Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from transformers import pipeline | |
| # Load your translation pipeline | |
| translator = pipeline("translation", model="Sephdude/en-esPR") | |
| def translate_text(text): | |
| result = translator(text) | |
| return result[0]["translation_text"] | |
| demo = gr.Interface( | |
| fn=translate_text, | |
| inputs=gr.Textbox(label="Input Text"), | |
| outputs=gr.Textbox(label="Translated Text"), | |
| title="en-esPR", | |
| description="Enter text..." | |
| ) | |
| demo.launch() | |