Update documentation for Cohere2Vision models (#39817)

* Update docs with pipeline example

* Add Cohere2Vision to list of vision models

* Sort models
This commit is contained in:
Kyle Duffy
2025-07-31 13:58:45 +02:00
committed by GitHub
parent e1688d28d3
commit 6ba8a1ff45
2 changed files with 33 additions and 1 deletions

View File

@@ -19,9 +19,12 @@ Command A Vision is built upon a robust architecture that leverages the latest a
The model and image processor can be loaded as follows:
```python
<hfoptions id="usage">
<hfoption id="AutoModel">
```python
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
model_id = "CohereLabs/command-a-vision-07-2025"
@@ -68,6 +71,34 @@ print(
)
```
</hfoption>
<hfoption id="Pipeline">
```python
from transformers import pipeline
pipe = pipeline(model="CohereLabs/command-a-vision-07-2025", task="image-text-to-text", device_map="auto")
messages = [
{
"role": "user",
"content": [
{
"type": "image",
"url": "https://media.istockphoto.com/id/458012057/photo/istanbul-turkey.jpg?s=612x612&w=0&k=20&c=qogAOVvkpfUyqLUMr_XJQyq-HkACXyYUSZbKhBlPrxo=",
},
{"type": "text", "text": "Where was this taken ?"},
],
},
]
outputs = pipe(text=messages, max_new_tokens=300, return_full_text=False)
print(outputs)
```
</hfoption>
</hfoptions>
## Cohere2VisionConfig
[[autodoc]] Cohere2VisionConfig

View File

@@ -712,6 +712,7 @@ MODEL_FOR_IMAGE_MAPPING_NAMES = OrderedDict(
("aimv2_vision_model", "Aimv2VisionModel"),
("beit", "BeitModel"),
("bit", "BitModel"),
("cohere2_vision", "Cohere2VisionModel"),
("conditional_detr", "ConditionalDetrModel"),
("convnext", "ConvNextModel"),
("convnextv2", "ConvNextV2Model"),