diff --git a/src/axolotl/utils/models.py b/src/axolotl/utils/models.py index 6d94cd674..7181cca31 100644 --- a/src/axolotl/utils/models.py +++ b/src/axolotl/utils/models.py @@ -202,7 +202,7 @@ def load_model( else True, ) load_in_8bit = False - elif cfg.is_llama_derived_model: + elif cfg.is_llama_derived_model and not cfg.trust_remote_code: from transformers import LlamaForCausalLM config = LlamaConfig.from_pretrained(base_model_config) @@ -241,7 +241,7 @@ def load_model( # device=cfg.device, # ) # model.train() # sets to train instead of eval mode - elif model_type: + elif model_type and not cfg.trust_remote_code: model = getattr(transformers, model_type).from_pretrained( base_model, load_in_8bit=cfg.load_in_8bit and cfg.adapter is not None,