Changes
1 changed files (+8/-3)
-
-
@@ -5,6 +5,7 @@ import sqlite3import sys import threading import numpy as np import PIL import sqlite_vec from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler, FileOpenedEvent
-
@@ -82,12 +83,16 @@ if os.path.isfile(path):if db_vals is None or db_vals[0] != s.st_mtime_ns or db_vals[1] != parent: # Not in DB or modified # Probably faster to query DB first instead of guessing mimetype first type = mimetypes.guess_type(path)[0] if not type.startswith("image"): mtype = mimetypes.guess_type(path)[0] if mtype is None or not mtype.startswith("image"): # Only support image embeddings for now return emb = model.embed_image(path) try: emb = model.embed_image(path) except PIL.UnidentifiedImageError: print("Couldn't index", path) return # sqlite-vec doesn't support INSERT OR REPLACE and UPSERT # https://github.com/asg017/sqlite-vec/issues/127
-