-
Notifications
You must be signed in to change notification settings - Fork 244
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
Dependency injection for model deployments #1787
Conversation
|
||
|
||
def create_object(spec: ObjectSpec, additional_args: Optional[Dict[str, Any]] = None): | ||
"""Create the actual object given the `spec`.""" |
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.
Elaborate on documentation of additional_args
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.
Hmm...I think it might be cleaner / more modular to have a function that takes a spec and updates the spec with additional_args, so that the create_object
function can stay the same.
args = {} | ||
args.update(spec.args) | ||
missing_args = [] | ||
for parameter_name in init_signature.parameters.keys(): |
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.
I guess I'm confused what injectors are supposed to do...
Closing because this is addressed by #1861. |
This allows using
ModelDeploymentRegistry
with clients that do not have aapi_key
parameter.Example:
helm-run --run-specs boolq:model=simple/my-simple-model --suite debug -m 5 --model-deployment-paths model_deployments_simple.yaml --model-metadata models.yaml
models.yaml
:model_deployments_simple.yaml
: