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

Forward rest parameters to model #1921

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

idlefella
Copy link
Contributor

@idlefella idlefella commented Oct 8, 2024

Pull Request

Fixes #1660

Description

The parameters sent over REST to the mlserver are not forwarded to the predict function of the model. This PR fixes that issue.

Changes Made

Properly forward the params to the predict function of the model.

Related Issues

Screenshots (if applicable)

Checklist

  • Code follows the project's style guidelines
  • All tests related to the changes pass successfully
  • Documentation is updated (if necessary)
  • Code is reviewed by at least one other team member
  • Any breaking changes are communicated and documented

Additional Notes

@idlefella idlefella changed the title Forwards rest parameters to model Forward rest parameters to model Oct 8, 2024
Comment on lines +199 to +202
params = None
if payload.parameters and payload.parameters.model_extra:
params = payload.parameters.model_extra
model_output = self._model.predict(decoded_payload, params=params)
Copy link
Member

@sakoush sakoush Oct 16, 2024

Choose a reason for hiding this comment

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

is there a test that can be added for this new functionality @idlefella ?

Copy link
Member

Choose a reason for hiding this comment

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

@idlefella I think params is only supported for class-based pyfunc models and therefore this proposed changed will not work for function-based models.
I think we need to find a way to check the type of the model loaded and not pass params for function-based models.
check here

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.

Inference parameters are not passed to the predict function in MLFlow runtime
2 participants