Skip to content

Commit 5a374ec

Browse files
authored
allow user to force trust_remote_code=true via from_pretrained kwargs (#597)
1 parent 0fd85b9 commit 5a374ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

transformer_lens/loading_from_pretrained.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,8 @@ def convert_hf_model_config(model_name: str, **kwargs):
11471147
cfg_dict["original_architecture"] = architecture
11481148
# The name such that AutoTokenizer.from_pretrained works
11491149
cfg_dict["tokenizer_name"] = official_model_name
1150+
if kwargs.get("trust_remote_code", False):
1151+
cfg_dict["trust_remote_code"] = True
11501152
return cfg_dict
11511153

11521154

0 commit comments

Comments
 (0)