Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
bojiang committed Jan 6, 2021
1 parent e2819fe commit 125ff8c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bentoml/saved_bundle/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,12 @@ def get_bento_service_metadata_pb(self):
else:
api_metadata.mb_max_batch_size = DEFAULT_MAX_BATCH_SIZE

# Supports customize route from 0.10.2
if 'route' in api_config:
api_metadata.route = api_config["route"]
else:
# Use API name as the URL route when route config is missing,
# this is for backward compatibility for
# BentoML version <= 0.10.1
api_metadata.route = api_config["name"]

if "input_config" in api_config:
Expand Down
4 changes: 3 additions & 1 deletion bentoml/service/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def api_decorator(
:param output: OutputAdapter instance of the inference API
:param api_name: API name, default to the user-defined callback function's function
name
:param route: to customize the route of API
:param route: Specify HTTP URL route of this inference API. By default,
`api.name` is used as the route. This parameter can be used for customizing
the URL route, e.g. `route="/api/v2/model_a/predict"`
Default: None (the same as api_name)
:param api_doc: user-facing documentation of the inference API. default to the
user-defined callback function's docstring
Expand Down
4 changes: 3 additions & 1 deletion bentoml/service/inference_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def __init__(
"""
:param service: ref to service containing this API
:param name: API name
:param route: API path (by default the same as `name`)
:param doc: the user facing document of this inference API, default to the
docstring of the inference API function
:param input_adapter: A InputAdapter that transforms HTTP Request and/or
Expand All @@ -75,6 +74,9 @@ def __init__(
memory to hold the entire batch's data). Default: 1000.
:param batch: If true, the user API functool would take a batch of input data
a time.
:param route: Specify HTTP URL route of this inference API. By default,
`api.name` is used as the route. This parameter can be used for customizing
the URL route, e.g. `route="/api/v2/model_a/predict"`
"""
self._service = service
self._name = name
Expand Down

0 comments on commit 125ff8c

Please sign in to comment.