TheBloke commited on
Commit
1f545f9
·
1 Parent(s): a3dbed1

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +349 -0
README.md ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/CalderaAI/13B-Ouroboros
3
+ datasets:
4
+ - Open-Orca/OpenOrca
5
+ - anon8231489123/ShareGPT_Vicuna_unfiltered
6
+ - jondurbin/airoboros-uncensored
7
+ inference: false
8
+ language:
9
+ - en
10
+ license: other
11
+ metrics:
12
+ - accuracy
13
+ model_creator: Caldera AI
14
+ model_name: 13B Ouroboros
15
+ model_type: llama
16
+ pipeline_tag: text-generation
17
+ prompt_template: 'Below is an instruction that describes a task. Write a response
18
+ that appropriately completes the request.
19
+
20
+
21
+ ### Instruction:
22
+
23
+ {prompt}
24
+
25
+
26
+ ### Response:
27
+
28
+ '
29
+ quantized_by: TheBloke
30
+ tags:
31
+ - llama
32
+ - alpaca
33
+ - vicuna
34
+ - uncensored
35
+ - merge
36
+ - mix
37
+ - airoboros
38
+ - openorca
39
+ - orcamini
40
+ - orca
41
+ - instruct
42
+ - mixtune
43
+ ---
44
+
45
+ <!-- header start -->
46
+ <!-- 200823 -->
47
+ <div style="width: auto; margin-left: auto; margin-right: auto">
48
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
49
+ </div>
50
+ <div style="display: flex; justify-content: space-between; width: 100%;">
51
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
52
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
53
+ </div>
54
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
55
+ <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>
56
+ </div>
57
+ </div>
58
+ <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>
59
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
60
+ <!-- header end -->
61
+
62
+ # 13B Ouroboros - AWQ
63
+ - Model creator: [Caldera AI](https://huggingface.co/CalderaAI)
64
+ - Original model: [13B Ouroboros](https://huggingface.co/CalderaAI/13B-Ouroboros)
65
+
66
+ <!-- description start -->
67
+ ## Description
68
+
69
+ This repo contains AWQ model files for [CalderaAI's 13B Ouroboros](https://huggingface.co/CalderaAI/13B-Ouroboros).
70
+
71
+
72
+ ### About AWQ
73
+
74
+ 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.
75
+
76
+ 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.
77
+ <!-- description end -->
78
+ <!-- repositories-available start -->
79
+ ## Repositories available
80
+
81
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/13B-Ouroboros-AWQ)
82
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/13B-Ouroboros-GPTQ)
83
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/13B-Ouroboros-GGUF)
84
+ * [Caldera AI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/CalderaAI/13B-Ouroboros)
85
+ <!-- repositories-available end -->
86
+
87
+ <!-- prompt-template start -->
88
+ ## Prompt template: Alpaca
89
+
90
+ ```
91
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
92
+
93
+ ### Instruction:
94
+ {prompt}
95
+
96
+ ### Response:
97
+
98
+ ```
99
+
100
+ <!-- prompt-template end -->
101
+
102
+
103
+ <!-- README_AWQ.md-provided-files start -->
104
+ ## Provided files and AWQ parameters
105
+
106
+ 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.
107
+
108
+ Models are released as sharded safetensors files.
109
+
110
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
111
+ | ------ | ---- | -- | ----------- | ------- | ---- |
112
+ | [main](https://huggingface.co/TheBloke/13B-Ouroboros-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
113
+
114
+ <!-- README_AWQ.md-provided-files end -->
115
+
116
+ <!-- README_AWQ.md-use-from-vllm start -->
117
+ ## Serving this model from vLLM
118
+
119
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
120
+
121
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
122
+
123
+ ```shell
124
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/13B-Ouroboros-AWQ --quantization awq
125
+ ```
126
+
127
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
128
+
129
+ ```python
130
+ from vllm import LLM, SamplingParams
131
+
132
+ prompts = [
133
+ "Hello, my name is",
134
+ "The president of the United States is",
135
+ "The capital of France is",
136
+ "The future of AI is",
137
+ ]
138
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
139
+
140
+ llm = LLM(model="TheBloke/13B-Ouroboros-AWQ", quantization="awq")
141
+
142
+ outputs = llm.generate(prompts, sampling_params)
143
+
144
+ # Print the outputs.
145
+ for output in outputs:
146
+ prompt = output.prompt
147
+ generated_text = output.outputs[0].text
148
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
149
+ ```
150
+ <!-- README_AWQ.md-use-from-vllm start -->
151
+
152
+ <!-- README_AWQ.md-use-from-python start -->
153
+ ## How to use this AWQ model from Python code
154
+
155
+ ### Install the necessary packages
156
+
157
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
158
+
159
+ ```shell
160
+ pip3 install autoawq
161
+ ```
162
+
163
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
164
+
165
+ ```shell
166
+ pip3 uninstall -y autoawq
167
+ git clone https://github.com/casper-hansen/AutoAWQ
168
+ cd AutoAWQ
169
+ pip3 install .
170
+ ```
171
+
172
+ ### You can then try the following example code
173
+
174
+ ```python
175
+ from awq import AutoAWQForCausalLM
176
+ from transformers import AutoTokenizer
177
+
178
+ model_name_or_path = "TheBloke/13B-Ouroboros-AWQ"
179
+
180
+ # Load model
181
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
182
+ trust_remote_code=True, safetensors=True)
183
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
184
+
185
+ prompt = "Tell me about AI"
186
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
187
+
188
+ ### Instruction:
189
+ {prompt}
190
+
191
+ ### Response:
192
+
193
+ '''
194
+
195
+ print("\n\n*** Generate:")
196
+
197
+ tokens = tokenizer(
198
+ prompt_template,
199
+ return_tensors='pt'
200
+ ).input_ids.cuda()
201
+
202
+ # Generate output
203
+ generation_output = model.generate(
204
+ tokens,
205
+ do_sample=True,
206
+ temperature=0.7,
207
+ top_p=0.95,
208
+ top_k=40,
209
+ max_new_tokens=512
210
+ )
211
+
212
+ print("Output: ", tokenizer.decode(generation_output[0]))
213
+
214
+ # Inference can also be done using transformers' pipeline
215
+ from transformers import pipeline
216
+
217
+ print("*** Pipeline:")
218
+ pipe = pipeline(
219
+ "text-generation",
220
+ model=model,
221
+ tokenizer=tokenizer,
222
+ max_new_tokens=512,
223
+ do_sample=True,
224
+ temperature=0.7,
225
+ top_p=0.95,
226
+ top_k=40,
227
+ repetition_penalty=1.1
228
+ )
229
+
230
+ print(pipe(prompt_template)[0]['generated_text'])
231
+ ```
232
+ <!-- README_AWQ.md-use-from-python end -->
233
+
234
+ <!-- README_AWQ.md-compatibility start -->
235
+ ## Compatibility
236
+
237
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
238
+
239
+ [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).
240
+ <!-- README_AWQ.md-compatibility end -->
241
+
242
+ <!-- footer start -->
243
+ <!-- 200823 -->
244
+ ## Discord
245
+
246
+ For further support, and discussions on these models and AI in general, join us at:
247
+
248
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
249
+
250
+ ## Thanks, and how to contribute
251
+
252
+ Thanks to the [chirper.ai](https://chirper.ai) team!
253
+
254
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
255
+
256
+ 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.
257
+
258
+ 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.
259
+
260
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
261
+
262
+ * Patreon: https://patreon.com/TheBlokeAI
263
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
264
+
265
+ **Special thanks to**: Aemon Algiz.
266
+
267
+ **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
268
+
269
+
270
+ Thank you to all my generous patrons and donaters!
271
+
272
+ And thank you again to a16z for their generous grant.
273
+
274
+ <!-- footer end -->
275
+
276
+ # Original model card: CalderaAI's 13B Ouroboros
277
+
278
+
279
+ ## 13B-Ouroboros
280
+ Ouroboros is an experimental model based on Meta's LLaMA [v1] 13B base model using a custom merging technique, tweaking
281
+ each layer's merge % based on internal tests against the PTB dataset, scoring ~26.31 according to internal evaluation
282
+ (6 samples, sequence length 1024; this testing is not empirical, it's a quick way to find near-optimum values). Testing,
283
+ evaluating, and remixing this model is absolutely permissible and even encouraged (within the bounds of Meta's LLaMAv1
284
+ license agreement); the more feedback the better we can tune our process! 😊
285
+
286
+ ## Composition:
287
+ Ouroboros is comprised of 40 layers [LLaMAv1 13B standard] mixed at optimized
288
+ ratios VS the PTB dataset for lowest perplexity score. Listed below are the
289
+ paired models and ratios merged per layer.
290
+
291
+ Tier One Merge:
292
+
293
+ 13B-airoboros-gpt4-1.4 > 13B-orca_mini_v2
294
+
295
+ [0.22, 0.85, 0.89, 0.98, 0.3, 0.41, 0.71, 0.83, 0.32, 0.1, 0.44, 0.6, 0.53, 0.15, 0.86, 0.79, 0.93, 0.02, 0.19, 0.82, 0.01, 0.52, 0.07, 0.27, 0.73, 0.86, 0.08, 0.67, 0.42, 0.28, 0.37, 0.08, 0.95, 0.68, 0.45, 0.08, 0.7, 0.93, 0.96, 0.43]
296
+
297
+ 13B-gpt4-x-alpaca > 13B-Vicuna-cocktail
298
+
299
+ [0.65, 0.94, 0.98, 0.87, 0.28, 0.64, 0.73, 0.7, 0.95, 0.89, 0.84, 0.9, 0.59, 0.92, 0.28, 0.61, 0.88, 0.73, 0.34, 0.85, 0.98, 0.05, 0.74, 0.92, 0.5, 0.78, 0.26, 0.4, 0.27, 0.65, 0.71, 0.7, 0.8, 0.93, 0.36, 0.03, 0.45, 0.39, 0.77, 0.06]
300
+
301
+ Tier Two Merge:
302
+
303
+ [13B-airoboros-gpt4-1.4 + 13B-orca_mini_v2] offspring > [13B-gpt4-x-alpaca + 13B-Vicuna-cocktail] offspring
304
+
305
+ [0.2, 0.83, 0.24, 0.03, 0.37, 0.62, 0.02, 0.82, 0.65, 0.63, 0.45, 0.65, 0.48, 0.45, 0.24, 0.76, 0.06, 0.31, 0.45, 0.86, 0.23, 0.99, 0.93, 0.84, 0.96, 0.53, 0.95, 0.32, 0.19, 0.06, 0.4, 0.08, 0.62, 0.4, 0.26, 0.12, 0.16, 0.91, 0.14, 0.0]
306
+
307
+ Result:
308
+
309
+ 13B-Ouroboros, a model that seems uncensored and highly competent. So far only Alpaca instruction prompting has been tested and seems to work solidly well.
310
+
311
+ ## Use:
312
+
313
+ Alpaca's instruct format can be used to do many things, including control of the terms of behavior
314
+ between a user and a response from an agent in chat. Below is an example of a command injected into
315
+ memory.
316
+
317
+ ```
318
+ ### Instruction:
319
+ Make Narrator function as a text based adventure game that responds with verbose, detailed, and creative descriptions of what happens next after Player's response.
320
+ Make Player function as the player input for Narrator's text based adventure game, controlling a character named (insert character name here, their short bio, and
321
+ whatever quest or other information to keep consistent in the interaction).
322
+
323
+ ### Response:
324
+ {an empty new line here}
325
+ ```
326
+
327
+ ## Language Models Used Credits:
328
+
329
+ 13B-airoboros-gpt4-1.4 by jondurbin
330
+
331
+ https://huggingface.co/jondurbin/airoboros-13b-gpt4-1.4
332
+
333
+ 13B-orca_mini_v2 by psmathur
334
+
335
+ https://huggingface.co/psmathur/orca_mini_v2_13b
336
+
337
+ 13B-gpt4-x-alpaca by chavinlo
338
+
339
+ https://huggingface.co/chavinlo/gpt4-x-alpaca
340
+
341
+ 13B-Vicuna-cocktail by reeducator
342
+
343
+ https://huggingface.co/reeducator/vicuna-13b-cocktail
344
+
345
+ Also thanks to Meta for LLaMA.
346
+
347
+ Each model was hand picked and considered for what it could contribute to this ensemble.
348
+ Thanks to each and every one of you for your incredible work developing some of the best things
349
+ to come out of this community.