Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama3.1
|
| 3 |
+
base_model: meta-llama/Llama-3.1-8B-Instruct
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- drug-combination
|
| 7 |
+
- relation-extraction
|
| 8 |
+
- biomedical
|
| 9 |
+
- llama
|
| 10 |
+
- chain-of-thought
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# RexDrug-Base
|
| 14 |
+
|
| 15 |
+
This is the SFT (Supervised Fine-Tuning) base model for **RexDrug**, a chain-of-thought reasoning model for biomedical drug combination relation extraction.
|
| 16 |
+
|
| 17 |
+
## Model Details
|
| 18 |
+
|
| 19 |
+
- **Base architecture**: [Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct)
|
| 20 |
+
- **Fine-tuning method**: SFT with LoRA (merged)
|
| 21 |
+
- **Task**: Drug combination relation extraction from biomedical literature
|
| 22 |
+
- **Relation types**: POS (beneficial), NEG (harmful), COMB (neutral/mixed), NO_COMB (no combination)
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
|
| 26 |
+
This model is intended to be used with the [RexDrug-adapter](https://huggingface.co/dlutIR/RexDrug-adapter) (LoRA adapter trained via GRPO). See the adapter repository for the full quick start guide.
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 30 |
+
from peft import PeftModel
|
| 31 |
+
import torch
|
| 32 |
+
|
| 33 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 34 |
+
"dlutIR/RexDrug-base",
|
| 35 |
+
torch_dtype=torch.bfloat16,
|
| 36 |
+
device_map="auto",
|
| 37 |
+
)
|
| 38 |
+
model = PeftModel.from_pretrained(model, "dlutIR/RexDrug-adapter")
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## License
|
| 42 |
+
|
| 43 |
+
This model is built upon Llama 3.1 and is subject to the [Llama 3.1 Community License Agreement](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE).
|