Spaces:
Sleeping
Sleeping
update gr.chatbot type=messages, commenting change_model_button
Browse files
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 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
|
| 542 |
-
|
| 543 |
-
|
| 544 |
|
| 545 |
-
change_model_button.click(
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 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):
|