CohereLabs/aya_dataset
Viewer • Updated • 206k • 15.4k • 363
How to use yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4")
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("yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4")
model = AutoModelForMultimodalLM.from_pretrained("yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4", 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]:]))How to use yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4",
"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 run hf.co/yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4
How to use yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4" \
--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": "yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4",
"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 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 "yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4" \
--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": "yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4",
"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"
}
}
]
}
]
}'How to use yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4 with Docker Model Runner:
docker model run hf.co/yasu-oh/gemma-4-26B-A4B-it-qat-NVFP4
An NVFP4-quantized version of google/gemma-4-26B-A4B-it-qat-q4_0-unquantized.
This model was independently quantized to NVFP4 W4A4 using LLM Compressor and saved in the compressed-tensors format.
The following datasets were used for calibration:
The calibration dataset consists of:
default_stage:
default_modifiers:
GPTQModifier:
config_groups:
group_0:
targets: [Linear]
weights:
num_bits: 4
type: float
symmetric: true
group_size: 16
strategy: tensor_group
block_structure: null
dynamic: false
actorder: static
scale_dtype: torch.float8_e4m3fn
zp_dtype: null
observer: imatrix_mse
observer_kwargs: {strict: true}
input_activations:
num_bits: 4
type: float
symmetric: true
group_size: 16
strategy: tensor_group
block_structure: null
dynamic: local
actorder: null
scale_dtype: torch.float8_e4m3fn
zp_dtype: null
observer: static_minmax
observer_kwargs: {}
output_activations: null
format: null
targets: [Linear]
ignore: ['re:.*vision.*', 're:.*audio.*', lm_head, 're:.*embed.*', 're:.*router.*']
kv_cache_scheme:
num_bits: 8
type: float
symmetric: true
group_size: null
strategy: tensor
block_structure: null
dynamic: false
actorder: null
scale_dtype: null
zp_dtype: null
observer: static_minmax
observer_kwargs: {}
bypass_divisibility_checks: false
requires_calibration_data: true
block_size: 128
dampening_frac: 0.01
actorder: static
offload_hessians: false
The quantization code and calibration preprocessing are available at:
The quantization run used:
transformers: 5.12.1
llmcompressor: 0.12.1.dev91+g4bb29d00c
compressed-tensors: 0.17.2.dev36+g2cff344
Base model
google/gemma-4-26B-A4B