diff --git a/gnes/service/indexer.py b/gnes/service/indexer.py index 16d264ef..a0985fd8 100644 --- a/gnes/service/indexer.py +++ b/gnes/service/indexer.py @@ -39,11 +39,11 @@ def _handler_index(self, msg: 'gnes_pb2.Message'): if len(d.chunks): all_vecs.append(blob2array(d.chunk_embeddings)) doc_ids += [d.doc_id] * len(d.chunks) - if d.doc_type == 'TEXT': + if d.doc_type == gnes_pb2.Document.TEXT: offsets += [c.offset_1d for c in d.chunks] - elif d.doc_type == 'IMAGE': + elif d.doc_type == gnes_pb2.Document.IMAGE: offsets += [c.offset_nd for c in d.chunks] - elif d.doc_type == 'VIDEO': + elif d.doc_type == gnes_pb2.Document.VIDEO: offsets += [c.offset_1d for c in d.chunks] weights += [c.weight for c in d.chunks]