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

Add lora_paths to v1_chat_generate_request #2529

Merged
merged 1 commit into from
Dec 22, 2024
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
4 changes: 4 additions & 0 deletions python/sglang/srt/openai_api/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ def v1_chat_generate_request(
logprob_start_lens = []
top_logprobs_nums = []
modalities_list = []
lora_paths = []

# NOTE: with openai API, the prompt's logprobs are always not computed

Expand Down Expand Up @@ -920,6 +921,7 @@ def v1_chat_generate_request(
return_logprobs.append(request.logprobs)
logprob_start_lens.append(-1)
top_logprobs_nums.append(request.top_logprobs or 0)
lora_paths.append(request.lora_path)

sampling_params = {
"temperature": request.temperature,
Expand Down Expand Up @@ -958,6 +960,7 @@ def v1_chat_generate_request(
logprob_start_lens = logprob_start_lens[0]
top_logprobs_nums = top_logprobs_nums[0]
modalities_list = modalities_list[0]
lora_paths = lora_paths[0]
else:
if isinstance(input_ids[0], str):
prompt_kwargs = {"text": input_ids}
Expand All @@ -975,6 +978,7 @@ def v1_chat_generate_request(
return_text_in_logprobs=True,
rid=request_ids,
modalities=modalities_list,
lora_path=lora_paths,
)

return adapted_request, all_requests if len(all_requests) > 1 else all_requests[0]
Expand Down
Loading