hugforziio commited on
Commit
f5c5806
·
1 Parent(s): c52d87c

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +3 -3
functions.py CHANGED
@@ -209,10 +209,10 @@ def sequential_chat_once_fn(payload, api_key_text, history, history_md_stable, h
209
  is_first = False
210
  continue
211
  if chunk.choices[0].finish_reason is None:
212
- sys.stdout.write("\r")
213
- # print(chunk.choices[0].delta.content or '', end="")
214
  assistant_message += chunk.choices[0].delta.content or ''
215
- print(assistant_message, end="")
216
  history_md_stream = make_md_line('assistant', assistant_message)
217
  tips = 'streaming'
218
  yield assistant_message, history_md_stream, tips, history
 
209
  is_first = False
210
  continue
211
  if chunk.choices[0].finish_reason is None:
212
+ # sys.stdout.write("\r")
213
+ print(chunk.choices[0].delta.content or '', end="")
214
  assistant_message += chunk.choices[0].delta.content or ''
215
+ # print(f"\033[2K{assistant_message}", end="")
216
  history_md_stream = make_md_line('assistant', assistant_message)
217
  tips = 'streaming'
218
  yield assistant_message, history_md_stream, tips, history