Spaces:
Runtime error
Runtime error
liujch1998
commited on
Commit
Β·
b206d70
1
Parent(s):
bc61899
Debug
Browse files
app.py
CHANGED
@@ -144,9 +144,7 @@ interactive = Interactive()
|
|
144 |
# return record_feedback(output_raw, 'disagree', do_save)
|
145 |
|
146 |
def predict(statements, do_saves):
|
147 |
-
|
148 |
-
print(list(statements))
|
149 |
-
output_raws = interactive.runs(list(statements))
|
150 |
outputs = [{
|
151 |
'True': output_raw['score_calibrated'],
|
152 |
'False': 1 - output_raw['score_calibrated'],
|
@@ -283,7 +281,7 @@ with gr.Blocks() as demo:
|
|
283 |
value=True,
|
284 |
label="Store data",
|
285 |
info="You agree to the storage of your input data for research and development purposes:")
|
286 |
-
statement = gr.Textbox(placeholder='Enter a commonsense statement here', label='Statement', interactive=True)
|
287 |
submit = gr.Button(value='Submit', variant='primary', visible=True)
|
288 |
with gr.Column(scale=1):
|
289 |
output = gr.Label(num_top_classes=2, interactive=False)
|
@@ -307,7 +305,7 @@ with gr.Blocks() as demo:
|
|
307 |
feedback_agree.click(record_feedback_agree, inputs=[output_raw, do_save], outputs=[submit, feedback_agree, feedback_disagree, feedback_ack], batch=True, max_batch_size=16)
|
308 |
feedback_disagree.click(record_feedback_disagree, inputs=[output_raw, do_save], outputs=[submit, feedback_agree, feedback_disagree, feedback_ack], batch=True, max_batch_size=16)
|
309 |
|
310 |
-
demo.queue(concurrency_count=
|
311 |
|
312 |
# Concurrency, Batching
|
313 |
# Theme, CSS
|
|
|
144 |
# return record_feedback(output_raw, 'disagree', do_save)
|
145 |
|
146 |
def predict(statements, do_saves):
|
147 |
+
output_raws = interactive.runs(list(statements)) # statements is a tuple, but tokenizer takes a list
|
|
|
|
|
148 |
outputs = [{
|
149 |
'True': output_raw['score_calibrated'],
|
150 |
'False': 1 - output_raw['score_calibrated'],
|
|
|
281 |
value=True,
|
282 |
label="Store data",
|
283 |
info="You agree to the storage of your input data for research and development purposes:")
|
284 |
+
statement = gr.Textbox(placeholder='Enter a commonsense statement here, or select an example from below', label='Statement', interactive=True)
|
285 |
submit = gr.Button(value='Submit', variant='primary', visible=True)
|
286 |
with gr.Column(scale=1):
|
287 |
output = gr.Label(num_top_classes=2, interactive=False)
|
|
|
305 |
feedback_agree.click(record_feedback_agree, inputs=[output_raw, do_save], outputs=[submit, feedback_agree, feedback_disagree, feedback_ack], batch=True, max_batch_size=16)
|
306 |
feedback_disagree.click(record_feedback_disagree, inputs=[output_raw, do_save], outputs=[submit, feedback_agree, feedback_disagree, feedback_ack], batch=True, max_batch_size=16)
|
307 |
|
308 |
+
demo.queue(concurrency_count=1).launch(debug=True)
|
309 |
|
310 |
# Concurrency, Batching
|
311 |
# Theme, CSS
|