# /// script # requires-python = ">=3.10" # dependencies = ["pandas>=2"] # /// """Assemble the Hugging Face Hub copy of FreeTZAN (https://huggingface.co/datasets/gclef-cmu/freetzan). The Hub repo mirrors this repository plus the audio (audio///.mp3, not in git), and adds: audio//metadata.csv that split's rows of metadata.csv, with `file_name` relative to the folder; the Hub dataset viewer and datasets.load_dataset read the clips through these README.md this README.md with a YAML dataset-card header that maps audio/train, audio/valid, audio/test to the Hub splits train, validation, test Writes into --out (a clone of the Hub repo), replacing audio/, scripts/ and resources/ there. Push with git + git-lfs (mp3 files are LFS-tracked by the Hub's default .gitattributes). Usage: uv run scripts/make_hf_dataset.py --out /path/to/hub/clone """ import argparse import hashlib import shutil from pathlib import Path import pandas as pd REPO = Path(__file__).resolve().parent.parent SPLITS = ['train', 'valid', 'test'] MIRROR = ['LICENSE', 'metadata.csv', 'checksums.sha1', 'scripts/build_freetzan.py', 'scripts/find_duplicates.py', 'scripts/extract_features.py', 'scripts/run_baselines.py', 'scripts/make_hf_dataset.py', 'resources/exclusions.csv', 'resources/duplicates.csv', 'resources/baselines.csv'] CARD = """--- pretty_name: FreeTZAN license: other license_name: per-track-creative-commons license_link: LICENSE task_categories: - audio-classification tags: - music - genre-classification size_categories: - 1K