from transformers import pipeline import gradio as gr pipe = pipeline("text2text-generation", model="long292/bartpho-word") def translate_HV(from_text): results = translation_pipeline(from_text) return results[0]['generated_text'] interface = gr.Interface(fn = translate_HV, inputs=gr.inputs.Textbox(lines=2, placeholder='Text to translate'), outputs = 'text') interface.launch()