fix: silence ChromaDB telemetry warnings and CoreML segfault on Apple Silicon
ChromaDB 0.6.x bundles a Posthog telemetry client whose capture() signature is incompatible with the installed posthog library, producing noisy "Failed to send telemetry event" stderr warnings on every operation. Silence by raising the logger threshold to CRITICAL. ONNX Runtime's CoreML execution provider segfaults during vector queries on macOS ARM64 (issue #74). Auto-set ORT_DISABLE_COREML=1 on Apple Silicon to force CPU execution, while respecting any user-provided override via os.environ.setdefault(). Made-with: Cursor
This commit is contained in:
+17
-2
@@ -1,6 +1,21 @@
|
||||
"""MemPalace — Give your AI a memory. No API key required."""
|
||||
|
||||
from .cli import main
|
||||
from .version import __version__
|
||||
import logging
|
||||
import os
|
||||
import platform
|
||||
|
||||
from .cli import main # noqa: E402
|
||||
from .version import __version__ # noqa: E402
|
||||
|
||||
# ChromaDB 0.6.x ships a Posthog telemetry client whose capture() signature is
|
||||
# incompatible with the bundled posthog library, producing noisy stderr warnings
|
||||
# on every client operation ("Failed to send telemetry event … capture() takes
|
||||
# 1 positional argument but 3 were given"). Silence just that logger.
|
||||
logging.getLogger("chromadb.telemetry.product.posthog").setLevel(logging.CRITICAL)
|
||||
|
||||
# ONNX Runtime's CoreML provider segfaults during vector queries on Apple Silicon.
|
||||
# Force CPU execution unless the user has explicitly set a preference.
|
||||
if platform.machine() == "arm64" and platform.system() == "Darwin":
|
||||
os.environ.setdefault("ORT_DISABLE_COREML", "1")
|
||||
|
||||
__all__ = ["main", "__version__"]
|
||||
|
||||
Reference in New Issue
Block a user