Skip to content

Set scheduler_specific_kwargs to get_scheduler#4006

Merged
hiyouga merged 1 commit intohiyouga:mainfrom
Uminosachi:scheduler-kwargs
Jun 3, 2024
Merged

Set scheduler_specific_kwargs to get_scheduler#4006
hiyouga merged 1 commit intohiyouga:mainfrom
Uminosachi:scheduler-kwargs

Conversation

@Uminosachi
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@hiyouga hiyouga added the solved This problem has been already solved label Jun 3, 2024
yoonseok312 pushed a commit to pensieve-ai/LLaMA-Factory-vlm that referenced this pull request Apr 29, 2025
Set scheduler_specific_kwargs to get_scheduler

Former-commit-id: 0f01500
liu-qingyuan pushed a commit to liu-qingyuan/LLaMA-Factory-Megafake that referenced this pull request Jun 6, 2025
Set scheduler_specific_kwargs to get_scheduler

Former-commit-id: 0f01500
zhongwei1968 pushed a commit to zhongwei1968/LLaMA-Factory that referenced this pull request Aug 1, 2025
Set scheduler_specific_kwargs to get_scheduler
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