-
Notifications
You must be signed in to change notification settings - Fork 30
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
Pass model kwargs through to operator from_config methods #158
Pass model kwargs through to operator from_config methods #158
Conversation
@@ -18,7 +18,17 @@ | |||
|
|||
|
|||
class OperatorRunner: | |||
def __init__(self, config, repository="./", version=1, kind=""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed kind
since it doesn't appear to be used currently. Can be added back if required in future
def __init__( | ||
self, | ||
config, | ||
*, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this forces the following parameters to be passed as keyword arguments.
Documentation preview |
Click to view CI ResultsGitHub pull request #158 of commit 7d147b1708125d6f1f5586fb3a03ecd6f92a6172, no merge conflicts. Running as SYSTEM Setting status of 7d147b1708125d6f1f5586fb3a03ecd6f92a6172 to PENDING with url https://10.20.13.93:8080/job/merlin_systems/187/console and message: 'Pending' Using context: Jenkins Building on master in workspace /var/jenkins_home/workspace/merlin_systems using credential fce1c729-5d7c-48e8-90cb-b0c314b1076e > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/NVIDIA-Merlin/systems # timeout=10 Fetching upstream changes from https://github.com/NVIDIA-Merlin/systems > git --version # timeout=10 using GIT_ASKPASS to set credentials login for merlin-systems user + githubtoken > git fetch --tags --force --progress -- https://github.com/NVIDIA-Merlin/systems +refs/pull/158/*:refs/remotes/origin/pr/158/* # timeout=10 > git rev-parse 7d147b1708125d6f1f5586fb3a03ecd6f92a6172^{commit} # timeout=10 Checking out Revision 7d147b1708125d6f1f5586fb3a03ecd6f92a6172 (detached) > git config core.sparsecheckout # timeout=10 > git checkout -f 7d147b1708125d6f1f5586fb3a03ecd6f92a6172 # timeout=10 Commit message: "Update tests for OperatorRunner to pass named keyword arguments" > git rev-list --no-walk f412ba518aa276b1ab0aabdc781bd501562d143f # timeout=10 [merlin_systems] $ /bin/bash /tmp/jenkins789547165856919159.sh PYTHONPATH=:/usr/local/lib/python3.8/dist-packages/:/usr/local/hugectr/lib:/var/jenkins_home/workspace/merlin_systems/systems ============================= test session starts ============================== platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0 rootdir: /var/jenkins_home/workspace/merlin_systems/systems, configfile: pyproject.toml plugins: anyio-3.6.1, xdist-2.5.0, forked-1.4.0, cov-3.0.0 collected 53 items |
Passing model kwargs (model_repository, model_name, model_version) through to operator
from_config
methods when used in anOperatorRunner
.Motivation
This enables operators to use the location of the model repository to load artifacts that may be required for the operator to run. For example, a serialized model saved alongside the model conifg (or in the model version directory).
Intended to be used by the Implict operator in #134 . We could also update the QueryFaiss operator to load the index from a relative path too instead of relying on a path in the model config. This would make the model repository self-contained.