Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/model-conversion/scripts/causal/run-org-model.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def fn(_m, input, output):
"Model path must be specified either via --model-path argument or MODEL_PATH environment variable"
)

config = AutoConfig.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)

print("Model type: ", config.model_type)
print("Vocab size: ", config.vocab_size)
Expand All @@ -148,8 +148,8 @@ def fn(_m, input, output):
print("EOS token id: ", config.eos_token_id)

print("Loading model and tokenizer using AutoTokenizer:", model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)

if unreleased_model_name:
model_name_lower = unreleased_model_name.lower()
Expand All @@ -171,7 +171,7 @@ def fn(_m, input, output):
exit(1)
else:
model = AutoModelForCausalLM.from_pretrained(
model_path, device_map="auto", offload_folder="offload"
model_path, device_map="auto", offload_folder="offload", trust_remote_code=True
)

for name, module in model.named_modules():
Expand Down