youjunhyeok
commited on
Commit
•
21e8c9e
1
Parent(s):
bf47ceb
Update README.md
Browse files
README.md
CHANGED
@@ -1,201 +1,135 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
library_name: transformers
|
3 |
license: apache-2.0
|
|
|
4 |
tags:
|
5 |
- llama-factory
|
6 |
---
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
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 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
#### Metrics
|
124 |
-
|
125 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
126 |
-
|
127 |
-
[More Information Needed]
|
128 |
-
|
129 |
-
### Results
|
130 |
-
|
131 |
-
[More Information Needed]
|
132 |
-
|
133 |
-
#### Summary
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
## Model Examination [optional]
|
138 |
-
|
139 |
-
<!-- Relevant interpretability work for the model goes here -->
|
140 |
-
|
141 |
-
[More Information Needed]
|
142 |
-
|
143 |
-
## Environmental Impact
|
144 |
-
|
145 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
146 |
-
|
147 |
-
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).
|
148 |
-
|
149 |
-
- **Hardware Type:** [More Information Needed]
|
150 |
-
- **Hours used:** [More Information Needed]
|
151 |
-
- **Cloud Provider:** [More Information Needed]
|
152 |
-
- **Compute Region:** [More Information Needed]
|
153 |
-
- **Carbon Emitted:** [More Information Needed]
|
154 |
-
|
155 |
-
## Technical Specifications [optional]
|
156 |
-
|
157 |
-
### Model Architecture and Objective
|
158 |
-
|
159 |
-
[More Information Needed]
|
160 |
-
|
161 |
-
### Compute Infrastructure
|
162 |
-
|
163 |
-
[More Information Needed]
|
164 |
-
|
165 |
-
#### Hardware
|
166 |
-
|
167 |
-
[More Information Needed]
|
168 |
-
|
169 |
-
#### Software
|
170 |
-
|
171 |
-
[More Information Needed]
|
172 |
-
|
173 |
-
## Citation [optional]
|
174 |
-
|
175 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
176 |
-
|
177 |
-
**BibTeX:**
|
178 |
-
|
179 |
-
[More Information Needed]
|
180 |
-
|
181 |
-
**APA:**
|
182 |
-
|
183 |
-
[More Information Needed]
|
184 |
-
|
185 |
-
## Glossary [optional]
|
186 |
-
|
187 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
188 |
-
|
189 |
-
[More Information Needed]
|
190 |
-
|
191 |
-
## More Information [optional]
|
192 |
-
|
193 |
-
[More Information Needed]
|
194 |
-
|
195 |
-
## Model Card Authors [optional]
|
196 |
-
|
197 |
-
[More Information Needed]
|
198 |
-
|
199 |
-
## Model Card Contact
|
200 |
-
|
201 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
+
datasets:
|
3 |
+
- jojo0217/korean_rlhf_dataset
|
4 |
+
- jojo0217/korean_safe_conversation
|
5 |
+
- HAERAE-HUB/qarv-instruct-ko
|
6 |
+
- HAERAE-HUB/Korean-Human-Judgements
|
7 |
+
- HAERAE-HUB/K2-Feedback
|
8 |
+
- changpt/ko-lima-vicuna
|
9 |
+
- maywell/kiqu_samples
|
10 |
+
- CarrotAI/ko-instruction-dataset
|
11 |
+
- 4n3mone/vector_bench
|
12 |
+
- youjunhyeok/llama3_train
|
13 |
+
language:
|
14 |
+
- ko
|
15 |
library_name: transformers
|
16 |
license: apache-2.0
|
17 |
+
pipeline_tag: text-generation
|
18 |
tags:
|
19 |
- llama-factory
|
20 |
---
|
21 |
|
22 |
+
## Model
|
23 |
+
- base model: [THUDM/glm-4v-9b](https://huggingface.co/THUDM/glm-4v-9b)
|
24 |
+
|
25 |
+
## Dataset
|
26 |
+
- [jojo0217/korean_rlhf_dataset](https://huggingface.co/datasets/jojo0217/korean_rlhf_dataset)
|
27 |
+
- [jojo0217/korean_safe_conversation](https://huggingface.co/datasets/jojo0217/korean_safe_conversation)
|
28 |
+
- [HAERAE-HUB/qarv-instruct-ko](https://huggingface.co/datasets/HAERAE-HUB/qarv-instruct-ko)
|
29 |
+
- [HAERAE-HUB/Korean-Human-Judgements](https://huggingface.co/datasets/HAERAE-HUB/Korean-Human-Judgements)
|
30 |
+
- [HAERAE-HUB/K2-Feedback](https://huggingface.co/datasets/HAERAE-HUB/K2-Feedback)
|
31 |
+
- [changpt/ko-lima-vicuna](https://huggingface.co/datasets/changpt/ko-lima-vicuna)
|
32 |
+
- [maywell/kiqu_samples](https://huggingface.co/datasets/maywell/kiqu_samples)
|
33 |
+
- [CarrotAI/ko-instruction-dataset](https://huggingface.co/datasets/CarrotAI/ko-instruction-dataset)
|
34 |
+
- [4n3mone/vector_bench](https://huggingface.co/datasets/4n3mone/vector_bench)
|
35 |
+
- [youjunhyeok/llama3_train](https://huggingface.co/datasets/youjunhyeok/llama3_train)
|
36 |
+
|
37 |
+
## Load Model
|
38 |
+
|
39 |
+
Use the following Python code to load the model:
|
40 |
+
|
41 |
+
```python3
|
42 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
43 |
+
|
44 |
+
path = 'youjunhyeok/solar-ko-recovery-11b-chat-v1'
|
45 |
+
|
46 |
+
model = AutoModelForCausalLM.from_pretrained(path)
|
47 |
+
tokenizer = AutoTokenizer.from_pretrained(path)
|
48 |
+
model.to('cuda')
|
49 |
+
```
|
50 |
+
|
51 |
+
## Chat
|
52 |
+
|
53 |
+
```python3
|
54 |
+
def chat(message):
|
55 |
+
messages = [
|
56 |
+
{"role": "system", "content": "당신은 인공지능 어시스턴트입니다. 친절하고 상세한 답변을 해주세요."},
|
57 |
+
{"role": "user", "content": message},
|
58 |
+
]
|
59 |
+
|
60 |
+
input_ids = tokenizer.apply_chat_template(
|
61 |
+
messages,
|
62 |
+
add_generation_prompt=True,
|
63 |
+
tokenize=True,
|
64 |
+
return_tensors="pt"
|
65 |
+
).to(model.device)
|
66 |
+
|
67 |
+
outputs = model.generate(
|
68 |
+
input_ids,
|
69 |
+
max_new_tokens=1024,
|
70 |
+
do_sample=True,
|
71 |
+
temperature=0.9,
|
72 |
+
top_p=0.95,
|
73 |
+
)
|
74 |
+
response = outputs[0][input_ids.shape[-1]:]
|
75 |
+
print(tokenizer.decode(response, skip_special_tokens=True))
|
76 |
+
|
77 |
+
chat('태양의 흑점 폭발에 대해 설명해줘.')
|
78 |
+
|
79 |
+
```
|
80 |
+
|
81 |
+
## Output
|
82 |
+
|
83 |
+
```
|
84 |
+
넵! 태양의 흑점 폭발에 대해 설명해드리겠습니다.
|
85 |
+
태양의 흑점 폭발은 태양의 표면에 있는 흑점이 폭발하여 생기는 현상입니다.
|
86 |
+
흑점은 태양의 자기장이 강한 부분으로, 그 부위의 자기장이 폭발하면서 에너지를 방출하는 것이지요.
|
87 |
+
이 폭발은 태양의 에너지 변화로 이어져 지구에 다양한 영향을 미칠 수 있습니다.
|
88 |
+
예를 들어, 지구의 통신 시스템에 교란을 일으키거나 GPS 등의 장비에 오류가 발생할 수 있습니다.
|
89 |
+
또한, 태양에서 방출된 에너지가 지구에 도달하여 오로라를 발생시키기도 하지요.
|
90 |
+
따라서, 태양의 흑점 폭발은 태양의 활동성과 관련이 깊으며, 태양의 자기장 변화를 연구하는 데에도 중요한 지표가 됩니다.
|
91 |
+
더 궁금하신 점이 있으면 언제든지 말씀해 주세요!
|
92 |
+
```
|
93 |
+
|
94 |
+
|
95 |
+
## Llama_factory Train Config
|
96 |
+
{data_dir}, {dataset_name}, {output_dir} is variable
|
97 |
+
```
|
98 |
+
bf16: true
|
99 |
+
cutoff_len: 2048
|
100 |
+
dataset: k2-feedback,kiqu_samples,ko_lima_vicuna,ko-instruction-data,korean-human-judgements,rlhf_dataset,safe_conversation,qarv-instruct-ko,vector_bench,llama3_train
|
101 |
+
dataset_dir: {data_dir}
|
102 |
+
ddp_timeout: 180000000
|
103 |
+
do_train: true
|
104 |
+
eval_steps: 250
|
105 |
+
eval_strategy: steps
|
106 |
+
finetuning_type: lora
|
107 |
+
flash_attn: auto
|
108 |
+
gradient_accumulation_steps: 4
|
109 |
+
include_num_input_tokens_seen: true
|
110 |
+
learning_rate: 1.0e-06
|
111 |
+
logging_steps: 5
|
112 |
+
lora_alpha: 16
|
113 |
+
lora_dropout: 0.05
|
114 |
+
lora_rank: 16
|
115 |
+
lora_target: all
|
116 |
+
lr_scheduler_type: inverse_sqrt
|
117 |
+
max_grad_norm: 1.0
|
118 |
+
max_samples: 100000
|
119 |
+
model_name_or_path: beomi/Solar-Ko-Recovery-11B
|
120 |
+
num_train_epochs: 2.0
|
121 |
+
optim: adamw_torch
|
122 |
+
output_dir: saves/SOLAR-10.7B/lora/solar-ko-recovery-instruct-v2
|
123 |
+
packing: false
|
124 |
+
per_device_eval_batch_size: 8
|
125 |
+
per_device_train_batch_size: 8
|
126 |
+
plot_loss: true
|
127 |
+
preprocessing_num_workers: 16
|
128 |
+
report_to: none
|
129 |
+
save_steps: 250
|
130 |
+
stage: sft
|
131 |
+
template: solar
|
132 |
+
val_size: 0.05
|
133 |
+
warmup_steps: 250
|
134 |
+
|
135 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|