Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,12 +22,13 @@ def chat(message, history=[]):
|
|
| 22 |
resp = chatbot(prompt, max_new_tokens=150, do_sample=True, temperature=0.7)[0]["generated_text"]
|
| 23 |
reply = resp.split("Aria:")[-1].strip()
|
| 24 |
|
| 25 |
-
history.append(
|
| 26 |
-
return
|
|
|
|
| 27 |
|
| 28 |
with gr.Blocks() as demo:
|
| 29 |
chat_ui = gr.Chatbot()
|
| 30 |
msg = gr.Textbox(placeholder="Écris un message...")
|
| 31 |
-
msg.submit(chat, [msg, chat_ui], [chat_ui
|
| 32 |
|
| 33 |
demo.launch()
|
|
|
|
| 22 |
resp = chatbot(prompt, max_new_tokens=150, do_sample=True, temperature=0.7)[0]["generated_text"]
|
| 23 |
reply = resp.split("Aria:")[-1].strip()
|
| 24 |
|
| 25 |
+
history.append([message, reply])
|
| 26 |
+
return history, history
|
| 27 |
+
|
| 28 |
|
| 29 |
with gr.Blocks() as demo:
|
| 30 |
chat_ui = gr.Chatbot()
|
| 31 |
msg = gr.Textbox(placeholder="Écris un message...")
|
| 32 |
+
msg.submit(chat, [msg, chat_ui], [chat_ui])
|
| 33 |
|
| 34 |
demo.launch()
|