ONEROCKS commited on
Commit
e16459e
·
verified ·
1 Parent(s): e4e3ab8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -731,7 +731,7 @@ def create_chatbot():
731
  with gr.Tab("Chat History"):
732
  gr.Markdown("## Chat History Viewer and Resume")
733
 
734
- history_dropdown = gr.Dropdown(choices=list_chat_sessions, label="Select a session") # Dynamic list
735
  load_button = gr.Button("Load Chat")
736
  history_chatbot = gr.Chatbot(type="messages", label="Loaded Chat")
737
  resume_button = gr.Button("Resume in Chatbot")
@@ -747,7 +747,7 @@ def create_chatbot():
747
 
748
  load_button.click(fn=load_selected_history, inputs=history_dropdown, outputs=[history_chatbot, state])
749
  resume_button.click(fn=lambda history: (format_history_for_gradio(history), history), inputs=[state], outputs=[chatbot, state])
750
- refresh_button.click(fn=refresh_dropdown, inputs=[], outputs=history_dropdown)
751
 
752
  return demo
753
 
 
731
  with gr.Tab("Chat History"):
732
  gr.Markdown("## Chat History Viewer and Resume")
733
 
734
+ history_dropdown = gr.Dropdown(choices=list_chat_sessions(), label="Select a session")
735
  load_button = gr.Button("Load Chat")
736
  history_chatbot = gr.Chatbot(type="messages", label="Loaded Chat")
737
  resume_button = gr.Button("Resume in Chatbot")
 
747
 
748
  load_button.click(fn=load_selected_history, inputs=history_dropdown, outputs=[history_chatbot, state])
749
  resume_button.click(fn=lambda history: (format_history_for_gradio(history), history), inputs=[state], outputs=[chatbot, state])
750
+ refresh_button.click(fn=lambda: gr.update(choices=list_chat_sessions()), inputs=[], outputs=history_dropdown)
751
 
752
  return demo
753