Error: cannot import name 'split_torch_state_dict_into_shards' from 'huggingface_hub' #14605
-
Facing the mentioned error when trying the following:
This is the complete traceback:
Versions used
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
The error "cannot import name 'split_torch_state_dict_into_shards' from 'huggingface_hub'" is likely due to a version mismatch between the To resolve this issue, ensure that you are using compatible versions of these libraries. Based on your provided versions, Update your pip install --upgrade huggingface-hub==0.24.0 After updating, your [tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
llama-index = "0.10.22"
huggingface-hub = "^0.24.0"
transformers = "^4.37.0" Then, run |
Beta Was this translation helpful? Give feedback.
-
In my case I had to pin "accelerate" to 0.31.0 |
Beta Was this translation helpful? Give feedback.
The error you're encountering is due to the
split_torch_state_dict_into_shards
function not being available inhuggingface-hub
version 0.20.3. This function is included starting from version 0.23.0.To resolve this issue, update the
huggingface-hub
library to version 0.23.0 or later:This should include the required function and resolve the import error [1].
To continue talking to Dosu, mention @dosu.