TheBloke commited on
Commit
9d9e218
1 Parent(s): 46d44e5

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -21
README.md CHANGED
@@ -67,7 +67,7 @@ Many thanks to William Beauchamp from [Chai](https://chai-research.com/) for pro
67
  <!-- README_GGUF.md-about-gguf start -->
68
  ### About GGUF
69
 
70
- 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. GGUF offers numerous advantages over GGML, such as better tokenisation, and support for special tokens. It is also supports metadata, and is designed to be extensible.
71
 
72
  Here is an incomplate list of clients and libraries that are known to support GGUF:
73
 
@@ -111,7 +111,7 @@ Here is an incomplate list of clients and libraries that are known to support GG
111
  <!-- compatibility_gguf start -->
112
  ## Compatibility
113
 
114
- These quantised GGUFv2 files are compatible with llama.cpp from August 27th onwards, as of commit [d0cee0d36d5be95a0d9088b674dbb27354107221](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221)
115
 
116
  They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
117
 
@@ -166,7 +166,7 @@ The following clients/libraries will automatically download models for you, prov
166
 
167
  ### In `text-generation-webui`
168
 
169
- Under Download Model, you can enter the model repo: TheBloke/upstage-llama-30b-instruct-2048-GGUF and below it, a specific filename to download, such as: upstage-llama-30b-instruct-2048.q4_K_M.gguf.
170
 
171
  Then click Download.
172
 
@@ -175,13 +175,13 @@ Then click Download.
175
  I recommend using the `huggingface-hub` Python library:
176
 
177
  ```shell
178
- pip3 install huggingface-hub>=0.17.1
179
  ```
180
 
181
  Then you can download any individual model file to the current directory, at high speed, with a command like this:
182
 
183
  ```shell
184
- huggingface-cli download TheBloke/upstage-llama-30b-instruct-2048-GGUF upstage-llama-30b-instruct-2048.q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
185
  ```
186
 
187
  <details>
@@ -204,25 +204,25 @@ pip3 install hf_transfer
204
  And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
205
 
206
  ```shell
207
- HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/upstage-llama-30b-instruct-2048-GGUF upstage-llama-30b-instruct-2048.q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
208
  ```
209
 
210
- Windows CLI users: Use `set HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1` before running the download command.
211
  </details>
212
  <!-- README_GGUF.md-how-to-download end -->
213
 
214
  <!-- README_GGUF.md-how-to-run start -->
215
  ## Example `llama.cpp` command
216
 
217
- Make sure you are using `llama.cpp` from commit [d0cee0d36d5be95a0d9088b674dbb27354107221](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
218
 
219
  ```shell
220
- ./main -ngl 32 -m upstage-llama-30b-instruct-2048.q4_K_M.gguf --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### System:\n{system_message}\n\n### User:\n{prompt}\n\n### Assistant:"
221
  ```
222
 
223
  Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
224
 
225
- 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.
226
 
227
  If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
228
 
@@ -236,35 +236,37 @@ Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://git
236
 
237
  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.
238
 
239
- ### How to load this model from Python using ctransformers
240
 
241
  #### First install the package
242
 
243
- ```bash
 
 
244
  # Base ctransformers with no GPU acceleration
245
- pip install ctransformers>=0.2.24
246
  # Or with CUDA GPU acceleration
247
- pip install ctransformers[cuda]>=0.2.24
248
- # Or with ROCm GPU acceleration
249
- CT_HIPBLAS=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
250
- # Or with Metal GPU acceleration for macOS systems
251
- CT_METAL=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
252
  ```
253
 
254
- #### Simple example code to load one of these GGUF models
255
 
256
  ```python
257
  from ctransformers import AutoModelForCausalLM
258
 
259
  # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
260
- llm = AutoModelForCausalLM.from_pretrained("TheBloke/upstage-llama-30b-instruct-2048-GGUF", model_file="upstage-llama-30b-instruct-2048.q4_K_M.gguf", model_type="llama", gpu_layers=50)
261
 
262
  print(llm("AI is going to"))
263
  ```
264
 
265
  ## How to use with LangChain
266
 
267
- Here's guides on using llama-cpp-python or ctransformers with LangChain:
268
 
269
  * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
270
  * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
 
67
  <!-- README_GGUF.md-about-gguf start -->
68
  ### About GGUF
69
 
70
+ 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.
71
 
72
  Here is an incomplate list of clients and libraries that are known to support GGUF:
73
 
 
111
  <!-- compatibility_gguf start -->
112
  ## Compatibility
113
 
114
+ 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)
115
 
116
  They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
117
 
 
166
 
167
  ### In `text-generation-webui`
168
 
169
+ Under Download Model, you can enter the model repo: TheBloke/upstage-llama-30b-instruct-2048-GGUF and below it, a specific filename to download, such as: upstage-llama-30b-instruct-2048.Q4_K_M.gguf.
170
 
171
  Then click Download.
172
 
 
175
  I recommend using the `huggingface-hub` Python library:
176
 
177
  ```shell
178
+ pip3 install huggingface-hub
179
  ```
180
 
181
  Then you can download any individual model file to the current directory, at high speed, with a command like this:
182
 
183
  ```shell
184
+ huggingface-cli download TheBloke/upstage-llama-30b-instruct-2048-GGUF upstage-llama-30b-instruct-2048.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
185
  ```
186
 
187
  <details>
 
204
  And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
205
 
206
  ```shell
207
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/upstage-llama-30b-instruct-2048-GGUF upstage-llama-30b-instruct-2048.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
208
  ```
209
 
210
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
211
  </details>
212
  <!-- README_GGUF.md-how-to-download end -->
213
 
214
  <!-- README_GGUF.md-how-to-run start -->
215
  ## Example `llama.cpp` command
216
 
217
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
218
 
219
  ```shell
220
+ ./main -ngl 32 -m upstage-llama-30b-instruct-2048.Q4_K_M.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### System:\n{system_message}\n\n### User:\n{prompt}\n\n### Assistant:"
221
  ```
222
 
223
  Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
224
 
225
+ Change `-c 2048` 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.
226
 
227
  If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
228
 
 
236
 
237
  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.
238
 
239
+ ### How to load this model in Python code, using ctransformers
240
 
241
  #### First install the package
242
 
243
+ Run one of the following commands, according to your system:
244
+
245
+ ```shell
246
  # Base ctransformers with no GPU acceleration
247
+ pip install ctransformers
248
  # Or with CUDA GPU acceleration
249
+ pip install ctransformers[cuda]
250
+ # Or with AMD ROCm GPU acceleration (Linux only)
251
+ CT_HIPBLAS=1 pip install ctransformers --no-binary ctransformers
252
+ # Or with Metal GPU acceleration for macOS systems only
253
+ CT_METAL=1 pip install ctransformers --no-binary ctransformers
254
  ```
255
 
256
+ #### Simple ctransformers example code
257
 
258
  ```python
259
  from ctransformers import AutoModelForCausalLM
260
 
261
  # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
262
+ llm = AutoModelForCausalLM.from_pretrained("TheBloke/upstage-llama-30b-instruct-2048-GGUF", model_file="upstage-llama-30b-instruct-2048.Q4_K_M.gguf", model_type="llama", gpu_layers=50)
263
 
264
  print(llm("AI is going to"))
265
  ```
266
 
267
  ## How to use with LangChain
268
 
269
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
270
 
271
  * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
272
  * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)