Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make quickstart batchable #3172

Merged
merged 3 commits into from Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/quickstart/service.py
Expand Up @@ -9,7 +9,9 @@


@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:
Expand Down
4 changes: 3 additions & 1 deletion examples/quickstart/train.py
Expand Up @@ -18,5 +18,7 @@
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}")