RogerB's picture
Update app.py
95afe98
raw
history blame contribute delete
567 Bytes
from transformers import pipeline
import gradio as gr
model_checkpoint = "RogerB/x-marian-finetuned-multidataset-kin-to-en"
fine_tuned_model = pipeline("translation", model=model_checkpoint)
def translate_transformers(from_text):
results = fine_tuned_model(from_text)
return results[0]['translation_text']
interface = gr.Interface(fn=translate_transformers,
inputs=gr.Textbox(placeholder='Kinyarwanda Text to translate'),
outputs='text',title="Kinyarwanda to English Translation")
interface.launch(debug=True)