sandz7 commited on
Commit
617d3d2
Β·
1 Parent(s): a423985

added text from the stream from TIS into a 'result' list

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -144,12 +144,12 @@ async def bot_comms(message, history):
144
  history=history,
145
  )
146
  if isinstance(stream, TextIteratorStreamer):
147
- buffer = ""
148
  for new_text in stream:
149
  if "" in new_text:
150
  new_text = new_text.split("")[0]
151
- buffer += new_text
152
- yield buffer
153
  else:
154
  gpt_outputs = []
155
  for chunk in stream:
 
144
  history=history,
145
  )
146
  if isinstance(stream, TextIteratorStreamer):
147
+ results = []
148
  for new_text in stream:
149
  if "" in new_text:
150
  new_text = new_text.split("")[0]
151
+ results.append(new_text)
152
+ yield "".join(results)
153
  else:
154
  gpt_outputs = []
155
  for chunk in stream: