CohereLabs/aya_dataset
Viewer • Updated • 206k • 24.3k • 381
How to use yasu-oh/GLM-5.3-Flash-NVFP4 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="yasu-oh/GLM-5.3-Flash-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) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("yasu-oh/GLM-5.3-Flash-NVFP4")
model = AutoModelForMultimodalLM.from_pretrained("yasu-oh/GLM-5.3-Flash-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=256)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use yasu-oh/GLM-5.3-Flash-NVFP4 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "yasu-oh/GLM-5.3-Flash-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/GLM-5.3-Flash-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/GLM-5.3-Flash-NVFP4
How to use yasu-oh/GLM-5.3-Flash-NVFP4 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "yasu-oh/GLM-5.3-Flash-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/GLM-5.3-Flash-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/GLM-5.3-Flash-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/GLM-5.3-Flash-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/GLM-5.3-Flash-NVFP4 with Docker Model Runner:
docker model run hf.co/yasu-oh/GLM-5.3-Flash-NVFP4
An NVFP4-quantized version of zai-org/GLM-5.3-Flash.
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: ['re:.*mlp\.experts\..*(gate|up|down)_proj$']
weights:
num_bits: 4
type: float
symmetric: true
group_size: 16
strategy: tensor_group
dynamic: false
actorder: static
scale_dtype: torch.float8_e4m3fn
observer: nvfp4_expanded_imatrix
observer_kwargs: {strict: true}
input_activations: {num_bits: 4, type: float, symmetric: true, group_size: 16, strategy: tensor_group,
dynamic: local, scale_dtype: torch.float8_e4m3fn, observer: static_minmax}
output_activations: null
format: null
targets: [Linear]
ignore: ['re:.*visual.*', lm_head, 're:.*mlp\.gate$', 're:.*self_attn\.indexer\..*']
bypass_divisibility_checks: false
requires_calibration_data: true
block_size: 128
dampening_frac: 0.01
actorder: static
batched_quantization: auto
The quantization code and calibration preprocessing are available at:
glm-5.3-flash-nvfp4-quantization
The quantization run used:
transformers: 5.22.2
llmcompressor: 0.15.1a20261106
compressed-tensors: 0.20.2a20261103
Base model
zai-org/GLM-5.3-Flash