Skip to content
Permalink
Browse files

fix(encoder): fix embed_chunks_in_docs function

  • Loading branch information...
hanxiao committed Sep 2, 2019
1 parent d94329b commit 40dd1d5a8bfd41a4edd0729259c8e5fe5411c13e
Showing with 4 additions and 3 deletions.
  1. +4 −3 gnes/service/encoder.py
@@ -29,8 +29,9 @@ def post_init(self):
self.train_data = []

def embed_chunks_in_docs(self, docs: Union[List['gnes_pb2.Document'], 'gnes_pb2.Document'],
do_encoding: bool = True):
if not isinstance(docs, list):
do_encoding: bool = True,
is_input_list: bool = True):
if not is_input_list:
docs = [docs]

contents = []
@@ -82,4 +83,4 @@ def _handler_train(self, msg: 'gnes_pb2.Message'):

@handler.register(gnes_pb2.Request.QueryRequest)
def _handler_search(self, msg: 'gnes_pb2.Message'):
self.embed_chunks_in_docs(msg.request.search.query)
self.embed_chunks_in_docs(msg.request.search.query, is_input_list=False)

0 comments on commit 40dd1d5

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