Last active
November 12, 2022 23:19
-
-
Save ahmedbesbes/681e79311e9fe664af124919f6f45e09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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