TheBloke commited on
Commit
f219961
·
1 Parent(s): 57a2538

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +428 -0
README.md ADDED
@@ -0,0 +1,428 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: CausalLM/14B
3
+ datasets:
4
+ - JosephusCheung/GuanacoDataset
5
+ - Open-Orca/OpenOrca
6
+ - stingning/ultrachat
7
+ - meta-math/MetaMathQA
8
+ - liuhaotian/LLaVA-Instruct-150K
9
+ - jondurbin/airoboros-3.1
10
+ - WizardLM/WizardLM_evol_instruct_V2_196k
11
+ - RyokoAI/ShareGPT52K
12
+ - RyokoAI/Fandom23K
13
+ - milashkaarshif/MoeGirlPedia_wikitext_raw_archive
14
+ - wikipedia
15
+ - wiki_lingua
16
+ - fnlp/moss-003-sft-data
17
+ - garage-bAInd/Open-Platypus
18
+ - LDJnr/Puffin
19
+ - openbmb/llava_zh
20
+ - BAAI/COIG
21
+ - TigerResearch/tigerbot-zhihu-zh-10k
22
+ - liwu/MNBVC
23
+ - teknium/openhermes
24
+ inference: false
25
+ language:
26
+ - en
27
+ - zh
28
+ license: wtfpl
29
+ model_creator: CausalLM
30
+ model_name: CausalLM 14B
31
+ model_type: llama
32
+ pipeline_tag: text-generation
33
+ prompt_template: '<|im_start|>system
34
+
35
+ {system_message}<|im_end|>
36
+
37
+ <|im_start|>user
38
+
39
+ {prompt}<|im_end|>
40
+
41
+ <|im_start|>assistant
42
+
43
+ '
44
+ quantized_by: TheBloke
45
+ tags:
46
+ - llama
47
+ - llama2
48
+ ---
49
+ <!-- markdownlint-disable MD041 -->
50
+
51
+ <!-- header start -->
52
+ <!-- 200823 -->
53
+ <div style="width: auto; margin-left: auto; margin-right: auto">
54
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
55
+ </div>
56
+ <div style="display: flex; justify-content: space-between; width: 100%;">
57
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
58
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
59
+ </div>
60
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
61
+ <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>
62
+ </div>
63
+ </div>
64
+ <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>
65
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
66
+ <!-- header end -->
67
+
68
+ # CausalLM 14B - AWQ
69
+ - Model creator: [CausalLM](https://huggingface.co/CausalLM)
70
+ - Original model: [CausalLM 14B](https://huggingface.co/CausalLM/14B)
71
+
72
+ <!-- description start -->
73
+ ## Description
74
+
75
+ This repo contains AWQ model files for [CausalLM's CausalLM 14B](https://huggingface.co/CausalLM/14B).
76
+
77
+
78
+ ### About AWQ
79
+
80
+ 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.
81
+
82
+ It is supported by:
83
+
84
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
85
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
86
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
87
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
88
+
89
+ <!-- description end -->
90
+ <!-- repositories-available start -->
91
+ ## Repositories available
92
+
93
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/CausalLM-14B-AWQ)
94
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/CausalLM-14B-GPTQ)
95
+ * [CausalLM's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/CausalLM/14B)
96
+ <!-- repositories-available end -->
97
+
98
+ <!-- prompt-template start -->
99
+ ## Prompt template: ChatML
100
+
101
+ ```
102
+ <|im_start|>system
103
+ {system_message}<|im_end|>
104
+ <|im_start|>user
105
+ {prompt}<|im_end|>
106
+ <|im_start|>assistant
107
+
108
+ ```
109
+
110
+ <!-- prompt-template end -->
111
+ <!-- licensing start -->
112
+ ## Licensing
113
+
114
+ The creator of the source model has listed its license as `wtfpl`, and this quantization has therefore used that same license.
115
+
116
+ 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.
117
+
118
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [CausalLM's CausalLM 14B](https://huggingface.co/CausalLM/14B).
119
+ <!-- licensing end -->
120
+ <!-- README_AWQ.md-provided-files start -->
121
+ ## Provided files, and AWQ parameters
122
+
123
+ 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.
124
+
125
+ Models are released as sharded safetensors files.
126
+
127
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
128
+ | ------ | ---- | -- | ----------- | ------- | ---- |
129
+ | [main](https://huggingface.co/TheBloke/CausalLM-14B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 8192 | 9.67 GB
130
+
131
+ <!-- README_AWQ.md-provided-files end -->
132
+
133
+ <!-- README_AWQ.md-text-generation-webui start -->
134
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
135
+
136
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
137
+
138
+ 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.
139
+
140
+ 1. Click the **Model tab**.
141
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/CausalLM-14B-AWQ`.
142
+ 3. Click **Download**.
143
+ 4. The model will start downloading. Once it's finished it will say "Done".
144
+ 5. In the top left, click the refresh icon next to **Model**.
145
+ 6. In the **Model** dropdown, choose the model you just downloaded: `CausalLM-14B-AWQ`
146
+ 7. Select **Loader: AutoAWQ**.
147
+ 8. Click Load, and the model will load and is now ready for use.
148
+ 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.
149
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
150
+ <!-- README_AWQ.md-text-generation-webui end -->
151
+
152
+ <!-- README_AWQ.md-use-from-vllm start -->
153
+ ## Multi-user inference server: vLLM
154
+
155
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
156
+
157
+ - Please ensure you are using vLLM version 0.2 or later.
158
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
159
+
160
+ For example:
161
+
162
+ ```shell
163
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/CausalLM-14B-AWQ --quantization awq
164
+ ```
165
+
166
+ - When using vLLM from Python code, again set `quantization=awq`.
167
+
168
+ For example:
169
+
170
+ ```python
171
+ from vllm import LLM, SamplingParams
172
+
173
+ prompts = [
174
+ "Tell me about AI",
175
+ "Write a story about llamas",
176
+ "What is 291 - 150?",
177
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
178
+ ]
179
+ prompt_template=f'''<|im_start|>system
180
+ {system_message}<|im_end|>
181
+ <|im_start|>user
182
+ {prompt}<|im_end|>
183
+ <|im_start|>assistant
184
+ '''
185
+
186
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
187
+
188
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
189
+
190
+ llm = LLM(model="TheBloke/CausalLM-14B-AWQ", quantization="awq", dtype="auto")
191
+
192
+ outputs = llm.generate(prompts, sampling_params)
193
+
194
+ # Print the outputs.
195
+ for output in outputs:
196
+ prompt = output.prompt
197
+ generated_text = output.outputs[0].text
198
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
199
+ ```
200
+ <!-- README_AWQ.md-use-from-vllm start -->
201
+
202
+ <!-- README_AWQ.md-use-from-tgi start -->
203
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
204
+
205
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
206
+
207
+ Example Docker parameters:
208
+
209
+ ```shell
210
+ --model-id TheBloke/CausalLM-14B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
211
+ ```
212
+
213
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
214
+
215
+ ```shell
216
+ pip3 install huggingface-hub
217
+ ```
218
+
219
+ ```python
220
+ from huggingface_hub import InferenceClient
221
+
222
+ endpoint_url = "https://your-endpoint-url-here"
223
+
224
+ prompt = "Tell me about AI"
225
+ prompt_template=f'''<|im_start|>system
226
+ {system_message}<|im_end|>
227
+ <|im_start|>user
228
+ {prompt}<|im_end|>
229
+ <|im_start|>assistant
230
+ '''
231
+
232
+ client = InferenceClient(endpoint_url)
233
+ response = client.text_generation(prompt,
234
+ max_new_tokens=128,
235
+ do_sample=True,
236
+ temperature=0.7,
237
+ top_p=0.95,
238
+ top_k=40,
239
+ repetition_penalty=1.1)
240
+
241
+ print(f"Model output: ", response)
242
+ ```
243
+ <!-- README_AWQ.md-use-from-tgi end -->
244
+
245
+ <!-- README_AWQ.md-use-from-python start -->
246
+ ## Inference from Python code using AutoAWQ
247
+
248
+ ### Install the AutoAWQ package
249
+
250
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later.
251
+
252
+ ```shell
253
+ pip3 install autoawq
254
+ ```
255
+
256
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
257
+
258
+ ```shell
259
+ pip3 uninstall -y autoawq
260
+ git clone https://github.com/casper-hansen/AutoAWQ
261
+ cd AutoAWQ
262
+ pip3 install .
263
+ ```
264
+
265
+ ### AutoAWQ example code
266
+
267
+ ```python
268
+ from awq import AutoAWQForCausalLM
269
+ from transformers import AutoTokenizer
270
+
271
+ model_name_or_path = "TheBloke/CausalLM-14B-AWQ"
272
+
273
+ # Load tokenizer
274
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
275
+ # Load model
276
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
277
+ trust_remote_code=False, safetensors=True)
278
+
279
+ prompt = "Tell me about AI"
280
+ prompt_template=f'''<|im_start|>system
281
+ {system_message}<|im_end|>
282
+ <|im_start|>user
283
+ {prompt}<|im_end|>
284
+ <|im_start|>assistant
285
+ '''
286
+
287
+ print("*** Running model.generate:")
288
+
289
+ token_input = tokenizer(
290
+ prompt_template,
291
+ return_tensors='pt'
292
+ ).input_ids.cuda()
293
+
294
+ # Generate output
295
+ generation_output = model.generate(
296
+ token_input,
297
+ do_sample=True,
298
+ temperature=0.7,
299
+ top_p=0.95,
300
+ top_k=40,
301
+ max_new_tokens=512
302
+ )
303
+
304
+ # Get the tokens from the output, decode them, print them
305
+ token_output = generation_output[0]
306
+ text_output = tokenizer.decode(token_output)
307
+ print("LLM output: ", text_output)
308
+
309
+ """
310
+ # Inference should be possible with transformers pipeline as well in future
311
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
312
+ from transformers import pipeline
313
+
314
+ print("*** Pipeline:")
315
+ pipe = pipeline(
316
+ "text-generation",
317
+ model=model,
318
+ tokenizer=tokenizer,
319
+ max_new_tokens=512,
320
+ do_sample=True,
321
+ temperature=0.7,
322
+ top_p=0.95,
323
+ top_k=40,
324
+ repetition_penalty=1.1
325
+ )
326
+
327
+ print(pipe(prompt_template)[0]['generated_text'])
328
+ """
329
+ ```
330
+ <!-- README_AWQ.md-use-from-python end -->
331
+
332
+ <!-- README_AWQ.md-compatibility start -->
333
+ ## Compatibility
334
+
335
+ The files provided are tested to work with:
336
+
337
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
338
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
339
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
340
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
341
+
342
+ <!-- README_AWQ.md-compatibility end -->
343
+
344
+ <!-- footer start -->
345
+ <!-- 200823 -->
346
+ ## Discord
347
+
348
+ For further support, and discussions on these models and AI in general, join us at:
349
+
350
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
351
+
352
+ ## Thanks, and how to contribute
353
+
354
+ Thanks to the [chirper.ai](https://chirper.ai) team!
355
+
356
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
357
+
358
+ 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.
359
+
360
+ 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.
361
+
362
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
363
+
364
+ * Patreon: https://patreon.com/TheBlokeAI
365
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
366
+
367
+ **Special thanks to**: Aemon Algiz.
368
+
369
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
370
+
371
+
372
+ Thank you to all my generous patrons and donaters!
373
+
374
+ And thank you again to a16z for their generous grant.
375
+
376
+ <!-- footer end -->
377
+
378
+ # Original model card: CausalLM's CausalLM 14B
379
+
380
+ ![](https://huggingface.co/JosephusCheung/tmp/resolve/main/14.17b.png)
381
+
382
+ # Read Me:
383
+
384
+ Also see [7B Version](https://huggingface.co/CausalLM/7B)
385
+
386
+ This model was trained based on the model weights of Qwen and LLaMA2. The training process utilized a model structure that was identical to LLaMA2, using the same attention calculation method as the original MHA LLaMA2 models, and no additional scaling applied to the Relative Positional Encoding (RoPE).
387
+
388
+ We manually curated a dataset of 1.3B tokens for training, utilizing open source datasets from Hugging Face. For most of these sentences, we performed manual or synthetic rewrites and generated alternate language versions using larger language models. Additionally, we conducted augmented text training using carefully selected entries from Wikipedia, as well as featured entries from Fandom and filtered entries from Moegirlpedia. In order to strike a balance between efficiency and quality, 100% of the data used for training was synthetic data, no direct use of text from the internet or original texts from publicly available datasets was employed for fine-tuning.
389
+
390
+ The 7B version of the model is a distilled version of the 14B model, specifically designed for speculative sampling. Therefore, it is important to exercise caution when directly using the model, as it may produce hallucinations or unreliable outputs.
391
+
392
+ Please note that the model was trained on unfiltered internet data. Since we do not have the capacity to vet all of it, there may be a substantial amount of objectionable content, pornography, violence, and offensive language present that we are unable to remove. Therefore, you will still need to complete your own checks on the model's safety and filter keywords in the output. Due to computational resource constraints, we are presently unable to implement RLHF for the model's ethics and safety, nor training on SFT samples that refuse to answer certain questions for restrictive fine-tuning.
393
+
394
+ Bonus: The model underwent some fine-tuning on the prompt format introduced in LLaVA1.5 that is unrelated to image attention calculation. Therefore, aligning the ViT Projection module with frozen LM under visual instructions would enable rapid implementation of effective multimodal capabilities.
395
+
396
+ ## PROMPT FORMAT:
397
+ [chatml](https://github.com/openai/openai-python/blob/main/chatml.md)
398
+
399
+ **System Prompt must not be empty!**
400
+
401
+ ## MMLU:
402
+ stem ACC: 64.19
403
+
404
+ Humanities ACC: 61.40
405
+
406
+ other ACC: 71.64
407
+
408
+ social ACC: 75.37
409
+
410
+ **AVERAGE ACC:67.36**
411
+
412
+
413
+ ## CEval (Val):
414
+ STEM ACC: 66.71
415
+
416
+ Social Science ACC: 85.10
417
+
418
+ Humanities ACC: 76.68
419
+
420
+ Other ACC: 70.23
421
+
422
+ Hard ACC:54.71
423
+
424
+ **AVERAGE ACC:73.10**
425
+
426
+ ## GSM8K
427
+
428
+ **Zero-shot ACC 0.7012888551933283**