Upload README.md
Browse files
README.md
CHANGED
@@ -43,7 +43,7 @@ This repo contains GGUF format model files for [Tim Dettmers' Guanaco 33B](https
|
|
43 |
<!-- README_GGUF.md-about-gguf start -->
|
44 |
### About GGUF
|
45 |
|
46 |
-
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.
|
47 |
|
48 |
Here is an incomplate list of clients and libraries that are known to support GGUF:
|
49 |
|
@@ -82,7 +82,7 @@ Here is an incomplate list of clients and libraries that are known to support GG
|
|
82 |
<!-- compatibility_gguf start -->
|
83 |
## Compatibility
|
84 |
|
85 |
-
These quantised GGUFv2 files are compatible with llama.cpp from August 27th onwards, as of commit [
|
86 |
|
87 |
They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
|
88 |
|
@@ -137,7 +137,7 @@ The following clients/libraries will automatically download models for you, prov
|
|
137 |
|
138 |
### In `text-generation-webui`
|
139 |
|
140 |
-
Under Download Model, you can enter the model repo: TheBloke/guanaco-33B-GGUF and below it, a specific filename to download, such as: guanaco-33b.
|
141 |
|
142 |
Then click Download.
|
143 |
|
@@ -146,13 +146,13 @@ Then click Download.
|
|
146 |
I recommend using the `huggingface-hub` Python library:
|
147 |
|
148 |
```shell
|
149 |
-
pip3 install huggingface-hub
|
150 |
```
|
151 |
|
152 |
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
153 |
|
154 |
```shell
|
155 |
-
huggingface-cli download TheBloke/guanaco-33B-GGUF guanaco-33b.
|
156 |
```
|
157 |
|
158 |
<details>
|
@@ -175,25 +175,25 @@ pip3 install hf_transfer
|
|
175 |
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
176 |
|
177 |
```shell
|
178 |
-
|
179 |
```
|
180 |
|
181 |
-
Windows
|
182 |
</details>
|
183 |
<!-- README_GGUF.md-how-to-download end -->
|
184 |
|
185 |
<!-- README_GGUF.md-how-to-run start -->
|
186 |
## Example `llama.cpp` command
|
187 |
|
188 |
-
Make sure you are using `llama.cpp` from commit [
|
189 |
|
190 |
```shell
|
191 |
-
./main -ngl 32 -m guanaco-33b.
|
192 |
```
|
193 |
|
194 |
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
195 |
|
196 |
-
Change `-c
|
197 |
|
198 |
If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
|
199 |
|
@@ -207,35 +207,37 @@ Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://git
|
|
207 |
|
208 |
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.
|
209 |
|
210 |
-
### How to load this model
|
211 |
|
212 |
#### First install the package
|
213 |
|
214 |
-
|
|
|
|
|
215 |
# Base ctransformers with no GPU acceleration
|
216 |
-
pip install ctransformers
|
217 |
# Or with CUDA GPU acceleration
|
218 |
-
pip install ctransformers[cuda]
|
219 |
-
# Or with ROCm GPU acceleration
|
220 |
-
CT_HIPBLAS=1 pip install ctransformers
|
221 |
-
# Or with Metal GPU acceleration for macOS systems
|
222 |
-
CT_METAL=1 pip install ctransformers
|
223 |
```
|
224 |
|
225 |
-
#### Simple example code
|
226 |
|
227 |
```python
|
228 |
from ctransformers import AutoModelForCausalLM
|
229 |
|
230 |
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
231 |
-
llm = AutoModelForCausalLM.from_pretrained("TheBloke/guanaco-33B-GGUF", model_file="guanaco-33b.
|
232 |
|
233 |
print(llm("AI is going to"))
|
234 |
```
|
235 |
|
236 |
## How to use with LangChain
|
237 |
|
238 |
-
Here
|
239 |
|
240 |
* [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
|
241 |
* [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
|
|
|
43 |
<!-- README_GGUF.md-about-gguf start -->
|
44 |
### About GGUF
|
45 |
|
46 |
+
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.
|
47 |
|
48 |
Here is an incomplate list of clients and libraries that are known to support GGUF:
|
49 |
|
|
|
82 |
<!-- compatibility_gguf start -->
|
83 |
## Compatibility
|
84 |
|
85 |
+
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)
|
86 |
|
87 |
They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
|
88 |
|
|
|
137 |
|
138 |
### In `text-generation-webui`
|
139 |
|
140 |
+
Under Download Model, you can enter the model repo: TheBloke/guanaco-33B-GGUF and below it, a specific filename to download, such as: guanaco-33b.Q4_K_M.gguf.
|
141 |
|
142 |
Then click Download.
|
143 |
|
|
|
146 |
I recommend using the `huggingface-hub` Python library:
|
147 |
|
148 |
```shell
|
149 |
+
pip3 install huggingface-hub
|
150 |
```
|
151 |
|
152 |
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
153 |
|
154 |
```shell
|
155 |
+
huggingface-cli download TheBloke/guanaco-33B-GGUF guanaco-33b.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
|
156 |
```
|
157 |
|
158 |
<details>
|
|
|
175 |
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
176 |
|
177 |
```shell
|
178 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/guanaco-33B-GGUF guanaco-33b.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
|
179 |
```
|
180 |
|
181 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
182 |
</details>
|
183 |
<!-- README_GGUF.md-how-to-download end -->
|
184 |
|
185 |
<!-- README_GGUF.md-how-to-run start -->
|
186 |
## Example `llama.cpp` command
|
187 |
|
188 |
+
Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
|
189 |
|
190 |
```shell
|
191 |
+
./main -ngl 32 -m guanaco-33b.Q4_K_M.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### Human: {prompt}\n### Assistant:"
|
192 |
```
|
193 |
|
194 |
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
195 |
|
196 |
+
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.
|
197 |
|
198 |
If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
|
199 |
|
|
|
207 |
|
208 |
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.
|
209 |
|
210 |
+
### How to load this model in Python code, using ctransformers
|
211 |
|
212 |
#### First install the package
|
213 |
|
214 |
+
Run one of the following commands, according to your system:
|
215 |
+
|
216 |
+
```shell
|
217 |
# Base ctransformers with no GPU acceleration
|
218 |
+
pip install ctransformers
|
219 |
# Or with CUDA GPU acceleration
|
220 |
+
pip install ctransformers[cuda]
|
221 |
+
# Or with AMD ROCm GPU acceleration (Linux only)
|
222 |
+
CT_HIPBLAS=1 pip install ctransformers --no-binary ctransformers
|
223 |
+
# Or with Metal GPU acceleration for macOS systems only
|
224 |
+
CT_METAL=1 pip install ctransformers --no-binary ctransformers
|
225 |
```
|
226 |
|
227 |
+
#### Simple ctransformers example code
|
228 |
|
229 |
```python
|
230 |
from ctransformers import AutoModelForCausalLM
|
231 |
|
232 |
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
233 |
+
llm = AutoModelForCausalLM.from_pretrained("TheBloke/guanaco-33B-GGUF", model_file="guanaco-33b.Q4_K_M.gguf", model_type="llama", gpu_layers=50)
|
234 |
|
235 |
print(llm("AI is going to"))
|
236 |
```
|
237 |
|
238 |
## How to use with LangChain
|
239 |
|
240 |
+
Here are guides on using llama-cpp-python and ctransformers with LangChain:
|
241 |
|
242 |
* [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
|
243 |
* [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
|