GiantPandas commited on
Commit
b0e21c7
·
verified ·
1 Parent(s): 1b637c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -220,16 +220,10 @@ def _launch_demo(args):
220
  temperature=0.7,
221
  top_p=1.0,
222
  )
 
223
  for response in responses:
224
- if not response.status_code == HTTPStatus.OK:
225
- raise HTTPError(f'response.code: {response.code}\nresponse.message: {response.message}')
226
- response = response.output.choices[0].message.content
227
- response_text = []
228
- for ele in response:
229
- if 'text' in ele:
230
- response_text.append(ele['text'])
231
- elif 'box' in ele:
232
- response_text.append(ele['box'])
233
  response_text = ''.join(response_text)
234
  _chatbot[-1] = (_parse_text(chat_query), _remove_image_special(response_text))
235
  yield _chatbot
 
220
  temperature=0.7,
221
  top_p=1.0,
222
  )
223
+ response_text = []
224
  for response in responses:
225
+ response_text.append(response.choices[0].delta.content)
226
+
 
 
 
 
 
 
 
227
  response_text = ''.join(response_text)
228
  _chatbot[-1] = (_parse_text(chat_query), _remove_image_special(response_text))
229
  yield _chatbot