Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,98 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
library_name: transformers
|
4 |
+
tags:
|
5 |
+
- trl
|
6 |
+
- sft
|
7 |
+
datasets:
|
8 |
+
- pubmed
|
9 |
+
- bigbio/czi_drsm
|
10 |
+
- bigbio/bc5cdr
|
11 |
+
- bigbio/distemist
|
12 |
+
- pubmed_qa
|
13 |
+
- medmcqa
|
14 |
---
|
15 |
+
|
16 |
+
# Model Card for med_mistral
|
17 |
+
|
18 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
+
## Model Details
|
23 |
+
|
24 |
+
### Model Description
|
25 |
+
|
26 |
+
<!-- Provide a longer summary of what this model is. -->
|
27 |
+
|
28 |
+
Model Mistral-7B-Instruct-v0.2 finetuned with QLoRA on multiple medical datasets.
|
29 |
+
|
30 |
+
4-bit version: [med_mistral_4bit](https://huggingface.co/adriata/med_mistral_4bit)
|
31 |
+
|
32 |
+
- **License:** apache-2.0
|
33 |
+
- **Finetuned from model :** mistralai/Mistral-7B-Instruct-v0.2
|
34 |
+
|
35 |
+
### Model Sources [optional]
|
36 |
+
|
37 |
+
<!-- Provide the basic links for the model. -->
|
38 |
+
|
39 |
+
- **Repository:** https://github.com/atadria/med_llm
|
40 |
+
|
41 |
+
## Uses
|
42 |
+
|
43 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
44 |
+
|
45 |
+
The model is finetuned on medical data and is intended only for research. It should not be used as a substitute for professional medical advice, diagnosis, or treatment.
|
46 |
+
|
47 |
+
## Bias, Risks, and Limitations
|
48 |
+
|
49 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
50 |
+
The model's predictions are based on the information available in the finetuned medical dataset. It may not generalize well to all medical conditions or diverse patient populations.
|
51 |
+
|
52 |
+
Sensitivity to variations in input data and potential biases present in the training data may impact the model's performance.
|
53 |
+
|
54 |
+
### Recommendations
|
55 |
+
|
56 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
57 |
+
|
58 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
59 |
+
|
60 |
+
## How to Get Started with the Model
|
61 |
+
|
62 |
+
Use the code below to get started with the model.
|
63 |
+
|
64 |
+
```python
|
65 |
+
# !pip install -q transformers accelerate bitsandbytes
|
66 |
+
|
67 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
68 |
+
|
69 |
+
tokenizer = AutoTokenizer.from_pretrained("adriata/med_mistral")
|
70 |
+
model = AutoModelForCausalLM.from_pretrained("adriata/med_mistral")
|
71 |
+
|
72 |
+
prompt_template = """<s>[INST] {prompt} [/INST]"""
|
73 |
+
|
74 |
+
prompt = "What is influenza?"
|
75 |
+
|
76 |
+
model_inputs = tokenizer.encode(prompt_template.format(prompt=prompt),
|
77 |
+
return_tensors="pt").to("cuda")
|
78 |
+
|
79 |
+
generated_ids = model.generate(model_inputs, max_new_tokens=512, do_sample=True)
|
80 |
+
decoded = tokenizer.batch_decode(generated_ids)
|
81 |
+
print(decoded[0])
|
82 |
+
```
|
83 |
+
|
84 |
+
## Training Details
|
85 |
+
~13h - 20k examples x 1 epoch
|
86 |
+
|
87 |
+
GPU: OVH - 1 × NVIDIA TESLA V100S (32 GiB RAM)
|
88 |
+
|
89 |
+
### Training Data
|
90 |
+
|
91 |
+
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
92 |
+
Training data included 20k examples randomly selected from datasets:
|
93 |
+
- pubmed
|
94 |
+
- bigbio/czi_drsm
|
95 |
+
- bigbio/bc5cdr
|
96 |
+
- bigbio/distemist
|
97 |
+
- pubmed_qa
|
98 |
+
- medmcqa
|