Former-commit-id: ada0e536c9
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): async def predict(query: str, history: List[Tuple[str, str]], system: str, request: ChatCompletionRequest):
choice_data = ChatCompletionResponseStreamChoice( choice_data = ChatCompletionResponseStreamChoice(
index=0, index=0,
delta=DeltaMessage(role=Role.ASSISTANT), delta=DeltaMessage(role=Role.ASSISTANT, content=""),
finish_reason=None finish_reason=None
) )
chunk = ChatCompletionStreamResponse(model=request.model, choices=[choice_data]) chunk = ChatCompletionStreamResponse(model=request.model, choices=[choice_data])