인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
개발 및 엔지니어링 · SKILL.md

model-usage

model-usage

Initialize OpenFlamingo models, load checkpoints, prepare multimodal prompts, run forward/generate, and debug media caching constraints.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: model-usage description: "Initialize OpenFlamingo models, load checkpoints, prepare multimodal prompts, run forward/generate, and debug media caching constraints." disable-model-invocation: true metadata: disco-role: operating license: MIT

OpenFlamingo Model Usage

Use this sub-skill when a task requires OpenFlamingo model construction, checkpoint loading, prompt/media preprocessing, generation, log-likelihood style forward() calls, media caching, or architecture debugging.

Do not start full model downloads, benchmark datasets, training, or evaluation unless the caller explicitly provides the required local files, network permission, hardware budget, and time budget. The safe default is to validate inputs and prepare code that works with a caller-supplied local cache or checkpoint.

Route by task

Critical invariants

  • Public imports are from open_flamingo import create_model_and_transforms, Flamingo.
  • The package/distribution identity is open_flamingo 2.0.1.
  • vision_x for Flamingo.forward() and Flamingo.generate() is B x T_img x F x C x H x W; current OpenFlamingo supports F=1 only.
  • Text prompts must use the exact special tokens <image> and <|endofchunk|>. Each image/media item should have a matching <image> token in the prompt for the same example.
  • For generation, set tokenizer.padding_side = "left" before tokenization and pass attention_mask.
  • generate(num_beams=N) internally repeats vision_x along batch dimension when N > 1; do not pre-repeat the media batch for beam search.
  • cache_media() is for repeated forward()/classification-style scoring, not for generate(). After cached calls, call uncache_media().

Safe input validation

From this sub-skill directory, validate a three-image captioning prompt without importing OpenFlamingo or downloading anything:

python scripts/validate_generation_inputs.py \
  --batch-size 1 \
  --num-media 3 \
  --num-frames 1 \
  --channels 3 \
  --height 224 \
  --width 224 \
  --prompt '<image>An image of two cats.<|endofchunk|><image>An image of a sink.<|endofchunk|><image>An image of'

If the script exits nonzero, correct the reported shape/token issue before attempting model execution.

저장한 Skills