El-Alberto67 commited on
Commit
d0f41e0
Β·
verified Β·
1 Parent(s): 9a45ada

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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((message, reply))
26
- return reply, history
 
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, 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()