Skip to content

Commit

Permalink
fix error in interactive api (#3074)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvhan028 authored Jan 23, 2025
1 parent aa034eb commit 76ccef6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lmdeploy/serve/openai/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,11 +798,10 @@ async def chat_interactive_v1(request: GenerateRequest, raw_request: Request = N
if isinstance(request.stop, str):
request.stop = [request.stop]

end_session = sequence_end and not sequence_start \
and request.prompt == '' and request.request_output_len == 0
end_session = sequence_end and request.prompt == '' and request.request_output_len == 0
if end_session:
await async_engine.end_session(request.session_id)
return JSONResponse(dict(text='', tokens=0, input_tokens=0, history_tokens=0, finish_reason=None))
return JSONResponse(dict(text='', tokens=0, input_tokens=0, history_tokens=0, finish_reason='stop'))

random_seed = request.seed if request.seed else None

Expand Down

0 comments on commit 76ccef6

Please sign in to comment.