Merge pull request #266 from OpenAccess-AI-Collective/trust-remote-no-llama
Browse files
src/axolotl/utils/models.py
CHANGED
@@ -202,7 +202,7 @@ def load_model(
|
|
202 |
else True,
|
203 |
)
|
204 |
load_in_8bit = False
|
205 |
-
elif cfg.is_llama_derived_model:
|
206 |
from transformers import LlamaForCausalLM
|
207 |
|
208 |
config = LlamaConfig.from_pretrained(base_model_config)
|
@@ -241,7 +241,7 @@ def load_model(
|
|
241 |
# device=cfg.device,
|
242 |
# )
|
243 |
# model.train() # sets to train instead of eval mode
|
244 |
-
elif model_type:
|
245 |
model = getattr(transformers, model_type).from_pretrained(
|
246 |
base_model,
|
247 |
load_in_8bit=cfg.load_in_8bit and cfg.adapter is not None,
|
|
|
202 |
else True,
|
203 |
)
|
204 |
load_in_8bit = False
|
205 |
+
elif cfg.is_llama_derived_model and not cfg.trust_remote_code:
|
206 |
from transformers import LlamaForCausalLM
|
207 |
|
208 |
config = LlamaConfig.from_pretrained(base_model_config)
|
|
|
241 |
# device=cfg.device,
|
242 |
# )
|
243 |
# model.train() # sets to train instead of eval mode
|
244 |
+
elif model_type and not cfg.trust_remote_code:
|
245 |
model = getattr(transformers, model_type).from_pretrained(
|
246 |
base_model,
|
247 |
load_in_8bit=cfg.load_in_8bit and cfg.adapter is not None,
|