diff --git a/app/utils/milvus_utils.py b/app/utils/milvus_utils.py index 82306e1..3e3cc28 100644 --- a/app/utils/milvus_utils.py +++ b/app/utils/milvus_utils.py @@ -48,8 +48,9 @@ class MilvusService: vector_store=vector_store, embed_model=self.embeddings, ) - from llama_index.core.node_parser import HierarchicalNodeParser - parser = HierarchicalNodeParser.from_defaults(chunk_sizes=[2048, 512, 128]) + from llama_index.core.node_parser import SimpleNodeParser + # parser = HierarchicalNodeParser.from_defaults(chunk_sizes=[2048, 512, 128]) + parser = SimpleNodeParser() # nodes = await parser.aget_nodes_from_documents(documents) # 使用同步方法并包装在 asyncio.to_thread 中 nodes = await asyncio.to_thread(parser.get_nodes_from_documents, documents)