luofeim commited on
Commit
42a63cb
·
1 Parent(s): 50ee719
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -1,7 +1,14 @@
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
  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()
8
+
9
+ from transformers import pipeline
10
+
11
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
12
+
13
+ demo = gr.Interface.from_pipeline(pipe)
14
+ demo.launch()