SamiKoen commited on
Commit
92bdc2a
·
verified ·
1 Parent(s): 590a749

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -259,9 +259,10 @@ with gr.Blocks(css=demo_css, theme=theme) as demo:
259
  )
260
  with gr.Column(elem_classes="fixed_button_container"):
261
  send_button = gr.Button(value="Gönder", elem_id="send_button")
262
-
263
- state = gr.State([])
264
 
 
 
265
 
266
  with gr.Accordion("", open=False, visible=False):
267
  top_p = gr.Slider(minimum=0, maximum=1.0, value=0.5, step=0.05, interactive=False, visible=False)
@@ -271,7 +272,7 @@ with gr.Blocks(css=demo_css, theme=theme) as demo:
271
  inputs.submit(predict, [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter])
272
  inputs.submit(reset_textbox, [], [inputs])
273
  send_button.click(predict, [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter])
274
- send_button.click(save_chat_and_upload, [chatbot], reset_textbox, [], [inputs])
275
-
276
 
277
- demo.queue(max_size=10).launch(debug=True)
 
259
  )
260
  with gr.Column(elem_classes="fixed_button_container"):
261
  send_button = gr.Button(value="Gönder", elem_id="send_button")
262
+ save_button = gr.Button(value="Kayıt Et", elem_id="save_button")
 
263
 
264
+ state = gr.State([])
265
+ save_status = gr.Textbox(label="Kayıt Durumu", interactive=False)
266
 
267
  with gr.Accordion("", open=False, visible=False):
268
  top_p = gr.Slider(minimum=0, maximum=1.0, value=0.5, step=0.05, interactive=False, visible=False)
 
272
  inputs.submit(predict, [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter])
273
  inputs.submit(reset_textbox, [], [inputs])
274
  send_button.click(predict, [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter])
275
+ send_button.click(reset_textbox, [], [inputs])
276
+ save_button.click(save_chat_and_upload, [chatbot], [save_status])
277
 
278
+ demo.queue(max_size=10).launch(debug=True)