Commit
•
0b27ca7
1
Parent(s):
187f1bf
Update README.md
Browse files
README.md
CHANGED
@@ -6,16 +6,14 @@ language:
|
|
6 |
- ja
|
7 |
metrics:
|
8 |
- accuracy
|
|
|
9 |
---
|
10 |
|
11 |
# JMedLLM-7B-v1
|
12 |
|
13 |
⚠️ Do not use it for medical purposes. Only for research purposes.
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
|
20 |
|
21 |
## Model Details
|
@@ -26,21 +24,20 @@ metrics:
|
|
26 |
|
27 |
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
28 |
|
29 |
-
- **Developed by:**
|
30 |
-
- **Funded by [optional]:**
|
31 |
-
- **Shared by [optional]:**
|
32 |
-
- **
|
33 |
-
- **
|
34 |
-
- **
|
35 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
36 |
|
37 |
-
### Model Sources
|
38 |
|
39 |
<!-- Provide the basic links for the model. -->
|
40 |
|
41 |
-
- **Repository:** [
|
42 |
-
- **Paper
|
43 |
-
- **Demo
|
44 |
|
45 |
## Uses
|
46 |
|
@@ -50,37 +47,65 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
50 |
|
51 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
### Downstream Use [optional]
|
56 |
-
|
57 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
58 |
-
|
59 |
-
[More Information Needed]
|
60 |
|
61 |
### Out-of-Scope Use
|
62 |
|
63 |
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
64 |
|
65 |
-
|
66 |
|
67 |
## Bias, Risks, and Limitations
|
68 |
|
69 |
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
78 |
|
79 |
## How to Get Started with the Model
|
80 |
|
81 |
Use the code below to get started with the model.
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
## Training Details
|
86 |
|
@@ -88,125 +113,44 @@ Use the code below to get started with the model.
|
|
88 |
|
89 |
<!-- 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. -->
|
90 |
|
91 |
-
|
|
|
92 |
|
93 |
### Training Procedure
|
94 |
|
95 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
[More Information Needed]
|
100 |
|
101 |
|
102 |
#### Training Hyperparameters
|
103 |
|
104 |
-
- **Training regime:**
|
105 |
|
106 |
-
####
|
107 |
|
108 |
-
|
|
|
109 |
|
110 |
-
[More Information Needed]
|
111 |
|
112 |
## Evaluation
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
### Testing Data, Factors & Metrics
|
117 |
-
|
118 |
-
#### Testing Data
|
119 |
-
|
120 |
-
<!-- This should link to a Dataset Card if possible. -->
|
121 |
-
|
122 |
-
[More Information Needed]
|
123 |
-
|
124 |
-
#### Factors
|
125 |
-
|
126 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
127 |
-
|
128 |
-
[More Information Needed]
|
129 |
-
|
130 |
-
#### Metrics
|
131 |
-
|
132 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
133 |
-
|
134 |
-
[More Information Needed]
|
135 |
-
|
136 |
-
### Results
|
137 |
-
|
138 |
-
[More Information Needed]
|
139 |
-
|
140 |
-
#### Summary
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
## Model Examination [optional]
|
145 |
-
|
146 |
-
<!-- Relevant interpretability work for the model goes here -->
|
147 |
-
|
148 |
-
[More Information Needed]
|
149 |
-
|
150 |
-
## Environmental Impact
|
151 |
-
|
152 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
153 |
-
|
154 |
-
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).
|
155 |
-
|
156 |
-
- **Hardware Type:** [More Information Needed]
|
157 |
-
- **Hours used:** [More Information Needed]
|
158 |
-
- **Cloud Provider:** [More Information Needed]
|
159 |
-
- **Compute Region:** [More Information Needed]
|
160 |
-
- **Carbon Emitted:** [More Information Needed]
|
161 |
|
162 |
## Technical Specifications [optional]
|
163 |
|
164 |
-
### Model Architecture
|
165 |
|
166 |
-
|
167 |
|
168 |
### Compute Infrastructure
|
169 |
|
170 |
-
|
171 |
-
|
172 |
-
#### Hardware
|
173 |
-
|
174 |
-
[More Information Needed]
|
175 |
|
176 |
#### Software
|
177 |
|
178 |
-
[
|
179 |
-
|
180 |
-
## Citation [optional]
|
181 |
-
|
182 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
183 |
-
|
184 |
-
**BibTeX:**
|
185 |
-
|
186 |
-
[More Information Needed]
|
187 |
-
|
188 |
-
**APA:**
|
189 |
-
|
190 |
-
[More Information Needed]
|
191 |
-
|
192 |
-
## Glossary [optional]
|
193 |
-
|
194 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
195 |
-
|
196 |
-
[More Information Needed]
|
197 |
-
|
198 |
-
## More Information [optional]
|
199 |
-
|
200 |
-
[More Information Needed]
|
201 |
-
|
202 |
-
## Model Card Authors [optional]
|
203 |
-
|
204 |
-
[More Information Needed]
|
205 |
-
|
206 |
-
## Model Card Contact
|
207 |
-
|
208 |
-
[More Information Needed]
|
209 |
-
|
210 |
|
211 |
|
212 |
# Acknowledgement
|
|
|
6 |
- ja
|
7 |
metrics:
|
8 |
- accuracy
|
9 |
+
license: cc-by-nc-sa-4.0
|
10 |
---
|
11 |
|
12 |
# JMedLLM-7B-v1
|
13 |
|
14 |
⚠️ Do not use it for medical purposes. Only for research purposes.
|
15 |
|
16 |
+
This model is a Japanese medical LLM based on QWen2-7B-Instruct.
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
## Model Details
|
|
|
24 |
|
25 |
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
26 |
|
27 |
+
- **Developed by:** stardust-coder
|
28 |
+
- **Funded by [optional]:** AIST KAKUSEI(2023)
|
29 |
+
- **Shared by [optional]:** stardust-coder
|
30 |
+
- **Language(s) (NLP):** Japanese
|
31 |
+
- **License:** cc-by-nc-sa-4.0
|
32 |
+
- **Finetuned from model [optional]:** QWen2-7B-Instruct
|
|
|
33 |
|
34 |
+
### Model Sources
|
35 |
|
36 |
<!-- Provide the basic links for the model. -->
|
37 |
|
38 |
+
- **Repository:** [stardust-coder/jmedllm-7b-v1](https://huggingface.co/stardust-coder/jmedllm-7b-v1)
|
39 |
+
- **Paper:** Coming soon...
|
40 |
+
- **Demo:** None
|
41 |
|
42 |
## Uses
|
43 |
|
|
|
47 |
|
48 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
49 |
|
50 |
+
- Ask benchmark medical questions like medical license exams.
|
51 |
+
- Further research purposes.
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
### Out-of-Scope Use
|
54 |
|
55 |
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
56 |
|
57 |
+
Any medical uses.
|
58 |
|
59 |
## Bias, Risks, and Limitations
|
60 |
|
61 |
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
62 |
|
63 |
+
This model carries risks with use.
|
64 |
+
Evauation is only conducted with [IgakuQA](https://github.com/jungokasai/IgakuQA) in English and Japanese, and has not covered, nor could it cover all scenarios.
|
65 |
+
Its potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts.
|
66 |
+
This model is not designed for any medical uses.
|
67 |
+
Those who download this model should perform safety testing and tuning before any usage.
|
68 |
+
Users (both direct and downstream) should be aware of the risks, biases and limitations of the model.
|
|
|
69 |
|
70 |
## How to Get Started with the Model
|
71 |
|
72 |
Use the code below to get started with the model.
|
73 |
+
```python
|
74 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
75 |
+
from peft import PeftModel
|
76 |
+
import torch
|
77 |
+
import argparse
|
78 |
+
|
79 |
+
def get_args():
|
80 |
+
parser = argparse.ArgumentParser()
|
81 |
+
parser.add_argument("--base_model", type=str)
|
82 |
+
parser.add_argument("--peft_model", type=str)
|
83 |
+
return parser.parse_args()
|
84 |
+
|
85 |
+
def main():
|
86 |
+
args = get_args()
|
87 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
88 |
+
args.base_model,
|
89 |
+
return_dict=True,
|
90 |
+
torch_dtype=torch.float16,
|
91 |
+
device_map="auto",
|
92 |
+
)
|
93 |
+
tokenizer = AutoTokenizer.from_pretrained(args.base_model)
|
94 |
+
model = PeftModel.from_pretrained(base_model, args.peft_model, device_map="auto")
|
95 |
+
|
96 |
+
prompt = "hoge"
|
97 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(model.device)
|
98 |
+
with torch.no_grad():
|
99 |
+
generated_tokens = model.generate(
|
100 |
+
inputs=input_ids,
|
101 |
+
do_sample=False,
|
102 |
+
)[0]
|
103 |
+
generated_text = tokenizer.decode(generated_tokens)
|
104 |
+
print(generated_text)
|
105 |
+
|
106 |
+
if __name__ == "__main__" :
|
107 |
+
main()
|
108 |
+
```
|
109 |
|
110 |
## Training Details
|
111 |
|
|
|
113 |
|
114 |
<!-- 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. -->
|
115 |
|
116 |
+
1. Naika-Text : collected from a medical journal (not made public)
|
117 |
+
2. USMLEJP(train split) : translated into Japanese by hand (not made public)
|
118 |
|
119 |
### Training Procedure
|
120 |
|
121 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
122 |
|
123 |
+
1. Full parameter, 5 epoch
|
124 |
+
2. LoRA, 5 epoch
|
|
|
125 |
|
126 |
|
127 |
#### Training Hyperparameters
|
128 |
|
129 |
+
- **Training regime:** dtype = AUTO, LoRA target modules = ALL <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
130 |
|
131 |
+
#### Train run time
|
132 |
|
133 |
+
1. 'train_runtime': 27214.5232, 'epoch': 5, 'global_step': 1890
|
134 |
+
2. 'train_runtime': 102718.0035, 'epoch': 5, 'global_step': 3145
|
135 |
|
|
|
136 |
|
137 |
## Evaluation
|
138 |
|
139 |
+
Coming soon...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
## Technical Specifications [optional]
|
142 |
|
143 |
+
### Model Architecture
|
144 |
|
145 |
+
QWen2-7B
|
146 |
|
147 |
### Compute Infrastructure
|
148 |
|
149 |
+
G.large x 1 in ABCI
|
|
|
|
|
|
|
|
|
150 |
|
151 |
#### Software
|
152 |
|
153 |
+
[MS-SWIFT](https://github.com/modelscope/swift)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
|
156 |
# Acknowledgement
|