# Cannot upload large files for a single repository

**URL:** <https://discuss.huggingface.co/t/cannot-upload-large-files-for-a-single-repository/88366>\
**Category:** 🤗Hub\
**Created:** [May 24, 2024, 10:21pm UTC](https://discuss.huggingface.co/t/cannot-upload-large-files-for-a-single-repository/88366 "2024-05-24T22:21:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigHuggyD](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bighuggyd/32/27340_2.png) [@BigHuggyD](https://discuss.huggingface.co/u/BigHuggyD)\
**Post date:** [May 24, 2024, 10:21pm UTC](https://discuss.huggingface.co/t/cannot-upload-large-files-for-a-single-repository/88366/1 "2024-05-24T22:21:12Z")

</div>

Hello!  
So I have created four model repositories. I have followed the same steps for each one.  
Create model repository HF website  
Login to HF Hub from terminal on server  
Clone repository to my server.  
Enable large files  
Create quant with final destination the local clone of repository  
git add  
git commit  
git push  
Worked flawlessly twice  
Third one gives me

```auto
remote: Your push was rejected because it contains files larger than 10 MiB.
remote: Please use https://git-lfs.github.com/ to store large files.
remote: See also: https://hf.co/docs/hub/repositories-getting-started#terminal
remote: 
remote: Offending files:
remote: - tokenizer.json (ref: refs/heads/main)
remote: -------------------------------------------------------------------------
To <my HF https repository URL>
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to <my HF https repository URL>

```

I created a fourth repository and made a quant for another model and went through the steps to make sure I wasn’t crazy. The fourth one worked like a champ.  
I have tried.  
-Delete repository on HF and create a new one with a different name. Clone to local server and copy all the files to the new destination. - Same issue

- Try to commit a different 10MB+ file - they all fail. Files less than 10MB are fine  
And yes I am doing  
git lfs install  
and also  
huggingface-cli lfs-enable-largefiles .  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![BigHuggyD](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bighuggyd/32/27340_2.png) [@BigHuggyD](https://discuss.huggingface.co/u/BigHuggyD)\
**Post date:** [May 28, 2024, 9:32pm UTC](https://discuss.huggingface.co/t/cannot-upload-large-files-for-a-single-repository/88366/2 "2024-05-28T21:32:33Z")

</div>

Just had another successful upload of about 100GB to a repo but not with the folder in question. A new one. I don’t freaking get it

---

<div class="post-metadata">

**Author:** ![Basir-Mahmood](https://avatars.discourse-cdn.com/v4/letter/b/b5e925/32.png) [@Basir-Mahmood](https://discuss.huggingface.co/u/Basir-Mahmood)\
**Post date:** [December 31, 2024, 5:02pm UTC](https://discuss.huggingface.co/t/cannot-upload-large-files-for-a-single-repository/88366/3 "2024-12-31T17:02:57Z")

</div>

It is required to add the \*.json to be added to “.gitattributes”.  
With the following command, this can also be achieved.  
`git lfs track "*.file_extension"`

---

<div class="post-metadata">

**Author:** ![SurAyush](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/surayush/32/42751_2.png) [@SurAyush](https://discuss.huggingface.co/u/SurAyush)\
**Post date:** [March 7, 2025, 3:35pm UTC](https://discuss.huggingface.co/t/cannot-upload-large-files-for-a-single-repository/88366/4 "2025-03-07T15:35:18Z")

</div>

from huggingface\_hub import HfApi

api = HfApi()  
api.upload\_file(  
path\_or\_fileobj=“github\_issues\_with\_comments.jsonl”,  
path\_in\_repo=“github\_issues\_with\_comments.jsonl”,  
repo\_id=“SurAyush/github\_issues”,  
token=“\<your\_token\>”,  
repo\_type=‘dataset’  
)

make changes in the above code and upload using the .py file  
I was facing the same problem and this is the only way out I found
