Hugging Face datasets "FileNotFoundError: Couldn't find a dataset script" in CI
load_dataset could not locate the dataset locally or on the Hub. The name is wrong or unqualified, a local path does not exist, or a private dataset was requested without a token so the Hub hides it.
What this error means
load_dataset fails with "FileNotFoundError: Couldn't find a dataset script at <path> or any data file in the directory" on the runner.
datasets
FileNotFoundError: Couldn't find a dataset script at /home/runner/work/app/my_dataset/my_dataset.py
or any data file in the directory. Couldn't find 'my_dataset' on the Hugging Face Hub either.Common causes
The dataset id or local path is wrong
A typo, a missing org/ prefix, or a path that does not exist on the runner means datasets finds nothing to load.
A private dataset requested without a token
Without HF_TOKEN, the Hub hides the private dataset, so it appears missing.
How to fix it
Use the exact dataset id and set a token if private
- Copy the dataset id from its Hub page (including the org).
- For a local dataset, confirm the path exists in the checkout.
- Set
HF_TOKENin the job for a private dataset.
.github/workflows/ci.yml
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}Load with the correct config name
Some datasets require a config; pass it explicitly so datasets resolves the right files.
python
from datasets import load_dataset
load_dataset("glue", "mrpc")How to prevent it
- Copy dataset ids and config names from the Hub page.
- Set
HF_TOKENfor private datasets in CI. - Verify local dataset paths exist after checkout.
Related guides
Hugging Face datasets "trust_remote_code=True" required in CIFix datasets "The repository ... contains custom code which must be executed ... pass trust_remote_code=True"…
Hugging Face "RepositoryNotFoundError" (wrong repo_type) in CIFix huggingface_hub "RepositoryNotFoundError" in CI - the repo id, repo_type (model vs dataset vs space), or…
Hugging Face offline mode "cannot find the requested files in the cached path" in CIFix Hugging Face "Cannot find the requested files in the cached path and outgoing traffic has been disabled"…