Signed-off-by: bk-201 <joy25810@foxmail.com>
This commit is contained in:
bk-201 2025-10-13 02:39:01 +00:00
parent 0fa9111e82
commit 882213cca2
3 changed files with 8 additions and 5 deletions

View File

@ -336,7 +336,7 @@ class LoRAModelManager:
max_num_batched_tokens: int,
vocab_size: int,
lora_config: LoRAConfig,
model_config: Optional[ModelConfig],
model_config: ModelConfig | None,
device: torch.device,
):
"""Create a LoRAModelManager and adapter for a given model.
@ -709,7 +709,7 @@ class LoRAModelManager:
return any([module_name.startswith(prefix) for prefix in prefix_lst])
return False
def _get_mm_punica_wrapper(self, module_name: str) -> Optional[PunicaWrapperBase]:
def _get_mm_punica_wrapper(self, module_name: str) -> PunicaWrapperBase | None:
"""
Match the corresponding punica_wrapper based on module_name,
and return None if lora is not supported for this module.

View File

@ -71,7 +71,7 @@ class WorkerLoRAManager:
def create_lora_manager(
self,
model: torch.nn.Module,
model_config: Optional[ModelConfig] = None,
model_config: ModelConfig | None = None,
) -> Any:
lora_manager = create_lora_manager(
model,
@ -222,7 +222,7 @@ class LRUCacheWorkerLoRAManager(WorkerLoRAManager):
def create_lora_manager(
self,
model: torch.nn.Module,
model_config: Optional[ModelConfig] = None,
model_config: ModelConfig | None = None,
) -> Any:
lora_manager = create_lora_manager(
model,

View File

@ -131,7 +131,10 @@ class LoRAModelRunnerMixin:
@contextmanager
def maybe_select_dummy_loras(
self, lora_config: LoRAConfig | None, num_scheduled_tokens: np.ndarray, is_mm_input: bool = False
self,
lora_config: LoRAConfig | None,
num_scheduled_tokens: np.ndarray,
is_mm_input: bool = False,
):
if lora_config is None:
yield