Sagemaker Huggingface zero shot classification with candidate_labels in predict method

@dineshmane you deploy your model on sagemaker with the task text-classification and in the pipeline you use zero-shot-classification. If you change your sagemaker task it should work.

Also you payload was a bit off. An example of a zero-shot-classifcation payload can be found in the documentation and I also added a json below. Reference

{
  "inputs": "Hi, I recently bought a device from your company but it is not working as advertised and I would like to get reimbursed!",
  "parameters": {
    "candidate_labels": ["refund", "legal", "faq"]
  }
}
1 Like