Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@
|
|
8 |
from textwrap import dedent
|
9 |
|
10 |
# credit to https://github.com/THUDM/ChatGLM2-6B/blob/main/web_demo.py
|
|
|
11 |
from transformers import AutoModel, AutoTokenizer
|
12 |
import gradio as gr
|
13 |
import mdtex2html
|
@@ -166,6 +167,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
166 |
history = gr.State([])
|
167 |
past_key_values = gr.State(None)
|
168 |
|
|
|
|
|
169 |
submitBtn.click(predict, [user_input, chatbot, max_length, top_p, temperature, history, past_key_values],
|
170 |
[chatbot, history, past_key_values], show_progress=True, api_name="predict")
|
171 |
submitBtn.click(reset_user_input, [], [user_input])
|
|
|
8 |
from textwrap import dedent
|
9 |
|
10 |
# credit to https://github.com/THUDM/ChatGLM2-6B/blob/main/web_demo.py
|
11 |
+
# while mistakes are mine
|
12 |
from transformers import AutoModel, AutoTokenizer
|
13 |
import gradio as gr
|
14 |
import mdtex2html
|
|
|
167 |
history = gr.State([])
|
168 |
past_key_values = gr.State(None)
|
169 |
|
170 |
+
user_input.submit(predict, [user_input, chatbot, max_length, top_p, temperature, history, past_key_values],
|
171 |
+
[chatbot, history, past_key_values], show_progress=True)
|
172 |
submitBtn.click(predict, [user_input, chatbot, max_length, top_p, temperature, history, past_key_values],
|
173 |
[chatbot, history, past_key_values], show_progress=True, api_name="predict")
|
174 |
submitBtn.click(reset_user_input, [], [user_input])
|