Spaces:
Runtime error
Runtime error
hugforziio
commited on
Commit
·
fa7d983
1
Parent(s):
f4e76cf
Update functions.py
Browse files- functions.py +2 -1
functions.py
CHANGED
@@ -206,7 +206,7 @@ def sequential_chat_once_fn(payload, api_key_text, history, history_md_stable, h
|
|
206 |
is_first = False
|
207 |
continue
|
208 |
if chunk.choices[0].finish_reason is None:
|
209 |
-
print(chunk.choices[0].delta.content or '')
|
210 |
assistant_message += chunk.choices[0].delta.content or ''
|
211 |
history_md_stream = make_md_line('assistant', assistant_message)
|
212 |
tips = 'streaming'
|
@@ -214,6 +214,7 @@ def sequential_chat_once_fn(payload, api_key_text, history, history_md_stable, h
|
|
214 |
else:
|
215 |
pass
|
216 |
pass
|
|
|
217 |
pass
|
218 |
else:
|
219 |
assistant_message = completion.choices[0].message.content
|
|
|
206 |
is_first = False
|
207 |
continue
|
208 |
if chunk.choices[0].finish_reason is None:
|
209 |
+
print(chunk.choices[0].delta.content or '', end="")
|
210 |
assistant_message += chunk.choices[0].delta.content or ''
|
211 |
history_md_stream = make_md_line('assistant', assistant_message)
|
212 |
tips = 'streaming'
|
|
|
214 |
else:
|
215 |
pass
|
216 |
pass
|
217 |
+
print('')
|
218 |
pass
|
219 |
else:
|
220 |
assistant_message = completion.choices[0].message.content
|