TheBloke commited on
Commit
44123c3
1 Parent(s): 5dc0e01

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +464 -0
README.md ADDED
@@ -0,0 +1,464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Nondzu/Mistral-7B-code-16k-qlora
3
+ inference: false
4
+ license: apache-2.0
5
+ model_creator: Kamil
6
+ model_name: Mistral 7B Code 16K qLoRA
7
+ model_type: mistral
8
+ prompt_template: 'Below is an instruction that describes a task. Write a response
9
+ that appropriately completes the request.
10
+
11
+
12
+ ### Instruction:
13
+
14
+ {prompt}
15
+
16
+
17
+ ### Response:
18
+
19
+ '
20
+ quantized_by: TheBloke
21
+ ---
22
+ <!-- markdownlint-disable MD041 -->
23
+
24
+ <!-- header start -->
25
+ <!-- 200823 -->
26
+ <div style="width: auto; margin-left: auto; margin-right: auto">
27
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
28
+ </div>
29
+ <div style="display: flex; justify-content: space-between; width: 100%;">
30
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
31
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
32
+ </div>
33
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
34
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
35
+ </div>
36
+ </div>
37
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
38
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
39
+ <!-- header end -->
40
+
41
+ # Mistral 7B Code 16K qLoRA - GPTQ
42
+ - Model creator: [Kamil](https://huggingface.co/Nondzu)
43
+ - Original model: [Mistral 7B Code 16K qLoRA](https://huggingface.co/Nondzu/Mistral-7B-code-16k-qlora)
44
+
45
+ <!-- description start -->
46
+ ## Description
47
+
48
+ This repo contains GPTQ model files for [Kamil's Mistral 7B Code 16K qLoRA](https://huggingface.co/Nondzu/Mistral-7B-code-16k-qlora).
49
+
50
+ Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
51
+
52
+ <!-- description end -->
53
+ <!-- repositories-available start -->
54
+ ## Repositories available
55
+
56
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-AWQ)
57
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GPTQ)
58
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GGUF)
59
+ * [Kamil's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Nondzu/Mistral-7B-code-16k-qlora)
60
+ <!-- repositories-available end -->
61
+
62
+ <!-- prompt-template start -->
63
+ ## Prompt template: Alpaca
64
+
65
+ ```
66
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
67
+
68
+ ### Instruction:
69
+ {prompt}
70
+
71
+ ### Response:
72
+
73
+ ```
74
+
75
+ <!-- prompt-template end -->
76
+
77
+
78
+ <!-- README_GPTQ.md-provided-files start -->
79
+ ## Provided files, and GPTQ parameters
80
+
81
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
82
+
83
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
84
+
85
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
86
+
87
+ <details>
88
+ <summary>Explanation of GPTQ parameters</summary>
89
+
90
+ - Bits: The bit size of the quantised model.
91
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
92
+ - Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
93
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
94
+ - GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
95
+ - Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
96
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
97
+
98
+ </details>
99
+
100
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
101
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
102
+ | [main](https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 4.16 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
103
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 4.57 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
104
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 7.52 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
105
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 7.68 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
106
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 8.17 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
107
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 4.29 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
108
+
109
+ <!-- README_GPTQ.md-provided-files end -->
110
+
111
+ <!-- README_GPTQ.md-download-from-branches start -->
112
+ ## How to download, including from branches
113
+
114
+ ### In text-generation-webui
115
+
116
+ To download from the `main` branch, enter `TheBloke/Mistral-7B-Code-16K-qlora-GPTQ` in the "Download model" box.
117
+
118
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/Mistral-7B-Code-16K-qlora-GPTQ:gptq-4bit-32g-actorder_True`
119
+
120
+ ### From the command line
121
+
122
+ I recommend using the `huggingface-hub` Python library:
123
+
124
+ ```shell
125
+ pip3 install huggingface-hub
126
+ ```
127
+
128
+ To download the `main` branch to a folder called `Mistral-7B-Code-16K-qlora-GPTQ`:
129
+
130
+ ```shell
131
+ mkdir Mistral-7B-Code-16K-qlora-GPTQ
132
+ huggingface-cli download TheBloke/Mistral-7B-Code-16K-qlora-GPTQ --local-dir Mistral-7B-Code-16K-qlora-GPTQ --local-dir-use-symlinks False
133
+ ```
134
+
135
+ To download from a different branch, add the `--revision` parameter:
136
+
137
+ ```shell
138
+ mkdir Mistral-7B-Code-16K-qlora-GPTQ
139
+ huggingface-cli download TheBloke/Mistral-7B-Code-16K-qlora-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir Mistral-7B-Code-16K-qlora-GPTQ --local-dir-use-symlinks False
140
+ ```
141
+
142
+ <details>
143
+ <summary>More advanced huggingface-cli download usage</summary>
144
+
145
+ If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Huggingface cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
146
+
147
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
148
+
149
+ For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
150
+
151
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
152
+
153
+ ```shell
154
+ pip3 install hf_transfer
155
+ ```
156
+
157
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
158
+
159
+ ```shell
160
+ mkdir Mistral-7B-Code-16K-qlora-GPTQ
161
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Mistral-7B-Code-16K-qlora-GPTQ --local-dir Mistral-7B-Code-16K-qlora-GPTQ --local-dir-use-symlinks False
162
+ ```
163
+
164
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
165
+ </details>
166
+
167
+ ### With `git` (**not** recommended)
168
+
169
+ To clone a specific branch with `git`, use a command like this:
170
+
171
+ ```shell
172
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GPTQ
173
+ ```
174
+
175
+ Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)
176
+
177
+ <!-- README_GPTQ.md-download-from-branches end -->
178
+ <!-- README_GPTQ.md-text-generation-webui start -->
179
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
180
+
181
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
182
+
183
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
184
+
185
+ 1. Click the **Model tab**.
186
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Mistral-7B-Code-16K-qlora-GPTQ`.
187
+
188
+ - To download from a specific branch, enter for example `TheBloke/Mistral-7B-Code-16K-qlora-GPTQ:gptq-4bit-32g-actorder_True`
189
+ - see Provided Files above for the list of branches for each option.
190
+
191
+ 3. Click **Download**.
192
+ 4. The model will start downloading. Once it's finished it will say "Done".
193
+ 5. In the top left, click the refresh icon next to **Model**.
194
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Mistral-7B-Code-16K-qlora-GPTQ`
195
+ 7. The model will automatically load, and is now ready for use!
196
+ 8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
197
+
198
+ - Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
199
+
200
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
201
+
202
+ <!-- README_GPTQ.md-text-generation-webui end -->
203
+
204
+ <!-- README_GPTQ.md-use-from-tgi start -->
205
+ ## Serving this model from Text Generation Inference (TGI)
206
+
207
+ It's recommended to use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
208
+
209
+ Example Docker parameters:
210
+
211
+ ```shell
212
+ --model-id TheBloke/Mistral-7B-Code-16K-qlora-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
213
+ ```
214
+
215
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
216
+
217
+ ```shell
218
+ pip3 install huggingface-hub
219
+ ```
220
+
221
+ ```python
222
+ from huggingface_hub import InferenceClient
223
+
224
+ endpoint_url = "https://your-endpoint-url-here"
225
+
226
+ prompt = "Tell me about AI"
227
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
228
+
229
+ ### Instruction:
230
+ {prompt}
231
+
232
+ ### Response:
233
+ '''
234
+
235
+ client = InferenceClient(endpoint_url)
236
+ response = client.text_generation(prompt,
237
+ max_new_tokens=128,
238
+ do_sample=True,
239
+ temperature=0.7,
240
+ top_p=0.95,
241
+ top_k=40,
242
+ repetition_penalty=1.1)
243
+
244
+ print(f"Model output: {response}")
245
+ ```
246
+ <!-- README_GPTQ.md-use-from-tgi end -->
247
+ <!-- README_GPTQ.md-use-from-python start -->
248
+ ## How to use this GPTQ model from Python code
249
+
250
+ ### Install the necessary packages
251
+
252
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
253
+
254
+ ```shell
255
+ pip3 install transformers optimum
256
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
257
+ ```
258
+
259
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
260
+
261
+ ```shell
262
+ pip3 uninstall -y auto-gptq
263
+ git clone https://github.com/PanQiWei/AutoGPTQ
264
+ cd AutoGPTQ
265
+ git checkout v0.4.2
266
+ pip3 install .
267
+ ```
268
+
269
+ ### You can then use the following code
270
+
271
+ ```python
272
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
273
+
274
+ model_name_or_path = "TheBloke/Mistral-7B-Code-16K-qlora-GPTQ"
275
+ # To use a different branch, change revision
276
+ # For example: revision="gptq-4bit-32g-actorder_True"
277
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
278
+ device_map="auto",
279
+ trust_remote_code=False,
280
+ revision="main")
281
+
282
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
283
+
284
+ prompt = "Tell me about AI"
285
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
286
+
287
+ ### Instruction:
288
+ {prompt}
289
+
290
+ ### Response:
291
+ '''
292
+
293
+ print("\n\n*** Generate:")
294
+
295
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
296
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
297
+ print(tokenizer.decode(output[0]))
298
+
299
+ # Inference can also be done using transformers' pipeline
300
+
301
+ print("*** Pipeline:")
302
+ pipe = pipeline(
303
+ "text-generation",
304
+ model=model,
305
+ tokenizer=tokenizer,
306
+ max_new_tokens=512,
307
+ do_sample=True,
308
+ temperature=0.7,
309
+ top_p=0.95,
310
+ top_k=40,
311
+ repetition_penalty=1.1
312
+ )
313
+
314
+ print(pipe(prompt_template)[0]['generated_text'])
315
+ ```
316
+ <!-- README_GPTQ.md-use-from-python end -->
317
+
318
+ <!-- README_GPTQ.md-compatibility start -->
319
+ ## Compatibility
320
+
321
+ The files provided are tested to work with AutoGPTQ, both via Transformers and using AutoGPTQ directly. They should also work with [Occ4m's GPTQ-for-LLaMa fork](https://github.com/0cc4m/KoboldAI).
322
+
323
+ [ExLlama](https://github.com/turboderp/exllama) is compatible with Llama and Mistral models in 4-bit. Please see the Provided Files table above for per-file compatibility.
324
+
325
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
326
+ <!-- README_GPTQ.md-compatibility end -->
327
+
328
+ <!-- footer start -->
329
+ <!-- 200823 -->
330
+ ## Discord
331
+
332
+ For further support, and discussions on these models and AI in general, join us at:
333
+
334
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
335
+
336
+ ## Thanks, and how to contribute
337
+
338
+ Thanks to the [chirper.ai](https://chirper.ai) team!
339
+
340
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
341
+
342
+ I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
343
+
344
+ If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
345
+
346
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
347
+
348
+ * Patreon: https://patreon.com/TheBlokeAI
349
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
350
+
351
+ **Special thanks to**: Aemon Algiz.
352
+
353
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
354
+
355
+
356
+ Thank you to all my generous patrons and donaters!
357
+
358
+ And thank you again to a16z for their generous grant.
359
+
360
+ <!-- footer end -->
361
+
362
+ # Original model card: Kamil's Mistral 7B Code 16K qLoRA
363
+
364
+ # Mistral-7B-code-16k-qlora
365
+
366
+ I'm excited to announce the release of a new model called Mistral-7B-code-16k-qlora. This small and fast model shows a lot of promise for supporting coding or acting as a copilot. I'm currently looking for people to help me test it out!
367
+
368
+ ## Additional Information
369
+
370
+ This model was trained on 3x RTX 3090 in my homelab, using around 65kWh for approximately 23 cents, which is equivalent to around $15 for electricity.
371
+
372
+ ## Dataset:
373
+ nickrosh/Evol-Instruct-Code-80k-v1
374
+ https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1
375
+ ## Prompt template: Alpaca
376
+ ```
377
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
378
+
379
+ ### Instruction:
380
+ {prompt}
381
+
382
+ ### Response:
383
+ ```
384
+
385
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
386
+ ## Settings:
387
+ ```
388
+ base_model: mistralai/Mistral-7B-Instruct-v0.1
389
+ base_model_config: mistralai/Mistral-7B-Instruct-v0.1
390
+ model_type: MistralForCausalLM
391
+ tokenizer_type: LlamaTokenizer
392
+ is_mistral_derived_model: true
393
+
394
+ load_in_8bit: false
395
+ load_in_4bit: true
396
+ strict: false
397
+
398
+ datasets:
399
+ - path: nickrosh/Evol-Instruct-Code-80k-v1
400
+ type: oasst
401
+ dataset_prepared_path:
402
+ val_set_size: 0.01
403
+ output_dir: ./Mistral-7B-Evol-Instruct-16k-test11
404
+ adapter: qlora
405
+ lora_model_dir:
406
+ # 16384 8192 4096 2048
407
+ sequence_len: 16384
408
+ sample_packing: true
409
+ pad_to_sequence_len: true
410
+ lora_r: 32
411
+ lora_alpha: 16
412
+ lora_dropout: 0.05
413
+ lora_target_modules:
414
+ lora_target_linear: true
415
+ lora_fan_in_fan_out:
416
+
417
+ wandb_project: mistral-code
418
+ wandb_entity:
419
+ wandb_watch:
420
+ wandb_run_id:
421
+ wandb_log_model:
422
+
423
+ gradient_accumulation_steps: 2
424
+ micro_batch_size: 1
425
+ num_epochs: 8
426
+ optimizer: paged_adamw_32bit
427
+ lr_scheduler: cosine
428
+ learning_rate: 0.0002
429
+
430
+ train_on_inputs: false
431
+ group_by_length: false
432
+ bf16: true
433
+ fp16: false
434
+ tf32: false
435
+ gradient_checkpointing: true
436
+ early_stopping_patience:
437
+ resume_from_checkpoint:
438
+ local_rank:
439
+ logging_steps: 1
440
+ xformers_attention:
441
+ flash_attention: true
442
+
443
+ warmup_steps: 10
444
+ eval_steps: 20
445
+ save_steps:
446
+ debug:
447
+ # deepspeed:
448
+ deepspeed: deepspeed/zero2.json
449
+ weight_decay: 0.0
450
+ fsdp:
451
+ fsdp_config:
452
+ special_tokens:
453
+ bos_token: "<s>"
454
+ eos_token: "</s>"
455
+ unk_token: "<unk>"
456
+
457
+ ```
458
+
459
+
460
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63729f35acef705233c87909/NyuqJFDkH00KGvuOwHIuG.png)
461
+
462
+ Check my other projects:
463
+
464
+ https://github.com/Nondzu/LlamaTor