Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
medical
multimodal
report generation
radiology
clinical-reasoning
MRI
CT
Histopathology
X-ray
Fundus
conversational
text-generation-inference
Instructions to use lingshu-medical-mllm/Lingshu-32B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lingshu-medical-mllm/Lingshu-32B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="lingshu-medical-mllm/Lingshu-32B") 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("lingshu-medical-mllm/Lingshu-32B") model = AutoModelForMultimodalLM.from_pretrained("lingshu-medical-mllm/Lingshu-32B", device_map="auto") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lingshu-medical-mllm/Lingshu-32B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lingshu-medical-mllm/Lingshu-32B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lingshu-medical-mllm/Lingshu-32B", "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/lingshu-medical-mllm/Lingshu-32B
- SGLang
How to use lingshu-medical-mllm/Lingshu-32B 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 "lingshu-medical-mllm/Lingshu-32B" \ --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": "lingshu-medical-mllm/Lingshu-32B", "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 "lingshu-medical-mllm/Lingshu-32B" \ --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": "lingshu-medical-mllm/Lingshu-32B", "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 lingshu-medical-mllm/Lingshu-32B with Docker Model Runner:
docker model run hf.co/lingshu-medical-mllm/Lingshu-32B
Update README.md
Browse files
README.md
CHANGED
|
@@ -104,6 +104,17 @@ tags:
|
|
| 104 |
<td>43.3</td>
|
| 105 |
<td>61.5</td>
|
| 106 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
<tr>
|
| 108 |
<td colspan="9" style="text-align:center;"><strong>Open-source Models (<10B)</strong></td>
|
| 109 |
</tr>
|
|
@@ -365,6 +376,17 @@ tags:
|
|
| 365 |
<td>56.3</td>
|
| 366 |
<td>73.1</td>
|
| 367 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
<tr>
|
| 369 |
<td colspan="9" style="text-align:center;"><strong>Open-source Models (<10B)</strong></td>
|
| 370 |
</tr>
|
|
@@ -642,6 +664,24 @@ tags:
|
|
| 642 |
<td>41.0</td>
|
| 643 |
<td>72.1</td>
|
| 644 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 645 |
<tr>
|
| 646 |
<td colspan="16" style="text-align:center;"><strong>Open-source Models (<10B)</strong></td>
|
| 647 |
</tr>
|
|
@@ -1088,7 +1128,7 @@ If you find our project useful, we hope you would kindly star our repo and cite
|
|
| 1088 |
|
| 1089 |
* `*` are equal contributions. `^` are corresponding authors.
|
| 1090 |
```
|
| 1091 |
-
@misc{
|
| 1092 |
title={Lingshu: A Generalist Foundation Model for Unified Multimodal Medical Understanding and Reasoning},
|
| 1093 |
author={LASA Team and Weiwen Xu* and Hou Pong Chan* and Long Li* and Mahani Aljunied and Ruifeng Yuan and Jianyu Wang and Chenghao Xiao and Guizhen Chen and Chaoqun Liu and Zhaodonghui Li and Yu Sun and Junao Shen and Chaojun Wang and Jie Tan and Deli Zhao and Tingyang Xu and Hao Zhang^ and Yu Rong^},
|
| 1094 |
year={2025},
|
|
@@ -1097,4 +1137,4 @@ If you find our project useful, we hope you would kindly star our repo and cite
|
|
| 1097 |
primaryClass={cs.CL},
|
| 1098 |
url={https://arxiv.org/abs/2506.07044},
|
| 1099 |
}
|
| 1100 |
-
```
|
|
|
|
| 104 |
<td>43.3</td>
|
| 105 |
<td>61.5</td>
|
| 106 |
</tr>
|
| 107 |
+
<tr>
|
| 108 |
+
<td>Gemini-2.5-Flash</td>
|
| 109 |
+
<td>76.9</td>
|
| 110 |
+
<td>68.5</td>
|
| 111 |
+
<td>75.8</td>
|
| 112 |
+
<td>55.4</td>
|
| 113 |
+
<td>55.4</td>
|
| 114 |
+
<td>71.0</td>
|
| 115 |
+
<td>52.8</td>
|
| 116 |
+
<td>65.1</td>
|
| 117 |
+
</tr>
|
| 118 |
<tr>
|
| 119 |
<td colspan="9" style="text-align:center;"><strong>Open-source Models (<10B)</strong></td>
|
| 120 |
</tr>
|
|
|
|
| 376 |
<td>56.3</td>
|
| 377 |
<td>73.1</td>
|
| 378 |
</tr>
|
| 379 |
+
<tr>
|
| 380 |
+
<td>Gemini-2.5-Flash</td>
|
| 381 |
+
<td>84.2</td>
|
| 382 |
+
<td>73.8</td>
|
| 383 |
+
<td>73.6</td>
|
| 384 |
+
<td>91.2</td>
|
| 385 |
+
<td>77.6</td>
|
| 386 |
+
<td>35.6</td>
|
| 387 |
+
<td>53.3</td>
|
| 388 |
+
<td>69.9</td>
|
| 389 |
+
</tr>
|
| 390 |
<tr>
|
| 391 |
<td colspan="9" style="text-align:center;"><strong>Open-source Models (<10B)</strong></td>
|
| 392 |
</tr>
|
|
|
|
| 664 |
<td>41.0</td>
|
| 665 |
<td>72.1</td>
|
| 666 |
</tr>
|
| 667 |
+
<tr>
|
| 668 |
+
<td>Gemini-2.5-Flash</td>
|
| 669 |
+
<td>25.4</td>
|
| 670 |
+
<td>80.7</td>
|
| 671 |
+
<td>50.3</td>
|
| 672 |
+
<td>29.7</td>
|
| 673 |
+
<td>59.4</td>
|
| 674 |
+
<td>23.6</td>
|
| 675 |
+
<td>72.2</td>
|
| 676 |
+
<td>44.3</td>
|
| 677 |
+
<td>27.4</td>
|
| 678 |
+
<td>44.0</td>
|
| 679 |
+
<td>33.5</td>
|
| 680 |
+
<td>129.3</td>
|
| 681 |
+
<td>55.6</td>
|
| 682 |
+
<td>50.9</td>
|
| 683 |
+
<td>91.6</td>
|
| 684 |
+
</tr>
|
| 685 |
<tr>
|
| 686 |
<td colspan="16" style="text-align:center;"><strong>Open-source Models (<10B)</strong></td>
|
| 687 |
</tr>
|
|
|
|
| 1128 |
|
| 1129 |
* `*` are equal contributions. `^` are corresponding authors.
|
| 1130 |
```
|
| 1131 |
+
@misc{lasateam2025lingshu,
|
| 1132 |
title={Lingshu: A Generalist Foundation Model for Unified Multimodal Medical Understanding and Reasoning},
|
| 1133 |
author={LASA Team and Weiwen Xu* and Hou Pong Chan* and Long Li* and Mahani Aljunied and Ruifeng Yuan and Jianyu Wang and Chenghao Xiao and Guizhen Chen and Chaoqun Liu and Zhaodonghui Li and Yu Sun and Junao Shen and Chaojun Wang and Jie Tan and Deli Zhao and Tingyang Xu and Hao Zhang^ and Yu Rong^},
|
| 1134 |
year={2025},
|
|
|
|
| 1137 |
primaryClass={cs.CL},
|
| 1138 |
url={https://arxiv.org/abs/2506.07044},
|
| 1139 |
}
|
| 1140 |
+
```
|