Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(doc_reducer_router): fix reduce error
Browse files Browse the repository at this point in the history
  • Loading branch information
felix committed Jul 17, 2019
1 parent 94f1496 commit fb07ff0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion docker-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion gnes/router/reduce/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
}

}
Expand Down

0 comments on commit fb07ff0

Please sign in to comment.