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

Set scheduler_specific_kwargs to get_scheduler #4006

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

Uminosachi
Copy link
Contributor

What does this PR do?

When setting the argument --lr_scheduler_type cosine_with_min_lr for python src/train.py, the following error occurs:

ValueError: One of min_lr or min_lr_rate should be set through the `lr_scheduler_kwargs`

In response, I provided the argument --lr_scheduler_kwargs '{"min_lr": 1e-7}', but an error still occurs because the scheduler_specific_kwargs argument is not properly passed to the get_scheduler function within the create_custom_scheduler function in src/llamafactory/train/utils.py.

To resolve this error, I have modified the code to set the scheduler_specific_kwargs argument to training_args.lr_scheduler_kwargs within the create_custom_scheduler function.

Before submitting

@Uminosachi
Copy link
Contributor Author

A TypeError may occur when handling string arguments if you are using a version of transformers prior to the following PR:

huggingface/transformers#30227

@hiyouga hiyouga self-requested a review June 3, 2024 11:27
Copy link
Owner

@hiyouga hiyouga left a comment

Choose a reason for hiding this comment

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

LGTM

@hiyouga hiyouga merged commit 0f01500 into hiyouga:main Jun 3, 2024
1 check passed
@hiyouga hiyouga added the solved This problem has been already solved label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants