liujch1998 commited on
Commit
8b35b55
β€’
1 Parent(s): b4e5034
Files changed (1) hide show
  1. app.py +10 -10
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
- value=True,
204
- label="Store data",
205
- info="You agree to the storage of your prompt and generated text for research and development purposes:")
206
- statement = gr.Textbox(placeholder="Enter a commonsense statement here", label="statement", elem_id="q-input")
207
- submit = gr.Button(label='Submit', variant='primary')
208
  with gr.Column(scale=1):
209
  output = gr.outputs.Label(num_top_classes=2)
210
- output_raw = gr.outputs.JSON()
211
  with gr.Row():
212
- feedback_agree = gr.Button(label='πŸ‘ Agree', variant='primary')
213
- feedback_disagree = gr.Button(label='πŸ‘Ž Disagree', variant='primary')
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