Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ochat/serving/openai_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def create_stream_response_json(
model=model_name,
)

return response.json(exclude_unset=True, ensure_ascii=False)
return response.model_dump_json(exclude_unset=True)

async def completion_stream_generator() -> AsyncGenerator[str, None]:
# First chunk with role
Expand All @@ -220,7 +220,7 @@ async def completion_stream_generator() -> AsyncGenerator[str, None]:
choices=[choice_data],
model=model_name)

yield f"data: {chunk.json(exclude_unset=True, ensure_ascii=False)}\n\n"
yield f"data: {chunk.model_dump_json(exclude_unset=True)}\n\n"

previous_texts = [""] * request.n
previous_num_tokens = [0] * request.n
Expand Down