Having multiple candidate labels in a zero shot classification model

Please be informed, i’m using mDeBERTa-v3-base-mnli-xnli zero shot classification for classifying the label for my input. Its working great, except for not allowing more than 10 candidate labels. I have more than 100 labels. Is it possible that this model could allow it or if not, is there any AI model that can allow this much number of labels. I’m also prepared for going for an inference endpoint if needed.

Shall appreciate should you guys provide us with clarity on this issue. Thanks.

Answered that question here: facebook/bart-large-mnli · Number of classes

Thanks for replying, i’m not using transformers locally, but using through serverless inference api. Can we do the same with inference api.

If you’re using the Inference API, you would need to send each (text, candidate label) pair to the API. So this won’t be very efficient, since the serverless inference API does not support batched requests.

For production use cases, we recommend Inference Endpoints - Hugging Face. You could write a custom handler which takes in a batch of texts + candidate pairs and sends a response (based on the code snippet linked in my reply above).