JSON Decode Error/.Cache Missing File

#9
by vsiddons - opened

Things I have already tried:

  • Clearing the .cache
  • Reinstalling transformers
  • deleting the model and reloading it

Here is the traceback:

Traceback (most recent call last):
  File "/N/u/vsiddons/BigRed200/.local/lib/python3.11/site-packages/transformers/image_processing_base.py", line 371, in get_image_processor_dict
    image_processor_dict = json.loads(text)
                           ^^^^^^^^^^^^^^^^
  File "/N/soft/sles15/deeplearning/Python-3.11.5/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/N/soft/sles15/deeplearning/Python-3.11.5/lib/python3.11/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 25 column 1 (char 432)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
Could not set the permissions on the file '/N/u/vsiddons/BigRed200/.cache/huggingface/hub/models--Salesforce--blip2-flan-t5-xxl/blobs/0b0fa393c4e1fa80a41fd3b84e022c6e3488230e.incomplete'. Error: [Errno 2] No such file or directory: '/N/u/vsiddons/BigRed200/.cache/huggingface/hub/models--Salesforce--blip2-flan-t5-xxl/blobs/0b0fa393c4e1fa80a41fd3b84e022c6e3488230e.incomplete'.
Continuing without setting permissions.
  File "/N/u/vsiddons/BigRed200/new_metmeme/train_blip.py", line 250, in <module>
    main()
  File "/N/u/vsiddons/BigRed200/new_metmeme/train_blip.py", line 160, in main
    processor = Blip2Processor.from_pretrained("Salesforce/blip2-flan-t5-xxl")
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/N/u/vsiddons/BigRed200/.local/lib/python3.11/site-packages/transformers/processing_utils.py", line 974, in from_pretrained
    args = cls._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs)
Traceback (most recent call last):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/N/soft/sles15/deeplearning/Python-3.11.5/lib/python3.11/shutil.py", line 825, in move
  File "/N/u/vsiddons/BigRed200/.local/lib/python3.11/site-packages/transformers/processing_utils.py", line 1020, in _get_arguments_from_pretrained
    args.append(attribute_class.from_pretrained(pretrained_model_name_or_path, **kwargs))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/N/u/vsiddons/BigRed200/.local/lib/python3.11/site-packages/transformers/image_processing_base.py", line 209, in from_pretrained
    image_processor_dict, kwargs = cls.get_image_processor_dict(pretrained_model_name_or_path, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/N/u/vsiddons/BigRed200/.local/lib/python3.11/site-packages/transformers/image_processing_base.py", line 374, in get_image_processor_dict
    raise EnvironmentError(
OSError: It looks like the config file at '/N/u/vsiddons/BigRed200/.cache/huggingface/hub/models--Salesforce--blip2-flan-t5-xxl/snapshots/847ce5bfa5c6b374da8f3216c50c64e2142edbed/preprocessor_config.json' is not a valid JSON file.
Traceback (most recent call last):
  File "/N/u/vsiddons/BigRed200/.local/lib/python3.11/site-packages/transformers/image_processing_base.py", line 371, in get_image_processor_dict
Traceback (most recent call last):
  File "/N/u/vsiddons/BigRed200/.local/lib/python3.11/site-packages/transformers/image_processing_base.py", line 371, in get_image_processor_dict
    image_processor_dict = json.loads(text)
                           ^^^^^^^^^^^^^^^^
  File "/N/soft/sles15/deeplearning/Python-3.11.5/lib/python3.11/json/__init__.py", line 346, in loads
    image_processor_dict = json.loads(text)
    os.rename(src, real_dst)
    return _default_decoder.decode(s)
                           ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/N/u/vsiddons/BigRed200/.cache/huggingface/hub/models--Salesforce--blip2-flan-t5-xxl/blobs/0b0fa393c4e1fa80a41fd3b84e022c6e3488230e.incomplete' -> '/N/u/vsiddons/BigRed200/.cache/huggingface/hub/models--Salesforce--blip2-flan-t5-xxl/blobs/0b0fa393c4e1fa80a41fd3b84e022c6e3488230e'

This happens when I run:

model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-flan-t5-xxl", torch_dtype= torch.bfloat16, device_map= device)

Sign up or log in to comment