Instructions to use SeanScripts/pixtral-12b-nf4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SeanScripts/pixtral-12b-nf4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SeanScripts/pixtral-12b-nf4")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("SeanScripts/pixtral-12b-nf4") model = AutoModelForImageTextToText.from_pretrained("SeanScripts/pixtral-12b-nf4") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SeanScripts/pixtral-12b-nf4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SeanScripts/pixtral-12b-nf4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SeanScripts/pixtral-12b-nf4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SeanScripts/pixtral-12b-nf4
- SGLang
How to use SeanScripts/pixtral-12b-nf4 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 "SeanScripts/pixtral-12b-nf4" \ --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": "SeanScripts/pixtral-12b-nf4", "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 "SeanScripts/pixtral-12b-nf4" \ --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": "SeanScripts/pixtral-12b-nf4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SeanScripts/pixtral-12b-nf4 with Docker Model Runner:
docker model run hf.co/SeanScripts/pixtral-12b-nf4
working python packages
I got this working with the following python packages:
accelerate==0.34.2
bitsandbytes==0.44.1
certifi==2024.8.30
charset-normalizer==3.3.2
colorama==0.4.6
filelock==3.16.1
fsspec==2024.9.0
huggingface-hub==0.25.1
idna==3.10
Jinja2==3.1.3
MarkupSafe==2.1.5
mpmath==1.3.0
networkx==3.2.1
numpy==2.1.1
packaging==24.1
pillow==10.2.0
psutil==6.0.0
PyYAML==6.0.2
regex==2024.9.11
requests==2.32.3
safetensors==0.4.5
sympy==1.12
tokenizers==0.20.0
torch==2.4.1+cu121
torchvision==0.19.1+cu121
tqdm==4.66.5
transformers==4.45.1
typing_extensions==4.12.2
urllib3==2.2.3
going from 4.40 to 4.45.1 with transformers fixed my issues.
5t/s on a 4060ti 16gb.
@info-int output was not great, i perfer moondream2 for my use case, but it sucks losing the true multimodel aspect