Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose flag for should_save_peft_only #1357

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
irenedea marked this conversation as resolved.
Show resolved Hide resolved
)

@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
Loading