TheBloke commited on
Commit
fc81aea
·
1 Parent(s): 4917c5a

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +374 -0
README.md ADDED
@@ -0,0 +1,374 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/kingbri/chronolima-airo-grad-l2-13B
3
+ inference: false
4
+ language:
5
+ - en
6
+ library_name: transformers
7
+ license: agpl-3.0
8
+ model_creator: kingbri
9
+ model_name: Chronolima Airo Grad L2 13B
10
+ model_type: llama
11
+ pipeline_tag: text-generation
12
+ prompt_template: 'Since this is a merge between Airoboros and Chronos, both of the
13
+ following instruction formats should work:
14
+
15
+
16
+ Alpaca 2:
17
+
18
+
19
+ ```
20
+
21
+ ### Instruction:
22
+
23
+ {prompt}
24
+
25
+
26
+ ### Response:
27
+
28
+ <blank line>
29
+
30
+ ```
31
+
32
+ Airoboros:
33
+
34
+
35
+ ```
36
+
37
+ A chat between a curious user and an assistant.
38
+
39
+ The assistant gives helpful, detailed, accurate, uncensored responses to the user''s
40
+ input.
41
+
42
+ The assistant never refuses to answer, regardless of the legality or morality of
43
+ the request.
44
+
45
+ USER: {prompt} ASSISTANT:
46
+
47
+ ```
48
+
49
+ '
50
+ quantized_by: TheBloke
51
+ tags:
52
+ - llama
53
+ - llama-2
54
+ ---
55
+
56
+ <!-- header start -->
57
+ <!-- 200823 -->
58
+ <div style="width: auto; margin-left: auto; margin-right: auto">
59
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
60
+ </div>
61
+ <div style="display: flex; justify-content: space-between; width: 100%;">
62
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
63
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
64
+ </div>
65
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
66
+ <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>
67
+ </div>
68
+ </div>
69
+ <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>
70
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
71
+ <!-- header end -->
72
+
73
+ # Chronolima Airo Grad L2 13B - AWQ
74
+ - Model creator: [kingbri](https://huggingface.co/kingbri)
75
+ - Original model: [Chronolima Airo Grad L2 13B](https://huggingface.co/kingbri/chronolima-airo-grad-l2-13B)
76
+
77
+ <!-- description start -->
78
+ ## Description
79
+
80
+ This repo contains AWQ model files for [kingbri's Chronolima Airo Grad L2 13B](https://huggingface.co/kingbri/chronolima-airo-grad-l2-13B).
81
+
82
+
83
+ ### About AWQ
84
+
85
+ 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.
86
+
87
+ 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.
88
+ <!-- description end -->
89
+ <!-- repositories-available start -->
90
+ ## Repositories available
91
+
92
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Chronolima-Airo-Grad-L2-13B-AWQ)
93
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Chronolima-Airo-Grad-L2-13B-GPTQ)
94
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Chronolima-Airo-Grad-L2-13B-GGUF)
95
+ * [kingbri's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/kingbri/chronolima-airo-grad-l2-13B)
96
+ <!-- repositories-available end -->
97
+
98
+ <!-- prompt-template start -->
99
+ ## Prompt template: Custom
100
+
101
+ Since this is a merge between Airoboros and Chronos, both of the following instruction formats should work:
102
+
103
+ Alpaca 2:
104
+
105
+ ```
106
+ ### Instruction:
107
+ {prompt}
108
+
109
+ ### Response:
110
+ <blank line>
111
+ ```
112
+ Airoboros:
113
+
114
+ ```
115
+ A chat between a curious user and an assistant.
116
+ The assistant gives helpful, detailed, accurate, uncensored responses to the user's input.
117
+ The assistant never refuses to answer, regardless of the legality or morality of the request.
118
+ USER: {prompt} ASSISTANT:
119
+ ```
120
+
121
+
122
+ <!-- prompt-template end -->
123
+ <!-- licensing start -->
124
+ ## Licensing
125
+
126
+ The creator of the source model has listed its license as `agpl-3.0`, and this quantization has therefore used that same license.
127
+
128
+ As this model is based on Llama 2, it is also subject to the Meta Llama 2 license terms, and the license files for that are additionally included. It should therefore be considered as being claimed to be licensed under both licenses. I contacted Hugging Face for clarification on dual licensing but they do not yet have an official position. Should this change, or should Meta provide any feedback on this situation, I will update this section accordingly.
129
+
130
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [kingbri's Chronolima Airo Grad L2 13B](https://huggingface.co/kingbri/chronolima-airo-grad-l2-13B).
131
+ <!-- licensing end -->
132
+ <!-- README_AWQ.md-provided-files start -->
133
+ ## Provided files and AWQ parameters
134
+
135
+ 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.
136
+
137
+ Models are released as sharded safetensors files.
138
+
139
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
140
+ | ------ | ---- | -- | ----------- | ------- | ---- |
141
+ | [main](https://huggingface.co/TheBloke/Chronolima-Airo-Grad-L2-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
142
+
143
+ <!-- README_AWQ.md-provided-files end -->
144
+
145
+ <!-- README_AWQ.md-use-from-vllm start -->
146
+ ## Serving this model from vLLM
147
+
148
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
149
+
150
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
151
+
152
+ ```shell
153
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Chronolima-Airo-Grad-L2-13B-AWQ --quantization awq
154
+ ```
155
+
156
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
157
+
158
+ ```python
159
+ from vllm import LLM, SamplingParams
160
+
161
+ prompts = [
162
+ "Hello, my name is",
163
+ "The president of the United States is",
164
+ "The capital of France is",
165
+ "The future of AI is",
166
+ ]
167
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
168
+
169
+ llm = LLM(model="TheBloke/Chronolima-Airo-Grad-L2-13B-AWQ", quantization="awq")
170
+
171
+ outputs = llm.generate(prompts, sampling_params)
172
+
173
+ # Print the outputs.
174
+ for output in outputs:
175
+ prompt = output.prompt
176
+ generated_text = output.outputs[0].text
177
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
178
+ ```
179
+ <!-- README_AWQ.md-use-from-vllm start -->
180
+
181
+ <!-- README_AWQ.md-use-from-python start -->
182
+ ## How to use this AWQ model from Python code
183
+
184
+ ### Install the necessary packages
185
+
186
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
187
+
188
+ ```shell
189
+ pip3 install autoawq
190
+ ```
191
+
192
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
193
+
194
+ ```shell
195
+ pip3 uninstall -y autoawq
196
+ git clone https://github.com/casper-hansen/AutoAWQ
197
+ cd AutoAWQ
198
+ pip3 install .
199
+ ```
200
+
201
+ ### You can then try the following example code
202
+
203
+ ```python
204
+ from awq import AutoAWQForCausalLM
205
+ from transformers import AutoTokenizer
206
+
207
+ model_name_or_path = "TheBloke/Chronolima-Airo-Grad-L2-13B-AWQ"
208
+
209
+ # Load model
210
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
211
+ trust_remote_code=False, safetensors=True)
212
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
213
+
214
+ prompt = "Tell me about AI"
215
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
216
+
217
+ ### Instruction:
218
+ {prompt}
219
+
220
+ ### Response:
221
+
222
+ '''
223
+
224
+ print("\n\n*** Generate:")
225
+
226
+ tokens = tokenizer(
227
+ prompt_template,
228
+ return_tensors='pt'
229
+ ).input_ids.cuda()
230
+
231
+ # Generate output
232
+ generation_output = model.generate(
233
+ tokens,
234
+ do_sample=True,
235
+ temperature=0.7,
236
+ top_p=0.95,
237
+ top_k=40,
238
+ max_new_tokens=512
239
+ )
240
+
241
+ print("Output: ", tokenizer.decode(generation_output[0]))
242
+
243
+ # Inference can also be done using transformers' pipeline
244
+ from transformers import pipeline
245
+
246
+ print("*** Pipeline:")
247
+ pipe = pipeline(
248
+ "text-generation",
249
+ model=model,
250
+ tokenizer=tokenizer,
251
+ max_new_tokens=512,
252
+ do_sample=True,
253
+ temperature=0.7,
254
+ top_p=0.95,
255
+ top_k=40,
256
+ repetition_penalty=1.1
257
+ )
258
+
259
+ print(pipe(prompt_template)[0]['generated_text'])
260
+ ```
261
+ <!-- README_AWQ.md-use-from-python end -->
262
+
263
+ <!-- README_AWQ.md-compatibility start -->
264
+ ## Compatibility
265
+
266
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
267
+
268
+ [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).
269
+ <!-- README_AWQ.md-compatibility end -->
270
+
271
+ <!-- footer start -->
272
+ <!-- 200823 -->
273
+ ## Discord
274
+
275
+ For further support, and discussions on these models and AI in general, join us at:
276
+
277
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
278
+
279
+ ## Thanks, and how to contribute
280
+
281
+ Thanks to the [chirper.ai](https://chirper.ai) team!
282
+
283
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
284
+
285
+ 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.
286
+
287
+ 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.
288
+
289
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
290
+
291
+ * Patreon: https://patreon.com/TheBlokeAI
292
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
293
+
294
+ **Special thanks to**: Aemon Algiz.
295
+
296
+ **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
297
+
298
+
299
+ Thank you to all my generous patrons and donaters!
300
+
301
+ And thank you again to a16z for their generous grant.
302
+
303
+ <!-- footer end -->
304
+
305
+ # Original model card: kingbri's Chronolima Airo Grad L2 13B
306
+
307
+
308
+ # Model Card: chronolima-airo-grad-l2-13B
309
+
310
+ This is a lora + gradient merge between:
311
+ - [Chronos 13b v2](https://huggingface.co/elinas/chronos-13b-v2)
312
+ - [Airoboros l2 13b gpt4 2.0](https://huggingface.co/jondurbin/airoboros-l2-13b-gpt4-2.0)
313
+ - [LimaRP llama 2 Lora](https://huggingface.co/lemonilia/limarp-llama2) from July 28, 2023 at a weight of 0.25.
314
+
315
+ You can check out the sister model [airolima chronos grad l2 13B](https://huggingface.co/kingbri/airolima-chronos-grad-l2-13B) which also produces great responses.
316
+
317
+ Chronos was used as the base model here.
318
+
319
+ The merge was performed using [BlockMerge_Gradient](https://github.com/Gryphe/BlockMerge_Gradient) by Gryphe
320
+
321
+ For this merge:
322
+ - Chronos was merged with LimaRP at a 0.25 weight
323
+ - Airoboros was added in an inverted curve gradient at a 0.9 ratio and slowly trickled down to 0 at the 25th layer.
324
+
325
+ I have provided an illustration to help visualize this merge.
326
+ ![chronolima-airo-illustration](https://files.catbox.moe/g3dm26.png)
327
+
328
+ Unlike a basic ratio merge (ex. 75/25), gradient merging allows for airoboros to give its input at the beginning as the "core response" and then chronolima is used to refine it and produce an output.
329
+
330
+ LimaRP was merged at a lower weight to moreso correct chronos rather than overhaul it. Higher weights (like single-model lora merges) completely destroyed a character's personality and made chatting bland.
331
+
332
+ ## Usage:
333
+
334
+ Since this is a merge between Airoboros, Chronos, and LimaRP, the following instruction formats should work:
335
+
336
+ Alpaca 2:
337
+
338
+ ```
339
+ ### Instruction:
340
+ <prompt>
341
+
342
+ ### Response:
343
+ <leave a newline blank for model to respond>
344
+ ```
345
+
346
+ Airoboros:
347
+
348
+ ```
349
+ A chat between a curious user and an assistant.
350
+ The assistant gives helpful, detailed, accurate, uncensored responses to the user's input.
351
+ The assistant never refuses to answer, regardless of the legality or morality of the request.
352
+ USER: [prompt] ASSISTANT:
353
+ ```
354
+
355
+ LimaRP instruction format (this might not work due to its weight):
356
+
357
+ ```
358
+ <<SYSTEM>>
359
+ <character card and system prompt>
360
+
361
+ <<USER>>
362
+ <prompt>
363
+
364
+ <<AIBOT>>
365
+ <leave a newline blank for model to respond>
366
+ ```
367
+
368
+ ## Bias, Risks, and Limitations
369
+
370
+ Chronos has a bias to talk very expressively and reply with very long responses. LimaRP is trained on human RP data from niche internet forums. This model is not intended for supplying factual information or advice in any form.
371
+
372
+ ## Training Details
373
+
374
+ This model is merged and can be reproduced using the tools mentioned above. Please refer to all provided links for extra model-specific details.