open-flamingo
Use OpenFlamingo for vision-language model initialization, image-conditioned generation, distributed training, benchmark evaluation, RICES, MMC4/WebDataset conversion, and VQA-style result preparation.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- open-flamingo
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use OpenFlamingo for vision-language model initialization, image-conditioned generation, distributed training, benchmark evaluation, RICES, MMC4/WebDataset conversion, and VQA-style result preparation.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/model-zoo-and-compatibility.md4.5 KB
- 参考文档references/repo-provenance.md2.6 KB
- 参考文档references/repo-routing-metadata.json553 B
- 参考文档references/troubleshooting.md4.3 KB
- 脚本scripts/check_open_flamingo_env.py4.4 KB
03 SKILL.md 正文
OpenFlamingo repo skill
Use this skill when a task involves the OpenFlamingo (open_flamingo) package, Flamingo-style vision-language models, OpenCLIP vision encoders plus causal language models, interleaved image/text prompts, training on LAION/MMC4, benchmark evaluation, RICES feature caches, or OpenFlamingo data-preparation utilities.
Do not treat this skill as proof that a full model, dataset, or benchmark run already succeeded. Full generation, training, RICES, and evaluation require caller-provided checkpoints, datasets, cache/network permission, hardware, and time budget. The bundled scripts are safe preflight helpers and command builders unless the user explicitly asks to execute a generated command.
Install and environment preflight
- Install the package for the intended workflow:
- model usage:
pip install open-flamingo - training: install the package with training requirements
- evaluation: install the package with evaluation requirements and ensure
scikit-learnis present
- model usage:
- Read model zoo and compatibility before selecting released checkpoints, dependency pins, or offline cache behavior.
- Run
scripts/check_open_flamingo_env.pyfor a safe import/signature/entrypoint check. It does not instantiate models or download assets. - If package layout or dependency versions differ substantially from repo provenance, refresh this skill before relying on detailed commands.
Route by task
| User task | Read this |
|---|---|
Initialize create_model_and_transforms, load checkpoints, prepare <image> prompts, run forward()/generate(), or debug vision_x and media cache behavior |
model-usage |
| Build or troubleshoot OpenFlamingo training/fine-tuning commands, DDP/FSDP, LAION/MMC4 shard inputs, checkpoints, precision, or W&B | training |
Configure benchmark evaluation, supported dataset paths, EvalModel, metrics, result JSON, or RICES feature caches |
evaluation |
| Convert/validate MMC4/WebDataset data, check LAION/MMC4 schemas, or fill VQAv2/VizWiz test-dev result files | data-preparation |
| Diagnose install/import/dependency/cache/backend problems before choosing a workflow | cross-cutting troubleshooting |
High-value identifiers
- Public import:
from open_flamingo import create_model_and_transforms, Flamingo - Package version in this snapshot:
open_flamingo2.0.1 - Core model API:
create_model_and_transforms(...) -> (model, image_processor, tokenizer) - Special tokens:
<image>and<|endofchunk|> - Model media tensor:
vision_xshapedB x T_img x F x C x H x W; OpenFlamingo supportsF=1 - Training data families: LAION image/text WebDataset shards and MMC4 interleaved JSON/base64 WebDataset shards
- Evaluation families: COCO, Flickr30K, VQAv2, OK-VQA, TextVQA, VizWiz, ImageNet, Hateful Memes
Safe helpers bundled with this skill
scripts/check_open_flamingo_env.py: import/version/signature and packaged-entrypoint preflight.sub-skills/model-usage/scripts/validate_generation_inputs.py: validate prompt token counts andvision_xdimensions without imports or downloads.sub-skills/training/scripts/build_train_command.py: print a validatedtorchruncommand targeting the bundled training wrapper; never runs training.sub-skills/evaluation/scripts/build_eval_command.py: print validated evaluation or RICES-cache commands targeting bundled wrappers; never runs evaluation.sub-skills/data-preparation/scripts/validate_open_flamingo_data.py: bounded checks for MMC4 JSON, VQA predictions, and WebDataset path patterns.sub-skills/data-preparation/scripts/convert_mmc4_to_wds.py: standalone MMC4 ZIP/image-directory to WebDataset converter with safer validation.sub-skills/data-preparation/scripts/fill_vqa_testdev_results.py: standalone VQAv2/VizWiz result filler.
Workflow guardrails
- Do not hand-run full training/evaluation/generation until the user provides local data/checkpoints or authorizes downloads and runtime cost.
- Prefer local cache paths and
use_local_files=Truefor offline model initialization tasks. - For evaluation, install
requirements-eval.txtor addscikit-learnifevaluate.pyfails onsklearn.metrics. - If PyTorch imports but Transformers says PyTorch is unavailable, check the torch/Transformers compatibility note in model zoo and compatibility.
- Use the bundled training/evaluation wrappers instead of checkout-relative script paths; they locate the installed package and fix OpenFlamingo's local import quirks.
- For VQA test-dev submissions, local accuracy may be unavailable without private annotations; use
data-preparationto format complete submission files.
Provenance and routing metadata
- Read repo provenance when checking staleness or before refreshing the skill.
references/repo-routing-metadata.jsonrecords the structured router placement for managed repo-skill import. This production run intentionally did not import the skill because the user requested no import.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).