mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2025-09-11 07:44:35 +00:00
fix: object type for non-streaming response
This commit is contained in:
parent
6d45871de8
commit
584c7d5639
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ async def chat_completion(request:Request,create:ChatCompletionCreate):
|
||||||
yield chunk
|
yield chunk
|
||||||
return chat_stream_response(request,inner())
|
return chat_stream_response(request,inner())
|
||||||
else:
|
else:
|
||||||
comp = ChatCompletionObject(id=id,object='chat.completion.chunk',created=int(time()))
|
comp = ChatCompletionObject(id=id,object='chat.completion',created=int(time()))
|
||||||
comp.usage = Usage(completion_tokens=1, prompt_tokens=1, total_tokens=2)
|
comp.usage = Usage(completion_tokens=1, prompt_tokens=1, total_tokens=2)
|
||||||
async for token in interface.inference(input_message,id):
|
async for token in interface.inference(input_message,id):
|
||||||
comp.append_token(token)
|
comp.append_token(token)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue