A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 09:30 UTC
[CI/Build] Fix lint errors in mistral tokenizer (#9504)
Cyrus Leung committed
Oct 19, 2024 at 00:09 UTC
1bbbcc0b1d96384a72b13d34600b1bdd24cb0f7f
1 file changed
+3
-3
vllm/transformers_utils/tokenizers/mistral.py
+3
-3
@@ -2,11 +2,11 @@ import os
2
import re
3
from dataclasses import dataclass
4
from pathlib import Path
5
-from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
5
+from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union, cast
6
7
from huggingface_hub import HfApi, hf_hub_download
8
+from mistral_common.protocol.instruct.request import ChatCompletionRequest
9
# yapf: disable
9
-from mistral_common.tokens.tokenizers.mistral import ChatCompletionRequest
10
from mistral_common.tokens.tokenizers.mistral import (
11
MistralTokenizer as PublicMistralTokenizer)
12
# yapf: enable
@@ -166,7 +166,7 @@ class MistralTokenizer:
166
tools: Optional[Dict[str, Any]] = None,
167
**kwargs) -> List[int]:
168
169
- last_message = messages[-1]
169
+ last_message = cast(Dict[str, Any], messages[-1])
170
if last_message["role"] == "assistant":
171
last_message["prefix"] = True
172