antomtnez's picture
Update app.py
854a441 verified
raw
history blame
247 Bytes
import gradio as gr
def traductor(text):
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-es-en")
return pipe(text)[0]['translation-text']
demo = gr.Interface(fn=traductor, inputs="text", outputs="text")
demo.launch(share=True)