TheBloke commited on
Commit
806add1
1 Parent(s): a5d8522

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +373 -0
README.md ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: cgato/Thespis-13b-v0.4
3
+ inference: false
4
+ license: llama2
5
+ model_creator: c.gato
6
+ model_name: Thespis 13B v0.4
7
+ model_type: llama
8
+ prompt_template: "{system_message}\n\nUsername: {prompt}\nBotName: \n"
9
+ quantized_by: TheBloke
10
+ ---
11
+ <!-- markdownlint-disable MD041 -->
12
+
13
+ <!-- header start -->
14
+ <!-- 200823 -->
15
+ <div style="width: auto; margin-left: auto; margin-right: auto">
16
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
17
+ </div>
18
+ <div style="display: flex; justify-content: space-between; width: 100%;">
19
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
20
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
21
+ </div>
22
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
23
+ <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>
24
+ </div>
25
+ </div>
26
+ <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>
27
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
28
+ <!-- header end -->
29
+
30
+ # Thespis 13B v0.4 - AWQ
31
+ - Model creator: [c.gato](https://huggingface.co/cgato)
32
+ - Original model: [Thespis 13B v0.4](https://huggingface.co/cgato/Thespis-13b-v0.4)
33
+
34
+ <!-- description start -->
35
+ ## Description
36
+
37
+ This repo contains AWQ model files for [c.gato's Thespis 13B v0.4](https://huggingface.co/cgato/Thespis-13b-v0.4).
38
+
39
+
40
+ ### About AWQ
41
+
42
+ 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.
43
+
44
+ It is supported by:
45
+
46
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
47
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
48
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
49
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
50
+
51
+ <!-- description end -->
52
+ <!-- repositories-available start -->
53
+ ## Repositories available
54
+
55
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Thespis-13B-v0.4-AWQ)
56
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Thespis-13B-v0.4-GPTQ)
57
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Thespis-13B-v0.4-GGUF)
58
+ * [c.gato's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/cgato/Thespis-13b-v0.4)
59
+ <!-- repositories-available end -->
60
+
61
+ <!-- prompt-template start -->
62
+ ## Prompt template: Thespis
63
+
64
+ ```
65
+ {system_message}
66
+
67
+ Username: {prompt}
68
+ BotName:
69
+
70
+ ```
71
+
72
+ <!-- prompt-template end -->
73
+
74
+
75
+ <!-- README_AWQ.md-provided-files start -->
76
+ ## Provided files, and AWQ parameters
77
+
78
+ 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.
79
+
80
+ Models are released as sharded safetensors files.
81
+
82
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
83
+ | ------ | ---- | -- | ----------- | ------- | ---- |
84
+ | [main](https://huggingface.co/TheBloke/Thespis-13B-v0.4-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
85
+
86
+ <!-- README_AWQ.md-provided-files end -->
87
+
88
+ <!-- README_AWQ.md-text-generation-webui start -->
89
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
90
+
91
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
92
+
93
+ 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.
94
+
95
+ 1. Click the **Model tab**.
96
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Thespis-13B-v0.4-AWQ`.
97
+ 3. Click **Download**.
98
+ 4. The model will start downloading. Once it's finished it will say "Done".
99
+ 5. In the top left, click the refresh icon next to **Model**.
100
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Thespis-13B-v0.4-AWQ`
101
+ 7. Select **Loader: AutoAWQ**.
102
+ 8. Click Load, and the model will load and is now ready for use.
103
+ 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.
104
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
105
+ <!-- README_AWQ.md-text-generation-webui end -->
106
+
107
+ <!-- README_AWQ.md-use-from-vllm start -->
108
+ ## Multi-user inference server: vLLM
109
+
110
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
111
+
112
+ - Please ensure you are using vLLM version 0.2 or later.
113
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
114
+
115
+ For example:
116
+
117
+ ```shell
118
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Thespis-13B-v0.4-AWQ --quantization awq
119
+ ```
120
+
121
+ - When using vLLM from Python code, again set `quantization=awq`.
122
+
123
+ For example:
124
+
125
+ ```python
126
+ from vllm import LLM, SamplingParams
127
+
128
+ prompts = [
129
+ "Tell me about AI",
130
+ "Write a story about llamas",
131
+ "What is 291 - 150?",
132
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
133
+ ]
134
+ prompt_template=f'''{system_message}
135
+
136
+ Username: {prompt}
137
+ BotName:
138
+ '''
139
+
140
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
141
+
142
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
143
+
144
+ llm = LLM(model="TheBloke/Thespis-13B-v0.4-AWQ", quantization="awq", dtype="auto")
145
+
146
+ outputs = llm.generate(prompts, sampling_params)
147
+
148
+ # Print the outputs.
149
+ for output in outputs:
150
+ prompt = output.prompt
151
+ generated_text = output.outputs[0].text
152
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
153
+ ```
154
+ <!-- README_AWQ.md-use-from-vllm start -->
155
+
156
+ <!-- README_AWQ.md-use-from-tgi start -->
157
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
158
+
159
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
160
+
161
+ Example Docker parameters:
162
+
163
+ ```shell
164
+ --model-id TheBloke/Thespis-13B-v0.4-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
165
+ ```
166
+
167
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
168
+
169
+ ```shell
170
+ pip3 install huggingface-hub
171
+ ```
172
+
173
+ ```python
174
+ from huggingface_hub import InferenceClient
175
+
176
+ endpoint_url = "https://your-endpoint-url-here"
177
+
178
+ prompt = "Tell me about AI"
179
+ prompt_template=f'''{system_message}
180
+
181
+ Username: {prompt}
182
+ BotName:
183
+ '''
184
+
185
+ client = InferenceClient(endpoint_url)
186
+ response = client.text_generation(prompt,
187
+ max_new_tokens=128,
188
+ do_sample=True,
189
+ temperature=0.7,
190
+ top_p=0.95,
191
+ top_k=40,
192
+ repetition_penalty=1.1)
193
+
194
+ print(f"Model output: ", response)
195
+ ```
196
+ <!-- README_AWQ.md-use-from-tgi end -->
197
+
198
+ <!-- README_AWQ.md-use-from-python start -->
199
+ ## Inference from Python code using AutoAWQ
200
+
201
+ ### Install the AutoAWQ package
202
+
203
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later.
204
+
205
+ ```shell
206
+ pip3 install autoawq
207
+ ```
208
+
209
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
210
+
211
+ ```shell
212
+ pip3 uninstall -y autoawq
213
+ git clone https://github.com/casper-hansen/AutoAWQ
214
+ cd AutoAWQ
215
+ pip3 install .
216
+ ```
217
+
218
+ ### AutoAWQ example code
219
+
220
+ ```python
221
+ from awq import AutoAWQForCausalLM
222
+ from transformers import AutoTokenizer
223
+
224
+ model_name_or_path = "TheBloke/Thespis-13B-v0.4-AWQ"
225
+
226
+ # Load tokenizer
227
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
228
+ # Load model
229
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
230
+ trust_remote_code=False, safetensors=True)
231
+
232
+ prompt = "Tell me about AI"
233
+ prompt_template=f'''{system_message}
234
+
235
+ Username: {prompt}
236
+ BotName:
237
+ '''
238
+
239
+ print("*** Running model.generate:")
240
+
241
+ token_input = tokenizer(
242
+ prompt_template,
243
+ return_tensors='pt'
244
+ ).input_ids.cuda()
245
+
246
+ # Generate output
247
+ generation_output = model.generate(
248
+ token_input,
249
+ do_sample=True,
250
+ temperature=0.7,
251
+ top_p=0.95,
252
+ top_k=40,
253
+ max_new_tokens=512
254
+ )
255
+
256
+ # Get the tokens from the output, decode them, print them
257
+ token_output = generation_output[0]
258
+ text_output = tokenizer.decode(token_output)
259
+ print("LLM output: ", text_output)
260
+
261
+ """
262
+ # Inference should be possible with transformers pipeline as well in future
263
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
264
+ from transformers import pipeline
265
+
266
+ print("*** Pipeline:")
267
+ pipe = pipeline(
268
+ "text-generation",
269
+ model=model,
270
+ tokenizer=tokenizer,
271
+ max_new_tokens=512,
272
+ do_sample=True,
273
+ temperature=0.7,
274
+ top_p=0.95,
275
+ top_k=40,
276
+ repetition_penalty=1.1
277
+ )
278
+
279
+ print(pipe(prompt_template)[0]['generated_text'])
280
+ """
281
+ ```
282
+ <!-- README_AWQ.md-use-from-python end -->
283
+
284
+ <!-- README_AWQ.md-compatibility start -->
285
+ ## Compatibility
286
+
287
+ The files provided are tested to work with:
288
+
289
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
290
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
291
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
292
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
293
+
294
+ <!-- README_AWQ.md-compatibility end -->
295
+
296
+ <!-- footer start -->
297
+ <!-- 200823 -->
298
+ ## Discord
299
+
300
+ For further support, and discussions on these models and AI in general, join us at:
301
+
302
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
303
+
304
+ ## Thanks, and how to contribute
305
+
306
+ Thanks to the [chirper.ai](https://chirper.ai) team!
307
+
308
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
309
+
310
+ 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.
311
+
312
+ 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.
313
+
314
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
315
+
316
+ * Patreon: https://patreon.com/TheBlokeAI
317
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
318
+
319
+ **Special thanks to**: Aemon Algiz.
320
+
321
+ **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
322
+
323
+
324
+ Thank you to all my generous patrons and donaters!
325
+
326
+ And thank you again to a16z for their generous grant.
327
+
328
+ <!-- footer end -->
329
+
330
+ # Original model card: c.gato's Thespis 13B v0.4
331
+
332
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64dd7cda3d6b954bf7cdd922/ZXmxNKGaHUrqjdS1I3GkL.png)
333
+
334
+ This model is a bit of a personal project. It uses a vanilla chat template and is focused on providing multiturn sfw and nsfw RP experience.
335
+
336
+ This model works best with internet style RP using standard markup with asterisks surrounding actions and no quotes around dialogue.
337
+
338
+ It uses the following data:
339
+
340
+ * 3000 samples from Claude Multiround Chat 30k dataset ( 45 token length or greater. Coding and math filtered out. )
341
+ * 3000 samples from Pippa Dataset ( 90 token length or greater. Filtered for responses which did not contain quotes and contained at least one asterisk. )
342
+ * 2200 samples from Puffin Dataset ( 90 token length or greater. Coding and math filtered out. )
343
+ * 700 samples from Airoboros 3.1 ( 1500 token length or greater. Writing samples only. )
344
+ * 4700 samples of hand curated RP conversation with various characters.
345
+
346
+
347
+ Works with standard chat format for Ooba or SillyTavern.
348
+
349
+ ## Prompt Format: Chat
350
+ ```
351
+ {System Prompt}
352
+
353
+ Username: {Input}
354
+ BotName: {Response}
355
+ Username: {Input}
356
+ BotName: {Response}
357
+
358
+ ```
359
+
360
+ ## Turn Template (for Ooba Instruct):
361
+ You can either bake usernames into the prompt directly for ease of use or programatically add them if running through the API to use as a chatbot.
362
+ ```
363
+ <|user|>{Username}: <|user-message|>\n<|bot|>{BotName}: <|bot-message|>\n
364
+ ```
365
+
366
+ ## Examples
367
+
368
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64dd7cda3d6b954bf7cdd922/Uhf5IRiudjEB8-z547BWi.png)
369
+
370
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64dd7cda3d6b954bf7cdd922/maO25mC1pfcYoJacpaM2t.png)
371
+
372
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64dd7cda3d6b954bf7cdd922/t7zJ4cCkSbtQv0ONVgOoS.png)
373
+