Skip to content

[docs] Fix HF_HOME example in cache guide - #8694

Merged
lhoestq merged 1 commit into
huggingface:mainfrom
ZainnQureshii:docs-hf-home-example
Sep 30, 2026
Merged

lhoestq merged 1 commit into
huggingface:mainfrom
ZainnQureshii:docs-hf-home-example

Conversation

@ZainnQureshii

Copy link
Copy Markdown

The cache guide's HF_HOME example sets HF_HOME="/path/to/another/directory/datasets", but HF_HOME is the root of all Hugging Face caches and the library appends datasets itself, so the example puts the datasets cache in .../datasets/datasets.

Truth, src/datasets/config.py:

HF_CACHE_HOME = os.path.expanduser(os.getenv("HF_HOME", DEFAULT_HF_CACHE_HOME))
DEFAULT_HF_DATASETS_CACHE = os.path.join(HF_CACHE_HOME, "datasets")

The suffix is left over from #7200, which switched the example from HF_DATASETS_CACHE to HF_HOME but kept the path. The tip further down the same page already shows the right form (HF_HOME="/path/to/cache_root" -> datasets cache in /path/to/cache_root/datasets).

Change: export HF_HOME="/path/to/another/directory/datasets" -> export HF_HOME="/path/to/another/directory". Docs-only, one line.

Prepared with AI assistance (Claude Code) and reviewed with GitHub Copilot.

ðŸĪ– Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@lhoestq lhoestq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx !

@lhoestq
lhoestq merged commit 83c6aae into huggingface:main Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants