Ahsen Khaliq commited on
Commit
43f449a
·
1 Parent(s): 69f9761

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -1
app.py CHANGED
@@ -10,4 +10,27 @@ examples = [
10
  ["Paris is the capital of France"]
11
  ]
12
 
13
- gr.Interface.load("huggingface/microsoft/prophetnet-large-uncased", inputs=gr.inputs.Textbox(lines=5, label="Input Text"),title=title,description=description,article=article, examples=examples).launch(enable_queue=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ["Paris is the capital of France"]
11
  ]
12
 
13
+ io1 = gr.Interface.load("huggingface/microsoft/prophetnet-large-uncased")
14
+
15
+ io2 = gr.Interface.load("huggingface/microsoft/prophetnet-large-uncased-squad-qg")
16
+
17
+
18
+ def inference(text, model):
19
+ if model == "prophetnet-large-uncased":
20
+ outtext = io1(text)
21
+ else:
22
+ outtext = io2(text)
23
+ return outtext
24
+
25
+ gr.Interface(
26
+ inference,
27
+ [gr.inputs.Textbox(label="Input"),gr.inputs.Dropdown(choices=["prophetnet-large-uncased","prophetnet-large-uncased-squad-qg"], type="value", default="prophetnet-large-uncased", label="model")
28
+ ],
29
+ gr.outputs.Textbox(label="Output"),
30
+ examples=examples,
31
+ article=article,
32
+ title=title,
33
+ description=description).launch(enable_queue=True, cache_examples=True)
34
+
35
+
36
+