fix(lora): validate LoRA rank is positive in PEFTHelper (#48437)

Signed-off-by: ErenAta16 <erena6466@gmail.com>
This commit is contained in:
ErenAta16
2026-07-16 05:22:52 +00:00
committed by GitHub
parent 6a9f24aa8c
commit 59b964f37d
2 changed files with 19 additions and 0 deletions
+2
View File
@@ -51,6 +51,8 @@ class PEFTHelper:
return error_msg
def __post_init__(self):
if self.r <= 0:
raise ValueError(f"LoRA rank `r` must be a positive integer, got {self.r}.")
if self.use_rslora:
logger.info_once("Loading LoRA weights trained with rsLoRA.")
self.vllm_lora_scaling_factor = self.lora_alpha / math.sqrt(self.r)