Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,4 +10,23 @@ examples = [
|
|
10 |
["Hello, is my dog cute ?"]
|
11 |
]
|
12 |
|
13 |
-
gr.Interface.load("huggingface/voidful/dpr-question_encoder-bert-base-multilingual"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
["Hello, is my dog cute ?"]
|
11 |
]
|
12 |
|
13 |
+
io1 = gr.Interface.load("huggingface/voidful/dpr-question_encoder-bert-base-multilingual")
|
14 |
+
|
15 |
+
io2 = gr.Interface.load("huggingface/sivasankalpp/dpr-multidoc2dial-structure-question-encoder")
|
16 |
+
|
17 |
+
def inference(inputtext, model):
|
18 |
+
if model == "dpr-question_encoder-bert-base-multilingual":
|
19 |
+
outlabel = io1(inputtext)
|
20 |
+
else:
|
21 |
+
outlabel = io2(inputtext)
|
22 |
+
return outlabel
|
23 |
+
|
24 |
+
|
25 |
+
gr.Interface(
|
26 |
+
inference,
|
27 |
+
[gr.inputs.Textbox(label="Context",lines=10),gr.inputs.Dropdown(choices=["dpr-question_encoder-bert-base-multilingual","dpr-multidoc2dial-structure-question-encoder"], type="value", default="dpr-question_encoder-bert-base-multilingual", label="model")],
|
28 |
+
[gr.outputs.Dataframe(label="Output")],
|
29 |
+
examples=examples,
|
30 |
+
article=article,
|
31 |
+
title=title,
|
32 |
+
description=description).launch(enable_queue=True,cache_examples=True)
|