It would be amazing if 0-shot text classifiers that are designed to work with the HF zeroshot pipeline were supported by TEI and HF inference endpoints.
The output is the output from the model as if it were used as a normal classifier. The expectation would be that the
task="zero-shot-classification" flag changes how the input is processed internally in accordance with the 0-shot pipeline and output probabilities for each class in "candidate_labels".
In the endpoint playground, the model deployed with the TEI container produces the following error:
The same model with the same deployment code works, if I do not use a custom_image with a TEI container. I imagine that this is because the 0-shot pipeline is not supported by TEI? (Not sure if changes to inference endpoints would be required for this as well)
Note: One API call with one text an 8 candidate labels requires 8 forward-passes in the model (one for each label), given how the 0-shot pipeline and NLI-based 0-shot models work. Not sure to what extent this complicates things for TEI and things like continuous batching.
Feature request
It would be amazing if 0-shot text classifiers that are designed to work with the HF zeroshot pipeline were supported by TEI and HF inference endpoints.
I tried a deployment like this:
But local inference with the TEI endpoint seems to ignore the 0-shot pipeline parameters:
The output is the output from the model as if it were used as a normal classifier. The expectation would be that the
task="zero-shot-classification"
flag changes how the input is processed internally in accordance with the 0-shot pipeline and output probabilities for each class in "candidate_labels".In the endpoint playground, the model deployed with the TEI container produces the following error:
The same model with the same deployment code works, if I do not use a
custom_image
with a TEI container. I imagine that this is because the 0-shot pipeline is not supported by TEI? (Not sure if changes to inference endpoints would be required for this as well)Note: One API call with one text an 8 candidate labels requires 8 forward-passes in the model (one for each label), given how the 0-shot pipeline and NLI-based 0-shot models work. Not sure to what extent this complicates things for TEI and things like continuous batching.
Motivation
Zeroshot classifiers are downloaded millions of times via the HF Hub and are part of the default models in the HF inference endpoint catalogue. See also this internal thread on upcoming new 0-shot classifiers.
@OlivierDehaene
Your contribution
Happy to contribute to this feature