Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebeklett committed Feb 14, 2024
1 parent f61e9ac commit 1e01e0c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion experiments/laplace_lora/lora_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, config: FrozenConfigDict):
WEIGHTS_TO_LORA = ["q_proj", "v_proj", "o_proj"]

modules = list(model.model.layers.named_parameters())
# Get layer index, name for layers to adapt
module_names_with_layer = [
(name.split(".")[0], f'layer.{name.strip('.weight')}')
for name, param in modules
Expand All @@ -44,7 +45,7 @@ def __init__(self, config: FrozenConfigDict):
)
]

# only adapt last layer
# Subset of layers to adapt
if self.target_modules == "last_layer":
modules = [
[layer for name, layer in list(group)]
Expand Down

0 comments on commit 1e01e0c

Please sign in to comment.