Skip to content

thomas-happify/happifyml

Repository files navigation

Happify ML

Happify AI team MLOps Solution for Centralized, Flexible and Reproducible Modeling

🐳 Installation

pip install git+https://github.com/thomas-happify/happifyml.git

🚀 Quickstart

Command Line Interface

  1. Submit ANY training command to Azure compute.
hml azure <your-local-training-arguments>

# hml azure python run.py --nodes=8 --gpus=8
# hml azure bash run.sh
  1. Register model from AML experiment.
hml azure --register <run-id> --model-name <custom-model-name> --model-path <model-remote-path-on-azure>
  1. Switch to another Azure ML workspace.
hml azure --relogin
  1. [TODO] Initialize research template
hml init <project-name>
  1. [TODO] Model deployment
hml deploy <configuration-file>

Python SDK

  1. Huggingface Integrations
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from happifyml import AzureMixin, AzureML

# mixin azure integrations
class AutoModelForSequenceClassification(AzureMixin, AutoModelForSequenceClassification):
    pass

class AutoTokenizer(AzureMixin, AutoTokenizer):
    pass


aml = AzureML()

tokenizer = AutoTokenizer.from_pretrained(<remote-path-to-your-azure-model>, workspace=aml.workspace)
model = AutoModelForSequenceClassification.from_pretrained(<remote-path-to-your-azure-model>, workspace=aml.workspace)

# you then can push to the model to registry in 2 ways:
# 1.
model.save_pretrained(<local-save-path>, push_to_azure=True)
model.save_pretrained(<local-save-path>, push_to_azure=True, push_to_hub=True) # you can push to 2 places as well
# 2.
aml.push(<save-path>)

🧪 Tests (coming soon)

🧑‍💻 Packages (coming soon)