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
Download quantization_config.json from stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound: direct link, hf CLI and curl.
- Browser
- Download file 485 Bytes
-
https://huggingface.co/stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound/resolve/main/quantization_config.json
- Command line
-
hf download hf://stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound/quantization_config.json
-
curl -L -o quantization_config.json https://huggingface.co/stuchapin/SenseNova-Loop-9B-Preview-W4A16-AutoRound/resolve/main/quantization_config.json
485 Bytes
| { | |
| "bits": 4, | |
| "data_type": "int", | |
| "group_size": 128, | |
| "sym": true, | |
| "iters": 100, | |
| "low_gpu_mem_usage": true, | |
| "autoround_version": "0.16.1", | |
| "block_name_to_quantize": "model.language_model.layers", | |
| "quant_method": "auto-round", | |
| "packing_format": "auto_round:auto_gptq", | |
| "extra_config": { | |
| ".*model\\.language_model\\.embed_tokens.*": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| ".*mtp\\..*": { | |
| "bits": 16, | |
| "data_type": "float" | |
| } | |
| } | |
| } |