TypeError: zipnn_hf.<locals>.custom_load_state_dict() got an unexpected keyword argument 'map_location'
#1
by
Wuyouz
- opened
Hello, Thanks for uploading the model, I tried to use in my space https://huggingface.co/spaces/Wuyouz/English-Writing-Teacher/blob/main/app.py, but got an error:
Traceback (most recent call last):
File "/home/user/app/app.py", line 13, in <module>
model = AutoModelForPreTraining.from_pretrained("royleibov/Llama-3.2-11B-Vision-Instruct-ZipNN-Compressed")
File "/usr/local/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 564, in from_pretrained
return model_class.from_pretrained(
File "/usr/local/lib/python3.10/site-packages/zipnn/zipnn.py", line 1246, in custom_from_pretrained
return original_from_pretrained.__func__(
File "/usr/local/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4238, in from_pretrained
) = cls._load_pretrained_model(
File "/usr/local/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4719, in _load_pretrained_model
state_dict = load_state_dict(
TypeError: zipnn_hf.<locals>.custom_load_state_dict() got an unexpected keyword argument 'map_location'
Does it mean it supports GPU instances only?
it is caused by the transformers version, I used back to transformers==4.45.0, it works.
Wuyouz
changed discussion status to
closed
Thanks for opening the issue!
In ZipNN version 0.4.0, we fixed this issue, so you can work with any transformer version you prefer.