Tags can be used to label, search, and track models across different versions. The following guide will demonstrate how to:
The example shown uses the model ccfraudmodel
.
To set a tag for a specific version of a model uploaded to Wallaroo using the Wallaroo Dashboard:
To remove a tag from a version of an uploaded model:
Tags are applied to either model versions or pipelines. This allows organizations to track different versions of models, and search for what pipelines have been used for specific purposes such as testing versus production use.
Tags are created with the Wallaroo client command create_tag(String tagname)
. This creates the tag and makes it available for use.
The tag will be saved to the variable currentTag
to be used in the rest of these examples.
# Now we create our tag
currentTag = wl.create_tag("My Great Tag")
Tags are listed with the Wallaroo client command list_tags()
, which shows all tags and what models and pipelines they have been assigned to.
# List all tags
wl.list_tags()
id | tag | models | pipelines |
---|---|---|---|
1 | My Great Tag | [('tagtestmodel', ['70169e97-fb7e-4922-82ba-4f5d37e75253'])] | [] |
Tags are used with models to track differences in model versions.
Tags are assigned to a model through the Wallaroo Tag add_to_model(model_id)
command, where model_id
is the model’s numerical ID number. The tag is applied to the most current version of the model.
For this example, the currentTag
will be applied to the tagtest_model
. All tags will then be listed to show it has been assigned to this model.
# add tag to model
currentTag.add_to_model(tagtest_model.id())
{'model_id': 1, 'tag_id': 1}
Model versions can be searched via tags using the Wallaroo Client method search_models(search_term)
, where search_term
is a string value. All models versions containing the tag will be displayed. In this example, we will be using the text from our tag to list all models that have the text from currentTag
in them.
# Search models by tag
wl.search_models('My Great Tag')
name | version | file_name | image_path | last_update_time |
---|---|---|---|---|
tagtestmodel | 70169e97-fb7e-4922-82ba-4f5d37e75253 | ccfraud.onnx | None | 2022-11-29 17:15:21.703465+00:00 |
Tags are removed from models using the Wallaroo Tag remove_from_model(model_id)
command.
In this example, the currentTag
will be removed from tagtest_model
. A list of all tags will be shown with the list_tags
command, followed by searching the models for the tag to verify it has been removed.
### remove tag from model
currentTag.remove_from_model(tagtest_model.id())
{'model_id': 1, 'tag_id': 1}