Skip to content
Permalink
Browse files

fix(service): fix bug for doc type in encoder

  • Loading branch information...
Larryjianfeng committed Sep 2, 2019
1 parent a252024 commit ba21c4e7176eb84a860edb1b8b9cfe74821addab
Showing with 4 additions and 1 deletion.
  1. +4 −1 gnes/service/encoder.py
@@ -43,8 +43,11 @@ def embed_chunks_in_docs(self, docs: Union[List['gnes_pb2.Document'], 'gnes_pb2.
for c in d.chunks:
if d.doc_type == gnes_pb2.Document.TEXT:
contents.append(c.text)
else:
elif d.doc_type in {gnes_pb2.Document.IMAGE, gnes_pb2.Document.VIDEO}:
contents.append(blob2array(c.blob))
else:
self.logger.warning(
'chunk content is in type: %s, dont kow how to handle that, ignored' % c.WhichOneof('content'))

if do_encoding:
embeds = self._model.encode(contents)

0 comments on commit ba21c4e

Please sign in to comment.
You can’t perform that action at this time.