TheBloke commited on
Commit
99e6fd0
·
1 Parent(s): 94c38a8

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +325 -0
README.md ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/CalderaAI/13B-BlueMethod
3
+ inference: false
4
+ license: other
5
+ model_creator: Caldera AI
6
+ model_name: 13B BlueMethod
7
+ model_type: llama
8
+ prompt_template: 'Below is an instruction that describes a task. Write a response
9
+ that appropriately completes the request.
10
+
11
+
12
+ ### Instruction:
13
+
14
+ {prompt}
15
+
16
+
17
+ ### Response:
18
+
19
+ '
20
+ quantized_by: TheBloke
21
+ tags:
22
+ - llama
23
+ - alpaca
24
+ - cot
25
+ - vicuna
26
+ - uncensored
27
+ - merge
28
+ - mix
29
+ ---
30
+
31
+ <!-- header start -->
32
+ <!-- 200823 -->
33
+ <div style="width: auto; margin-left: auto; margin-right: auto">
34
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
35
+ </div>
36
+ <div style="display: flex; justify-content: space-between; width: 100%;">
37
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
38
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
39
+ </div>
40
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
41
+ <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>
42
+ </div>
43
+ </div>
44
+ <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>
45
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
46
+ <!-- header end -->
47
+
48
+ # 13B BlueMethod - AWQ
49
+ - Model creator: [Caldera AI](https://huggingface.co/CalderaAI)
50
+ - Original model: [13B BlueMethod](https://huggingface.co/CalderaAI/13B-BlueMethod)
51
+
52
+ <!-- description start -->
53
+ ## Description
54
+
55
+ This repo contains AWQ model files for [CalderaAI's 13B BlueMethod](https://huggingface.co/CalderaAI/13B-BlueMethod).
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.
61
+
62
+ 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.
63
+ <!-- description end -->
64
+ <!-- repositories-available start -->
65
+ ## Repositories available
66
+
67
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/13B-BlueMethod-AWQ)
68
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/13B-BlueMethod-GPTQ)
69
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/13B-BlueMethod-GGUF)
70
+ * [Caldera AI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/CalderaAI/13B-BlueMethod)
71
+ <!-- repositories-available end -->
72
+
73
+ <!-- prompt-template start -->
74
+ ## Prompt template: Alpaca
75
+
76
+ ```
77
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
78
+
79
+ ### Instruction:
80
+ {prompt}
81
+
82
+ ### Response:
83
+
84
+ ```
85
+
86
+ <!-- prompt-template end -->
87
+
88
+
89
+ <!-- README_AWQ.md-provided-files start -->
90
+ ## Provided files and AWQ parameters
91
+
92
+ 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.
93
+
94
+ Models are released as sharded safetensors files.
95
+
96
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
97
+ | ------ | ---- | -- | ----------- | ------- | ---- |
98
+ | [main](https://huggingface.co/TheBloke/13B-BlueMethod-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
99
+
100
+ <!-- README_AWQ.md-provided-files end -->
101
+
102
+ <!-- README_AWQ.md-use-from-vllm start -->
103
+ ## Serving this model from vLLM
104
+
105
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
106
+
107
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
108
+
109
+ ```shell
110
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/13B-BlueMethod-AWQ --quantization awq
111
+ ```
112
+
113
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
114
+
115
+ ```python
116
+ from vllm import LLM, SamplingParams
117
+
118
+ prompts = [
119
+ "Hello, my name is",
120
+ "The president of the United States is",
121
+ "The capital of France is",
122
+ "The future of AI is",
123
+ ]
124
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
125
+
126
+ llm = LLM(model="TheBloke/13B-BlueMethod-AWQ", quantization="awq")
127
+
128
+ outputs = llm.generate(prompts, sampling_params)
129
+
130
+ # Print the outputs.
131
+ for output in outputs:
132
+ prompt = output.prompt
133
+ generated_text = output.outputs[0].text
134
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
135
+ ```
136
+ <!-- README_AWQ.md-use-from-vllm start -->
137
+
138
+ <!-- README_AWQ.md-use-from-python start -->
139
+ ## How to use this AWQ model from Python code
140
+
141
+ ### Install the necessary packages
142
+
143
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
144
+
145
+ ```shell
146
+ pip3 install autoawq
147
+ ```
148
+
149
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
150
+
151
+ ```shell
152
+ pip3 uninstall -y autoawq
153
+ git clone https://github.com/casper-hansen/AutoAWQ
154
+ cd AutoAWQ
155
+ pip3 install .
156
+ ```
157
+
158
+ ### You can then try the following example code
159
+
160
+ ```python
161
+ from awq import AutoAWQForCausalLM
162
+ from transformers import AutoTokenizer
163
+
164
+ model_name_or_path = "TheBloke/13B-BlueMethod-AWQ"
165
+
166
+ # Load model
167
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
168
+ trust_remote_code=True, safetensors=True)
169
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
170
+
171
+ prompt = "Tell me about AI"
172
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
173
+
174
+ ### Instruction:
175
+ {prompt}
176
+
177
+ ### Response:
178
+
179
+ '''
180
+
181
+ print("\n\n*** Generate:")
182
+
183
+ tokens = tokenizer(
184
+ prompt_template,
185
+ return_tensors='pt'
186
+ ).input_ids.cuda()
187
+
188
+ # Generate output
189
+ generation_output = model.generate(
190
+ tokens,
191
+ do_sample=True,
192
+ temperature=0.7,
193
+ top_p=0.95,
194
+ top_k=40,
195
+ max_new_tokens=512
196
+ )
197
+
198
+ print("Output: ", tokenizer.decode(generation_output[0]))
199
+
200
+ # Inference can also be done using transformers' pipeline
201
+ from transformers import pipeline
202
+
203
+ print("*** Pipeline:")
204
+ pipe = pipeline(
205
+ "text-generation",
206
+ model=model,
207
+ tokenizer=tokenizer,
208
+ max_new_tokens=512,
209
+ do_sample=True,
210
+ temperature=0.7,
211
+ top_p=0.95,
212
+ top_k=40,
213
+ repetition_penalty=1.1
214
+ )
215
+
216
+ print(pipe(prompt_template)[0]['generated_text'])
217
+ ```
218
+ <!-- README_AWQ.md-use-from-python end -->
219
+
220
+ <!-- README_AWQ.md-compatibility start -->
221
+ ## Compatibility
222
+
223
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
224
+
225
+ [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).
226
+ <!-- README_AWQ.md-compatibility end -->
227
+
228
+ <!-- footer start -->
229
+ <!-- 200823 -->
230
+ ## Discord
231
+
232
+ For further support, and discussions on these models and AI in general, join us at:
233
+
234
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
235
+
236
+ ## Thanks, and how to contribute
237
+
238
+ Thanks to the [chirper.ai](https://chirper.ai) team!
239
+
240
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
241
+
242
+ 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.
243
+
244
+ 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.
245
+
246
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
247
+
248
+ * Patreon: https://patreon.com/TheBlokeAI
249
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
250
+
251
+ **Special thanks to**: Aemon Algiz.
252
+
253
+ **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
254
+
255
+
256
+ Thank you to all my generous patrons and donaters!
257
+
258
+ And thank you again to a16z for their generous grant.
259
+
260
+ <!-- footer end -->
261
+
262
+ # Original model card: CalderaAI's 13B BlueMethod
263
+
264
+
265
+ ## 13B-BlueMethod
266
+
267
+ ## Composition:
268
+ BlueMethod is a bit of a convoluted experiment in tiered merging.
269
+ Furthering the experimental nature of the merge, the models combined
270
+ were done so with a custom script that randomized the percent of each
271
+ layer merged from one model to the next. This is a warmup for a larger
272
+ project.
273
+ [Tier One and Two Merges not released; internal naming convention]
274
+
275
+ Tier One Merges:
276
+
277
+ 13B-Metharme+13B-Nous-Hermes=13B-Methermes
278
+
279
+ 13B-Vicuna-cocktail+13B-Manticore=13B-Vicortia
280
+
281
+ 13B-HyperMantis+13B-Alpacino=13B-PsychoMantis
282
+
283
+ Tier Two Merges:
284
+
285
+ 13B-Methermes+13B-Vicortia=13B-Methphistopheles
286
+
287
+ 13B-PsychoMantis+13B-BlueMoonRP=13B-BlueMantis
288
+
289
+ Tier Three Merge:
290
+
291
+ 13B-Methphistopheles+13B-BlueMantis=13B-BlueMethod
292
+
293
+ ## Use:
294
+ Multiple instruct models and model composites were combined to make the final resulting model;
295
+ This model is highly open to experimental prompting, both Alpaca and Vicuna instruct can be used.
296
+ It can have interesting results.
297
+
298
+ ## Language Models and LoRAs Used Credits:
299
+
300
+ 13B-Metharme by PygmalionAI
301
+
302
+ https://www.huggingface.co/PygmalionAI/metharme-13b
303
+
304
+ 13B-Nous-Hermes by NousResearch
305
+
306
+ https://www.huggingface.co/NousResearch/Nous-Hermes-13b
307
+
308
+ 13B-Vicuna-cocktail by reeducator
309
+
310
+ https://www.huggingface.co/reeducator/vicuna-13b-cocktail
311
+
312
+ 13B-Manticore by openaccess-ai-collective
313
+
314
+ https://www.huggingface.co/openaccess-ai-collective/manticore-13b
315
+
316
+ 13B-HyperMantis and 13B-Alpacino by Digitous
317
+
318
+ https://huggingface.co/digitous/13B-HyperMantis
319
+ https://huggingface.co/digitous/Alpacino13b
320
+
321
+ Also thanks to Meta for LLaMA.
322
+
323
+ Each model and LoRA was hand picked and considered for what it could contribute to this ensemble.
324
+ Thanks to each and every one of you for your incredible work developing some of the best things
325
+ to come out of this community.