TheBloke commited on
Commit
82df2c4
1 Parent(s): f9f3bb9

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +382 -0
README.md ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: chargoddard/rpguild-chatml-13b
3
+ datasets:
4
+ - chargoddard/rpguild
5
+ inference: false
6
+ language:
7
+ - en
8
+ license: cc-by-nc-4.0
9
+ model_creator: Charles Goddard
10
+ model_name: RPGuild ChatML 13B
11
+ model_type: llama
12
+ prompt_template: '<|im_start|>system
13
+
14
+ {system_message}<|im_end|>
15
+
16
+ <|im_start|>user
17
+
18
+ {prompt}<|im_end|>
19
+
20
+ <|im_start|>assistant
21
+
22
+ '
23
+ quantized_by: TheBloke
24
+ tags:
25
+ - llama
26
+ - roleplay
27
+ ---
28
+ <!-- markdownlint-disable MD041 -->
29
+
30
+ <!-- header start -->
31
+ <!-- 200823 -->
32
+ <div style="width: auto; margin-left: auto; margin-right: auto">
33
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
34
+ </div>
35
+ <div style="display: flex; justify-content: space-between; width: 100%;">
36
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
37
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
38
+ </div>
39
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
40
+ <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>
41
+ </div>
42
+ </div>
43
+ <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>
44
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
45
+ <!-- header end -->
46
+
47
+ # RPGuild ChatML 13B - AWQ
48
+ - Model creator: [Charles Goddard](https://huggingface.co/chargoddard)
49
+ - Original model: [RPGuild ChatML 13B](https://huggingface.co/chargoddard/rpguild-chatml-13b)
50
+
51
+ <!-- description start -->
52
+ ## Description
53
+
54
+ This repo contains AWQ model files for [Charles Goddard's RPGuild ChatML 13B](https://huggingface.co/chargoddard/rpguild-chatml-13b).
55
+
56
+
57
+ ### About AWQ
58
+
59
+ 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.
60
+
61
+ It is supported by:
62
+
63
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
64
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
65
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
66
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
67
+
68
+ <!-- description end -->
69
+ <!-- repositories-available start -->
70
+ ## Repositories available
71
+
72
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/rpguild-chatml-13B-AWQ)
73
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/rpguild-chatml-13B-GPTQ)
74
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/rpguild-chatml-13B-GGUF)
75
+ * [Charles Goddard's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/chargoddard/rpguild-chatml-13b)
76
+ <!-- repositories-available end -->
77
+
78
+ <!-- prompt-template start -->
79
+ ## Prompt template: ChatML
80
+
81
+ ```
82
+ <|im_start|>system
83
+ {system_message}<|im_end|>
84
+ <|im_start|>user
85
+ {prompt}<|im_end|>
86
+ <|im_start|>assistant
87
+
88
+ ```
89
+
90
+ <!-- prompt-template end -->
91
+ <!-- licensing start -->
92
+ ## Licensing
93
+
94
+ The creator of the source model has listed its license as `cc-by-nc-4.0`, and this quantization has therefore used that same license.
95
+
96
+ As this model is based on Llama 2, it is also subject to the Meta Llama 2 license terms, and the license files for that are additionally included. It should therefore be considered as being claimed to be licensed under both licenses. I contacted Hugging Face for clarification on dual licensing but they do not yet have an official position. Should this change, or should Meta provide any feedback on this situation, I will update this section accordingly.
97
+
98
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Charles Goddard's RPGuild ChatML 13B](https://huggingface.co/chargoddard/rpguild-chatml-13b).
99
+ <!-- licensing end -->
100
+ <!-- README_AWQ.md-provided-files start -->
101
+ ## Provided files, and AWQ parameters
102
+
103
+ For my first release of AWQ models, I am releasing 128g models only. I will consider adding 32g as well if there is interest, and once I have done perplexity and evaluation comparisons, but at this time 32g models are still not fully tested with AutoAWQ and vLLM.
104
+
105
+ Models are released as sharded safetensors files.
106
+
107
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
108
+ | ------ | ---- | -- | ----------- | ------- | ---- |
109
+ | [main](https://huggingface.co/TheBloke/rpguild-chatml-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
110
+
111
+ <!-- README_AWQ.md-provided-files end -->
112
+
113
+ <!-- README_AWQ.md-text-generation-webui start -->
114
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
115
+
116
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
117
+
118
+ 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.
119
+
120
+ 1. Click the **Model tab**.
121
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/rpguild-chatml-13B-AWQ`.
122
+ 3. Click **Download**.
123
+ 4. The model will start downloading. Once it's finished it will say "Done".
124
+ 5. In the top left, click the refresh icon next to **Model**.
125
+ 6. In the **Model** dropdown, choose the model you just downloaded: `rpguild-chatml-13B-AWQ`
126
+ 7. Select **Loader: AutoAWQ**.
127
+ 8. Click Load, and the model will load and is now ready for use.
128
+ 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.
129
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
130
+ <!-- README_AWQ.md-text-generation-webui end -->
131
+
132
+ <!-- README_AWQ.md-use-from-vllm start -->
133
+ ## Multi-user inference server: vLLM
134
+
135
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
136
+
137
+ - Please ensure you are using vLLM version 0.2 or later.
138
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
139
+
140
+ For example:
141
+
142
+ ```shell
143
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/rpguild-chatml-13B-AWQ --quantization awq
144
+ ```
145
+
146
+ - When using vLLM from Python code, again set `quantization=awq`.
147
+
148
+ For example:
149
+
150
+ ```python
151
+ from vllm import LLM, SamplingParams
152
+
153
+ prompts = [
154
+ "Tell me about AI",
155
+ "Write a story about llamas",
156
+ "What is 291 - 150?",
157
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
158
+ ]
159
+ prompt_template=f'''<|im_start|>system
160
+ {system_message}<|im_end|>
161
+ <|im_start|>user
162
+ {prompt}<|im_end|>
163
+ <|im_start|>assistant
164
+ '''
165
+
166
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
167
+
168
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
169
+
170
+ llm = LLM(model="TheBloke/rpguild-chatml-13B-AWQ", quantization="awq", dtype="auto")
171
+
172
+ outputs = llm.generate(prompts, sampling_params)
173
+
174
+ # Print the outputs.
175
+ for output in outputs:
176
+ prompt = output.prompt
177
+ generated_text = output.outputs[0].text
178
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
179
+ ```
180
+ <!-- README_AWQ.md-use-from-vllm start -->
181
+
182
+ <!-- README_AWQ.md-use-from-tgi start -->
183
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
184
+
185
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
186
+
187
+ Example Docker parameters:
188
+
189
+ ```shell
190
+ --model-id TheBloke/rpguild-chatml-13B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
191
+ ```
192
+
193
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
194
+
195
+ ```shell
196
+ pip3 install huggingface-hub
197
+ ```
198
+
199
+ ```python
200
+ from huggingface_hub import InferenceClient
201
+
202
+ endpoint_url = "https://your-endpoint-url-here"
203
+
204
+ prompt = "Tell me about AI"
205
+ prompt_template=f'''<|im_start|>system
206
+ {system_message}<|im_end|>
207
+ <|im_start|>user
208
+ {prompt}<|im_end|>
209
+ <|im_start|>assistant
210
+ '''
211
+
212
+ client = InferenceClient(endpoint_url)
213
+ response = client.text_generation(prompt,
214
+ max_new_tokens=128,
215
+ do_sample=True,
216
+ temperature=0.7,
217
+ top_p=0.95,
218
+ top_k=40,
219
+ repetition_penalty=1.1)
220
+
221
+ print(f"Model output: ", response)
222
+ ```
223
+ <!-- README_AWQ.md-use-from-tgi end -->
224
+
225
+ <!-- README_AWQ.md-use-from-python start -->
226
+ ## Inference from Python code using AutoAWQ
227
+
228
+ ### Install the AutoAWQ package
229
+
230
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later.
231
+
232
+ ```shell
233
+ pip3 install autoawq
234
+ ```
235
+
236
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
237
+
238
+ ```shell
239
+ pip3 uninstall -y autoawq
240
+ git clone https://github.com/casper-hansen/AutoAWQ
241
+ cd AutoAWQ
242
+ pip3 install .
243
+ ```
244
+
245
+ ### AutoAWQ example code
246
+
247
+ ```python
248
+ from awq import AutoAWQForCausalLM
249
+ from transformers import AutoTokenizer
250
+
251
+ model_name_or_path = "TheBloke/rpguild-chatml-13B-AWQ"
252
+
253
+ # Load tokenizer
254
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
255
+ # Load model
256
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
257
+ trust_remote_code=False, safetensors=True)
258
+
259
+ prompt = "Tell me about AI"
260
+ prompt_template=f'''<|im_start|>system
261
+ {system_message}<|im_end|>
262
+ <|im_start|>user
263
+ {prompt}<|im_end|>
264
+ <|im_start|>assistant
265
+ '''
266
+
267
+ print("*** Running model.generate:")
268
+
269
+ token_input = tokenizer(
270
+ prompt_template,
271
+ return_tensors='pt'
272
+ ).input_ids.cuda()
273
+
274
+ # Generate output
275
+ generation_output = model.generate(
276
+ token_input,
277
+ do_sample=True,
278
+ temperature=0.7,
279
+ top_p=0.95,
280
+ top_k=40,
281
+ max_new_tokens=512
282
+ )
283
+
284
+ # Get the tokens from the output, decode them, print them
285
+ token_output = generation_output[0]
286
+ text_output = tokenizer.decode(token_output)
287
+ print("LLM output: ", text_output)
288
+
289
+ """
290
+ # Inference should be possible with transformers pipeline as well in future
291
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
292
+ from transformers import pipeline
293
+
294
+ print("*** Pipeline:")
295
+ pipe = pipeline(
296
+ "text-generation",
297
+ model=model,
298
+ tokenizer=tokenizer,
299
+ max_new_tokens=512,
300
+ do_sample=True,
301
+ temperature=0.7,
302
+ top_p=0.95,
303
+ top_k=40,
304
+ repetition_penalty=1.1
305
+ )
306
+
307
+ print(pipe(prompt_template)[0]['generated_text'])
308
+ """
309
+ ```
310
+ <!-- README_AWQ.md-use-from-python end -->
311
+
312
+ <!-- README_AWQ.md-compatibility start -->
313
+ ## Compatibility
314
+
315
+ The files provided are tested to work with:
316
+
317
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
318
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
319
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
320
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
321
+
322
+ <!-- README_AWQ.md-compatibility end -->
323
+
324
+ <!-- footer start -->
325
+ <!-- 200823 -->
326
+ ## Discord
327
+
328
+ For further support, and discussions on these models and AI in general, join us at:
329
+
330
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
331
+
332
+ ## Thanks, and how to contribute
333
+
334
+ Thanks to the [chirper.ai](https://chirper.ai) team!
335
+
336
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
337
+
338
+ 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.
339
+
340
+ 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.
341
+
342
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
343
+
344
+ * Patreon: https://patreon.com/TheBlokeAI
345
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
346
+
347
+ **Special thanks to**: Aemon Algiz.
348
+
349
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
350
+
351
+
352
+ Thank you to all my generous patrons and donaters!
353
+
354
+ And thank you again to a16z for their generous grant.
355
+
356
+ <!-- footer end -->
357
+
358
+ # Original model card: Charles Goddard's RPGuild ChatML 13B
359
+
360
+
361
+ It's a roleplay model! Trained on ~50k examples of human written roleplay sessions. Not a hint of gpt-flavor writing. Very creative and very able to roll with the punches.
362
+
363
+ Does tend to speak for you more than it should and has a very, very strong bias towards speech in quotes.
364
+
365
+ Uses ChatML prompt format, with optional length suffixes:
366
+
367
+ ```
368
+ <|im_start|>system
369
+ Enter roleplay mode. You are Steve.
370
+
371
+ Steve is a nasty little man and solves all his problems by punching people in the face.<|im_end|>
372
+ <|im_start|>Gundalf, Gandalf's cousin with a gun
373
+ Gundalf runs frantically up to Steve and begins yelling. "We have a big problem, Steve!"<|im_end|>
374
+ <|im_start|>Steve (Length: short)
375
+ "What is it now Gundalf? Do you want me to punch you in the face?" Steve asked, looking down at him. He was pretty sure that this guy wasn't worth the trouble of punching him in the face, but he didn't like to leave loose ends hanging either.
376
+
377
+ "There's been an incident," Gundalf said quickly, "A dwarf has stolen some gold from Smaug."
378
+
379
+ "Well I don't care about any of those things," Steve responded, turning away. <|im_end|>
380
+ ```
381
+
382
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)