import gradio as gr from transformers import pipeline def traductor(prompt): pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es") frase_traducida=pipe(prompt) return frase_traducida[0]['translation_text'] demo = gr.Interface(fn=traductor, inputs="text", outputs="text") demo.launch()