luofeim commited on
Commit
86ac295
·
1 Parent(s): 42a63cb

with gradio load fun

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -6,9 +6,16 @@ import gradio as gr
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()
 
6
  #iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  #iface.launch()
8
 
 
9
 
 
10
 
11
+ #from transformers import pipeline
12
+
13
+ #pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
14
+
15
+ #demo = gr.Interface.from_pipeline(pipe)
16
+ #demo.launch()
17
+
18
+
19
+ demo = gr.load("Helsinki-NLP/opus-mt-en-es", src="models")
20
+
21
  demo.launch()