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)