mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
Add a check that warmup_setps is either 0 or >= 1 (#30764)
* Add a check that warmup_setps is either 0 or >= 1 Update training_args.py to add a check that warmup_setps is either 0 or >= 1. Otherwise, raise an error. * Update src/transformers/training_args.py Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com> --------- Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
This commit is contained in:
parent
21339a5213
commit
892b13d3cf
1 changed files with 3 additions and 0 deletions
|
|
@ -1797,6 +1797,9 @@ class TrainingArguments:
|
|||
" during training"
|
||||
)
|
||||
|
||||
if not isinstance(self.warmup_steps, int) or self.warmup_steps < 0 or 0 < self.warmup_steps <= 1:
|
||||
raise ValueError("warmup_steps must be either 0 or > 1")
|
||||
|
||||
if isinstance(self.fsdp, bool):
|
||||
self.fsdp = "full_shard" if self.fsdp else ""
|
||||
if isinstance(self.fsdp, str):
|
||||
|
|
|
|||
Loading…
Reference in a new issue