Spaces:
Runtime error
Runtime error
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() |