Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Codecov Report
@@ Coverage Diff @@
## dev #2956 +/- ##
==========================================
- Coverage 89.82% 89.80% -0.02%
==========================================
Files 196 196
Lines 16548 16563 +15
==========================================
+ Hits 14864 14875 +11
- Misses 1684 1688 +4
Continue to review full report at Codecov.
|
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 |
| if isinstance(data, str): | ||
| if not os.path.exists(data): | ||
| raise ValueError(f"{data} is not a valid file path.") | ||
| image = open(data, "rb") |
There was a problem hiding this comment.
Addressed in current revision.
navinsoni
left a comment
There was a problem hiding this comment.
Please close file before returning from function
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 |
| try: | ||
| dataFile = open(data, "rb") | ||
| except Exception: | ||
| raise ValueError(f"{data} is not a valid file-path.") |
There was a problem hiding this comment.
Lets generalise the exception and not conclude not a valid file-path for better debugging.
try:
dataFile = open(data, "rb")
dataFileInfo = dataFile.read()
dataFile.close()
except Exception as e:
raise ValueError(f"Could not open/read file: {data}. {e.message}")
There was a problem hiding this comment.
updated in the current revision.
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 |
| dataFile.close() | ||
| except Exception as e: | ||
| raise ValueError(f"Could not open/read file: {data}. {e}") | ||
| return dataFileInfo |
There was a problem hiding this comment.
can you please move this in try block
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 |
| dataFile = open(data, "rb") | ||
| dataFileInfo = dataFile.read() | ||
| dataFile.close() |
There was a problem hiding this comment.
Wouldn't it have made more sense to use the context manager for reading the file, to be safer about error handling when .read() fails?
Also shouldn't be the naming schema for variables be snake_case rather than camelCase? Similar to all other Serializer
There was a problem hiding this comment.
As this PR is already merged, added a new PR with the suggested changes here: #2962
* change: update code to get commit_id in codepipeline (#2961) * feature: Data Serializer (#2956) * change: reorganize test files for workflow (#2960) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> * feature: TensorFlow 2.4 for Neo (#2861) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> * fix: Remove sagemaker_job_name from hyperparameters in TrainingStep (#2950) Co-authored-by: Payton Staub <pstaub@amazon.com> * fix: Style update in DataSerializer (#2962) * documentation: smddp doc update (#2968) * fix: container env generation for S3 URI and add test for the same (#2971) * documentation: update sagemaker training compiler docstring (#2969) * feat: Python 3.9 for readthedocs (#2973) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> Co-authored-by: Payton Staub <pstaub@amazon.com> Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com> Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com> Co-authored-by: Payton Staub <staubhpa@gmail.com> * fix doc structure * archive 1.6.0 doc * add new args, refs, and links * fix version number * incorp eng feedback, update docstrings, improve xref * Trigger Build * minor fix, trigger build again * fix typo Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com> Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com> Co-authored-by: Payton Staub <staubhpa@gmail.com> Co-authored-by: Payton Staub <pstaub@amazon.com> Co-authored-by: Shreya Pandit <shreya.pandit25@gmail.com> Co-authored-by: Ahsan Khan <ahsan.al.zaki@gmail.com> Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
* change: update code to get commit_id in codepipeline (aws#2961) * feature: Data Serializer (aws#2956) * change: reorganize test files for workflow (aws#2960) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> * feature: TensorFlow 2.4 for Neo (aws#2861) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> * fix: Remove sagemaker_job_name from hyperparameters in TrainingStep (aws#2950) Co-authored-by: Payton Staub <pstaub@amazon.com> * fix: Style update in DataSerializer (aws#2962) * documentation: smddp doc update (aws#2968) * fix: container env generation for S3 URI and add test for the same (aws#2971) * documentation: update sagemaker training compiler docstring (aws#2969) * feat: Python 3.9 for readthedocs (aws#2973) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> Co-authored-by: Payton Staub <pstaub@amazon.com> Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com> Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com> Co-authored-by: Payton Staub <staubhpa@gmail.com> * fix doc structure * archive 1.6.0 doc * add new args, refs, and links * fix version number * incorp eng feedback, update docstrings, improve xref * Trigger Build * minor fix, trigger build again * fix typo Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com> Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com> Co-authored-by: Payton Staub <staubhpa@gmail.com> Co-authored-by: Payton Staub <pstaub@amazon.com> Co-authored-by: Shreya Pandit <shreya.pandit25@gmail.com> Co-authored-by: Ahsan Khan <ahsan.al.zaki@gmail.com> Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
* change: update code to get commit_id in codepipeline (aws#2961) * feature: Data Serializer (aws#2956) * change: reorganize test files for workflow (aws#2960) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> * feature: TensorFlow 2.4 for Neo (aws#2861) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> * fix: Remove sagemaker_job_name from hyperparameters in TrainingStep (aws#2950) Co-authored-by: Payton Staub <pstaub@amazon.com> * fix: Style update in DataSerializer (aws#2962) * documentation: smddp doc update (aws#2968) * fix: container env generation for S3 URI and add test for the same (aws#2971) * documentation: update sagemaker training compiler docstring (aws#2969) * feat: Python 3.9 for readthedocs (aws#2973) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> Co-authored-by: Payton Staub <pstaub@amazon.com> Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com> Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com> Co-authored-by: Payton Staub <staubhpa@gmail.com> * fix doc structure * archive 1.6.0 doc * add new args, refs, and links * fix version number * incorp eng feedback, update docstrings, improve xref * Trigger Build * minor fix, trigger build again * fix typo Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com> Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com> Co-authored-by: Payton Staub <staubhpa@gmail.com> Co-authored-by: Payton Staub <pstaub@amazon.com> Co-authored-by: Shreya Pandit <shreya.pandit25@gmail.com> Co-authored-by: Ahsan Khan <ahsan.al.zaki@gmail.com> Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
* change: update code to get commit_id in codepipeline (aws#2961) * feature: Data Serializer (aws#2956) * change: reorganize test files for workflow (aws#2960) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> * feature: TensorFlow 2.4 for Neo (aws#2861) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> * fix: Remove sagemaker_job_name from hyperparameters in TrainingStep (aws#2950) Co-authored-by: Payton Staub <pstaub@amazon.com> * fix: Style update in DataSerializer (aws#2962) * documentation: smddp doc update (aws#2968) * fix: container env generation for S3 URI and add test for the same (aws#2971) * documentation: update sagemaker training compiler docstring (aws#2969) * feat: Python 3.9 for readthedocs (aws#2973) Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> Co-authored-by: Payton Staub <pstaub@amazon.com> Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com> Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com> Co-authored-by: Payton Staub <staubhpa@gmail.com> * fix doc structure * archive 1.6.0 doc * add new args, refs, and links * fix version number * incorp eng feedback, update docstrings, improve xref * Trigger Build * minor fix, trigger build again * fix typo Co-authored-by: Navin Soni <navinsoni89@gmail.com> Co-authored-by: Jeniya Tabassum <jeniya.tabassum@gmail.com> Co-authored-by: qidewenwhen <32910701+qidewenwhen@users.noreply.github.com> Co-authored-by: Ben Crabtree <bencrab@amazon.com> Co-authored-by: Dewen Qi <qidewen@amazon.com> Co-authored-by: Qingzi-Lan <83724147+Qingzi-Lan@users.noreply.github.com> Co-authored-by: Payton Staub <staubhpa@gmail.com> Co-authored-by: Payton Staub <pstaub@amazon.com> Co-authored-by: Shreya Pandit <shreya.pandit25@gmail.com> Co-authored-by: Ahsan Khan <ahsan.al.zaki@gmail.com> Co-authored-by: Mufaddal Rohawala <89424143+mufaddal-rohawala@users.noreply.github.com>
Issue #, if available:
Includes a serializer for multimodal support
Description of changes:
Introduced DataSerializer class that utilizes current SimpleBaseSerializer class to read and serialize data in different formats, i.e, audio/image
Testing done:
Merge Checklist
Put an
xin 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_baseto 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.