This commit is contained in:
Josh Hawkins 2025-07-16 09:36:05 -05:00
parent 2495e4d7c3
commit 497a54ad2a

View File

@ -334,7 +334,7 @@ class Embeddings:
.paginate(current_page, batch_size) .paginate(current_page, batch_size)
) )
while len(events) > 0: while events:
event: Event event: Event
batch_thumbs = {} batch_thumbs = {}
batch_descs = {} batch_descs = {}
@ -345,16 +345,13 @@ class Embeddings:
batch_descs[event.id] = description batch_descs[event.id] = description
totals["descriptions"] += 1 totals["descriptions"] += 1
thumbnail = get_event_thumbnail_bytes(event) if thumbnail := get_event_thumbnail_bytes(event):
batch_thumbs[event.id] = thumbnail
if thumbnail is None: totals["thumbnails"] += 1
continue
batch_thumbs[event.id] = thumbnail
totals["thumbnails"] += 1
# run batch embedding # run batch embedding
self.batch_embed_thumbnail(batch_thumbs) if batch_thumbs:
self.batch_embed_thumbnail(batch_thumbs)
if batch_descs: if batch_descs:
self.batch_embed_description(batch_descs) self.batch_embed_description(batch_descs)