YC-Chen commited on
Commit
05eed08
1 Parent(s): 130a4fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -129,12 +129,11 @@ with gr.Blocks() as demo:
129
  }
130
 
131
  outputs = requests.post(API_URL, headers=HEADERS, data=json.dumps(data)).json()['choices'][0]['text']
132
- for segment in outputs:
133
- if history[-1][1] is None:
134
- history[-1][1] = segment
135
- else:
136
- history[-1][1] += outputs
137
- yield history
138
 
139
  msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
140
  fn=bot,
 
129
  }
130
 
131
  outputs = requests.post(API_URL, headers=HEADERS, data=json.dumps(data)).json()['choices'][0]['text']
132
+ if history[-1][1] is None:
133
+ history[-1][1] = segment
134
+ else:
135
+ history[-1][1] += outputs
136
+ return history
 
137
 
138
  msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
139
  fn=bot,