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

Ability to transform model outputs in DJL Serving #1214

Closed
rachitchauhan43 opened this issue Oct 23, 2023 · 4 comments
Closed

Ability to transform model outputs in DJL Serving #1214

rachitchauhan43 opened this issue Oct 23, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@rachitchauhan43
Copy link

rachitchauhan43 commented Oct 23, 2023

Description

We are using SageMaker for large model inference (LMI) as documented here

With this notebook https://github.com/deepjavalibrary/djl-demo/blob/master/aws/sagemaker/large-model-inference/sample-llm/rollingbatch_llama_7b_customized_preprocessing.ipynb, we saw there is a way to manipulate the input before it goes to then model because parse_input method is available as a hook but we also have a need to manipulate the output before it leaves model server.

@lanking520 and @frankfliu Any thoughts on supporting that ?

Will this change the current api? How?
No. It's just an extension we are asking for.

Benefit of this will be: Users won;t have to write another service layer in front of model server just to manipulate/transform outputs.

Who will benefit from this enhancement?

References

@rachitchauhan43 rachitchauhan43 added the enhancement New feature or request label Oct 23, 2023
@rachitchauhan43 rachitchauhan43 changed the title Ability to manipulate model outputs in DJL Serving Ability to transform model outputs in DJL Serving Oct 23, 2023
@rachitchauhan43
Copy link
Author

cc: @chirag-orbittec

@frankfliu
Copy link
Contributor

@rachitchauhan43

We do have plan to allow customize output. We have a few built-in output_formatter for rolling batch. We are considering allows user to point the output_formatter to a user provided module.

Are you considering to contribute to this feature?

@chirag-orbittec
Copy link

@frankfliu I can contribute that feature. We need this

@sindhuvahinis
Copy link
Contributor

@rachitchauhan43 @chirag-orbittec We do provide a way to write your own custom input formatter https://docs.djl.ai/master/docs/serving/serving/docs/lmi/user_guides/input_formatter_schema.html and also custom output formatter https://docs.djl.ai/master/docs/serving/serving/docs/lmi/user_guides/output_formatter_schema.html Please give it a try.

Closing this issue, as it was created a while ago. Feel free to open a new one, if you have any more questions.

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

No branches or pull requests

4 participants