Adam Liter
11/18/2024, 6:57 PMAaron Pham
11/21/2024, 1:33 AMbentoml.models.create API to save to BentoML store
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
@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
@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