"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "707105290b0825c8fd01c977d33ec8f8833c937f"
Unverified Commit 892b13d3 authored by Yasmin Moslem's avatar Yasmin Moslem Committed by GitHub
Browse files

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: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>

---------
Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
parent 21339a52
...@@ -1797,6 +1797,9 @@ class TrainingArguments: ...@@ -1797,6 +1797,9 @@ class TrainingArguments:
" during training" " 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): if isinstance(self.fsdp, bool):
self.fsdp = "full_shard" if self.fsdp else "" self.fsdp = "full_shard" if self.fsdp else ""
if isinstance(self.fsdp, str): if isinstance(self.fsdp, str):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment