Skip to content

Commit

Permalink
fix #5797
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga authored Oct 23, 2024
1 parent 74a79cc commit b4c7dd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/llamafactory/model/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ def load_model(
load_class = AutoModelForVision2Seq
else:
load_class = AutoModelForCausalLM

if model_args.train_from_scratch:
model = load_class.from_config(config)
model = load_class.from_config(config, trust_remote_code=True)
else:
model = load_class.from_pretrained(**init_kwargs)

Expand Down

0 comments on commit b4c7dd3

Please sign in to comment.