Image-Text-to-Text
Transformers
Safetensors
English
Chinese
sensenova_loop
text-generation
auto-round
w4a16
4-bit precision
quantized
multimodal
looped-transformer
mhc
custom_code
conversational
Instructions to use stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound", trust_remote_code=True) 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 AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound", "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/stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound
- SGLang
How to use stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound 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 "stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound" \ --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": "stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound", "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 "stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound" \ --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": "stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound", "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 stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound with Docker Model Runner:
docker model run hf.co/stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound
SenseNova-Loop-9B-Preview-W4A16-AutoRound
4-bit (W4A16) AutoRound quantization of sensenova/SenseNova-Loop-9B-Preview.
Quantization Summary
- Method: AutoRound
0.16.1(auto-round,auto_round:auto_gptqpacking) - Precision: 4-bit symmetric weights, 16-bit activations (
W4A16), group size128,100tuning iterations (256calibration samples,seqlen=2048) - Scope:
248/359layers quantized across the 32 decoder blocks (model.language_model.layers);lm_head,model.language_model.embed_tokens,model.visual.*(vision tower & merger), andmtp.*kept in BF16 - Artifact size: ~8.5 GB on disk (
model-00001-of-00002.safetensors,model-00002-of-00002.safetensors,model_extra_tensors.safetensors)
Evaluation Status
| Check | Result | Notes |
|---|---|---|
| Canary suite (5 prompts) | 5/5 passed | Coding, math, architecture, strict instruction-following, factual extraction (load_time_sec: 8.02s, vram_budget_passed: true) |
| WikiText-2 PPL (W4A16) | 22.068 | 100,000 tokens, seqlen=2048, stride=512, bfloat16 (316.12s, loaded in 3.13s) |
| BF16 PPL baseline / ratio | Pending | Single 24 GB GPU OOMd on full BF16 at seqlen=2048 |
| Fleet / downstream bench | Pending | — |
| Serving engine check | Pending | Base architecture uses trust_remote_code=True (modeling_sensenova_loop.py) and targets SGLang / LightLLM / transformers |
Note on local speed: Canary generation averaged
0.71 tok/sunder unoptimized Hugging Facetransformers(auto_round:tritonv2_zp) with the PyTorch referencecausal_conv1dfallback. This is not representative of SGLang/LightLLM serving throughput.
Usage (transformers)
from transformers import AutoModelForImageTextToText, AutoTokenizer
model_id = "stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
model_id,
device_map="auto",
torch_dtype="auto",
trust_remote_code=True,
)
- Downloads last month
- 17
Model tree for stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound
Base model
sensenova/SenseNova-Loop-9B-Preview