Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,8 +44,9 @@ def chatbot(input_text, history, model_choice, system_message, max_new_tokens, t
|
|
| 44 |
except Exception as e:
|
| 45 |
assistant_response = f"Error: {str(e)}"
|
| 46 |
|
| 47 |
-
|
| 48 |
-
history.append(
|
|
|
|
| 49 |
return history, history, ""
|
| 50 |
|
| 51 |
# --- Gradio Interface ---
|
|
@@ -61,7 +62,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="DeepSeek Chatbot") as demo:
|
|
| 61 |
|
| 62 |
with gr.Row():
|
| 63 |
with gr.Column():
|
| 64 |
-
chatbot_output = gr.Chatbot(label="DeepSeek Chatbot", height=500
|
| 65 |
msg = gr.Textbox(label="Your Message", placeholder="Type your message here...")
|
| 66 |
with gr.Row():
|
| 67 |
submit_btn = gr.Button("Submit", variant="primary")
|
|
@@ -105,4 +106,4 @@ with gr.Blocks(theme=gr.themes.Soft(), title="DeepSeek Chatbot") as demo:
|
|
| 105 |
)
|
| 106 |
|
| 107 |
if __name__ == "__main__":
|
| 108 |
-
demo.launch()
|
|
|
|
| 44 |
except Exception as e:
|
| 45 |
assistant_response = f"Error: {str(e)}"
|
| 46 |
|
| 47 |
+
# Append user and assistant messages to history
|
| 48 |
+
history.append((input_text, assistant_response))
|
| 49 |
+
|
| 50 |
return history, history, ""
|
| 51 |
|
| 52 |
# --- Gradio Interface ---
|
|
|
|
| 62 |
|
| 63 |
with gr.Row():
|
| 64 |
with gr.Column():
|
| 65 |
+
chatbot_output = gr.Chatbot(label="DeepSeek Chatbot", height=500)
|
| 66 |
msg = gr.Textbox(label="Your Message", placeholder="Type your message here...")
|
| 67 |
with gr.Row():
|
| 68 |
submit_btn = gr.Button("Submit", variant="primary")
|
|
|
|
| 106 |
)
|
| 107 |
|
| 108 |
if __name__ == "__main__":
|
| 109 |
+
demo.launch()
|