Update app.py
Browse files
app.py
CHANGED
|
@@ -68,13 +68,22 @@ with gr.Blocks() as demo:
|
|
| 68 |
["The dog is barking at the mailman", "There is a cat"]
|
| 69 |
]
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
def update_examples(mode_value):
|
| 72 |
return gr.Examples(
|
| 73 |
-
zero_shot_examples if mode_value == "Zero-Shot Classification" else nli_examples,
|
| 74 |
inputs=[text_input, labels_or_premise]
|
| 75 |
-
)
|
| 76 |
|
| 77 |
-
mode.change(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
submit_btn.click(
|
| 80 |
fn=process_input,
|
|
|
|
| 68 |
["The dog is barking at the mailman", "There is a cat"]
|
| 69 |
]
|
| 70 |
|
| 71 |
+
examples = gr.Examples(
|
| 72 |
+
examples=zero_shot_examples,
|
| 73 |
+
inputs=[text_input, labels_or_premise]
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
def update_examples(mode_value):
|
| 77 |
return gr.Examples(
|
| 78 |
+
examples=zero_shot_examples if mode_value == "Zero-Shot Classification" else nli_examples,
|
| 79 |
inputs=[text_input, labels_or_premise]
|
| 80 |
+
).update()
|
| 81 |
|
| 82 |
+
mode.change(
|
| 83 |
+
fn=update_examples,
|
| 84 |
+
inputs=[mode],
|
| 85 |
+
outputs=[examples]
|
| 86 |
+
)
|
| 87 |
|
| 88 |
submit_btn.click(
|
| 89 |
fn=process_input,
|