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

Commit

Permalink
Merge pull request #19 from gnes-ai/hotfix_doc_reducer
Browse files Browse the repository at this point in the history
fix(doc_reducer_router): fix reduce error
  • Loading branch information
jemmyshin authored Jul 17, 2019
2 parents 794c699 + d02f320 commit ff86fd6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ ADD . ./
RUN pip --no-cache-dir install .[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 ff86fd6

Please sign in to comment.