-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Merge ModelLoader and InferenceRunner into same class. #21795
Conversation
R: @yeandy , @ryanthompson591 or @TheNeuralBit |
class InferenceRunner(Generic[ExampleT, PredictionT, ModelT]): | ||
"""Implements running inferences for a framework.""" | ||
class ModelHandler(Generic[ExampleT, PredictionT, ModelT]): | ||
"""Has the ability to load an ML model.""" |
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.
Maybe update this docstring?
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.
Similarly for the implementations, consider if the the docstrings need to be merged.
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.
Yep. Done.
class InferenceRunner(Generic[ExampleT, PredictionT, ModelT]): | ||
"""Implements running inferences for a framework.""" | ||
class ModelHandler(Generic[ExampleT, PredictionT, ModelT]): | ||
"""Has the ability to load an ML model.""" |
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.
Has the abiltity to load ML models and run inferences on that model.
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.
Done.
@@ -26,8 +26,7 @@ | |||
|
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.
Might have to merge this file since I just merged a change. Should be straight forward.
@@ -71,7 +70,7 @@ def tearDown(self): | |||
|
|||
def test_predict_output(self): | |||
fake_model = FakeModel() | |||
inference_runner = SklearnInferenceRunner() | |||
inference_runner = SklearnModelHandler('unused') |
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.
SklearnModelHandler(uri='unused')?
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.
Done.
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 can't add a Github comment since these lines weren't changed, but can we change the name test_inference_runner_X
to something like test_model_handler_X
in the pytorch_inference.py
file? Lines 142, 169, 182, 218
Co-authored-by: Andy Ye <andyye333@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #21795 +/- ##
==========================================
+ Coverage 74.01% 74.05% +0.03%
==========================================
Files 698 698
Lines 92224 92330 +106
==========================================
+ Hits 68263 68377 +114
+ Misses 22710 22702 -8
Partials 1251 1251
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Run PythonLint PreCommit |
Seems Unit tests are brocken:
|
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.