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

docs: Add model loading doc #5049

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add API doc
Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>
Sherlock113 committed Oct 29, 2024
commit 06b63d60f8acff02df82030ad09ca20db6d6fbe1
2 changes: 2 additions & 0 deletions docs/source/guides/model-loading-and-management.rst
Original file line number Diff line number Diff line change
@@ -108,6 +108,8 @@ BentoML provides an efficient mechanism for loading AI models to accelerate mode

When using ``HuggingFaceModel`` and ``BentoModel``, you must load the model from the class scope of a Service. Defining the model as a class variable declares it as a dependency of the Service, ensuring the models are referenced by the Bento when transported and deployed. If you call these two APIs within the constructor of a Service class, the model will not be referenced by the Bento. As a result, it will not be pushed or deployed, leading to a model ``NotFound`` error.

For more information, see :doc:`/reference/stores`.

Manage models
-------------

13 changes: 13 additions & 0 deletions docs/source/reference/stores.rst
Original file line number Diff line number Diff line change
@@ -15,6 +15,19 @@ Manage Bentos
.. autofunction:: bentoml.build
.. autofunction:: bentoml.bentos.build_bentofile

Load models
-----------

.. autoclass:: bentoml.models.BentoModel
:members: to_info, from_info, resolve
:undoc-members:
:show-inheritance:

.. autoclass:: bentoml.models.HuggingFaceModel
:members: to_info, from_info, resolve
:undoc-members:
:show-inheritance:

Manage models
-------------