Skip to content
Permalink
Browse files

fix(doc_reducer_router): fix reduce error

  • Loading branch information...
numb3r3 committed Jul 17, 2019
1 parent 94f1496 commit fb07ff02fbd93cc07c570211bd0d5b6515ea6586
Showing with 7 additions and 5 deletions.
  1. +3 −1 Dockerfile
  2. +1 −1 docker-push.sh
  3. +1 −1 gnes/router/reduce/document.py
  4. +2 −2 tests/__init__.py
@@ -13,7 +13,9 @@ FROM dependency as base
ADD . ./


RUN pip --no-cache-dir install .[all] \
RUN pip --no-cache-dir install -e .[all] \
&& rm -rf /tmp/*

# WORKDIR /

ENTRYPOINT ["gnes"]
@@ -11,7 +11,7 @@ _docker_push() {
docker build --rm --target $TARGET -t ${DOCKER_NAMESPACE}/${PROJ_NAME}:${GIT_TAG} .
docker push ${DOCKER_NAMESPACE}/${PROJ_NAME}:${GIT_TAG}
printf 'done! and to run the container simply do:\n'
printf "\e[1;33mdocker run --entrypoint "/bin/bash" --rm -v /data1/cips/data:/ext_data -it $DOCKER_NAMESPACE/$PROJ_NAME:$GIT_TAG\e[0m\n"
printf "\e[1;33mdocker run --entrypoint "/bin/bash" --rm -v /data/ext_models/ext_models:/ext_data -it $DOCKER_NAMESPACE/$PROJ_NAME:$GIT_TAG\e[0m\n"
}

_select_namespace() {
@@ -9,7 +9,7 @@ def apply(self, msg: 'gnes_pb2.Message', accum_msgs: List['gnes_pb2.Message'], *
final_docs = []
for idx, r in enumerate(msg.response.search.topk_results):
# get result from all shards, some may return None, we only take the first non-None doc
final_docs.append([r for m in accum_msgs if
final_docs.append([m.response.search.topk_results[idx] for m in accum_msgs if
m.response.search.topk_results[idx].doc.WhichOneof('raw_data') is not None][0])

# resort all doc result as the doc_weight has been applied
@@ -48,7 +48,7 @@ def line2pb_doc(line: str, doc_id: int = 0, deliminator: str = r'[.。!?!?]+
'VGG_MODEL': '/',
'RESNET_MODEL': '/',
'INCEPTION_MODEL': '/',
'GNES_PROFILING': 1
'GNES_PROFILING': 0
},
'idc-165': {
'BERT_CI_PORT': 7125,
@@ -63,7 +63,7 @@ def line2pb_doc(line: str, doc_id: int = 0, deliminator: str = r'[.。!?!?]+
'VGG_MODEL': '/ext_data/image_encoder',
'RESNET_MODEL': '/ext_data/image_encoder',
'INCEPTION_MODEL': '/ext_data/image_encoder',
'GNES_PROFILING': 1
'GNES_PROFILING': 0
}

}

0 comments on commit fb07ff0

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