/hf-publisher-tools:audio-parquet-standardisefrom hf-publisher-tools
Standardise a user's Hugging Face audio datasets on parquet. Find their audio datasets from the latest hub-inventory export, check each one's file layout, and convert any that still hold loose audio files (wav/flac/mp3, audiofolder layouts, ad-hoc folders) into parquet shards with an embedded Audio column. Verify each against its source, remove the loose files, and repeat until none are left. Use when the user says "convert my audio datasets to parquet", "standardise audio datasets", "any audio datasets still loose files?", "parquet sweep", or after a new audio dataset is published as individual files.
Ships in hf-publisher-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Find the data folder (see shared/settings.md: $HF_PUB_HOME, $CLAUDE_USER_DATA/hf-publisher-tools/, then ~/.claude-user-data/hf-publisher-tools/). Read profile.env and audio-parquet-standardise.md there if they exist. They win over the defaults below, and comments in profile.env are instructions. With no profile, use the defaults below and offer setup at the end.
Profile keys used: HF_PUB_EXPORT_DIR (where hub-inventory wrote its exports; default <data folder>/exports), HF_PUB_OWNERS.
Standard: every audio dataset on the Hub is parquet shards with the
audio embedded (datasets Audio feature, written by push_to_hub). Loose audio files are not
the standard. Exception: audio the dataset card links to (an intro or demo clip) is a card asset
and stays a file. audio-layout already leaves it out.
P="${CLAUDE_PLUGIN_ROOT}/scripts"
M="$(python3 "$P/hf-hub.py" profile | python3 -c 'import json,sys; print(json.load(sys.stdin).get("HF_PUB_EXPORT_DIR",""))')"
[ -n "$M" ] || M="$(python3 "$P/hf-hub.py" home | python3 -c 'import json,sys; print(json.load(sys.stdin)["data_dir"])')/exports" # M = export dir
UV="uv run -q --with datasets --with huggingface_hub python"
Run the Python from a scratch dir such as /tmp/hfaudio, not from a downloaded snapshot.
Use the latest $M/<date>/datasets.csv. If there isn't one, run hub-inventory first.
The candidates are rows where any of these holds:
modalities contains audioformats contains audiofoldertask_categories contains an audio task (automatic-speech-recognition, text-to-speech,
audio-classification, audio-to-audio, voice-activity-detection, text-to-audio)modalities is empty. The viewer never ran, so the content is unknown.mkdir -p /tmp/hfaudio
python3 - "$M" <<'EOF' > /tmp/hfaudio/candidates.txt
import csv, glob, sys
f = sorted(glob.glob(f"{sys.argv[1]}/*/datasets.csv"))[-1]
T = {"automatic-speech-recognition","text-to-speech","audio-classification","audio-to-audio","voice-activity-detection","text-to-audio"}
for r in csv.DictReader(open(f)):
m = set(filter(None, r["modalities"].split(";")))
if "audio" in m or "audiofolder" in r["formats"] or T & set(r["task_categories"].split(";")) or not m:
print(r["id"])
EOF
audio-layout, one tree call eachbash -c 'while read d; do python3 "$0" audio-layout "$d"; done' "$P/hf-hub.py" < /tmp/hfaudio/candidates.txt
verdict | Meaning | Action |
|---|---|---|
parquet | no loose audio | done |
no-audio-files | no audio files and no parquet (text-only, or audio inside JSON/arrow) | not in scope. Note it if the data is really audio |
loose-audio | audio files, no parquet | convert |
mixed | both. Usually parquet holding paths to the loose files, or a half-done earlier conversion | open the parquet schema first; convert so the audio is embedded, then remove the files |
About 120 candidates take about 120 calls. Don't run this while a backup or other bulk Hub job is running: the shared API quota can return 429.
Loose files are often read or written by code at a path: a recorder app appending takes, a
script that hf_hub_downloads audio/x.wav, or a site linking resolve/main/...mp3. Converting
removes those paths. Search first:
rg -l -F "<owner/name>" <your code root> --glob '!**/node_modules/**' | grep -v "$M"
Ignore hits that are only listings (site data files, project lists, inventory dumps).
For hits in code or docs that write to the dataset (for example a recorder app that appends takes) or read files
by path, don't convert yet. Patch the reader/writer to use the parquet (load_dataset, or
appending parquet shards) as part of the same task if the user agrees. Otherwise list the dataset
as blocked, with the repo and file that would break. A live writer would recreate loose files,
so the loop would never finish.
cd /tmp/hfaudio
$UV "$P/audio-to-parquet.py" manifest <owner/name> m/<name> # writes m/<name>/<split>.jsonl
The manifest is one JSONL per split, one row per audio file: "audio" (repo path) plus columns.
audiofolder metadata (metadata.jsonl/.csv with file_name) is merged in. The split is taken
from a train/test/validation/dev directory in the path, else train. Then read it:
rows_without_metadata > 0: the labels live somewhere else (sidecar .txt/.json per clip,
a CSV with another key, the README). Add those columns to the manifest rows with a small script
before converting. A dataset converted with only an audio column has lost its transcripts.--exclude <path> and leave it.--config <name> for each.$UV "$P/audio-to-parquet.py" convert <owner/name> m/<name> # dry run
$UV "$P/audio-to-parquet.py" convert <owner/name> m/<name> --apply --delete-originals # do it
--apply downloads only the manifest's audio, builds a DatasetDict with Audio(), and runs
push_to_hub(config_name, max_shard_size="500MB"). That writes data/<split>-NNNNN-of-NNNNN.parquet
(<config>/… for a named config) and the configs:/dataset_info card header. It then
verifies from the Hub: for each split it checks the row count, that no audio cell lacks bytes,
and that the embedded byte total equals the source files' total (the bytes go in unchanged, so the
totals match). Only if every split passes does --delete-originals remove the audio files and
the audiofolder metadata in one commit. The files remain in git history, so a revert is possible.
Learned the hard way (2026-10-30):
push_to_hub deletes everything under the config's dir (data/ for default, <config>/
otherwise) in the push commit, not only the audio. That includes jsonl, md, png and audio left out of
the manifest. On one test set this took the main 20-minute recording plus the
prompts/results files, which then had to be reverted. The script now refuses (would_clobber,
blocked) when non-manifest files sit there. Fix it by putting them in the manifest, by using
--config <name> so the shards go to another dir, or, for files whose content you have checked
is already in manifest columns (per-clip transcript .txt, a save_to_disk copy of the same rows),
with --absorbed '<glob>'. Never move or delete files just to get past the guard.
Verification compares against sizes recorded before the push, so it stays valid, and the delete
step removes only what the push left (removed_by_push).orphaned_audio/ folder) or a long source recording that the clips were
cut from goes in its own config (--config orphaned, --config source), so it's kept in parquet and
doesn't mix with the labelled split.TMPDIR on disk ($HOME/.cache/hfaudio-<run>; /tmp may be a small RAM disk).
A parallel run's cleanup of a shared temp dir once killed a download partway through.--config audio, so the shards go to audio/train-*.parquet.Above about 5 GB of audio (audio_bytes in the dry run), check local disk first, or run it on a bigger machine or a cloud job.
hf-hub.py audio-layout <id> must now say parquet, with audio_files: 0.hf-hub.py dataset-peek <id> shows the viewer. It can take a few minutes after the push.push_to_hub rewrites only the YAML header.Go back to Step 2 over the remaining loose-audio/mixed ids. Stop when every candidate is
parquet, no-audio-files or blocked. Record the pass in
$M/../log/YYYY-MM-DD_audio-parquet-standardise.md (or wherever the profile says): datasets converted (with the push and delete commit
ids), blocked ones with the code that blocks each, and skipped ones with the reason. If that location is in a git repository, commit it with the day's export.
Converting rewrites a public dataset and deletes its loose files from the head revision. The user asking for the sweep approves datasets with no readers or writers. Confirm the blocked ones and any public dataset over 5 GB separately.
Reads the inventory export from $HF_PUB_EXPORT_DIR; the pass log and manifests are working files, not plugin content. Private notes for this skill go in <data folder>/audio-parquet-standardise.md; shared settings in <data folder>/profile.env. Nothing personal is stored in the plugin.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
21 skills in this plugin
/access-requestsReview and decide access requests on your gated Hugging Face models and datasets. Lists every gated repo under your owners with pending requests and their form answers, shows them with a neutral reading (or against your own acceptance policy), and accepts or rejects only the users you name. Also gives a history of requests over the last N days. Use when asked who has requested access, to check, approve or reject access requests, or after a release./collectionsKeep a user's Hugging Face collections current: list an owner's collections, find models, datasets and Spaces that are in none of them, find which collections hold a repo, create a collection, add, remove, annotate or reorder items, rename or re-describe a collection, change its visibility, delete it. Works for the user and every org they belong to. Use after creating or publishing any Hub repo, or on "update the collections", "add it to a collection", "what isn't in a collection", "which collection is X in", "take X out of", "rename the collection", "reorder", "delete the collection"./complementary-pluginsList and install plugins that complement hf-publisher-tools: data-utils. Use on "what goes with this plugin", "related plugins"./contact-supportEmail Hugging Face support about the Hub account, an org, a repo or billing. Use when the user says "email HF support", "contact Hugging Face", "ask HF to unlock/delete/rename this DOI repo", "HF billing question", or when a Hub action is blocked and only staff can do it (DOI-locked delete, rename or visibility change; account or org problems; stuck Space; storage or quota)./create-datasetCreate a Hugging Face dataset repository, public or private, under the user's account or one of their organisations. Use when the user says "create a private dataset", "make a public dataset repo on HF", "new dataset under <org>", "set up a dataset on Hugging Face for X"./create-modelCreate a Hugging Face model repository, public or private, under the user's account or one of their organisations. Use when the user says "create a private model", "make a public model repo on HF", "new model under <org>", "set up a model on Hugging Face for X".hf-publisher-tools@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin hf-publisher-tools