transformers
8d362e7d - fix: idefics3 _get_num_multimodal_tokens handles \n\n tokenization correctly

Commit
141 days ago
fix: idefics3 _get_num_multimodal_tokens handles \n\n tokenization correctly The formula assumed \n\n = 1 token (as in the full SmolVLM tokenizer where the BPE merge exists), but trimmed/tiny tokenizers keep \n\n as 2 separate tokens, causing +1 per split image vs the actual processor output. Fix: count len(tokenizer('\n\n')) - 1 as extra tokens for split images so the formula is correct for any tokenizer. Also update the test comment to reflect that the tiny SmolVLM processor now works correctly (no need to load the full HuggingFaceTB/SmolVLM-256M-Instruct, saving ~1.5s per run). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
Parents
Loading