diff --git a/basic_demo/openai_api_server.py b/basic_demo/openai_api_server.py index f03b120..07ea206 100644 --- a/basic_demo/openai_api_server.py +++ b/basic_demo/openai_api_server.py @@ -484,7 +484,8 @@ async def predict_stream(model_id, gen_params): object="chat.completion.chunk" ) yield "{}".format(chunk.model_dump_json(exclude_unset=True)) - + if not has_send_first_chunk and output.startswith("\n"): + output = output[1:] send_msg = delta_text if has_send_first_chunk else output has_send_first_chunk = True message = DeltaMessage(