Instructions to use CohereLabs/command-a-plus-05-2026-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CohereLabs/command-a-plus-05-2026-bf16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="CohereLabs/command-a-plus-05-2026-bf16") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("CohereLabs/command-a-plus-05-2026-bf16") model = AutoModelForMultimodalLM.from_pretrained("CohereLabs/command-a-plus-05-2026-bf16", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CohereLabs/command-a-plus-05-2026-bf16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CohereLabs/command-a-plus-05-2026-bf16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CohereLabs/command-a-plus-05-2026-bf16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/CohereLabs/command-a-plus-05-2026-bf16
- SGLang
How to use CohereLabs/command-a-plus-05-2026-bf16 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "CohereLabs/command-a-plus-05-2026-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CohereLabs/command-a-plus-05-2026-bf16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "CohereLabs/command-a-plus-05-2026-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CohereLabs/command-a-plus-05-2026-bf16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use CohereLabs/command-a-plus-05-2026-bf16 with Docker Model Runner:
docker model run hf.co/CohereLabs/command-a-plus-05-2026-bf16
Update preprocessor_config.json
Browse files- preprocessor_config.json +17 -13
preprocessor_config.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
| 1 |
{
|
| 2 |
-
|
| 3 |
"crop_to_patches": true,
|
| 4 |
"data_format": "channels_first",
|
| 5 |
"default_to_square": true,
|
|
|
|
|
|
|
|
|
|
| 6 |
"do_convert_rgb": true,
|
| 7 |
"do_normalize": true,
|
| 8 |
"do_rescale": true,
|
|
@@ -10,29 +13,30 @@
|
|
| 10 |
"downsample_factor": 2,
|
| 11 |
"end_of_img_token": "<|END_OF_IMG|>",
|
| 12 |
"image_mean": [
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
],
|
| 17 |
-
"image_processor_type": "
|
| 18 |
"image_std": [
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
],
|
| 23 |
"img_line_break_token": "<|IMG_LINE_BREAK|>",
|
| 24 |
"img_patch_token": "<|IMG_PATCH|>",
|
| 25 |
"img_size": 512,
|
|
|
|
| 26 |
"max_patches": 12,
|
| 27 |
"min_patches": 1,
|
| 28 |
"patch_size": 16,
|
|
|
|
| 29 |
"resample": 3,
|
| 30 |
"rescale_factor": 0.00392156862745098,
|
|
|
|
| 31 |
"size": {
|
| 32 |
-
|
| 33 |
-
|
| 34 |
},
|
| 35 |
"start_of_img_token": "<|START_OF_IMG|>"
|
| 36 |
-
|
| 37 |
-
"processor_class": "Cohere2VisionProcessor"
|
| 38 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"crop_size": null,
|
| 3 |
"crop_to_patches": true,
|
| 4 |
"data_format": "channels_first",
|
| 5 |
"default_to_square": true,
|
| 6 |
+
"device": null,
|
| 7 |
+
"disable_grouping": null,
|
| 8 |
+
"do_center_crop": null,
|
| 9 |
"do_convert_rgb": true,
|
| 10 |
"do_normalize": true,
|
| 11 |
"do_rescale": true,
|
|
|
|
| 13 |
"downsample_factor": 2,
|
| 14 |
"end_of_img_token": "<|END_OF_IMG|>",
|
| 15 |
"image_mean": [
|
| 16 |
+
0.5,
|
| 17 |
+
0.5,
|
| 18 |
+
0.5
|
| 19 |
],
|
| 20 |
+
"image_processor_type": "Cohere2VisionImageProcessorFast",
|
| 21 |
"image_std": [
|
| 22 |
+
0.5,
|
| 23 |
+
0.5,
|
| 24 |
+
0.5
|
| 25 |
],
|
| 26 |
"img_line_break_token": "<|IMG_LINE_BREAK|>",
|
| 27 |
"img_patch_token": "<|IMG_PATCH|>",
|
| 28 |
"img_size": 512,
|
| 29 |
+
"input_data_format": null,
|
| 30 |
"max_patches": 12,
|
| 31 |
"min_patches": 1,
|
| 32 |
"patch_size": 16,
|
| 33 |
+
"processor_class": "Cohere2VisionProcessor",
|
| 34 |
"resample": 3,
|
| 35 |
"rescale_factor": 0.00392156862745098,
|
| 36 |
+
"return_tensors": null,
|
| 37 |
"size": {
|
| 38 |
+
"height": 512,
|
| 39 |
+
"width": 512
|
| 40 |
},
|
| 41 |
"start_of_img_token": "<|START_OF_IMG|>"
|
| 42 |
+
}
|
|
|
|
|
|