modelstore is a library for versioning, exporting, and storing machine learning models
Project description
modelstore
modelstore
is a Python library that allows you to version, export, save and download machine learning models in your choice of storage.
For more details, please refer to the documentation.
This library has been developed using Python 3.6
, 3.7
and 3.8
. Please open an issue if you have any trouble!
Installation
pip install modelstore
Supported storage types
- AWS S3 Bucket (example)
- Azure Blob Storage (example)
- Google Cloud Storage Bucket (example)
- A filesystem directory (example)
- A hosted storage option (Get in touch for an API key! example)
Supported machine learning libraries
- Catboost
- Fast.AI
- Gensim
- Keras
- LightGBM
- PyTorch
- PyTorch Lightning
- Scikit Learn
- Tensorflow
- Transformers
- XGBoost
Is there a machine learning framework that is missing? Feel free to open an issue or send us a pull request!
Features
- Model versioning on each upload
- Replaces all the boiler plate code you need to save models
- Support for multiple clouds (AWS, GCP, Azure)
- List models in a domain
- Download model archives by id
- Create model states and manage which state a model is in
Example Usage
Colab Notebook
There is a full example in this Colab notebook.
Python Script
from modelstore import ModelStore
# And your other imports
# Train your model
clf = RandomForestClassifier(n_estimators=10)
clf = clf.fit(X, Y)
# Create a model store that uses a one of the storage options
# In this example, the model store is created with a GCP bucket
model_store = ModelStore.from_gcloud(
project_name="my-project",
bucket_name="my-bucket",
)
# Upload the archive to your model store
domain = "example-model"
meta_data = model_store.upload(domain, model=clf)
# Print the meta-data about the model
print(json.dumps(meta_data, indent=4))
# Download the model back!
target = f"downloaded-{model_type}-model"
os.makedirs(target, exist_ok=True)
model_path = model_store.download(
local_path=target,
domain=model_domain,
model_id=meta["model"]["model_id"],
)
Recorded demo from Data Talks Club
This interview and demo, recorded with Alexey from the Data Talks Club in July 2021, is based on modelstore==0.0.6
. Click below to watch on YouTube.
License
Copyright 2020 Neal Lathia
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for modelstore-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f17053738909c31e03e855144f326170eb0c7ff8cabb2cecaad247c2586ec01 |
|
MD5 | 577ca285486357012f81c42e6b879edc |
|
BLAKE2b-256 | 9e8f0d350a610dda0fa8f891f3d62ee14828bf5da8aec28c69f4b49efa0044ce |