enhancement: introduce Ruff for Python linter for reordering and removing unused imports with automated pre-commit and sytle check (#2366)

This commit is contained in:
Bowen Liang
2024-02-06 13:21:13 +08:00
committed by GitHub
parent 42344795cd
commit 843280f82b
333 changed files with 2109 additions and 1050 deletions

View File

@@ -3,11 +3,20 @@ from __future__ import annotations
from typing import Any, List, Optional, cast
from langchain.text_splitter import (
TS,
AbstractSet,
Collection,
Literal,
RecursiveCharacterTextSplitter,
TokenTextSplitter,
Type,
Union,
)
from core.model_manager import ModelInstance
from core.model_runtime.model_providers.__base.text_embedding_model import TextEmbeddingModel
from core.model_runtime.model_providers.__base.tokenizers.gpt2_tokenzier import GPT2Tokenizer
from langchain.text_splitter import (TS, AbstractSet, Collection, Literal, RecursiveCharacterTextSplitter,
TokenTextSplitter, Type, Union)
class EnhanceRecursiveCharacterTextSplitter(RecursiveCharacterTextSplitter):