awslabs / multi-model-server

Multi Model Server is a tool for serving neural net models for inference
Apache License 2.0
998 stars 230 forks source link

function top_probability missing 'self' argument; fixing python3 syntax error. #803

Closed JustinhoCHN closed 5 years ago

JustinhoCHN commented 5 years ago

Before or while filing an issue please feel free to join our slack channel to get in touch with development team, ask questions, find out what's cooking and more!

Issue #, if available:

Description of changes:

  1. function top_probability missing 'self' argument;

  2. function postprocessing for loop syntax error: for idx, resp in data[:self._num_requests]: should be for idx, resp in enumerate(data[:self._num_requests]):, other wise it'll raise some error like TypeError: 'int' object is not iterable in python 3.

Testing done:

I think local build test is passed.

agent_1  | -- Docs: http://doc.pytest.org/en/latest/warnings.html
agent_1  | =================== 51 passed, 2 warnings in 228.75 seconds ====================
agent_1  | 
agent_1  | [Container] 2019/05/21 01:46:48 Running command cd model-archiver/ && python -m pytest model_archiver/tests/unit_tests && cd ../
agent_1  | ============================= test session starts ==============================
agent_1  | platform linux -- Python 3.6.5, pytest-3.6.2, py-1.5.3, pluggy-0.6.0
agent_1  | rootdir: /codebuild/output/srcDownload/src/model-archiver, inifile:
agent_1  | plugins: mock-1.10.4
agent_1  | collected 28 items
agent_1  | 
agent_1  | model_archiver/tests/unit_tests/test_model_packaging.py ...              [ 10%]
agent_1  | model_archiver/tests/unit_tests/test_model_packaging_utils.py .......... [ 46%]
agent_1  | ..............                                                           [ 96%]
agent_1  | model_archiver/tests/unit_tests/test_version.py .                        [100%]
agent_1  | 
agent_1  | ========================== 28 passed in 0.13 seconds ===========================
agent_1  | 
agent_1  | [Container] 2019/05/21 01:46:48 Running command pylint -rn --rcfile=./mms/tests/pylintrc mms/.
agent_1  | Using config file /codebuild/output/srcDownload/src/mms/tests/pylintrc
agent_1  | 
agent_1  | ------------------------------------
agent_1  | Your code has been rated at 10.00/10
agent_1  | 
agent_1  | 
agent_1  | [Container] 2019/05/21 01:46:53 Running command cd model-archiver/ && pylint -rn --rcfile=./model_archiver/tests/pylintrc model_archiver/. && cd ../
agent_1  | Using config file /codebuild/output/srcDownload/src/model-archiver/model_archiver/tests/pylintrc
agent_1  | 
agent_1  | ------------------------------------
agent_1  | Your code has been rated at 10.00/10
agent_1  | 
agent_1  | 
agent_1  | [Container] 2019/05/21 01:46:57 Running command $NIGHTLYBUILD
agent_1  | 
agent_1  | [Container] 2019/05/21 01:46:57 Running command eval $NIGHTLYUPLOAD
agent_1  | 
agent_1  | [Container] 2019/05/21 01:46:57 Phase complete: BUILD State: SUCCEEDED
agent_1  | [Container] 2019/05/21 01:46:57 Phase context status code:  Message: 
agent_1  | [Container] 2019/05/21 01:46:57 Entering phase POST_BUILD
agent_1  | [Container] 2019/05/21 01:46:57 Phase complete: POST_BUILD State: SUCCEEDED
agent_1  | [Container] 2019/05/21 01:46:57 Phase context status code:  Message: 
agent_1  | [Container] 2019/05/21 01:46:57 Expanding base directory path: .
agent_1  | [Container] 2019/05/21 01:46:57 Assembling file list
agent_1  | [Container] 2019/05/21 01:46:57 Expanding .
agent_1  | [Container] 2019/05/21 01:46:57 Expanding artifact file paths for base directory .
agent_1  | [Container] 2019/05/21 01:46:57 Assembling file list
agent_1  | [Container] 2019/05/21 01:46:57 Expanding dist/*.whl
agent_1  | [Container] 2019/05/21 01:46:57 Expanding model_archiver/dist/*.whl
agent_1  | [Container] 2019/05/21 01:46:57 Expanding frontend/server/build/reports/**/*
agent_1  | [Container] 2019/05/21 01:46:57 Expanding frontend/modelarchive/build/reports/**/*
agent_1  | [Container] 2019/05/21 01:46:57 Expanding frontend/cts/build/reports/**/*
agent_1  | [Container] 2019/05/21 01:46:57 Found 253 file(s)
agent_1  | [Container] 2019/05/21 01:46:57 Preparing to copy secondary artifacts
agent_1  | [Container] 2019/05/21 01:46:57 No secondary artifacts defined in buildspec
agent_1  | [Container] 2019/05/21 01:46:57 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED
agent_1  | [Container] 2019/05/21 01:46:57 Phase context status code:  Message:

To run CI tests on your changes refer README.md

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.