chore: cleanup unnecessary mypy suppressions on imports (#24712)

This commit is contained in:
Bowen Liang 2025-08-28 23:17:25 +08:00 committed by GitHub
commit 39064197da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 37 additions and 37 deletions

View file

@ -144,7 +144,7 @@ class TextSplitter(BaseDocumentTransformer, ABC):
def from_huggingface_tokenizer(cls, tokenizer: Any, **kwargs: Any) -> TextSplitter:
"""Text splitter that uses HuggingFace tokenizer to count length."""
try:
from transformers import PreTrainedTokenizerBase # type: ignore
from transformers import PreTrainedTokenizerBase
if not isinstance(tokenizer, PreTrainedTokenizerBase):
raise ValueError("Tokenizer received was not an instance of PreTrainedTokenizerBase")