TheBloke commited on
Commit
7868c3a
1 Parent(s): bd10763

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +50 -10
README.md CHANGED
@@ -45,7 +45,7 @@ GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is
45
 
46
  The key benefit of GGUF is that it is a extensible, future-proof format which stores more information about the model as metadata. It also includes significantly improved tokenization code, including for the first time full support for special tokens. This should improve performance, especially with models that use new special tokens and implement custom prompt templates.
47
 
48
- As of August 25th, here is a list of clients and libraries that are known to support GGUF:
49
  * [llama.cpp](https://github.com/ggerganov/llama.cpp).
50
  * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI. Supports GGUF with GPU acceleration via the ctransformers backend - llama-cpp-python backend should work soon too.
51
  * [KoboldCpp](https://github.com/LostRuins/koboldcpp), now supports GGUF as of release 1.41! A powerful GGML web UI, with full GPU accel. Especially good for story telling.
@@ -55,9 +55,7 @@ As of August 25th, here is a list of clients and libraries that are known to sup
55
  * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), supports GGUF as of version 0.1.79. A Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
56
  * [candle](https://github.com/huggingface/candle), added GGUF support on August 22nd. Candle is a Rust ML framework with a focus on performance, including GPU support, and ease of use.
57
 
58
- The clients and libraries below are expecting to add GGUF support shortly:
59
  <!-- README_GGUF.md-about-gguf end -->
60
-
61
  <!-- repositories-available start -->
62
  ## Repositories available
63
 
@@ -117,19 +115,22 @@ Refer to the Provided Files table below to see what files use which methods, and
117
  | [yarn-llama-2-7b-128k.Q8_0.gguf](https://huggingface.co/TheBloke/Yarn-Llama-2-7B-128K-GGUF/blob/main/yarn-llama-2-7b-128k.Q8_0.gguf) | Q8_0 | 8 | 7.16 GB| 9.66 GB | very large, extremely low quality loss - not recommended |
118
 
119
  **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.
 
 
 
120
  <!-- README_GGUF.md-provided-files end -->
121
 
122
  <!-- README_GGUF.md-how-to-run start -->
123
- ## How to run in `llama.cpp`
124
 
125
  Make sure you are using `llama.cpp` from commit [6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9](https://github.com/ggerganov/llama.cpp/commit/6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9) or later.
126
 
127
- For compatibility with older versions of llama.cpp, or for use with third-party clients and libaries, please use GGML files instead.
128
 
129
  ```
130
  ./main -t 10 -ngl 32 -m yarn-llama-2-7b-128k.q4_K_M.gguf --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "Write a story about llamas"
131
  ```
132
- Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`.
133
 
134
  Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
135
 
@@ -142,6 +143,44 @@ For other parameters and how to use them, please refer to [the llama.cpp documen
142
  ## How to run in `text-generation-webui`
143
 
144
  Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp.md).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  <!-- README_GGUF.md-how-to-run end -->
146
 
147
  <!-- footer start -->
@@ -167,7 +206,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
167
 
168
  **Special thanks to**: Aemon Algiz.
169
 
170
- **Patreon special mentions**: Kacper Wikieł, knownsqashed, Leonard Tan, Asp the Wyvern, Daniel P. Andersen, Luke Pendergrass, Stanislav Ovsiannikov, RoA, Dave, Ai Maven, Kalila, Will Dee, Imad Khwaja, Nitin Borwankar, Joseph William Delisle, Tony Hughes, Cory Kujawski, Rishabh Srivastava, Russ Johnson, Stephen Murray, Lone Striker, Johann-Peter Hartmann, Elle, J, Deep Realms, SuperWojo, Raven Klaugh, Sebastain Graf, ReadyPlayerEmma, Alps Aficionado, Mano Prime, Derek Yates, Gabriel Puliatti, Mesiah Bishop, Magnesian, Sean Connelly, biorpg, Iucharbius, Olakabola, Fen Risland, Space Cruiser, theTransient, Illia Dulskyi, Thomas Belote, Spencer Kim, Pieter, John Detwiler, Fred von Graf, Michael Davis, Swaroop Kallakuri, subjectnull, Clay Pascal, Subspace Studios, Chris Smitley, Enrico Ros, usrbinkat, Steven Wood, alfie_i, David Ziegler, Willem Michiel, Matthew Berman, Andrey, Pyrater, Jeffrey Morgan, vamX, LangChain4j, Luke @flexchar, Trenton Dambrowitz, Pierre Kircher, Alex, Sam, James Bentley, Edmond Seymore, Eugene Pentland, Pedro Madruga, Rainer Wilmers, Dan Guido, Nathan LeClaire, Spiking Neurons AB, Talal Aujan, zynix, Artur Olbinski, Michael Levine, 阿明, K, John Villwock, Nikolai Manek, Femi Adebogun, senxiiz, Deo Leter, NimbleBox.ai, Viktor Bowallius, Geoffrey Montalvo, Mandus, Ajan Kanaga, ya boyyy, Jonathan Leane, webtim, Brandon Frisco, danny, Alexandros Triantafyllidis, Gabriel Tamborski, Randy H, terasurfer, Vadim, Junyu Yang, Vitor Caleffi, Chadd, transmissions 11
171
 
172
 
173
  Thank you to all my generous patrons and donaters!
@@ -181,11 +220,12 @@ And thank you again to a16z for their generous grant.
181
 
182
  # Model Card: Nous-Yarn-Llama-2-13b-64k
183
 
184
-
 
185
 
186
  ## Model Description
187
 
188
- Nous-Yarn-Llama-2-13b-128k is a state-of-the-art language model for long context, further pretrained on long context data for 600 steps.
189
  This model is the Flash Attention 2 patched version of the original model: https://huggingface.co/conceptofmind/Yarn-Llama-2-13b-128k
190
 
191
  Note that this model **requires** the [Flash Attention library](https://pypi.org/project/flash-attn/) in order to function correctly, see the Model Usage section for installation instructions.
@@ -201,7 +241,7 @@ Starting from the base Llama 2 models, this model was further pretrained on a su
201
  - [@EnricoShippole](https://twitter.com/EnricoShippole): Model Training
202
  - [honglu2875](https://github.com/honglu2875): Paper and evals
203
 
204
- The authors would like to thank Stability AI, Carper AI, and Eleuther AI for their generous support of significant computing resources that enabled the training of these models and the completion of this research. We would also like to thank Jonathan Tow and Dakota Mahan directly for their help in advising on the use of the Stability AI compute cluster. Additionally, we would like to thank a16z, and PygmalionAI, for providing resources to run evaluations and experiments on the models.
205
 
206
  ## Usage and Prompt Format
207
 
 
45
 
46
  The key benefit of GGUF is that it is a extensible, future-proof format which stores more information about the model as metadata. It also includes significantly improved tokenization code, including for the first time full support for special tokens. This should improve performance, especially with models that use new special tokens and implement custom prompt templates.
47
 
48
+ Here are a list of clients and libraries that are known to support GGUF:
49
  * [llama.cpp](https://github.com/ggerganov/llama.cpp).
50
  * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI. Supports GGUF with GPU acceleration via the ctransformers backend - llama-cpp-python backend should work soon too.
51
  * [KoboldCpp](https://github.com/LostRuins/koboldcpp), now supports GGUF as of release 1.41! A powerful GGML web UI, with full GPU accel. Especially good for story telling.
 
55
  * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), supports GGUF as of version 0.1.79. A Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
56
  * [candle](https://github.com/huggingface/candle), added GGUF support on August 22nd. Candle is a Rust ML framework with a focus on performance, including GPU support, and ease of use.
57
 
 
58
  <!-- README_GGUF.md-about-gguf end -->
 
59
  <!-- repositories-available start -->
60
  ## Repositories available
61
 
 
115
  | [yarn-llama-2-7b-128k.Q8_0.gguf](https://huggingface.co/TheBloke/Yarn-Llama-2-7B-128K-GGUF/blob/main/yarn-llama-2-7b-128k.Q8_0.gguf) | Q8_0 | 8 | 7.16 GB| 9.66 GB | very large, extremely low quality loss - not recommended |
116
 
117
  **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.
118
+
119
+
120
+
121
  <!-- README_GGUF.md-provided-files end -->
122
 
123
  <!-- README_GGUF.md-how-to-run start -->
124
+ ## Example `llama.cpp` command
125
 
126
  Make sure you are using `llama.cpp` from commit [6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9](https://github.com/ggerganov/llama.cpp/commit/6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9) or later.
127
 
128
+ For compatibility with older versions of llama.cpp, or for any third-party libraries or clients that haven't yet updated for GGUF, please use GGML files instead.
129
 
130
  ```
131
  ./main -t 10 -ngl 32 -m yarn-llama-2-7b-128k.q4_K_M.gguf --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "Write a story about llamas"
132
  ```
133
+ Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`. If offloading all layers to GPU, set `-t 1`.
134
 
135
  Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
136
 
 
143
  ## How to run in `text-generation-webui`
144
 
145
  Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp.md).
146
+
147
+ ## How to run from Python code
148
+
149
+ 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.
150
+
151
+ ### How to load this model from Python using ctransformers
152
+
153
+ #### First install the package
154
+
155
+ ```bash
156
+ # Base ctransformers with no GPU acceleration
157
+ pip install ctransformers>=0.2.24
158
+ # Or with CUDA GPU acceleration
159
+ pip install ctransformers[cuda]>=0.2.24
160
+ # Or with ROCm GPU acceleration
161
+ CT_HIPBLAS=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
162
+ # Or with Metal GPU acceleration for macOS systems
163
+ CT_METAL=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
164
+ ```
165
+
166
+ #### Simple example code to load one of these GGUF models
167
+
168
+ ```python
169
+ from ctransformers import AutoModelForCausalLM
170
+
171
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
172
+ llm = AutoModelForCausalLM.from_pretrained("TheBloke/Yarn-Llama-2-7B-128K-GGML", model_file="yarn-llama-2-7b-128k.q4_K_M.gguf", model_type="llama", gpu_layers=50)
173
+
174
+ print(llm("AI is going to"))
175
+ ```
176
+
177
+ ## How to use with LangChain
178
+
179
+ Here's guides on using llama-cpp-python or ctransformers with LangChain:
180
+
181
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
182
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
183
+
184
  <!-- README_GGUF.md-how-to-run end -->
185
 
186
  <!-- footer start -->
 
206
 
207
  **Special thanks to**: Aemon Algiz.
208
 
209
+ **Patreon special mentions**: Russ Johnson, J, alfie_i, Alex, NimbleBox.ai, Chadd, Mandus, Nikolai Manek, Ken Nordquist, ya boyyy, Illia Dulskyi, Viktor Bowallius, vamX, Iucharbius, zynix, Magnesian, Clay Pascal, Pierre Kircher, Enrico Ros, Tony Hughes, Elle, Andrey, knownsqashed, Deep Realms, Jerry Meng, Lone Striker, Derek Yates, Pyrater, Mesiah Bishop, James Bentley, Femi Adebogun, Brandon Frisco, SuperWojo, Alps Aficionado, Michael Dempsey, Vitor Caleffi, Will Dee, Edmond Seymore, usrbinkat, LangChain4j, Kacper Wikieł, Luke Pendergrass, John Detwiler, theTransient, Nathan LeClaire, Tiffany J. Kim, biorpg, Eugene Pentland, Stanislav Ovsiannikov, Fred von Graf, terasurfer, Kalila, Dan Guido, Nitin Borwankar, 阿明, Ai Maven, John Villwock, Gabriel Puliatti, Stephen Murray, Asp the Wyvern, danny, Chris Smitley, ReadyPlayerEmma, S_X, Daniel P. Andersen, Olakabola, Jeffrey Morgan, Imad Khwaja, Caitlyn Gatomon, webtim, Alicia Loh, Trenton Dambrowitz, Swaroop Kallakuri, Erik Bjäreholt, Leonard Tan, Spiking Neurons AB, Luke @flexchar, Ajan Kanaga, Thomas Belote, Deo Leter, RoA, Willem Michiel, transmissions 11, subjectnull, Matthew Berman, Joseph William Delisle, David Ziegler, Michael Davis, Johann-Peter Hartmann, Talal Aujan, senxiiz, Artur Olbinski, Rainer Wilmers, Spencer Kim, Fen Risland, Cap'n Zoog, Rishabh Srivastava, Michael Levine, Geoffrey Montalvo, Sean Connelly, Alexandros Triantafyllidis, Pieter, Gabriel Tamborski, Sam, Subspace Studios, Junyu Yang, Pedro Madruga, Vadim, Cory Kujawski, K, Raven Klaugh, Randy H, Mano Prime, Sebastain Graf, Space Cruiser
210
 
211
 
212
  Thank you to all my generous patrons and donaters!
 
220
 
221
  # Model Card: Nous-Yarn-Llama-2-13b-64k
222
 
223
+ [Preprint (arXiv)](https://arxiv.org/abs/2309.00071)
224
+ [GitHub](https://github.com/jquesnelle/yarn)
225
 
226
  ## Model Description
227
 
228
+ Nous-Yarn-Llama-2-13b-128k is a state-of-the-art language model for long context, further pretrained on long context data for 600 steps.
229
  This model is the Flash Attention 2 patched version of the original model: https://huggingface.co/conceptofmind/Yarn-Llama-2-13b-128k
230
 
231
  Note that this model **requires** the [Flash Attention library](https://pypi.org/project/flash-attn/) in order to function correctly, see the Model Usage section for installation instructions.
 
241
  - [@EnricoShippole](https://twitter.com/EnricoShippole): Model Training
242
  - [honglu2875](https://github.com/honglu2875): Paper and evals
243
 
244
+ The authors would like to thank Stability AI, Carper AI, and Eleuther AI for their generous support of significant computing resources that enabled the training of these models and the completion of this research. We would also like to thank Jonathan Tow and Dakota Mahan directly for their help in advising on the use of the Stability AI compute cluster. Additionally, we would like to thank a16z, and PygmalionAI, for providing resources to run evaluations and experiments on the models.
245
 
246
  ## Usage and Prompt Format
247