Skip to main content

A Python package to manage delphai machine learning operations.

Project description

delphai-ml-utils

Installation

pip install delphai-ml-utils

Usage

  • Upload to Azure Blob

The delphai-hybrid cluster allows model training with gpu. This feature allows uploading the trained model from inside the cluster to Azure blobs.

This works by adding a config file to your project config/ml-config.yml .

With this yaml file you can configure to which storage account you want to upload your trained model.

cluster: delphai-hybrid
training_dir: model-gpu
model_name: test-model
dest:
  storage_account_secret: azure-storage/connection-string

training_dir : is the output directory of your trained model (model directory)

model_name : Name your model and with it name the new created azure container to save the model into it (Note if the container name already exists will throw an error)

storage_account_secret: Here add the kubernetes secret name that contains the connection string to the storage account. example azure-storage/conenction-string

How to use with python:

from ml_utils import upload
# Train Model
model.train_model(train_df, use_cuda=True)
# Upload to Azure blob with delphai-ml-utils
upload.upload_to_azure_blob()
  • register gpu

If your model will serve with gpu, we need to monitor every request that comes to the model so kubernetes removes the deployment once it's not being used.

NOTE: if you don't register the model for gpu, it will be destroyed once deployed

from ml_utils import upload, gpu

# serving function
def foo():
    gpu.monitor()

    #
    # Some Logic
    #

    return bar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

delphai-ml-utils-1.0.6.tar.gz (25.0 kB view hashes)

Uploaded Source

Built Distribution

delphai_ml_utils-1.0.6-py3-none-any.whl (28.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page