[Misc][LoRA] Ensure Lora Adapter requests return adapter name (#11094)

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
This commit is contained in:
Jiaxin Shan
2024-12-12 09:25:16 +00:00
committed by GitHub
co-authored by Jee Jee Li
parent 62de37a38e
commit 85362f028c
4 changed files with 33 additions and 7 deletions
+13
View File
@@ -661,3 +661,16 @@ class OpenAIServing:
def _is_model_supported(self, model_name):
return any(model.name == model_name for model in self.base_model_paths)
def _get_model_name(self, lora: Optional[LoRARequest]):
"""
Returns the appropriate model name depending on the availability
and support of the LoRA or base model.
Parameters:
- lora: LoRARequest that contain a base_model_name.
Returns:
- str: The name of the base model or the first available model path.
"""
if lora is not None:
return lora.lora_name
return self.base_model_paths[0].name