davidberenstein1957 commited on
Commit
81490b8
·
1 Parent(s): c5f8c61

Modify conversation submission flow in app.py

Browse files

- Adjust submit_conversation call to remove redundant outputs
- Add submit_conversation call after updating dataframe to ensure consistent conversation tracking

Files changed (1) hide show
  1. app/app.py +4 -2
app/app.py CHANGED
@@ -466,7 +466,10 @@ with gr.Blocks(css=css) as demo:
466
  outputs=[chatbot, chat_input],
467
  ).then(respond, inputs=[chatbot, language], outputs=[chatbot]).then(
468
  lambda: gr.Textbox(interactive=True), None, [chat_input]
469
- ).then(update_dataframe, inputs=[dataframe, chatbot], outputs=[dataframe])
 
 
 
470
 
471
  chatbot.like(
472
  fn=wrangle_like_data,
@@ -476,7 +479,6 @@ with gr.Blocks(css=css) as demo:
476
  ).then(
477
  submit_conversation,
478
  inputs=[dataframe, conversation_id, session_id, language],
479
- outputs=[dataframe, chatbot],
480
  )
481
 
482
  chatbot.retry(
 
466
  outputs=[chatbot, chat_input],
467
  ).then(respond, inputs=[chatbot, language], outputs=[chatbot]).then(
468
  lambda: gr.Textbox(interactive=True), None, [chat_input]
469
+ ).then(update_dataframe, inputs=[dataframe, chatbot], outputs=[dataframe]).then(
470
+ submit_conversation,
471
+ inputs=[dataframe, conversation_id, session_id, language],
472
+ )
473
 
474
  chatbot.like(
475
  fn=wrangle_like_data,
 
479
  ).then(
480
  submit_conversation,
481
  inputs=[dataframe, conversation_id, session_id, language],
 
482
  )
483
 
484
  chatbot.retry(