Repository navigation
fix(image): keep longest-edge resize dimensions nonzero - #761
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The thin-image resize fix has no identified merge-blocking issue. Normal checks remain appropriate before merging. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Reproduced the crash in both orientations ( Local validation: 27 related tests passed, both pinned pre-commit hooks passed, repository-wide Ruff lint and the CI mypy/pyright commands passed. The root formatting check reports three unchanged files; full model-download/inference tests were not completed locally. |
|
Added concise docstrings to |
|
Hope it could be merged 😊 |
|
thank you for the fix! |
…t queries via model_v2.onnx (#784) * tests: check ColModernVBERT mixed-size batches against the re-exported test model * tests: add tmp test script * tests: probe whether onnxruntime 1.18 crashes on the published ColModernVBERT on Windows too * tests: drop onnxruntime 1.18 and the probe job from the temporary ColModernVBERT check * fix: build ColModernVBERT image prompts from the actual tile grid Co-authored-by: Hulk <happyhls@gmail.com> * fix(image): keep longest-edge resize dimensions nonzero (#761) * fix(image): keep longest-edge resize dimensions nonzero * docs(image): document resize behavior and regression tests * tests: drop the extra tests and docstring from the nonzero resize fix --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech> * fix: send ColModernVBERT text queries without image tiles and warn that the model was updated * tests: run the ColModernVBERT query test on all platforms and drop the temporary CI check * fix: switch ColModernVBERT to model_v2.onnx, avoid an empty tensor on CUDA, drop padding rows and lower the default image batch size * fix: set qdrant hf account as model source for colmodernvbert --------- Co-authored-by: Hulk <happyhls@gmail.com> Co-authored-by: Li Haodong <1638272030@qq.com>
A
4096 x 1or1 x 4096image resized to a longest edge of 2048 currently truncates its shorter edge to zero. Pillow raisesValueError: height and width must be > 0, including when the image goes through ColModernVBERT's Idefics3 preprocessing.Clamp the final resize dimensions to at least one pixel, matching Idefics3's reference behavior. Tests cover both orientations, existing even rounding and ordinary images, plus the real
Composepipeline with image splitting, rescaling and normalization.Validation:
pytest tests/test_image_transform.py tests/test_common.py tests/test_postprocess.py::test_empty_multivectors_raise_value_error -q: 27 passed.pyright tests/type_stub.py, andgit diff --check: passed.ruff format --check .reports three unchanged files (experiments/attention_export.py,experiments/try_attention_export.py,tests/test_postprocess.py); both modified files pass formatting. The full model-download/inference suite was not completed locally.All submissions: