yangdx commited on
Commit
22483ea
·
1 Parent(s): 07feee7

Standardize variable names with other vector database implementations (without functional modifications)

Browse files
lightrag/kg/faiss_impl.py CHANGED
@@ -27,8 +27,8 @@ class FaissVectorDBStorage(BaseVectorStorage):
27
 
28
  def __post_init__(self):
29
  # Grab config values if available
30
- config = self.global_config.get("vector_db_storage_cls_kwargs", {})
31
- cosine_threshold = config.get("cosine_better_than_threshold")
32
  if cosine_threshold is None:
33
  raise ValueError(
34
  "cosine_better_than_threshold must be specified in vector_db_storage_cls_kwargs"
 
27
 
28
  def __post_init__(self):
29
  # Grab config values if available
30
+ kwargs = self.global_config.get("vector_db_storage_cls_kwargs", {})
31
+ cosine_threshold = kwargs.get("cosine_better_than_threshold")
32
  if cosine_threshold is None:
33
  raise ValueError(
34
  "cosine_better_than_threshold must be specified in vector_db_storage_cls_kwargs"
lightrag/kg/nano_vector_db_impl.py CHANGED
@@ -79,8 +79,8 @@ class NanoVectorDBStorage(BaseVectorStorage):
79
  # Initialize lock only for file operations
80
  self._save_lock = asyncio.Lock()
81
  # Use global config value if specified, otherwise use default
82
- config = self.global_config.get("vector_db_storage_cls_kwargs", {})
83
- cosine_threshold = config.get("cosine_better_than_threshold")
84
  if cosine_threshold is None:
85
  raise ValueError(
86
  "cosine_better_than_threshold must be specified in vector_db_storage_cls_kwargs"
 
79
  # Initialize lock only for file operations
80
  self._save_lock = asyncio.Lock()
81
  # Use global config value if specified, otherwise use default
82
+ kwargs = self.global_config.get("vector_db_storage_cls_kwargs", {})
83
+ cosine_threshold = kwargs.get("cosine_better_than_threshold")
84
  if cosine_threshold is None:
85
  raise ValueError(
86
  "cosine_better_than_threshold must be specified in vector_db_storage_cls_kwargs"