Conversation
VLMTokenizerWrapper.__init__ sets self.tokenizer but OutlinesLogitsProcessor reads tokenizer._tokenizer (outlines_logits_processor.py:48,58). Any json_schema / guided-decoding request against a VLM therefore raises AttributeError: 'VLMTokenizerWrapper' object has no attribute '_tokenizer'. Alias self._tokenizer = self.tokenizer in __init__ so the Outlines path works with VLM models.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesVLM Tokenizer Compatibility Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Problem
VLMTokenizerWrapper.__init__(chat/mlx/model_types.py) setsself.tokenizerbut notself._tokenizer.OutlinesLogitsProcessorreadstokenizer._tokenizer(chat/mlx/outlines_logits_processor.py:48,58), so any request that usesjson_schema/ guided decoding against a VLM model raises:Fix
Alias
self._tokenizer = self.tokenizerin__init__so the Outlines path resolves the underlying tokenizer for VLM models. One-line change (+ comment).Present on
main(0.5.3). Verified against Gemma-4 with ajson_schemaresponse format.Summary by CodeRabbit