Only try to import memryx SDK when memry detector is used (#19737)

This commit is contained in:
Josh Hawkins 2025-08-24 18:38:30 -05:00 committed by GitHub
parent 5af8fbac51
commit 1636fee36a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,15 +9,6 @@ from queue import Queue
import cv2
import numpy as np
try:
# from memryx import AsyncAccl # Import MemryX SDK
from memryx import AsyncAccl
except ModuleNotFoundError:
raise ImportError(
"MemryX SDK is not installed. Install it and set up MIX environment."
)
from pydantic import BaseModel, Field
from typing_extensions import Literal
@ -55,6 +46,14 @@ class MemryXDetector(DetectionApi):
def __init__(self, detector_config):
"""Initialize MemryX detector with the provided configuration."""
try:
# Import MemryX SDK
from memryx import AsyncAccl
except ModuleNotFoundError:
raise ImportError(
"MemryX SDK is not installed. Install it and set up MIX environment."
)
return
model_cfg = getattr(detector_config, "model", None)