TheBloke commited on
Commit
2692e69
1 Parent(s): a438b59

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +746 -0
README.md ADDED
@@ -0,0 +1,746 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: fblgit/juanako-7b-UNA
3
+ datasets:
4
+ - HuggingFaceH4/ultrafeedback_binarized
5
+ inference: false
6
+ license: apache-2.0
7
+ model-index:
8
+ - name: juanako-7b-UNA
9
+ results:
10
+ - dataset:
11
+ config: multiple_choice
12
+ name: truthful_qa
13
+ split: validation
14
+ type: text-generation
15
+ metrics:
16
+ - type: accuracy
17
+ value: 65.13
18
+ verified: true
19
+ task:
20
+ name: TruthfulQA (MC2)
21
+ type: text-generation
22
+ - dataset:
23
+ config: ARC-Challenge
24
+ name: ai2_arc
25
+ split: test
26
+ type: text-generation
27
+ metrics:
28
+ - type: accuracy
29
+ value: 68.17
30
+ verified: true
31
+ task:
32
+ name: ARC-Challenge
33
+ type: text-generation
34
+ - dataset:
35
+ name: Rowan/hellaswag
36
+ split: test
37
+ type: text-generation
38
+ metrics:
39
+ - type: accuracy
40
+ value: 85.34
41
+ verified: true
42
+ task:
43
+ name: HellaSwag
44
+ type: text-generation
45
+ - dataset:
46
+ config: winogrande_debiased
47
+ name: winogrande
48
+ split: test
49
+ type: text-generation
50
+ metrics:
51
+ - type: accuracy
52
+ value: 78.85
53
+ verified: true
54
+ task:
55
+ name: Winogrande
56
+ type: text-generation
57
+ - dataset:
58
+ config: all
59
+ name: cais/mmlu
60
+ split: test
61
+ type: text-generation
62
+ metrics:
63
+ - type: accuracy
64
+ value: 62.47
65
+ verified: true
66
+ task:
67
+ name: MMLU
68
+ type: text-generation
69
+ - dataset:
70
+ name: piqa
71
+ split: test
72
+ type: text-generation
73
+ metrics:
74
+ - type: accuracy
75
+ value: 83.57
76
+ task:
77
+ name: PiQA
78
+ type: text-generation
79
+ - dataset:
80
+ name: drop
81
+ split: validation
82
+ type: text-generation
83
+ metrics:
84
+ - type: accuracy
85
+ value: 38.74
86
+ verified: true
87
+ task:
88
+ name: DROP
89
+ type: text-generation
90
+ - dataset:
91
+ config: pubmed_qa_artificial_bigbio_qa
92
+ name: bigbio/pubmed_qa
93
+ split: validation
94
+ type: text-generation
95
+ metrics:
96
+ - type: accuracy
97
+ value: 76.0
98
+ task:
99
+ name: PubMedQA
100
+ type: text-generation
101
+ model_creator: FBL
102
+ model_name: Juanako 7B UNA
103
+ model_type: mistral
104
+ prompt_template: '<|im_start|>system
105
+
106
+ {system_message}<|im_end|>
107
+
108
+ <|im_start|>user
109
+
110
+ {prompt}<|im_end|>
111
+
112
+ <|im_start|>assistant
113
+
114
+ '
115
+ quantized_by: TheBloke
116
+ tags:
117
+ - alignment-handbook
118
+ - generated_from_trainer
119
+ - juanako
120
+ - mistral
121
+ - UNA
122
+ ---
123
+ <!-- markdownlint-disable MD041 -->
124
+
125
+ <!-- header start -->
126
+ <!-- 200823 -->
127
+ <div style="width: auto; margin-left: auto; margin-right: auto">
128
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
129
+ </div>
130
+ <div style="display: flex; justify-content: space-between; width: 100%;">
131
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
132
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
133
+ </div>
134
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
135
+ <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>
136
+ </div>
137
+ </div>
138
+ <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>
139
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
140
+ <!-- header end -->
141
+
142
+ # Juanako 7B UNA - GPTQ
143
+ - Model creator: [FBL](https://huggingface.co/fblgit)
144
+ - Original model: [Juanako 7B UNA](https://huggingface.co/fblgit/juanako-7b-UNA)
145
+
146
+ <!-- description start -->
147
+ # Description
148
+
149
+ This repo contains GPTQ model files for [FBL's Juanako 7B UNA](https://huggingface.co/fblgit/juanako-7b-UNA).
150
+
151
+ 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.
152
+
153
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
154
+
155
+ <!-- description end -->
156
+ <!-- repositories-available start -->
157
+ ## Repositories available
158
+
159
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/juanako-7B-UNA-AWQ)
160
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/juanako-7B-UNA-GPTQ)
161
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF)
162
+ * [FBL's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/fblgit/juanako-7b-UNA)
163
+ <!-- repositories-available end -->
164
+
165
+ <!-- prompt-template start -->
166
+ ## Prompt template: ChatML
167
+
168
+ ```
169
+ <|im_start|>system
170
+ {system_message}<|im_end|>
171
+ <|im_start|>user
172
+ {prompt}<|im_end|>
173
+ <|im_start|>assistant
174
+
175
+ ```
176
+
177
+ <!-- prompt-template end -->
178
+
179
+
180
+
181
+ <!-- README_GPTQ.md-compatible clients start -->
182
+ ## Known compatible clients / servers
183
+
184
+ These GPTQ models are known to work in the following inference servers/webuis.
185
+
186
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
187
+ - [KoboldAI United](https://github.com/henk717/koboldai)
188
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
189
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
190
+
191
+ This may not be a complete list; if you know of others, please let me know!
192
+ <!-- README_GPTQ.md-compatible clients end -->
193
+
194
+ <!-- README_GPTQ.md-provided-files start -->
195
+ ## Provided files, and GPTQ parameters
196
+
197
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
198
+
199
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
200
+
201
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
202
+
203
+ <details>
204
+ <summary>Explanation of GPTQ parameters</summary>
205
+
206
+ - Bits: The bit size of the quantised model.
207
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
208
+ - 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.
209
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
210
+ - 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).
211
+ - 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.
212
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
213
+
214
+ </details>
215
+
216
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
217
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
218
+ | [main](https://huggingface.co/TheBloke/juanako-7B-UNA-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 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. |
219
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/juanako-7B-UNA-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.57 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
220
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/juanako-7B-UNA-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 7.52 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
221
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/juanako-7B-UNA-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 7.68 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
222
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/juanako-7B-UNA-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 8.17 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
223
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/juanako-7B-UNA-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.29 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
224
+
225
+ <!-- README_GPTQ.md-provided-files end -->
226
+
227
+ <!-- README_GPTQ.md-download-from-branches start -->
228
+ ## How to download, including from branches
229
+
230
+ ### In text-generation-webui
231
+
232
+ To download from the `main` branch, enter `TheBloke/juanako-7B-UNA-GPTQ` in the "Download model" box.
233
+
234
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/juanako-7B-UNA-GPTQ:gptq-4bit-32g-actorder_True`
235
+
236
+ ### From the command line
237
+
238
+ I recommend using the `huggingface-hub` Python library:
239
+
240
+ ```shell
241
+ pip3 install huggingface-hub
242
+ ```
243
+
244
+ To download the `main` branch to a folder called `juanako-7B-UNA-GPTQ`:
245
+
246
+ ```shell
247
+ mkdir juanako-7B-UNA-GPTQ
248
+ huggingface-cli download TheBloke/juanako-7B-UNA-GPTQ --local-dir juanako-7B-UNA-GPTQ --local-dir-use-symlinks False
249
+ ```
250
+
251
+ To download from a different branch, add the `--revision` parameter:
252
+
253
+ ```shell
254
+ mkdir juanako-7B-UNA-GPTQ
255
+ huggingface-cli download TheBloke/juanako-7B-UNA-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir juanako-7B-UNA-GPTQ --local-dir-use-symlinks False
256
+ ```
257
+
258
+ <details>
259
+ <summary>More advanced huggingface-cli download usage</summary>
260
+
261
+ If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Hugging Face 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.
262
+
263
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
264
+
265
+ 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).
266
+
267
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
268
+
269
+ ```shell
270
+ pip3 install hf_transfer
271
+ ```
272
+
273
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
274
+
275
+ ```shell
276
+ mkdir juanako-7B-UNA-GPTQ
277
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/juanako-7B-UNA-GPTQ --local-dir juanako-7B-UNA-GPTQ --local-dir-use-symlinks False
278
+ ```
279
+
280
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
281
+ </details>
282
+
283
+ ### With `git` (**not** recommended)
284
+
285
+ To clone a specific branch with `git`, use a command like this:
286
+
287
+ ```shell
288
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/juanako-7B-UNA-GPTQ
289
+ ```
290
+
291
+ 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.)
292
+
293
+ <!-- README_GPTQ.md-download-from-branches end -->
294
+ <!-- README_GPTQ.md-text-generation-webui start -->
295
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
296
+
297
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
298
+
299
+ 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.
300
+
301
+ 1. Click the **Model tab**.
302
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/juanako-7B-UNA-GPTQ`.
303
+
304
+ - To download from a specific branch, enter for example `TheBloke/juanako-7B-UNA-GPTQ:gptq-4bit-32g-actorder_True`
305
+ - see Provided Files above for the list of branches for each option.
306
+
307
+ 3. Click **Download**.
308
+ 4. The model will start downloading. Once it's finished it will say "Done".
309
+ 5. In the top left, click the refresh icon next to **Model**.
310
+ 6. In the **Model** dropdown, choose the model you just downloaded: `juanako-7B-UNA-GPTQ`
311
+ 7. The model will automatically load, and is now ready for use!
312
+ 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.
313
+
314
+ - 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`.
315
+
316
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
317
+
318
+ <!-- README_GPTQ.md-text-generation-webui end -->
319
+
320
+ <!-- README_GPTQ.md-use-from-tgi start -->
321
+ ## Serving this model from Text Generation Inference (TGI)
322
+
323
+ 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`
324
+
325
+ Example Docker parameters:
326
+
327
+ ```shell
328
+ --model-id TheBloke/juanako-7B-UNA-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
329
+ ```
330
+
331
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
332
+
333
+ ```shell
334
+ pip3 install huggingface-hub
335
+ ```
336
+
337
+ ```python
338
+ from huggingface_hub import InferenceClient
339
+
340
+ endpoint_url = "https://your-endpoint-url-here"
341
+
342
+ prompt = "Tell me about AI"
343
+ prompt_template=f'''<|im_start|>system
344
+ {system_message}<|im_end|>
345
+ <|im_start|>user
346
+ {prompt}<|im_end|>
347
+ <|im_start|>assistant
348
+ '''
349
+
350
+ client = InferenceClient(endpoint_url)
351
+ response = client.text_generation(prompt,
352
+ max_new_tokens=128,
353
+ do_sample=True,
354
+ temperature=0.7,
355
+ top_p=0.95,
356
+ top_k=40,
357
+ repetition_penalty=1.1)
358
+
359
+ print(f"Model output: {response}")
360
+ ```
361
+ <!-- README_GPTQ.md-use-from-tgi end -->
362
+ <!-- README_GPTQ.md-use-from-python start -->
363
+ ## Python code example: inference from this GPTQ model
364
+
365
+ ### Install the necessary packages
366
+
367
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
368
+
369
+ ```shell
370
+ pip3 install --upgrade transformers optimum
371
+ # If using PyTorch 2.1 + CUDA 12.x:
372
+ pip3 install --upgrade auto-gptq
373
+ # or, if using PyTorch 2.1 + CUDA 11.x:
374
+ pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
375
+ ```
376
+
377
+ If you are using PyTorch 2.0, you will need to install AutoGPTQ from source. Likewise if you have problems with the pre-built wheels, you should try building from source:
378
+
379
+ ```shell
380
+ pip3 uninstall -y auto-gptq
381
+ git clone https://github.com/PanQiWei/AutoGPTQ
382
+ cd AutoGPTQ
383
+ git checkout v0.5.1
384
+ pip3 install .
385
+ ```
386
+
387
+ ### Example Python code
388
+
389
+ ```python
390
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
391
+
392
+ model_name_or_path = "TheBloke/juanako-7B-UNA-GPTQ"
393
+ # To use a different branch, change revision
394
+ # For example: revision="gptq-4bit-32g-actorder_True"
395
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
396
+ device_map="auto",
397
+ trust_remote_code=False,
398
+ revision="main")
399
+
400
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
401
+
402
+ prompt = "Tell me about AI"
403
+ prompt_template=f'''<|im_start|>system
404
+ {system_message}<|im_end|>
405
+ <|im_start|>user
406
+ {prompt}<|im_end|>
407
+ <|im_start|>assistant
408
+ '''
409
+
410
+ print("\n\n*** Generate:")
411
+
412
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
413
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
414
+ print(tokenizer.decode(output[0]))
415
+
416
+ # Inference can also be done using transformers' pipeline
417
+
418
+ print("*** Pipeline:")
419
+ pipe = pipeline(
420
+ "text-generation",
421
+ model=model,
422
+ tokenizer=tokenizer,
423
+ max_new_tokens=512,
424
+ do_sample=True,
425
+ temperature=0.7,
426
+ top_p=0.95,
427
+ top_k=40,
428
+ repetition_penalty=1.1
429
+ )
430
+
431
+ print(pipe(prompt_template)[0]['generated_text'])
432
+ ```
433
+ <!-- README_GPTQ.md-use-from-python end -->
434
+
435
+ <!-- README_GPTQ.md-compatibility start -->
436
+ ## Compatibility
437
+
438
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
439
+
440
+ [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.
441
+
442
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
443
+ <!-- README_GPTQ.md-compatibility end -->
444
+
445
+ <!-- footer start -->
446
+ <!-- 200823 -->
447
+ ## Discord
448
+
449
+ For further support, and discussions on these models and AI in general, join us at:
450
+
451
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
452
+
453
+ ## Thanks, and how to contribute
454
+
455
+ Thanks to the [chirper.ai](https://chirper.ai) team!
456
+
457
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
458
+
459
+ 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.
460
+
461
+ 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.
462
+
463
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
464
+
465
+ * Patreon: https://patreon.com/TheBlokeAI
466
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
467
+
468
+ **Special thanks to**: Aemon Algiz.
469
+
470
+ **Patreon special mentions**: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
471
+
472
+
473
+ Thank you to all my generous patrons and donaters!
474
+
475
+ And thank you again to a16z for their generous grant.
476
+
477
+ <!-- footer end -->
478
+
479
+ # Original model card: FBL's Juanako 7B UNA
480
+
481
+
482
+ # juanako-7b-UNA (Uniform Neural Alignment)
483
+
484
+ This model is a fine-tuned version of [fblgit/juanako-7b-UNA-v2-phase-1](https://huggingface.co/fblgit/juanako-7b-UNA-v2-phase-1) on the HuggingFaceH4/ultrafeedback_binarized dataset.
485
+ It outperforms in many aspects most of the current Mistral based models and is the **latest and most powerful juanako version as of now**.
486
+
487
+ ## Scores
488
+
489
+ The official HuggingFace results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/results/blob/main/fblgit/juanako-7b-UNA/results_2023-11-28T08-33-33.965228.json)
490
+
491
+ | Model | Average ⬆️| ARC (25-s) ⬆️ | HellaSwag (10-s) ⬆️ | MMLU (5-s) ⬆️| TruthfulQA (MC) (0-s) ⬆️ | Winogrande (5-s) | GSM8K (5-s) | DROP (3-s) |
492
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
493
+ |[mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) | 50.32 | 59.58 | 83.31 | 64.16 | 42.15 | 78.37 | 18.12 | 6.14 |
494
+ | [Intel/neural-chat-7b-v3-1](https://huggingface.co/Intel/neural-chat-7b-v3-1) | 59.0 | 66.21 | 83.64 | 62.37 | 59.65 | 78.14 | 19.56 | 43.84 |
495
+ | [fblgit/juanako-7b-UNA](https://huggingface.co/fblgit/juanako-7b-UNA) | **59.91** | **68.17** | **85.34** | 62.47 | **65.13** | **78.85** | **20.7** | 38.74 |
496
+
497
+ It scores: **59.91** according HuggingFace LLM Leaderboard.
498
+ It scores: **65.1** with `big-refactor` branch of lm-eval-harness
499
+
500
+ Author [Xavier M.](mailto:[email protected]) @fblgit
501
+
502
+ ## Model description
503
+
504
+ juanako uses UNA, Uniform Neural Alignment. A training technique that ease alignment between transformer layers yet to be published.
505
+
506
+ ### Prompts
507
+ The following prompts showed positive results, it may depend the task and needs further experimentation but this should work for starters:
508
+ ```
509
+ <|im_start|>system
510
+ - You are a helpful assistant chatbot trained by MosaicML.
511
+ - You answer questions.
512
+ - You are excited to be able to help the user, but will refuse to do anything that could be considered harmful to the user.
513
+ - You are more than just an information source, you are also able to write poetry, short stories, and make jokes.<|im_end|>
514
+ <|im_start|>user
515
+ Explain QKV<|im_end|>
516
+ <|im_start|>assistant
517
+ ```
518
+ ```
519
+ ### Assistant: I am StableVicuna, a large language model created by CarperAI. I am here to chat!
520
+
521
+ ### Human: Explain QKV
522
+ ### Assistant:
523
+ ```
524
+ ```
525
+ [Round <|round|>]
526
+ 问:Explain QKV
527
+ 答:
528
+ ```
529
+ ```
530
+ [Round <|round|>]
531
+ Question:Explain QKV
532
+ Answer:
533
+ ```
534
+ ```
535
+ Question:Explain QKV
536
+ Answer:
537
+ ```
538
+
539
+ ## Evaluations (lm-eval big-refactor branch)
540
+
541
+ ### TruthfulQA 0-Shot
542
+ ```
543
+ | Tasks |Version|Filter|Metric|Value | |Stderr|
544
+ |--------------|-------|------|------|-----:|---|-----:|
545
+ |truthfulqa_mc2|Yaml |none |acc |0.6549|± |0.0153|
546
+ ```
547
+ ### ARC 25-Shot
548
+ ```
549
+ | Tasks |Version|Filter| Metric |Value | |Stderr|
550
+ |-------------|-------|------|--------|-----:|---|-----:|
551
+ |arc_challenge|Yaml |none |acc |0.6476|± |0.0140|
552
+ | | |none |acc_norm|0.6809|± |0.0136|
553
+ ```
554
+ ### HellaSwag 10-Shot
555
+ ```
556
+ | Tasks |Version|Filter| Metric |Value | |Stderr|
557
+ |---------|-------|------|--------|-----:|---|-----:|
558
+ |hellaswag|Yaml |none |acc |0.6703|± |0.0047|
559
+ | | |none |acc_norm|0.8520|± |0.0035|
560
+ ```
561
+ ### GSM8k 5-Shot
562
+ ```
563
+ |Tasks|Version| Filter | Metric |Value | |Stderr|
564
+ |-----|-------|----------|-----------|-----:|---|-----:|
565
+ |gsm8k|Yaml |get-answer|exact_match|0.4898|± |0.0138|
566
+ ```
567
+ ### GPT Evaluations 0-Shot
568
+ ```
569
+ | Tasks |Version|Filter| Metric |Value | |Stderr|
570
+ |--------------|-------|------|----------|-----:|---|-----:|
571
+ |boolq |Yaml |none |acc |0.8703|± |0.0059|
572
+ |lambada_openai|Yaml |none |perplexity|3.2598|± |0.0705|
573
+ | | |none |acc |0.7336|± |0.0062|
574
+ |piqa |Yaml |none |acc |0.8254|± |0.0089|
575
+ | | |none |acc_norm |0.8292|± |0.0088|
576
+ |sciq |Yaml |none |acc |0.9580|± |0.0063|
577
+ | | |none |acc_norm |0.9130|± |0.0089|
578
+ ```
579
+ ### MathQA 0-Shot
580
+ ```
581
+ |Tasks |Version|Filter| Metric |Value | |Stderr|
582
+ |------|-------|------|--------|-----:|---|-----:|
583
+ |mathqa|Yaml |none |acc |0.3752|± |0.0089|
584
+ | | |none |acc_norm|0.3772|± |0.0089|
585
+ ```
586
+ ### PiQa 1-Shot
587
+ ```
588
+ |Tasks|Version|Filter| Metric |Value | |Stderr|
589
+ |-----|-------|------|--------|-----:|---|-----:|
590
+ |piqa |Yaml |none |acc |0.8308|± |0.0087|
591
+ | | |none |acc_norm|0.8357|± |0.0086|
592
+ ```
593
+ ### Winogrande 5-Shot
594
+ ```
595
+ | Tasks |Version|Filter|Metric|Value| |Stderr|
596
+ |----------|-------|------|------|----:|---|-----:|
597
+ |winogrande|Yaml |none |acc |0.768|± |0.0119|
598
+ ```
599
+ ### PubMedQA 0-Shot
600
+ ```
601
+ | Tasks |Version|Filter|Metric|Value| |Stderr|
602
+ |--------|-------|------|------|----:|---|-----:|
603
+ |pubmedqa|Yaml |none |acc | 0.76|± |0.0191|
604
+ ```
605
+ ### RACE 1-Shot
606
+ ```
607
+ |Tasks|Version|Filter|Metric|Value | |Stderr|
608
+ |-----|-------|------|------|-----:|---|-----:|
609
+ |race |Yaml |none |acc |0.5282|± |0.0154|
610
+ ```
611
+ ### MMLU 5-Shot (8-Bit)
612
+ ```
613
+ | Groups |Version|Filter|Metric|Value | |Stderr|
614
+ |------------------|-------|------|------|-----:|---|-----:|
615
+ |mmlu |N/A |none |acc |0.6137|± |0.1243|
616
+ | - humanities |N/A |none |acc |0.5671|± |0.1101|
617
+ | - other |N/A |none |acc |0.6859|± |0.1164|
618
+ | - social_sciences|N/A |none |acc |0.7195|± |0.0713|
619
+ | - stem |N/A |none |acc |0.5087|± |0.1297|
620
+ ```
621
+ ### DROP 3-Shot (8-Bit) (Instruct-Eval)
622
+ ```
623
+ {'score': 0.49801113762927607}
624
+ {'drop': 49.8}
625
+ drop: 49.8
626
+ ```
627
+
628
+ ### CRASS 0-Shot (Instruct-Eval)
629
+ ```
630
+ {'score': 0.8357664233576643}
631
+ {'crass': 83.58}
632
+ crass: 83.58
633
+ ```
634
+
635
+ ## Training Details
636
+
637
+ ### Training hyperparameters
638
+
639
+ The following hyperparameters were used during training:
640
+ - learning_rate: 0.0001
641
+ - train_batch_size: 1
642
+ - eval_batch_size: 1
643
+ - seed: 42
644
+ - distributed_type: multi-GPU
645
+ - num_devices: 14
646
+ - gradient_accumulation_steps: 16
647
+ - total_train_batch_size: 224
648
+ - total_eval_batch_size: 14
649
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
650
+ - lr_scheduler_type: linear
651
+ - lr_scheduler_warmup_ratio: 0.01
652
+ - num_epochs: 1
653
+
654
+ ### Training results
655
+
656
+ | Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
657
+ |:-------------:|:-----:|:----:|:---------------:|:--------------:|:----------------:|:------------------:|:---------------:|:--------------:|:------------:|:---------------:|:-------------:|
658
+ | 0.4795 | 0.2 | 56 | 0.4958 | -1.3684 | -2.6385 | 0.7552 | 1.2701 | -265.3887 | -241.2612 | -2.2572 | -2.4922 |
659
+ | 0.4642 | 0.4 | 112 | 0.4859 | -1.0380 | -1.9769 | 0.7273 | 0.9389 | -258.7718 | -237.9569 | -2.2414 | -2.4751 |
660
+ | 0.4758 | 0.61 | 168 | 0.4808 | -1.2594 | -2.3704 | 0.7343 | 1.1110 | -262.7074 | -240.1708 | -2.2305 | -2.4633 |
661
+ | 0.4549 | 0.81 | 224 | 0.4768 | -1.1906 | -2.3201 | 0.7552 | 1.1295 | -262.2044 | -239.4827 | -2.2284 | -2.4610 |
662
+
663
+
664
+ ### Framework versions
665
+
666
+ - Transformers 4.35.0-UNA
667
+ - Pytorch 2.1.0
668
+ - Datasets 2.14.6
669
+ - Tokenizers 0.14.1
670
+
671
+ ## Citations
672
+ If you find juanako useful please:
673
+
674
+ ```
675
+ @misc{juanako7buna,
676
+ title={Juanako: Uniform Neural Alignment},
677
+ author={Xavier Murias},
678
+ year={2023},
679
+ publisher = {HuggingFace},
680
+ journal = {HuggingFace repository},
681
+ howpublished = {\url{https://huggingface.co/fblgit/juanako-7b-UNA}},
682
+ }
683
+ ```
684
+
685
+ Thanks to all the brilliant humans behind the creation of AI, here some of the ones that we find relevant to our research. If you feel a citation is missing, please contact.
686
+ ```
687
+ @misc{lin2021truthfulqa,
688
+ title={TruthfulQA: Measuring How Models Mimic Human Falsehoods},
689
+ author={Stephanie Lin and Jacob Hilton and Owain Evans},
690
+ year={2021},
691
+ eprint={2109.07958},
692
+ archivePrefix={arXiv},
693
+ primaryClass={cs.CL}
694
+ }
695
+ @misc{tunstall2023zephyr,
696
+ title={Zephyr: Direct Distillation of LM Alignment},
697
+ author={Lewis Tunstall and Edward Beeching and Nathan Lambert and Nazneen Rajani and Kashif Rasul and Younes Belkada and Shengyi Huang and Leandro von Werra and Clémentine Fourrier and Nathan Habib and Nathan Sarrazin and Omar Sanseviero and Alexander M. Rush and Thomas Wolf},
698
+ year={2023},
699
+ eprint={2310.16944},
700
+ archivePrefix={arXiv},
701
+ primaryClass={cs.LG}
702
+ }
703
+ @inproceedings{Bisk2020,
704
+ author = {Yonatan Bisk and Rowan Zellers and
705
+ Ronan Le Bras and Jianfeng Gao
706
+ and Yejin Choi},
707
+ title = {PIQA: Reasoning about Physical Commonsense in
708
+ Natural Language},
709
+ booktitle = {Thirty-Fourth AAAI Conference on
710
+ Artificial Intelligence},
711
+ year = {2020},
712
+ }
713
+ @software{eval-harness,
714
+ author = {Gao, Leo and
715
+ Tow, Jonathan and
716
+ Biderman, Stella and
717
+ Black, Sid and
718
+ DiPofi, Anthony and
719
+ Foster, Charles and
720
+ Golding, Laurence and
721
+ Hsu, Jeffrey and
722
+ McDonell, Kyle and
723
+ Muennighoff, Niklas and
724
+ Phang, Jason and
725
+ Reynolds, Laria and
726
+ Tang, Eric and
727
+ Thite, Anish and
728
+ Wang, Ben and
729
+ Wang, Kevin and
730
+ Zou, Andy},
731
+ title = {A framework for few-shot language model evaluation},
732
+ month = sep,
733
+ year = 2021,
734
+ publisher = {Zenodo},
735
+ version = {v0.0.1},
736
+ doi = {10.5281/zenodo.5371628},
737
+ url = {https://doi.org/10.5281/zenodo.5371628}
738
+ }
739
+ @misc{rafailov2023direct,
740
+ title={Direct Preference Optimization: Your Language Model is Secretly a Reward Model},
741
+ author={Rafael Rafailov and Archit Sharma and Eric Mitchell and Stefano Ermon and Christopher D. Manning and Chelsea Finn},
742
+ year={2023},
743
+ eprint={2305.18290},
744
+ archivePrefix={arXiv},
745
+ }
746
+ ```