Commit b70051ad authored by 于飞's avatar 于飞

换行修改

parent fab3229e
......@@ -544,8 +544,10 @@ async def stream_generator(chat, incremental: bool, model_name: str):
json_chunk = model_to_json(
chunk, exclude_unset=True, ensure_ascii=False
)
json_chunk = json_chunk.replace("\\n", "\n")
yield f"data: {json_chunk}\n\n"
json_chunk = json_chunk.replace("\\n", "n")
#print(f"===>:{json_chunk}")
#yield f"data: {json_chunk}\n\n"
yield f"data: {json_chunk}"
else:
# TODO generate an openai-compatible streaming responses
msg = msg.replace("\n", "\\n")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment