Skip to content

Commit 3fe9653

Browse files
authored
docs: Add notes for loading HF private models (#5166)
Add notes for loading hf private model Signed-off-by: Sherlock113 <[email protected]>
1 parent 9cf780d commit 3fe9653

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/source/build-with-bentoml/model-loading-and-management.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ BentoML provides an efficient mechanism for loading AI models to accelerate mode
8181
8282
By default, ``HuggingFaceModel`` returns the downloaded model path as a string, which means you can directly pass the path into libraries like ``transformers`` for model loading.
8383

84-
If you deploy the HF model to BentoCloud, you can view and verify it within your Bento on the details page. It is indicated with the HF icon. Clicking it redirects you to the model page on HF.
84+
If your model is hosted in a private repository, specify your endpoint URL through the ``endpoint`` parameter, which defaults to ``https://huggingface.co/``.
85+
86+
.. code-block:: python
87+
88+
model_path = HuggingFaceModel("your_model_id", endpoint="https://my.huggingface.co/")
89+
90+
After deploying the HF model to BentoCloud, you can view and verify it on the Bento details page. It is indicated with the HF icon. Clicking it redirects you to the model page on HF.
8591

8692
.. image:: ../../_static/img/build-with-bentoml/model-loading-and-management/hf-model-on-bentocloud.png
8793
:alt: Hugging Face model marked with an icon on BentoCloud console

0 commit comments

Comments
 (0)