nxphi47 commited on
Commit
19782fd
1 Parent(s): 698a096

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1073,6 +1073,8 @@ def chat_response_stream_multiturn(
1073
 
1074
  for j, gen in enumerate(vllm_generate_stream(llm, full_prompt, sampling_params)):
1075
  if cur_out is not None and (STREAM_YIELD_MULTIPLE < 1 or j % STREAM_YIELD_MULTIPLE == 0) and j > 0:
 
 
1076
  # optionally check safety, and respond
1077
  if STREAM_CHECK_MULTIPLE > 0 and j % STREAM_CHECK_MULTIPLE == 0:
1078
  message_safety = safety_check(cur_out, history=None)
 
1073
 
1074
  for j, gen in enumerate(vllm_generate_stream(llm, full_prompt, sampling_params)):
1075
  if cur_out is not None and (STREAM_YIELD_MULTIPLE < 1 or j % STREAM_YIELD_MULTIPLE == 0) and j > 0:
1076
+ cur_out = cur_out.replace("\\n", "\n")
1077
+
1078
  # optionally check safety, and respond
1079
  if STREAM_CHECK_MULTIPLE > 0 and j % STREAM_CHECK_MULTIPLE == 0:
1080
  message_safety = safety_check(cur_out, history=None)