Update README.md
Browse files
README.md
CHANGED
|
@@ -21,4 +21,20 @@ Med-R1 is a reinforcement learning (RL)-enhanced vision-language model (VLM) des
|
|
| 21 |
- **Cross-Task Learning**: We provide checkpoints trained separately on the following tasks:
|
| 22 |
- **Anatomy Identification**, **Disease Diagnosis**, **Lesion Grading**, **Modality Recognition**, and **Biological Attribute Analysis**.
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
## Citation
|
|
|
|
| 21 |
- **Cross-Task Learning**: We provide checkpoints trained separately on the following tasks:
|
| 22 |
- **Anatomy Identification**, **Disease Diagnosis**, **Lesion Grading**, **Modality Recognition**, and **Biological Attribute Analysis**.
|
| 23 |
|
| 24 |
+
## Use of Models
|
| 25 |
+
```
|
| 26 |
+
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
|
| 27 |
+
|
| 28 |
+
MODEL_PATH = "yuxianglai117/Med-R1"
|
| 29 |
+
|
| 30 |
+
model = Qwen2VLForConditionalGeneration.from_pretrained(
|
| 31 |
+
MODEL_PATH,
|
| 32 |
+
torch_dtype=torch.bfloat16,
|
| 33 |
+
attn_implementation="flash_attention_2",
|
| 34 |
+
device_map="auto",
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
processor = AutoProcessor.from_pretrained(MODEL_PATH)
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
## Citation
|