Skip to content
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

add predict functionality #318

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

plzdoo
Copy link

@plzdoo plzdoo commented Oct 16, 2023

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

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.

@dhrubo-os
Copy link
Collaborator

DCO is missing. Could you please take a look at this?

@@ -494,6 +494,34 @@ def generate_embedding(self, model_id: str, sentences: List[str]) -> object:
body=API_BODY,
)

def predict(self, model_id: str, algo_name: str, input_json):

API_URL = f"{ML_BASE_URI}/_predict/{algo_name}/{model_id}/_deploy"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think, this is the correct endpoint for the predict functionality.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing out. Already changed this

Signed-off-by: yimingl9 <yimingl9@illinois.edu>
Modify request

Signed-off-by: yimingl9 <yimingl9@illinois.edu>
@rawwar
Copy link
Contributor

rawwar commented Nov 4, 2023

@plzdoo , can you take latest changes from main? You can reuse iris_index fixture that was recently added. just include iris_index argument in your test_predict and it would ensure the index is present. Name of the index will be the variable iris_index

@dhrubo-os
Copy link
Collaborator

@plzdoo linting is failing. Can you check this? Please let me know if you are facing any blocker?

@rawwar
Copy link
Contributor

rawwar commented Nov 15, 2023

@plzdoo , can you pull latest changes from dev?

@plzdoo
Copy link
Author

plzdoo commented Nov 15, 2023

@plzdoo , can you pull latest changes from dev?
Done

@@ -237,6 +237,64 @@ def test_DEPRECATED_integration_pretrained_model_upload_unload_delete():
raised = True
assert raised == False, "Raised Exception in deleting pretrained model"

def test_predict():
input_json = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you consider taking iris_index as an argument here. Since, that is a fixture, you would have the iris data in the opensearch in an index. iris_index variable will have the actual name of the index here.. So, input_index can be iris_index

@dhrubo-os
Copy link
Collaborator

@plzdoo are you working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants