Skip to content

Commit

Permalink
file input change: "--input" to "--input-file" (#1362)
Browse files Browse the repository at this point in the history
Co-authored-by: rhbian <ruhan@gentoo.homenetwork>
  • Loading branch information
rhbian and rhbian committed Dec 25, 2020
1 parent 7159fe7 commit e8de72b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bentoml/cli/bento_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def bentoml_cli():
BentoML CLI tool
"""

# Example Usage: bentoml run {API_NAME} {BUNDLE_PATH} --input=...
# Example Usage: bentoml run {API_NAME} {BUNDLE_PATH} --input ...
@bentoml_cli.command(
help="Run a API defined in saved BentoService bundle from command line",
short_help="Run API function",
Expand Down
14 changes: 7 additions & 7 deletions docs/source/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -907,21 +907,21 @@ Python. There are two main ways this can be done:
.. code-block:: bash
# With BentoService name and version pair
bentoml run IrisClassifier:latest predict --input='[[5.1, 3.5, 1.4, 0.2]]'
bentoml run IrisClassifier:latest predict --input='./iris_test_data.csv'
bentoml run IrisClassifier:latest predict --input '[[5.1, 3.5, 1.4, 0.2]]'
bentoml run IrisClassifier:latest predict --input-file './iris_test_data.csv'
# With BentoService's saved path
bentoml run $saved_path predict --input='[[5.1, 3.5, 1.4, 0.2]]'
bentoml run $saved_path predict --input='./iris_test_data.csv'
bentoml run $saved_path predict --input '[[5.1, 3.5, 1.4, 0.2]]'
bentoml run $saved_path predict --input-file './iris_test_data.csv'
Or if you have already pip-installed the BentoService, it provides a CLI command
specifically for this BentoService. The CLI command is the same as the BentoService
class name:

.. code-block:: bash
IrisClassifier run predict --input='[[5.1, 3.5, 1.4, 0.2]]'
IrisClassifier run predict --input='./iris_test_data.csv'
IrisClassifier run predict --input '[[5.1, 3.5, 1.4, 0.2]]'
IrisClassifier run predict --input-file './iris_test_data.csv'
Expand Down Expand Up @@ -1019,7 +1019,7 @@ BentoService directly. For example:
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
> bentoml run IrisClassifier:latest predict --input='[[5.1, 3.5, 1.4, 0.2]]'
> bentoml run IrisClassifier:latest predict --input '[[5.1, 3.5, 1.4, 0.2]]'
[0]
Expand Down
4 changes: 2 additions & 2 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ argument or local csv or json files:

.. code-block:: bash
bentoml run IrisClassifier:latest predict --input='[[5.1, 3.5, 1.4, 0.2]]'
bentoml run IrisClassifier:latest predict --input '[[5.1, 3.5, 1.4, 0.2]]'
bentoml run IrisClassifier:latest predict --input='./iris_data.csv'
bentoml run IrisClassifier:latest predict --input-file './iris_data.csv'
Containerize Model API Server
Expand Down
8 changes: 4 additions & 4 deletions guides/quick-start/bentoml-quick-start-guide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,13 @@
"output_type": "stream",
"text": [
"[2020-09-23 09:23:00,640] INFO - Getting latest version IrisClassifier:20200923090955_A2644D\n",
"[2020-09-23 09:23:06,415] INFO - {'service_name': 'IrisClassifier', 'service_version': '20200923090955_A2644D', 'api': 'predict', 'task': {'data': {}, 'task_id': 'f1982177-45bb-4c3f-8348-01d3c06b7cae', 'batch': 1, 'cli_args': ('--input=[[5.1, 3.5, 1.4, 0.2]]',)}, 'result': {'data': '[0]', 'http_status': 200, 'http_headers': (('Content-Type', 'application/json'),)}, 'request_id': 'f1982177-45bb-4c3f-8348-01d3c06b7cae'}\n",
"[2020-09-23 09:23:06,415] INFO - {'service_name': 'IrisClassifier', 'service_version': '20200923090955_A2644D', 'api': 'predict', 'task': {'data': {}, 'task_id': 'f1982177-45bb-4c3f-8348-01d3c06b7cae', 'batch': 1, 'cli_args': ('--input [[5.1, 3.5, 1.4, 0.2]]',)}, 'result': {'data': '[0]', 'http_status': 200, 'http_headers': (('Content-Type', 'application/json'),)}, 'request_id': 'f1982177-45bb-4c3f-8348-01d3c06b7cae'}\n",
"[0]\n"
]
}
],
"source": [
"!bentoml run IrisClassifier:latest predict --input='[[5.1, 3.5, 1.4, 0.2]]'"
"!bentoml run IrisClassifier:latest predict --input '[[5.1, 3.5, 1.4, 0.2]]'"
]
},
{
Expand All @@ -682,14 +682,14 @@
"output_type": "stream",
"text": [
"[2020-09-23 09:23:08,352] INFO - Getting latest version IrisClassifier:20200923090955_A2644D\n",
"[2020-09-23 09:23:11,535] INFO - {'service_name': 'IrisClassifier', 'service_version': '20200923090955_A2644D', 'api': 'predict', 'task': {'data': {'uri': 'file:///Users/chaoyu/workspace/BentoML/guides/quick-start/iris_data.csv', 'name': 'iris_data.csv'}, 'task_id': 'a02d0a95-09a6-4011-aa8d-3aa86681b11e', 'batch': 150, 'cli_args': ('--input-file=./iris_data.csv',)}, 'result': {'data': '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]', 'http_status': 200, 'http_headers': (('Content-Type', 'application/json'),)}, 'request_id': 'a02d0a95-09a6-4011-aa8d-3aa86681b11e'}\n",
"[2020-09-23 09:23:11,535] INFO - {'service_name': 'IrisClassifier', 'service_version': '20200923090955_A2644D', 'api': 'predict', 'task': {'data': {'uri': 'file:///Users/chaoyu/workspace/BentoML/guides/quick-start/iris_data.csv', 'name': 'iris_data.csv'}, 'task_id': 'a02d0a95-09a6-4011-aa8d-3aa86681b11e', 'batch': 150, 'cli_args': ('--input-file ./iris_data.csv',)}, 'result': {'data': '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]', 'http_status': 200, 'http_headers': (('Content-Type', 'application/json'),)}, 'request_id': 'a02d0a95-09a6-4011-aa8d-3aa86681b11e'}\n",
"[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]\n"
]
}
],
"source": [
"!bentoml run IrisClassifier:latest predict \\\n",
" --input-file=\"./iris_data.csv\""
" --input-file \"./iris_data.csv\""
]
},
{
Expand Down

0 comments on commit e8de72b

Please sign in to comment.