-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: make 'ModelInput' field optional for inference recommendation #3220
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
fix: make 'ModelInput' field optional for inference recommendation #3220
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
src/sagemaker/utils.py
Outdated
if data_input_configuration is not None: | ||
obj.update( | ||
{ | ||
"Framework": framework, | ||
"FrameworkVersion": framework_version, | ||
"NearestModelName": nearest_model_name, | ||
"ModelInput": { | ||
"DataInputConfig": data_input_configuration, | ||
}, | ||
} | ||
) | ||
else: | ||
obj.update( | ||
{ | ||
"Framework": framework, | ||
"FrameworkVersion": framework_version, | ||
"NearestModelName": nearest_model_name, | ||
} | ||
) |
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.
nit : Can the obj be partially updated also? Then we can refactor the code saying update the 3 fields(Framework, FrameworkVersion, NearestModelName) first and then if data_input_configuration
is not none then update ModelInput
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.
Yes, this can be refactored. Thank you for pointing this out!
@@ -3319,7 +3317,6 @@ def test_register_inference_image(sagemaker_session): | |||
framework = "TENSORFLOW" | |||
framework_version = "2.9" | |||
nearest_model_name = "resnet50" | |||
data_input_config = '{"input_1":[1,224,224,3]}' |
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.
Have atleast 1 new test where we check for data_input_config if not already present.
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.
It is already present in the existing test files.
…hub.com/rahven14/sagemaker-python-sdk into fix/update-inference-recommender-fields
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…ws#3220) * fix: make 'ModelInput' field optional for inference recommendation * fix: refactor code to conditionally update container object
Issue #, if available: N/A
Description of changes: Make 'ModelInput' field optional for inference recommendation and refactor code for better readability.
Testing done: units
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
unique_name_from_base
to create resource names in integ tests (if appropriate)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.