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 a "quiet" flag to the HTTP API #1984

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

Conversation

danielkeyes-sony
Copy link

For some context, I was working on a use-case where the size of the inputs to my predictor were very large, but the size of the outputs are relatively small. I noticed that since both PredictionResponse and PredictionRequest are subclasses of PredictionBaseModel (which defines input), this meant that the inputs were transmitted in both the response and the request, which used up a lot of network bandwidth.

This PR adds an optional "quiet" flag to the http API, which just makes it so the PredictionResponse does not repeat the input.

Let me know if this looks good, or if you would like me to change anything.

When "quiet" is enabled, prediction responses do not include the original
input. This change also keeps the typehints consistent by making `input`
optional in `PredictionResponse` (but still required in `PredictionRequest`).

Signed-off-by: Daniel Keyes <[email protected]>
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.

1 participant