[Error] Weights only load failed

#1
by DrNicefellow - opened

I ran into the following error during loading from pretrained.
Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/transformers/modeling_utils.py", line 519, in load_state_dict
return torch.load(checkpoint_file, map_location=map_location, weights_only=True)
File "/opt/conda/lib/python3.10/site-packages/torch/serialization.py", line 1013, in load
raise pickle.UnpicklingError(UNSAFE_MESSAGE + str(e)) from None
_pickle.UnpicklingError: Weights only load failed. Re-running torch.load with weights_only set to False will likely succeed, but it can result in arbitrary code execution.Do it only if you get the file from a trusted source. WeightsUnpickler error: Unsupported operand 149

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/transformers/modeling_utils.py", line 523, in load_state_dict
if f.read(7) == "version":
File "/opt/conda/lib/python3.10/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 68: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/src/models/Tinyllamas/test_generation.py", line 114, in
test_generation(texts,model_name,model_name)
File "/src/models/Tinyllamas/test_generation.py", line 13, in test_generation
model = AutoModelForCausalLM.from_pretrained(model_name,load_in_4bit=load_in_4bit,trust_remote_code=True)
File "/opt/conda/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 566, in from_pretrained
return model_class.from_pretrained(
File "/opt/conda/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3393, in from_pretrained
state_dict = load_state_dict(resolved_archive_file)
File "/opt/conda/lib/python3.10/site-packages/transformers/modeling_utils.py", line 535, in load_state_dict
raise OSError(
OSError: Unable to load weights from pytorch checkpoint file for './step-10k-token-21B/pytorch_model.bin' at './step-10k-token-21B/pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

Sign up or log in to comment