Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,13 +19,13 @@ import subprocess
|
|
| 19 |
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
| 20 |
|
| 21 |
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 22 |
-
"lingshu-medical-mllm/Lingshu-
|
| 23 |
torch_dtype=torch.bfloat16,
|
| 24 |
attn_implementation="flash_attention_2",
|
| 25 |
device_map="auto",
|
| 26 |
)
|
| 27 |
|
| 28 |
-
processor = AutoProcessor.from_pretrained("lingshu-medical-mllm/Lingshu-
|
| 29 |
|
| 30 |
|
| 31 |
MAX_NUM_IMAGES = int(os.getenv("MAX_NUM_IMAGES", "5"))
|
|
@@ -216,7 +216,7 @@ def run(message: dict, history: list[dict], system_prompt: str = "", max_new_tok
|
|
| 216 |
|
| 217 |
|
| 218 |
DESCRIPTION = """\
|
| 219 |
-
This is a demo of Lingshu
|
| 220 |
Lingshu supports more than 12 medical imaging modalities, including X-Ray, CT Scan, MRI, Microscopy, Ultrasound, Histopathology, Dermoscopy, Fundus, OCT, Digital Photography, Endoscopy, and PET.
|
| 221 |
"""
|
| 222 |
|
|
@@ -231,7 +231,7 @@ demo = gr.ChatInterface(
|
|
| 231 |
gr.Slider(label="Max New Tokens", minimum=100, maximum=8192, step=10, value=2048),
|
| 232 |
],
|
| 233 |
stop_btn=False,
|
| 234 |
-
title="Lingshu
|
| 235 |
description=DESCRIPTION,
|
| 236 |
run_examples_on_click=False,
|
| 237 |
cache_examples=False,
|
|
|
|
| 19 |
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
| 20 |
|
| 21 |
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 22 |
+
"lingshu-medical-mllm/Lingshu-7B",
|
| 23 |
torch_dtype=torch.bfloat16,
|
| 24 |
attn_implementation="flash_attention_2",
|
| 25 |
device_map="auto",
|
| 26 |
)
|
| 27 |
|
| 28 |
+
processor = AutoProcessor.from_pretrained("lingshu-medical-mllm/Lingshu-7B")
|
| 29 |
|
| 30 |
|
| 31 |
MAX_NUM_IMAGES = int(os.getenv("MAX_NUM_IMAGES", "5"))
|
|
|
|
| 216 |
|
| 217 |
|
| 218 |
DESCRIPTION = """\
|
| 219 |
+
This is a demo of Lingshu 7B, a multimodal model trained for performance on medical text and image comprehension.
|
| 220 |
Lingshu supports more than 12 medical imaging modalities, including X-Ray, CT Scan, MRI, Microscopy, Ultrasound, Histopathology, Dermoscopy, Fundus, OCT, Digital Photography, Endoscopy, and PET.
|
| 221 |
"""
|
| 222 |
|
|
|
|
| 231 |
gr.Slider(label="Max New Tokens", minimum=100, maximum=8192, step=10, value=2048),
|
| 232 |
],
|
| 233 |
stop_btn=False,
|
| 234 |
+
title="Lingshu 7B",
|
| 235 |
description=DESCRIPTION,
|
| 236 |
run_examples_on_click=False,
|
| 237 |
cache_examples=False,
|