The most common use-case for a Model is to associate it with a pipeline.
from zenml import pipelinefrom zenml import Model@pipeline( model=Model( name="ClassificationModel", # Give your models unique names tags=["MVP", "Tabular"] # Use tags for future filtering ))defmy_pipeline(): ...
This will associate this pipeline with the model specified. In case the model already exists, this will create a new version of that model.
In case you want to attach the pipeline to an existing model version, specify this as well.
from zenml import pipelinefrom zenml import Modelfrom zenml.enums import ModelStages@pipeline( model=Model( name="ClassificationModel", # Give your models unique names tags=["MVP", "Tabular"], # Use tags for future filtering version=ModelStages.LATEST # Alternatively use a stage: [STAGING, PRODUCTION]] ))defmy_pipeline(): ...
Feel free to also move the Model configuration into your configuration files:
...model:name:text_classifierdescription:A breast cancer classifiertags: ["classifier","sgd"]...