Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Give the Kimi processor test's stand-in tokenizer convert_tokens_to_ids (#12206)

Daniel Hanb67b334d0b5a
diff --git a/tests/test_kimi_medias_processor_loader.py b/tests/test_kimi_medias_processor_loader.py
index 53804f6335d..d36db715bfb 100644
--- a/tests/test_kimi_medias_processor_loader.py
+++ b/tests/test_kimi_medias_processor_loader.py
@@ -94,6 +94,11 @@ def test_patched_kimi_processor_takes_text_and_images(monkeypatch):
from transformers.feature_extraction_utils import BatchFeature
class _Tokenizer:
+ # Encodes each word as its length, so a token's id is its length too. unsloth_zoo
+ # (#1442) counts the image placeholders left after tokenizing through this.
+ def convert_tokens_to_ids(self, token):
+ return len(token)
+
def __call__(
self,
text,