# Problem spanning an endpoint from a personal repository with a custome handler

**URL:** <https://discuss.huggingface.co/t/problem-spanning-an-endpoint-from-a-personal-repository-with-a-custome-handler/113147>\
**Category:** Inference Endpoints on the Hub\
**Created:** [October 21, 2024, 9:24am UTC](https://discuss.huggingface.co/t/problem-spanning-an-endpoint-from-a-personal-repository-with-a-custome-handler/113147 "2024-10-21T09:24:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AhmadMM2024](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@AhmadMM2024](https://discuss.huggingface.co/u/AhmadMM2024)\
**Post date:** [October 21, 2024, 9:24am UTC](https://discuss.huggingface.co/t/problem-spanning-an-endpoint-from-a-personal-repository-with-a-custome-handler/113147/1 "2024-10-21T09:24:48Z")

</div>

I am trying to span an inference endpoint for Falcon 40B.  
However I want to have a custom handling of the model and its output.  
So I duplicated the repo into my account and created the handler.py file.

However before even the logs start being generated, I am getting an error as following:

```auto
Exit code: 1. Reason: 1487, in _hf_hub_download_to_local_dir
    _download_to_tmp_and_move(
  File "/usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 1884, in _download_to_tmp_and_move
    http_get(
  File "/usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 459, in http_get
    r = _request_wrapper(
        ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 396, in _request_wrapper
    hf_raise_for_status(response)
  File "/usr/local/lib/python3.11/site-packages/huggingface_hub/utils/_errors.py", line 367, in hf_raise_for_status
    raise HfHubHTTPError(message, response=response) from e
huggingface_hub.utils._errors.HfHubHTTPError: 

403 Forbidden: None.
Cannot access content at: https://cdn-lfs.hf.co/repos/bf/e9/...
If you are trying to create or update content,make sure you have a token with the `write` role.
Last status 1
Unable to download repo correctly after 6 attempts

```

Any though why this might be happening as spanning Falcon 40B itself worked out.  
N.B: The repo is owned by my account.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 21, 2024, 10:55am UTC](https://discuss.huggingface.co/t/problem-spanning-an-endpoint-from-a-personal-repository-with-a-custome-handler/113147/2 "2024-10-21T10:55:43Z")

</div>

I think this happens when the `README.md` (YAML part) is improperly set up, or when the **private** setting is used but the token is not passed. That model doesn’t seem to be gated.

> [@Error 403! What to do about it?](https://discuss.huggingface.co/t/error-403-what-to-do-about-it/12983/38?page=2):
>
> That works!! Thanks a lot saluting_face saluting_face saluting_face

---

<div class="post-metadata">

**Author:** ![AhmadMM2024](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@AhmadMM2024](https://discuss.huggingface.co/u/AhmadMM2024)\
**Post date:** [October 21, 2024, 11:56am UTC](https://discuss.huggingface.co/t/problem-spanning-an-endpoint-from-a-personal-repository-with-a-custome-handler/113147/4 "2024-10-21T11:56:20Z")

</div>

Thanks for sharing thoughs :-).

How you can pass the token when you are on inference endpoint interface.  
set HF\_TOKEN as an environment variable? This didn’t work.  
Also the repo is mine personal public and it is not gated.  
Also the repo is duplicated from the original Falcon 40B so the readme should be valid.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 21, 2024, 12:00pm UTC](https://discuss.huggingface.co/t/problem-spanning-an-endpoint-from-a-personal-repository-with-a-custome-handler/113147/5 "2024-10-21T12:00:23Z")

</div>

The private repo will be in 404 status for others or even for the owner without a password, so I think we need to give them a token or make it public somehow.  
As for how to pass a token, you can pass it to almost all HF function with the `token=` argument.

---

<div class="post-metadata">

**Author:** ![AhmadMM2024](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@AhmadMM2024](https://discuss.huggingface.co/u/AhmadMM2024)\
**Post date:** [October 21, 2024, 12:12pm UTC](https://discuss.huggingface.co/t/problem-spanning-an-endpoint-from-a-personal-repository-with-a-custome-handler/113147/6 "2024-10-21T12:12:15Z")

</div>

I am talking in the setting of an “_Inference Endpoint_”. You can’t pass a token programmatically. Again the repo is public and you can download it normally through colab.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 21, 2024, 12:19pm UTC](https://discuss.huggingface.co/t/problem-spanning-an-endpoint-from-a-personal-repository-with-a-custome-handler/113147/7 "2024-10-21T12:19:55Z")

</div>

> I am talking in the setting of an “_Inference Endpoint_”.

Very sorry… I was completely wrong. Surely here is the Endpoint category!  
If so, it’s a strange error?

> **[Hub API Endpoints](https://huggingface.co/docs/hub/api)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.
