Skip to content

Don't infer the Harbor builder from unrelated .md and .toml files - #8891

Open
NgoQuocViet2001 wants to merge 1 commit into
huggingface:mainfrom
NgoQuocViet2001:fix-harbor-md-toml-inference
Open

NgoQuocViet2001 wants to merge 1 commit into
huggingface:mainfrom
NgoQuocViet2001:fix-harbor-md-toml-inference

Conversation

@NgoQuocViet2001

Copy link
Copy Markdown

Since #8729, .md and .toml are allowed data file extensions. Every Markdown or TOML file matched by the default ** pattern now counts as a vote for harbor when the builder is inferred. So a directory with data.jsonl, LICENSE.md and CHANGELOG.md is inferred as Harbor, and so is data.csv with pyproject.toml and ruff.toml, or a tie like seqs.fasta with notes.md. load_dataset(dir) then fails with DataFilesNotFoundError: No task.toml or instruction.md files found. Before #8729, these directories loaded with the json/csv/fasta builders.

Harbor tasks are identified by their task.toml and instruction.md file names, which are already counted as metadata files. This PR drops the votes of all other .md and .toml files in infer_module_for_data_files_list. Harbor repos are still inferred as Harbor. A directory that only contains unrelated .md/.toml files now gets the generic "No (supported) data files found" error instead of the Harbor one.

  • Ran: pytest tests/test_load.py tests/test_data_files.py tests/packaged_modules/test_harbor.py -m "not integration": 320 passed, 3 skipped. The 6 new cases fail without the fix.
  • Ran: pytest tests/packaged_modules/test_fasta.py tests/test_buckets.py: 53 passed, 4 skipped
  • Checked: ruff check and ruff format --check on src, tests, benchmarks and utils are clean

Harbor tasks are identified by their task.toml and instruction.md file names, so other Markdown and TOML files like LICENSE.md or pyproject.toml shouldn't count as votes for the harbor module when inferring the builder of a dataset.
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.

1 participant