Skip to content

Instantly share code, notes, and snippets.

@ahmedbesbes
Last active November 12, 2022 23:19
Show Gist options
  • Save ahmedbesbes/681e79311e9fe664af124919f6f45e09 to your computer and use it in GitHub Desktop.
Save ahmedbesbes/681e79311e9fe664af124919f6f45e09 to your computer and use it in GitHub Desktop.
import numpy as np
import bentoml
from bentoml.io import NumpyNdarray
iris_clf_runner = bentoml.sklearn.get("iris_clf:latest").to_runner()
svc = bentoml.Service("iris_classifier", runners=[iris_clf_runner])
@svc.api(input=NumpyNdarray(), output=NumpyNdarray())
def classify(input_series: np.ndarray) -> np.ndarray:
result = iris_clf_runner.predict.run(input_series)
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment