# 403 Client Error: Forbidden for url:

**URL:** <https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563>\
**Category:** Models\
**Created:** [December 6, 2021, 12:10pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563 "2021-12-06T12:10:40Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![giovanni94s](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@giovanni94s](https://discuss.huggingface.co/u/giovanni94s)\
**Post date:** [December 6, 2021, 12:10pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/1 "2021-12-06T12:10:40Z")

</div>

hi guys, I have this problem using paraphrase-distilroberta-base-v2 model.  
once I call the model through in my python code:

model = SentenceTransformer(‘sentence-transformers/paraphrase-distilroberta-base-v2’)

this error appear:  
403 Client Error: Forbidden for url: [https://huggingface.co/sentence-transformers/distiluse-base-multilingual-cased-v2/resolve/486c69f0e5395a86ef58883e1c18e475cc7b8aba/.gitattributes](https://huggingface.co/sentence-transformers/distiluse-base-multilingual-cased-v2/resolve/486c69f0e5395a86ef58883e1c18e475cc7b8aba/.gitattributes)

same thing if I use Hosted inference API in model main page.  
Some advise about this problem?

---

<div class="post-metadata">

**Author:** ![pierreguillou](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pierreguillou/32/19626_2.png) [@pierreguillou](https://discuss.huggingface.co/u/pierreguillou)\
**Post date:** [December 6, 2021, 12:50pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/2 "2021-12-06T12:50:42Z")

</div>

Hi @giovanni94s,

I guess there is today a problem in the Hugging Face hub as I even can not edit a model or a datasets card in my profile. @julien-c can you help us? Thank you.

---

<div class="post-metadata">

**Author:** ![sasikiran](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sasikiran](https://discuss.huggingface.co/u/sasikiran)\
**Post date:** [December 6, 2021, 2:26pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/3 "2021-12-06T14:26:53Z")

</div>

I’m also facing the issue for a different model, both in production code and as well as the hosted API.  
`Cannot GET /sentence-transformers/multi-qa-MiniLM-L6-cos-v1/resolve/1de23253abdbc620a58070d408055cc9a8439375`

For now, I copied the model and loaded it from the local path. I would like to know why it errored out as well.

---

<div class="post-metadata">

**Author:** ![giovanni94s](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@giovanni94s](https://discuss.huggingface.co/u/giovanni94s)\
**Post date:** [December 6, 2021, 2:28pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/4 "2021-12-06T14:28:09Z")

</div>

@sasikiran can you show me how to copy the model and load it locally?

---

<div class="post-metadata">

**Author:** ![kjackson](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@kjackson](https://discuss.huggingface.co/u/kjackson)\
**Post date:** [December 6, 2021, 2:28pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/5 "2021-12-06T14:28:50Z")

</div>

Having the same issue with ‘sentence-transformers/all-mpnet-base-v2’. I saw there was an earlier thread on this too

> [@Batch transform inference job - downloading model from the Hugging Face Hub on start up](https://discuss.huggingface.co/t/batch-transform-inference-job-downloading-model-from-the-hugging-face-hub-on-start-up/10632):
>
> I try to run However I get this error: requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: [[https://huggingface.co/api/models/cardiffnlp/twitter-roberta-base-sentiment](https://huggingface.co/api/models/cardiffnlp/twitter-roberta-base-sentiment)] It looks like an instance created by AWS SageMaker (client) is not allowed to download the model. Something specific I need to add in the role I use with AWS Sagemaker? or there is an issue with a token in model\_info = \_api.model\_info(repo\_id=model\_id, revision=revision, token=use\_auth\_token) Thanks, Kate

Weirdly, I’m only getting it when trying to run batch on sagemaker

where I do it locally it works fine eg  
model = AutoModel.from\_pretrained(‘sentence-transformers/paraphrase-distilroberta-base-v2’)  
and  
model = AutoModel.from\_pretrained(‘sentence-transformers/all-mpnet-base-v2’)

Checking the cloud log

> This is an experimental beta features, which allows downloading model from the Hugging Face Hub on start up. It loads the model defined in the env var `HF_MODEL_ID`

Then immediately followed by the 403 error

---

<div class="post-metadata">

**Author:** ![sasikiran](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sasikiran](https://discuss.huggingface.co/u/sasikiran)\
**Post date:** [December 6, 2021, 2:31pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/6 "2021-12-06T14:31:37Z")

</div>

@giovanni94s I was able to find the cached model located at:

`~/.cache/torch/sentence_transformers`.

I then copied the model directory to `./models` and used:

`model = SentenceTransformer('./models/sentence-transformers_multi-qa-MiniLM-L6-cos-v1')` to load it from the local path. I believe it should be possible to download the model if it isn’t available in the cache directory.

---

<div class="post-metadata">

**Author:** ![sasikiran](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sasikiran](https://discuss.huggingface.co/u/sasikiran)\
**Post date:** [December 6, 2021, 2:33pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/7 "2021-12-06T14:33:44Z")

</div>

Weird. For me, it failed on EC2 server. Then, I loaded the model using a local path.

---

<div class="post-metadata">

**Author:** ![giovanni94s](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@giovanni94s](https://discuss.huggingface.co/u/giovanni94s)\
**Post date:** [December 6, 2021, 2:35pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/8 "2021-12-06T14:35:19Z")

</div>

I think is a problem from server side. Let’s wait for an answer

---

<div class="post-metadata">

**Author:** ![giovanni94s](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@giovanni94s](https://discuss.huggingface.co/u/giovanni94s)\
**Post date:** [December 6, 2021, 2:40pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/9 "2021-12-06T14:40:50Z")

</div>

@sasikiran @pierreguillou now the model seems to be downloaded correctly. Confirm from your side?

---

<div class="post-metadata">

**Author:** ![sasikiran](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sasikiran](https://discuss.huggingface.co/u/sasikiran)\
**Post date:** [December 6, 2021, 2:53pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/10 "2021-12-06T14:53:55Z")

</div>

Yes, it’s working now on the hosted API. I believe it would work on EC2 as well but for now, I would continue loading it from local path.

---

<div class="post-metadata">

**Author:** ![pierreguillou](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pierreguillou/32/19626_2.png) [@pierreguillou](https://discuss.huggingface.co/u/pierreguillou)\
**Post date:** [December 6, 2021, 3:20pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/11 "2021-12-06T15:20:37Z")

</div>

I can edit model and dataset card but **I can not create a new one from the web** inside my Hugging face perfil: I still get **403 Forbidden**.

PS: I do it inside the HF account of a organization where I’m an `admin` member.

 ![createdcard](https://us1.discourse-cdn.com/hellohellohello/original/2X/e/edab6bf933e9a2833f73294ab83085a125fd6bd9.png)  
 ![card](https://us1.discourse-cdn.com/hellohellohello/original/2X/2/21eb335ef2eca04991660fd7faa1578a2e2b0f48.png)

---

<div class="post-metadata">

**Author:** ![kjackson](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@kjackson](https://discuss.huggingface.co/u/kjackson)\
**Post date:** [December 6, 2021, 4:06pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/12 "2021-12-06T16:06:49Z")

</div>

I still have same issue with sagemaker no matter what model I call it seems ☹

---

<div class="post-metadata">

**Author:** ![Kateryna](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@Kateryna](https://discuss.huggingface.co/u/Kateryna)\
**Post date:** [December 7, 2021, 3:56am UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/13 "2021-12-07T03:56:06Z")

</div>

So you run it from SageMaker Studio and receive the error but if you start a batch job from your local environment it does work?

I have the same log message but I start from the local environment

Thanks,  
Kate

---

<div class="post-metadata">

**Author:** ![lewtun](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lewtun/32/30995_2.png) [@lewtun](https://discuss.huggingface.co/u/lewtun)\
**Post date:** [December 7, 2021, 8:39am UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/14 "2021-12-07T08:39:17Z")

</div>

Hey everyone, thanks for reporting the issue - it’s now fixed so you should be able to download the pretrained models as normal 🙂

---

<div class="post-metadata">

**Author:** ![pierreguillou](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pierreguillou/32/19626_2.png) [@pierreguillou](https://discuss.huggingface.co/u/pierreguillou)\
**Post date:** [December 7, 2021, 10:40am UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/15 "2021-12-07T10:40:30Z")

</div>

Great! It Works (I can create a card for a dataset in the HF hub). Thank you @lewtun .

---

<div class="post-metadata">

**Author:** ![kjackson](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@kjackson](https://discuss.huggingface.co/u/kjackson)\
**Post date:** [December 7, 2021, 6:12pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/16 "2021-12-07T18:12:08Z")

</div>

I’m kicking off the batch job from a sagemaker notebook instance, but the batch job runs in sagemaker. It still fails with 403. I tried it from a different aws account with the same results. More detail in this thread [Error 403 when downloading model for Sagemaker batch inference - #6 by philschmid](https://discuss.huggingface.co/t/error-403-when-downloading-model-for-sagemaker-batch-inference/12571/6)

---

<div class="post-metadata">

**Author:** ![dpark354](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@dpark354](https://discuss.huggingface.co/u/dpark354)\
**Post date:** [March 9, 2022, 2:12am UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/17 "2022-03-09T02:12:37Z")

</div>

i’m still getting this error any advice?

---

<div class="post-metadata">

**Author:** ![grushaju](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/grushaju/32/47673_2.png) [@grushaju](https://discuss.huggingface.co/u/grushaju)\
**Post date:** [May 16, 2025, 1:34pm UTC](https://discuss.huggingface.co/t/403-client-error-forbidden-for-url/12563/19 "2025-05-16T13:34:44Z")

</div>

I have some problem  
403 Client Error: Forbidden for url: [https://huggingface.co/ThomasSimonini/ppo-LunarLander-v2.git/info/lfs/objects/batch](https://huggingface.co/ThomasSimonini/ppo-LunarLander-v2.git/info/lfs/objects/batch)
