# Pinned model still needs to load

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpinned-model-still-needs-to-load%2F12006%3E%5C
**Category:** Beginners\
**Created:** [November 18, 2021, 1:57am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpinned-model-still-needs-to-load%2F12006 "2021-11-18T01:57:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Connorvr](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@Connorvr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FConnorvr)%5C
**Post date:** [November 18, 2021, 1:57am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpinned-model-still-needs-to-load%2F12006%2F1 "2021-11-18T01:57:37Z")

</div>

Hello,  
I have a model pinned. After a short amount of idle time the inference API still needs to load the model, i.e. it returns the message ‘Model \<username\>/\<model\_name\> is currently loading’. This is not supposed to happen, right? As I understand it, this is the whole purpose of pinning models.

I have confirmed it is indeed pinned through the code:

```
    request_headers = {
                      'Authorization': 'Bearer {}'.format(<huggingface_token>)
                      }
    pin_url = "/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fusage%2Fpinned_models"
    response = requests.get(pin_url, headers=request_headers)

```

The model is called through the following code:

```
   api_endpoint = '/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2F%3Cusername%3E%2F%3Cmodel_name%3E'
   data = json.dumps(payload)
   response = requests.request('POST',
                                api_endpoint,
                                headers=request_headers,
                                data=data)

```

I feel like I have followed everything in the documentation and don’t understand why it isn’t working.

Thank you in advance for any answers!

---

<div class="post-metadata">

**Author:** ![dmz](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/dmz/32/3720_2.png) [@dmz](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdmz)%5C
**Post date:** [January 13, 2022, 8:28pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpinned-model-still-needs-to-load%2F12006%2F2 "2022-01-13T20:28:13Z")

</div>

We’re encountering the same issue.

---

<div class="post-metadata">

**Author:** ![abhig](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@abhig](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fabhig)%5C
**Post date:** [September 12, 2022, 10:51pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpinned-model-still-needs-to-load%2F12006%2F3 "2022-09-12T22:51:20Z")

</div>

still not solved
