TheBloke commited on
Commit
576acea
1 Parent(s): 9e4398f

Upload README.md

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