计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
prompt-engineering【效率与协作】Build CLIP zero-shot class prompts, tokenizer-safe templates, and normalized text classifier weights.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when an agent needs to turn class labels into CLIP text prompts, tokenize them safely, build zero-shot classifier weights, or diagnose prompt/template failures.
references/prompting-workflows.md for class taxonomies, template design, prompt ensembling, normalized text features, and top-k zero-shot scoring.references/tokenization.md before generating large prompt sets or when clip.tokenize raises context-length errors.references/troubleshooting.md for unsafe category design, malformed templates, device mismatches, unnormalized features, and multilingual/English limitations.scripts/build_zeroshot_classifier.py when you need a reusable helper for expanding templates, dry-run tokenization, or building normalized classifier weights from a loaded CLIP model.clip.load, image preprocessing, and image-text inference setup belong in ../model-loading-inference/.../feature-evaluation/.{} placeholder, such as a photo of a {}. or domain-specific variants like a photo of a {}, a type of bird.clip.tokenize(..., context_length=77, truncate=False) before running model inference.[text_feature_dim, num_classes].100.0 * image_features @ zeroshot_weights; treat softmax/top-k scores as relative to the candidate class list, not calibrated real-world confidence.Dry-run prompt tokenization without loading or downloading model checkpoints:
python sub-skills/prompt-engineering/scripts/build_zeroshot_classifier.py \
--class-name cat --class-name "electric ray" \
--template "a photo of a {}." \
--dry-run-tokenize
Build classifier weights only when a model load is explicitly requested or a caller imports build_zeroshot_classifier(model, class_names, templates) with an already loaded model. See references/prompting-workflows.md for the importable contract.