Create README.md
Browse files
README.md
CHANGED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### Model Card for Model ID
|
2 |
+
base_model : [google/gemma-7b-it](https://huggingface.co/google/gemma-7b-it)
|
3 |
+
|
4 |
+
### Basic usage
|
5 |
+
```python
|
6 |
+
# pip install accelerate
|
7 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
8 |
+
import torch
|
9 |
+
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained("MDDDDR/gemma-7b-it-v0.1")
|
11 |
+
model = AutoModelForCausalLM.from_pretrained(
|
12 |
+
"MDDDDR/gemma-7b-it-v0.1",
|
13 |
+
device_map="auto",
|
14 |
+
torch_dtype=torch.bfloat16
|
15 |
+
)
|
16 |
+
|
17 |
+
input_text = "사과가 뭐야?"
|
18 |
+
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
|
19 |
+
|
20 |
+
outputs = model.generate(**input_ids)
|
21 |
+
print(tokenizer.decode(outputs[0]))
|
22 |
+
```
|
23 |
+
|
24 |
+
### Training dataset
|
25 |
+
dataset : [sean0042/KorMedMCQA](https://huggingface.co/datasets/sean0042/KorMedMCQA)
|
26 |
+
|
27 |
+
### lora_config and bnb_config in Training
|
28 |
+
```python
|
29 |
+
bnd_config = BitsAndBytesConfig(
|
30 |
+
load_in_4bit = True,
|
31 |
+
bnb_4bit_use_double_quant = True,
|
32 |
+
bnb_4bit_quant_type = 'nf4',
|
33 |
+
bnb_4bit_compute_dtype = torch.bfloat16
|
34 |
+
)
|
35 |
+
|
36 |
+
lora_config = LoraConfig(
|
37 |
+
r = 32,
|
38 |
+
lora_alpha = 32,
|
39 |
+
lora_dropout = 0.05,
|
40 |
+
target_modules = ['q_proj', 'k_proj', 'v_proj', 'o_proj', 'gate_proj', 'up_proj', 'down_proj']
|
41 |
+
)
|
42 |
+
```
|
43 |
+
|
44 |
+
### Hardware
|
45 |
+
A100 40GB x 1
|