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

ADD: warning if hub_model_id ist set but not any save strategy #1202

Merged
merged 6 commits into from
Jan 26, 2024

Conversation

JohanWork
Copy link
Contributor

Add warning if hub_model_id is set but not any save strategy. Reference issue

Copy link
Collaborator

@winglian winglian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This would be better in the validate_config function. We also have a test suite for the validate_config function to verify the functionality of the various checks that it performs.

@JohanWork JohanWork changed the title Johan/warning hub no save ADD: warninf if hub_model_id ist set but not any save strategy Jan 25, 2024
@JohanWork JohanWork changed the title ADD: warninf if hub_model_id ist set but not any save strategy ADD: warning if hub_model_id ist set but not any save strategy Jan 25, 2024
@JohanWork
Copy link
Contributor Author

@winglian I have update the code and put a test in place, but how do I fix the "Too many public methods (21/20) (too-many-public-methods)" I guess 20 is a default value? I can at least not find where you set it.

@winglian
Copy link
Collaborator

@winglian I have update the code and put a test in place, but how do I fix the "Too many public methods (21/20) (too-many-public-methods)" I guess 20 is a default value? I can at least not find where you set it.

I fixed this for you. thanks!

tests/test_validation.py Outdated Show resolved Hide resolved
@winglian winglian merged commit af29d81 into axolotl-ai-cloud:main Jan 26, 2024
7 checks passed
Copy link
Collaborator

@NanoCode012 NanoCode012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, just saw this. Should this be updated?

@@ -339,6 +339,11 @@ def validate_config(cfg):
"push_to_hub_model_id is deprecated. Please use hub_model_id instead."
)

if cfg.hub_model_id and not (cfg.save_steps or cfg.saves_per_epoch):
Copy link
Collaborator

@NanoCode012 NanoCode012 Feb 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also check for cfg.save_strategy and update the log message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah your right @NanoCode012 . The test should check for save_strategy, and the comments should be something like:

hub_model_id is set without any models being saved. To save a model, set save_strategy to steps or leave empty. Dose that sound right? If so I can create a pr and update.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Please feel free to tag me for review

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit confused both save_on_epochs and save_steps needs save_strategy to be steps see: https://github.com/OpenAccess-AI-Collective/axolotl/blob/5a5d47458d9aaf7ead798d15291ba3d9bef785c5/src/axolotl/utils/config.py#L426
https://github.com/OpenAccess-AI-Collective/axolotl/blob/5a5d47458d9aaf7ead798d15291ba3d9bef785c5/src/axolotl/utils/config.py#L442

However https://github.com/OpenAccess-AI-Collective/axolotl/blob/5a5d47458d9aaf7ead798d15291ba3d9bef785c5/README.md?plain=1#L777 says nothing about that, it only says set to no to skip. Should we also maybe update the comment to be somthing like set to 'steps' to save checkpoints?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

save_strategy and save_steps are default HF Trainer Arguments. save_on_epochs is just a handy utility by axolotl that auto computes the save_steps based on total steps, hence needing steps.

This is the doc for save_strategy: https://huggingface.co/docs/transformers/v4.37.2/en/main_classes/trainer#transformers.TrainingArguments.save_strategy

djsaunde pushed a commit that referenced this pull request Dec 17, 2024
* warning if hub model id set but no save

* add warning

* move the warning

* add test

* allow more public methods for tests for now

* fix tests

---------

Co-authored-by: Wing Lian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants