Spaces:
Build error
Build error
Commit ·
a1ff158
1
Parent(s): fbe8175
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,24 +24,24 @@ m8 = gr.Interface.load("huggingface/amitjohn007/mpnet-finetuned")
|
|
| 24 |
|
| 25 |
def predict(model_choice,context,question):
|
| 26 |
if model_choice=="m1":
|
| 27 |
-
return model_performance_UQS(model_checkpoint=
|
| 28 |
elif model_choice==m2:
|
| 29 |
-
return model_performance_UQS(model_checkpoint=m2
|
| 30 |
elif model_choice=="m3":
|
| 31 |
-
return model_performance_UQS(model_checkpoint=m3
|
| 32 |
elif model_choice=="m4":
|
| 33 |
-
return model_performance_UQS(model_checkpoint=m4
|
| 34 |
elif model_choice=="m5":
|
| 35 |
-
return model_performance_UQS(model_checkpoint=m5
|
| 36 |
elif model_choice=="m6":
|
| 37 |
-
return model_performance_UQS(model_checkpoint=m6
|
| 38 |
elif model_choice=="m7":
|
| 39 |
-
return model_performance_UQS(model_checkpoint=m7
|
| 40 |
elif model_choice=="m8":
|
| 41 |
-
return model_performance_UQS(model_checkpoint=m8
|
| 42 |
|
| 43 |
Interface=gr.Interface(
|
| 44 |
fn = predict,
|
| 45 |
-
inputs = [gr.Dropdown(
|
| 46 |
outputs = [gr.outputs.Textbox(label="Answer"), gr.outputs.Textbox(label="Score")]
|
| 47 |
-
).launch()
|
|
|
|
| 24 |
|
| 25 |
def predict(model_choice,context,question):
|
| 26 |
if model_choice=="m1":
|
| 27 |
+
return model_performance_UQS(model_checkpoint="huggingface/amitjohn007/albert-finetuned-squad",context=context,question=question)
|
| 28 |
elif model_choice==m2:
|
| 29 |
+
return model_performance_UQS(model_checkpoint=m2,context=context,question=question)
|
| 30 |
elif model_choice=="m3":
|
| 31 |
+
return model_performance_UQS(model_checkpoint=m3,context=context,question=question)
|
| 32 |
elif model_choice=="m4":
|
| 33 |
+
return model_performance_UQS(model_checkpoint=m4,context=context,question=question)
|
| 34 |
elif model_choice=="m5":
|
| 35 |
+
return model_performance_UQS(model_checkpoint=m5,context=context,question=question)
|
| 36 |
elif model_choice=="m6":
|
| 37 |
+
return model_performance_UQS(model_checkpoint=m6,context=context,question=question)
|
| 38 |
elif model_choice=="m7":
|
| 39 |
+
return model_performance_UQS(model_checkpoint=m7,context=context,question=question)
|
| 40 |
elif model_choice=="m8":
|
| 41 |
+
return model_performance_UQS(model_checkpoint=m8,context=context,question=question)
|
| 42 |
|
| 43 |
Interface=gr.Interface(
|
| 44 |
fn = predict,
|
| 45 |
+
inputs = [gr.inputs.Dropdown(["m1","m2","m3","m4","m5","m6","m7","m8"],"value"),gr.inputs.Textbox(lines=7, default=context, label="Context Paragraph"), gr.inputs.Textbox(lines=2, default=question, label="Question")],
|
| 46 |
outputs = [gr.outputs.Textbox(label="Answer"), gr.outputs.Textbox(label="Score")]
|
| 47 |
+
).launch(debug=True)
|