Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
# Load the text translation pipeline with the specified model | |
translator = pipeline("translation", model="Noxus09/my_awesome_opus_books_model") | |
# Define the Gradio interface | |
iface = gr.Interface( | |
fn=translator, # Function to call for translation | |
inputs=[gr.Textbox(lines=5, placeholder="Enter English text to translate")], | |
outputs="textbox", | |
title="English to French Translator", | |
description="Translates English text into French using a fine-tuned google-t5 model.", | |
) | |
# Launch the Gradio app | |
iface.launch() | |