dappyx commited on
Commit
61253c2
1 Parent(s): 6e78665

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -55,19 +55,12 @@ with gr.Blocks() as iface:
55
  real_answer = gr.Textbox(lines=2, label="Real Answer")
56
  with gr.Column():
57
  predicted_answer = gr.Textbox(lines=2, label="Predicted Answer")
58
- with gr.Row():
59
- generate_button = gr.Button("Get Random Example")
60
- update_button = gr.Button("Update Answer")
61
 
62
  def update_example():
63
  context_val, question_val, real_answer_val, predicted_answer_val = get_random_example()
64
  return context_val, question_val, real_answer_val, predicted_answer_val
65
 
66
- def update_answer(context, question):
67
- predicted_answer = answer_question(context, question)
68
- return predicted_answer
69
-
70
  generate_button.click(update_example, outputs=[context, question, real_answer, predicted_answer])
71
- update_button.click(update_answer, inputs=[context, question], outputs=[predicted_answer])
72
 
73
- iface.launch()
 
55
  real_answer = gr.Textbox(lines=2, label="Real Answer")
56
  with gr.Column():
57
  predicted_answer = gr.Textbox(lines=2, label="Predicted Answer")
58
+ generate_button = gr.Button("Get Random Example")
 
 
59
 
60
  def update_example():
61
  context_val, question_val, real_answer_val, predicted_answer_val = get_random_example()
62
  return context_val, question_val, real_answer_val, predicted_answer_val
63
 
 
 
 
 
64
  generate_button.click(update_example, outputs=[context, question, real_answer, predicted_answer])
 
65
 
66
+ iface.launch()