Skip to content

Commit

Permalink
move hf model to device on load
Browse files Browse the repository at this point in the history
  • Loading branch information
chanind committed Nov 10, 2024
1 parent 0c3a5b8 commit 6e9350d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sae_lens/load_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def load_model(
elif model_class_name == "AutoModelForCausalLM":
hf_model = AutoModelForCausalLM.from_pretrained(
model_name, **model_from_pretrained_kwargs
)
).to(device)
tokenizer = AutoTokenizer.from_pretrained(model_name)
return HookedProxyLM(hf_model, tokenizer)

Expand Down

0 comments on commit 6e9350d

Please sign in to comment.