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:
Billy Cao
2024-06-19 18:11:44 +08:00
committed by GitHub
parent 1c1aec2ef1
commit cd5f7c1790
2 changed files with 8 additions and 2 deletions

View File

@@ -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)
```