essbony commited on
Commit
69ed227
·
verified ·
1 Parent(s): 1d05394

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -129,16 +129,14 @@ with gr.Blocks(theme= gr.themes.Soft(
129
 
130
  session_id = gr.State(str(uuid.uuid4()))
131
 
132
- chatbot = gr.Chatbot(type="messages", height=800) # version simple (tuples)
133
  msg = gr.Textbox( label="❓",placeholder="Posez une question")
134
 
135
  def respond(message, chat_history, session_id):
136
 
137
  answer = chat_fn(message, session_id)
138
 
139
- chat_history.append({"role": "user", "content": message})
140
- chat_history.append({"role": "assistant", "content": answer})
141
- #chat_history.append((message, answer))
142
 
143
  return "", chat_history, session_id
144
 
 
129
 
130
  session_id = gr.State(str(uuid.uuid4()))
131
 
132
+ chatbot = gr.Chatbot(height=800)
133
  msg = gr.Textbox( label="❓",placeholder="Posez une question")
134
 
135
  def respond(message, chat_history, session_id):
136
 
137
  answer = chat_fn(message, session_id)
138
 
139
+ chat_history.append((message, answer))
 
 
140
 
141
  return "", chat_history, session_id
142