Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set run description programmatically in mlflow

Similar to this question, I'd like to edit/set the description of a run via code, instead of editing it via UI.

To clarify, I don't want to set the description of my entire experiment, only of a single run.

Image showing what I want to edit

like image 436
waykiki Avatar asked Aug 30 '26 15:08

waykiki


1 Answers

There are two ways to set the description.

1. description parameter

You can set a description using a markdown string for your run in mlflow.start_run() using description parameter. Here is an example.

if __name__ == "__main__":
    # load dataset and other stuff

    run_description = """
### Header
This is a test **Bold**, *italic*, ~~strikethrough~~ text.
[And this is an example hayperlink](http://example.com/).
    """

    with mlflow.start_run(description=run_description) as run:
        # train model and other stuff

2. mlflow.note.content tag

You can set/edit run names by setting the tag with the key mlflow.note.content, which is what the UI (currently) does under the hood.

if __name__ == "__main__":
    # load dataset and other stuff

    run_description = """
### Header
This is a test **Bold**, *italic*, ~~strikethrough~~ text.
[And this is an example hayperlink](http://example.com/).
    """

    tags = {
        'mlflow.note.content': run_description
    }

    with mlflow.start_run(tags=tags) as run:
        # train model and other stuff

Result

output of the given example


If you set description parameter and mlflow.note.content tag in mlflow.start_run(), you'll get this error.

Description is already set via the tag mlflow.note.content in tags.
Remove the key mlflow.note.content from the tags or omit the description.
like image 57
Matin Zivdar Avatar answered Sep 01 '26 05:09

Matin Zivdar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!