executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
evaluation-conversionBuild OpenCLIP zero-shot and retrieval evaluation flows, diagnose checkpoint state dicts, and route conversion or Hugging Face export work across model families.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when an OpenCLIP task is about zero-shot classifier construction, ImageNet zero-shot evaluation, paired retrieval metrics, checkpoint key diagnosis, third-party state-dict conversion, or Hugging Face export/push planning.
build_zero_shot_classifier, open_clip_train.zero_shot.zero_shot_eval, run_zero_shot_classifier, retrieval metric knobs, open_clip.factory.load_state_dict/load_checkpoint, open_clip.convert, open_clip.naflex_convert, and open_clip.push_to_hf_hub helpers.../model-inference/SKILL.md before applying classifier or retrieval metrics.../audio-clap/SKILL.md.../naflex-generative/SKILL.md.../training/SKILL.md.Validate a no-download zero-shot classifier path with a tiny fake text model:
python sub-skills/evaluation-conversion/scripts/zero_shot_classifier_smoke.py
Inspect a local checkpoint before loading it into an inference/export model:
python sub-skills/evaluation-conversion/scripts/checkpoint_key_report.py /path/to/checkpoint.pt --prefer-ema
If a model config is available locally, compare checkpoint keys against random-initialized model keys without downloading weights:
python sub-skills/evaluation-conversion/scripts/checkpoint_key_report.py /path/to/checkpoint.pt --model ViT-B-32 --prefer-ema --max-missing 20
build_zero_shot_classifier(model, tokenizer, classnames, templates, num_classes_per_batch=10, device="cpu", use_tqdm=False) builds normalized text-classifier weights shaped [embed_dim, num_classes] from contrastive text features.visual and encode_image; it also requires encode_text, so generative image models such as GenLIP skip this contrastive path.zero_shot_eval accepts bare models, DDP-like wrappers, compiled modules, or TrainingTask wrappers; unwrapping happens only for capability checks while classifier/eval calls still receive the original model-or-task object.create_dummy_batch when available, and NaFlex FSDP eval should use the task interface.weights_only=True; do not set unsafe pickle loading unless the user explicitly accepts the risk and the checkpoint is trusted.state_dict; training checkpoints may also include state_dict_ema, optimizer, scaler, epoch, and counters.state_dict. Use the key-report helper to identify which payloads exist before choosing..npz, MobileCLIP key mapping, NaFlex timm/native ViT state-dict conversion, scalar shape reconciliation, and HF Hub packaging. Audio-specific HF CLAP conversion is routed to ../audio-clap/SKILL.md.push_to_hf_hub and push_pretrained_to_hf_hub as an explicit side-effecting step after local config/weights checks pass.references/evaluation.md — zero-shot classifier construction, ImageNet zero-shot restrictions, FSDP/NaFlex behavior, and routing for audio/generative alternatives.references/retrieval-metrics.md — paired retrieval metric inputs, chunking, precision/device options, and common memory trade-offs.references/conversion-and-export.md — checkpoint payload selection, key-prefix diagnosis, conversion helpers, pretrained registry checks, and HF export/push workflow.references/troubleshooting.md — failures for incompatible model families, wrapped models, retrieval OOM, state-dict mismatch, unsafe checkpoints, and HF auth/network issues.scripts/zero_shot_classifier_smoke.py constructs classifier weights using fake class names/templates and a tiny deterministic text module; it does not download weights, read datasets, or require OpenCLIP installed.scripts/checkpoint_key_report.py loads a local .pt/.pth/.bin checkpoint on CPU with weights_only=True by default, reports nested payloads and prefix patterns, and optionally compares against a random uninitialized OpenCLIP model without downloading weights.