Skip to content

Commit

Permalink
tests(serialization): Skip using device_map (requires accelerate)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eta0 committed Jun 29, 2024
1 parent edf5d0b commit afb9606
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,8 @@ def _test_exception_decrypts(self):
# even in the event of an exception
encryption = EncryptionParams.random()
with torch.device("cpu"):
model = AutoModelForCausalLM.from_pretrained(
model_name, device_map="cpu"
)
model = AutoModelForCausalLM.from_pretrained(model_name)
self.assertEqual(model.device.type, "cpu")

model_sd = model.state_dict()
model_clone = {k: v.detach().clone() for k, v in model_sd.items()}
Expand Down

0 comments on commit afb9606

Please sign in to comment.