mirror of https://github.com/THUDM/ChatGLM-6B
Update web_demo.py
parent
0473dfb97b
commit
a339498980
|
@ -14,9 +14,9 @@ def predict(input, max_length, top_p, temperature, history=None):
|
||||||
history = []
|
history = []
|
||||||
flag = True
|
flag = True
|
||||||
response = ''
|
response = ''
|
||||||
|
updates = []
|
||||||
for delta, seq, history in model.chat_stream(tokenizer, input, history, max_length=max_length, top_p=top_p,
|
for delta, seq, history in model.chat_stream(tokenizer, input, history, max_length=max_length, top_p=top_p,
|
||||||
temperature=temperature):
|
temperature=temperature):
|
||||||
updates = []
|
|
||||||
response += delta
|
response += delta
|
||||||
if flag:
|
if flag:
|
||||||
updates.append(gr.update(visible=True, value="用户:" + input))
|
updates.append(gr.update(visible=True, value="用户:" + input))
|
||||||
|
|
Loading…
Reference in New Issue