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

Rename model version to a model #13

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Rename model version to a model #13

merged 2 commits into from
Jan 19, 2024

Conversation

avishniakov
Copy link
Contributor

@avishniakov avishniakov commented Jan 12, 2024

Companion for zenml-io/zenml#2267

Summary by CodeRabbit

  • New Features

    • Enhanced model artifact retrieval and management in the pipeline.
  • Refactor

    • Updated key names in configuration for consistency with model handling.
  • Documentation

    • Improved .gitignore to exclude local files from the repository.
  • Bug Fixes

    • Fixed the model promotion step to align with the new model versioning system.

Copy link

coderabbitai bot commented Jan 12, 2024

Walkthrough

The project has undergone a refactoring to update the handling of model artifacts, including changes in file paths like .gitignore, inference.py, quickstart.ipynb, run.py, and model_promoter.py. The transition from using ModelVersion to Model in various parts of the project affects how models are created, associated, loaded, and promoted within the ZenML pipelines.

Changes

File Path Change Summary
.gitignore Added .local to ignored patterns
template/pipelines/inference.py Modified method to retrieve model artifacts
template/quickstart.ipynb Replaced ModelVersion with Model
template/run.py Changed "model_version" keys to "model" in config access
template/steps/model_promoter.py Updated to use Model and changed stage setting method

🐇🎉
To the code that shifts and shapes,
A rabbit danced with glee,
For models morphed, and versions skipped,
In code, they're now set free. 🚀
🐇🎉

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 324a456 and 6d86c2b.
Files ignored due to filter (3)
  • template/configs/inference.yaml
  • template/configs/training_rf.yaml
  • template/configs/training_sgd.yaml
Files selected for processing (5)
  • .gitignore (1 hunks)
  • template/pipelines/inference.py (1 hunks)
  • template/quickstart.ipynb (8 hunks)
  • template/run.py (1 hunks)
  • template/steps/model_promoter.py (1 hunks)
Additional comments: 8
template/pipelines/inference.py (1)
  • 28-31: The updates to use get_pipeline_context().model.get_artifact align with the PR objectives and reflect the shift from "model version" to "model" in the ZenML framework. Ensure that all references to the old method have been updated accordingly.
.gitignore (1)
  • 136-136: The addition of .local to the .gitignore file is a standard practice to prevent local configuration files from being tracked in version control.
template/steps/model_promoter.py (1)
  • 39-60: The updates to use get_step_context().model and current_model.set_stage(stage, force=True) align with the PR objectives and reflect the shift from "model version" to "model" in the ZenML framework. Ensure that all references to the old method have been updated accordingly.
template/run.py (1)
  • 204-204: The updates to the config dictionary keys from "model_version" to "model" are consistent with the PR objectives and reflect the shift from "model version" to "model" in the ZenML framework. Ensure that all references to the old keys have been updated accordingly.
template/quickstart.ipynb (4)
  • 145-145: The replacement of ModelVersion with Model in the notebook aligns with the PR objectives and reflects the shift from "model version" to "model" in the ZenML framework. Ensure that all references to the old class have been updated accordingly.

  • 732-732: The use of the Model object to create a ZenML Model and associate it with pipelines is consistent with the new approach in the ZenML framework.

  • 943-946: The update to load the model using get_step_context().model and model.load_artifact("sklearn_classifier") in the inference_predict step is consistent with the new model handling approach in ZenML.

  • 997-997: The configuration to always load the production model by passing in the production stage into the Model config is a good practice to ensure consistency in model usage across pipelines.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 6d86c2b and 5b0d7c9.
Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
Additional comments: 1
.github/workflows/ci.yml (1)
  • 58-58: The update to the default value for ref-zenml aligns with the PR's objectives to reflect the new branch naming conventions. Ensure that the branch 'feature/OSSK-342-rename-model-version-to-a-model' exists and is the correct reference for this workflow.

@avishniakov avishniakov merged commit 6dbf10f into main Jan 19, 2024
13 checks passed
@avishniakov avishniakov deleted the 2024.01.12 branch January 19, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants