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

YataiService doesn't allow a BentoService without artifacts #1475

Closed
withsmilo opened this issue Feb 26, 2021 · 3 comments · Fixed by #1479
Closed

YataiService doesn't allow a BentoService without artifacts #1475

withsmilo opened this issue Feb 26, 2021 · 3 comments · Fixed by #1479
Assignees
Labels
bug Something isn't working

Comments

@withsmilo
Copy link
Collaborator

Describe the bug

In order to avoid #1037 and #1065, I override the __init__ function of BentoService to download and initialize the required model files from an external service(MLflow). In this case, I don't need to pack any artifacts, but I found a problem in YataiService that doesn't allow this case. The current YataiService includes the assumption that BentoService must always have artifacts.

To Reproduce

from sklearn import svm
from sklearn import datasets
iris = datasets.load_iris()
X, y = iris.data, iris.target
clf = svm.SVC(gamma='scale')
clf.fit(X, y)
# test_bentoservice.py
import pandas as pd
from bentoml import env, artifacts, api, BentoService
from bentoml.adapters import DataframeInput

@env(infer_pip_packages=True)
class TestBentoService(BentoService):
    def __init__(self):
        # Download model files from MLflow and Initialize them
        pass
    @api(input=DataframeInput(), batch=True)
    def predict(self, df: pd.DataFrame):
        return None # We can predict something with model files here.
from test_bentoservice import TestBentoService
bento_service = TestBentoService()
saved_path = bento_service.save()
  1. Run a YataiService and select the BentoService.

Expected behavior

YataiService should show even BentoService without artifacts.

Screenshots/Logs

Environment:

  • OS: MacOS 11.2.2
  • Python Version: 3.7.9
  • BentoML Version: 0.11.0

Additional context

@withsmilo withsmilo added the bug Something isn't working label Feb 26, 2021
@yubozhao
Copy link
Contributor

Run a YataiService and select the BentoService.

Is the selection happens in the web UI?

@withsmilo
Copy link
Collaborator Author

@yubozhao
Yes. When I select the BentoService without artifacts in YataiService UI, nothing is visible.

@yubozhao yubozhao self-assigned this Feb 28, 2021
@yubozhao
Copy link
Contributor

Got it. I will work on a fix. Thank you for finding it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants