This message was deleted.
# announcements
s
This message was deleted.
c
Is it a scikitlearn model?
g
Yes it is
t
@Guillermo Alvarado can you use the
PickleArtifact
with pickle_module pointed to joblib?
c
Great suggestion, I think that will work
g
Thanks @Timothy Laurent @Chaoyu I can confirm that PickleArtifact worked as expected
bentoservice.py
from bentoml.service.artifacts.common import PickleArtifact
@env(infer_pip_packages=True)
@artifacts([PickleArtifact('model', pickle_module='joblib')])
class MyBentoService(BentoService):
@api(input=DataframeInput(), batch=True)
def predict_proba(self, df: pd.DataFrame):
return self.artifacts.model.predict_proba(df)
main.py
from bentoservice import MyBentoService
model=load('serialized.joblib')
# Create  service with the  trained model
bento_service = MyBentoService()
bento_service.pack("model", model)
c
👍