Update chat_app.py
Browse files- chat_app.py +3 -3
chat_app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import random
|
| 3 |
import time
|
| 4 |
|
| 5 |
-
def respond(message, chat_history):
|
| 6 |
user_input = message.lower()
|
| 7 |
|
| 8 |
# Topic-based responses
|
|
@@ -33,9 +33,9 @@ def launch_chat_app():
|
|
| 33 |
chatbot = gr.Chatbot()
|
| 34 |
msg = gr.Textbox("Write your input here")
|
| 35 |
submit_button = gr.Button("Submit")
|
| 36 |
-
chat_history_slider = gr.Slider(maximum=10,
|
| 37 |
|
| 38 |
-
submit_button.click(respond, [msg, chatbot])
|
| 39 |
|
| 40 |
demo.launch()
|
| 41 |
|
|
|
|
| 2 |
import random
|
| 3 |
import time
|
| 4 |
|
| 5 |
+
def respond(message, chat_history, chat_history_slider):
|
| 6 |
user_input = message.lower()
|
| 7 |
|
| 8 |
# Topic-based responses
|
|
|
|
| 33 |
chatbot = gr.Chatbot()
|
| 34 |
msg = gr.Textbox("Write your input here")
|
| 35 |
submit_button = gr.Button("Submit")
|
| 36 |
+
chat_history_slider = gr.Slider(minimum=1, maximum=10, value=5, label="Chat History Length")
|
| 37 |
|
| 38 |
+
submit_button.click(respond, [msg, chatbot, chat_history_slider])
|
| 39 |
|
| 40 |
demo.launch()
|
| 41 |
|