Former-commit-id: ada0e536c926fd0196d127c89cc817da1008c017
This commit is contained in:
hiyouga 2023-12-12 19:58:34 +08:00
parent 1a0bdd305c
commit b43a8dcfbf

View File

@ -128,7 +128,7 @@ def create_app(chat_model: "ChatModel") -> "FastAPI":
async def predict(query: str, history: List[Tuple[str, str]], system: str, request: ChatCompletionRequest):
choice_data = ChatCompletionResponseStreamChoice(
index=0,
delta=DeltaMessage(role=Role.ASSISTANT),
delta=DeltaMessage(role=Role.ASSISTANT, content=""),
finish_reason=None
)
chunk = ChatCompletionStreamResponse(model=request.model, choices=[choice_data])