Spaces:
Build error
Build error
greet button
Browse files
app.py
CHANGED
|
@@ -19,4 +19,16 @@ def zs(premise,hypothesis):
|
|
| 19 |
entail_prob = round(probs[:,2].item() * 100,2)
|
| 20 |
return contra_prob, neut_prob, entail_prob
|
| 21 |
|
| 22 |
-
gr.Interface(fn=zs, inputs=["text", "text"], outputs="text").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
entail_prob = round(probs[:,2].item() * 100,2)
|
| 20 |
return contra_prob, neut_prob, entail_prob
|
| 21 |
|
| 22 |
+
# gr.Interface(fn=zs, inputs=["text", "text"], outputs=["text","text","text"]).launch()
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
with gr.Blocks() as demo:
|
| 26 |
+
premise = gr.Textbox(label="Premise")
|
| 27 |
+
hypothesis = gr.Textbox(label="Hypothesis")
|
| 28 |
+
entailment = gr.Textbox(label="Entailment Probability")
|
| 29 |
+
contradiction = gr.Textbox(label="Contradiction Probability")
|
| 30 |
+
neutral = gr.Textbox(label="Neutral Probability")
|
| 31 |
+
greet_btn = gr.Button("Compute")
|
| 32 |
+
greet_btn.click(fn=zs, inputs=[premise,hypothesis], outputs=[contradiction,neutral,entailment])
|
| 33 |
+
|
| 34 |
+
demo.launch()
|