Darwinkel commited on
Commit
2e5d958
·
verified ·
1 Parent(s): 9ab0e5d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -6
app.py CHANGED
@@ -61,7 +61,7 @@ support_gr = gr.TextArea(
61
  value="Bananas are yellow and curved."
62
  )
63
 
64
- answer_gr = gr.TextArea(
65
  label="Answer optional",
66
  info="Make sure you use proper punctuation.",
67
  value="yellow"
@@ -69,16 +69,38 @@ answer_gr = gr.TextArea(
69
 
70
  button = gr.Button("Generate", elem_id="send-btn", visible=True)
71
 
72
- output_gr = gr.TextArea(
73
- label="Output",
74
- info="Make sure you use proper punctuation.",
75
- value=""
 
 
 
 
 
 
 
76
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
  gr.Interface(
79
  fn=predict,
80
  inputs=[support_gr, answer_gr],
81
- outputs=[output_gr],
82
  title=title,
83
  description=description,
84
  article=article,
 
61
  value="Bananas are yellow and curved."
62
  )
63
 
64
+ answer_gr = gr.Text(
65
  label="Answer optional",
66
  info="Make sure you use proper punctuation.",
67
  value="yellow"
 
69
 
70
  button = gr.Button("Generate", elem_id="send-btn", visible=True)
71
 
72
+ context_output_gr = gr.Text(
73
+ label="Output"
74
+ )
75
+ answer_output_gr = gr.Text(
76
+ label="Output"
77
+ )
78
+ question_output_gr = gr.Text(
79
+ label="Output"
80
+ )
81
+ distractor1_output_gr = gr.Text(
82
+ label="Output"
83
  )
84
+ distractor2_output_gr = gr.Text(
85
+ label="Output"
86
+ )
87
+ distractor3_output_gr = gr.Text(
88
+ label="Output"
89
+ )
90
+
91
+ button.click(
92
+ predict,
93
+ [
94
+ support_gr,
95
+ answer_gr,
96
+ ],
97
+ outputs=[context_output_gr, answer_output_gr, question_output_gr, distractor1_output_gr, distractor2_output_gr, distractor3_output_gr],
98
+ )
99
 
100
  gr.Interface(
101
  fn=predict,
102
  inputs=[support_gr, answer_gr],
103
+ outputs=[context_output_gr, answer_output_gr, question_output_gr, distractor1_output_gr, distractor2_output_gr, distractor3_output_gr],
104
  title=title,
105
  description=description,
106
  article=article,