Skip to content

Library to interact with S3 bucket as a Model Registry.

License

Notifications You must be signed in to change notification settings

tomsharp/model-registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

model-registry

Library to interact with S3 bucket as a Model Registry.

How to use this Repo

Warning

  • Never commit your AWS Account ID to git. Save it in an .env file and ensure .env is added to your .gitiginore

Setup, Deploy, and Install

Setup

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

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

Install the Python library

make install

Usage

Create model

Using PyTorch as an example:
```
from registry.torch import TorchModel
from registry.registry import ModelRegistry
model = TorchModel(obj=NeuralNetwork(), name="my_torch_model")
```

Upload to registry

```
registry = ModelRegistry()
registry.upload_model(model)
```

Load model from registry

```
registry = ModelRegistry()
loaded_model = registry.load_model(model_id)
```

list model_ids

```
registry = ModelRegistry()
model_ids = registry.list_models()
print(model_ids)
```

Delete model

```
registry.delete_model(model_id)
```

About

Library to interact with S3 bucket as a Model Registry.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published