liujch1998 commited on
Commit
6c09b42
Β·
1 Parent(s): f8a5c23
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -107,9 +107,9 @@ def record_feedback(output_raw, feedback, do_save=True):
107
  print()
108
  return gr.update(interactive=True), gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(visible=True)
109
  def record_feedback_agree(output_raw, do_save=True):
110
- record_feedback(output_raw, 'agree', do_save)
111
  def record_feedback_disagree(output_raw, do_save=True):
112
- record_feedback(output_raw, 'disagree', do_save)
113
 
114
  examples = [
115
  # openbookqa
@@ -208,7 +208,7 @@ with gr.Blocks() as demo:
208
  submit = gr.Button(value='Submit', variant='primary', visible=True)
209
  with gr.Column(scale=1):
210
  output = gr.Label(num_top_classes=2, interactive=False)
211
- output_raw = gr.JSON(visible=True)
212
  with gr.Row():
213
  feedback_agree = gr.Button(value='πŸ‘ Agree', variant='secondary', visible=False)
214
  feedback_disagree = gr.Button(value='πŸ‘Ž Disagree', variant='secondary', visible=False)
 
107
  print()
108
  return gr.update(interactive=True), gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(visible=True)
109
  def record_feedback_agree(output_raw, do_save=True):
110
+ return record_feedback(output_raw, 'agree', do_save)
111
  def record_feedback_disagree(output_raw, do_save=True):
112
+ return record_feedback(output_raw, 'disagree', do_save)
113
 
114
  examples = [
115
  # openbookqa
 
208
  submit = gr.Button(value='Submit', variant='primary', visible=True)
209
  with gr.Column(scale=1):
210
  output = gr.Label(num_top_classes=2, interactive=False)
211
+ output_raw = gr.JSON(visible=False)
212
  with gr.Row():
213
  feedback_agree = gr.Button(value='πŸ‘ Agree', variant='secondary', visible=False)
214
  feedback_disagree = gr.Button(value='πŸ‘Ž Disagree', variant='secondary', visible=False)