ElMater06 commited on
Commit
be522e5
1 Parent(s): cbbd90c

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,3 +1,202 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ base_model: stabilityai/stablelm-2-1_6b-chat
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- 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. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ 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).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
200
+ ### Framework versions
201
+
202
+ - PEFT 0.11.2.dev0
adapter_config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "stabilityai/stablelm-2-1_6b-chat",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layer_replication": null,
10
+ "layers_pattern": null,
11
+ "layers_to_transform": null,
12
+ "loftq_config": {},
13
+ "lora_alpha": 8,
14
+ "lora_dropout": 0.1,
15
+ "megatron_config": null,
16
+ "megatron_core": "megatron.core",
17
+ "modules_to_save": null,
18
+ "peft_type": "LORA",
19
+ "r": 16,
20
+ "rank_pattern": {},
21
+ "revision": null,
22
+ "target_modules": [
23
+ "v_proj",
24
+ "o_proj",
25
+ "up_proj",
26
+ "gate_proj",
27
+ "k_proj",
28
+ "q_proj"
29
+ ],
30
+ "task_type": "CAUSAL_LM",
31
+ "use_dora": false,
32
+ "use_rslora": false
33
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf33eeb42b50f5d32145b207fefecf05d46a6adcf248d64ab5e3afc2475ada48
3
+ size 48797072
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "D:/Vega/training/stablelm-2-1_6b-chat/",
3
+ "architectures": [
4
+ "StableLmForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 100257,
8
+ "eos_token_id": 100257,
9
+ "hidden_act": "silu",
10
+ "hidden_dropout": 0.0,
11
+ "hidden_size": 2048,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 5632,
14
+ "layer_norm_eps": 1e-05,
15
+ "max_position_embeddings": 4096,
16
+ "model_type": "stablelm",
17
+ "num_attention_heads": 32,
18
+ "num_hidden_layers": 24,
19
+ "num_key_value_heads": 32,
20
+ "partial_rotary_factor": 0.25,
21
+ "qk_layernorm": false,
22
+ "rope_scaling": null,
23
+ "rope_theta": 10000,
24
+ "tie_word_embeddings": false,
25
+ "torch_dtype": "float32",
26
+ "transformers_version": "4.41.0",
27
+ "use_cache": true,
28
+ "use_parallel_residual": false,
29
+ "use_qkv_bias": true,
30
+ "vocab_size": 100352,
31
+ "rms_norm_eps": 1e-5
32
+ }
export-lora.cpp ADDED
@@ -0,0 +1,474 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ #include "common.h"
3
+ #include "ggml.h"
4
+ #include "ggml-alloc.h"
5
+
6
+ #include <vector>
7
+ #include <string>
8
+ #include <thread>
9
+
10
+ static const size_t tensor_alignment = 32;
11
+
12
+ struct lora_info {
13
+ std::string filename;
14
+ float scale;
15
+ };
16
+
17
+ struct export_lora_params {
18
+ std::string fn_model_base;
19
+ std::string fn_model_out;
20
+ std::vector<struct lora_info> lora;
21
+ int n_threads;
22
+ };
23
+
24
+ struct lora_data {
25
+ struct lora_info info;
26
+ std::vector<uint8_t> data;
27
+ struct ggml_context * ctx;
28
+
29
+ uint32_t lora_r;
30
+ uint32_t lora_alpha;
31
+ };
32
+
33
+ struct llama_file {
34
+ // use FILE * so we don't have to re-open the file to mmap
35
+ FILE * fp;
36
+ size_t size;
37
+
38
+ llama_file(const char * fname, const char * mode) {
39
+ fp = std::fopen(fname, mode);
40
+ if (fp == NULL) {
41
+ size = 0;
42
+ } else {
43
+ seek(0, SEEK_END);
44
+ size = tell();
45
+ seek(0, SEEK_SET);
46
+ }
47
+ }
48
+
49
+ size_t tell() const {
50
+ #ifdef _WIN32
51
+ __int64 ret = _ftelli64(fp);
52
+ #else
53
+ long ret = std::ftell(fp);
54
+ #endif
55
+ GGML_ASSERT(ret != -1); // this really shouldn't fail
56
+ return (size_t) ret;
57
+ }
58
+
59
+ void seek(size_t offset, int whence) {
60
+ #ifdef _WIN32
61
+ int ret = _fseeki64(fp, (__int64) offset, whence);
62
+ #else
63
+ int ret = std::fseek(fp, (long) offset, whence);
64
+ #endif
65
+ GGML_ASSERT(ret == 0); // same
66
+ }
67
+
68
+ void read_raw(void * ptr, size_t size) {
69
+ if (size == 0) {
70
+ return;
71
+ }
72
+ errno = 0;
73
+ std::size_t ret = std::fread(ptr, size, 1, fp);
74
+ if (ferror(fp)) {
75
+ die_fmt("read error: %s", strerror(errno));
76
+ }
77
+ if (ret != 1) {
78
+ die("unexpectedly reached end of file");
79
+ }
80
+ }
81
+
82
+ std::uint32_t read_u32() {
83
+ std::uint32_t ret;
84
+ read_raw(&ret, sizeof(ret));
85
+ return ret;
86
+ }
87
+
88
+ std::string read_string(std::uint32_t len) {
89
+ std::vector<char> chars(len);
90
+ read_raw(chars.data(), len);
91
+ return std::string(chars.data(), len);
92
+ }
93
+
94
+ void write_raw(const void * ptr, size_t size) {
95
+ if (size == 0) {
96
+ return;
97
+ }
98
+ errno = 0;
99
+ size_t ret = std::fwrite(ptr, size, 1, fp);
100
+ if (ret != 1) {
101
+ die_fmt("write error: %s", strerror(errno));
102
+ }
103
+ }
104
+
105
+ void write_u32(std::uint32_t val) {
106
+ write_raw(&val, sizeof(val));
107
+ }
108
+
109
+ bool eof() {
110
+ return tell() >= size;
111
+ }
112
+
113
+ ~llama_file() {
114
+ if (fp) {
115
+ std::fclose(fp);
116
+ }
117
+ }
118
+ };
119
+
120
+ static struct export_lora_params get_default_export_lora_params() {
121
+ struct export_lora_params result;
122
+ result.fn_model_base = "";
123
+ result.fn_model_out = "";
124
+ result.n_threads = GGML_DEFAULT_N_THREADS;
125
+ return result;
126
+ }
127
+
128
+ static void export_lora_print_usage(int /*argc*/, char ** argv, const struct export_lora_params * params) {
129
+ fprintf(stderr, "usage: %s [options]\n", argv[0]);
130
+ fprintf(stderr, "\n");
131
+ fprintf(stderr, "options:\n");
132
+ fprintf(stderr, " -h, --help show this help message and exit\n");
133
+ fprintf(stderr, " -m FNAME, --model-base FNAME model path from which to load base model (default '%s')\n", params->fn_model_base.c_str());
134
+ fprintf(stderr, " -o FNAME, --model-out FNAME path to save exported model (default '%s')\n", params->fn_model_out.c_str());
135
+ fprintf(stderr, " -l FNAME, --lora FNAME apply LoRA adapter\n");
136
+ fprintf(stderr, " -s FNAME S, --lora-scaled FNAME S apply LoRA adapter with user defined scaling S\n");
137
+ fprintf(stderr, " -t N, --threads N number of threads to use during computation (default: %d)\n", params->n_threads);
138
+ }
139
+
140
+ static bool export_lora_params_parse(int argc, char ** argv, struct export_lora_params * params) {
141
+ bool invalid_param = false;
142
+ std::string arg;
143
+ struct export_lora_params default_params = get_default_export_lora_params();
144
+ const std::string arg_prefix = "--";
145
+
146
+ for (int i = 1; i < argc; i++) {
147
+ arg = argv[i];
148
+ if (arg.compare(0, arg_prefix.size(), arg_prefix) == 0) {
149
+ std::replace(arg.begin(), arg.end(), '_', '-');
150
+ }
151
+
152
+ if (arg == "-m" || arg == "--model-base") {
153
+ if (++i >= argc) {
154
+ invalid_param = true;
155
+ break;
156
+ }
157
+ params->fn_model_base = argv[i];
158
+ } else if (arg == "-o" || arg == "--model-out") {
159
+ if (++i >= argc) {
160
+ invalid_param = true;
161
+ break;
162
+ }
163
+ params->fn_model_out = argv[i];
164
+ } else if (arg == "-l" || arg == "--lora") {
165
+ if (++i >= argc) {
166
+ invalid_param = true;
167
+ break;
168
+ }
169
+ struct lora_info lora;
170
+ lora.filename = argv[i];
171
+ lora.scale = 1.0f;
172
+ params->lora.push_back(lora);
173
+ } else if (arg == "-s" || arg == "--lora-scaled") {
174
+ if (++i >= argc) {
175
+ invalid_param = true;
176
+ break;
177
+ }
178
+ struct lora_info lora;
179
+ lora.filename = argv[i];
180
+ if (++i >= argc) {
181
+ invalid_param = true;
182
+ break;
183
+ }
184
+ lora.scale = std::stof(argv[i]);
185
+ params->lora.push_back(lora);
186
+ } else if (arg == "-t" || arg == "--threads") {
187
+ if (++i >= argc) {
188
+ invalid_param = true;
189
+ break;
190
+ }
191
+ params->n_threads = std::stoi(argv[i]);
192
+ if (params->n_threads <= 0) {
193
+ params->n_threads = std::thread::hardware_concurrency();
194
+ }
195
+ } else {
196
+ fprintf(stderr, "error: unknown argument: '%s'\n", arg.c_str());
197
+ export_lora_print_usage(argc, argv, &default_params);
198
+ exit(1);
199
+ }
200
+ }
201
+
202
+ if (params->fn_model_base == default_params.fn_model_base) {
203
+ fprintf(stderr, "error: please specify a filename for model-base.\n");
204
+ export_lora_print_usage(argc, argv, &default_params);
205
+ exit(1);
206
+ }
207
+ if (params->fn_model_out == default_params.fn_model_out) {
208
+ fprintf(stderr, "error: please specify a filename for model-out.\n");
209
+ export_lora_print_usage(argc, argv, &default_params);
210
+ exit(1);
211
+ }
212
+ if (invalid_param) {
213
+ fprintf(stderr, "error: invalid parameter for argument: '%s'\n", arg.c_str());
214
+ export_lora_print_usage(argc, argv, &default_params);
215
+ exit(1);
216
+ }
217
+ return true;
218
+ }
219
+
220
+ static void free_lora(struct lora_data * lora) {
221
+ if (lora->ctx != NULL) {
222
+ ggml_free(lora->ctx);
223
+ }
224
+ delete lora;
225
+ }
226
+
227
+ static struct lora_data * load_lora(struct lora_info * info) {
228
+ struct lora_data * result = new struct lora_data;
229
+ result->info = *info;
230
+ result->ctx = NULL;
231
+ result->lora_r = 1;
232
+ result->lora_alpha = 1;
233
+
234
+ struct llama_file file(info->filename.c_str(), "rb");
235
+ if (file.fp == NULL) {
236
+ fprintf(stderr, "warning: Could not open lora adapter '%s'. Ignoring this adapter.\n",
237
+ info->filename.c_str());
238
+ free_lora(result);
239
+ return NULL;
240
+ }
241
+
242
+ struct ggml_init_params params_ggml;
243
+ params_ggml.mem_size = ggml_tensor_overhead() * GGML_MAX_NODES;
244
+ params_ggml.mem_buffer = NULL;
245
+ params_ggml.no_alloc = true;
246
+ result->ctx = ggml_init(params_ggml);
247
+
248
+ uint32_t LLAMA_FILE_MAGIC_LORA = 0x67676C61; // 'ggla'
249
+ uint32_t magic = file.read_u32();
250
+ if (magic != LLAMA_FILE_MAGIC_LORA) {
251
+ die_fmt("unexpected lora header file magic in '%s'", info->filename.c_str());
252
+ }
253
+ uint32_t version = file.read_u32();
254
+ if (version != 1) {
255
+ die_fmt("unexpected lora file version '%u' in '%s'", (unsigned) version, info->filename.c_str());
256
+ }
257
+ result->lora_r = file.read_u32();
258
+ result->lora_alpha = file.read_u32();
259
+ // read tensor infos from file
260
+ std::vector<char> name_buf;
261
+ std::vector<struct ggml_tensor *> tensors;
262
+ std::vector<size_t> tensors_offset;
263
+ size_t total_nbytes_pad = 0;
264
+ while(!file.eof()) {
265
+ int64_t ne[4] = {1,1,1,1};
266
+ uint32_t n_dims = file.read_u32();
267
+ uint32_t namelen = file.read_u32();
268
+ uint32_t type = file.read_u32();
269
+ for (uint32_t k = 0; k < n_dims; ++k) {
270
+ ne[k] = (int64_t)file.read_u32();
271
+ }
272
+ name_buf.clear();
273
+ name_buf.resize(namelen + 1, '\0');
274
+ file.read_raw(name_buf.data(), namelen);
275
+ file.seek((0-file.tell()) & 31, SEEK_CUR);
276
+ size_t offset = file.tell();
277
+ struct ggml_tensor * tensor = ggml_new_tensor(result->ctx, (enum ggml_type) type, n_dims, ne);
278
+ ggml_set_name(tensor, name_buf.data());
279
+ size_t nbytes = ggml_nbytes(tensor);
280
+ size_t nbytes_pad = ggml_nbytes_pad(tensor);
281
+ total_nbytes_pad += nbytes_pad;
282
+ tensors.push_back(tensor);
283
+ tensors_offset.push_back(offset);
284
+ file.seek(nbytes, SEEK_CUR);
285
+ }
286
+ // read tensor data
287
+ result->data.resize(total_nbytes_pad);
288
+ size_t data_offset = 0;
289
+ for (size_t i = 0; i < tensors.size(); ++i) {
290
+ struct ggml_tensor * tensor = tensors[i];
291
+ size_t offset = tensors_offset[i];
292
+ size_t nbytes = ggml_nbytes(tensor);
293
+ size_t nbytes_pad = ggml_nbytes_pad(tensor);
294
+ file.seek(offset, SEEK_SET);
295
+ tensor->data = result->data.data() + data_offset;
296
+ file.read_raw(tensor->data, nbytes);
297
+ data_offset += nbytes_pad;
298
+ }
299
+ return result;
300
+ }
301
+
302
+
303
+ static struct ggml_cgraph * build_graph_lora(
304
+ struct ggml_context * ctx,
305
+ struct ggml_tensor * tensor,
306
+ struct ggml_tensor * lora_a,
307
+ struct ggml_tensor * lora_b,
308
+ float scaling
309
+ ) {
310
+ struct ggml_tensor * ab = ggml_mul_mat(ctx, lora_a, lora_b);
311
+ if (scaling != 1.0f) {
312
+ ab = ggml_scale(ctx, ab, ggml_new_f32(ctx, scaling));
313
+ }
314
+ struct ggml_tensor * res = ggml_add_inplace(ctx, tensor, ab);
315
+
316
+ struct ggml_cgraph * gf = ggml_new_graph(ctx);
317
+ ggml_build_forward_expand (gf, res);
318
+ return gf;
319
+ }
320
+
321
+ static bool apply_lora(struct ggml_tensor * tensor, struct lora_data * lora, int n_threads) {
322
+ if (lora->ctx == NULL) {
323
+ return false;
324
+ }
325
+ std::string name = ggml_get_name(tensor);
326
+ std::string name_a = name + std::string(".loraA");
327
+ std::string name_b = name + std::string(".loraB");
328
+ struct ggml_tensor * lora_a = ggml_get_tensor(lora->ctx, name_a.c_str());
329
+ struct ggml_tensor * lora_b = ggml_get_tensor(lora->ctx, name_b.c_str());
330
+ if (lora_a == NULL || lora_b == NULL) {
331
+ return false;
332
+ }
333
+
334
+ float scaling = lora->info.scale * (float)lora->lora_alpha / (float)lora->lora_r;
335
+
336
+ struct ggml_init_params params;
337
+ params.mem_size = GGML_OBJECT_SIZE + GGML_GRAPH_SIZE + ggml_tensor_overhead()*4 + GGML_MEM_ALIGN*5;
338
+ params.mem_buffer = NULL;
339
+ params.no_alloc = true;
340
+ struct ggml_context * ctx = NULL;
341
+ struct ggml_allocr * alloc = NULL;
342
+ struct ggml_cgraph * gf = NULL;
343
+
344
+ ctx = ggml_init(params);
345
+ alloc = ggml_allocr_new_measure(tensor_alignment);
346
+ gf = build_graph_lora(ctx, tensor, lora_a, lora_b, scaling);
347
+ size_t alloc_size = ggml_allocr_alloc_graph(alloc, gf);
348
+ ggml_allocr_free(alloc);
349
+ ggml_free(ctx);
350
+
351
+ static std::vector<uint8_t> data_compute;
352
+ data_compute.resize(alloc_size + tensor_alignment);
353
+
354
+ ctx = ggml_init(params);
355
+ alloc = ggml_allocr_new(data_compute.data(), data_compute.size(), tensor_alignment);
356
+ gf = build_graph_lora(ctx, tensor, lora_a, lora_b, scaling);
357
+ ggml_allocr_alloc_graph(alloc, gf);
358
+ ggml_allocr_free(alloc);
359
+
360
+ struct ggml_cplan cplan = ggml_graph_plan(gf, n_threads);
361
+ static std::vector<uint8_t> data_work;
362
+ data_work.resize(cplan.work_size);
363
+ cplan.work_data = data_work.data();
364
+
365
+ ggml_graph_compute(gf, &cplan);
366
+
367
+ ggml_free(ctx);
368
+ return true;
369
+ }
370
+
371
+ static void export_lora(struct export_lora_params * params) {
372
+ // load all loras
373
+ std::vector<struct lora_data *> loras;
374
+ for (size_t i = 0; i < params->lora.size(); ++i) {
375
+ struct lora_data * lora = load_lora(&params->lora[i]);
376
+ if (lora != NULL) {
377
+ loras.push_back(lora);
378
+ }
379
+ }
380
+ if (loras.size() == 0) {
381
+ fprintf(stderr, "warning: no lora adapters will be applied.\n");
382
+ }
383
+
384
+ // open input file
385
+ struct llama_file fin(params->fn_model_base.c_str(), "rb");
386
+ if (!fin.fp) {
387
+ die_fmt("Could not open file '%s'\n", params->fn_model_base.c_str());
388
+ }
389
+
390
+ // open base model gguf, read tensors without their data
391
+ struct ggml_context * ctx_in;
392
+ struct gguf_init_params params_gguf;
393
+ params_gguf.no_alloc = true;
394
+ params_gguf.ctx = &ctx_in;
395
+ struct gguf_context * gguf_in = gguf_init_from_file(params->fn_model_base.c_str(), params_gguf);
396
+
397
+ // create new gguf
398
+ struct gguf_context * gguf_out = gguf_init_empty();
399
+
400
+ // copy meta data from base model: kv and tensors
401
+ gguf_set_kv(gguf_out, gguf_in);
402
+ int n_tensors = gguf_get_n_tensors(gguf_in);
403
+ for (int i=0; i < n_tensors; ++i) {
404
+ const char * name = gguf_get_tensor_name(gguf_in, i);
405
+ struct ggml_tensor * tensor = ggml_get_tensor(ctx_in, name);
406
+ gguf_add_tensor(gguf_out, tensor);
407
+ }
408
+
409
+ // create output file
410
+ struct llama_file fout(params->fn_model_out.c_str(), "wb");
411
+ if (!fout.fp) {
412
+ die_fmt("Could not create file '%s'\n", params->fn_model_out.c_str());
413
+ }
414
+
415
+ // write gguf meta data
416
+ std::vector<uint8_t> meta;
417
+ meta.resize(gguf_get_meta_size(gguf_out));
418
+ gguf_get_meta_data(gguf_out, meta.data());
419
+ fout.write_raw(meta.data(), meta.size());
420
+
421
+ std::vector<uint8_t> data;
422
+ std::vector<uint8_t> padding;
423
+ for (int i=0; i < n_tensors; ++i) {
424
+ const char * name = gguf_get_tensor_name(gguf_in, i);
425
+ struct ggml_tensor * tensor = ggml_get_tensor(ctx_in, name);
426
+
427
+ // read tensor data
428
+ data.resize(ggml_nbytes(tensor));
429
+ tensor->data = data.data();
430
+ size_t offset = gguf_get_tensor_offset(gguf_in, i);
431
+ fin.seek(offset + meta.size(), SEEK_SET);
432
+ fin.read_raw(data.data(), data.size());
433
+
434
+ // apply all loras
435
+ for (size_t k = 0; k < loras.size(); ++k) {
436
+ apply_lora(tensor, loras[k], params->n_threads);
437
+ }
438
+
439
+ // write tensor data + padding
440
+ padding.clear();
441
+ padding.resize(GGML_PAD(data.size(), gguf_get_alignment(gguf_out)) - data.size(), 0);
442
+
443
+ GGML_ASSERT(fout.tell() == offset + meta.size());
444
+ // fout.seek(offset + meta.size(), SEEK_SET);
445
+ fout.write_raw(data.data(), data.size());
446
+ fout.write_raw(padding.data(), padding.size());
447
+
448
+ if (i % 2 == 0) {
449
+ printf(".");
450
+ }
451
+ }
452
+ printf("\n");
453
+
454
+ // close gguf
455
+ gguf_free(gguf_out);
456
+ gguf_free(gguf_in);
457
+
458
+ // free loras
459
+ for (size_t i = 0; i < loras.size(); ++i) {
460
+ free_lora(loras[i]);
461
+ }
462
+ }
463
+
464
+ int main(int argc, char ** argv) {
465
+ struct export_lora_params params = get_default_export_lora_params();
466
+
467
+ if (!export_lora_params_parse(argc, argv, &params)) {
468
+ return 1;
469
+ }
470
+
471
+ export_lora(&params);
472
+
473
+ return 0;
474
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 100257,
4
+ "do_sample": true,
5
+ "eos_token_id": 100257,
6
+ "transformers_version": "4.41.0"
7
+ }
ggml-model-f16.gguf ADDED
File without changes
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model-00001-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e477bec9cd907609a3263adf9fcbe650487951ebc1b1655c50c51eca2adf5af2
3
+ size 4984037184
model-00002-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95933d2775d1bbac72107fc0cf0bc3bf0db518522c0b8c57b7cd758b0c5ff48e
3
+ size 1594062688
model.safetensors.index.json ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 6578061312
4
+ },
5
+ "weight_map": {
6
+ "lm_head.weight": "model-00002-of-00002.safetensors",
7
+ "model.embed_tokens.weight": "model-00001-of-00002.safetensors",
8
+ "model.layers.0.input_layernorm.bias": "model-00001-of-00002.safetensors",
9
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
10
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
11
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
12
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
13
+ "model.layers.0.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
14
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
15
+ "model.layers.0.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
16
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
17
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
18
+ "model.layers.0.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
19
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
20
+ "model.layers.0.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
21
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
22
+ "model.layers.1.input_layernorm.bias": "model-00001-of-00002.safetensors",
23
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00002.safetensors",
24
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
25
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
26
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
27
+ "model.layers.1.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
28
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
29
+ "model.layers.1.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
30
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
31
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
32
+ "model.layers.1.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
33
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
34
+ "model.layers.1.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
35
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
36
+ "model.layers.10.input_layernorm.bias": "model-00001-of-00002.safetensors",
37
+ "model.layers.10.input_layernorm.weight": "model-00001-of-00002.safetensors",
38
+ "model.layers.10.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
39
+ "model.layers.10.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
40
+ "model.layers.10.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
41
+ "model.layers.10.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
42
+ "model.layers.10.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
43
+ "model.layers.10.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
44
+ "model.layers.10.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
45
+ "model.layers.10.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
46
+ "model.layers.10.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
47
+ "model.layers.10.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
48
+ "model.layers.10.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
49
+ "model.layers.10.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
50
+ "model.layers.11.input_layernorm.bias": "model-00001-of-00002.safetensors",
51
+ "model.layers.11.input_layernorm.weight": "model-00001-of-00002.safetensors",
52
+ "model.layers.11.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
53
+ "model.layers.11.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
54
+ "model.layers.11.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
55
+ "model.layers.11.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
56
+ "model.layers.11.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
57
+ "model.layers.11.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
58
+ "model.layers.11.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
59
+ "model.layers.11.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
60
+ "model.layers.11.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
61
+ "model.layers.11.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
62
+ "model.layers.11.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
63
+ "model.layers.11.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
64
+ "model.layers.12.input_layernorm.bias": "model-00001-of-00002.safetensors",
65
+ "model.layers.12.input_layernorm.weight": "model-00001-of-00002.safetensors",
66
+ "model.layers.12.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
67
+ "model.layers.12.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
68
+ "model.layers.12.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
69
+ "model.layers.12.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
70
+ "model.layers.12.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
71
+ "model.layers.12.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
72
+ "model.layers.12.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
73
+ "model.layers.12.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
74
+ "model.layers.12.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
75
+ "model.layers.12.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
76
+ "model.layers.12.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
77
+ "model.layers.12.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
78
+ "model.layers.13.input_layernorm.bias": "model-00001-of-00002.safetensors",
79
+ "model.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
80
+ "model.layers.13.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
81
+ "model.layers.13.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
82
+ "model.layers.13.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
83
+ "model.layers.13.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
84
+ "model.layers.13.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
85
+ "model.layers.13.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
86
+ "model.layers.13.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
87
+ "model.layers.13.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
88
+ "model.layers.13.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
89
+ "model.layers.13.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
90
+ "model.layers.13.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
91
+ "model.layers.13.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
92
+ "model.layers.14.input_layernorm.bias": "model-00001-of-00002.safetensors",
93
+ "model.layers.14.input_layernorm.weight": "model-00001-of-00002.safetensors",
94
+ "model.layers.14.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
95
+ "model.layers.14.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
96
+ "model.layers.14.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
97
+ "model.layers.14.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
98
+ "model.layers.14.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
99
+ "model.layers.14.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
100
+ "model.layers.14.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
101
+ "model.layers.14.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
102
+ "model.layers.14.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
103
+ "model.layers.14.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
104
+ "model.layers.14.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
105
+ "model.layers.14.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
106
+ "model.layers.15.input_layernorm.bias": "model-00001-of-00002.safetensors",
107
+ "model.layers.15.input_layernorm.weight": "model-00001-of-00002.safetensors",
108
+ "model.layers.15.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
109
+ "model.layers.15.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
110
+ "model.layers.15.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
111
+ "model.layers.15.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
112
+ "model.layers.15.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
113
+ "model.layers.15.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
114
+ "model.layers.15.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
115
+ "model.layers.15.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
116
+ "model.layers.15.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
117
+ "model.layers.15.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
118
+ "model.layers.15.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
119
+ "model.layers.15.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
120
+ "model.layers.16.input_layernorm.bias": "model-00001-of-00002.safetensors",
121
+ "model.layers.16.input_layernorm.weight": "model-00001-of-00002.safetensors",
122
+ "model.layers.16.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
123
+ "model.layers.16.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
124
+ "model.layers.16.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
125
+ "model.layers.16.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
126
+ "model.layers.16.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
127
+ "model.layers.16.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
128
+ "model.layers.16.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
129
+ "model.layers.16.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
130
+ "model.layers.16.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
131
+ "model.layers.16.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
132
+ "model.layers.16.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
133
+ "model.layers.16.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
134
+ "model.layers.17.input_layernorm.bias": "model-00001-of-00002.safetensors",
135
+ "model.layers.17.input_layernorm.weight": "model-00001-of-00002.safetensors",
136
+ "model.layers.17.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
137
+ "model.layers.17.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
138
+ "model.layers.17.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
139
+ "model.layers.17.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
140
+ "model.layers.17.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
141
+ "model.layers.17.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
142
+ "model.layers.17.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
143
+ "model.layers.17.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
144
+ "model.layers.17.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
145
+ "model.layers.17.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
146
+ "model.layers.17.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
147
+ "model.layers.17.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
148
+ "model.layers.18.input_layernorm.bias": "model-00001-of-00002.safetensors",
149
+ "model.layers.18.input_layernorm.weight": "model-00001-of-00002.safetensors",
150
+ "model.layers.18.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
151
+ "model.layers.18.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
152
+ "model.layers.18.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
153
+ "model.layers.18.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
154
+ "model.layers.18.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
155
+ "model.layers.18.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
156
+ "model.layers.18.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
157
+ "model.layers.18.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
158
+ "model.layers.18.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
159
+ "model.layers.18.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
160
+ "model.layers.18.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
161
+ "model.layers.18.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
162
+ "model.layers.19.input_layernorm.bias": "model-00001-of-00002.safetensors",
163
+ "model.layers.19.input_layernorm.weight": "model-00001-of-00002.safetensors",
164
+ "model.layers.19.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
165
+ "model.layers.19.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
166
+ "model.layers.19.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
167
+ "model.layers.19.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
168
+ "model.layers.19.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
169
+ "model.layers.19.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
170
+ "model.layers.19.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
171
+ "model.layers.19.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
172
+ "model.layers.19.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
173
+ "model.layers.19.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
174
+ "model.layers.19.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
175
+ "model.layers.19.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
176
+ "model.layers.2.input_layernorm.bias": "model-00001-of-00002.safetensors",
177
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00002.safetensors",
178
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
179
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
180
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
181
+ "model.layers.2.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
182
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
183
+ "model.layers.2.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
184
+ "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
185
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
186
+ "model.layers.2.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
187
+ "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
188
+ "model.layers.2.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
189
+ "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
190
+ "model.layers.20.input_layernorm.bias": "model-00002-of-00002.safetensors",
191
+ "model.layers.20.input_layernorm.weight": "model-00002-of-00002.safetensors",
192
+ "model.layers.20.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
193
+ "model.layers.20.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
194
+ "model.layers.20.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
195
+ "model.layers.20.post_attention_layernorm.bias": "model-00002-of-00002.safetensors",
196
+ "model.layers.20.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
197
+ "model.layers.20.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
198
+ "model.layers.20.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
199
+ "model.layers.20.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
200
+ "model.layers.20.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
201
+ "model.layers.20.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
202
+ "model.layers.20.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
203
+ "model.layers.20.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
204
+ "model.layers.21.input_layernorm.bias": "model-00002-of-00002.safetensors",
205
+ "model.layers.21.input_layernorm.weight": "model-00002-of-00002.safetensors",
206
+ "model.layers.21.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
207
+ "model.layers.21.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
208
+ "model.layers.21.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
209
+ "model.layers.21.post_attention_layernorm.bias": "model-00002-of-00002.safetensors",
210
+ "model.layers.21.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
211
+ "model.layers.21.self_attn.k_proj.bias": "model-00002-of-00002.safetensors",
212
+ "model.layers.21.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
213
+ "model.layers.21.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
214
+ "model.layers.21.self_attn.q_proj.bias": "model-00002-of-00002.safetensors",
215
+ "model.layers.21.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
216
+ "model.layers.21.self_attn.v_proj.bias": "model-00002-of-00002.safetensors",
217
+ "model.layers.21.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
218
+ "model.layers.22.input_layernorm.bias": "model-00002-of-00002.safetensors",
219
+ "model.layers.22.input_layernorm.weight": "model-00002-of-00002.safetensors",
220
+ "model.layers.22.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
221
+ "model.layers.22.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
222
+ "model.layers.22.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
223
+ "model.layers.22.post_attention_layernorm.bias": "model-00002-of-00002.safetensors",
224
+ "model.layers.22.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
225
+ "model.layers.22.self_attn.k_proj.bias": "model-00002-of-00002.safetensors",
226
+ "model.layers.22.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
227
+ "model.layers.22.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
228
+ "model.layers.22.self_attn.q_proj.bias": "model-00002-of-00002.safetensors",
229
+ "model.layers.22.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
230
+ "model.layers.22.self_attn.v_proj.bias": "model-00002-of-00002.safetensors",
231
+ "model.layers.22.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
232
+ "model.layers.23.input_layernorm.bias": "model-00002-of-00002.safetensors",
233
+ "model.layers.23.input_layernorm.weight": "model-00002-of-00002.safetensors",
234
+ "model.layers.23.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
235
+ "model.layers.23.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
236
+ "model.layers.23.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
237
+ "model.layers.23.post_attention_layernorm.bias": "model-00002-of-00002.safetensors",
238
+ "model.layers.23.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
239
+ "model.layers.23.self_attn.k_proj.bias": "model-00002-of-00002.safetensors",
240
+ "model.layers.23.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
241
+ "model.layers.23.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
242
+ "model.layers.23.self_attn.q_proj.bias": "model-00002-of-00002.safetensors",
243
+ "model.layers.23.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
244
+ "model.layers.23.self_attn.v_proj.bias": "model-00002-of-00002.safetensors",
245
+ "model.layers.23.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
246
+ "model.layers.3.input_layernorm.bias": "model-00001-of-00002.safetensors",
247
+ "model.layers.3.input_layernorm.weight": "model-00001-of-00002.safetensors",
248
+ "model.layers.3.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
249
+ "model.layers.3.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
250
+ "model.layers.3.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
251
+ "model.layers.3.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
252
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
253
+ "model.layers.3.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
254
+ "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
255
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
256
+ "model.layers.3.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
257
+ "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
258
+ "model.layers.3.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
259
+ "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
260
+ "model.layers.4.input_layernorm.bias": "model-00001-of-00002.safetensors",
261
+ "model.layers.4.input_layernorm.weight": "model-00001-of-00002.safetensors",
262
+ "model.layers.4.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
263
+ "model.layers.4.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
264
+ "model.layers.4.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
265
+ "model.layers.4.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
266
+ "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
267
+ "model.layers.4.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
268
+ "model.layers.4.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
269
+ "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
270
+ "model.layers.4.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
271
+ "model.layers.4.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
272
+ "model.layers.4.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
273
+ "model.layers.4.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
274
+ "model.layers.5.input_layernorm.bias": "model-00001-of-00002.safetensors",
275
+ "model.layers.5.input_layernorm.weight": "model-00001-of-00002.safetensors",
276
+ "model.layers.5.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
277
+ "model.layers.5.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
278
+ "model.layers.5.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
279
+ "model.layers.5.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
280
+ "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
281
+ "model.layers.5.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
282
+ "model.layers.5.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
283
+ "model.layers.5.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
284
+ "model.layers.5.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
285
+ "model.layers.5.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
286
+ "model.layers.5.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
287
+ "model.layers.5.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
288
+ "model.layers.6.input_layernorm.bias": "model-00001-of-00002.safetensors",
289
+ "model.layers.6.input_layernorm.weight": "model-00001-of-00002.safetensors",
290
+ "model.layers.6.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
291
+ "model.layers.6.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
292
+ "model.layers.6.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
293
+ "model.layers.6.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
294
+ "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
295
+ "model.layers.6.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
296
+ "model.layers.6.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
297
+ "model.layers.6.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
298
+ "model.layers.6.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
299
+ "model.layers.6.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
300
+ "model.layers.6.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
301
+ "model.layers.6.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
302
+ "model.layers.7.input_layernorm.bias": "model-00001-of-00002.safetensors",
303
+ "model.layers.7.input_layernorm.weight": "model-00001-of-00002.safetensors",
304
+ "model.layers.7.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
305
+ "model.layers.7.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
306
+ "model.layers.7.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
307
+ "model.layers.7.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
308
+ "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
309
+ "model.layers.7.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
310
+ "model.layers.7.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
311
+ "model.layers.7.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
312
+ "model.layers.7.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
313
+ "model.layers.7.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
314
+ "model.layers.7.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
315
+ "model.layers.7.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
316
+ "model.layers.8.input_layernorm.bias": "model-00001-of-00002.safetensors",
317
+ "model.layers.8.input_layernorm.weight": "model-00001-of-00002.safetensors",
318
+ "model.layers.8.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
319
+ "model.layers.8.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
320
+ "model.layers.8.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
321
+ "model.layers.8.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
322
+ "model.layers.8.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
323
+ "model.layers.8.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
324
+ "model.layers.8.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
325
+ "model.layers.8.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
326
+ "model.layers.8.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
327
+ "model.layers.8.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
328
+ "model.layers.8.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
329
+ "model.layers.8.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
330
+ "model.layers.9.input_layernorm.bias": "model-00001-of-00002.safetensors",
331
+ "model.layers.9.input_layernorm.weight": "model-00001-of-00002.safetensors",
332
+ "model.layers.9.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
333
+ "model.layers.9.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
334
+ "model.layers.9.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
335
+ "model.layers.9.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
336
+ "model.layers.9.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
337
+ "model.layers.9.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
338
+ "model.layers.9.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
339
+ "model.layers.9.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
340
+ "model.layers.9.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
341
+ "model.layers.9.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
342
+ "model.layers.9.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
343
+ "model.layers.9.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
344
+ "model.norm.bias": "model-00002-of-00002.safetensors",
345
+ "model.norm.weight": "model-00002-of-00002.safetensors"
346
+ }
347
+ }
rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e33000f86e77b6d015fc66f83393220237f21ef702a3ec03aeeef007c1b90015
3
+ size 14244
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07515c2b046d99c3743a994e794dd47b173671b79b64b92ecc764813da2c450b
3
+ size 1064
special_tokens_map.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|reg_extra|>",
4
+ "<|endoftext|>",
5
+ "<|fim_prefix|>",
6
+ "<|fim_middle|>",
7
+ "<|fim_suffix|>",
8
+ "<|fim_pad|>",
9
+ "<gh_stars>",
10
+ "<filename>",
11
+ "<issue_start>",
12
+ "<issue_comment>",
13
+ "<issue_closed>",
14
+ "<jupyter_start>",
15
+ "<jupyter_text>",
16
+ "<jupyter_code>",
17
+ "<jupyter_output>",
18
+ "<empty_output>",
19
+ "<commit_before>",
20
+ "<commit_msg>",
21
+ "<commit_after>",
22
+ "<reponame>",
23
+ "<|endofprompt|>",
24
+ "<|im_start|>",
25
+ "<|im_end|>",
26
+ "<|pause|>",
27
+ "<|reg0|>",
28
+ "<|reg1|>",
29
+ "<|reg2|>",
30
+ "<|reg3|>",
31
+ "<|reg4|>",
32
+ "<|reg5|>",
33
+ "<|reg6|>",
34
+ "<|reg7|>",
35
+ "<|extra0|>"
36
+ ],
37
+ "bos_token": {
38
+ "content": "<|endoftext|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "eos_token": {
45
+ "content": "<|endoftext|>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ },
51
+ "pad_token": "<|endoftext|>",
52
+ "unk_token": {
53
+ "content": "<|endoftext|>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false
58
+ }
59
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "100256": {
5
+ "content": "<|reg_extra|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "100257": {
13
+ "content": "<|endoftext|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "100258": {
21
+ "content": "<|fim_prefix|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "100259": {
29
+ "content": "<|fim_middle|>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "100260": {
37
+ "content": "<|fim_suffix|>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "100261": {
45
+ "content": "<|fim_pad|>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "100262": {
53
+ "content": "<gh_stars>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "100263": {
61
+ "content": "<filename>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "100264": {
69
+ "content": "<issue_start>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "100265": {
77
+ "content": "<issue_comment>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "100266": {
85
+ "content": "<issue_closed>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "100267": {
93
+ "content": "<jupyter_start>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "100268": {
101
+ "content": "<jupyter_text>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "100269": {
109
+ "content": "<jupyter_code>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "100270": {
117
+ "content": "<jupyter_output>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": true
123
+ },
124
+ "100271": {
125
+ "content": "<empty_output>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": true
131
+ },
132
+ "100272": {
133
+ "content": "<commit_before>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": true
139
+ },
140
+ "100273": {
141
+ "content": "<commit_msg>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": true
147
+ },
148
+ "100274": {
149
+ "content": "<commit_after>",
150
+ "lstrip": false,
151
+ "normalized": false,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": true
155
+ },
156
+ "100275": {
157
+ "content": "<reponame>",
158
+ "lstrip": false,
159
+ "normalized": false,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": true
163
+ },
164
+ "100276": {
165
+ "content": "<|endofprompt|>",
166
+ "lstrip": false,
167
+ "normalized": false,
168
+ "rstrip": false,
169
+ "single_word": false,
170
+ "special": true
171
+ },
172
+ "100277": {
173
+ "content": "<|im_start|>",
174
+ "lstrip": false,
175
+ "normalized": false,
176
+ "rstrip": false,
177
+ "single_word": false,
178
+ "special": true
179
+ },
180
+ "100278": {
181
+ "content": "<|im_end|>",
182
+ "lstrip": false,
183
+ "normalized": false,
184
+ "rstrip": false,
185
+ "single_word": false,
186
+ "special": true
187
+ },
188
+ "100279": {
189
+ "content": "<|pause|>",
190
+ "lstrip": false,
191
+ "normalized": false,
192
+ "rstrip": false,
193
+ "single_word": false,
194
+ "special": true
195
+ },
196
+ "100280": {
197
+ "content": "<|reg0|>",
198
+ "lstrip": false,
199
+ "normalized": false,
200
+ "rstrip": false,
201
+ "single_word": false,
202
+ "special": true
203
+ },
204
+ "100281": {
205
+ "content": "<|reg1|>",
206
+ "lstrip": false,
207
+ "normalized": false,
208
+ "rstrip": false,
209
+ "single_word": false,
210
+ "special": true
211
+ },
212
+ "100282": {
213
+ "content": "<|reg2|>",
214
+ "lstrip": false,
215
+ "normalized": false,
216
+ "rstrip": false,
217
+ "single_word": false,
218
+ "special": true
219
+ },
220
+ "100283": {
221
+ "content": "<|reg3|>",
222
+ "lstrip": false,
223
+ "normalized": false,
224
+ "rstrip": false,
225
+ "single_word": false,
226
+ "special": true
227
+ },
228
+ "100284": {
229
+ "content": "<|reg4|>",
230
+ "lstrip": false,
231
+ "normalized": false,
232
+ "rstrip": false,
233
+ "single_word": false,
234
+ "special": true
235
+ },
236
+ "100285": {
237
+ "content": "<|reg5|>",
238
+ "lstrip": false,
239
+ "normalized": false,
240
+ "rstrip": false,
241
+ "single_word": false,
242
+ "special": true
243
+ },
244
+ "100286": {
245
+ "content": "<|reg6|>",
246
+ "lstrip": false,
247
+ "normalized": false,
248
+ "rstrip": false,
249
+ "single_word": false,
250
+ "special": true
251
+ },
252
+ "100287": {
253
+ "content": "<|reg7|>",
254
+ "lstrip": false,
255
+ "normalized": false,
256
+ "rstrip": false,
257
+ "single_word": false,
258
+ "special": true
259
+ },
260
+ "100288": {
261
+ "content": "<|extra0|>",
262
+ "lstrip": false,
263
+ "normalized": false,
264
+ "rstrip": false,
265
+ "single_word": false,
266
+ "special": true
267
+ }
268
+ },
269
+ "additional_special_tokens": [
270
+ "<|reg_extra|>",
271
+ "<|endoftext|>",
272
+ "<|fim_prefix|>",
273
+ "<|fim_middle|>",
274
+ "<|fim_suffix|>",
275
+ "<|fim_pad|>",
276
+ "<gh_stars>",
277
+ "<filename>",
278
+ "<issue_start>",
279
+ "<issue_comment>",
280
+ "<issue_closed>",
281
+ "<jupyter_start>",
282
+ "<jupyter_text>",
283
+ "<jupyter_code>",
284
+ "<jupyter_output>",
285
+ "<empty_output>",
286
+ "<commit_before>",
287
+ "<commit_msg>",
288
+ "<commit_after>",
289
+ "<reponame>",
290
+ "<|endofprompt|>",
291
+ "<|im_start|>",
292
+ "<|im_end|>",
293
+ "<|pause|>",
294
+ "<|reg0|>",
295
+ "<|reg1|>",
296
+ "<|reg2|>",
297
+ "<|reg3|>",
298
+ "<|reg4|>",
299
+ "<|reg5|>",
300
+ "<|reg6|>",
301
+ "<|reg7|>",
302
+ "<|extra0|>"
303
+ ],
304
+ "bos_token": "<|endoftext|>",
305
+ "chat_template": "{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% set system_message = 'You are a helpful assistant.' %}{% endif %}{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in loop_messages %}{% if loop.index0 == 0 %}{{'<|im_start|>system\n' + system_message + '<|im_end|>\n'}}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
306
+ "clean_up_tokenization_spaces": true,
307
+ "eos_token": "<|endoftext|>",
308
+ "model_max_length": 2048,
309
+ "pad_token": "<|endoftext|>",
310
+ "tokenizer_class": "GPT2Tokenizer",
311
+ "unk_token": "<|endoftext|>"
312
+ }
trainer_state.json ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 3.9936,
5
+ "eval_steps": 500,
6
+ "global_step": 312,
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.192,
13
+ "grad_norm": 0.3010159432888031,
14
+ "learning_rate": 3.191489361702128e-05,
15
+ "loss": 2.2514,
16
+ "step": 15
17
+ },
18
+ {
19
+ "epoch": 0.384,
20
+ "grad_norm": 0.2521279752254486,
21
+ "learning_rate": 6.382978723404256e-05,
22
+ "loss": 2.1582,
23
+ "step": 30
24
+ },
25
+ {
26
+ "epoch": 0.576,
27
+ "grad_norm": 0.2557184100151062,
28
+ "learning_rate": 9.574468085106384e-05,
29
+ "loss": 1.8683,
30
+ "step": 45
31
+ },
32
+ {
33
+ "epoch": 0.768,
34
+ "grad_norm": 0.22737619280815125,
35
+ "learning_rate": 0.00012765957446808513,
36
+ "loss": 1.6607,
37
+ "step": 60
38
+ },
39
+ {
40
+ "epoch": 0.96,
41
+ "grad_norm": 0.19700799882411957,
42
+ "learning_rate": 0.00015957446808510637,
43
+ "loss": 1.4682,
44
+ "step": 75
45
+ },
46
+ {
47
+ "epoch": 1.152,
48
+ "grad_norm": 0.2368774265050888,
49
+ "learning_rate": 0.00019148936170212768,
50
+ "loss": 1.3196,
51
+ "step": 90
52
+ },
53
+ {
54
+ "epoch": 1.3439999999999999,
55
+ "grad_norm": 0.3574005365371704,
56
+ "learning_rate": 0.00018990825688073394,
57
+ "loss": 1.1283,
58
+ "step": 105
59
+ },
60
+ {
61
+ "epoch": 1.536,
62
+ "grad_norm": 0.3291820287704468,
63
+ "learning_rate": 0.0001761467889908257,
64
+ "loss": 0.9629,
65
+ "step": 120
66
+ },
67
+ {
68
+ "epoch": 1.728,
69
+ "grad_norm": 0.4235256612300873,
70
+ "learning_rate": 0.00016238532110091745,
71
+ "loss": 0.8761,
72
+ "step": 135
73
+ },
74
+ {
75
+ "epoch": 1.92,
76
+ "grad_norm": 0.3522832691669464,
77
+ "learning_rate": 0.00014862385321100919,
78
+ "loss": 0.7764,
79
+ "step": 150
80
+ },
81
+ {
82
+ "epoch": 2.112,
83
+ "grad_norm": 0.3914245367050171,
84
+ "learning_rate": 0.00013486238532110092,
85
+ "loss": 0.6717,
86
+ "step": 165
87
+ },
88
+ {
89
+ "epoch": 2.304,
90
+ "grad_norm": 0.3502177894115448,
91
+ "learning_rate": 0.00012110091743119268,
92
+ "loss": 0.6329,
93
+ "step": 180
94
+ },
95
+ {
96
+ "epoch": 2.496,
97
+ "grad_norm": 0.5064918398857117,
98
+ "learning_rate": 0.0001073394495412844,
99
+ "loss": 0.5551,
100
+ "step": 195
101
+ },
102
+ {
103
+ "epoch": 2.6879999999999997,
104
+ "grad_norm": 0.4178985357284546,
105
+ "learning_rate": 9.357798165137616e-05,
106
+ "loss": 0.5132,
107
+ "step": 210
108
+ },
109
+ {
110
+ "epoch": 2.88,
111
+ "grad_norm": 0.3729366958141327,
112
+ "learning_rate": 7.98165137614679e-05,
113
+ "loss": 0.4831,
114
+ "step": 225
115
+ },
116
+ {
117
+ "epoch": 3.072,
118
+ "grad_norm": 0.30623266100883484,
119
+ "learning_rate": 6.605504587155963e-05,
120
+ "loss": 0.4484,
121
+ "step": 240
122
+ },
123
+ {
124
+ "epoch": 3.2640000000000002,
125
+ "grad_norm": 0.31436726450920105,
126
+ "learning_rate": 5.229357798165138e-05,
127
+ "loss": 0.4255,
128
+ "step": 255
129
+ },
130
+ {
131
+ "epoch": 3.456,
132
+ "grad_norm": 0.32084089517593384,
133
+ "learning_rate": 3.8532110091743125e-05,
134
+ "loss": 0.3731,
135
+ "step": 270
136
+ },
137
+ {
138
+ "epoch": 3.648,
139
+ "grad_norm": 0.3452220857143402,
140
+ "learning_rate": 2.4770642201834864e-05,
141
+ "loss": 0.3786,
142
+ "step": 285
143
+ },
144
+ {
145
+ "epoch": 3.84,
146
+ "grad_norm": 0.3483213782310486,
147
+ "learning_rate": 1.1009174311926607e-05,
148
+ "loss": 0.3988,
149
+ "step": 300
150
+ }
151
+ ],
152
+ "logging_steps": 15,
153
+ "max_steps": 312,
154
+ "num_input_tokens_seen": 0,
155
+ "num_train_epochs": 4,
156
+ "save_steps": 1000,
157
+ "stateful_callbacks": {
158
+ "TrainerControl": {
159
+ "args": {
160
+ "should_epoch_stop": false,
161
+ "should_evaluate": false,
162
+ "should_log": false,
163
+ "should_save": true,
164
+ "should_training_stop": true
165
+ },
166
+ "attributes": {}
167
+ }
168
+ },
169
+ "total_flos": 4.447199037200794e+16,
170
+ "train_batch_size": 16,
171
+ "trial_name": null,
172
+ "trial_params": null
173
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2c89f66bc7dc95dfee8c0f78fbbe9a4b13a85b2831c23caaf58ebe5bdaf86f2
3
+ size 5048