Spaces:
Runtime error
Runtime error
Commit
·
0f32c86
1
Parent(s):
c3dae60
Update app.py
Browse files
app.py
CHANGED
@@ -88,7 +88,7 @@ def final_qa_pipeline(file, query, model_nm):
|
|
88 |
|
89 |
qa_model = pipeline("question-answering",
|
90 |
#model = "deepset/minilm-uncased-squad2")
|
91 |
-
model = "deepset/"+ str(model_nm
|
92 |
|
93 |
if len(lvl1) > 0:
|
94 |
fnl_rank = qa_ranker(query, [l["docs"] for l in lvl1], top_k_ranker)
|
@@ -115,7 +115,7 @@ examples = [
|
|
115 |
|
116 |
iface = gr.Interface(
|
117 |
fn = final_qa_pipeline,
|
118 |
-
inputs = [gr.inputs.File(label="input pdf file"), gr.inputs.Textbox(label="Question:"), gr.inputs.Dropdown(["minilm-uncased-squad2","roberta-base-squad2"], "minilm-uncased-squad2", label="Model")],
|
119 |
outputs = [gr.outputs.HTML(label="Top 1 answer"), gr.outputs.HTML(label="Top 2 answer")],
|
120 |
examples=examples,
|
121 |
theme = "grass",
|
|
|
88 |
|
89 |
qa_model = pipeline("question-answering",
|
90 |
#model = "deepset/minilm-uncased-squad2")
|
91 |
+
model = "deepset/"+ str(model_nm))
|
92 |
|
93 |
if len(lvl1) > 0:
|
94 |
fnl_rank = qa_ranker(query, [l["docs"] for l in lvl1], top_k_ranker)
|
|
|
115 |
|
116 |
iface = gr.Interface(
|
117 |
fn = final_qa_pipeline,
|
118 |
+
inputs = [gr.inputs.File(label="input pdf file"), gr.inputs.Textbox(label="Question:"), gr.inputs.Dropdown(choices=["minilm-uncased-squad2","roberta-base-squad2"], value="minilm-uncased-squad2", label="Model")],
|
119 |
outputs = [gr.outputs.HTML(label="Top 1 answer"), gr.outputs.HTML(label="Top 2 answer")],
|
120 |
examples=examples,
|
121 |
theme = "grass",
|