class_docstr: Zero shot image classification pipeline using `CLIPModel`. This pipeline predicts the class of an image when you
  provide an image and a set of `candidate_labels`.
  
  This image classification pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"zero-shot-image-classification"`.
  
  See the list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=zero-shot-image-classification).
class_docstr_tok: ["Zero","shot","image","classification","pipeline","using","`","CLIPModel","`",".","This","pipeline","predicts","the","class","of","an","image","when","you","provide","an","image","and","a","set","of","`","candidate_labels","`",".","This","image","classification","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","zero-shot-image-classification","''","`",".","See","the","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=zero-shot-image-classification",")","."]
code: def postprocess(self, model_outputs):
      candidate_labels = [
          outputs["candidate_label"] for outputs in model_outputs
      ]
      if self.framework == "pt":
          logits = torch.cat(
              [output["logits_per_image"] for output in model_outputs]
          )
          probs = logits.softmax(dim=0)
          scores = probs.tolist()
      else:
          logits = tf.concat(
              [output["logits_per_image"] for output in model_outputs],
              axis=0,
          )
          probs = stable_softmax(logits, axis=0)
          scores = probs.numpy().tolist()
  
      result = [
          {"score": score, "label": candidate_label}
          for score, candidate_label in sorted(
              zip(scores, candidate_labels), key=lambda x: -x[0]
          )
      ]
      return result
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/zero_shot_image_classification.py
imports: from typing import List, Union
  from ..utils import add_end_docstrings, is_tf_available, is_torch_available, is_vision_available, logging, requires_backends
  from .base import PIPELINE_INIT_ARGS, ChunkPipeline
label_desc: Use image node_id 6 for calling the ZeroShotImageClassificationPipeline obj's underlying member method code with example usage: obj.postprocess(model_outputs) and returns: result