DeepLearning101 commited on
Commit
db09be3
·
verified ·
1 Parent(s): e47ffb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -209,14 +209,14 @@ with gr.Blocks(css=custom_css) as iface:
209
  with gr.Row():
210
  chatbot = gr.Chatbot(elem_id="chatbot")
211
 
 
 
212
  with gr.Row():
213
  user_input = gr.Textbox(label='輸入您的問題', placeholder="在此輸入問題...", elem_id="user_input")
214
  submit_button = gr.Button("問題輸入好,請點我送出", elem_id="submit_button")
215
-
216
- gr.Examples(examples=examples, inputs=user_input)
217
-
218
  with gr.Row():
219
- like_button = gr.Button("👍 覺得答案很棒,請按我;或者直接繼續問新問題亦可", elem_id="like_button")
220
  dislike_button = gr.Button("👎 覺得答案待改善,請輸入改進建議,再按我送出保存", elem_id="dislike_button")
221
  improvement_input = gr.Textbox(label='請輸入改進建議', placeholder='請輸入如何改進模型回應的建議', elem_id="improvement_input")
222
 
@@ -233,11 +233,11 @@ with gr.Blocks(css=custom_css) as iface:
233
 
234
  submit_button.click(fn=chat, inputs=[user_input, chatbot], outputs=[chatbot, chatbot])
235
 
236
- like_button.click(
237
- fn=lambda response, improvement: handle_feedback(response, "like", improvement),
238
- inputs=[chatbot, improvement_input],
239
- outputs=feedback_output
240
- )
241
 
242
  dislike_button.click(
243
  fn=lambda response, improvement: handle_feedback(response, "dislike", improvement),
 
209
  with gr.Row():
210
  chatbot = gr.Chatbot(elem_id="chatbot")
211
 
212
+ gr.Examples(examples=examples, inputs=user_input)
213
+
214
  with gr.Row():
215
  user_input = gr.Textbox(label='輸入您的問題', placeholder="在此輸入問題...", elem_id="user_input")
216
  submit_button = gr.Button("問題輸入好,請點我送出", elem_id="submit_button")
217
+
 
 
218
  with gr.Row():
219
+ # like_button = gr.Button("👍 覺得答案很棒,請按我;或者直接繼續問新問題亦可", elem_id="like_button")
220
  dislike_button = gr.Button("👎 覺得答案待改善,請輸入改進建議,再按我送出保存", elem_id="dislike_button")
221
  improvement_input = gr.Textbox(label='請輸入改進建議', placeholder='請輸入如何改進模型回應的建議', elem_id="improvement_input")
222
 
 
233
 
234
  submit_button.click(fn=chat, inputs=[user_input, chatbot], outputs=[chatbot, chatbot])
235
 
236
+ # like_button.click(
237
+ # fn=lambda response, improvement: handle_feedback(response, "like", improvement),
238
+ # inputs=[chatbot, improvement_input],
239
+ # outputs=feedback_output
240
+ # )
241
 
242
  dislike_button.click(
243
  fn=lambda response, improvement: handle_feedback(response, "dislike", improvement),