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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- yahma/alpaca-cleaned
|
4 |
+
---
|
5 |
+
# Model Card for Model ID
|
6 |
+
|
7 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
8 |
+
|
9 |
+
This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
|
10 |
+
|
11 |
+
## Model Details
|
12 |
+
|
13 |
+
Configs
|
14 |
+
```
|
15 |
+
name: llama
|
16 |
+
model:
|
17 |
+
pretrained_model_name_or_path: 'mistralai/Mistral-7B-v0.1'
|
18 |
+
cache_dir: '/juice/scr/scr110/scr/nlp/data/neo/hub/'
|
19 |
+
return_dict: true
|
20 |
+
quantization: false
|
21 |
+
device_map: auto # null
|
22 |
+
low_cpu_mem_usage: true # false
|
23 |
+
torch_dtype: bfloat16
|
24 |
+
attn_implementation: eager # so we can load attention weights
|
25 |
+
rope_theta: 10000.0
|
26 |
+
|
27 |
+
attention:
|
28 |
+
attention_type: hedgehog_llama
|
29 |
+
feature_map: softmax_dim
|
30 |
+
feature_map_kwargs:
|
31 |
+
input_dim: 128
|
32 |
+
eps: 1e-12
|
33 |
+
# mlp: null # to set
|
34 |
+
fullspace: true
|
35 |
+
layer_idx: null # to set
|
36 |
+
learned_kernel: untied_head
|
37 |
+
learned_kernel_kwargs:
|
38 |
+
feature_dim: 128
|
39 |
+
skip_connection: false
|
40 |
+
bias: false
|
41 |
+
zero_init: false
|
42 |
+
tie_qk_kernels: false
|
43 |
+
train_qk: true
|
44 |
+
peft:
|
45 |
+
method: lora
|
46 |
+
kwargs:
|
47 |
+
r: 8 # 256
|
48 |
+
lora_alpha: 16 # 512
|
49 |
+
lora_dropout: 0.1 # 0.05
|
50 |
+
target_modules: ['self_attn.q_proj', 'self_attn.k_proj']
|
51 |
+
|
52 |
+
dataset:
|
53 |
+
name: alpaca_clean
|
54 |
+
dataset_config:
|
55 |
+
name: alpaca
|
56 |
+
path: yahma/alpaca-cleaned
|
57 |
+
chunk_size: 1024 # 2048
|
58 |
+
concat_data: true
|
59 |
+
cache_dir: '/u/scr/nlp/data/alpaca'
|
60 |
+
pretrained_model_config:
|
61 |
+
pretrained_model_name_or_path: 'mistralai/Mistral-7B-v0.1'
|
62 |
+
cache_dir: '/juice/scr/scr110/scr/nlp/data/neo/hub/'
|
63 |
+
preprocess_config: null
|
64 |
+
|
65 |
+
dataloader:
|
66 |
+
batch_size: 1
|
67 |
+
num_workers: 2
|
68 |
+
drop_last: false
|
69 |
+
pin_memory: true
|
70 |
+
|
71 |
+
optimizer:
|
72 |
+
optim: adamw_torch_fused
|
73 |
+
lr: 0.001
|
74 |
+
weight_decay: 0.0
|
75 |
+
|
76 |
+
lr_scheduler:
|
77 |
+
lr_scheduler_type: reduce_lr_on_plateau
|
78 |
+
mode: min
|
79 |
+
factor: 0.1
|
80 |
+
patience: 10
|
81 |
+
min_lr: 0.00001
|
82 |
+
|
83 |
+
trainer: # HuggingFace Trainer-like arguments
|
84 |
+
name: distill_attention
|
85 |
+
token_reduce: true
|
86 |
+
bottom_attention_only: false
|
87 |
+
reverse_kl: false
|
88 |
+
|
89 |
+
bf16: true
|
90 |
+
train_split: train
|
91 |
+
val_split: validation
|
92 |
+
num_train_epochs: 2
|
93 |
+
gradient_accumulation_steps: 8
|
94 |
+
seed: 42
|
95 |
+
batch_size: 1
|
96 |
+
load_best_model_at_end: true
|
97 |
+
greater_is_better: false
|
98 |
+
metric_for_best_model: distill/eval/loss
|
99 |
+
logging_steps: 100
|
100 |
+
evaluation_strategy: steps
|
101 |
+
max_steps: -1
|
102 |
+
eval_steps: 100
|
103 |
+
max_eval_batches: null
|
104 |
+
|
105 |
+
dataset:
|
106 |
+
name: alpaca_clean
|
107 |
+
dataset_config:
|
108 |
+
name: alpaca
|
109 |
+
path: yahma/alpaca-cleaned
|
110 |
+
chunk_size: 1024 # 2048
|
111 |
+
concat_data: true
|
112 |
+
cache_dir: '/u/scr/nlp/data/alpaca'
|
113 |
+
pretrained_model_config:
|
114 |
+
pretrained_model_name_or_path: 'mistralai/Mistral-7B-v0.1'
|
115 |
+
cache_dir: '/juice/scr/scr110/scr/nlp/data/neo/hub/'
|
116 |
+
preprocess_config: null
|
117 |
+
|
118 |
+
dataloader:
|
119 |
+
batch_size: 1
|
120 |
+
num_workers: 2
|
121 |
+
drop_last: false
|
122 |
+
pin_memory: true
|
123 |
+
|
124 |
+
optimizer:
|
125 |
+
optim: adamw_torch_fused
|
126 |
+
lr: 1e-4
|
127 |
+
weight_decay: 0.0
|
128 |
+
|
129 |
+
lr_scheduler:
|
130 |
+
lr_scheduler_type: reduce_lr_on_plateau
|
131 |
+
mode: min
|
132 |
+
factor: 0.1
|
133 |
+
patience: 10
|
134 |
+
min_lr: 0.00001
|
135 |
+
|
136 |
+
trainer: # HuggingFace Trainer-like arguments
|
137 |
+
name: default
|
138 |
+
bf16: true
|
139 |
+
train_split: train
|
140 |
+
val_split: validation
|
141 |
+
num_train_epochs: 2
|
142 |
+
gradient_accumulation_steps: 8
|
143 |
+
seed: 42
|
144 |
+
batch_size: 1
|
145 |
+
load_best_model_at_end: true
|
146 |
+
greater_is_better: false
|
147 |
+
metric_for_best_model: eval/loss # eval/rouge/geometric_mean
|
148 |
+
logging_steps: 100
|
149 |
+
evaluation_strategy: steps
|
150 |
+
max_steps: -1
|
151 |
+
eval_steps: 100
|
152 |
+
max_eval_batches: null
|
153 |
+
|
154 |
+
finetune:
|
155 |
+
method: lora
|
156 |
+
kwargs:
|
157 |
+
r: 8
|
158 |
+
lora_alpha: 16 # 32
|
159 |
+
lora_dropout: 0 # 0.05
|
160 |
+
target_modules: ['q_proj', 'k_proj', 'v_proj', 'o_proj']
|
161 |
+
```
|
162 |
+
|
163 |
+
|
164 |
+
### Model Description
|
165 |
+
|
166 |
+
<!-- Provide a longer summary of what this model is. -->
|
167 |
+
|
168 |
+
|
169 |
+
|
170 |
+
- **Developed by:** [More Information Needed]
|
171 |
+
- **Funded by [optional]:** [More Information Needed]
|
172 |
+
- **Shared by [optional]:** [More Information Needed]
|
173 |
+
- **Model type:** [More Information Needed]
|
174 |
+
- **Language(s) (NLP):** [More Information Needed]
|
175 |
+
- **License:** [More Information Needed]
|
176 |
+
- **Finetuned from model [optional]:** [More Information Needed]
|
177 |
+
|
178 |
+
### Model Sources [optional]
|
179 |
+
|
180 |
+
<!-- Provide the basic links for the model. -->
|
181 |
+
|
182 |
+
- **Repository:** [More Information Needed]
|
183 |
+
- **Paper [optional]:** [More Information Needed]
|
184 |
+
- **Demo [optional]:** [More Information Needed]
|
185 |
+
|
186 |
+
## Uses
|
187 |
+
|
188 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
189 |
+
|
190 |
+
### Direct Use
|
191 |
+
|
192 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
193 |
+
|
194 |
+
[More Information Needed]
|
195 |
+
|
196 |
+
### Downstream Use [optional]
|
197 |
+
|
198 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
199 |
+
|
200 |
+
[More Information Needed]
|
201 |
+
|
202 |
+
### Out-of-Scope Use
|
203 |
+
|
204 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
205 |
+
|
206 |
+
[More Information Needed]
|
207 |
+
|
208 |
+
## Bias, Risks, and Limitations
|
209 |
+
|
210 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
211 |
+
|
212 |
+
[More Information Needed]
|
213 |
+
|
214 |
+
### Recommendations
|
215 |
+
|
216 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
217 |
+
|
218 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
219 |
+
|
220 |
+
## How to Get Started with the Model
|
221 |
+
|
222 |
+
Use the code below to get started with the model.
|
223 |
+
|
224 |
+
[More Information Needed]
|
225 |
+
|
226 |
+
## Training Details
|
227 |
+
|
228 |
+
### Training Data
|
229 |
+
|
230 |
+
<!-- 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. -->
|
231 |
+
|
232 |
+
[More Information Needed]
|
233 |
+
|
234 |
+
### Training Procedure
|
235 |
+
|
236 |
+
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
237 |
+
|
238 |
+
#### Preprocessing [optional]
|
239 |
+
|
240 |
+
[More Information Needed]
|
241 |
+
|
242 |
+
|
243 |
+
#### Training Hyperparameters
|
244 |
+
|
245 |
+
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
246 |
+
|
247 |
+
#### Speeds, Sizes, Times [optional]
|
248 |
+
|
249 |
+
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
250 |
+
|
251 |
+
[More Information Needed]
|
252 |
+
|
253 |
+
## Evaluation
|
254 |
+
|
255 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
256 |
+
|
257 |
+
### Testing Data, Factors & Metrics
|
258 |
+
|
259 |
+
#### Testing Data
|
260 |
+
|
261 |
+
<!-- This should link to a Dataset Card if possible. -->
|
262 |
+
|
263 |
+
[More Information Needed]
|
264 |
+
|
265 |
+
#### Factors
|
266 |
+
|
267 |
+
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
268 |
+
|
269 |
+
[More Information Needed]
|
270 |
+
|
271 |
+
#### Metrics
|
272 |
+
|
273 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
274 |
+
|
275 |
+
[More Information Needed]
|
276 |
+
|
277 |
+
### Results
|
278 |
+
|
279 |
+
[More Information Needed]
|
280 |
+
|
281 |
+
#### Summary
|
282 |
+
|
283 |
+
|
284 |
+
|
285 |
+
## Model Examination [optional]
|
286 |
+
|
287 |
+
<!-- Relevant interpretability work for the model goes here -->
|
288 |
+
|
289 |
+
[More Information Needed]
|
290 |
+
|
291 |
+
## Environmental Impact
|
292 |
+
|
293 |
+
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
294 |
+
|
295 |
+
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).
|
296 |
+
|
297 |
+
- **Hardware Type:** [More Information Needed]
|
298 |
+
- **Hours used:** [More Information Needed]
|
299 |
+
- **Cloud Provider:** [More Information Needed]
|
300 |
+
- **Compute Region:** [More Information Needed]
|
301 |
+
- **Carbon Emitted:** [More Information Needed]
|
302 |
+
|
303 |
+
## Technical Specifications [optional]
|
304 |
+
|
305 |
+
### Model Architecture and Objective
|
306 |
+
|
307 |
+
[More Information Needed]
|
308 |
+
|
309 |
+
### Compute Infrastructure
|
310 |
+
|
311 |
+
[More Information Needed]
|
312 |
+
|
313 |
+
#### Hardware
|
314 |
+
|
315 |
+
[More Information Needed]
|
316 |
+
|
317 |
+
#### Software
|
318 |
+
|
319 |
+
[More Information Needed]
|
320 |
+
|
321 |
+
## Citation [optional]
|
322 |
+
|
323 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
324 |
+
|
325 |
+
**BibTeX:**
|
326 |
+
|
327 |
+
[More Information Needed]
|
328 |
+
|
329 |
+
**APA:**
|
330 |
+
|
331 |
+
[More Information Needed]
|
332 |
+
|
333 |
+
## Glossary [optional]
|
334 |
+
|
335 |
+
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
336 |
+
|
337 |
+
[More Information Needed]
|
338 |
+
|
339 |
+
## More Information [optional]
|
340 |
+
|
341 |
+
[More Information Needed]
|
342 |
+
|
343 |
+
## Model Card Authors [optional]
|
344 |
+
|
345 |
+
[More Information Needed]
|
346 |
+
|
347 |
+
## Model Card Contact
|
348 |
+
|
349 |
+
[More Information Needed]
|