winglian commited on
Commit
7659c00
·
unverified ·
1 Parent(s): 3fd8093

support for rslora (#1387) [skip ci]

Browse files
src/axolotl/utils/config/models/input/v0_4_1/__init__.py CHANGED
@@ -179,6 +179,7 @@ class LoraConfig(BaseModel):
179
  peft_layers_to_transform: Optional[List[int]] = None
180
  peft: Optional[PeftConfig] = None
181
  peft_use_dora: Optional[bool] = None
 
182
 
183
  lora_on_cpu: Optional[bool] = None
184
  gptq: Optional[bool] = None
 
179
  peft_layers_to_transform: Optional[List[int]] = None
180
  peft: Optional[PeftConfig] = None
181
  peft_use_dora: Optional[bool] = None
182
+ peft_use_relora: Optional[bool] = None
183
 
184
  lora_on_cpu: Optional[bool] = None
185
  gptq: Optional[bool] = None
src/axolotl/utils/models.py CHANGED
@@ -1055,6 +1055,8 @@ def load_lora(model, cfg, inference=False, config_only=False):
1055
  lora_config_kwargs["init_lora_weights"] = "loftq"
1056
  if cfg.peft_use_dora:
1057
  lora_config_kwargs["use_dora"] = cfg.peft_use_dora
 
 
1058
 
1059
  lora_config = LoraConfig(
1060
  r=cfg.lora_r,
 
1055
  lora_config_kwargs["init_lora_weights"] = "loftq"
1056
  if cfg.peft_use_dora:
1057
  lora_config_kwargs["use_dora"] = cfg.peft_use_dora
1058
+ if cfg.peft_use_rslora:
1059
+ lora_config_kwargs["use_rslora"] = cfg.use_rslora
1060
 
1061
  lora_config = LoraConfig(
1062
  r=cfg.lora_r,