Fix is_last off-by-one in MaskGenerationPipeline for partial batches (#46136)
* Fix is_last off-by-one in MaskGenerationPipeline for partial batches
* Code cleaning up
* build fix
* Simplify is_last test using a real tiny pipeline
Replace the two heavily-mocked test methods with a single subTest-driven
check that calls preprocess on a real MaskGenerationPipeline backed by
hf-internal-testing/tiny-random-SamModel. Covers both the partial-batch
(100 points) and exact-multiple (64 points) cases without mocking.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Matt <rocketknight1@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>