Model save
Browse files
README.md
CHANGED
@@ -11,107 +11,49 @@ model-index:
|
|
11 |
results: []
|
12 |
---
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
input_text = "์ํํธ ์ฌ๊ฑด์ถ์ ๋ํด ์๋ ค์ค."
|
54 |
-
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
|
55 |
-
|
56 |
-
outputs = model.generate(**input_ids, max_new_tokens=512)
|
57 |
-
print(tokenizer.decode(outputs[0]))
|
58 |
-
```
|
59 |
-
|
60 |
-
### Inference on GPU with embedded function example
|
61 |
-
๋ด์ฅ๋ ํจ์๋ก ๋ค์ด๋ฒ ๊ฒ์ API๋ฅผ ํตํด RAG๋ฅผ ์ง์๋ฐ์ต๋๋ค.
|
62 |
-
```python
|
63 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
64 |
-
from utils import generate
|
65 |
-
|
66 |
-
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it")
|
67 |
-
model = AutoModelForCausalLM.from_pretrained(
|
68 |
-
"aiqwe/gemma-2b-it-example-v1",
|
69 |
-
device_map="cuda",
|
70 |
-
torch_dtype=torch.bfloat16,
|
71 |
-
attn_implementation="flash_attention_2"
|
72 |
-
)
|
73 |
-
|
74 |
-
rag_config = {
|
75 |
-
"api_client_id": userdata.get('NAVER_API_ID'),
|
76 |
-
"api_client_secret": userdata.get('NAVER_API_SECRET')
|
77 |
-
}
|
78 |
-
completion = generate(
|
79 |
-
model=model,
|
80 |
-
tokenizer=tokenizer,
|
81 |
-
query=query,
|
82 |
-
max_new_tokens=512,
|
83 |
-
rag=True,
|
84 |
-
rag_config=rag_config
|
85 |
-
)
|
86 |
-
print(completion)
|
87 |
-
```
|
88 |
-
|
89 |
-
## Chat Template
|
90 |
-
Gemma ๋ชจ๋ธ์ Chat Template์ ์ฌ์ฉํฉ๋๋ค.
|
91 |
-
[gemma-2b-it Chat Template](https://huggingface.co/google/gemma-2b-it#chat-template)
|
92 |
-
|
93 |
-
## Training Spec
|
94 |
-
ํ์ต์ ๊ตฌ๊ธ ์ฝ๋ฉ L4 Single GPU๋ฅผ ํ์ฉํ์์ต๋๋ค.
|
95 |
-
|
96 |
-
| ๊ตฌ๋ถ | ๋ด์ฉ |
|
97 |
-
|---------------|---------------------|
|
98 |
-
| ํ์ต ํ๊ฒฝ | Google Colab |
|
99 |
-
| GPU | L4(22.5GB) |
|
100 |
-
| ํ์ต์ VRAM | ์ฝ 17GB ์ฌ์ฉ |
|
101 |
-
| dtype | bfloat16 |
|
102 |
-
| Attention | flash attention2 |
|
103 |
-
| Tuning | Lora(r=4, alpha=32) |
|
104 |
-
| Learning Rate | 5e-5 |
|
105 |
-
| LRScheduler | Cosine |
|
106 |
-
| Optimizer | adamw_torch_fused |
|
107 |
|
108 |
### Framework versions
|
109 |
|
110 |
- PEFT 0.10.0
|
111 |
- Transformers 4.40.1
|
112 |
- Pytorch 2.2.1+cu121
|
113 |
-
- Datasets 2.19.
|
114 |
-
- Tokenizers 0.19.1
|
115 |
-
|
116 |
-
## Github Profile
|
117 |
-
Github : https://github.com/aiqwe
|
|
|
11 |
results: []
|
12 |
---
|
13 |
|
14 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
15 |
+
should probably proofread and complete it, then remove this comment. -->
|
16 |
+
|
17 |
+
# gemma-2b-it-example-v1
|
18 |
+
|
19 |
+
This model is a fine-tuned version of [google/gemma-1.1-2b-it](https://huggingface.co/google/gemma-1.1-2b-it) on an unknown dataset.
|
20 |
+
|
21 |
+
## Model description
|
22 |
+
|
23 |
+
More information needed
|
24 |
+
|
25 |
+
## Intended uses & limitations
|
26 |
+
|
27 |
+
More information needed
|
28 |
+
|
29 |
+
## Training and evaluation data
|
30 |
+
|
31 |
+
More information needed
|
32 |
+
|
33 |
+
## Training procedure
|
34 |
+
|
35 |
+
### Training hyperparameters
|
36 |
+
|
37 |
+
The following hyperparameters were used during training:
|
38 |
+
- learning_rate: 5e-05
|
39 |
+
- train_batch_size: 8
|
40 |
+
- eval_batch_size: 8
|
41 |
+
- seed: 42
|
42 |
+
- gradient_accumulation_steps: 2
|
43 |
+
- total_train_batch_size: 16
|
44 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
45 |
+
- lr_scheduler_type: cosine
|
46 |
+
- lr_scheduler_warmup_ratio: 0.05
|
47 |
+
- num_epochs: 20
|
48 |
+
|
49 |
+
### Training results
|
50 |
+
|
51 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
### Framework versions
|
54 |
|
55 |
- PEFT 0.10.0
|
56 |
- Transformers 4.40.1
|
57 |
- Pytorch 2.2.1+cu121
|
58 |
+
- Datasets 2.19.1
|
59 |
+
- Tokenizers 0.19.1
|
|
|
|
|
|