Liwen Huang
12/06/2022, 7:55 PMimport bentoml
from <http://bentoml.io|bentoml.io> import JSON
from <http://bentoml.io|bentoml.io> import Text
BENTO_MODEL_TAG = "dummy_model:zr64nfdvtoikrlg6"
dummy_runner = bentoml.picklable_model.get(BENTO_MODEL_TAG).to_runner()
dummy_service = bentoml.Service("dummy_service", runners=[dummy_runner])
@dummy_service.api(input=Text(), output=JSON())
def dum_prediction(input_text: str) -> dict[int]:
return dummy_runner.run(input_text)
and my bentofile.yaml like this
service: "service:dummy_service" # Same as the argument passed to bentoml
labels:
owner: liwen_and_the_toxic_group
stage: dev
include:
- "*.py" # A pattern for matching which files to include in the bento
python:
packages: # Additional pip packages required by the service
however when I run bentoml serve service:dummy_service --reload
I got the following error
If you are attempting to import bento in local store: 'Invalid module extension "" in target "service:dummy_service", the only extension acceptable here is ".py"'.
If you are importing by python module path: 'Bento 'service:dummy_service' is not found in BentoML store <osfs '/Users/lihuang/bentoml/bentos'>'.