src/transformers/pipelines/zero_shot_image_classification.py/ZeroShotImageClassificationPipeline/preprocess
class ZeroShotImageClassificationPipeline:    def preprocess(self, image, candidate_labels=None, hypothesis_template="This is a photo of {}."):
        image = load_image(image)
        inputs = self.image_processor(images=[image], return_tensors=self.framework)
        inputs["candidate_labels"] = candidate_labels
        sequences = [hypothesis_template.format(x) for x in candidate_labels]
        text_inputs = self.tokenizer(sequences, return_tensors=self.framework, padding=True)
        inputs["text_inputs"] = [text_inputs]
        return inputs