This message was deleted.
# ask-for-help
s
This message was deleted.
👀 1
🍱 1
🏁 1
b
I think what you propose is fine. I think we should update the doc to expose that functionality.
s
What you proposed is OK. The example had it that way because the model instance needs to be passed as a Runner init param for the builder to recognize it. As long as you do that, how to structure the runnable doesn’t matter.
Copy code
spam_detection_runner = bentoml.Runner(SpamDetectionRunnable, models=[bento_model])
t
Thanks @Bo and @Sean for the feedback. I am circling back to this just to close the loop. I discovered that actually passing to models, did turn out to be necessary. So:
Copy code
# this did not save the model into the bento
spam_detection_runner = bentoml.Runner(SpamDetectionRunnable, 
  runnable_init_params={"model": bento_model},
)

# but this did
spam_detection_runner = bentoml.Runner(SpamDetectionRunnable, 
  runnable_init_params={"model": bento_model},
  models=[bento_model],
)
Oddly, the former doesn’t error when building the bento, but when I try running the service inside the built docker container, it complains the model wasn’t packaged in it