Update README.md
Browse files
README.md
CHANGED
@@ -6,10 +6,10 @@ tags: []
|
|
6 |
# Model Card for Model ID
|
7 |
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
-
|
10 |
-
|
11 |
|
12 |
## Model Details
|
|
|
13 |
|
14 |
### Model Description
|
15 |
|
@@ -17,40 +17,148 @@ tags: []
|
|
17 |
|
18 |
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
19 |
|
20 |
-
- **Developed by:**
|
21 |
-
- **
|
22 |
-
- **
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
### Model Sources [optional]
|
29 |
|
30 |
<!-- Provide the basic links for the model. -->
|
|
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
## Uses
|
37 |
|
38 |
-
|
|
|
|
|
|
|
39 |
|
40 |
-
###
|
|
|
41 |
|
42 |
-
|
|
|
43 |
|
44 |
-
|
|
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
[More Information Needed]
|
51 |
|
52 |
### Out-of-Scope Use
|
53 |
|
|
|
54 |
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
|
56 |
[More Information Needed]
|
@@ -67,9 +175,6 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
67 |
|
68 |
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
|
74 |
[More Information Needed]
|
75 |
|
@@ -77,6 +182,7 @@ Use the code below to get started with the model.
|
|
77 |
|
78 |
### Training Data
|
79 |
|
|
|
80 |
<!-- 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. -->
|
81 |
|
82 |
[More Information Needed]
|
@@ -130,70 +236,15 @@ Use the code below to get started with the model.
|
|
130 |
|
131 |
#### Summary
|
132 |
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
## Citation [optional]
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
# Model Card for Model ID
|
7 |
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
+
Finetuned "BioMistral/BioMistral-7B" with MedQA dataset.
|
|
|
10 |
|
11 |
## Model Details
|
12 |
+
A Collection of Open-Source Pretrained Large Language Models for Medical Domains finetuned with MedQA dataset.
|
13 |
|
14 |
### Model Description
|
15 |
|
|
|
17 |
|
18 |
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
19 |
|
20 |
+
- **Developed by:** mychen76
|
21 |
+
- **Model type:** BioMedical
|
22 |
+
- **Finetuned from model:** BioMistral/BioMistral-7B
|
|
|
|
|
|
|
|
|
23 |
|
24 |
### Model Sources [optional]
|
25 |
|
26 |
<!-- Provide the basic links for the model. -->
|
27 |
+
- **dataset:** MedQA dataset
|
28 |
|
29 |
+
|
30 |
+
## How to Get Started with the Model
|
31 |
+
|
32 |
+
Use the code below to get started with the model.
|
33 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
34 |
+
Load Model:
|
35 |
+
```python
|
36 |
+
import torch
|
37 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
38 |
+
|
39 |
+
base_model_id = "mychen76/biomistral_medqa_v1"
|
40 |
+
bnb_config = BitsAndBytesConfig(
|
41 |
+
load_in_4bit=True,
|
42 |
+
bnb_4bit_use_double_quant=True,
|
43 |
+
bnb_4bit_quant_type="nf4",
|
44 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
45 |
+
)
|
46 |
+
|
47 |
+
model = AutoModelForCausalLM.from_pretrained(base_model_id, quantization_config=bnb_config)
|
48 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
49 |
+
base_model_id,
|
50 |
+
add_eos_token=True,
|
51 |
+
add_bos_token=True,
|
52 |
+
)
|
53 |
|
54 |
## Uses
|
55 |
|
56 |
+
```
|
57 |
+
*** Information ***
|
58 |
+
```
|
59 |
+
eval_prompt = """From the MedQuad MedicalQA Dataset: Given the following medical question and question type, provide an accurate answer:
|
60 |
|
61 |
+
### Question type:
|
62 |
+
information
|
63 |
|
64 |
+
### Question:
|
65 |
+
What are the genetic changes related to X-linked lymphoproliferative disease ?
|
66 |
|
67 |
+
### Answer:
|
68 |
+
"""
|
69 |
|
70 |
+
model_input = eval_tokenizer(eval_prompt, return_tensors="pt").to("cuda")
|
71 |
|
72 |
+
ft_model.eval()
|
73 |
+
with torch.no_grad():
|
74 |
+
print(eval_tokenizer.decode(ft_model.generate(**model_input, max_new_tokens=300)[0], skip_special_tokens=True))
|
75 |
+
```
|
76 |
+
result:
|
77 |
+
```
|
78 |
+
From the MedQuad MedicalQA Dataset: Given the following medical question and question type, provide an accurate answer:
|
79 |
+
|
80 |
+
### Question type:
|
81 |
+
information
|
82 |
+
|
83 |
+
### Question:
|
84 |
+
What are the genetic changes related to X-linked lymphoproliferative disease ?
|
85 |
+
|
86 |
+
### Answer:
|
87 |
+
X-linked lymphoproliferative disease (XLP) is a rare primary immunodeficiency syndrome. XLP is caused by mutations in SH2D1A gene, which encodes the cytoplasmic signaling protein SLAM-associated protein ( client protein-SLAM). SLAM is a member of the signaling lymphocytic activation molecule family of receptors, which are involved in the regulation of lymphocyte activation and proliferation. The SLAM receptor is expressed on the surface of B and T lymphocytes, natural killer cells, and monocytes. Mutations in SH2D1A gene lead to impaired signaling through the SLAM receptor, resulting in a deficiency in the activation and proliferation of B and T lymphocytes. This leads to a decrease in the number of B and T lymphocytes, resulting in a weakened immune response.
|
88 |
+
```
|
89 |
+
|
90 |
+
*** Frequency ***
|
91 |
+
```
|
92 |
+
eval_prompt = """From the MedQuad MedicalQA Dataset: Given the following medical question and question type, provide an accurate answer:
|
93 |
+
|
94 |
+
### Question type:
|
95 |
+
frequency
|
96 |
+
|
97 |
+
### Question:
|
98 |
+
How many people are affected by Smith-Lemli-Opitz syndrome ?
|
99 |
+
|
100 |
+
### Answer:
|
101 |
+
"""
|
102 |
+
|
103 |
+
model_input = eval_tokenizer(eval_prompt, return_tensors="pt").to("cuda")
|
104 |
+
|
105 |
+
ft_model.eval()
|
106 |
+
with torch.no_grad():
|
107 |
+
print(eval_tokenizer.decode(ft_model.generate(**model_input, max_new_tokens=300)[0], skip_special_tokens=True))
|
108 |
+
```
|
109 |
+
result:
|
110 |
+
```
|
111 |
+
From the MedQuad MedicalQA Dataset: Given the following medical question and question type, provide an accurate answer:
|
112 |
+
|
113 |
+
### Question type:
|
114 |
+
frequency
|
115 |
+
|
116 |
+
### Question:
|
117 |
+
How many people are affected by Smith-Lemli-Opitz syndrome ?
|
118 |
+
|
119 |
+
### Answer:
|
120 |
+
Smith-Lemli-Opitz syndrome (SLOS) is a rare autosomal recessive disorder of human development. It is characterized by a wide range of symptoms, including growth and developmental delay, intellectual disability, characteristic facial features, and congenital heart defects. The prevalence of SLOS is estimated to be 1 in 15,000 to 1 in 25,000 live births.
|
121 |
+
```
|
122 |
+
|
123 |
+
*** Symptons ***
|
124 |
+
```
|
125 |
+
eval_prompt = """From the MedQuad MedicalQA Dataset: Given the following medical question and question type, provide an accurate answer:
|
126 |
+
|
127 |
+
### Question type:
|
128 |
+
symptoms
|
129 |
+
|
130 |
+
### Question:
|
131 |
+
What are the symptoms of Norrie disease ?
|
132 |
+
|
133 |
+
### Answer:
|
134 |
+
"""
|
135 |
+
|
136 |
+
model_input = eval_tokenizer(eval_prompt, return_tensors="pt").to("cuda")
|
137 |
+
|
138 |
+
ft_model.eval()
|
139 |
+
with torch.no_grad():
|
140 |
+
print(eval_tokenizer.decode(ft_model.generate(**model_input, max_new_tokens=300)[0], skip_special_tokens=True))
|
141 |
+
```
|
142 |
+
Result:
|
143 |
+
```
|
144 |
+
Setting `pad_token_id` to `eos_token_id`:2 for open-end generation.
|
145 |
+
|
146 |
+
From the MedQuad MedicalQA Dataset: Given the following medical question and question type, provide an accurate answer:
|
147 |
+
|
148 |
+
### Question type:
|
149 |
+
symptoms
|
150 |
+
|
151 |
+
### Question:
|
152 |
+
What are the symptoms of Norrie disease ?
|
153 |
+
|
154 |
+
### Answer:
|
155 |
+
Norrie disease is a rare, X-linked recessive disorder of the blood vessels. It is characterized by a variety of symptoms, including glaucoma, mental retardation, seizures, and deafness.
|
156 |
+
```
|
157 |
|
|
|
158 |
|
159 |
### Out-of-Scope Use
|
160 |
|
161 |
+
images
|
162 |
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
163 |
|
164 |
[More Information Needed]
|
|
|
175 |
|
176 |
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
177 |
|
|
|
|
|
|
|
178 |
|
179 |
[More Information Needed]
|
180 |
|
|
|
182 |
|
183 |
### Training Data
|
184 |
|
185 |
+
- **dataset:** keivalya/MedQuad-MedicalQnADataset
|
186 |
<!-- 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. -->
|
187 |
|
188 |
[More Information Needed]
|
|
|
236 |
|
237 |
#### Summary
|
238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
## Citation [optional]
|
240 |
|
241 |
+
Arxiv : https://arxiv.org/abs/2402.10373
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
|
243 |
+
@misc{labrak2024biomistral,
|
244 |
+
title={BioMistral: A Collection of Open-Source Pretrained Large Language Models for Medical Domains},
|
245 |
+
author={Yanis Labrak and Adrien Bazoge and Emmanuel Morin and Pierre-Antoine Gourraud and Mickael Rouvier and Richard Dufour},
|
246 |
+
year={2024},
|
247 |
+
eprint={2402.10373},
|
248 |
+
archivePrefix={arXiv},
|
249 |
+
primaryClass={cs.CL}
|
250 |
+
}
|