From 1c3bb01a2c87717d3a342c86a65592ea78ad717d Mon Sep 17 00:00:00 2001 From: Larry Yan Date: Fri, 26 Jul 2019 15:56:19 +0800 Subject: [PATCH] fix(service): fix bug in doc_type name in indexer service --- gnes/service/indexer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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]