2

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

1 Answer 1

8

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.
2
  • 1
    Great, thanks for the answer. Before I mark the question as done, is it possible to edit the description of an already active run?
    – waykiki
    Aug 12, 2022 at 8:33
  • 1
    Yes, you can edit the description of a run using the mlflow.note.content tag. @waykiki Aug 12, 2022 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.