# My space doesn't locally cache models

**URL:** <https://discuss.huggingface.co/t/my-space-doesnt-locally-cache-models/61653>\
**Category:** Spaces\
**Created:** [November 9, 2023, 1:04pm UTC](https://discuss.huggingface.co/t/my-space-doesnt-locally-cache-models/61653 "2023-11-09T13:04:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rikel](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rikel](https://discuss.huggingface.co/u/Rikel)\
**Post date:** [November 9, 2023, 1:04pm UTC](https://discuss.huggingface.co/t/my-space-doesnt-locally-cache-models/61653/1 "2023-11-09T13:04:34Z")

</div>

When creating my first space by following HF docs (hot dog image classifier), i noticed the model isn’t cached locally.

i created HF\_HOME and HF\_HUB\_CACHE env variable sys to point to desired cache folder

Testing with huggingface-cli, i was able to download and locally cache models in HF\_HOME.

Here is what i get when i use scan\_cache\_dir() from space app.py

HFCacheInfo(size\_on\_disk=0, repos=frozenset(), warnings=[CorruptedCacheException(‘Repo path is not a directory: /home/user/.cache/huggingface/hub/version.txt’)])

What can i do to tell HF hub to point to HF\_HOME and cache locally?
