File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " mistral_inference"
3
- version = " 1.3.0 "
3
+ version = " 1.3.1 "
4
4
description = " "
5
5
authors = [
" bam4d <[email protected] >" ]
6
6
readme = " README.md"
Original file line number Diff line number Diff line change 1
- __version__ = "1.3.0 "
1
+ __version__ = "1.3.1 "
Original file line number Diff line number Diff line change 12
12
from mistral_common .protocol .instruct .request import ChatCompletionRequest
13
13
from mistral_common .tokens .tokenizers .base import Tokenizer
14
14
from mistral_common .tokens .tokenizers .mistral import MistralTokenizer
15
+ from mistral_common .tokens .tokenizers .tekken import Tekkenizer , SpecialTokenPolicy
15
16
from mistral_common .tokens .tokenizers .sentencepiece import is_sentencepiece
16
17
from mistral_common .tokens .tokenizers .tekken import is_tekken
17
18
@@ -36,6 +37,9 @@ def load_tokenizer(model_path: Path) -> MistralTokenizer:
36
37
37
38
mistral_tokenizer = MistralTokenizer .from_file (str (model_path / tokenizer [0 ]))
38
39
40
+ if isinstance (mistral_tokenizer .instruct_tokenizer .tokenizer , Tekkenizer ):
41
+ mistral_tokenizer .instruct_tokenizer .tokenizer .special_token_policy = SpecialTokenPolicy .KEEP
42
+
39
43
logging .info (f"Loaded tokenizer of type { mistral_tokenizer .instruct_tokenizer .__class__ } " )
40
44
41
45
return mistral_tokenizer
You can’t perform that action at this time.
0 commit comments