Instructions to use qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- vLLM
How to use qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8", "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/qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8
- SGLang
How to use qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8 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 "qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8" \ --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": "qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8", "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 "qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8" \ --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": "qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8", "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 qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8 with Docker Model Runner:
docker model run hf.co/qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8
OpenSparX-3b-cabin-sft-v2-gptq-int8
简介 | Overview
这是一个基于 Qwen2.5-VL-3B-Instruct 的多模态座舱助手模型,采用 GPTQ INT8 量化,面向端侧或轻量部署场景。
This is a multimodal in-cabin assistant model based on Qwen2.5-VL-3B-Instruct and quantized with GPTQ INT8 for lightweight or on-device deployment.
适用场景 | Use Cases
座舱情绪识别与安抚建议。
驾驶分心行为识别与安全提醒。
儿童安全带佩戴检测与提醒。
输出自然语言回复和结构化控制标签,便于接入车机控制链路。
Emotion recognition and comfort suggestions in the cabin.
Driver distraction detection and safety reminders.
Child seat-belt wearing detection and reminders.
Natural-language responses plus structured action tags for downstream vehicle control integration.
推荐输入格式 | Recommended Input Format
推荐使用 Qwen2.5-VL 的多模态消息格式,图像和文本通过 content 数组一起传入。
Use the native Qwen2.5-VL multimodal message format, where image and text are passed together in the content array.
{
"messages": [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "请根据图像描述驾驶员状态并给出功能建议。"}
]
}
]
}
Python 推理示例 | Python Inference Example
该模型是视觉语言模型,推理时应使用 AutoProcessor 和 Qwen2_5_VLForConditionalGeneration。
This model is a vision-language model, so inference should use AutoProcessor and Qwen2_5_VLForConditionalGeneration.
from PIL import Image
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
repo_id = "qualcomm-ai-hub-community/OpenSparX-3b-cabin-sft-v2-gptq-int8"
processor = AutoProcessor.from_pretrained(repo_id, trust_remote_code=True)
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
repo_id,
torch_dtype="auto",
device_map="auto",
trust_remote_code=True,
)
image = Image.open("/path/to/your/image.jpg").convert("RGB")
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "Describe the driver state and suggest actions."},
],
}
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[text], images=[image], return_tensors="pt")
inputs = inputs.to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=128)
generated_ids = [
output_ids[len(input_ids):]
for input_ids, output_ids in zip(inputs.input_ids, generated_ids)
]
print(processor.batch_decode(generated_ids, skip_special_tokens=False)[0])
文件说明 | File Overview
model.safetensors:量化后的单文件权重。config.json:模型结构配置,基座为Qwen2.5-VL-3B-Instruct。quantize_config.json:GPTQ INT8 量化配置。preprocessor_config.json:视觉预处理配置。chat_template.json:对话模板。model.safetensors: quantized single-file model weights.config.json: model architecture config based onQwen2.5-VL-3B-Instruct.quantize_config.json: GPTQ INT8 quantization settings.preprocessor_config.json: visual preprocessing config.chat_template.json: chat template used for prompt construction.
资源需求 | Requirements
建议使用支持 GPTQ 的推理环境,显存建议 8 GB 以上,实际需求受输入分辨率和生成长度影响。
Use a GPTQ-capable inference stack. A GPU with at least 8 GB VRAM is recommended, although actual usage depends on image resolution and generation length.
注意事项 | Notes
模型仅用于研究与演示。若要部署到真实驾驶环境,请补充安全评估、异常回退和权限控制。
This model is intended for research and demo use only. For real driving deployment, add safety validation, fallback handling, and permission control.
- Downloads last month
- 11