AmberYifan commited on
Commit
c94b9d6
·
verified ·
1 Parent(s): 9295ada

Model save

Browse files
README.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: AmberYifan/Mistral-7B-v0.3-sft-ultrachat
3
+ library_name: transformers
4
+ model_name: Mistral-7B-v0.3-sft-ultrachat-safeRLHF
5
+ tags:
6
+ - generated_from_trainer
7
+ - trl
8
+ - sft
9
+ licence: license
10
+ ---
11
+
12
+ # Model Card for Mistral-7B-v0.3-sft-ultrachat-safeRLHF
13
+
14
+ This model is a fine-tuned version of [AmberYifan/Mistral-7B-v0.3-sft-ultrachat](https://huggingface.co/AmberYifan/Mistral-7B-v0.3-sft-ultrachat).
15
+ It has been trained using [TRL](https://github.com/huggingface/trl).
16
+
17
+ ## Quick start
18
+
19
+ ```python
20
+ from transformers import pipeline
21
+
22
+ question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
23
+ generator = pipeline("text-generation", model="AmberYifan/Mistral-7B-v0.3-sft-ultrachat-safeRLHF", device="cuda")
24
+ output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
25
+ print(output["generated_text"])
26
+ ```
27
+
28
+ ## Training procedure
29
+
30
+
31
+
32
+ This model was trained with SFT.
33
+
34
+ ### Framework versions
35
+
36
+ - TRL: 0.12.2
37
+ - Transformers: 4.46.3
38
+ - Pytorch: 2.5.1+cu118
39
+ - Datasets: 3.2.0
40
+ - Tokenizers: 0.20.3
41
+
42
+ ## Citations
43
+
44
+
45
+
46
+ Cite TRL as:
47
+
48
+ ```bibtex
49
+ @misc{vonwerra2022trl,
50
+ title = {{TRL: Transformer Reinforcement Learning}},
51
+ author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
52
+ year = 2020,
53
+ journal = {GitHub repository},
54
+ publisher = {GitHub},
55
+ howpublished = {\url{https://github.com/huggingface/trl}}
56
+ }
57
+ ```
all_results.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 1.0,
3
+ "total_flos": 12929193738240.0,
4
+ "train_loss": 1.46957281581786,
5
+ "train_runtime": 1664.2063,
6
+ "train_samples": 50301,
7
+ "train_samples_per_second": 4.746,
8
+ "train_steps_per_second": 0.148
9
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "4.46.3"
6
+ }
train_results.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 1.0,
3
+ "total_flos": 12929193738240.0,
4
+ "train_loss": 1.46957281581786,
5
+ "train_runtime": 1664.2063,
6
+ "train_samples": 50301,
7
+ "train_samples_per_second": 4.746,
8
+ "train_steps_per_second": 0.148
9
+ }
trainer_state.json ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 1.0,
5
+ "eval_steps": 500,
6
+ "global_step": 247,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.004048582995951417,
13
+ "grad_norm": 13.330064642581538,
14
+ "learning_rate": 8.000000000000001e-07,
15
+ "loss": 1.9385,
16
+ "step": 1
17
+ },
18
+ {
19
+ "epoch": 0.020242914979757085,
20
+ "grad_norm": 5.939947175837709,
21
+ "learning_rate": 4.000000000000001e-06,
22
+ "loss": 1.8644,
23
+ "step": 5
24
+ },
25
+ {
26
+ "epoch": 0.04048582995951417,
27
+ "grad_norm": 4.3216413283721185,
28
+ "learning_rate": 8.000000000000001e-06,
29
+ "loss": 1.6585,
30
+ "step": 10
31
+ },
32
+ {
33
+ "epoch": 0.06072874493927125,
34
+ "grad_norm": 3.6726967268003663,
35
+ "learning_rate": 1.2e-05,
36
+ "loss": 1.5636,
37
+ "step": 15
38
+ },
39
+ {
40
+ "epoch": 0.08097165991902834,
41
+ "grad_norm": 3.5395303268548055,
42
+ "learning_rate": 1.6000000000000003e-05,
43
+ "loss": 1.5441,
44
+ "step": 20
45
+ },
46
+ {
47
+ "epoch": 0.10121457489878542,
48
+ "grad_norm": 3.3745662946717503,
49
+ "learning_rate": 2e-05,
50
+ "loss": 1.561,
51
+ "step": 25
52
+ },
53
+ {
54
+ "epoch": 0.1214574898785425,
55
+ "grad_norm": 3.4145999647680654,
56
+ "learning_rate": 1.9974977965945e-05,
57
+ "loss": 1.5477,
58
+ "step": 30
59
+ },
60
+ {
61
+ "epoch": 0.1417004048582996,
62
+ "grad_norm": 3.5987577428282123,
63
+ "learning_rate": 1.9900037084217637e-05,
64
+ "loss": 1.5828,
65
+ "step": 35
66
+ },
67
+ {
68
+ "epoch": 0.16194331983805668,
69
+ "grad_norm": 3.275432270529186,
70
+ "learning_rate": 1.9775552389476865e-05,
71
+ "loss": 1.5512,
72
+ "step": 40
73
+ },
74
+ {
75
+ "epoch": 0.18218623481781376,
76
+ "grad_norm": 3.42399668876103,
77
+ "learning_rate": 1.9602146853776894e-05,
78
+ "loss": 1.5506,
79
+ "step": 45
80
+ },
81
+ {
82
+ "epoch": 0.20242914979757085,
83
+ "grad_norm": 3.0319493863000986,
84
+ "learning_rate": 1.938068826896166e-05,
85
+ "loss": 1.5446,
86
+ "step": 50
87
+ },
88
+ {
89
+ "epoch": 0.22267206477732793,
90
+ "grad_norm": 3.1210434260623106,
91
+ "learning_rate": 1.911228490388136e-05,
92
+ "loss": 1.5406,
93
+ "step": 55
94
+ },
95
+ {
96
+ "epoch": 0.242914979757085,
97
+ "grad_norm": 2.9914508124552546,
98
+ "learning_rate": 1.8798279958164295e-05,
99
+ "loss": 1.5289,
100
+ "step": 60
101
+ },
102
+ {
103
+ "epoch": 0.2631578947368421,
104
+ "grad_norm": 3.204722538572153,
105
+ "learning_rate": 1.8440244840299507e-05,
106
+ "loss": 1.5401,
107
+ "step": 65
108
+ },
109
+ {
110
+ "epoch": 0.2834008097165992,
111
+ "grad_norm": 3.1147243057747502,
112
+ "learning_rate": 1.8039971303669407e-05,
113
+ "loss": 1.5122,
114
+ "step": 70
115
+ },
116
+ {
117
+ "epoch": 0.30364372469635625,
118
+ "grad_norm": 3.350754622294628,
119
+ "learning_rate": 1.7599462479886976e-05,
120
+ "loss": 1.5253,
121
+ "step": 75
122
+ },
123
+ {
124
+ "epoch": 0.32388663967611336,
125
+ "grad_norm": 3.0227437711153238,
126
+ "learning_rate": 1.712092285431026e-05,
127
+ "loss": 1.513,
128
+ "step": 80
129
+ },
130
+ {
131
+ "epoch": 0.3441295546558704,
132
+ "grad_norm": 2.898694632209032,
133
+ "learning_rate": 1.6606747233900816e-05,
134
+ "loss": 1.5189,
135
+ "step": 85
136
+ },
137
+ {
138
+ "epoch": 0.3643724696356275,
139
+ "grad_norm": 2.862407919090872,
140
+ "learning_rate": 1.6059508762635482e-05,
141
+ "loss": 1.4922,
142
+ "step": 90
143
+ },
144
+ {
145
+ "epoch": 0.38461538461538464,
146
+ "grad_norm": 2.7545502314496306,
147
+ "learning_rate": 1.54819460444471e-05,
148
+ "loss": 1.5087,
149
+ "step": 95
150
+ },
151
+ {
152
+ "epoch": 0.4048582995951417,
153
+ "grad_norm": 2.779940917288299,
154
+ "learning_rate": 1.4876949438136348e-05,
155
+ "loss": 1.4865,
156
+ "step": 100
157
+ },
158
+ {
159
+ "epoch": 0.4251012145748988,
160
+ "grad_norm": 2.7351259055331902,
161
+ "learning_rate": 1.424754659284048e-05,
162
+ "loss": 1.4641,
163
+ "step": 105
164
+ },
165
+ {
166
+ "epoch": 0.44534412955465585,
167
+ "grad_norm": 2.7031992560589035,
168
+ "learning_rate": 1.359688729644536e-05,
169
+ "loss": 1.4512,
170
+ "step": 110
171
+ },
172
+ {
173
+ "epoch": 0.46558704453441296,
174
+ "grad_norm": 8.916756258638008,
175
+ "learning_rate": 1.2928227712765504e-05,
176
+ "loss": 1.4894,
177
+ "step": 115
178
+ },
179
+ {
180
+ "epoch": 0.48582995951417,
181
+ "grad_norm": 4.296610600782661,
182
+ "learning_rate": 1.2244914086375726e-05,
183
+ "loss": 1.4706,
184
+ "step": 120
185
+ },
186
+ {
187
+ "epoch": 0.5060728744939271,
188
+ "grad_norm": 2.735539829128421,
189
+ "learning_rate": 1.155036599664198e-05,
190
+ "loss": 1.4668,
191
+ "step": 125
192
+ },
193
+ {
194
+ "epoch": 0.5263157894736842,
195
+ "grad_norm": 2.88320021783325,
196
+ "learning_rate": 1.0848059244755093e-05,
197
+ "loss": 1.4391,
198
+ "step": 130
199
+ },
200
+ {
201
+ "epoch": 0.5465587044534413,
202
+ "grad_norm": 2.7000741221149176,
203
+ "learning_rate": 1.0141508459407622e-05,
204
+ "loss": 1.4533,
205
+ "step": 135
206
+ },
207
+ {
208
+ "epoch": 0.5668016194331984,
209
+ "grad_norm": 2.6467423688966245,
210
+ "learning_rate": 9.434249508162076e-06,
211
+ "loss": 1.4278,
212
+ "step": 140
213
+ },
214
+ {
215
+ "epoch": 0.5870445344129555,
216
+ "grad_norm": 3.1187755082536985,
217
+ "learning_rate": 8.729821802531213e-06,
218
+ "loss": 1.4483,
219
+ "step": 145
220
+ },
221
+ {
222
+ "epoch": 0.6072874493927125,
223
+ "grad_norm": 2.6419226226448522,
224
+ "learning_rate": 8.031750585322948e-06,
225
+ "loss": 1.4408,
226
+ "step": 150
227
+ },
228
+ {
229
+ "epoch": 0.6275303643724697,
230
+ "grad_norm": 2.6407581001383935,
231
+ "learning_rate": 7.343529288891239e-06,
232
+ "loss": 1.4166,
233
+ "step": 155
234
+ },
235
+ {
236
+ "epoch": 0.6477732793522267,
237
+ "grad_norm": 2.7267651184883057,
238
+ "learning_rate": 6.668602052579425e-06,
239
+ "loss": 1.4262,
240
+ "step": 160
241
+ },
242
+ {
243
+ "epoch": 0.6680161943319838,
244
+ "grad_norm": 2.6623303396026077,
245
+ "learning_rate": 6.010346486845837e-06,
246
+ "loss": 1.4019,
247
+ "step": 165
248
+ },
249
+ {
250
+ "epoch": 0.6882591093117408,
251
+ "grad_norm": 2.590693399618635,
252
+ "learning_rate": 5.3720567703270135e-06,
253
+ "loss": 1.3975,
254
+ "step": 170
255
+ },
256
+ {
257
+ "epoch": 0.708502024291498,
258
+ "grad_norm": 2.6432168771675117,
259
+ "learning_rate": 4.756927164427685e-06,
260
+ "loss": 1.4022,
261
+ "step": 175
262
+ },
263
+ {
264
+ "epoch": 0.728744939271255,
265
+ "grad_norm": 2.548470851349637,
266
+ "learning_rate": 4.168036027937267e-06,
267
+ "loss": 1.4046,
268
+ "step": 180
269
+ },
270
+ {
271
+ "epoch": 0.7489878542510121,
272
+ "grad_norm": 2.5411503805488307,
273
+ "learning_rate": 3.6083304116701535e-06,
274
+ "loss": 1.4005,
275
+ "step": 185
276
+ },
277
+ {
278
+ "epoch": 0.7692307692307693,
279
+ "grad_norm": 2.5226203469706676,
280
+ "learning_rate": 3.0806113102245395e-06,
281
+ "loss": 1.3827,
282
+ "step": 190
283
+ },
284
+ {
285
+ "epoch": 0.7894736842105263,
286
+ "grad_norm": 2.621236542921664,
287
+ "learning_rate": 2.587519644666001e-06,
288
+ "loss": 1.3835,
289
+ "step": 195
290
+ },
291
+ {
292
+ "epoch": 0.8097165991902834,
293
+ "grad_norm": 2.6155833525581405,
294
+ "learning_rate": 2.1315230462840985e-06,
295
+ "loss": 1.3709,
296
+ "step": 200
297
+ },
298
+ {
299
+ "epoch": 0.8299595141700404,
300
+ "grad_norm": 2.605493543515508,
301
+ "learning_rate": 1.7149035075615795e-06,
302
+ "loss": 1.3617,
303
+ "step": 205
304
+ },
305
+ {
306
+ "epoch": 0.8502024291497976,
307
+ "grad_norm": 2.575872270386264,
308
+ "learning_rate": 1.339745962155613e-06,
309
+ "loss": 1.3822,
310
+ "step": 210
311
+ },
312
+ {
313
+ "epoch": 0.8704453441295547,
314
+ "grad_norm": 2.5712243306858857,
315
+ "learning_rate": 1.0079278510416313e-06,
316
+ "loss": 1.3686,
317
+ "step": 215
318
+ },
319
+ {
320
+ "epoch": 0.8906882591093117,
321
+ "grad_norm": 2.6224297264123373,
322
+ "learning_rate": 7.211097270349065e-07,
323
+ "loss": 1.3685,
324
+ "step": 220
325
+ },
326
+ {
327
+ "epoch": 0.9109311740890689,
328
+ "grad_norm": 2.496616617072913,
329
+ "learning_rate": 4.807269447087348e-07,
330
+ "loss": 1.3757,
331
+ "step": 225
332
+ },
333
+ {
334
+ "epoch": 0.9311740890688259,
335
+ "grad_norm": 2.573961350030146,
336
+ "learning_rate": 2.879824772962381e-07,
337
+ "loss": 1.3759,
338
+ "step": 230
339
+ },
340
+ {
341
+ "epoch": 0.951417004048583,
342
+ "grad_norm": 2.578127235388859,
343
+ "learning_rate": 1.4384089652291544e-07,
344
+ "loss": 1.3767,
345
+ "step": 235
346
+ },
347
+ {
348
+ "epoch": 0.97165991902834,
349
+ "grad_norm": 2.452106055618849,
350
+ "learning_rate": 4.902354549733979e-08,
351
+ "loss": 1.3693,
352
+ "step": 240
353
+ },
354
+ {
355
+ "epoch": 0.9919028340080972,
356
+ "grad_norm": 2.520963888815248,
357
+ "learning_rate": 4.00492881678427e-09,
358
+ "loss": 1.3966,
359
+ "step": 245
360
+ },
361
+ {
362
+ "epoch": 1.0,
363
+ "eval_loss": 1.3552618026733398,
364
+ "eval_runtime": 57.2066,
365
+ "eval_samples_per_second": 23.039,
366
+ "eval_steps_per_second": 0.734,
367
+ "step": 247
368
+ },
369
+ {
370
+ "epoch": 1.0,
371
+ "step": 247,
372
+ "total_flos": 12929193738240.0,
373
+ "train_loss": 1.46957281581786,
374
+ "train_runtime": 1664.2063,
375
+ "train_samples_per_second": 4.746,
376
+ "train_steps_per_second": 0.148
377
+ }
378
+ ],
379
+ "logging_steps": 5,
380
+ "max_steps": 247,
381
+ "num_input_tokens_seen": 0,
382
+ "num_train_epochs": 1,
383
+ "save_steps": 500,
384
+ "stateful_callbacks": {
385
+ "TrainerControl": {
386
+ "args": {
387
+ "should_epoch_stop": false,
388
+ "should_evaluate": false,
389
+ "should_log": false,
390
+ "should_save": true,
391
+ "should_training_stop": true
392
+ },
393
+ "attributes": {}
394
+ }
395
+ },
396
+ "total_flos": 12929193738240.0,
397
+ "train_batch_size": 8,
398
+ "trial_name": null,
399
+ "trial_params": null
400
+ }