Load model weights without Hugging Face or S3
data
folder to store any necessary files.
Here’s an example of the data
folder for a Truss of Stable Diffusion 2.1.
self._data_dir
variable in the load()
function of model/model.py
:
external_data
in config.yamldata
directorydata/
directory to S3.
First, add the URLs for hosted versions of the large files to config.yaml
:
data
folder. The Stable Diffusion Truss has the following directory structure after large files are removed:
model/model.py
does not need to be changed and will automatically pull the large files from the provided links.
config.yaml
. Set the values to null
, only the keys are needed here.
__init__()
function:
boto3
package to access your model weights in load()
.
When you’re ready to deploy your model, make sure to pass is_trusted=True
to baseten.deploy()
: