- Create an access token in your Hugging Face account.
- Store the token securely as
hf_access_tokenin Baseten’s secret manager. - Reference the token in
model.pyusinguse_auth_token.
Configuring Secrets
Add the token reference toconfig.yaml:
config.yaml
model.py:
model/model.py
Example: Deploying a Private BERT Model
We’ll deploy a gated version of BERT base (uncased), a masked language model.1: Initialize Truss
Get started by creating a new Truss:Step 2: Set Dependencies
config.yaml
Step 3: Store the Access Token
- Accept the model terms on Hugging Face.
- Generate an access token.
- Store it as
hf_access_tokenin the Baseten secret manager.