Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
•
48c5223
1
Parent(s):
2a52e27
Update app.py
Browse files
app.py
CHANGED
@@ -14,17 +14,22 @@ 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 |
-
|
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,
|
|
|
14 |
|
15 |
io2 = gr.Interface.load("huggingface/microsoft/prophetnet-large-uncased-squad-qg")
|
16 |
|
17 |
+
io3 = gr.Interface.load("huggingface/microsoft/prophetnet-large-uncased-cnndm")
|
18 |
+
|
19 |
+
|
20 |
|
21 |
def inference(text, model):
|
22 |
if model == "prophetnet-large-uncased":
|
23 |
outtext = io1(text)
|
24 |
+
elif model == "prophetnet-large-uncased-squad-qg":
|
25 |
outtext = io2(text)
|
26 |
+
else:
|
27 |
+
outtext = io3(text)
|
28 |
return outtext
|
29 |
|
30 |
gr.Interface(
|
31 |
inference,
|
32 |
+
[gr.inputs.Textbox(label="Input"),gr.inputs.Dropdown(choices=["prophetnet-large-uncased","prophetnet-large-uncased-squad-qg","prophetnet-large-uncased-cnndm"], type="value", default="prophetnet-large-uncased", label="model")
|
33 |
],
|
34 |
gr.outputs.Textbox(label="Output"),
|
35 |
examples=examples,
|