File size: 586 Bytes
477729c
3a6071b
477729c
3a6071b
b73303f
3a6071b
 
 
 
 
 
 
33af22f
3a6071b
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()