Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,12 +7,7 @@ model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).ha
|
|
7 |
|
8 |
def predict(history, input):
|
9 |
response, history = model.chat(tokenizer, input, history)
|
10 |
-
return
|
11 |
-
|
12 |
-
def bot(history):
|
13 |
-
response = "**That's cool!**"
|
14 |
-
history[-1][1] = response
|
15 |
-
return history
|
16 |
|
17 |
with gr.Blocks() as demo:
|
18 |
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=750)
|
@@ -24,9 +19,7 @@ with gr.Blocks() as demo:
|
|
24 |
placeholder="Enter text and press enter",
|
25 |
).style(container=False)
|
26 |
|
27 |
-
txt.submit(predict, [chatbot, txt], [chatbot, txt])
|
28 |
-
bot, chatbot, chatbot
|
29 |
-
)
|
30 |
|
31 |
if __name__ == "__main__":
|
32 |
demo.launch()
|
|
|
7 |
|
8 |
def predict(history, input):
|
9 |
response, history = model.chat(tokenizer, input, history)
|
10 |
+
return history,""
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
with gr.Blocks() as demo:
|
13 |
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=750)
|
|
|
19 |
placeholder="Enter text and press enter",
|
20 |
).style(container=False)
|
21 |
|
22 |
+
txt.submit(predict, [chatbot, txt], [chatbot, txt])
|
|
|
|
|
23 |
|
24 |
if __name__ == "__main__":
|
25 |
demo.launch()
|