|
6 | 6 | from typing import Literal, Optional |
7 | 7 |
|
8 | 8 | import pytest |
9 | | -from mistral_common.tokens.tokenizers.base import SpecialTokenPolicy, SpecialTokens |
10 | | -from mistral_common.tokens.tokenizers.tekken import SpecialTokenInfo, Tekkenizer |
| 9 | +from mistral_common.tokens.tokenizers.base import SpecialTokenPolicy |
11 | 10 |
|
12 | 11 | from vllm.assets.audio import AudioAsset |
13 | 12 | from vllm.assets.image import ImageAsset |
@@ -2119,34 +2118,9 @@ def test_apply_mistral_chat_template_thinking_chunk(): |
2119 | 2118 | }, |
2120 | 2119 | {"role": "user", "content": "Thanks, what is 3+3?"}, |
2121 | 2120 | ] |
2122 | | - |
2123 | | - # TODO(Julien): upon model release change to a tokenizer already configured. |
2124 | | - # ================================================================= |
2125 | 2121 | mistral_tokenizer = MistralTokenizer.from_pretrained( |
2126 | | - "mistralai/Devstral-Small-2507" |
2127 | | - ) |
2128 | | - assert isinstance(mistral_tokenizer.tokenizer, Tekkenizer) |
2129 | | - # Add think special tokens to the tokenizer |
2130 | | - mistral_tokenizer.tokenizer._all_special_tokens[35] = SpecialTokenInfo( |
2131 | | - rank=35, is_control=True, token_str=SpecialTokens.begin_think.value |
| 2122 | + "mistralai/Magistral-Small-2509" |
2132 | 2123 | ) |
2133 | | - mistral_tokenizer.tokenizer._all_special_tokens[36] = SpecialTokenInfo( |
2134 | | - rank=36, is_control=True, token_str=SpecialTokens.end_think.value |
2135 | | - ) |
2136 | | - mistral_tokenizer.tokenizer._special_tokens_reverse_vocab = { |
2137 | | - k: v |
2138 | | - for k, v in mistral_tokenizer.tokenizer._special_tokens_reverse_vocab.items() |
2139 | | - if v not in {35, 36} |
2140 | | - } |
2141 | | - mistral_tokenizer.tokenizer._special_tokens_reverse_vocab[ |
2142 | | - SpecialTokens.begin_think.value |
2143 | | - ] = 35 |
2144 | | - mistral_tokenizer.tokenizer._special_tokens_reverse_vocab[ |
2145 | | - SpecialTokens.end_think.value |
2146 | | - ] = 36 |
2147 | | - mistral_tokenizer.instruct.BEGIN_THINK = 35 |
2148 | | - mistral_tokenizer.instruct.END_THINK = 36 |
2149 | | - # ================================================================= |
2150 | 2124 |
|
2151 | 2125 | tokens_ids = apply_mistral_chat_template( |
2152 | 2126 | mistral_tokenizer, messages, chat_template=None, tools=None |
|
0 commit comments