Closed byi8220 closed 3 months ago
Whoops, might be my fault for having an out of date version of safetensors
. Seems load_model
can only take in device
on release v0.4.3 (https://github.com/huggingface/safetensors/releases). I was on v0.4.2 but after updating it works as intended.
This also implies that accelerate
depends on the versioning constraint safetensors>=0.4.3
, which is quite annoying since as of writing this comment the latest version in conda is v0.4.2
Should setup.py
require safetensors to be up to date now? Throwing out a oneline change if so: https://github.com/huggingface/accelerate/pull/2957
Several unit tests are failing with the error messages similar to
FAILED tests/test_accelerator.py::AcceleratorTester::test_save_load_model_use_safetensors - TypeError: load_model() got an unexpected keyword argument 'device'
which appears to originate from https://github.com/huggingface/accelerate/blob/main/src/accelerate/checkpointing.py#L208For the versions of the packages below, running
make test
orpytest tests/test_accelerator.py
on the main branch fails on my machine: