Spaces:
Runtime error
Runtime error
liujch1998
commited on
Commit
β’
8b35b55
1
Parent(s):
b4e5034
WIP
Browse files
app.py
CHANGED
@@ -200,17 +200,17 @@ with gr.Blocks() as demo:
|
|
200 |
with gr.Row():
|
201 |
with gr.Column(scale=1):
|
202 |
do_save = gr.Checkbox(
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
statement = gr.Textbox(placeholder=
|
207 |
-
submit = gr.Button(
|
208 |
with gr.Column(scale=1):
|
209 |
output = gr.outputs.Label(num_top_classes=2)
|
210 |
-
output_raw = gr.
|
211 |
with gr.Row():
|
212 |
-
feedback_agree = gr.Button(
|
213 |
-
feedback_disagree = gr.Button(
|
214 |
with gr.Row():
|
215 |
gr.Examples(
|
216 |
examples=examples,
|
@@ -219,8 +219,8 @@ with gr.Blocks() as demo:
|
|
219 |
fn=predict,
|
220 |
outputs=[output, output_raw],
|
221 |
)
|
222 |
-
submit.click(predict, inputs=[statement, do_save], outputs=[output])
|
223 |
-
statement.submit(predict, inputs=[statement], outputs=[output])
|
224 |
feedback_agree.click(record_feedback_agree, inputs=[output_raw, do_save])
|
225 |
feedback_disagree.click(record_feedback_disagree, inputs=[output_raw, do_save])
|
226 |
|
|
|
200 |
with gr.Row():
|
201 |
with gr.Column(scale=1):
|
202 |
do_save = gr.Checkbox(
|
203 |
+
value=True,
|
204 |
+
label="Store data",
|
205 |
+
info="You agree to the storage of your input data for research and development purposes:")
|
206 |
+
statement = gr.Textbox(placeholder='Enter a commonsense statement here', label='Statement')
|
207 |
+
submit = gr.Button(value='Submit', variant='primary')
|
208 |
with gr.Column(scale=1):
|
209 |
output = gr.outputs.Label(num_top_classes=2)
|
210 |
+
output_raw = gr.JSON(visible=True)
|
211 |
with gr.Row():
|
212 |
+
feedback_agree = gr.Button(value='π Agree', variant='secondary')
|
213 |
+
feedback_disagree = gr.Button(value='π Disagree', variant='secondary')
|
214 |
with gr.Row():
|
215 |
gr.Examples(
|
216 |
examples=examples,
|
|
|
219 |
fn=predict,
|
220 |
outputs=[output, output_raw],
|
221 |
)
|
222 |
+
submit.click(predict, inputs=[statement, do_save], outputs=[output, output_raw])
|
223 |
+
# statement.submit(predict, inputs=[statement], outputs=[output, output_raw])
|
224 |
feedback_agree.click(record_feedback_agree, inputs=[output_raw, do_save])
|
225 |
feedback_disagree.click(record_feedback_disagree, inputs=[output_raw, do_save])
|
226 |
|