Image-Text-to-Text
Transformers
Safetensors
English
Chinese
sensenova_loop
text-generation
nvfp4
modelopt
quantized
multimodal
looped-transformer
mhc
mtp
custom_code
conversational
8-bit precision
Instructions to use gitcommit90/SenseNova-Loop-9B-Preview-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gitcommit90/SenseNova-Loop-9B-Preview-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="gitcommit90/SenseNova-Loop-9B-Preview-NVFP4", 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("gitcommit90/SenseNova-Loop-9B-Preview-NVFP4", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gitcommit90/SenseNova-Loop-9B-Preview-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gitcommit90/SenseNova-Loop-9B-Preview-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": "gitcommit90/SenseNova-Loop-9B-Preview-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" } } ] } ] }'Use Docker
docker model run hf.co/gitcommit90/SenseNova-Loop-9B-Preview-NVFP4
- SGLang
How to use gitcommit90/SenseNova-Loop-9B-Preview-NVFP4 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 "gitcommit90/SenseNova-Loop-9B-Preview-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": "gitcommit90/SenseNova-Loop-9B-Preview-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" } } ] } ] }'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 "gitcommit90/SenseNova-Loop-9B-Preview-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": "gitcommit90/SenseNova-Loop-9B-Preview-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 Runner
How to use gitcommit90/SenseNova-Loop-9B-Preview-NVFP4 with Docker Model Runner:
docker model run hf.co/gitcommit90/SenseNova-Loop-9B-Preview-NVFP4
NVFP4 (ModelOpt) quantization of sensenova/SenseNova-Loop-9B-Preview @27abea77 with BF16 MTP head
a57aa9f verified Download runtime/overlay/python/sglang/srt/configs/sensenova_loop.py from gitcommit90/SenseNova-Loop-9B-Preview-NVFP4: direct link, hf CLI and curl.
- Browser
- Download file 2.74 kB
-
https://huggingface.co/gitcommit90/SenseNova-Loop-9B-Preview-NVFP4/resolve/main/runtime/overlay/python/sglang/srt/configs/sensenova_loop.py
- Command line
-
hf download hf://gitcommit90/SenseNova-Loop-9B-Preview-NVFP4/runtime/overlay/python/sglang/srt/configs/sensenova_loop.py
-
curl -L -o sensenova_loop.py https://huggingface.co/gitcommit90/SenseNova-Loop-9B-Preview-NVFP4/resolve/main/runtime/overlay/python/sglang/srt/configs/sensenova_loop.py
2.74 kB
| # Copyright 2026 SGLang Team | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| from sglang.srt.configs.linear_attn_model_registry import ( | |
| LinearAttnModelSpec, | |
| register_linear_attn_model, | |
| ) | |
| from sglang.srt.configs.qwen3_5 import Qwen3_5Config, Qwen3_5TextConfig | |
| class SenseNovaLoopTextConfig(Qwen3_5TextConfig): | |
| """Serving slots follow execution order; checkpoint layers remain physical.""" | |
| def __init__(self, execution_plan=(), mhc=None, layer_types=None, **kwargs): | |
| super().__init__(layer_types=layer_types, **kwargs) | |
| self.execution_plan = tuple(execution_plan) | |
| self.mhc = mhc | |
| self.layer_types = layer_types | |
| def layers_block_type(self): | |
| return [ | |
| "attention" if kind == "full_attention" else "linear_attention" | |
| for kind in self.layer_types | |
| ] | |
| class SenseNovaLoopConfig(Qwen3_5Config): | |
| model_type = "sensenova_loop" | |
| has_no_defaults_at_init = True | |
| sub_configs = { | |
| **Qwen3_5Config.sub_configs, | |
| "text_config": SenseNovaLoopTextConfig, | |
| } | |
| def __init__(self, loop_settings=None, mhc=None, **kwargs): | |
| super().__init__(**kwargs) | |
| self.loop_settings = loop_settings | |
| self.mhc = mhc | |
| text = self.text_config.to_dict() | |
| depth = text.get("physical_num_hidden_layers", text["num_hidden_layers"]) | |
| kinds = text.get("physical_layer_types", text["layer_types"]) | |
| start, end, count = ( | |
| loop_settings[key] for key in ("start", "end", "eval_count") | |
| ) | |
| self.execution_plan = ( | |
| tuple(range(start)) | |
| + tuple(range(start, end)) * count | |
| + tuple(range(end, depth)) | |
| ) | |
| text.update( | |
| physical_num_hidden_layers=depth, | |
| physical_layer_types=kinds, | |
| num_hidden_layers=len(self.execution_plan), | |
| layer_types=[kinds[i] for i in self.execution_plan], | |
| execution_plan=self.execution_plan, | |
| mhc=mhc, | |
| ) | |
| self.text_config = SenseNovaLoopTextConfig(**text) | |
| self.architectures = ["SenseNovaLoopForConditionalGeneration"] | |
| register_linear_attn_model( | |
| LinearAttnModelSpec( | |
| config_class=SenseNovaLoopTextConfig, | |
| backend_class_name="sglang.srt.layers.attention.linear.gdn_backend.GDNAttnBackend", | |
| arch_names=["SenseNovaLoopForConditionalGeneration"], | |
| unwrap_text_config=True, | |
| uses_mamba_radix_cache=True, | |
| support_mamba_cache=True, | |
| support_mamba_cache_extra_buffer=True, | |
| ) | |
| ) | |