From 99286e7bd42494028af236cdeba66bd8af86c750 Mon Sep 17 00:00:00 2001 From: sauyon <2347889+sauyon@users.noreply.github.com> Date: Tue, 1 Nov 2022 15:27:57 -0700 Subject: [PATCH] make quickstart batchable --- examples/quickstart/service.py | 2 +- examples/quickstart/train.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/quickstart/service.py b/examples/quickstart/service.py index f96f8b9fc54..c2e356cc371 100644 --- a/examples/quickstart/service.py +++ b/examples/quickstart/service.py @@ -9,7 +9,7 @@ @svc.api( - input=NumpyNdarray.from_sample(np.array([[4.9, 3.0, 1.4, 0.2]], dtype=np.double)), + input=NumpyNdarray.from_sample(np.array([[4.9, 3.0, 1.4, 0.2]], dtype=np.double), enforce_shape=False), output=NumpyNdarray(), ) async def classify(input_series: np.ndarray) -> np.ndarray: diff --git a/examples/quickstart/train.py b/examples/quickstart/train.py index 3ab83b6f574..985103e956d 100644 --- a/examples/quickstart/train.py +++ b/examples/quickstart/train.py @@ -18,5 +18,5 @@ clf.fit(X, y) # Save model to BentoML local model store - saved_model = bentoml.sklearn.save_model("iris_clf", clf) + saved_model = bentoml.sklearn.save_model("iris_clf", clf, signatures={"predict": {"batchable": True, "batch_dim": 0}}) print(f"Model saved: {saved_model}")