1101411 commited on
Commit
a203b52
·
1 Parent(s): 3ea0b85
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -1,7 +1,11 @@
1
- import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as grad
3
 
4
+ model_name = "facebook/nllb-200-3.3B"
5
+ opus_translator = pipeline("translation", model=model_name)
6
 
7
+ def translate(text):
8
+ response = opus_translator(text)
9
+ return response
10
+
11
+ grad.Interface(translate, inputs=["text"], outputs=["text"]).launch()