hmrizal commited on
Commit
155810d
·
verified ·
1 Parent(s): c0c85ff

update gr.chatbot type=messages, commenting change_model_button

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -483,6 +483,7 @@ def create_gradio_interface():
483
  with gr.Column(scale=2):
484
  chatbot_interface = gr.Chatbot(
485
  label="Riwayat Chat",
 
486
  height=400
487
  )
488
  message_input = gr.Textbox(
@@ -534,19 +535,19 @@ def create_gradio_interface():
534
  )
535
 
536
  # Change model handler
537
- def handle_model_change(model_key, chatbot, sess_id):
538
- if chatbot is None:
539
- chatbot = ChatBot(sess_id, model_key)
540
- return chatbot, [(None, f"Model diatur ke {model_key}. Silakan upload file CSV.")]
541
 
542
- result = chatbot.change_model(model_key)
543
- return chatbot, chatbot.chat_history + [(None, result)]
544
 
545
- change_model_button.click(
546
- fn=handle_model_change,
547
- inputs=[model_dropdown, chatbot_state, session_id],
548
- outputs=[chatbot_state, chatbot_interface]
549
- )
550
 
551
  # Chat handlers
552
  def user_message_submitted(message, history, chatbot, sess_id):
 
483
  with gr.Column(scale=2):
484
  chatbot_interface = gr.Chatbot(
485
  label="Riwayat Chat",
486
+ type="messages",
487
  height=400
488
  )
489
  message_input = gr.Textbox(
 
535
  )
536
 
537
  # Change model handler
538
+ # def handle_model_change(model_key, chatbot, sess_id):
539
+ # if chatbot is None:
540
+ # chatbot = ChatBot(sess_id, model_key)
541
+ # return chatbot, [(None, f"Model diatur ke {model_key}. Silakan upload file CSV.")]
542
 
543
+ # result = chatbot.change_model(model_key)
544
+ # return chatbot, chatbot.chat_history + [(None, result)]
545
 
546
+ # change_model_button.click(
547
+ # fn=handle_model_change,
548
+ # inputs=[model_dropdown, chatbot_state, session_id],
549
+ # outputs=[chatbot_state, chatbot_interface]
550
+ # )
551
 
552
  # Chat handlers
553
  def user_message_submitted(message, history, chatbot, sess_id):