[LoRA] Support 2D and 3D MoE LoRA adapter at the same time (#42242)
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com> Signed-off-by: Jee Jee Li <jeejeelee@inferact.ai> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Roger Wang <hey@rogerw.io>
This commit is contained in:
co-authored by
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Roger Wang
parent
e3aeee5ff8
commit
7d5b033782
@@ -16,3 +16,4 @@ class LoRAModulePath:
|
||||
name: str
|
||||
path: str
|
||||
base_model_name: str | None = None
|
||||
is_3d_lora_weight: bool = False
|
||||
|
||||
@@ -121,7 +121,9 @@ class OpenAIServingModels:
|
||||
return
|
||||
for lora in self.static_lora_modules:
|
||||
load_request = LoadLoRAAdapterRequest(
|
||||
lora_path=lora.path, lora_name=lora.name
|
||||
lora_path=lora.path,
|
||||
lora_name=lora.name,
|
||||
is_3d_lora_weight=lora.is_3d_lora_weight,
|
||||
)
|
||||
load_result = await self.load_lora_adapter(
|
||||
request=load_request, base_model_name=lora.base_model_name
|
||||
@@ -177,6 +179,7 @@ class OpenAIServingModels:
|
||||
lora_int_id=lora_int_id,
|
||||
lora_path=lora_path,
|
||||
load_inplace=request.load_inplace,
|
||||
is_3d_lora_weight=request.is_3d_lora_weight,
|
||||
)
|
||||
if base_model_name is not None and self.is_base_model(base_model_name):
|
||||
lora_request.base_model_name = base_model_name
|
||||
|
||||
@@ -37,6 +37,7 @@ def attach_router(app: FastAPI):
|
||||
"lora_name": "body.name",
|
||||
"lora_path": "body.src",
|
||||
"load_inplace": "body.load_inplace || `false`",
|
||||
"is_3d_lora_weight": "body.is_3d_lora_weight || `false`",
|
||||
},
|
||||
)
|
||||
@router.post("/v1/load_lora_adapter", dependencies=[Depends(validate_json_request)])
|
||||
|
||||
@@ -8,6 +8,7 @@ class LoadLoRAAdapterRequest(BaseModel):
|
||||
lora_name: str
|
||||
lora_path: str
|
||||
load_inplace: bool = False
|
||||
is_3d_lora_weight: bool = False
|
||||
|
||||
|
||||
class UnloadLoRAAdapterRequest(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user