Skip to content

Commit

Permalink
Expose flag for should_save_peft_only (#1357)
Browse files Browse the repository at this point in the history
  • Loading branch information
irenedea authored Jul 15, 2024
1 parent d271210 commit 54746bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions llmfoundry/models/hf/hf_causal_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def __init__(
use_train_metrics: bool = True,
additional_train_metrics: Optional[List] = None,
additional_eval_metrics: Optional[List] = None,
should_save_peft_only: bool = True,
):

config_overrides = config_overrides or {}
Expand Down Expand Up @@ -131,6 +132,7 @@ def __init__(
eval_metrics=eval_metrics,
init_device=init_device,
peft_config=peft_config_object,
should_save_peft_only=should_save_peft_only,
)

@staticmethod
Expand Down
3 changes: 2 additions & 1 deletion llmfoundry/models/hf/model_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(
shift_labels: bool = False,
init_device: Optional[str] = None,
peft_config: Optional['PeftConfig'] = None,
should_save_peft_only: bool = True,
):
super().__init__(
model,
Expand All @@ -49,7 +50,7 @@ def __init__(
eval_metrics=eval_metrics,
shift_labels=shift_labels,
peft_config=peft_config,
should_save_peft_only=True,
should_save_peft_only=should_save_peft_only,
)

self.prepare_inner_model(self.model, init_device)
Expand Down

0 comments on commit 54746bf

Please sign in to comment.