pip install git+https://github.com/thomas-happify/happifyml.git
- 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
- Register model from AML experiment.
hml azure --register <run-id> --model-name <custom-model-name> --model-path <model-remote-path-on-azure>
- Switch to another Azure ML workspace.
hml azure --relogin
- [TODO] Initialize research template
hml init <project-name>
- [TODO] Model deployment
hml deploy <configuration-file>
- 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>)