From 896c1aebcf99086ca5a34db02aae58ecc4bb3edc Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Fri, 14 Jul 2023 12:56:07 +0900 Subject: [PATCH 1/3] Feat(docs): Add model_revision arg --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6b81e69de..a380f237f 100644 --- a/README.md +++ b/README.md @@ -305,6 +305,8 @@ base_model_ignore_patterns: # if the base_model repo on hf hub doesn't include configuration .json files, # you can set that here, or leave this empty to default to base_model base_model_config: ./llama-7b-hf +# you can specify to choose a specific model revision from huggingface hub +model_revision: # Optional tokenizer configuration override in case you want to use a different tokenizer # than the one defined in the base model tokenizer_config: From 1514739f0ffc3346fa3cc0ba2dc60bb1d11ac81f Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Fri, 14 Jul 2023 13:17:49 +0900 Subject: [PATCH 2/3] Set push to hub as private by default --- src/axolotl/utils/trainer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/axolotl/utils/trainer.py b/src/axolotl/utils/trainer.py index 98ff9b3b9..139961f75 100644 --- a/src/axolotl/utils/trainer.py +++ b/src/axolotl/utils/trainer.py @@ -181,6 +181,7 @@ def setup_trainer(cfg, train_dataset, eval_dataset, model, tokenizer): if cfg.hub_model_id: training_arguments_kwargs["hub_model_id"] = cfg.hub_model_id training_arguments_kwargs["push_to_hub"] = True + training_arguments_kwargs["hub_private_repo"] = True training_args = AxolotlTrainingArguments( per_device_train_batch_size=cfg.micro_batch_size, From 5491278a799262523b6575d96decd674cf3d93e4 Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Fri, 14 Jul 2023 13:21:47 +0900 Subject: [PATCH 3/3] Feat: Add save_safetensors --- README.md | 3 +++ src/axolotl/utils/trainer.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 6b81e69de..d83fdc7fd 100644 --- a/README.md +++ b/README.md @@ -411,6 +411,9 @@ logging_steps: save_steps: eval_steps: +# save model as safetensors (require safetensors package) +save_safetensors: + # whether to mask out or include the human's prompt from the training labels train_on_inputs: false # don't use this, leads to wonky training (according to someone on the internet) diff --git a/src/axolotl/utils/trainer.py b/src/axolotl/utils/trainer.py index 98ff9b3b9..d5697a9fe 100644 --- a/src/axolotl/utils/trainer.py +++ b/src/axolotl/utils/trainer.py @@ -182,6 +182,9 @@ def setup_trainer(cfg, train_dataset, eval_dataset, model, tokenizer): training_arguments_kwargs["hub_model_id"] = cfg.hub_model_id training_arguments_kwargs["push_to_hub"] = True + if cfg.save_safetensors: + training_arguments_kwargs["save_safetensors"] = cfg.save_safetensors + training_args = AxolotlTrainingArguments( per_device_train_batch_size=cfg.micro_batch_size, per_device_eval_batch_size=cfg.eval_batch_size