YC-Chen commited on
Commit
6ec0273
1 Parent(s): 4314d2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -145,7 +145,7 @@ with gr.Blocks() as demo:
145
 
146
 
147
  def user(user_message, history):
148
- return "", history + [[user_message, '']]
149
 
150
 
151
  def bot(history, max_new_tokens, temperature, top_p, system_prompt):
@@ -203,7 +203,8 @@ with gr.Blocks() as demo:
203
 
204
  delta = json_response["result"]["fragment"]["data"]["text"]
205
 
206
-
 
207
  history[-1][1] += delta
208
  yield history
209
 
 
145
 
146
 
147
  def user(user_message, history):
148
+ return "", history + [[user_message, None]]
149
 
150
 
151
  def bot(history, max_new_tokens, temperature, top_p, system_prompt):
 
203
 
204
  delta = json_response["result"]["fragment"]["data"]["text"]
205
 
206
+ if history[-1][1] is None:
207
+ history[-1][1] = ''
208
  history[-1][1] += delta
209
  yield history
210