Transformers
GGUF
mistral
alignment-handbook
Generated from Trainer
juanako
UNA
Eval Results
conversational
TheBloke commited on
Commit
1f2f201
1 Parent(s): c748bd4

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +703 -0
README.md ADDED
@@ -0,0 +1,703 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 - GGUF
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 GGUF format model files for [FBL's Juanako 7B UNA](https://huggingface.co/fblgit/juanako-7b-UNA).
150
+
151
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
152
+
153
+ <!-- description end -->
154
+ <!-- README_GGUF.md-about-gguf start -->
155
+ ### About GGUF
156
+
157
+ GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.
158
+
159
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
160
+
161
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
162
+ * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI, with many features and powerful extensions. Supports GPU acceleration.
163
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), a fully featured web UI, with GPU accel across all platforms and GPU architectures. Especially good for story telling.
164
+ * [GPT4All](https://gpt4all.io/index.html), a free and open source local running GUI, supporting Windows, Linux and macOS with full GPU accel.
165
+ * [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration. Linux available, in beta as of 27/11/2023.
166
+ * [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with many interesting and unique features, including a full model library for easy model selection.
167
+ * [Faraday.dev](https://faraday.dev/), an attractive and easy to use character-based chat GUI for Windows and macOS (both Silicon and Intel), with GPU acceleration.
168
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
169
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
170
+ * [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server. Note, as of time of writing (November 27th 2023), ctransformers has not been updated in a long time and does not support many recent models.
171
+
172
+ <!-- README_GGUF.md-about-gguf end -->
173
+ <!-- repositories-available start -->
174
+ ## Repositories available
175
+
176
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/juanako-7B-UNA-AWQ)
177
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/juanako-7B-UNA-GPTQ)
178
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF)
179
+ * [FBL's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/fblgit/juanako-7b-UNA)
180
+ <!-- repositories-available end -->
181
+
182
+ <!-- prompt-template start -->
183
+ ## Prompt template: ChatML
184
+
185
+ ```
186
+ <|im_start|>system
187
+ {system_message}<|im_end|>
188
+ <|im_start|>user
189
+ {prompt}<|im_end|>
190
+ <|im_start|>assistant
191
+
192
+ ```
193
+
194
+ <!-- prompt-template end -->
195
+
196
+
197
+ <!-- compatibility_gguf start -->
198
+ ## Compatibility
199
+
200
+ These quantised GGUFv2 files are compatible with llama.cpp from August 27th onwards, as of commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221)
201
+
202
+ They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
203
+
204
+ ## Explanation of quantisation methods
205
+
206
+ <details>
207
+ <summary>Click to see details</summary>
208
+
209
+ The new methods available are:
210
+
211
+ * GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
212
+ * GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
213
+ * GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
214
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
215
+ * GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
216
+
217
+ Refer to the Provided Files table below to see what files use which methods, and how.
218
+ </details>
219
+ <!-- compatibility_gguf end -->
220
+
221
+ <!-- README_GGUF.md-provided-files start -->
222
+ ## Provided files
223
+
224
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
225
+ | ---- | ---- | ---- | ---- | ---- | ----- |
226
+ | [juanako-7b-una.Q2_K.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q2_K.gguf) | Q2_K | 2 | 3.08 GB| 5.58 GB | smallest, significant quality loss - not recommended for most purposes |
227
+ | [juanako-7b-una.Q3_K_S.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q3_K_S.gguf) | Q3_K_S | 3 | 3.16 GB| 5.66 GB | very small, high quality loss |
228
+ | [juanako-7b-una.Q3_K_M.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q3_K_M.gguf) | Q3_K_M | 3 | 3.52 GB| 6.02 GB | very small, high quality loss |
229
+ | [juanako-7b-una.Q3_K_L.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q3_K_L.gguf) | Q3_K_L | 3 | 3.82 GB| 6.32 GB | small, substantial quality loss |
230
+ | [juanako-7b-una.Q4_0.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q4_0.gguf) | Q4_0 | 4 | 4.11 GB| 6.61 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
231
+ | [juanako-7b-una.Q4_K_S.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q4_K_S.gguf) | Q4_K_S | 4 | 4.14 GB| 6.64 GB | small, greater quality loss |
232
+ | [juanako-7b-una.Q4_K_M.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q4_K_M.gguf) | Q4_K_M | 4 | 4.37 GB| 6.87 GB | medium, balanced quality - recommended |
233
+ | [juanako-7b-una.Q5_0.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q5_0.gguf) | Q5_0 | 5 | 5.00 GB| 7.50 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
234
+ | [juanako-7b-una.Q5_K_S.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q5_K_S.gguf) | Q5_K_S | 5 | 5.00 GB| 7.50 GB | large, low quality loss - recommended |
235
+ | [juanako-7b-una.Q5_K_M.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q5_K_M.gguf) | Q5_K_M | 5 | 5.13 GB| 7.63 GB | large, very low quality loss - recommended |
236
+ | [juanako-7b-una.Q6_K.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q6_K.gguf) | Q6_K | 6 | 5.94 GB| 8.44 GB | very large, extremely low quality loss |
237
+ | [juanako-7b-una.Q8_0.gguf](https://huggingface.co/TheBloke/juanako-7B-UNA-GGUF/blob/main/juanako-7b-una.Q8_0.gguf) | Q8_0 | 8 | 7.70 GB| 10.20 GB | very large, extremely low quality loss - not recommended |
238
+
239
+ **Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
240
+
241
+
242
+
243
+ <!-- README_GGUF.md-provided-files end -->
244
+
245
+ <!-- README_GGUF.md-how-to-download start -->
246
+ ## How to download GGUF files
247
+
248
+ **Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single file.
249
+
250
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
251
+
252
+ * LM Studio
253
+ * LoLLMS Web UI
254
+ * Faraday.dev
255
+
256
+ ### In `text-generation-webui`
257
+
258
+ Under Download Model, you can enter the model repo: TheBloke/juanako-7B-UNA-GGUF and below it, a specific filename to download, such as: juanako-7b-una.Q4_K_M.gguf.
259
+
260
+ Then click Download.
261
+
262
+ ### On the command line, including multiple files at once
263
+
264
+ I recommend using the `huggingface-hub` Python library:
265
+
266
+ ```shell
267
+ pip3 install huggingface-hub
268
+ ```
269
+
270
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
271
+
272
+ ```shell
273
+ huggingface-cli download TheBloke/juanako-7B-UNA-GGUF juanako-7b-una.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
274
+ ```
275
+
276
+ <details>
277
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
278
+
279
+ You can also download multiple files at once with a pattern:
280
+
281
+ ```shell
282
+ huggingface-cli download TheBloke/juanako-7B-UNA-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
283
+ ```
284
+
285
+ 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).
286
+
287
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
288
+
289
+ ```shell
290
+ pip3 install hf_transfer
291
+ ```
292
+
293
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
294
+
295
+ ```shell
296
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/juanako-7B-UNA-GGUF juanako-7b-una.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
297
+ ```
298
+
299
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
300
+ </details>
301
+ <!-- README_GGUF.md-how-to-download end -->
302
+
303
+ <!-- README_GGUF.md-how-to-run start -->
304
+ ## Example `llama.cpp` command
305
+
306
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
307
+
308
+ ```shell
309
+ ./main -ngl 35 -m juanako-7b-una.Q4_K_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<|im_start|>system\n{system_message}<|im_end|>\n<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant"
310
+ ```
311
+
312
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
313
+
314
+ Change `-c 32768` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically. Note that longer sequence lengths require much more resources, so you may need to reduce this value.
315
+
316
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
317
+
318
+ For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
319
+
320
+ ## How to run in `text-generation-webui`
321
+
322
+ Further instructions can be found in the text-generation-webui documentation, here: [text-generation-webui/docs/04 ‐ Model Tab.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/04%20%E2%80%90%20Model%20Tab.md#llamacpp).
323
+
324
+ ## How to run from Python code
325
+
326
+ You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries. Note that at the time of writing (Nov 27th 2023), ctransformers has not been updated for some time and is not compatible with some recent models. Therefore I recommend you use llama-cpp-python.
327
+
328
+ ### How to load this model in Python code, using llama-cpp-python
329
+
330
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
331
+
332
+ #### First install the package
333
+
334
+ Run one of the following commands, according to your system:
335
+
336
+ ```shell
337
+ # Base ctransformers with no GPU acceleration
338
+ pip install llama-cpp-python
339
+ # With NVidia CUDA acceleration
340
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
341
+ # Or with OpenBLAS acceleration
342
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
343
+ # Or with CLBLast acceleration
344
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
345
+ # Or with AMD ROCm GPU acceleration (Linux only)
346
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
347
+ # Or with Metal GPU acceleration for macOS systems only
348
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
349
+
350
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
351
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
352
+ pip install llama-cpp-python
353
+ ```
354
+
355
+ #### Simple llama-cpp-python example code
356
+
357
+ ```python
358
+ from llama_cpp import Llama
359
+
360
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
361
+ llm = Llama(
362
+ model_path="./juanako-7b-una.Q4_K_M.gguf", # Download the model file first
363
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
364
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
365
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
366
+ )
367
+
368
+ # Simple inference example
369
+ output = llm(
370
+ "<|im_start|>system\n{system_message}<|im_end|>\n<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant", # Prompt
371
+ max_tokens=512, # Generate up to 512 tokens
372
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
373
+ echo=True # Whether to echo the prompt
374
+ )
375
+
376
+ # Chat Completion API
377
+
378
+ llm = Llama(model_path="./juanako-7b-una.Q4_K_M.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
379
+ llm.create_chat_completion(
380
+ messages = [
381
+ {"role": "system", "content": "You are a story writing assistant."},
382
+ {
383
+ "role": "user",
384
+ "content": "Write a story about llamas."
385
+ }
386
+ ]
387
+ )
388
+ ```
389
+
390
+ ## How to use with LangChain
391
+
392
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
393
+
394
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
395
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
396
+
397
+ <!-- README_GGUF.md-how-to-run end -->
398
+
399
+ <!-- footer start -->
400
+ <!-- 200823 -->
401
+ ## Discord
402
+
403
+ For further support, and discussions on these models and AI in general, join us at:
404
+
405
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
406
+
407
+ ## Thanks, and how to contribute
408
+
409
+ Thanks to the [chirper.ai](https://chirper.ai) team!
410
+
411
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
412
+
413
+ 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.
414
+
415
+ 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.
416
+
417
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
418
+
419
+ * Patreon: https://patreon.com/TheBlokeAI
420
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
421
+
422
+ **Special thanks to**: Aemon Algiz.
423
+
424
+ **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
425
+
426
+
427
+ Thank you to all my generous patrons and donaters!
428
+
429
+ And thank you again to a16z for their generous grant.
430
+
431
+ <!-- footer end -->
432
+
433
+ <!-- original-model-card start -->
434
+ # Original model card: FBL's Juanako 7B UNA
435
+
436
+
437
+ # juanako-7b-UNA (Uniform Neural Alignment)
438
+
439
+ 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.
440
+ It outperforms in many aspects most of the current Mistral based models and is the **latest and most powerful juanako version as of now**.
441
+
442
+ ## Scores
443
+
444
+ 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)
445
+
446
+ | Model | Average ⬆️| ARC (25-s) ⬆️ | HellaSwag (10-s) ⬆️ | MMLU (5-s) ⬆️| TruthfulQA (MC) (0-s) ⬆️ | Winogrande (5-s) | GSM8K (5-s) | DROP (3-s) |
447
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
448
+ |[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 |
449
+ | [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 |
450
+ | [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 |
451
+
452
+ It scores: **59.91** according HuggingFace LLM Leaderboard.
453
+ It scores: **65.1** with `big-refactor` branch of lm-eval-harness
454
+
455
+ Author [Xavier M.](mailto:[email protected]) @fblgit
456
+
457
+ ## Model description
458
+
459
+ juanako uses UNA, Uniform Neural Alignment. A training technique that ease alignment between transformer layers yet to be published.
460
+
461
+ ### Prompts
462
+ The following prompts showed positive results, it may depend the task and needs further experimentation but this should work for starters:
463
+ ```
464
+ <|im_start|>system
465
+ - You are a helpful assistant chatbot trained by MosaicML.
466
+ - You answer questions.
467
+ - You are excited to be able to help the user, but will refuse to do anything that could be considered harmful to the user.
468
+ - You are more than just an information source, you are also able to write poetry, short stories, and make jokes.<|im_end|>
469
+ <|im_start|>user
470
+ Explain QKV<|im_end|>
471
+ <|im_start|>assistant
472
+ ```
473
+ ```
474
+ ### Assistant: I am StableVicuna, a large language model created by CarperAI. I am here to chat!
475
+
476
+ ### Human: Explain QKV
477
+ ### Assistant:
478
+ ```
479
+ ```
480
+ [Round <|round|>]
481
+ 问:Explain QKV
482
+ 答:
483
+ ```
484
+ ```
485
+ [Round <|round|>]
486
+ Question:Explain QKV
487
+ Answer:
488
+ ```
489
+ ```
490
+ Question:Explain QKV
491
+ Answer:
492
+ ```
493
+
494
+ ## Evaluations (lm-eval big-refactor branch)
495
+
496
+ ### TruthfulQA 0-Shot
497
+ ```
498
+ | Tasks |Version|Filter|Metric|Value | |Stderr|
499
+ |--------------|-------|------|------|-----:|---|-----:|
500
+ |truthfulqa_mc2|Yaml |none |acc |0.6549|± |0.0153|
501
+ ```
502
+ ### ARC 25-Shot
503
+ ```
504
+ | Tasks |Version|Filter| Metric |Value | |Stderr|
505
+ |-------------|-------|------|--------|-----:|---|-----:|
506
+ |arc_challenge|Yaml |none |acc |0.6476|± |0.0140|
507
+ | | |none |acc_norm|0.6809|± |0.0136|
508
+ ```
509
+ ### HellaSwag 10-Shot
510
+ ```
511
+ | Tasks |Version|Filter| Metric |Value | |Stderr|
512
+ |---------|-------|------|--------|-----:|---|-----:|
513
+ |hellaswag|Yaml |none |acc |0.6703|± |0.0047|
514
+ | | |none |acc_norm|0.8520|± |0.0035|
515
+ ```
516
+ ### GSM8k 5-Shot
517
+ ```
518
+ |Tasks|Version| Filter | Metric |Value | |Stderr|
519
+ |-----|-------|----------|-----------|-----:|---|-----:|
520
+ |gsm8k|Yaml |get-answer|exact_match|0.4898|± |0.0138|
521
+ ```
522
+ ### GPT Evaluations 0-Shot
523
+ ```
524
+ | Tasks |Version|Filter| Metric |Value | |Stderr|
525
+ |--------------|-------|------|----------|-----:|---|-----:|
526
+ |boolq |Yaml |none |acc |0.8703|± |0.0059|
527
+ |lambada_openai|Yaml |none |perplexity|3.2598|± |0.0705|
528
+ | | |none |acc |0.7336|± |0.0062|
529
+ |piqa |Yaml |none |acc |0.8254|± |0.0089|
530
+ | | |none |acc_norm |0.8292|± |0.0088|
531
+ |sciq |Yaml |none |acc |0.9580|± |0.0063|
532
+ | | |none |acc_norm |0.9130|± |0.0089|
533
+ ```
534
+ ### MathQA 0-Shot
535
+ ```
536
+ |Tasks |Version|Filter| Metric |Value | |Stderr|
537
+ |------|-------|------|--------|-----:|---|-----:|
538
+ |mathqa|Yaml |none |acc |0.3752|± |0.0089|
539
+ | | |none |acc_norm|0.3772|± |0.0089|
540
+ ```
541
+ ### PiQa 1-Shot
542
+ ```
543
+ |Tasks|Version|Filter| Metric |Value | |Stderr|
544
+ |-----|-------|------|--------|-----:|---|-----:|
545
+ |piqa |Yaml |none |acc |0.8308|± |0.0087|
546
+ | | |none |acc_norm|0.8357|± |0.0086|
547
+ ```
548
+ ### Winogrande 5-Shot
549
+ ```
550
+ | Tasks |Version|Filter|Metric|Value| |Stderr|
551
+ |----------|-------|------|------|----:|---|-----:|
552
+ |winogrande|Yaml |none |acc |0.768|± |0.0119|
553
+ ```
554
+ ### PubMedQA 0-Shot
555
+ ```
556
+ | Tasks |Version|Filter|Metric|Value| |Stderr|
557
+ |--------|-------|------|------|----:|---|-----:|
558
+ |pubmedqa|Yaml |none |acc | 0.76|± |0.0191|
559
+ ```
560
+ ### RACE 1-Shot
561
+ ```
562
+ |Tasks|Version|Filter|Metric|Value | |Stderr|
563
+ |-----|-------|------|------|-----:|---|-----:|
564
+ |race |Yaml |none |acc |0.5282|± |0.0154|
565
+ ```
566
+ ### MMLU 5-Shot (8-Bit)
567
+ ```
568
+ | Groups |Version|Filter|Metric|Value | |Stderr|
569
+ |------------------|-------|------|------|-----:|---|-----:|
570
+ |mmlu |N/A |none |acc |0.6137|± |0.1243|
571
+ | - humanities |N/A |none |acc |0.5671|± |0.1101|
572
+ | - other |N/A |none |acc |0.6859|± |0.1164|
573
+ | - social_sciences|N/A |none |acc |0.7195|± |0.0713|
574
+ | - stem |N/A |none |acc |0.5087|± |0.1297|
575
+ ```
576
+ ### DROP 3-Shot (8-Bit) (Instruct-Eval)
577
+ ```
578
+ {'score': 0.49801113762927607}
579
+ {'drop': 49.8}
580
+ drop: 49.8
581
+ ```
582
+
583
+ ### CRASS 0-Shot (Instruct-Eval)
584
+ ```
585
+ {'score': 0.8357664233576643}
586
+ {'crass': 83.58}
587
+ crass: 83.58
588
+ ```
589
+
590
+ ## Training Details
591
+
592
+ ### Training hyperparameters
593
+
594
+ The following hyperparameters were used during training:
595
+ - learning_rate: 0.0001
596
+ - train_batch_size: 1
597
+ - eval_batch_size: 1
598
+ - seed: 42
599
+ - distributed_type: multi-GPU
600
+ - num_devices: 14
601
+ - gradient_accumulation_steps: 16
602
+ - total_train_batch_size: 224
603
+ - total_eval_batch_size: 14
604
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
605
+ - lr_scheduler_type: linear
606
+ - lr_scheduler_warmup_ratio: 0.01
607
+ - num_epochs: 1
608
+
609
+ ### Training results
610
+
611
+ | Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
612
+ |:-------------:|:-----:|:----:|:---------------:|:--------------:|:----------------:|:------------------:|:---------------:|:--------------:|:------------:|:---------------:|:-------------:|
613
+ | 0.4795 | 0.2 | 56 | 0.4958 | -1.3684 | -2.6385 | 0.7552 | 1.2701 | -265.3887 | -241.2612 | -2.2572 | -2.4922 |
614
+ | 0.4642 | 0.4 | 112 | 0.4859 | -1.0380 | -1.9769 | 0.7273 | 0.9389 | -258.7718 | -237.9569 | -2.2414 | -2.4751 |
615
+ | 0.4758 | 0.61 | 168 | 0.4808 | -1.2594 | -2.3704 | 0.7343 | 1.1110 | -262.7074 | -240.1708 | -2.2305 | -2.4633 |
616
+ | 0.4549 | 0.81 | 224 | 0.4768 | -1.1906 | -2.3201 | 0.7552 | 1.1295 | -262.2044 | -239.4827 | -2.2284 | -2.4610 |
617
+
618
+
619
+ ### Framework versions
620
+
621
+ - Transformers 4.35.0-UNA
622
+ - Pytorch 2.1.0
623
+ - Datasets 2.14.6
624
+ - Tokenizers 0.14.1
625
+
626
+ ## Citations
627
+ If you find juanako useful please:
628
+
629
+ ```
630
+ @misc{juanako7buna,
631
+ title={Juanako: Uniform Neural Alignment},
632
+ author={Xavier Murias},
633
+ year={2023},
634
+ publisher = {HuggingFace},
635
+ journal = {HuggingFace repository},
636
+ howpublished = {\url{https://huggingface.co/fblgit/juanako-7b-UNA}},
637
+ }
638
+ ```
639
+
640
+ 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.
641
+ ```
642
+ @misc{lin2021truthfulqa,
643
+ title={TruthfulQA: Measuring How Models Mimic Human Falsehoods},
644
+ author={Stephanie Lin and Jacob Hilton and Owain Evans},
645
+ year={2021},
646
+ eprint={2109.07958},
647
+ archivePrefix={arXiv},
648
+ primaryClass={cs.CL}
649
+ }
650
+ @misc{tunstall2023zephyr,
651
+ title={Zephyr: Direct Distillation of LM Alignment},
652
+ 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},
653
+ year={2023},
654
+ eprint={2310.16944},
655
+ archivePrefix={arXiv},
656
+ primaryClass={cs.LG}
657
+ }
658
+ @inproceedings{Bisk2020,
659
+ author = {Yonatan Bisk and Rowan Zellers and
660
+ Ronan Le Bras and Jianfeng Gao
661
+ and Yejin Choi},
662
+ title = {PIQA: Reasoning about Physical Commonsense in
663
+ Natural Language},
664
+ booktitle = {Thirty-Fourth AAAI Conference on
665
+ Artificial Intelligence},
666
+ year = {2020},
667
+ }
668
+ @software{eval-harness,
669
+ author = {Gao, Leo and
670
+ Tow, Jonathan and
671
+ Biderman, Stella and
672
+ Black, Sid and
673
+ DiPofi, Anthony and
674
+ Foster, Charles and
675
+ Golding, Laurence and
676
+ Hsu, Jeffrey and
677
+ McDonell, Kyle and
678
+ Muennighoff, Niklas and
679
+ Phang, Jason and
680
+ Reynolds, Laria and
681
+ Tang, Eric and
682
+ Thite, Anish and
683
+ Wang, Ben and
684
+ Wang, Kevin and
685
+ Zou, Andy},
686
+ title = {A framework for few-shot language model evaluation},
687
+ month = sep,
688
+ year = 2021,
689
+ publisher = {Zenodo},
690
+ version = {v0.0.1},
691
+ doi = {10.5281/zenodo.5371628},
692
+ url = {https://doi.org/10.5281/zenodo.5371628}
693
+ }
694
+ @misc{rafailov2023direct,
695
+ title={Direct Preference Optimization: Your Language Model is Secretly a Reward Model},
696
+ author={Rafael Rafailov and Archit Sharma and Eric Mitchell and Stefano Ermon and Christopher D. Manning and Chelsea Finn},
697
+ year={2023},
698
+ eprint={2305.18290},
699
+ archivePrefix={arXiv},
700
+ }
701
+ ```
702
+
703
+ <!-- original-model-card end -->