Skip to content

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

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

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
@SunMarc SunMarc closed this Sep 25, 2026
@CJstate

CJstate commented Oct 2, 2026

Copy link
Copy Markdown
Author

Closing note: this went down together with the umbrella request #3078, which @SunMarc closed on 2026-09-25. Nine example PRs were cross-referenced from that issue -- including two other contributors' captioning attempts (#4133 and #4220) -- and none of them landed, so the example gallery was not expanded in this direction. No review comments were left on this PR.

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

2 participants