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 option to skip postprocess in huggingface server #3570

Open
kevinmingtarja opened this issue Apr 3, 2024 · 1 comment · May be fixed by #3607
Open

Add option to skip postprocess in huggingface server #3570

kevinmingtarja opened this issue Apr 3, 2024 · 1 comment · May be fixed by #3607

Comments

@kevinmingtarja
Copy link
Contributor

kevinmingtarja commented Apr 3, 2024

/kind feature

Describe the solution you'd like

Add option to skip the default postprocess method of huggingface server, as users may want to postprocess the raw prediction results their own way, which may not be possible right now.

For example, let's take the sequence_classification task:

if self.task == MLTask.sequence_classification.value:
num_rows, num_cols = outputs.shape
for i in range(num_rows):
out = outputs[i].unsqueeze(0)
predicted_idx = out.argmax().item()
inferences.append(predicted_idx)
return get_predict_response(request, inferences, self.name)

Currently, the postprocess makes it output only the predicted idx (i.e. 0, or 1). So let's say if a user wants to get the probabilities of each idx (i.e. {0: 0.61, 1: 0.39}), it is not possible even if they implement their own postprocess, because the default postprocess will run first.

Anything else you would like to add:

Links to the design documents:
[Optional, start with the short-form RFC template to outline your ideas and get early feedback.]
[Required, use the longer-form design doc template to specify and discuss your design in more detail]

@andyi2it
Copy link
Contributor

/assign @andyi2it

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

Successfully merging a pull request may close this issue.

3 participants