From 19ba2b0ea9241bf6a3ff5918916cd725755d1b6b Mon Sep 17 00:00:00 2001 From: Lei Date: Sun, 22 Dec 2024 02:23:33 -0800 Subject: [PATCH] Add lora_paths to v1_chat_generate_request (#2529) --- python/sglang/srt/openai_api/adapter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/sglang/srt/openai_api/adapter.py b/python/sglang/srt/openai_api/adapter.py index 6aff0b45822..d8fd731c445 100644 --- a/python/sglang/srt/openai_api/adapter.py +++ b/python/sglang/srt/openai_api/adapter.py @@ -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 @@ -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, @@ -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} @@ -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]