Repository limitations and recommendations

There are some limitations to be aware of when dealing with a large amount of data in your repo. Given the time it takes to stream the data, getting an upload/push to fail at the end of the process or encountering a degraded experience, be it on hf.co or when working locally, can be very annoying.

Recommendations

We gathered a list of tips and recommendations for structuring your repo. If you are looking for more practical tips, check out this guide on how to upload large amount of data using the Python library.

Characteristic Recommended Tips
Repo size - contact us for large repos (TBs of data)
Files per repo <100k merge data into fewer files
Entries per folder <10k use subdirectories in repo
File size <5GB split data into chunked files
Commit size <100 files* upload files in multiple commits
Commits per repo - upload multiple files per commit and/or squash history

* Not relevant when using git CLI directly

Please read the next section to understand better those limits and how to deal with them.

Explanations

What are we talking about when we say “large uploads”, and what are their associated limitations? Large uploads can be very diverse, from repositories with a few huge files (e.g. model weights) to repositories with thousands of small files (e.g. an image dataset).

Under the hood, the Hub uses Git to version the data, which has structural implications on what you can do in your repo. If your repo is crossing some of the numbers mentioned in the previous section, we strongly encourage you to check out git-sizer, which has very detailed documentation about the different factors that will impact your experience. Here is a TL;DR of factors to consider: