add support for gradient accumulation steps

This commit is contained in:
Wing Lian
2023-05-30 23:24:37 -04:00
parent c5b0af1a7e
commit 3aad5f3b3e
3 changed files with 34 additions and 3 deletions

View File

@@ -4,6 +4,10 @@ import logging
def validate_config(cfg):
if cfg.gradient_accumulation_steps and cfg.batch_size:
raise ValueError(
"please set only one of gradient_accumulation_steps or batch_size"
)
if cfg.load_4bit:
raise ValueError(
"cfg.load_4bit parameter has been deprecated and replaced by cfg.gptq"