Skip to content

Commit d9a79c1

Browse files
committed
Add test cases
Signed-off-by: Jingyu Xin <[email protected]>
1 parent a2cea26 commit d9a79c1

File tree

4 files changed

+284
-650
lines changed

4 files changed

+284
-650
lines changed

modelopt/torch/peft/conversion.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def convert_to_peft_model(model: ModelLikeModule, config: PEFTConfig) -> Convert
4343

4444
metadata = {}
4545
add_adapter(model, config)
46-
# Should return adapaters, active_adapters
4746
update_peft_metadata(model, config, metadata)
4847

4948
return model, metadata

modelopt/torch/peft/lora/layer.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class LoRAModule(DynamicModule):
2525
2626
Attributes:
2727
_lora_adapters: Dictionary mapping adapter names to their LoRA A and B matrices
28-
_active_adapters: Set of currently active adapter names
2928
"""
3029

3130
def _setup(self) -> None:
@@ -37,11 +36,6 @@ def adapter_names(self) -> set:
3736
"""Return the set of all registered adapter names."""
3837
return set(self._lora_adapters.keys())
3938

40-
@property
41-
def active_adapters(self) -> set:
42-
"""Return the set of currently active adapter names."""
43-
return self._active_adapters.copy()
44-
4539
def _register_adapter(
4640
self,
4741
adapter_name: str,
@@ -103,7 +97,6 @@ def get_peft_state(self) -> dict[str, Any]:
10397
Returns:
10498
Dictionary containing:
10599
- adapters: Dict mapping adapter names to their configuration
106-
- active_adapters: List of currently active adapter names
107100
"""
108101
modelopt_state = {}
109102

0 commit comments

Comments
 (0)