Image-Text-to-Text
Transformers
Safetensors
English
qwen2_5_vl
sleep-staging
polysomnography
PSG
explainable-AI
AASM
vision-language-model
medical
EEG
EOG
EMG
lora
rule-grounded
multimodal
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use Feng613/SleepVLM-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Feng613/SleepVLM-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Feng613/SleepVLM-3B") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Feng613/SleepVLM-3B") model = AutoModelForMultimodalLM.from_pretrained("Feng613/SleepVLM-3B") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Feng613/SleepVLM-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Feng613/SleepVLM-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Feng613/SleepVLM-3B", "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/Feng613/SleepVLM-3B
- SGLang
How to use Feng613/SleepVLM-3B 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 "Feng613/SleepVLM-3B" \ --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": "Feng613/SleepVLM-3B", "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 "Feng613/SleepVLM-3B" \ --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": "Feng613/SleepVLM-3B", "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 Feng613/SleepVLM-3B with Docker Model Runner:
docker model run hf.co/Feng613/SleepVLM-3B
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -79,18 +79,6 @@ model-index:
|
|
| 79 |
> Guifeng Deng, Pan Wang, Jiquan Wang, Tao Li, Haiteng Jiang. "SleepVLM: Explainable and Rule-Grounded Sleep Staging via a Vision-Language Model." *In preparation.*
|
| 80 |
> This repository will be made public upon release of the preprint.
|
| 81 |
|
| 82 |
-
## Authors
|
| 83 |
-
|
| 84 |
-
| Name | Affiliation | ORCID |
|
| 85 |
-
|------|------------|-------|
|
| 86 |
-
| Guifeng Deng | Zhejiang University | [0009-0001-1940-7797](https://orcid.org/0009-0001-1940-7797) |
|
| 87 |
-
| Pan Wang | Wenzhou Medical University | [0009-0001-6664-6934](https://orcid.org/0009-0001-6664-6934) |
|
| 88 |
-
| Jiquan Wang | Zhejiang University | |
|
| 89 |
-
| Tao Li ✉ | Zhejiang University | [0000-0003-3831-901X](https://orcid.org/0000-0003-3831-901X) |
|
| 90 |
-
| Haiteng Jiang ✉ | Zhejiang University | [0000-0003-0739-8413](https://orcid.org/0000-0003-0739-8413) |
|
| 91 |
-
|
| 92 |
-
**Correspondence:** Tao Li (litaozjusc@zju.edu.cn) and Haiteng Jiang (h.jiang@zju.edu.cn)
|
| 93 |
-
|
| 94 |
## Overview
|
| 95 |
|
| 96 |
**SleepVLM-3B** is a rule-grounded vision-language model for explainable automated sleep staging from polysomnography (PSG) recordings. Unlike conventional black-box classifiers that output only a stage label, SleepVLM generates clinician-readable natural-language rationales citing specific AASM scoring rules for every 30-second epoch, making each staging decision auditable against the clinical standard.
|
|
|
|
| 79 |
> Guifeng Deng, Pan Wang, Jiquan Wang, Tao Li, Haiteng Jiang. "SleepVLM: Explainable and Rule-Grounded Sleep Staging via a Vision-Language Model." *In preparation.*
|
| 80 |
> This repository will be made public upon release of the preprint.
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
## Overview
|
| 83 |
|
| 84 |
**SleepVLM-3B** is a rule-grounded vision-language model for explainable automated sleep staging from polysomnography (PSG) recordings. Unlike conventional black-box classifiers that output only a stage label, SleepVLM generates clinician-readable natural-language rationales citing specific AASM scoring rules for every 30-second epoch, making each staging decision auditable against the clinical standard.
|