# Problem loading pretrained model that exists

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-loading-pretrained-model-that-exists%2F31074%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [February 3, 2023, 7:59pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-loading-pretrained-model-that-exists%2F31074 "2023-02-03T19:59:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alpha-Romeo](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/alpha-romeo/32/13972_2.png) [@Alpha-Romeo](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAlpha-Romeo)%5C
**Post date:** [February 3, 2023, 7:59pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-loading-pretrained-model-that-exists%2F31074%2F1 "2023-02-03T19:59:12Z")

</div>

Hi,

Im trying to load the image encoder from this repository

> **[Fantasy-Studio/Paint-by-Example at main](https://huggingface.co/Fantasy-Studio/Paint-by-Example/tree/main/image_encoder)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

Using this line of code:

> image\_encoder = PaintByExampleImageEncoder.from\_pretrained(“Fantasy-Studio/Paint-by-Example”, subfolder=“image\_encoder”)

However I get the error:  
OSError: Fantasy-Studio/Paint-by-Example does not appear to have a file named config.json.

Even though clearly there is one there in the above link. What is wrong?

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [February 3, 2023, 10:50pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-loading-pretrained-model-that-exists%2F31074%2F2 "2023-02-03T22:50:51Z")

</div>

hi @Alpha-Romeo ,

I think you can do this, where you need to explicitly pass CLIP config

```python
from diffusers.pipelines.paint_by_example import PaintByExampleImageEncoder
from transformers import CLIPVisionConfig

config = CLIPVisionConfig.from_pretrained("openai/clip-vit-large-patch14")
image_encoder = PaintByExampleImageEncoder(config)

```

---

<div class="post-metadata">

**Author:** ![Alpha-Romeo](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/alpha-romeo/32/13972_2.png) [@Alpha-Romeo](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAlpha-Romeo)%5C
**Post date:** [February 6, 2023, 4:23pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-loading-pretrained-model-that-exists%2F31074%2F3 "2023-02-06T16:23:25Z")

</div>

Thanks, this resolved the error!
