Spaces:
Runtime error
Runtime error
File size: 534 Bytes
76f5009 6b008ce 76f5009 ce42769 cf58dd3 76f5009 2c49f9f 76f5009 ce42769 76f5009 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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) |