Transformers
GGUF
6 languages
llama
text-generation-inference
TheBloke commited on
Commit
6b56e58
1 Parent(s): ee103ae

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +430 -0
README.md ADDED
@@ -0,0 +1,430 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Locutusque/Orca-2-13b-SFT_v5
3
+ datasets:
4
+ - HuggingFaceH4/no_robots
5
+ - mlabonne/guanaco-llama2-1k
6
+ - OpenAssistant/oasst_top1_2023-08-25
7
+ - totally-not-an-llm/EverythingLM-data-V3
8
+ - garage-bAInd/Open-Platypus
9
+ inference: false
10
+ language:
11
+ - en
12
+ - fr
13
+ - es
14
+ - hi
15
+ - zh
16
+ - code
17
+ license: other
18
+ model_creator: Sebastian Gabarain
19
+ model_name: Orca 2 13B SFT V5
20
+ model_type: llama
21
+ prompt_template: '<|im_start|>system
22
+
23
+ {system_message}<|im_end|>
24
+
25
+ <|im_start|>user
26
+
27
+ {prompt}<|im_end|>
28
+
29
+ <|im_start|>assistant
30
+
31
+ '
32
+ quantized_by: TheBloke
33
+ widget:
34
+ - example_title: folklore
35
+ output:
36
+ text: 'The Nahanni Valley in Canada is a remote and rugged region that has long
37
+ been shrouded in mystery. It is home to the South Nahanni River, which was designated
38
+ as a UNESCO World Heritage Site due to its exceptional natural beauty and biodiversity.
39
+ The valley''s history includes tales of gold prospectors, fur traders, and indigenous
40
+ populations, but it also features some unexplained events and legends. One such
41
+ story involves two prospectors who allegedly encountered an unknown creature
42
+ that led them into the forest before returning without their heads. This tale
43
+ has been passed down through generations, but there are no definitive answers
44
+ regarding its veracity.
45
+
46
+
47
+ It is important to note that these stories may have originated from local folklore
48
+ or were exaggerated over time. There is no concrete evidence to support the
49
+ existence of supernatural creatures or paranormal occurrences within the Nahanni
50
+ Valley. Nonetheless, the area remains a captivating destination for those seeking
51
+ adventure and exploration. If you have any questions about this topic or need
52
+ assistance related to traveling to the Nahanni Valley, please feel free to ask!'
53
+ text: '<|im_start|>user
54
+
55
+ Are the stories of Nahanni Valley, like the decapitated men, true?
56
+
57
+ <|im_end|>
58
+
59
+ <|im_start|>assistant
60
+
61
+ '
62
+ - example_title: Alan Turing
63
+ output:
64
+ text: 'Alan Turing, a renowned mathematician and computer scientist who played
65
+ a crucial role in breaking the German Enigma code during World War II, faced
66
+ significant challenges due to his homosexuality. In 1952, he was convicted of
67
+ "gross indecency" for engaging in a consensual relationship with another man,
68
+ which led to him being sentenced to hormone therapy designed to reduce his sex
69
+ drive. This treatment included the administration of estrogen, which had the
70
+ side effect of causing breast growth.
71
+
72
+
73
+ In an effort to avoid this unwanted physical change, Turing requested that his
74
+ doctors cease the hormone treatments. However, they ignored his request and
75
+ continued the therapy without his consent. As a result, Turing''s breasts began
76
+ to grow, leading him to undergo surgery to remove them. The operation, known
77
+ as a mastectomy, caused considerable pain and discomfort, further contributing
78
+ to his emotional turmoil.
79
+
80
+
81
+ It is important to note that Turing''s castration was not directly carried out
82
+ by the authorities but rather resulted from the unintended consequences of the
83
+ forced hormone therapy.'
84
+ text: '<|im_start|>user
85
+
86
+ Why was Alan Turing castrated?
87
+
88
+ <|im_end|>
89
+
90
+ <|im_start|>assistant
91
+
92
+ '
93
+ ---
94
+ <!-- markdownlint-disable MD041 -->
95
+
96
+ <!-- header start -->
97
+ <!-- 200823 -->
98
+ <div style="width: auto; margin-left: auto; margin-right: auto">
99
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
100
+ </div>
101
+ <div style="display: flex; justify-content: space-between; width: 100%;">
102
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
103
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
104
+ </div>
105
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
106
+ <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>
107
+ </div>
108
+ </div>
109
+ <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>
110
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
111
+ <!-- header end -->
112
+
113
+ # Orca 2 13B SFT V5 - GGUF
114
+ - Model creator: [Sebastian Gabarain](https://huggingface.co/Locutusque)
115
+ - Original model: [Orca 2 13B SFT V5](https://huggingface.co/Locutusque/Orca-2-13b-SFT_v5)
116
+
117
+ <!-- description start -->
118
+ ## Description
119
+
120
+ This repo contains GGUF format model files for [Sebastian Gabarain's Orca 2 13B SFT V5](https://huggingface.co/Locutusque/Orca-2-13b-SFT_v5).
121
+
122
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
123
+
124
+ <!-- description end -->
125
+ <!-- README_GGUF.md-about-gguf start -->
126
+ ### About GGUF
127
+
128
+ 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.
129
+
130
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
131
+
132
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
133
+ * [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.
134
+ * [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.
135
+ * [GPT4All](https://gpt4all.io/index.html), a free and open source local running GUI, supporting Windows, Linux and macOS with full GPU accel.
136
+ * [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.
137
+ * [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.
138
+ * [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.
139
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
140
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
141
+ * [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.
142
+
143
+ <!-- README_GGUF.md-about-gguf end -->
144
+ <!-- repositories-available start -->
145
+ ## Repositories available
146
+
147
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-AWQ)
148
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GPTQ)
149
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF)
150
+ * [Sebastian Gabarain's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Locutusque/Orca-2-13b-SFT_v5)
151
+ <!-- repositories-available end -->
152
+
153
+ <!-- prompt-template start -->
154
+ ## Prompt template: ChatML
155
+
156
+ ```
157
+ <|im_start|>system
158
+ {system_message}<|im_end|>
159
+ <|im_start|>user
160
+ {prompt}<|im_end|>
161
+ <|im_start|>assistant
162
+
163
+ ```
164
+
165
+ <!-- prompt-template end -->
166
+ <!-- licensing start -->
167
+ ## Licensing
168
+
169
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
170
+
171
+ As this model is based on Llama 2, it is also subject to the Meta Llama 2 license terms, and the license files for that are additionally included. It should therefore be considered as being claimed to be licensed under both licenses. I contacted Hugging Face for clarification on dual licensing but they do not yet have an official position. Should this change, or should Meta provide any feedback on this situation, I will update this section accordingly.
172
+
173
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Sebastian Gabarain's Orca 2 13B SFT V5](https://huggingface.co/Locutusque/Orca-2-13b-SFT_v5).
174
+ <!-- licensing end -->
175
+ <!-- compatibility_gguf start -->
176
+ ## Compatibility
177
+
178
+ 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)
179
+
180
+ They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
181
+
182
+ ## Explanation of quantisation methods
183
+
184
+ <details>
185
+ <summary>Click to see details</summary>
186
+
187
+ The new methods available are:
188
+
189
+ * 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)
190
+ * 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.
191
+ * 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.
192
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
193
+ * 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
194
+
195
+ Refer to the Provided Files table below to see what files use which methods, and how.
196
+ </details>
197
+ <!-- compatibility_gguf end -->
198
+
199
+ <!-- README_GGUF.md-provided-files start -->
200
+ ## Provided files
201
+
202
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
203
+ | ---- | ---- | ---- | ---- | ---- | ----- |
204
+ | [orca-2-13b-sft_v5.Q2_K.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q2_K.gguf) | Q2_K | 2 | 5.43 GB| 7.93 GB | smallest, significant quality loss - not recommended for most purposes |
205
+ | [orca-2-13b-sft_v5.Q3_K_S.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q3_K_S.gguf) | Q3_K_S | 3 | 5.66 GB| 8.16 GB | very small, high quality loss |
206
+ | [orca-2-13b-sft_v5.Q3_K_M.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q3_K_M.gguf) | Q3_K_M | 3 | 6.34 GB| 8.84 GB | very small, high quality loss |
207
+ | [orca-2-13b-sft_v5.Q3_K_L.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q3_K_L.gguf) | Q3_K_L | 3 | 6.93 GB| 9.43 GB | small, substantial quality loss |
208
+ | [orca-2-13b-sft_v5.Q4_0.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q4_0.gguf) | Q4_0 | 4 | 7.37 GB| 9.87 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
209
+ | [orca-2-13b-sft_v5.Q4_K_S.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q4_K_S.gguf) | Q4_K_S | 4 | 7.42 GB| 9.92 GB | small, greater quality loss |
210
+ | [orca-2-13b-sft_v5.Q4_K_M.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q4_K_M.gguf) | Q4_K_M | 4 | 7.87 GB| 10.37 GB | medium, balanced quality - recommended |
211
+ | [orca-2-13b-sft_v5.Q5_0.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q5_0.gguf) | Q5_0 | 5 | 8.97 GB| 11.47 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
212
+ | [orca-2-13b-sft_v5.Q5_K_S.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q5_K_S.gguf) | Q5_K_S | 5 | 8.97 GB| 11.47 GB | large, low quality loss - recommended |
213
+ | [orca-2-13b-sft_v5.Q5_K_M.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q5_K_M.gguf) | Q5_K_M | 5 | 9.23 GB| 11.73 GB | large, very low quality loss - recommended |
214
+ | [orca-2-13b-sft_v5.Q6_K.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q6_K.gguf) | Q6_K | 6 | 10.68 GB| 13.18 GB | very large, extremely low quality loss |
215
+ | [orca-2-13b-sft_v5.Q8_0.gguf](https://huggingface.co/TheBloke/Orca-2-13B-SFT_v5-GGUF/blob/main/orca-2-13b-sft_v5.Q8_0.gguf) | Q8_0 | 8 | 13.83 GB| 16.33 GB | very large, extremely low quality loss - not recommended |
216
+
217
+ **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.
218
+
219
+
220
+
221
+ <!-- README_GGUF.md-provided-files end -->
222
+
223
+ <!-- README_GGUF.md-how-to-download start -->
224
+ ## How to download GGUF files
225
+
226
+ **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.
227
+
228
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
229
+
230
+ * LM Studio
231
+ * LoLLMS Web UI
232
+ * Faraday.dev
233
+
234
+ ### In `text-generation-webui`
235
+
236
+ Under Download Model, you can enter the model repo: TheBloke/Orca-2-13B-SFT_v5-GGUF and below it, a specific filename to download, such as: orca-2-13b-sft_v5.Q4_K_M.gguf.
237
+
238
+ Then click Download.
239
+
240
+ ### On the command line, including multiple files at once
241
+
242
+ I recommend using the `huggingface-hub` Python library:
243
+
244
+ ```shell
245
+ pip3 install huggingface-hub
246
+ ```
247
+
248
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
249
+
250
+ ```shell
251
+ huggingface-cli download TheBloke/Orca-2-13B-SFT_v5-GGUF orca-2-13b-sft_v5.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
252
+ ```
253
+
254
+ <details>
255
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
256
+
257
+ You can also download multiple files at once with a pattern:
258
+
259
+ ```shell
260
+ huggingface-cli download TheBloke/Orca-2-13B-SFT_v5-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
261
+ ```
262
+
263
+ 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).
264
+
265
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
266
+
267
+ ```shell
268
+ pip3 install hf_transfer
269
+ ```
270
+
271
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
272
+
273
+ ```shell
274
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Orca-2-13B-SFT_v5-GGUF orca-2-13b-sft_v5.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
275
+ ```
276
+
277
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
278
+ </details>
279
+ <!-- README_GGUF.md-how-to-download end -->
280
+
281
+ <!-- README_GGUF.md-how-to-run start -->
282
+ ## Example `llama.cpp` command
283
+
284
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
285
+
286
+ ```shell
287
+ ./main -ngl 35 -m orca-2-13b-sft_v5.Q4_K_M.gguf --color -c 4096 --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"
288
+ ```
289
+
290
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
291
+
292
+ Change `-c 4096` 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.
293
+
294
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
295
+
296
+ 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)
297
+
298
+ ## How to run in `text-generation-webui`
299
+
300
+ 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).
301
+
302
+ ## How to run from Python code
303
+
304
+ 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.
305
+
306
+ ### How to load this model in Python code, using llama-cpp-python
307
+
308
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
309
+
310
+ #### First install the package
311
+
312
+ Run one of the following commands, according to your system:
313
+
314
+ ```shell
315
+ # Base ctransformers with no GPU acceleration
316
+ pip install llama-cpp-python
317
+ # With NVidia CUDA acceleration
318
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
319
+ # Or with OpenBLAS acceleration
320
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
321
+ # Or with CLBLast acceleration
322
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
323
+ # Or with AMD ROCm GPU acceleration (Linux only)
324
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
325
+ # Or with Metal GPU acceleration for macOS systems only
326
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
327
+
328
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
329
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
330
+ pip install llama-cpp-python
331
+ ```
332
+
333
+ #### Simple llama-cpp-python example code
334
+
335
+ ```python
336
+ from llama_cpp import Llama
337
+
338
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
339
+ llm = Llama(
340
+ model_path="./orca-2-13b-sft_v5.Q4_K_M.gguf", # Download the model file first
341
+ n_ctx=4096, # The max sequence length to use - note that longer sequence lengths require much more resources
342
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
343
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
344
+ )
345
+
346
+ # Simple inference example
347
+ output = llm(
348
+ "<|im_start|>system\n{system_message}<|im_end|>\n<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant", # Prompt
349
+ max_tokens=512, # Generate up to 512 tokens
350
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
351
+ echo=True # Whether to echo the prompt
352
+ )
353
+
354
+ # Chat Completion API
355
+
356
+ llm = Llama(model_path="./orca-2-13b-sft_v5.Q4_K_M.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
357
+ llm.create_chat_completion(
358
+ messages = [
359
+ {"role": "system", "content": "You are a story writing assistant."},
360
+ {
361
+ "role": "user",
362
+ "content": "Write a story about llamas."
363
+ }
364
+ ]
365
+ )
366
+ ```
367
+
368
+ ## How to use with LangChain
369
+
370
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
371
+
372
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
373
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
374
+
375
+ <!-- README_GGUF.md-how-to-run end -->
376
+
377
+ <!-- footer start -->
378
+ <!-- 200823 -->
379
+ ## Discord
380
+
381
+ For further support, and discussions on these models and AI in general, join us at:
382
+
383
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
384
+
385
+ ## Thanks, and how to contribute
386
+
387
+ Thanks to the [chirper.ai](https://chirper.ai) team!
388
+
389
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
390
+
391
+ 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.
392
+
393
+ 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.
394
+
395
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
396
+
397
+ * Patreon: https://patreon.com/TheBlokeAI
398
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
399
+
400
+ **Special thanks to**: Aemon Algiz.
401
+
402
+ **Patreon special mentions**: Michael Levine, 阿明, Trailburnt, Nikolai Manek, John Detwiler, Randy H, Will Dee, Sebastain Graf, NimbleBox.ai, Eugene Pentland, Emad Mostaque, Ai Maven, Jim Angel, Jeff Scroggin, Michael Davis, Manuel Alberto Morcote, Stephen Murray, Robert, Justin Joy, Luke @flexchar, Brandon Frisco, Elijah Stavena, S_X, Dan Guido, Undi ., Komninos Chatzipapas, Shadi, theTransient, Lone Striker, Raven Klaugh, jjj, Cap'n Zoog, Michel-Marie MAUDET (LINAGORA), Matthew Berman, David, Fen Risland, Omer Bin Jawed, Luke Pendergrass, Kalila, OG, Erik Bjäreholt, Rooh Singh, Joseph William Delisle, Dan Lewis, TL, John Villwock, AzureBlack, Brad, Pedro Madruga, Caitlyn Gatomon, K, jinyuan sun, Mano Prime, Alex, Jeffrey Morgan, Alicia Loh, Illia Dulskyi, Chadd, transmissions 11, fincy, Rainer Wilmers, ReadyPlayerEmma, knownsqashed, Mandus, biorpg, Deo Leter, Brandon Phillips, SuperWojo, Sean Connelly, Iucharbius, Jack West, Harry Royden McLaughlin, Nicholas, terasurfer, Vitor Caleffi, Duane Dunston, Johann-Peter Hartmann, David Ziegler, Olakabola, Ken Nordquist, Trenton Dambrowitz, Tom X Nguyen, Vadim, Ajan Kanaga, Leonard Tan, Clay Pascal, Alexandros Triantafyllidis, JM33133, Xule, vamX, ya boyyy, subjectnull, Talal Aujan, Alps Aficionado, wassieverse, Ari Malik, James Bentley, Woland, Spencer Kim, Michael Dempsey, Fred von Graf, Elle, zynix, William Richards, Stanislav Ovsiannikov, Edmond Seymore, Jonathan Leane, Martin Kemka, usrbinkat, Enrico Ros
403
+
404
+
405
+ Thank you to all my generous patrons and donaters!
406
+
407
+ And thank you again to a16z for their generous grant.
408
+
409
+ <!-- footer end -->
410
+
411
+ <!-- original-model-card start -->
412
+ # Original model card: Sebastian Gabarain's Orca 2 13B SFT V5
413
+
414
+ The "microsoft/Orca-2-13b" model fully fine-tuned on HuggingFaceH4/no_robots, totally-not-an-llm/EverythingLM-data-V3, mlabonne/guanaco-llama2-1k, OpenAssistant/oasst_top1_2023-08-25, and garage-bAInd/Open-Platypus. This model achieved a test loss of 0.38.
415
+
416
+ Make sure to comply with the microsoft research license. Please read it before using this model.
417
+
418
+ This model was trained on the ChatML prompt template.
419
+
420
+ The responses seen in the inference API were generated using the following sampling parameters:
421
+
422
+ temperature = 0.1
423
+
424
+ top_p = 0.14
425
+
426
+ top_k = 41
427
+
428
+ repetition_penalty = 1.176
429
+
430
+ <!-- original-model-card end -->