Commit 95099cbc authored by zhuwenwen's avatar zhuwenwen
Browse files

fix docstring

parent c7880912
......@@ -2635,6 +2635,9 @@ class LoRAConfig:
max_cpu_loras: Optional[int] = None
"""Maximum number of LoRAs to store in CPU memory. Must be >= than
`max_loras`."""
merge_lora: bool = False
"""Enable merge lora
"""
lora_target_modules: Optional[List[str]] = None
"""List of lora module name, If not specified,
modules will be chosen according to the model architecture.
......@@ -2653,8 +2656,6 @@ class LoRAConfig:
specified, only adapters trained with the base model scaling factor are
allowed."""
bias_enabled: bool = False
merge_lora: bool = False
lora_target_modules: Optional[List[str]] = None
"""Enable bias for LoRA adapters."""
def compute_hash(self) -> str:
......@@ -2677,6 +2678,7 @@ class LoRAConfig:
factors.append(self.lora_extra_vocab_size)
factors.append(self.long_lora_scaling_factors)
factors.append(self.bias_enabled)
factors.append(self.merge_lora)
hash_str = hashlib.md5(str(factors).encode(),
usedforsecurity=False).hexdigest()
return hash_str
......
......@@ -280,7 +280,7 @@ class EngineArgs:
max_lora_rank: int = LoRAConfig.max_lora_rank
fully_sharded_loras: bool = LoRAConfig.fully_sharded_loras
max_cpu_loras: Optional[int] = LoRAConfig.max_cpu_loras
merge_lora: bool = False
merge_lora: bool = LoRAConfig.merge_lora
lora_target_modules: Optional[List[str]] = LoRAConfig.lora_target_modules
lora_dtype: Optional[Union[str, torch.dtype]] = LoRAConfig.lora_dtype
lora_extra_vocab_size: int = LoRAConfig.lora_extra_vocab_size
......@@ -706,8 +706,9 @@ class EngineArgs:
lora_group.add_argument('--max-lora-rank',
**lora_kwargs["max_lora_rank"])
lora_group.add_argument('--merge-lora',
action=argparse.BooleanOptionalAction,
help='If set to True, the weights of the base layer will be merged with the weights of Lora.')
**lora_kwargs["merge-lora"])
# action=argparse.BooleanOptionalAction,
# help='If set to True, the weights of the base layer will be merged with the weights of Lora.')
lora_group.add_argument('--lora-target-modules',
**lora_kwargs["lora_target_modules"])
lora_group.add_argument('--lora-extra-vocab-size',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment