Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
| 1 |
---
|
| 2 |
license: llama3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: llama3
|
| 3 |
+
datasets:
|
| 4 |
+
- TsinghuaC3I/UltraMedical
|
| 5 |
+
- TsinghuaC3I/UltraMedical-Preference
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
metrics:
|
| 9 |
+
- accuracy
|
| 10 |
+
base_model: meta-llama/Meta-Llama-3-70B-Instruct
|
| 11 |
+
tags:
|
| 12 |
+
- UltraMedical
|
| 13 |
---
|
| 14 |
+
<div align="center">
|
| 15 |
+
<h1>
|
| 16 |
+
UltraMedical: Building Specialized Generalists in Biomedicine.
|
| 17 |
+
</h1>
|
| 18 |
+
</div>
|
| 19 |
+
|
| 20 |
+
<p align="center">
|
| 21 |
+
<a href="https://huggingface.co/datasets/TsinghuaC3I/UltraMedical">SFT Dataset</a> •
|
| 22 |
+
<a href="https://huggingface.co/datasets/TsinghuaC3I/UltraMedical-Preference">Pref Dataset</a> •
|
| 23 |
+
<a href="https://huggingface.co/collections/TsinghuaC3I/ultramedical-66d4076bad293ffc4bc41327">Collection</a> •
|
| 24 |
+
<!-- <a href="https://huggingface.co/spaces/TsinghuaC3I/UltraMedical-LM">Demo</a> • -->
|
| 25 |
+
<a href="https://arxiv.org/abs/2406.03949">Paper</a>
|
| 26 |
+
</p>
|
| 27 |
+
|
| 28 |
+
Llama-3-70B-UltraMedical is an open-access large language model (LLM) specialized in biomedicine. Developed by the Tsinghua C3I Lab, this model aims to enhance medical examination access, literature comprehension, and clinical knowledge.
|
| 29 |
+
|
| 30 |
+
Building on the foundation of Meta's Llama-3-70B, Llama-3-70B-UltraMedical is trained on our [UltraMedical](https://github.com/TsinghuaC3I/UltraMedical) collection with supervised fine-tuning (SFT), iterative preference learning (like DPO and KTO). The UltraMedical collection is a large-scale, high-quality dataset of biomedical instructions, comprising 410,000 synthetic and manually curated samples, along with more than 100,000 preference data.
|
| 31 |
+
|
| 32 |
+
### Inference with vLLM
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
from transformers import AutoTokenizer
|
| 36 |
+
from vllm import LLM, SamplingParams
|
| 37 |
+
|
| 38 |
+
llm = LLM(model="TsinghuaC3I/Llama-3-70B-UltraMedical", trust_remote_code=True)
|
| 39 |
+
tokenizer = AutoTokenizer.from_pretrained("TsinghuaC3I/Llama-3-70B-UltraMedical")
|
| 40 |
+
sampling_params = SamplingParams(temperature=0.7, top_p=0.9, max_tokens=1024, stop=["<|eot_id|>"])
|
| 41 |
+
|
| 42 |
+
messages = [
|
| 43 |
+
{"role": "user", "content": """The question format used in the above input examples。"""},
|
| 44 |
+
]
|
| 45 |
+
prompts = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 46 |
+
print(prompts[0])
|
| 47 |
+
"""
|
| 48 |
+
<|begin_of_text|><|start_header_id|>user<|end_header_id|>
|
| 49 |
+
|
| 50 |
+
{question}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
| 51 |
+
|
| 52 |
+
"""
|
| 53 |
+
|
| 54 |
+
outputs = llm.generate(prompts=prompts, sampling_params=sampling_params)
|
| 55 |
+
print(outputs[0].outputs[0].text)
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
### Citation
|
| 60 |
+
|
| 61 |
+
```
|
| 62 |
+
@misc{zhang2024ultramedical,
|
| 63 |
+
title={UltraMedical: Building Specialized Generalists in Biomedicine},
|
| 64 |
+
author={Kaiyan Zhang and Sihang Zeng and Ermo Hua and Ning Ding and Zhang-Ren Chen and Zhiyuan Ma and Haoxin Li and Ganqu Cui and Biqing Qi and Xuekai Zhu and Xingtai Lv and Hu Jinfang and Zhiyuan Liu and Bowen Zhou},
|
| 65 |
+
year={2024},
|
| 66 |
+
eprint={2406.03949},
|
| 67 |
+
archivePrefix={arXiv},
|
| 68 |
+
primaryClass={cs.CL}
|
| 69 |
+
}
|
| 70 |
+
```
|