style:fmt

This commit is contained in:
aries_ckt 2023-08-10 14:38:50 +08:00
parent 84fbebda4c
commit a7ec3400fe
4 changed files with 7 additions and 5 deletions

View File

@ -165,7 +165,9 @@ class Config(metaclass=Singleton):
self.KNOWLEDGE_CHUNK_SIZE = int(os.getenv("KNOWLEDGE_CHUNK_SIZE", 100)) self.KNOWLEDGE_CHUNK_SIZE = int(os.getenv("KNOWLEDGE_CHUNK_SIZE", 100))
self.KNOWLEDGE_CHUNK_OVERLAP = int(os.getenv("KNOWLEDGE_CHUNK_OVERLAP", 100)) self.KNOWLEDGE_CHUNK_OVERLAP = int(os.getenv("KNOWLEDGE_CHUNK_OVERLAP", 100))
self.KNOWLEDGE_SEARCH_TOP_SIZE = int(os.getenv("KNOWLEDGE_SEARCH_TOP_SIZE", 5)) self.KNOWLEDGE_SEARCH_TOP_SIZE = int(os.getenv("KNOWLEDGE_SEARCH_TOP_SIZE", 5))
self.KNOWLEDGE_SEARCH_MAX_TOKEN = int(os.getenv("KNOWLEDGE_SEARCH_MAX_TOKEN", 2000)) self.KNOWLEDGE_SEARCH_MAX_TOKEN = int(
os.getenv("KNOWLEDGE_SEARCH_MAX_TOKEN", 2000)
)
### SUMMARY_CONFIG Configuration ### SUMMARY_CONFIG Configuration
self.SUMMARY_CONFIG = os.getenv("SUMMARY_CONFIG", "FAST") self.SUMMARY_CONFIG = os.getenv("SUMMARY_CONFIG", "FAST")

View File

@ -188,7 +188,7 @@ class KnowledgeService:
text_splitter = SpacyTextSplitter( text_splitter = SpacyTextSplitter(
pipeline="zh_core_web_sm", pipeline="zh_core_web_sm",
chunk_size=chunk_size, chunk_size=chunk_size,
chunk_overlap=chunk_overlap chunk_overlap=chunk_overlap,
) )
except Exception: except Exception:
text_splitter = RecursiveCharacterTextSplitter( text_splitter = RecursiveCharacterTextSplitter(

View File

@ -26,7 +26,7 @@ class ChromaStore(VectorStoreBase):
persist_directory=self.persist_dir, persist_directory=self.persist_dir,
embedding_function=self.embeddings, embedding_function=self.embeddings,
client_settings=chroma_settings, client_settings=chroma_settings,
collection_metadata=collection_metadata collection_metadata=collection_metadata,
) )
def similar_search(self, text, topk, **kwargs: Any) -> None: def similar_search(self, text, topk, **kwargs: Any) -> None: