Skip to content

Commit ea9eb9a

Browse files
MementoRCclaude
andcommitted
fix(types): correct import path and add type annotations
- Fix MultiModalEmbeddings import path (atoms subdirectory) - Add explicit type annotation for device attribute - Add type ignore comment for optional import assignment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4266ffa commit ea9eb9a

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/uckn/core/atoms/multi_modal_embeddings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,13 @@ class MultiModalEmbeddings:
8181
def __init__(self, device: str | None = None):
8282
self._logger = logging.getLogger(__name__)
8383
# Defensive: If torch is unavailable, always use cpu
84+
self.device: str = "cpu" # Default value
8485
if (
8586
torch is not None
8687
and hasattr(torch, "cuda")
8788
and callable(getattr(torch.cuda, "is_available", None))
8889
):
8990
self.device = device or ("cuda" if torch.cuda.is_available() else "cpu")
90-
else:
91-
self.device = "cpu"
9291
self._lock = threading.Lock()
9392

9493
# Model loading

src/uckn/core/semantic_search_enhanced.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@
4747
CHROMADB_CONNECTOR_AVAILABLE = False
4848

4949
try:
50-
from .multi_modal_embeddings import MultiModalEmbeddings
50+
from .atoms.multi_modal_embeddings import MultiModalEmbeddings
5151

5252
MULTIMODAL_EMBEDDINGS_AVAILABLE = True
5353
except ImportError:
5454
logging.getLogger(__name__).warning(
5555
"MultiModalEmbeddings not found. "
5656
"Multi-modal search capabilities will be limited."
5757
)
58-
MultiModalEmbeddings = None
58+
MultiModalEmbeddings = None # type: ignore[misc, assignment]
5959
MULTIMODAL_EMBEDDINGS_AVAILABLE = False
6060

6161

0 commit comments

Comments
 (0)