model_demo / app.py
huynguyen208's picture
Update app.py
2c49f9f
raw
history blame
535 Bytes
import gradio as gr
from transformers import pipeline
model_checkpoint = "huynguyen208/fantastic4-finetuned-vi-to-en-PhoMT-demo"
translator = pipeline("translation", model=model_checkpoint)
def translate(Vietnamese):
return translator(Vietnamese)#[0]['translation_text']
iface = gr.Interface(fn=translate,
inputs=["text"],
outputs="text",
title = 'Translate Vietnamese to English',
description = 'Mini Translator')
iface.launch(inline = False)