# Not a valid JSON file

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-a-valid-json-file%2F22900%3E%5C
**Category:** 🤗Transformers\
**Created:** [September 9, 2022, 6:47pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-a-valid-json-file%2F22900 "2022-09-09T18:47:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugginfaces](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@hugginfaces](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fhugginfaces)%5C
**Post date:** [September 9, 2022, 6:47pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-a-valid-json-file%2F22900%2F1 "2022-09-09T18:47:27Z")

</div>

Hi - first post here.

I am trying to run the deforum diffusion collab & I’m getting this error when running select & load model

OSError: It looks like the config file at ‘/root/.cache/huggingface/transformers/9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142’ is not a valid JSON file.

* * *

JSONDecodeError Traceback (most recent call last)  
/usr/local/lib/python3.7/dist-packages/transformers/configuration\_utils.py in \_get\_config\_dict(cls, pretrained\_model\_name\_or\_path, \*\*kwargs)  
671 # Load config dict  
 → 672 config\_dict = cls.\_dict\_from\_json\_file(resolved\_config\_file)  
673 except (json.JSONDecodeError, UnicodeDecodeError):

14 frames  
JSONDecodeError: Expecting property name enclosed in double quotes: line 88 column 3 (char 2317)

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)  
/usr/local/lib/python3.7/dist-packages/transformers/configuration\_utils.py in \_get\_config\_dict(cls, pretrained\_model\_name\_or\_path, \*\*kwargs)  
673 except (json.JSONDecodeError, UnicodeDecodeError):  
674 raise EnvironmentError(  
 → 675 f"It looks like the config file at ‘{resolved\_config\_file}’ is not a valid JSON file."  
676 )  
677

OSError: It looks like the config file at ‘/root/.cache/huggingface/transformers/9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142’ is not a valid JSON file.

---

<div class="post-metadata">

**Author:** ![sunnyod](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@sunnyod](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsunnyod)%5C
**Post date:** [September 9, 2022, 7:01pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-a-valid-json-file%2F22900%2F2 "2022-09-09T19:01:43Z")

</div>

Hi I got exactly the same error, except I installed under my user’s home directory so the .cache directory is under there. The cache filename is exactly the same as yours lol

FYI. I’ve installed SD on fedora linux and am running:

```auto
python scripts/txt2img.py --prompt "a fish wearing a hat" --plms --ckpt sd-v1-4.ckpt --skip_grid --n_samples 1

```

This is the full error:

```auto
~/Developer/stable-diffusion/ python scripts/txt2img.py --prompt "small man with a big hat wearing pyjamas" --plms --ckpt sd-v1-4-full-ema.ckpt --skip_grid --n_samples 1
Global seed set to 42
Loading model from sd-v1-4-full-ema.ckpt
Global Step: 470000
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Traceback (most recent call last):
  File "/home/sunny/.conda/envs/ldm/lib/python3.8/site-packages/transformers/configuration_utils.py", line 650, in _get_config_dict
    config_dict = cls._dict_from_json_file(resolved_config_file)
  File "/home/sunny/.conda/envs/ldm/lib/python3.8/site-packages/transformers/configuration_utils.py", line 734, in _dict_from_json_file
    return json.loads(text)
  File "/home/sunny/.conda/envs/ldm/lib/python3.8/json/ __init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/home/sunny/.conda/envs/ldm/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/sunny/.conda/envs/ldm/lib/python3.8/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 88 column 3 (char 2317)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scripts/txt2img.py", line 344, in <module>
    main()
  File "scripts/txt2img.py", line 240, in main
    model = load_model_from_config(config, f"{opt.ckpt}")
  File "scripts/txt2img.py", line 54, in load_model_from_config
    model = instantiate_from_config(config.model)
  File "/home/sunny/Developer/stable-diffusion/ldm/util.py", line 85, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "/home/sunny/Developer/stable-diffusion/ldm/models/diffusion/ddpm.py", line 461, in __init__
    self.instantiate_cond_stage(cond_stage_config)
  File "/home/sunny/Developer/stable-diffusion/ldm/models/diffusion/ddpm.py", line 519, in instantiate_cond_stage
    model = instantiate_from_config(config)
  File "/home/sunny/Developer/stable-diffusion/ldm/util.py", line 85, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "/home/sunny/Developer/stable-diffusion/ldm/modules/encoders/modules.py", line 142, in __init__
    self.transformer = CLIPTextModel.from_pretrained(version)
  File "/home/sunny/.conda/envs/ldm/lib/python3.8/site-packages/transformers/modeling_utils.py", line 1764, in from_pretrained
    config, model_kwargs = cls.config_class.from_pretrained(
  File "/home/sunny/.conda/envs/ldm/lib/python3.8/site-packages/transformers/models/clip/configuration_clip.py", line 126, in from_pretrained
    config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/sunny/.conda/envs/ldm/lib/python3.8/site-packages/transformers/configuration_utils.py", line 553, in get_config_dict
    config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/sunny/.conda/envs/ldm/lib/python3.8/site-packages/transformers/configuration_utils.py", line 652, in _get_config_dict
    raise EnvironmentError(
OSError: It looks like the config file at '/home/sunny/.cache/huggingface/transformers/9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142' is not a valid JSON file.

```

---

<div class="post-metadata">

**Author:** ![didierkobi](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@didierkobi](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdidierkobi)%5C
**Post date:** [September 9, 2022, 7:04pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-a-valid-json-file%2F22900%2F3 "2022-09-09T19:04:38Z")

</div>

Same issue here: was just fine a few hours ago and now I am unable to load SD model in 2 different colab environments.

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [September 9, 2022, 7:23pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-a-valid-json-file%2F22900%2F4 "2022-09-09T19:23:40Z")

</div>

Should be fixed now!

---

<div class="post-metadata">

**Author:** ![hugginfaces](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@hugginfaces](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fhugginfaces)%5C
**Post date:** [September 9, 2022, 8:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-a-valid-json-file%2F22900%2F5 "2022-09-09T20:32:29Z")

</div>

![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/9/908805faf34a3ab5114ac20997cb6ad5e9784e01.jpeg)

---

<div class="post-metadata">

**Author:** ![hugginfaces](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@hugginfaces](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fhugginfaces)%5C
**Post date:** [September 9, 2022, 8:33pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-a-valid-json-file%2F22900%2F6 "2022-09-09T20:33:12Z")

</div>

![Screen Shot 2022-09-09 at 3.29.02 PM](https://us1.discourse-cdn.com/hellohellohello/original/2X/a/a6bc9d075c5bf46f267558dcfe558fbe48a7a350.png)
