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

Can't have load_best_model_at_end with explicit test_datasets #1286

Closed
6 of 8 tasks
chiragjn opened this issue Feb 12, 2024 · 1 comment · Fixed by #1291
Closed
6 of 8 tasks

Can't have load_best_model_at_end with explicit test_datasets #1286

chiragjn opened this issue Feb 12, 2024 · 1 comment · Fixed by #1291
Labels
bug Something isn't working

Comments

@chiragjn
Copy link
Contributor

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

Ideally, it should be possible to have load_best_model_at_end: True with test_datasets: [...] as it is already allowed with val_set_size.

Not sure why it was restricted, tried doing a git blame, but there was a massive refactor so hard to trace

Current behaviour

Currently it crashes with

.../lib/python3.10/site-packages/transformers/trainer_callback.py", line 578, in on_train_begin
    assert args.load_best_model_at_end, "EarlyStoppingCallback requires load_best_model_at_end = True"
AssertionError: EarlyStoppingCallback requires load_best_model_at_end = True

because load_best_model_at_end gets disabled

https://github.com/OpenAccess-AI-Collective/axolotl/blob/ea00dd08528399405943f880b27ecc60e4d83cdf/src/axolotl/core/trainer_builder.py#L849-L859

Steps to reproduce

Train qlora model but set

test_datasets:
 - ...
val_set_size: 0
load_best_model_at_end: True

Config yaml

No response

Possible solution

Slightly modify the condition to allow load_best_model_at_end when either test_datasets is set or val_set_size > 0

Which Operating Systems are you using?

  • Linux
  • macOS
  • Windows

Python Version

3.10

axolotl branch-commit

main/ea00dd08528399405943f880b27ecc60e4d83cdf

Acknowledgements

  • My issue title is concise, descriptive, and in title casing.
  • I have searched the existing issues to make sure this bug has not been reported yet.
  • I am using the latest version of axolotl.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.
@chiragjn chiragjn added the bug Something isn't working label Feb 12, 2024
@chiragjn chiragjn changed the title Can't have test_datasets load_best_model_at_end with explicit test_datasets Can't have load_best_model_at_end with explicit test_datasets Feb 12, 2024
@dameikle
Copy link
Contributor

dameikle commented Feb 14, 2024

I raised a pull request here that I believe resolves this as I had a similar need #1291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants