AmberYifan commited on
Commit
ca1e434
·
verified ·
1 Parent(s): aa46553

Model save

Browse files
README.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: AmberYifan/Gemma-2-9B-sft-ultrachat
3
+ library_name: transformers
4
+ model_name: Gemma-2-9B-sft-ultrachat-safeRLHF
5
+ tags:
6
+ - generated_from_trainer
7
+ - trl
8
+ - sft
9
+ licence: license
10
+ ---
11
+
12
+ # Model Card for Gemma-2-9B-sft-ultrachat-safeRLHF
13
+
14
+ This model is a fine-tuned version of [AmberYifan/Gemma-2-9B-sft-ultrachat](https://huggingface.co/AmberYifan/Gemma-2-9B-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/Gemma-2-9B-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": 26794052812800.0,
4
+ "train_loss": 1.5483093844519722,
5
+ "train_runtime": 2786.619,
6
+ "train_samples": 50301,
7
+ "train_samples_per_second": 2.581,
8
+ "train_steps_per_second": 0.081
9
+ }
generation_config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 2,
4
+ "cache_implementation": "hybrid",
5
+ "eos_token_id": 1,
6
+ "pad_token_id": 0,
7
+ "transformers_version": "4.46.3"
8
+ }
train_results.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 1.0,
3
+ "total_flos": 26794052812800.0,
4
+ "train_loss": 1.5483093844519722,
5
+ "train_runtime": 2786.619,
6
+ "train_samples": 50301,
7
+ "train_samples_per_second": 2.581,
8
+ "train_steps_per_second": 0.081
9
+ }
trainer_state.json ADDED
@@ -0,0 +1,372 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 1.0,
5
+ "eval_steps": 500,
6
+ "global_step": 225,
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.0044444444444444444,
13
+ "grad_norm": 8.214417146752451,
14
+ "learning_rate": 8.695652173913044e-07,
15
+ "loss": 2.0263,
16
+ "step": 1
17
+ },
18
+ {
19
+ "epoch": 0.022222222222222223,
20
+ "grad_norm": 3.6940982023267743,
21
+ "learning_rate": 4.347826086956522e-06,
22
+ "loss": 1.9582,
23
+ "step": 5
24
+ },
25
+ {
26
+ "epoch": 0.044444444444444446,
27
+ "grad_norm": 1.8498095767085803,
28
+ "learning_rate": 8.695652173913044e-06,
29
+ "loss": 1.7626,
30
+ "step": 10
31
+ },
32
+ {
33
+ "epoch": 0.06666666666666667,
34
+ "grad_norm": 1.6070070655248392,
35
+ "learning_rate": 1.3043478260869566e-05,
36
+ "loss": 1.6818,
37
+ "step": 15
38
+ },
39
+ {
40
+ "epoch": 0.08888888888888889,
41
+ "grad_norm": 1.5319931708713932,
42
+ "learning_rate": 1.739130434782609e-05,
43
+ "loss": 1.6306,
44
+ "step": 20
45
+ },
46
+ {
47
+ "epoch": 0.1111111111111111,
48
+ "grad_norm": 1.467269040192921,
49
+ "learning_rate": 1.999516282291988e-05,
50
+ "loss": 1.6301,
51
+ "step": 25
52
+ },
53
+ {
54
+ "epoch": 0.13333333333333333,
55
+ "grad_norm": 1.4554783607714894,
56
+ "learning_rate": 1.9940798309400527e-05,
57
+ "loss": 1.6183,
58
+ "step": 30
59
+ },
60
+ {
61
+ "epoch": 0.15555555555555556,
62
+ "grad_norm": 1.400684418666206,
63
+ "learning_rate": 1.982635248222264e-05,
64
+ "loss": 1.6312,
65
+ "step": 35
66
+ },
67
+ {
68
+ "epoch": 0.17777777777777778,
69
+ "grad_norm": 1.373530741526711,
70
+ "learning_rate": 1.9652517041934357e-05,
71
+ "loss": 1.6135,
72
+ "step": 40
73
+ },
74
+ {
75
+ "epoch": 0.2,
76
+ "grad_norm": 1.3446098817534498,
77
+ "learning_rate": 1.9420342634699893e-05,
78
+ "loss": 1.6207,
79
+ "step": 45
80
+ },
81
+ {
82
+ "epoch": 0.2222222222222222,
83
+ "grad_norm": 1.325817153627182,
84
+ "learning_rate": 1.913123250228619e-05,
85
+ "loss": 1.5728,
86
+ "step": 50
87
+ },
88
+ {
89
+ "epoch": 0.24444444444444444,
90
+ "grad_norm": 1.3469969360424408,
91
+ "learning_rate": 1.878693400099269e-05,
92
+ "loss": 1.6118,
93
+ "step": 55
94
+ },
95
+ {
96
+ "epoch": 0.26666666666666666,
97
+ "grad_norm": 1.3917425359171944,
98
+ "learning_rate": 1.8389528040783014e-05,
99
+ "loss": 1.6024,
100
+ "step": 60
101
+ },
102
+ {
103
+ "epoch": 0.28888888888888886,
104
+ "grad_norm": 1.4303898969445588,
105
+ "learning_rate": 1.7941416508447537e-05,
106
+ "loss": 1.5685,
107
+ "step": 65
108
+ },
109
+ {
110
+ "epoch": 0.3111111111111111,
111
+ "grad_norm": 1.3429999677825752,
112
+ "learning_rate": 1.7445307750810153e-05,
113
+ "loss": 1.5726,
114
+ "step": 70
115
+ },
116
+ {
117
+ "epoch": 0.3333333333333333,
118
+ "grad_norm": 1.2742933093395246,
119
+ "learning_rate": 1.690420020571747e-05,
120
+ "loss": 1.5603,
121
+ "step": 75
122
+ },
123
+ {
124
+ "epoch": 0.35555555555555557,
125
+ "grad_norm": 1.3045085959219214,
126
+ "learning_rate": 1.6321364279743267e-05,
127
+ "loss": 1.5693,
128
+ "step": 80
129
+ },
130
+ {
131
+ "epoch": 0.37777777777777777,
132
+ "grad_norm": 1.2646034578224143,
133
+ "learning_rate": 1.570032258213783e-05,
134
+ "loss": 1.537,
135
+ "step": 85
136
+ },
137
+ {
138
+ "epoch": 0.4,
139
+ "grad_norm": 1.2590924521485223,
140
+ "learning_rate": 1.50448286344864e-05,
141
+ "loss": 1.542,
142
+ "step": 90
143
+ },
144
+ {
145
+ "epoch": 0.4222222222222222,
146
+ "grad_norm": 1.259340176409621,
147
+ "learning_rate": 1.4358844184753713e-05,
148
+ "loss": 1.5492,
149
+ "step": 95
150
+ },
151
+ {
152
+ "epoch": 0.4444444444444444,
153
+ "grad_norm": 1.2705396470791088,
154
+ "learning_rate": 1.3646515262826551e-05,
155
+ "loss": 1.5322,
156
+ "step": 100
157
+ },
158
+ {
159
+ "epoch": 0.4666666666666667,
160
+ "grad_norm": 1.2638794294944307,
161
+ "learning_rate": 1.2912147122272523e-05,
162
+ "loss": 1.5427,
163
+ "step": 105
164
+ },
165
+ {
166
+ "epoch": 0.4888888888888889,
167
+ "grad_norm": 1.2424077091728765,
168
+ "learning_rate": 1.2160178219764838e-05,
169
+ "loss": 1.5283,
170
+ "step": 110
171
+ },
172
+ {
173
+ "epoch": 0.5111111111111111,
174
+ "grad_norm": 1.2329795354035313,
175
+ "learning_rate": 1.1395153389439232e-05,
176
+ "loss": 1.5173,
177
+ "step": 115
178
+ },
179
+ {
180
+ "epoch": 0.5333333333333333,
181
+ "grad_norm": 1.2371556053676906,
182
+ "learning_rate": 1.0621696374314807e-05,
183
+ "loss": 1.5307,
184
+ "step": 120
185
+ },
186
+ {
187
+ "epoch": 0.5555555555555556,
188
+ "grad_norm": 1.232712434692815,
189
+ "learning_rate": 9.844481880796492e-06,
190
+ "loss": 1.5281,
191
+ "step": 125
192
+ },
193
+ {
194
+ "epoch": 0.5777777777777777,
195
+ "grad_norm": 1.2529176937558433,
196
+ "learning_rate": 9.068207325159285e-06,
197
+ "loss": 1.5087,
198
+ "step": 130
199
+ },
200
+ {
201
+ "epoch": 0.6,
202
+ "grad_norm": 1.2996588051365014,
203
+ "learning_rate": 8.297564442776014e-06,
204
+ "loss": 1.5159,
205
+ "step": 135
206
+ },
207
+ {
208
+ "epoch": 0.6222222222222222,
209
+ "grad_norm": 1.2184035510596667,
210
+ "learning_rate": 7.537210931679988e-06,
211
+ "loss": 1.5176,
212
+ "step": 140
213
+ },
214
+ {
215
+ "epoch": 0.6444444444444445,
216
+ "grad_norm": 1.2490727423346757,
217
+ "learning_rate": 6.791742301846325e-06,
218
+ "loss": 1.4941,
219
+ "step": 145
220
+ },
221
+ {
222
+ "epoch": 0.6666666666666666,
223
+ "grad_norm": 1.2241017843446953,
224
+ "learning_rate": 6.065664100332478e-06,
225
+ "loss": 1.5191,
226
+ "step": 150
227
+ },
228
+ {
229
+ "epoch": 0.6888888888888889,
230
+ "grad_norm": 1.239277498997839,
231
+ "learning_rate": 5.3633646801467255e-06,
232
+ "loss": 1.5149,
233
+ "step": 155
234
+ },
235
+ {
236
+ "epoch": 0.7111111111111111,
237
+ "grad_norm": 1.2454092681206306,
238
+ "learning_rate": 4.6890886774272485e-06,
239
+ "loss": 1.4911,
240
+ "step": 160
241
+ },
242
+ {
243
+ "epoch": 0.7333333333333333,
244
+ "grad_norm": 1.1922483231102439,
245
+ "learning_rate": 4.046911357233343e-06,
246
+ "loss": 1.4784,
247
+ "step": 165
248
+ },
249
+ {
250
+ "epoch": 0.7555555555555555,
251
+ "grad_norm": 1.2247982014982308,
252
+ "learning_rate": 3.440713983000601e-06,
253
+ "loss": 1.4801,
254
+ "step": 170
255
+ },
256
+ {
257
+ "epoch": 0.7777777777777778,
258
+ "grad_norm": 1.239899805156239,
259
+ "learning_rate": 2.8741603585249312e-06,
260
+ "loss": 1.4583,
261
+ "step": 175
262
+ },
263
+ {
264
+ "epoch": 0.8,
265
+ "grad_norm": 1.2422952358608288,
266
+ "learning_rate": 2.3506746842535244e-06,
267
+ "loss": 1.4918,
268
+ "step": 180
269
+ },
270
+ {
271
+ "epoch": 0.8222222222222222,
272
+ "grad_norm": 1.2349149954091598,
273
+ "learning_rate": 1.8734208617174986e-06,
274
+ "loss": 1.4642,
275
+ "step": 185
276
+ },
277
+ {
278
+ "epoch": 0.8444444444444444,
279
+ "grad_norm": 1.2203735788336134,
280
+ "learning_rate": 1.4452833711883629e-06,
281
+ "loss": 1.4605,
282
+ "step": 190
283
+ },
284
+ {
285
+ "epoch": 0.8666666666666667,
286
+ "grad_norm": 1.2111942025579017,
287
+ "learning_rate": 1.0688498381320855e-06,
288
+ "loss": 1.4518,
289
+ "step": 195
290
+ },
291
+ {
292
+ "epoch": 0.8888888888888888,
293
+ "grad_norm": 1.2227205188182604,
294
+ "learning_rate": 7.463953938275859e-07,
295
+ "loss": 1.471,
296
+ "step": 200
297
+ },
298
+ {
299
+ "epoch": 0.9111111111111111,
300
+ "grad_norm": 1.2352427530088093,
301
+ "learning_rate": 4.798689246727006e-07,
302
+ "loss": 1.4786,
303
+ "step": 205
304
+ },
305
+ {
306
+ "epoch": 0.9333333333333333,
307
+ "grad_norm": 1.2107626288198272,
308
+ "learning_rate": 2.708812932856253e-07,
309
+ "loss": 1.4627,
310
+ "step": 210
311
+ },
312
+ {
313
+ "epoch": 0.9555555555555556,
314
+ "grad_norm": 1.2338739350312762,
315
+ "learning_rate": 1.206956025924333e-07,
316
+ "loss": 1.4702,
317
+ "step": 215
318
+ },
319
+ {
320
+ "epoch": 0.9777777777777777,
321
+ "grad_norm": 1.2316651082897998,
322
+ "learning_rate": 3.0219561743707326e-08,
323
+ "loss": 1.4524,
324
+ "step": 220
325
+ },
326
+ {
327
+ "epoch": 1.0,
328
+ "grad_norm": 1.379154124562403,
329
+ "learning_rate": 0.0,
330
+ "loss": 1.4667,
331
+ "step": 225
332
+ },
333
+ {
334
+ "epoch": 1.0,
335
+ "eval_loss": 1.4416327476501465,
336
+ "eval_runtime": 82.5389,
337
+ "eval_samples_per_second": 14.539,
338
+ "eval_steps_per_second": 0.46,
339
+ "step": 225
340
+ },
341
+ {
342
+ "epoch": 1.0,
343
+ "step": 225,
344
+ "total_flos": 26794052812800.0,
345
+ "train_loss": 1.5483093844519722,
346
+ "train_runtime": 2786.619,
347
+ "train_samples_per_second": 2.581,
348
+ "train_steps_per_second": 0.081
349
+ }
350
+ ],
351
+ "logging_steps": 5,
352
+ "max_steps": 225,
353
+ "num_input_tokens_seen": 0,
354
+ "num_train_epochs": 1,
355
+ "save_steps": 500,
356
+ "stateful_callbacks": {
357
+ "TrainerControl": {
358
+ "args": {
359
+ "should_epoch_stop": false,
360
+ "should_evaluate": false,
361
+ "should_log": false,
362
+ "should_save": true,
363
+ "should_training_stop": true
364
+ },
365
+ "attributes": {}
366
+ }
367
+ },
368
+ "total_flos": 26794052812800.0,
369
+ "train_batch_size": 8,
370
+ "trial_name": null,
371
+ "trial_params": null
372
+ }