From e79c8e617e1584a0fe4cac33c263237178b561ce Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Mon, 3 Jul 2023 12:44:29 +0900 Subject: [PATCH] Fix future deprecation push_to_hub_model_id --- README.md | 2 +- src/axolotl/utils/trainer.py | 4 ++-- src/axolotl/utils/validation.py | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4929987cb..e45ac54b7 100644 --- a/README.md +++ b/README.md @@ -341,7 +341,7 @@ dataset_prepared_path: data/last_run_prepared # push prepared dataset to hub push_dataset_to_hub: # repo path # push checkpoints to hub -push_to_hub_model_id: # repo path +hub_model_id: # repo path # whether to use hf `use_auth_token` for loading datasets. Useful for fetching private datasets # required to be true when used in combination with `push_dataset_to_hub` hf_use_auth_token: # boolean diff --git a/src/axolotl/utils/trainer.py b/src/axolotl/utils/trainer.py index e9ec641a6..263d6c78d 100644 --- a/src/axolotl/utils/trainer.py +++ b/src/axolotl/utils/trainer.py @@ -124,8 +124,8 @@ def setup_trainer(cfg, train_dataset, eval_dataset, model, tokenizer): if cfg.max_grad_norm: training_arguments_kwargs["max_grad_norm"] = cfg.max_grad_norm - if cfg.push_to_hub_model_id: - training_arguments_kwargs["push_to_hub_model_id"] = cfg.push_to_hub_model_id + if cfg.hub_model_id: + training_arguments_kwargs["hub_model_id"] = cfg.hub_model_id training_arguments_kwargs["push_to_hub"] = True training_args = transformers.TrainingArguments( diff --git a/src/axolotl/utils/validation.py b/src/axolotl/utils/validation.py index 2e0da69b3..43b4b1d16 100644 --- a/src/axolotl/utils/validation.py +++ b/src/axolotl/utils/validation.py @@ -92,6 +92,11 @@ def validate_config(cfg): ): logging.warning("adamw hyperparameters found, but no adamw optimizer set") + if cfg.push_to_hub_model_id: + raise ValueError( + "push_to_hub_model_id is deprecated. Please use hub_model_id instead." + ) + # TODO # MPT 7b # https://github.com/facebookresearch/bitsandbytes/issues/25