mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-11 03:15:30 +08:00
[CI/Build] Fix lint errors in mistral tokenizer (#9504)
This commit is contained in:
parent
25aeb7d4c9
commit
1bbbcc0b1d
@ -2,11 +2,11 @@ import os
|
|||||||
import re
|
import re
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
|
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
from huggingface_hub import HfApi, hf_hub_download
|
from huggingface_hub import HfApi, hf_hub_download
|
||||||
|
from mistral_common.protocol.instruct.request import ChatCompletionRequest
|
||||||
# yapf: disable
|
# yapf: disable
|
||||||
from mistral_common.tokens.tokenizers.mistral import ChatCompletionRequest
|
|
||||||
from mistral_common.tokens.tokenizers.mistral import (
|
from mistral_common.tokens.tokenizers.mistral import (
|
||||||
MistralTokenizer as PublicMistralTokenizer)
|
MistralTokenizer as PublicMistralTokenizer)
|
||||||
# yapf: enable
|
# yapf: enable
|
||||||
@ -166,7 +166,7 @@ class MistralTokenizer:
|
|||||||
tools: Optional[Dict[str, Any]] = None,
|
tools: Optional[Dict[str, Any]] = None,
|
||||||
**kwargs) -> List[int]:
|
**kwargs) -> List[int]:
|
||||||
|
|
||||||
last_message = messages[-1]
|
last_message = cast(Dict[str, Any], messages[-1])
|
||||||
if last_message["role"] == "assistant":
|
if last_message["role"] == "assistant":
|
||||||
last_message["prefix"] = True
|
last_message["prefix"] = True
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user