TheBloke commited on
Commit
398771b
1 Parent(s): 3c53a57

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +311 -0
README.md ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/Sao10K/Stheno-Inverted-L2-13B
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: llama2
7
+ model_creator: Sao10K
8
+ model_name: Stheno Inverted L2 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
+ ---
24
+
25
+ <!-- header start -->
26
+ <!-- 200823 -->
27
+ <div style="width: auto; margin-left: auto; margin-right: auto">
28
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
29
+ </div>
30
+ <div style="display: flex; justify-content: space-between; width: 100%;">
31
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
32
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
33
+ </div>
34
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
35
+ <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>
36
+ </div>
37
+ </div>
38
+ <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>
39
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
40
+ <!-- header end -->
41
+
42
+ # Stheno Inverted L2 13B - AWQ
43
+ - Model creator: [Sao10K](https://huggingface.co/Sao10K)
44
+ - Original model: [Stheno Inverted L2 13B](https://huggingface.co/Sao10K/Stheno-Inverted-L2-13B)
45
+
46
+ <!-- description start -->
47
+ ## Description
48
+
49
+ This repo contains AWQ model files for [Sao10K's Stheno Inverted L2 13B](https://huggingface.co/Sao10K/Stheno-Inverted-L2-13B).
50
+
51
+
52
+ ### About AWQ
53
+
54
+ 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.
55
+
56
+ It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of AWQ models for high-throughput concurrent inference in multi-user server scenarios. Note that, at the time of writing, overall throughput is still lower than running vLLM with unquantised models, however using AWQ enables using much smaller GPUs which can lead to easier deployment and overall cost savings. For example, a 70B model can be run on 1 x 48GB GPU instead of 2 x 80GB.
57
+ <!-- description end -->
58
+ <!-- repositories-available start -->
59
+ ## Repositories available
60
+
61
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Stheno-Inverted-L2-13B-AWQ)
62
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Stheno-Inverted-L2-13B-GPTQ)
63
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Stheno-Inverted-L2-13B-GGUF)
64
+ * [Sao10K's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Sao10K/Stheno-Inverted-L2-13B)
65
+ <!-- repositories-available end -->
66
+
67
+ <!-- prompt-template start -->
68
+ ## Prompt template: Alpaca
69
+
70
+ ```
71
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
72
+
73
+ ### Instruction:
74
+ {prompt}
75
+
76
+ ### Response:
77
+
78
+ ```
79
+
80
+ <!-- prompt-template end -->
81
+
82
+
83
+ <!-- README_AWQ.md-provided-files start -->
84
+ ## Provided files and AWQ parameters
85
+
86
+ 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.
87
+
88
+ Models are released as sharded safetensors files.
89
+
90
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
91
+ | ------ | ---- | -- | ----------- | ------- | ---- |
92
+ | [main](https://huggingface.co/TheBloke/Stheno-Inverted-L2-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
93
+
94
+ <!-- README_AWQ.md-provided-files end -->
95
+
96
+ <!-- README_AWQ.md-use-from-vllm start -->
97
+ ## Serving this model from vLLM
98
+
99
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
100
+
101
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
102
+
103
+ ```shell
104
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Stheno-Inverted-L2-13B-AWQ --quantization awq
105
+ ```
106
+
107
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
108
+
109
+ ```python
110
+ from vllm import LLM, SamplingParams
111
+
112
+ prompts = [
113
+ "Hello, my name is",
114
+ "The president of the United States is",
115
+ "The capital of France is",
116
+ "The future of AI is",
117
+ ]
118
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
119
+
120
+ llm = LLM(model="TheBloke/Stheno-Inverted-L2-13B-AWQ", quantization="awq")
121
+
122
+ outputs = llm.generate(prompts, sampling_params)
123
+
124
+ # Print the outputs.
125
+ for output in outputs:
126
+ prompt = output.prompt
127
+ generated_text = output.outputs[0].text
128
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
129
+ ```
130
+ <!-- README_AWQ.md-use-from-vllm start -->
131
+
132
+ <!-- README_AWQ.md-use-from-python start -->
133
+ ## How to use this AWQ model from Python code
134
+
135
+ ### Install the necessary packages
136
+
137
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
138
+
139
+ ```shell
140
+ pip3 install autoawq
141
+ ```
142
+
143
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
144
+
145
+ ```shell
146
+ pip3 uninstall -y autoawq
147
+ git clone https://github.com/casper-hansen/AutoAWQ
148
+ cd AutoAWQ
149
+ pip3 install .
150
+ ```
151
+
152
+ ### You can then try the following example code
153
+
154
+ ```python
155
+ from awq import AutoAWQForCausalLM
156
+ from transformers import AutoTokenizer
157
+
158
+ model_name_or_path = "TheBloke/Stheno-Inverted-L2-13B-AWQ"
159
+
160
+ # Load model
161
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
162
+ trust_remote_code=False, safetensors=True)
163
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
164
+
165
+ prompt = "Tell me about AI"
166
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
167
+
168
+ ### Instruction:
169
+ {prompt}
170
+
171
+ ### Response:
172
+
173
+ '''
174
+
175
+ print("\n\n*** Generate:")
176
+
177
+ tokens = tokenizer(
178
+ prompt_template,
179
+ return_tensors='pt'
180
+ ).input_ids.cuda()
181
+
182
+ # Generate output
183
+ generation_output = model.generate(
184
+ tokens,
185
+ do_sample=True,
186
+ temperature=0.7,
187
+ top_p=0.95,
188
+ top_k=40,
189
+ max_new_tokens=512
190
+ )
191
+
192
+ print("Output: ", tokenizer.decode(generation_output[0]))
193
+
194
+ # Inference can also be done using transformers' pipeline
195
+ from transformers import pipeline
196
+
197
+ print("*** Pipeline:")
198
+ pipe = pipeline(
199
+ "text-generation",
200
+ model=model,
201
+ tokenizer=tokenizer,
202
+ max_new_tokens=512,
203
+ do_sample=True,
204
+ temperature=0.7,
205
+ top_p=0.95,
206
+ top_k=40,
207
+ repetition_penalty=1.1
208
+ )
209
+
210
+ print(pipe(prompt_template)[0]['generated_text'])
211
+ ```
212
+ <!-- README_AWQ.md-use-from-python end -->
213
+
214
+ <!-- README_AWQ.md-compatibility start -->
215
+ ## Compatibility
216
+
217
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
218
+
219
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is not yet compatible with AWQ, but a PR is open which should bring support soon: [TGI PR #781](https://github.com/huggingface/text-generation-inference/issues/781).
220
+ <!-- README_AWQ.md-compatibility end -->
221
+
222
+ <!-- footer start -->
223
+ <!-- 200823 -->
224
+ ## Discord
225
+
226
+ For further support, and discussions on these models and AI in general, join us at:
227
+
228
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
229
+
230
+ ## Thanks, and how to contribute
231
+
232
+ Thanks to the [chirper.ai](https://chirper.ai) team!
233
+
234
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
235
+
236
+ 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.
237
+
238
+ 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.
239
+
240
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
241
+
242
+ * Patreon: https://patreon.com/TheBlokeAI
243
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
244
+
245
+ **Special thanks to**: Aemon Algiz.
246
+
247
+ **Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
248
+
249
+
250
+ Thank you to all my generous patrons and donaters!
251
+
252
+ And thank you again to a16z for their generous grant.
253
+
254
+ <!-- footer end -->
255
+
256
+ # Original model card: Sao10K's Stheno Inverted L2 13B
257
+
258
+
259
+ <img src="https://w.forfun.com/fetch/cb/cba2205390e517bea1ea60ca0b491af4.jpeg" style="width: 70%; min-width: 300px; display: block; margin: auto;">
260
+
261
+ The sister Model of [Stheno-L2-13B](https://huggingface.co/Sao10K/Stheno-L2-13B)
262
+
263
+ Stheno Inverted:
264
+ <br>Gradient Merge of Stheno-P2 & Stheno-P1, Models are in Inverted Positions
265
+
266
+ Quants courtesy of TheBloke!
267
+ <br>[GPTQ](https://huggingface.co/TheBloke/Stheno-Inverted-L2-13B-GPTQ)
268
+ <br>[GGUF](https://huggingface.co/TheBloke/Stheno-Inverted-L2-13B-GGUF)
269
+ <br>[GGML](https://huggingface.co/TheBloke/Stheno-Inverted-L2-13B-GGML)
270
+
271
+ Test Checklist:
272
+ <br>Censorship - Fairly Uncensored
273
+ <br>Writing - Good Prose, Fairly Descriptive
274
+ <br>NSFW - Yes
275
+ <br>IQ Level - Pretty Smart
276
+ <br>Formatting - Proper Formatting with Examples
277
+
278
+ *Noticeable difference with Stheno-L2. From personal tests: A bit more verbose, a little less smart, and a little more forward with NSFW compared to regular Stheno.*
279
+
280
+ Stheno-P1 [Ties-Merge]
281
+ <br>-----[elinas/chronos-13b-v2](https://huggingface.co/elinas/chronos-13b-v2)
282
+ <br>-----[jondurbin/airoboros-l2-13b-2.1](https://huggingface.co/jondurbin/airoboros-l2-13b-2.1)
283
+ <br>-----[NousResearch/Nous-Hermes-Llama2-13b](https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b)+[nRuaif/Kimiko-v2 **LORA**](https://huggingface.co/nRuaif/Kimiko-v2-13B)
284
+
285
+
286
+ Stheno-P2 [Ties-Merge]
287
+ <br>-----[CalderaAI/13B-Legerdemain-L2](https://huggingface.co/CalderaAI/13B-Legerdemain-L2)+[lemonilia/limarp-llama2-v2 **LORA**](https://huggingface.co/lemonilia/limarp-llama2-v2)
288
+ <br>-----[ehartford/WizardLM-1.0-Uncensored-Llama2-13b](https://huggingface.co/ehartford/WizardLM-1.0-Uncensored-Llama2-13b)
289
+ <br>-----[Henk717/spring-dragon](https://huggingface.co/Henk717/spring-dragon)
290
+
291
+
292
+ Most formats could work, but my tests have all been done in Alpaca format and it works well.
293
+ ```
294
+ ### Instruction:
295
+ Your instruction or question here.
296
+ For roleplay purposes, I suggest the following - Write <CHAR NAME>'s next reply in a chat between <YOUR NAME> and <CHAR NAME>. Write a single reply only.
297
+
298
+ ### Response:
299
+ ```
300
+
301
+ Below is the Illustration for the Final Merge:
302
+
303
+ ![ILLUSTRATION](https://cdn-uploads.huggingface.co/production/uploads/64be6a5376a6e2efccc638c1/4JaMhVMiLCFkeeYDPtU1D.png)
304
+
305
+
306
+ Once Again, thanks to [Chargoddard](https://huggingface.co/chargoddard) for his amazing and simple [ties-merge](https://github.com/cg123/ties-merge) script, and [Gryphe](https://huggingface.co/Gryphe) for their great [BlockMerge_Gradient](https://github.com/Gryphe/BlockMerge_Gradient) script.
307
+ Thank you to the original model creators too!
308
+
309
+ ```
310
+ Art by wada_kazu / わだかず (pixiv page private?)
311
+ ```