# Pinned model still needs to load

**URL:** <https://discuss.huggingface.co/t/pinned-model-still-needs-to-load/12006>\
**Category:** Beginners\
**Created:** [November 18, 2021, 1:57am UTC](https://discuss.huggingface.co/t/pinned-model-still-needs-to-load/12006 "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](https://discuss.huggingface.co/u/Connorvr)\
**Post date:** [November 18, 2021, 1:57am UTC](https://discuss.huggingface.co/t/pinned-model-still-needs-to-load/12006/1 "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 = "https://api-inference.huggingface.co/usage/pinned_models"
    response = requests.get(pin_url, headers=request_headers)

```

The model is called through the following code:

```
   api_endpoint = 'https://api-inference.huggingface.co/models/<username>/<model_name>'
   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](https://discuss.huggingface.co/u/dmz)\
**Post date:** [January 13, 2022, 8:28pm UTC](https://discuss.huggingface.co/t/pinned-model-still-needs-to-load/12006/2 "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](https://discuss.huggingface.co/u/abhig)\
**Post date:** [September 12, 2022, 10:51pm UTC](https://discuss.huggingface.co/t/pinned-model-still-needs-to-load/12006/3 "2022-09-12T22:51:20Z")

</div>

still not solved
