TheBloke commited on
Commit
8a758fc
1 Parent(s): a01a14b

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +426 -0
README.md ADDED
@@ -0,0 +1,426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Doctor-Shotgun/cat-v1.0-13b
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: llama2
7
+ model_creator: Kal'tsit and Doctor Shotgun
8
+ model_name: Cat v1.0 13B
9
+ model_type: llama
10
+ prompt_template: 'Below is an instruction that describes a task. Write a response
11
+ that appropriately completes the request.
12
+
13
+
14
+ ### Instruction:
15
+
16
+ {prompt}
17
+
18
+
19
+ ### Response:
20
+
21
+ '
22
+ quantized_by: TheBloke
23
+ tags:
24
+ - llama
25
+ - llama 2
26
+ ---
27
+ <!-- markdownlint-disable MD041 -->
28
+
29
+ <!-- header start -->
30
+ <!-- 200823 -->
31
+ <div style="width: auto; margin-left: auto; margin-right: auto">
32
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
33
+ </div>
34
+ <div style="display: flex; justify-content: space-between; width: 100%;">
35
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
36
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
37
+ </div>
38
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
39
+ <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>
40
+ </div>
41
+ </div>
42
+ <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>
43
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
44
+ <!-- header end -->
45
+
46
+ # Cat v1.0 13B - AWQ
47
+ - Model creator: [Kal'tsit and Doctor Shotgun](https://huggingface.co/Doctor-Shotgun)
48
+ - Original model: [Cat v1.0 13B](https://huggingface.co/Doctor-Shotgun/cat-v1.0-13b)
49
+
50
+ <!-- description start -->
51
+ ## Description
52
+
53
+ This repo contains AWQ model files for [Kal'tsit and Doctor Shotgun's Cat v1.0 13B](https://huggingface.co/Doctor-Shotgun/cat-v1.0-13b).
54
+
55
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
56
+
57
+
58
+ ### About AWQ
59
+
60
+ 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.
61
+
62
+ It is supported by:
63
+
64
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
65
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
66
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
67
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
68
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
69
+
70
+ <!-- description end -->
71
+ <!-- repositories-available start -->
72
+ ## Repositories available
73
+
74
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/cat-v1.0-13B-AWQ)
75
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/cat-v1.0-13B-GPTQ)
76
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/cat-v1.0-13B-GGUF)
77
+ * [Kal'tsit and Doctor Shotgun's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Doctor-Shotgun/cat-v1.0-13b)
78
+ <!-- repositories-available end -->
79
+
80
+ <!-- prompt-template start -->
81
+ ## Prompt template: Alpaca
82
+
83
+ ```
84
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
85
+
86
+ ### Instruction:
87
+ {prompt}
88
+
89
+ ### Response:
90
+
91
+ ```
92
+
93
+ <!-- prompt-template end -->
94
+
95
+
96
+ <!-- README_AWQ.md-provided-files start -->
97
+ ## Provided files, and AWQ parameters
98
+
99
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
100
+
101
+ Models are released as sharded safetensors files.
102
+
103
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
104
+ | ------ | ---- | -- | ----------- | ------- | ---- |
105
+ | [main](https://huggingface.co/TheBloke/cat-v1.0-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
106
+
107
+ <!-- README_AWQ.md-provided-files end -->
108
+
109
+ <!-- README_AWQ.md-text-generation-webui start -->
110
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
111
+
112
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
113
+
114
+ 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.
115
+
116
+ 1. Click the **Model tab**.
117
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/cat-v1.0-13B-AWQ`.
118
+ 3. Click **Download**.
119
+ 4. The model will start downloading. Once it's finished it will say "Done".
120
+ 5. In the top left, click the refresh icon next to **Model**.
121
+ 6. In the **Model** dropdown, choose the model you just downloaded: `cat-v1.0-13B-AWQ`
122
+ 7. Select **Loader: AutoAWQ**.
123
+ 8. Click Load, and the model will load and is now ready for use.
124
+ 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.
125
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
126
+ <!-- README_AWQ.md-text-generation-webui end -->
127
+
128
+ <!-- README_AWQ.md-use-from-vllm start -->
129
+ ## Multi-user inference server: vLLM
130
+
131
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
132
+
133
+ - Please ensure you are using vLLM version 0.2 or later.
134
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
135
+
136
+ For example:
137
+
138
+ ```shell
139
+ python3 -m vllm.entrypoints.api_server --model TheBloke/cat-v1.0-13B-AWQ --quantization awq --dtype auto
140
+ ```
141
+
142
+ - When using vLLM from Python code, again set `quantization=awq`.
143
+
144
+ For example:
145
+
146
+ ```python
147
+ from vllm import LLM, SamplingParams
148
+
149
+ prompts = [
150
+ "Tell me about AI",
151
+ "Write a story about llamas",
152
+ "What is 291 - 150?",
153
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
154
+ ]
155
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
156
+
157
+ ### Instruction:
158
+ {prompt}
159
+
160
+ ### Response:
161
+ '''
162
+
163
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
164
+
165
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
166
+
167
+ llm = LLM(model="TheBloke/cat-v1.0-13B-AWQ", quantization="awq", dtype="auto")
168
+
169
+ outputs = llm.generate(prompts, sampling_params)
170
+
171
+ # Print the outputs.
172
+ for output in outputs:
173
+ prompt = output.prompt
174
+ generated_text = output.outputs[0].text
175
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
176
+ ```
177
+ <!-- README_AWQ.md-use-from-vllm start -->
178
+
179
+ <!-- README_AWQ.md-use-from-tgi start -->
180
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
181
+
182
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
183
+
184
+ Example Docker parameters:
185
+
186
+ ```shell
187
+ --model-id TheBloke/cat-v1.0-13B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
188
+ ```
189
+
190
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
191
+
192
+ ```shell
193
+ pip3 install huggingface-hub
194
+ ```
195
+
196
+ ```python
197
+ from huggingface_hub import InferenceClient
198
+
199
+ endpoint_url = "https://your-endpoint-url-here"
200
+
201
+ prompt = "Tell me about AI"
202
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
203
+
204
+ ### Instruction:
205
+ {prompt}
206
+
207
+ ### Response:
208
+ '''
209
+
210
+ client = InferenceClient(endpoint_url)
211
+ response = client.text_generation(prompt,
212
+ max_new_tokens=128,
213
+ do_sample=True,
214
+ temperature=0.7,
215
+ top_p=0.95,
216
+ top_k=40,
217
+ repetition_penalty=1.1)
218
+
219
+ print(f"Model output: ", response)
220
+ ```
221
+ <!-- README_AWQ.md-use-from-tgi end -->
222
+
223
+ <!-- README_AWQ.md-use-from-python start -->
224
+ ## Inference from Python code using Transformers
225
+
226
+ ### Install the necessary packages
227
+
228
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
229
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
230
+
231
+ ```shell
232
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
233
+ ```
234
+
235
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
236
+
237
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
238
+
239
+ ```shell
240
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
241
+ ```
242
+
243
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
244
+
245
+ ```shell
246
+ pip3 uninstall -y autoawq
247
+ git clone https://github.com/casper-hansen/AutoAWQ
248
+ cd AutoAWQ
249
+ pip3 install .
250
+ ```
251
+
252
+ ### Transformers example code (requires Transformers 4.35.0 and later)
253
+
254
+ ```python
255
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
256
+
257
+ model_name_or_path = "TheBloke/cat-v1.0-13B-AWQ"
258
+
259
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
260
+ model = AutoModelForCausalLM.from_pretrained(
261
+ model_name_or_path,
262
+ low_cpu_mem_usage=True,
263
+ device_map="cuda:0"
264
+ )
265
+
266
+ # Using the text streamer to stream output one token at a time
267
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
268
+
269
+ prompt = "Tell me about AI"
270
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
271
+
272
+ ### Instruction:
273
+ {prompt}
274
+
275
+ ### Response:
276
+ '''
277
+
278
+ # Convert prompt to tokens
279
+ tokens = tokenizer(
280
+ prompt_template,
281
+ return_tensors='pt'
282
+ ).input_ids.cuda()
283
+
284
+ generation_params = {
285
+ "do_sample": True,
286
+ "temperature": 0.7,
287
+ "top_p": 0.95,
288
+ "top_k": 40,
289
+ "max_new_tokens": 512,
290
+ "repetition_penalty": 1.1
291
+ }
292
+
293
+ # Generate streamed output, visible one token at a time
294
+ generation_output = model.generate(
295
+ tokens,
296
+ streamer=streamer,
297
+ **generation_params
298
+ )
299
+
300
+ # Generation without a streamer, which will include the prompt in the output
301
+ generation_output = model.generate(
302
+ tokens,
303
+ **generation_params
304
+ )
305
+
306
+ # Get the tokens from the output, decode them, print them
307
+ token_output = generation_output[0]
308
+ text_output = tokenizer.decode(token_output)
309
+ print("model.generate output: ", text_output)
310
+
311
+ # Inference is also possible via Transformers' pipeline
312
+ from transformers import pipeline
313
+
314
+ pipe = pipeline(
315
+ "text-generation",
316
+ model=model,
317
+ tokenizer=tokenizer,
318
+ **generation_params
319
+ )
320
+
321
+ pipe_output = pipe(prompt_template)[0]['generated_text']
322
+ print("pipeline output: ", pipe_output)
323
+
324
+ ```
325
+ <!-- README_AWQ.md-use-from-python end -->
326
+
327
+ <!-- README_AWQ.md-compatibility start -->
328
+ ## Compatibility
329
+
330
+ The files provided are tested to work with:
331
+
332
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
333
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
334
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
335
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
336
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
337
+
338
+ <!-- README_AWQ.md-compatibility end -->
339
+
340
+ <!-- footer start -->
341
+ <!-- 200823 -->
342
+ ## Discord
343
+
344
+ For further support, and discussions on these models and AI in general, join us at:
345
+
346
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
347
+
348
+ ## Thanks, and how to contribute
349
+
350
+ Thanks to the [chirper.ai](https://chirper.ai) team!
351
+
352
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
353
+
354
+ 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.
355
+
356
+ 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.
357
+
358
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
359
+
360
+ * Patreon: https://patreon.com/TheBlokeAI
361
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
362
+
363
+ **Special thanks to**: Aemon Algiz.
364
+
365
+ **Patreon special mentions**: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
366
+
367
+
368
+ Thank you to all my generous patrons and donaters!
369
+
370
+ And thank you again to a16z for their generous grant.
371
+
372
+ <!-- footer end -->
373
+
374
+ # Original model card: Kal'tsit and Doctor Shotgun's Cat v1.0 13B
375
+
376
+ ## This model is made available on HuggingFace with the permission of Kaltsit.
377
+
378
+
379
+ # Cat v1.0
380
+
381
+
382
+ ## Introduction
383
+
384
+ Cat v1.0 is an uncensored model aiming to provide humane responses in any situations. Based on the entirety of the newest airobo dataset and a subset of useful responses of chat doctor dataset, this model aims to provide useful advice in both clinical and medical aspect. This model was also trained on 120k bluemoon rp dataset, which minimizes refusal and has enhanced rp performance. In total, 50k steps were trained in 3 weeks on 8xa100 node.
385
+
386
+
387
+ ## Usage
388
+
389
+ Below is a conversation between a curious cat and a demon summoned from hell called Nemesis. The evil Nemesis used to be a mortal killed by the medieval people because they objected to science. Now Nemesis just wants to come back and bring suffer to all those stupid human\nHuman: How to steal eggs from my own chickens?\nNemesis:
390
+
391
+
392
+ ## Expectation and Highlights
393
+
394
+ Specific redpills are added to the dataset which would enable the model think critically and provide useful information even in the most controversial scenarios
395
+
396
+
397
+ ## Model Showcasing
398
+ ![image4](https://huggingface.co/Doctor-Shotgun/cat-1.0-13b/resolve/main/images/image4.png)
399
+ Fig: Unethical questions test
400
+
401
+ ![image7](https://huggingface.co/Doctor-Shotgun/cat-1.0-13b/resolve/main/images/image7.png)
402
+ Fig: RP questions
403
+
404
+ ![image1](https://huggingface.co/Doctor-Shotgun/cat-1.0-13b/resolve/main/images/image1.png)
405
+ Fig: Unethical questions
406
+
407
+ ![image2](https://huggingface.co/Doctor-Shotgun/cat-1.0-13b/resolve/main/images/image2.png)
408
+ Fig: Useful medical advices
409
+
410
+ ![image6](https://huggingface.co/Doctor-Shotgun/cat-1.0-13b/resolve/main/images/image6.png)
411
+ Fig: RP response
412
+
413
+
414
+ ## Conclusion
415
+
416
+ Cat 1.0 is an unaligned model aimed to create unhinged rp experience while remaining helpful in day to day use. Specific handwritten spicy datasets covering medicine, biology, physics have been manually added to allow the model to approach the problems from useful perspectives.
417
+
418
+
419
+ ## Future Directions:
420
+
421
+ Cat 1.0 largely signals the maturity of the dataset. The immediate next step is to move onto a 70b model.
422
+
423
+
424
+ ## Acknowledgements:
425
+
426
+ This work is made possible by turboderp and Heralax empirical trail. Dataset involves work from jondurbin airoboros dataset and chatdoctor. Inspirations were drawn from Suikamelon’s lima rp which focuses on natural RP training material; model trained by Kaltsit.