Noxus09 commited on
Commit
3a6071b
·
verified ·
1 Parent(s): 2646298

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -1,3 +1,17 @@
1
  import gradio as gr
 
2
 
3
- gr.load("models/Noxus09/my_awesome_opus_books_model").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ # Load the text translation pipeline with the specified model
5
+ translator = pipeline("translation", model="models/Noxus09/my_awesome_opus_books_model")
6
+
7
+ # Define the Gradio interface
8
+ iface = gr.Interface(
9
+ fn=translator, # Function to call for translation
10
+ inputs=[gr.Textbox(lines=5, placeholder="Enter English text to translate")],
11
+ outputs="textbox",
12
+ title="English to French Translator",
13
+ description="Translates English text into French using a fine-tuned OPUS-MT model.",
14
+ )
15
+
16
+ # Launch the Gradio app
17
+ iface.launch()