AttributeError while loading the model

#9
by ojas03 - opened

while running
model = AutoModelForCausalLM.from_pretrained("jinaai/ReaderLM-v2")
on Google Colab, I encounter :

/usr/local/lib/python3.11/dist-packages/transformers/modeling_utils.py in from_pretrained(cls, pretrained_model_name_or_path, config, cache_dir, ignore_mismatched_sizes, force_download, local_files_only, token, revision, use_safetensors, weights_only, *model_args, **kwargs)
   4011                 metadata = f.metadata()
   4012 
-> 4013             if metadata.get("format") == "pt":
   4014                 pass
   4015             elif metadata.get("format") == "tf":

AttributeError: 'NoneType' object has no attribute 'get'

Any fixes?

while running
model = AutoModelForCausalLM.from_pretrained("jinaai/ReaderLM-v2")
on Google Colab, I encounter :

/usr/local/lib/python3.11/dist-packages/transformers/modeling_utils.py in from_pretrained(cls, pretrained_model_name_or_path, config, cache_dir, ignore_mismatched_sizes, force_download, local_files_only, token, revision, use_safetensors, weights_only, *model_args, **kwargs)
   4011                 metadata = f.metadata()
   4012 
-> 4013             if metadata.get("format") == "pt":
   4014                 pass
   4015             elif metadata.get("format") == "tf":

AttributeError: 'NoneType' object has no attribute 'get'

Any fixes?

python3.11 and 3.12 throw this exception, while python3.9 works properly.

use python3.9 and cuda12.1 can fix this.

Sign up or log in to comment