Image-Text-to-Text
Transformers
Safetensors
English
Chinese
sensenova_loop
text-generation
multimodal
looped-transformer
mhc
custom_code
conversational
Instructions to use sensenova/SenseNova-Loop-9B-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sensenova/SenseNova-Loop-9B-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sensenova/SenseNova-Loop-9B-Preview", 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("sensenova/SenseNova-Loop-9B-Preview", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sensenova/SenseNova-Loop-9B-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sensenova/SenseNova-Loop-9B-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sensenova/SenseNova-Loop-9B-Preview", "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/sensenova/SenseNova-Loop-9B-Preview
- SGLang
How to use sensenova/SenseNova-Loop-9B-Preview 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 "sensenova/SenseNova-Loop-9B-Preview" \ --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": "sensenova/SenseNova-Loop-9B-Preview", "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 "sensenova/SenseNova-Loop-9B-Preview" \ --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": "sensenova/SenseNova-Loop-9B-Preview", "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 sensenova/SenseNova-Loop-9B-Preview with Docker Model Runner:
docker model run hf.co/sensenova/SenseNova-Loop-9B-Preview
Add SGLang deployment example
Browse files- README.md +8 -0
- README_CN.md +8 -0
README.md
CHANGED
|
@@ -224,6 +224,14 @@ curl http://localhost:8000/v1/chat/completions \
|
|
| 224 |
-d '{"model": "sensenova_loop", "messages": [{"role": "user", "content": "Hello!"}], "max_tokens": 128}'
|
| 225 |
```
|
| 226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
## License and citation
|
| 228 |
|
| 229 |
**License:** [Apache License 2.0](https://github.com/OpenSenseNova/SenseNova-6.8-Loop-9B-Preview/blob/main/LICENSE).<br>**Citation:** To be added with the release.
|
|
|
|
| 224 |
-d '{"model": "sensenova_loop", "messages": [{"role": "user", "content": "Hello!"}], "max_tokens": 128}'
|
| 225 |
```
|
| 226 |
|
| 227 |
+
### [SGLang](https://github.com/sgl-project/sglang/pull/47281)
|
| 228 |
+
|
| 229 |
+
Use a build containing the SenseNova Loop implementation in this PR, and replace the path below with your local canonical checkpoint directory:
|
| 230 |
+
|
| 231 |
+
```bash
|
| 232 |
+
sglang serve --model-path /path/to/canonical-checkpoint
|
| 233 |
+
```
|
| 234 |
+
|
| 235 |
## License and citation
|
| 236 |
|
| 237 |
**License:** [Apache License 2.0](https://github.com/OpenSenseNova/SenseNova-6.8-Loop-9B-Preview/blob/main/LICENSE).<br>**Citation:** To be added with the release.
|
README_CN.md
CHANGED
|
@@ -224,6 +224,14 @@ curl http://localhost:8000/v1/chat/completions \
|
|
| 224 |
-d '{"model": "sensenova_loop", "messages": [{"role": "user", "content": "Hello!"}], "max_tokens": 128}'
|
| 225 |
```
|
| 226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
## 许可证与引用
|
| 228 |
|
| 229 |
**许可证:**[Apache License 2.0](https://github.com/OpenSenseNova/SenseNova-6.8-Loop-9B-Preview/blob/main/LICENSE)。<br>**引用:**将在发布时补充。
|
|
|
|
| 224 |
-d '{"model": "sensenova_loop", "messages": [{"role": "user", "content": "Hello!"}], "max_tokens": 128}'
|
| 225 |
```
|
| 226 |
|
| 227 |
+
### [SGLang](https://github.com/sgl-project/sglang/pull/47281)
|
| 228 |
+
|
| 229 |
+
请使用包含该 PR 中 SenseNova Loop 实现的版本,并将下方路径替换为本地 canonical checkpoint 目录:
|
| 230 |
+
|
| 231 |
+
```bash
|
| 232 |
+
sglang serve --model-path /path/to/canonical-checkpoint
|
| 233 |
+
```
|
| 234 |
+
|
| 235 |
## 许可证与引用
|
| 236 |
|
| 237 |
**许可证:**[Apache License 2.0](https://github.com/OpenSenseNova/SenseNova-6.8-Loop-9B-Preview/blob/main/LICENSE)。<br>**引用:**将在发布时补充。
|