Spaces:
Sleeping
Sleeping
Gemini
commited on
Commit
·
fa21e69
1
Parent(s):
bf063e6
fix: Explicitly disable ChromaDB telemetry\n\n- Set anonymized_telemetry=False in ChromaDB client initialization in both chroma_utils.py and vector_repository.py to resolve persistent posthog errors.
Browse files
lpm_kernel/common/repository/vector_repository.py
CHANGED
|
@@ -26,7 +26,8 @@ class BaseVectorRepository(ABC):
|
|
| 26 |
|
| 27 |
class ChromaRepository(BaseVectorRepository):
|
| 28 |
def __init__(self, collection_name: str, persist_directory: str = "./chroma_db"):
|
| 29 |
-
|
|
|
|
| 30 |
|
| 31 |
# Check if collection exists, create it if it doesn't
|
| 32 |
try:
|
|
|
|
| 26 |
|
| 27 |
class ChromaRepository(BaseVectorRepository):
|
| 28 |
def __init__(self, collection_name: str, persist_directory: str = "./chroma_db"):
|
| 29 |
+
settings = Settings(anonymized_telemetry=False)
|
| 30 |
+
self.client = chromadb.PersistentClient(path=persist_directory, settings=settings)
|
| 31 |
|
| 32 |
# Check if collection exists, create it if it doesn't
|
| 33 |
try:
|
lpm_kernel/file_data/chroma_utils.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
from typing import Optional, Dict, Any, List, Tuple
|
| 2 |
import os
|
| 3 |
import chromadb
|
|
|
|
| 4 |
import logging
|
| 5 |
from lpm_kernel.configs.logging import get_train_process_logger
|
| 6 |
|
|
@@ -73,7 +74,8 @@ def reinitialize_chroma_collections(dimension: int = 1536) -> bool:
|
|
| 73 |
"""
|
| 74 |
try:
|
| 75 |
chroma_path = os.getenv("CHROMA_PERSIST_DIRECTORY", "./data/chroma_db")
|
| 76 |
-
|
|
|
|
| 77 |
|
| 78 |
# Delete and recreate document collection
|
| 79 |
try:
|
|
|
|
| 1 |
from typing import Optional, Dict, Any, List, Tuple
|
| 2 |
import os
|
| 3 |
import chromadb
|
| 4 |
+
from chromadb.config import Settings
|
| 5 |
import logging
|
| 6 |
from lpm_kernel.configs.logging import get_train_process_logger
|
| 7 |
|
|
|
|
| 74 |
"""
|
| 75 |
try:
|
| 76 |
chroma_path = os.getenv("CHROMA_PERSIST_DIRECTORY", "./data/chroma_db")
|
| 77 |
+
settings = Settings(anonymized_telemetry=False)
|
| 78 |
+
client = chromadb.PersistentClient(path=chroma_path, settings=settings)
|
| 79 |
|
| 80 |
# Delete and recreate document collection
|
| 81 |
try:
|