Add docs on zeroshot image classification prompt templates (#31343)
* Add docs on pipeline templates * Fix example and comments Update usage tips * Update docs/source/en/tasks/zero_shot_image_classification.md Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com> * Update docs/source/en/model_doc/siglip.md Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com> * Trigger CI --------- Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
This commit is contained in:
@@ -119,6 +119,8 @@ image for the model by resizing and normalizing it, and a tokenizer that takes c
|
||||
|
||||
```py
|
||||
>>> candidate_labels = ["tree", "car", "bike", "cat"]
|
||||
# follows the pipeline prompt template to get same results
|
||||
>>> candidate_labels = [f'This is a photo of {label}.' for label in candidate_labels]
|
||||
>>> inputs = processor(images=image, text=candidate_labels, return_tensors="pt", padding=True)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user