Skip to content

feat(examples): Add distributed image captioning example with BLIP-2 - #4239

Open
CJstate wants to merge 2 commits into
huggingface:mainfrom
CJstate:docs-distributed-inference-3078
Open

feat(examples): Add distributed image captioning example with BLIP-2#4239
CJstate wants to merge 2 commits into
huggingface:mainfrom
CJstate:docs-distributed-inference-3078

Conversation

@CJstate

@CJstate CJstate commented Sep 10, 2026

Copy link
Copy Markdown

Add a new example for distributed image captioning using BLIP-2 model. This addresses the request in #3078 for image captioning examples.

The example includes:

  • Data-parallel inference using
  • for non-blocking artifact serialization (saves to disk without blocking GPU)
  • Support for common image formats (jpg, png, bmp, webp, tiff)
  • Resume capability via output file tracking
  • Configurable batch size, beam search, and token limits

Files changed:

  • (new)
  • (updated with new example)

Closes #3078

Add new example `gemma_distributed.py` demonstrating distributed inference
with Google Gemma 2B-IT using PartialState API. Update README with example
table and run instructions.

Addresses community contributions request in huggingface#3078.
Add a new example for distributed image captioning using BLIP-2 model.
This addresses the request in huggingface#3078 for image captioning examples.

The example includes:
- Data-parallel inference using PartialState
- ThreadPoolExecutor for non-blocking artifact serialization
- Support for common image formats (jpg, png, bmp, webp, tiff)
- Resume capability via output file tracking
- Configurable batch size, beam search, and token limits

Update README.md to include the new example in the table and add usage instructions.

Closes huggingface#3078
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Community Contributions] examples on distributed inference using 馃 Accelerate

1 participant