There was an error while loading. Please reload this page.
1 parent 539c5cc commit 1aa2723Copy full SHA for 1aa2723
1 file changed
headroom/cache/dynamic_detector.py
@@ -770,14 +770,16 @@ def detect(
770
# Encode all sentences
771
if not sentences:
772
return [], None
773
+ if self._model is None or self._exemplar_embeddings is None:
774
+ return [], self._load_error or "semantic detector is not initialized"
775
776
try:
777
import numpy as np
778
except ImportError:
779
return [], "numpy not installed. Install with: pip install numpy"
780
781
sentence_texts = [s[0] for s in sentences]
- sentence_embeddings = self._model.encode( # type: ignore[union-attr]
782
+ sentence_embeddings = self._model.encode(
783
sentence_texts,
784
convert_to_numpy=True,
785
)
0 commit comments