Pablo Ojea Lopez
Prueba_01
5529ce7
raw
history blame
375 Bytes
import gradio as gr
from transformers import pipeline
# sample_text = "Lolo is singing in the rain!!"
def translate(name):
trans = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es", tokenizer="Helsinki-NLP/opus-mt-en-es")
return trans(name)
# print (translate(sample_text))
demo = gr.Interface(fn=translate, inputs="text", outputs="text")
demo.launch()