Image-Text-to-Text
Transformers
Safetensors
mistral3
mistral
devstral
gptq
quantized
4-bit precision
8-bit precision
mixed-precision
vllm
rocm
code
conversational
compressed-tensors
Instructions to use btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ") model = AutoModelForImageTextToText.from_pretrained("btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ", "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/btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ
- SGLang
How to use btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ 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 "btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ" \ --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": "btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ", "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 "btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ" \ --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": "btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ", "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 btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ with Docker Model Runner:
docker model run hf.co/btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ
Update README.md
Browse filesAdd transformers v5 dependency
README.md
CHANGED
|
@@ -61,12 +61,16 @@ The 4bit AWQ quantization performs significantly faster in my testing, but you d
|
|
| 61 |
|
| 62 |
## Usage
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
### vLLM (Recommended)
|
| 65 |
|
| 66 |
```bash
|
| 67 |
vllm serve btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ \
|
| 68 |
--tensor-parallel-size 4 \
|
| 69 |
-
--trust-remote-code \
|
| 70 |
--quantization compressed-tensors
|
| 71 |
```
|
| 72 |
|
|
|
|
| 61 |
|
| 62 |
## Usage
|
| 63 |
|
| 64 |
+
You will need transformers v5+ to run ministral models. Install via:
|
| 65 |
+
```bash
|
| 66 |
+
pip install transformers>=5.0.0
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
### vLLM (Recommended)
|
| 70 |
|
| 71 |
```bash
|
| 72 |
vllm serve btbtyler09/Devstral-Small-2-24B-Instruct-INT4-INT8-Mixed-GPTQ \
|
| 73 |
--tensor-parallel-size 4 \
|
|
|
|
| 74 |
--quantization compressed-tensors
|
| 75 |
```
|
| 76 |
|