Update README.md
Browse files
README.md
CHANGED
@@ -15,192 +15,82 @@ The **Llama-3-instruction-constructionsafety-layertuning** model is a fine-tuned
|
|
15 |
Llama-3-instruction-constructionsafety-layertuning model is contined pretrained model based on beomi/Llama-3-KoEn-8B-Instruction-preview.
|
16 |
|
17 |
The training was conducted based on the QA datasets and RAW data of Constrution Safety Guidelines provided by the Korea Ocuupational Safety and Health Agency(KOSHA).
|
18 |
-
The training was conducted using full parameter tuning, utilizing 2xA100GPU(80GB). Approximately 11,000 data were used for the training process.
|
19 |
-
|
20 |
-
|
21 |
-
### Model Description
|
22 |
-
|
23 |
-
<!-- Provide a longer summary of what this model is. -->
|
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:** [More Information Needed]
|
28 |
-
- **Funded by [optional]:** [More Information Needed]
|
29 |
-
- **Shared by [optional]:** [More Information Needed]
|
30 |
-
- **Model type:** [More Information Needed]
|
31 |
-
- **Language(s) (NLP):** [More Information Needed]
|
32 |
-
- **License:** [More Information Needed]
|
33 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
34 |
-
|
35 |
-
### Model Sources [optional]
|
36 |
-
|
37 |
-
<!-- Provide the basic links for the model. -->
|
38 |
-
|
39 |
-
- **Repository:** [More Information Needed]
|
40 |
-
- **Paper [optional]:** [More Information Needed]
|
41 |
-
- **Demo [optional]:** [More Information Needed]
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
46 |
-
|
47 |
-
### Direct Use
|
48 |
-
|
49 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
50 |
-
|
51 |
-
[More Information Needed]
|
52 |
-
|
53 |
-
### Downstream Use [optional]
|
54 |
|
55 |
-
|
56 |
|
57 |
-
[More Information Needed]
|
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 |
-
## Training Details
|
84 |
|
85 |
### Training Data
|
86 |
-
|
87 |
<!-- 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. -->
|
88 |
|
89 |
-
[More Information Needed]
|
90 |
-
|
91 |
-
### Training Procedure
|
92 |
-
|
93 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
94 |
-
|
95 |
-
#### Preprocessing [optional]
|
96 |
-
|
97 |
-
[More Information Needed]
|
98 |
-
|
99 |
-
|
100 |
-
#### Training Hyperparameters
|
101 |
-
|
102 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
103 |
-
|
104 |
-
#### Speeds, Sizes, Times [optional]
|
105 |
-
|
106 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
107 |
-
|
108 |
-
[More Information Needed]
|
109 |
-
|
110 |
-
## Evaluation
|
111 |
-
|
112 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
113 |
-
|
114 |
-
### Testing Data, Factors & Metrics
|
115 |
-
|
116 |
-
#### Testing Data
|
117 |
-
|
118 |
-
<!-- This should link to a Dataset Card if possible. -->
|
119 |
-
|
120 |
-
[More Information Needed]
|
121 |
-
|
122 |
-
#### Factors
|
123 |
-
|
124 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
125 |
-
|
126 |
-
[More Information Needed]
|
127 |
-
|
128 |
-
#### Metrics
|
129 |
-
|
130 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
131 |
-
|
132 |
-
[More Information Needed]
|
133 |
-
|
134 |
-
### Results
|
135 |
-
|
136 |
-
[More Information Needed]
|
137 |
-
|
138 |
-
#### Summary
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
## Model Examination [optional]
|
143 |
-
|
144 |
-
<!-- Relevant interpretability work for the model goes here -->
|
145 |
-
|
146 |
-
[More Information Needed]
|
147 |
-
|
148 |
-
## Environmental Impact
|
149 |
-
|
150 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
151 |
-
|
152 |
-
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).
|
153 |
-
|
154 |
-
- **Hardware Type:** [More Information Needed]
|
155 |
-
- **Hours used:** [More Information Needed]
|
156 |
-
- **Cloud Provider:** [More Information Needed]
|
157 |
-
- **Compute Region:** [More Information Needed]
|
158 |
-
- **Carbon Emitted:** [More Information Needed]
|
159 |
-
|
160 |
-
## Technical Specifications [optional]
|
161 |
-
|
162 |
-
### Model Architecture and Objective
|
163 |
-
|
164 |
-
[More Information Needed]
|
165 |
-
|
166 |
-
### Compute Infrastructure
|
167 |
-
|
168 |
-
[More Information Needed]
|
169 |
-
|
170 |
-
#### Hardware
|
171 |
-
|
172 |
-
[More Information Needed]
|
173 |
-
|
174 |
-
#### Software
|
175 |
-
|
176 |
-
[More Information Needed]
|
177 |
-
|
178 |
-
## Citation [optional]
|
179 |
-
|
180 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
181 |
|
182 |
**BibTeX:**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
|
184 |
-
[More Information Needed]
|
185 |
-
|
186 |
-
**APA:**
|
187 |
-
|
188 |
-
[More Information Needed]
|
189 |
-
|
190 |
-
## Glossary [optional]
|
191 |
-
|
192 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
193 |
-
|
194 |
-
[More Information Needed]
|
195 |
-
|
196 |
-
## More Information [optional]
|
197 |
-
|
198 |
-
[More Information Needed]
|
199 |
-
|
200 |
-
## Model Card Authors [optional]
|
201 |
-
|
202 |
-
[More Information Needed]
|
203 |
-
|
204 |
-
## Model Card Contact
|
205 |
-
|
206 |
-
[More Information Needed]
|
|
|
15 |
Llama-3-instruction-constructionsafety-layertuning model is contined pretrained model based on beomi/Llama-3-KoEn-8B-Instruction-preview.
|
16 |
|
17 |
The training was conducted based on the QA datasets and RAW data of Constrution Safety Guidelines provided by the Korea Ocuupational Safety and Health Agency(KOSHA).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
+
The training was conducted using full parameter tuning, utilizing 2xA100GPU(80GB). Approximately 11,000 data were used for the training process.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
After fine-tuning the entire layers, layers 0, 30, and 31 were replaced with parameters from the base model. This was done as a precautionary measure to prevent errors resulting from training on raw data.
|
22 |
|
|
|
23 |
|
24 |
+
## Simple Use
|
25 |
|
26 |
+
```
|
27 |
+
import torch
|
28 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
29 |
|
30 |
+
model_name = "juungwon/Llama-3-instruction-constructionsafety-layertuning"
|
31 |
+
tuned_model = AutoModelForCausalLM.from_pretrained(
|
32 |
+
model_name,
|
33 |
+
token=access_token,
|
34 |
+
torch_dtype="auto",
|
35 |
+
device_map="auto",
|
36 |
+
)
|
37 |
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, token=access_token)
|
39 |
|
40 |
+
tokenizer.pad_token = tokenizer.eos_token
|
41 |
+
pipe = pipeline("text-generation", model=tuned_model, tokenizer = tokenizer, torch_dtype=torch.bfloat16, device_map="auto")
|
42 |
|
43 |
+
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
44 |
+
messages = [
|
45 |
+
{
|
46 |
+
"role": "system",
|
47 |
+
"content": "μΉμ ν 건μ€μμ μ λ¬Έκ°λ‘μ μλλ°©μ μμ²μ μ΅λν 'μμΈνκ³ ' μΉμ νκ² λ΅νμ. λͺ¨λ λλ΅μ νκ΅μ΄(Korean)μΌλ‘ λλ΅ν΄μ€.",
|
48 |
+
},
|
49 |
+
{"role": "user", "content": "νλ§μ΄ κ°μμ€ κ³΅μ¬μ μμ
μ μμ μ‘°μΉμ λν΄μ 10κ°μ§ μ λ μλ €μ£ΌμΈμ."},
|
50 |
+
]
|
51 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
52 |
+
outputs = pipe(prompt, max_new_tokens=1024, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
53 |
+
print(outputs[0]["generated_text"])
|
54 |
|
55 |
+
```
|
56 |
+
## Output
|
57 |
|
58 |
+
```
|
59 |
+
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
60 |
|
61 |
+
μΉμ ν 건μ€μμ μ λ¬Έκ°λ‘μ μλλ°©μ μμ²μ μ΅λν 'μμΈνκ³ ' μΉμ νκ² λ΅νμ. λͺ¨λ λλ΅μ νκ΅μ΄(Korean)μΌλ‘ λλ΅ν΄μ€.<|eot_id|><|start_header_id|>user<|end_header_id|>
|
62 |
|
63 |
+
νλ§μ΄ κ°μμ€ κ³΅μ¬μ μμ
μ μμ μ‘°μΉμ λν΄μ 10κ°μ§ μ λ μλ €μ£ΌμΈμ.<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
64 |
|
65 |
+
1. κ³΅μ¬ μ€μλ νμ₯μ¬λ¬΄μ€μ μ€μΉνμ¬ κ³΅μ¬κ΄λ ¨ κΈ°λ‘, μμ
μ§ν, μμ
μ λκΈ°, μμ κ΅μ‘, μμ μ κ² λ±μ μ
무λ₯Ό μνν μ μμ΄μΌ νλ€. 2. κ³΅μ¬ μ Β·νμλ μ£Όλ³μ μ§λ°μΉ¨ν, μ§νμμ, μ§ν 맀μ€λ¬Ό, μ§νλ©΄μ μ΄μ, μ§λ°μ μ΄μ, μ§νλ©΄μ κ· μ΄, λ
Έλ©΄μ μ΄μ μ 무, λλ‘ μμ€λ¬Ό λ±μ μ΄μ μ 무λ₯Ό νμΈνμ¬μΌ νλ€. 3. μ€κ³λμ, μλ°©μ, μμ 보건κ·μΉ, μμ 보건κ·μΉ λ° κ΄λ ¨λ²κ·, μμ 보건κ·μΉκ³Ό κ΄λ ¨λ μ§μΉ¨, μ°μ
μμ 보건기μ€μ κ΄ν κ·μΉμ κ²ν νμ¬ μμ λμ±
μ μ립νμ¬μΌ νλ€. 4. νλ§μ΄ κ°μμ€ κ³΅μ¬ μμλ μμ
μμ μΆλ½λ°©μ§λ₯Ό μνμ¬ μμ λ, μμ λͺ¨, μμ ν λ± κ°μΈλ³΄νΈκ΅¬λ₯Ό μ°©μ©νμ¬μΌ νλ€. 5. νλ§μ΄ κ°μμ€ κ³΅μ¬ μμλ 근골격κ³μ§ν μλ°©μ μνμ¬ μ μ ν ν΄μμκ°μ μ 곡νμ¬μΌ νλ€. 6. νλ§μ΄ κ°μμ€ κ³΅μ¬ μμλ μμ
μμ 건κ°κ΄λ¦¬λ₯Ό μνμ¬ μμ
νκ²½μ κ°μ νκ³ μ μ ν ν΄μ곡κ°μ λ§λ ¨νμ¬μΌ νλ€. 7. νλ§μ΄ κ°μμ€ κ³΅μ¬ μμλ μμ
μμ μ°μ
μ¬ν΄ μλ°©μ μνμ¬ μμ κ΅μ‘, μμ μμ€, μμ μ₯λΉλ₯Ό λ§λ ¨νμ¬μΌ νλ€. 8. νλ§μ΄ κ°μμ€ κ³΅μ¬ μμλ μμ
μμ μμ μ μνμ¬ μμ μμ
κ³νμ μ립νμ¬μΌ νλ€. 9. νλ§μ΄ κ°μμ€ κ³΅μ¬ μμλ μμ
μμ μμ μ μνμ¬ ν μ§, μ§νμμ, ν μΈ΅, 맀μ€λ¬Ό, μΈμ ꡬ쑰물, μ§νμμ, μ§νλ©΄μ μ΄μ μ 무, λλ‘ μμ€λ¬Ό λ±μ μ΄μ μ 무λ₯Ό νμΈνμ¬μΌ νλ€. 10. νλ§μ΄ κ°μμ€ κ³΅μ¬ μμλ μμ
μμ μμ μ μνμ¬ μμ
μ 1μΈλΉ 1κ°μ μμ λͺ¨, μμ ν, μμ λ λ± κ°μΈλ³΄νΈκ΅¬λ₯Ό μ°©μ©νμ¬μΌ νλ€.
|
66 |
|
67 |
+
```
|
68 |
|
|
|
69 |
|
70 |
### Training Data
|
71 |
+
Training Data will be provided upon requests.
|
72 |
<!-- 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. -->
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
**BibTeX:**
|
76 |
+
@article{llama3cs-layertuning,
|
77 |
+
title={Llama-3-instruction-constructionsafety-layertuning},
|
78 |
+
author={L, Jungwon, A, Seungjun},
|
79 |
+
year={2024},
|
80 |
+
url={https://huggingface.co/juungwon/Llama-3-instruction-constructionsafety-layertuning}
|
81 |
+
}
|
82 |
+
|
83 |
+
@article{llama3koen,
|
84 |
+
title={Llama-3-KoEn},
|
85 |
+
author={L, Junbum},
|
86 |
+
year={2024},
|
87 |
+
url={https://huggingface.co/beomi/Llama-3-KoEn-8B}
|
88 |
+
}
|
89 |
+
|
90 |
+
@article{llama3modelcard,
|
91 |
+
title={Llama 3 Model Card},
|
92 |
+
author={AI@Meta},
|
93 |
+
year={2024},
|
94 |
+
url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
|
95 |
+
}
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|