<It looks like there is a planned upcoming depreca...
# ask-for-help
a
It looks like there is a planned upcoming deprecation of the ML framework APIs in BentoML. Just curious if there is any GitHub issue or documentation about this that we could look at as a preview of what is to come. Seems similar to the deprecations from 1.2.0 but then brought back in a later 1.2.x release, so I’d be interested in getting a sense of the rationale and what the upcoming alternative will be. Thanks! 😃
a
Hi Adam, we don’t have a docs for this yet, but the plan going forward is that for most frameworks users should use
bentoml.models.create
API to save to BentoML store
Copy code
with bentoml.models.create("my-model") as model:
  # your saving logic here
In users training script, etc. Then in your service definition, you can use the following pattern
Copy code
@bentoml.service
class Service:
  model = bentoml.models.BentoModel("my-model")

  def __init__(self): ...
If you are using HuggingFace models then you can use
bentoml.models.HuggingFaceModel
directly
Copy code
@bentoml.service
class Service:
  model = bentoml.models.HuggingFaceModel("my-model")

  def __init__(self): ...
You can see more here https://docs.bentoml.com/en/latest/guides/model-loading-and-management.html#model-loading-and-management
👍 1
gratitude thank you 1