translation_app / app.py
long292's picture
Update app.py
9e4ab2e verified
raw
history blame
409 Bytes
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()