Library to interact with S3 bucket as a Model Registry.
- Never commit your AWS Account ID to git. Save it in an
.env
file and ensure.env
is added to your.gitiginore
Add an .env
file containing your AWS account ID and region. Example file:
AWS_ACCOUNT_ID=1234567890
AWS_DEFAULT_REGION=ap-southeast-1
REGISTRY_NAME=my-model-registry
Deploy the registry to S3 using the following command
make deploy-registry
Export the bucket name to your envrionment.
At the end of the above command, Terraform will print your bucket_name
. Export that using the following command:
export REGISTRY_BUCKET=<bucket_name_from_terraform_output>
Install the Python library
make install
Using PyTorch as an example:
```
from registry.torch import TorchModel
from registry.registry import ModelRegistry
model = TorchModel(obj=NeuralNetwork(), name="my_torch_model")
```
```
registry = ModelRegistry()
registry.upload_model(model)
```
```
registry = ModelRegistry()
loaded_model = registry.load_model(model_id)
```
```
registry = ModelRegistry()
model_ids = registry.list_models()
print(model_ids)
```
```
registry.delete_model(model_id)
```