Instructions to use Prarabdha/pixtral-12b-240910-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Prarabdha/pixtral-12b-240910-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Prarabdha/pixtral-12b-240910-hf")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("Prarabdha/pixtral-12b-240910-hf") model = AutoModelForImageTextToText.from_pretrained("Prarabdha/pixtral-12b-240910-hf") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Prarabdha/pixtral-12b-240910-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Prarabdha/pixtral-12b-240910-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Prarabdha/pixtral-12b-240910-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Prarabdha/pixtral-12b-240910-hf
- SGLang
How to use Prarabdha/pixtral-12b-240910-hf 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 "Prarabdha/pixtral-12b-240910-hf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Prarabdha/pixtral-12b-240910-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Prarabdha/pixtral-12b-240910-hf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Prarabdha/pixtral-12b-240910-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Prarabdha/pixtral-12b-240910-hf with Docker Model Runner:
docker model run hf.co/Prarabdha/pixtral-12b-240910-hf
Pixtral-12B-2409 - HuggingFace Transformers Compatible Weights
Model Overview
This repository contains the HuggingFace Transformers compatible weights for the Pixtral-12B-2409 multimodal model. The weights have been converted to ensure seamless integration with the Hugging Face Transformers library, allowing easy loading and usage in your projects.
Model Details
- Original Model: Pixtral-12B-2409 by Mistral AI
- Model Type: Multimodal Language Model
- Parameters: 12B parameters + 400M parameter vision encoder
- Sequence Length: 128k tokens
- License: Apache 2.0
Key Features
- Natively multimodal, trained with interleaved image and text data
- Supports variable image sizes
- Leading performance in its weight class on multimodal tasks
- Maintains state-of-the-art performance on text-only benchmarks
Conversion Details
This repository provides the original Pixtral model weights converted to be fully compatible with the HuggingFace Transformers library. The conversion process ensures:
- Seamless loading using
from_pretrained() - Full compatibility with HuggingFace Transformers pipeline
- No modifications to the original model weights or architecture
Installation
You can install the model using the Transformers library:
from transformers import AutoProcessor, AutoModelForImageTextToText
import torch
processor = AutoProcessor.from_pretrained("Prarabdha/pixtral-12b-240910-hf")
model = AutoModelForImageTextToText.from_pretrained("Prarabdha/pixtral-12b-240910-hf", torch_dtype=torch.float16, device_map="auto")
Example Usage
from PIL import Image
import requests
# Load an image
url = "https://example.com/sample-image.jpg"
image = Image.open(requests.get(url, stream=True).raw)
# Prepare conversation
conversation = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "What is shown in this image?"},
],
}
]
# Process and generate
prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
inputs = processor(images=[image], text=prompt, return_tensors="pt")
generate_ids = model.generate(**inputs, max_new_tokens=30)
response = processor.batch_decode(generate_ids, skip_special_tokens=True)
Performance Benchmarks
Multimodal Benchmarks
| Benchmark | Pixtral 12B | Qwen2 7B VL | LLaVA-OV 7B | Phi-3 Vision |
|---|---|---|---|---|
| MMMU (CoT) | 52.5 | 47.6 | 45.1 | 40.3 |
| Mathvista (CoT) | 58.0 | 54.4 | 36.1 | 36.4 |
| ChartQA (CoT) | 81.8 | 38.6 | 67.1 | 72.0 |
(Full benchmark details available in the original model card)
Acknowledgements
A huge thank you to the Mistral team for creating and releasing the original Pixtral model.
Citation
If you use this model, please cite the original Mistral AI research.
License
This model is distributed under the Apache 2.0 License.
Original Model Card
For more comprehensive details, please refer to the original Mistral model card.
- Downloads last month
- 8
Model tree for Prarabdha/pixtral-12b-240910-hf
Base model
mistralai/Pixtral-12B-Base-2409