This commit is contained in:
betterwang 2024-03-07 23:02:06 +08:00
parent f14fee9b0d
commit c2a280d72e
5 changed files with 45 additions and 57 deletions

View file

@ -29,10 +29,8 @@ class RAGIndexFactory(ConfigFactory):
embed_model = self.extract_embed_model(config, **kwargs)
vector_store = FaissVectorStore.from_persist_dir(str(config.persist_path))
storage_context = StorageContext.from_defaults(
vector_store=vector_store, persist_dir=config.persist_path, embed_mode=embed_model
)
index = load_index_from_storage(storage_context=storage_context)
storage_context = StorageContext.from_defaults(vector_store=vector_store, persist_dir=config.persist_path)
index = load_index_from_storage(storage_context=storage_context, embed_model=embed_model)
return index
def _create_chroma(self, config: ChromaIndexConfig, **kwargs) -> VectorStoreIndex: