Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metadata to model versions #2109

Merged
merged 17 commits into from
Dec 15, 2023

Conversation

avishniakov
Copy link
Contributor

@avishniakov avishniakov commented Dec 5, 2023

Describe changes

I implemented metadata support for Model Versions.
Usage:

# object-oriented outside of a pipeline
mv = ModelVersion(name=MODEL_NAME, version="latest")
mv.log_metadata({"foo": "bar"})
assert mv.metadata["foo"] == "bar" # True

# object-oriented inside a pipeline
@step(...)
def step_1():
    mv = get_step_context().model_version
    mv.log_metadata({"foo": "bar"})
    assert mv.metadata["foo"] == "bar" # True

# functional outside of a pipeline
log_model_version_metadata({"foo": "bar"}, model_name=MODEL_NAME, model_version="latest")
mv = ModelVersion(name=MODEL_NAME, version="latest")
assert mv.metadata["foo"] == "bar" # True

# functional inside a pipeline
@step(...)
def step_1():
    log_model_version_metadata({"foo": "bar"})
    mv = get_step_context().model_version
    assert mv.metadata["foo"] == "bar" # True

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • If my change requires a change to docs, I have updated the documentation accordingly.
  • If I have added an integration, I have updated the integrations table and the corresponding website section.
  • I have added tests to cover my changes.
  • I have based my new branch on develop and the open PR is targeting develop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

@github-actions github-actions bot added internal To filter out internal PRs and issues enhancement New feature or request labels Dec 5, 2023
Copy link
Contributor

@strickvl strickvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though wondering again whether this needs a DB migration...

Copy link
Contributor

@fa9r fa9r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to go 🙌

src/zenml/models/model_models.py Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Dec 6, 2023

E2E template updates in examples/e2e have been pushed.

Copy link
Contributor

E2E template updates in examples/e2e have been pushed.

Copy link
Contributor

E2E template updates in examples/e2e have been pushed.

@avishniakov avishniakov merged commit e5d388c into develop Dec 15, 2023
25 of 31 checks passed
@avishniakov avishniakov deleted the feature/OSS-2574-add-metadata-to-model-versions branch December 15, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internal To filter out internal PRs and issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants