Trying to deploy an ml model as an api through bentoml

1.1k views Asked by At
import bentoml
import numpy as np
from bentoml.io import NumpyNdarray

# Get the runner
xgb_runner = bentoml.models.get("xgb_booster:latest").to_runner()

# Create a Service object
svc = bentoml.Service("xgb_classifier", runners=[xgb_runner])

# Create an endpoint named classify
@svc.api(input=NumpyNdarray(), output=NumpyNdarray())
def classify(input_series) -> np.ndarray:
    # Convert the input string to numpy array
    label = xgb_runner.predict.run(input_series)

    return label

bentoml serve service.py:svc --reload

so this is my code and the error i am getting is

Error: [bentoml-cli] serve failed: Failed to load bento or import service 'Service.py:svc'. If you are attempting to import bento in local store: 'Failed to import module "Service.py": No module named 'Service.py''. If you are importing by python module path: 'Bento 'Service.py:svc' is not found in BentoML store <osfs '/root/bentoml/bentos'>'.

so i tried pip install service

0

There are 0 answers