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