Skip to content

Commit

Permalink
Merge pull request axolotl-ai-cloud#143 from NanoCode012/fix/deprecat…
Browse files Browse the repository at this point in the history
…e-prepare-8bit-training

Fix future deprecate prepare_model_for_int8_training
  • Loading branch information
NanoCode012 authored Jun 8, 2023
2 parents 4c9e160 + 65bb499 commit 7047903
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def load_model(
)

replace_peft_model_with_int4_lora_model()
from peft import prepare_model_for_int8_training
else:
from peft import prepare_model_for_kbit_training
except Exception as err:
logging.exception(err)
raise err
Expand Down Expand Up @@ -269,8 +270,8 @@ def load_model(
(cfg.adapter == "lora" and load_in_8bit)
or (cfg.adapter == "qlora" and cfg.load_in_4bit)
):
logging.info("converting PEFT model w/ prepare_model_for_int8_training")
model = prepare_model_for_int8_training(model)
logging.info("converting PEFT model w/ prepare_model_for_kbit_training")
model = prepare_model_for_kbit_training(model)

model, lora_config = load_adapter(model, cfg, adapter)

Expand Down

0 comments on commit 7047903

Please sign in to comment.