Fix lr_scheduler_parsing (#41322)

* fix

* fix
This commit is contained in:
Marc Sun
2025-10-03 17:51:17 +02:00
committed by GitHub
parent c2b3cc3e64
commit 1bc75db9bd

View File

@ -298,7 +298,7 @@ class TrainingArguments:
`max_steps` is reached.
lr_scheduler_type (`str` or [`SchedulerType`], *optional*, defaults to `"linear"`):
The scheduler type to use. See the documentation of [`SchedulerType`] for all possible values.
lr_scheduler_kwargs ('dict', *optional*, defaults to {}):
lr_scheduler_kwargs (`dict` or `str`, *optional*, defaults to `None`):
The extra arguments for the lr_scheduler. See the documentation of each scheduler for possible values.
warmup_ratio (`float`, *optional*, defaults to 0.0):
Ratio of total training steps used for a linear warmup from 0 to `learning_rate`.
@ -880,8 +880,8 @@ class TrainingArguments:
default="linear",
metadata={"help": "The scheduler type to use."},
)
lr_scheduler_kwargs: Union[dict[str, Any], str] = field(
default_factory=dict,
lr_scheduler_kwargs: Optional[Union[dict, str]] = field(
default=None,
metadata={
"help": (
"Extra parameters for the lr_scheduler such as {'num_cycles': 1} for the cosine with hard restarts."