Skip to content

Commit

Permalink
enforce upper bound on max steps (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshannon-sil authored Nov 2, 2023
1 parent 0c31e49 commit 2174c7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions machine/jobs/huggingface/hugging_face_nmt_model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def __init__(self, config: Any, shared_file_service: SharedFileService) -> None:
args["output_dir"] = str(self._model_dir)
args["overwrite_output_dir"] = True
if "max_steps" in self._config:
if self._config.max_steps > 50000:
raise ValueError("max_steps must be less than or equal to 50000")
args["max_steps"] = self._config.max_steps
parser = HfArgumentParser(cast(Any, Seq2SeqTrainingArguments))
self._training_args = cast(Seq2SeqTrainingArguments, parser.parse_dict(args)[0])
Expand Down

0 comments on commit 2174c7d

Please sign in to comment.