mtmd: fix LFM2 image tiling threshold (#27057)

* mtmd: fix LFM2 image tiling threshold

* refactor testing

* fix

* fix on windows

---------

Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
This commit is contained in:
BlackFoil
2026-08-18 11:11:19 +02:00
committed by GitHub
co-authored by Xuan Son Nguyen
parent 1511ce3bc3
commit 7acdbb1f19
6 changed files with 119 additions and 2 deletions
+2
View File
@@ -148,6 +148,8 @@ struct mtmd_image_preprocessor_lfm2 : mtmd_image_preprocessor_llava_uhd {
mtmd_image_preproc_out preprocess(const clip_image_u8 & img) override;
slice_instructions get_slice_instructions(const clip_image_size & original_size) override;
static bool should_tile(const clip_hparams & hparams, const clip_image_size & original_size);
private:
clip_image_size find_closest_aspect_ratio(
float aspect_ratio,