willco-afk commited on
Commit
eb59b63
·
verified ·
1 Parent(s): d6ba4b7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Define the model path in Hugging Face
5
+ model_name = "willco-afk/languages" # Ensure this is correct for your uploaded model
6
+ translator = pipeline("translation", model=model_name)
7
+
8
+ def translate(input_text):
9
+ return translator(input_text)[0]['translation_text']
10
+
11
+ # Define Gradio Interface
12
+ iface = gr.Interface(fn=translate, inputs="text", outputs="text", live=True)
13
+
14
+ iface.launch()