added text from the stream from TIS into a 'result' list
Browse files
app.py
CHANGED
@@ -144,12 +144,12 @@ async def bot_comms(message, history):
|
|
144 |
history=history,
|
145 |
)
|
146 |
if isinstance(stream, TextIteratorStreamer):
|
147 |
-
|
148 |
for new_text in stream:
|
149 |
if "" in new_text:
|
150 |
new_text = new_text.split("")[0]
|
151 |
-
|
152 |
-
|
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:
|