From 1657f915571dc0289631b10de3cae70eb8629fc2 Mon Sep 17 00:00:00 2001 From: Lei Zhou Date: Thu, 19 Dec 2024 18:44:10 +0000 Subject: [PATCH] add lora_paths to v1_chat_generate_request --- 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]