Skip to content

Commit

Permalink
allow user to force trust_remote_code=true via from_pretrained kwargs (
Browse files Browse the repository at this point in the history
  • Loading branch information
Butanium authored May 15, 2024
1 parent 0fd85b9 commit 5a374ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions transformer_lens/loading_from_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,8 @@ def convert_hf_model_config(model_name: str, **kwargs):
cfg_dict["original_architecture"] = architecture
# The name such that AutoTokenizer.from_pretrained works
cfg_dict["tokenizer_name"] = official_model_name
if kwargs.get("trust_remote_code", False):
cfg_dict["trust_remote_code"] = True
return cfg_dict


Expand Down

0 comments on commit 5a374ec

Please sign in to comment.