Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -63,7 +63,8 @@ def chatbot(user_input, history, model_choice):
|
|
63 |
split_res = response.split("<|assistant|>")
|
64 |
final_response = split_res[-1].strip() if len(split_res) > 1 else response
|
65 |
|
66 |
-
history.append(
|
|
|
67 |
return "", history
|
68 |
|
69 |
with gr.Blocks() as demo:
|
@@ -72,7 +73,7 @@ with gr.Blocks() as demo:
|
|
72 |
with gr.Row():
|
73 |
model_choice = gr.Dropdown(label="Select Model", choices=premium_models, value=premium_models[0])
|
74 |
|
75 |
-
chatbot_ui = gr.Chatbot()
|
76 |
user_input = gr.Textbox(show_label=False, placeholder="Type your message and press Enter")
|
77 |
clear_btn = gr.Button("Clear")
|
78 |
|
|
|
63 |
split_res = response.split("<|assistant|>")
|
64 |
final_response = split_res[-1].strip() if len(split_res) > 1 else response
|
65 |
|
66 |
+
history.append({"role": "user", "content": user_input})
|
67 |
+
history.append({"role": "assistant", "content": final_response})
|
68 |
return "", history
|
69 |
|
70 |
with gr.Blocks() as demo:
|
|
|
73 |
with gr.Row():
|
74 |
model_choice = gr.Dropdown(label="Select Model", choices=premium_models, value=premium_models[0])
|
75 |
|
76 |
+
chatbot_ui = gr.Chatbot(type="messages")
|
77 |
user_input = gr.Textbox(show_label=False, placeholder="Type your message and press Enter")
|
78 |
clear_btn = gr.Button("Clear")
|
79 |
|