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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -220,10 +220,14 @@ def _launch_demo(args):
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
 
220
  temperature=0.7,
221
  top_p=1.0,
222
  )
 
223
  for response in responses:
224
+ response = response.choices[0].delta.content
225
+ response_text = []
226
+ for ele in response:
227
+ if 'text' in ele:
228
+ response_text.append(ele['text'])
229
+ elif 'box' in ele:
230
+ response_text.append(ele['box'])
231
  response_text = ''.join(response_text)
232
  _chatbot[-1] = (_parse_text(chat_query), _remove_image_special(response_text))
233
  yield _chatbot