技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
audio-clap【数据与研究】Use and troubleshoot OpenCLIP CLAP and NaFlexClap audio models, audio transforms/data loaders, Hugging Face audio zero-shot evaluation, and HF CLAP checkpoint conversion.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when working with OpenCLIP audio-text models: CLAP-HTSAT-*, CLAP-Whisper-*, and naflexclap_*. It covers model/config selection, audio preprocessing contracts, webdataset-audio/synthetic-audio data flows, Hugging Face audio zero-shot evaluation, and Transformers CLAP checkpoint conversion.
CLIPAudioCfg, AudioAugmentationCfg, AUDIO_AVAILABLE, audio WebDataset loaders, audio zero-shot flags, and HF CLAP state-dict conversion.../model-inference/SKILL.md.../training/SKILL.md.../naflex-generative/SKILL.md.../evaluation-conversion/SKILL.md.Confirm optional audio support before building audio transforms:
python sub-skills/audio-clap/scripts/audio_config_report.py --model CLAP-HTSAT-tiny-Roberta-base-fused
For HF audio zero-shot, plan the exact command without downloading data or loading checkpoints:
python sub-skills/audio-clap/scripts/clap_zero_shot_args.py \
--model CLAP-HTSAT-tiny-Roberta-base-fused \
--pretrained laion \
--audio-zeroshot-dataset ashraq/esc50 \
--audio-zeroshot-split train \
--audio-zeroshot-class-key category \
--audio-zeroshot-target-key target \
--batch-size 16 --device cuda --precision amp_bf16
Run real HF audio zero-shot only after the plan is acceptable and the environment has checkpoints or pretrained weights plus datasets[audio], torchaudio, torchlibrosa, and model-specific extras. Prefer the installed training CLI path:
python -m open_clip_train.main --model CLAP-HTSAT-tiny-Roberta-base-fused --pretrained laion --audio-zeroshot-dataset ashraq/esc50 --audio-zeroshot-split train --batch-size 64 --device cuda --zeroshot-frequency 1
open_clip.audio.AUDIO_AVAILABLE; call open_clip.audio.require_audio() when you need an explicit failure with missing package names.CLIPAudioCfg fields are model_type="HTSAT", model_name="tiny", audio_length=1024, clip_samples=480000, sample_rate=48000, mel_bins=64, window_size=1024, hop_size=480, fmin=50, fmax=14000, class_num=527, enable_fusion=False, and fusion_type="aff_2d".data_fill="repeatpad" and data_trunc="rand_trunc"; eval forces deterministic truncation unless fusion is enabled.batch["audio"] = {"waveform": Tensor[B, clip_samples], "longer": BoolTensor[B]} and optionally "mel_fusion": Tensor[B, 4, frames, mel_bins].batch["audio"] = {"patches": Tensor[B, N, patch_dim], "patch_coord": LongTensor[B, N, 2], "patch_valid": BoolTensor[B, N]}; do not feed waveform dicts to model_type="naflexvit" towers."audio" and "text" keys, not image/text tuples.references/audio-api.md — model families, config fields, transforms, dependency checks, and batch shapes.references/data-and-eval.md — webdataset-audio, synthetic-audio, NaFlexClap loaders, and HF audio zero-shot flags.references/checkpoints-conversion.md — pretrained audio encoder loading and Transformers CLAP conversion APIs.references/troubleshooting.md — common optional dependency, dataset, transform, worker, and conversion failures.scripts/audio_config_report.py imports audio/config APIs, reports dependency availability, and prints CLIPAudioCfg/model audio config fields without downloading weights.scripts/clap_zero_shot_args.py validates audio zero-shot arguments and prints a data/model-dependent command plan without loading checkpoints, downloading datasets, or running evaluation.