skip explicit model type too if using trust_remote_code

This commit is contained in:
Wing Lian
2023-07-07 21:33:11 -04:00
parent 66afb76a15
commit d69da99c2c

View File

@@ -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,