Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error in interactive api #3074

Merged
merged 1 commit into from
Jan 23, 2025
Merged
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
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