Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set custom huggingface-hub cache #3075

Merged
merged 4 commits into from
Sep 30, 2024
Merged

Set custom huggingface-hub cache #3075

merged 4 commits into from
Sep 30, 2024

Conversation

albertvillanova
Copy link
Member

Set custom huggingface-hub cache.

Fix #3074.

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

lgtm !

logging.debug(f"datasets data cache set to: {datasets.config.HF_DATASETS_CACHE}")
datasets.config.DOWNLOADED_DATASETS_PATH = (
datasets.config.HF_DATASETS_CACHE / datasets.config.DOWNLOADED_DATASETS_DIR
)
datasets.config.EXTRACTED_DATASETS_PATH = (
datasets.config.HF_DATASETS_CACHE / datasets.config.EXTRACTED_DATASETS_DIR
)
huggingface_hub.constants.HF_HUB_CACHE = cache_subdirectory / "hub"
Copy link
Member

Choose a reason for hiding this comment

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

cc @Wauplin please keep this working in the future ^^'

Copy link

@Wauplin Wauplin Sep 30, 2024

Choose a reason for hiding this comment

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

Any chance you could use the env variable instead of monkeypatching?

Copy link
Member

Choose a reason for hiding this comment

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

we handle the cache at runtime so no

(e.g. using temporary directories)

@albertvillanova albertvillanova merged commit bbd2338 into main Sep 30, 2024
6 of 7 checks passed
@albertvillanova albertvillanova deleted the fix-3074 branch September 30, 2024 11:23
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.

The viewer raises PermissionError after updating datasets to 3.0.1
3 participants