From 08115148d5d2ffd7451c00592c5dab673444e303 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 7 Sep 2023 20:18:18 -0400 Subject: [PATCH] add validation for earl;y stopping patience --- src/axolotl/utils/config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/axolotl/utils/config.py b/src/axolotl/utils/config.py index 93a23f7738..a24eb46efc 100644 --- a/src/axolotl/utils/config.py +++ b/src/axolotl/utils/config.py @@ -217,6 +217,15 @@ def validate_config(cfg): "sample_packing not compatible with xformers_attention. Use flash_attention" ) + if cfg.early_stopping_patience: + if not cfg.save_steps or not cfg.eval_steps: + raise ValueError( + "`early_stopping_patience` requires save_steps and eval_steps to be set. eval_steps should evenly divide save_steps." + ) + if not cfg.save_steps % cfg.eval_steps != 0: + raise ValueError( + "`early_stopping_patience` requires that eval_steps should evenly divide save_steps." + ) # TODO # MPT 7b # https://github.com/facebookresearch/bitsandbytes/issues/25