youtu-graphrag
youtu-graphrag copied to clipboard
# refactor: Check for embedding model consistency
refactor: Check for embedding model consistency
This pull request introduces a check to ensure that the embedding model used during inference is consistent with the model used when creating the index.
Changes:
- In
enhanced_kt_retriever.py, the_load_node_embedding_cachemethod now checks for anembedding_model_info.jsonfile and compares the model name. - In
faiss_filter.py, the dimension transformation logic has been removed, and thebuild_indicesmethod now checks forembedding_model_info.jsonand its consistency. - A new method
_save_embedding_model_infohas been added to save the embedding model name.
These changes prevent the use of inconsistent embeddings, which could lead to unexpected behavior.