AGENT SKILL

paligemma-2

Use Maestro's PaliGemma 2 recipe for JSON extraction, VQA, OCR-style fine-tuning, checkpoint loading, and inference.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
paligemma-2
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use Maestro's PaliGemma 2 recipe for JSON extraction, VQA, OCR-style fine-tuning, checkpoint loading, and inference.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

PaliGemma 2

Use this sub-skill when the user needs Maestro's paligemma_2 route for PaliGemma 2 text-generation fine-tuning or inference over images: JSON extraction, VQA, OCR-style prompts, loading/saving checkpoints, or choosing LoRA/QLoRA/freeze/full fine-tuning behavior.

Route here for

  • CLI training through maestro paligemma_2 train.
  • Python training through maestro.trainer.models.paligemma_2.core.PaliGemma2Configuration and train(config).
  • Checkpoint work through load_model(...), save_model(...), and OptimizationStrategy.
  • Single-image prediction through maestro.trainer.models.paligemma_2.inference.predict(...).
  • PaliGemma-specific prompt handling, especially when and where Maestro prepends <image>.

Route elsewhere

  • Generic JSONL split validation, Roboflow dataset identifiers, image-file checks, and metric registry details belong in datasets-and-metrics.
  • Florence-2 or Qwen2.5-VL detection formatting belongs in their sibling sub-skills. Maestro's PaliGemma 2 implementation provides train/evaluation collate functions and text prediction; it does not expose a PaliGemma object-detection formatter API.
  • Package-wide installation, root CLI discovery, and non-model-specific import warnings belong in the root installation and CLI guide and root troubleshooting reference.

Source-backed defaults to preserve

  • Default model id: google/paligemma2-3b-pt-224.
  • Default revision: refs/heads/main.
  • Default train output base: ./training/paligemma_2; training creates a numbered run directory below it.
  • Training/evaluation generation length default: PaliGemma2Configuration.max_new_tokens = 512.
  • Direct prediction default: predict(..., max_new_tokens=1024).
  • Dataset JSONL prefix values should not include <image> for standard Maestro use; train_collate_fn, evaluation_collate_fn, and predict prepend <image> internally.

Operating sequence

  1. Confirm the dataset task and split layout with datasets-and-metrics before choosing model parameters.
  2. Use API reference to choose CLI vs Python API, optimization strategy, checkpoint load/save behavior, and exact option names.
  3. Use workflows for JSON extraction, VQA, OCR-style fine-tuning, inference, and safe validation steps.
  4. Use troubleshooting for QLoRA/bitsandbytes, CUDA memory, invalid JSON suffixes, token truncation, HF access, and CLI edge cases.
  5. Use the bundled helper only to generate configuration text; it never downloads models or starts training:
python scripts/build_paligemma_config.py \
  --dataset ./dataset \
  --optimization-strategy lora \
  --metric edit_distance \
  --metric bleu \
  --emit json

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351