Hectiq Lab

Tags

Tags are used to categorize content. You can attach tags to runs, models and datasets. Tags are per-project, so you can have a tag with the same name in different projects, but only one tag with the same name in the same project.

Create a tag

You can create a tag using the create method. You can only create a tag if it does not exist in the project. If the tag already exists, the method will finish without errors.

import pyhectiqlab.functional as hl
hl.create_tag(name="my-tag", project="hectiq-ai/demo")
NameTypeDefaultDescription
namestrThe name of the tag.
projectstrThe project where the tag will be created.
colorstr, optionalThe color of the tag. If the color is unset, a random color is assigned.
wait_responseboolFalseSet to true to create sync. If False, the creation is made in background.

List tags

You can list tags using the list method. This method is available from the functional and Tag object-oriented approaches, and the CLI.

import pyhectiqlab.functional as hl
hl.list_tags(project="hectiq-ai/demo")
NameTypeDefaultDescription
projectstrNoneProject name.
pageint1Page number.
limitint100Number of tags per page.
order_bystrNoneOrder by field.
order_directionstrNoneOrder direction.

Attach tags to a run

At initialization of a run, you can specify the tags that you want to attach to the run. You can also attach tags to an existing run using the add_tags method. If the tag does not exist, it will be created.

import pyhectiqlab.functional as hl
hl.add_tags_to_run(tags=["my-tag"])
NameTypeDefaultDescription
tagsList[str]-List of tags to attach.
run_idstr-Run ID.
projectstr-Project name.
wait_responseboolFalseSet to true to attach sync. If False, the attachment is made in background.

Detach tag from a run

While you can attach many tags to a run, you can only detach one tag at a time. You can detach a tag from a run using the detach_from_run method. If the tag doesn't exist or is not attached to the run, the method will finish without errors.

import pyhectiqlab.functional as hl
hl.detach_tag_from_run(run_id="9c29ckw0", tag="my-tag")
NameTypeDefaultDescription
run_idstr-Run ID.
tagstr-Tag name.
projectstr-Project name.
wait_responseboolFalseSet to true to detach sync. If False, the detachment is made in background.

On this page