Spaces:
Sleeping
Sleeping
Fixed conversation state error
Browse files
app.py
CHANGED
|
@@ -106,6 +106,8 @@ with gr.Blocks(theme = theme, css = custom_css) as demo:
|
|
| 106 |
|
| 107 |
custom_country_input = gr.Textbox(label="Enter Country (if not listed)", visible=False)
|
| 108 |
|
|
|
|
|
|
|
| 109 |
chatbot = gr.Chatbot(label="💬 Chat History", type="messages")
|
| 110 |
chatbot.clear(fn=clear_history, outputs=conversation_state)
|
| 111 |
|
|
@@ -149,8 +151,6 @@ with gr.Blocks(theme = theme, css = custom_css) as demo:
|
|
| 149 |
|
| 150 |
country_input.change(lambda c: gr.update(visible=c == "Other"), inputs=country_input, outputs=custom_country_input)
|
| 151 |
|
| 152 |
-
conversation_state = gr.State([])
|
| 153 |
-
|
| 154 |
submit_btn.click(
|
| 155 |
submit,
|
| 156 |
inputs=[country_input, custom_country_input, language_input, scenario_input, conversation_state],
|
|
|
|
| 106 |
|
| 107 |
custom_country_input = gr.Textbox(label="Enter Country (if not listed)", visible=False)
|
| 108 |
|
| 109 |
+
conversation_state = gr.State([])
|
| 110 |
+
|
| 111 |
chatbot = gr.Chatbot(label="💬 Chat History", type="messages")
|
| 112 |
chatbot.clear(fn=clear_history, outputs=conversation_state)
|
| 113 |
|
|
|
|
| 151 |
|
| 152 |
country_input.change(lambda c: gr.update(visible=c == "Other"), inputs=country_input, outputs=custom_country_input)
|
| 153 |
|
|
|
|
|
|
|
| 154 |
submit_btn.click(
|
| 155 |
submit,
|
| 156 |
inputs=[country_input, custom_country_input, language_input, scenario_input, conversation_state],
|