-
Notifications
You must be signed in to change notification settings - Fork 64
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
Implement predict
method and add unit tests
#425
Conversation
Signed-off-by: Yerzhaisang Taskali <tasqali1697@gmail.com>
Signed-off-by: Yerzhaisang Taskali <tasqali1697@gmail.com>
Signed-off-by: Yerzhaisang Taskali <tasqali1697@gmail.com>
predict
method and add unit testspredict
method and added unit tests
Signed-off-by: Yerzhaisang Taskali <tasqali1697@gmail.com>
predict
method and added unit testspredict
method and add unit tests
@@ -568,6 +568,29 @@ def unload_model(self, model_id: str, node_ids: List[str] = []) -> object: | |||
body=API_BODY, | |||
) | |||
|
|||
def predict(self, algorithm_name: str, model_id: str, predict_object: dict) -> dict: |
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.
We have a method generate_model_inference, which is in fact the predict functionality. We can just invoke this method here?
We could change the method name generate_model_inference
to predict, but for backward compatibility keep the method as it is.
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.
generate_model_inference
and predict
methods are not the same because:
- URLs are not the same
generate_model_inference
doesn't usealgorithm_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.
For model prediction, we don't need algorithm_name
. code ref
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.
could you please take a look at the issue description?
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 see, @dhrubo-os thank you for the feedback!
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.
So aren't we going to remove the algorithm_name
here?
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.
Good point. I think it's better to keep this as a optional parameter for the BWC as before we needed to have algorithm_name for model prediction.
@Yerzhaisang currently algorithm_name isn't optional here. Can we do something like def predict(self, model_id: str, predict_object: dict, algorithm_name: str = None) -> dict:
?
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
Signed-off-by: Yerzhaisang Taskali <tasqali1697@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
==========================================
- Coverage 91.53% 89.94% -1.59%
==========================================
Files 42 43 +1
Lines 4395 4556 +161
==========================================
+ Hits 4023 4098 +75
- Misses 372 458 +86 ☔ View full report in Codecov by Sentry. |
codecov/patch — 33.33% of diff hit (target 91.53%) @Yerzhaisang could you please take a look? |
Signed-off-by: Yerzhaisang Taskali <tasqali1697@gmail.com>
@dhrubo-os it's ready for overview |
Signed-off-by: Yerzhaisang Taskali <tasqali1697@gmail.com>
Description
predict
method inMLCommonClient
.predict
method's behavior.text_docs
,return_number
,target_response
) as expected.Issues Resolved
#287
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.