TheBloke commited on
Commit
74ba09b
1 Parent(s): eef2f20

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +360 -0
README.md ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/OpenAssistant/codellama-13b-oasst-sft-v10
3
+ datasets:
4
+ - OpenAssistant/oasst1
5
+ - shahules786/orca-best
6
+ inference: false
7
+ language:
8
+ - en
9
+ license: llama2
10
+ model_creator: OpenAssistant
11
+ model_name: CodeLlama 13B SFT v10
12
+ model_type: llama
13
+ prompt_template: '<|im_start|>system
14
+
15
+ {system_message}<|im_end|>
16
+
17
+ <|im_start|>user
18
+
19
+ {prompt}<|im_end|>
20
+
21
+ <|im_start|>assistant
22
+
23
+ '
24
+ quantized_by: TheBloke
25
+ ---
26
+
27
+ <!-- header start -->
28
+ <!-- 200823 -->
29
+ <div style="width: auto; margin-left: auto; margin-right: auto">
30
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
31
+ </div>
32
+ <div style="display: flex; justify-content: space-between; width: 100%;">
33
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
34
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
35
+ </div>
36
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
37
+ <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>
38
+ </div>
39
+ </div>
40
+ <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>
41
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
42
+ <!-- header end -->
43
+
44
+ # CodeLlama 13B SFT v10 - AWQ
45
+ - Model creator: [OpenAssistant](https://huggingface.co/OpenAssistant)
46
+ - Original model: [CodeLlama 13B SFT v10](https://huggingface.co/OpenAssistant/codellama-13b-oasst-sft-v10)
47
+
48
+ <!-- description start -->
49
+ ## Description
50
+
51
+ This repo contains AWQ model files for [OpenAssistant's CodeLlama 13B SFT v10](https://huggingface.co/OpenAssistant/codellama-13b-oasst-sft-v10).
52
+
53
+
54
+ ### About AWQ
55
+
56
+ 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.
57
+
58
+ 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.
59
+ <!-- description end -->
60
+ <!-- repositories-available start -->
61
+ ## Repositories available
62
+
63
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/CodeLlama-13B-oasst-sft-v10-AWQ)
64
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/CodeLlama-13B-oasst-sft-v10-GPTQ)
65
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/CodeLlama-13B-oasst-sft-v10-GGUF)
66
+ * [OpenAssistant's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/OpenAssistant/codellama-13b-oasst-sft-v10)
67
+ <!-- repositories-available end -->
68
+
69
+ <!-- prompt-template start -->
70
+ ## Prompt template: ChatML
71
+
72
+ ```
73
+ <|im_start|>system
74
+ {system_message}<|im_end|>
75
+ <|im_start|>user
76
+ {prompt}<|im_end|>
77
+ <|im_start|>assistant
78
+
79
+ ```
80
+
81
+ <!-- prompt-template end -->
82
+
83
+
84
+ <!-- README_AWQ.md-provided-files start -->
85
+ ## Provided files and AWQ parameters
86
+
87
+ 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.
88
+
89
+ Models are released as sharded safetensors files.
90
+
91
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
92
+ | ------ | ---- | -- | ----------- | ------- | ---- |
93
+ | [main](https://huggingface.co/TheBloke/CodeLlama-13B-oasst-sft-v10-AWQ/tree/main) | 4 | 128 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 7.25 GB
94
+
95
+ <!-- README_AWQ.md-provided-files end -->
96
+
97
+ <!-- README_AWQ.md-use-from-vllm start -->
98
+ ## Serving this model from vLLM
99
+
100
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
101
+
102
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
103
+
104
+ ```shell
105
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/CodeLlama-13B-oasst-sft-v10-AWQ --quantization awq
106
+ ```
107
+
108
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
109
+
110
+ ```python
111
+ from vllm import LLM, SamplingParams
112
+
113
+ prompts = [
114
+ "Hello, my name is",
115
+ "The president of the United States is",
116
+ "The capital of France is",
117
+ "The future of AI is",
118
+ ]
119
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
120
+
121
+ llm = LLM(model="TheBloke/CodeLlama-13B-oasst-sft-v10-AWQ", quantization="awq")
122
+
123
+ outputs = llm.generate(prompts, sampling_params)
124
+
125
+ # Print the outputs.
126
+ for output in outputs:
127
+ prompt = output.prompt
128
+ generated_text = output.outputs[0].text
129
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
130
+ ```
131
+ <!-- README_AWQ.md-use-from-vllm start -->
132
+
133
+ <!-- README_AWQ.md-use-from-python start -->
134
+ ## How to use this AWQ model from Python code
135
+
136
+ ### Install the necessary packages
137
+
138
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
139
+
140
+ ```shell
141
+ pip3 install autoawq
142
+ ```
143
+
144
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
145
+
146
+ ```shell
147
+ pip3 uninstall -y autoawq
148
+ git clone https://github.com/casper-hansen/AutoAWQ
149
+ cd AutoAWQ
150
+ pip3 install .
151
+ ```
152
+
153
+ ### You can then try the following example code
154
+
155
+ ```python
156
+ from awq import AutoAWQForCausalLM
157
+ from transformers import AutoTokenizer
158
+
159
+ model_name_or_path = "TheBloke/CodeLlama-13B-oasst-sft-v10-AWQ"
160
+
161
+ # Load model
162
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
163
+ trust_remote_code=False, safetensors=True)
164
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
165
+
166
+ prompt = "Tell me about AI"
167
+ prompt_template=f'''<|im_start|>system
168
+ {system_message}<|im_end|>
169
+ <|im_start|>user
170
+ {prompt}<|im_end|>
171
+ <|im_start|>assistant
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: OpenAssistant's CodeLlama 13B SFT v10
257
+
258
+ # Open-Assistant CodeLlama 13B SFT v10
259
+
260
+ This model is an Open-Assistant fine-tuning of Meta's CodeLlama 13B LLM.
261
+
262
+ **Note**: Due to the new RoPE Theta value (1e6 instead of 1e4), for correct results you must load this model with `trust_remote_code=True` or use the latest main branch of Huggingface transformers (until version 4.33 is released).
263
+
264
+ ## Model Details
265
+
266
+ - **Finetuned from:** [codellama/CodeLlama-7b-hf](https://huggingface.co/codellama/CodeLlama-7b-hf) via [epfLLM/Megatron-LLM](https://github.com/epfLLM/Megatron-LLM)
267
+ - **Model type:** Causal decoder-only transformer language model
268
+ - **Language:** English
269
+ - **Weights & Biases training logs:** 6123 steps, BS 64 [run56_oa_llamacode](https://wandb.ai/open-assistant/public-sft/runs/run56_oa_llamacode)
270
+ - **Demo:** [Continuations for 250 random prompts (without system message)](https://open-assistant.github.io/oasst-model-eval/?f=https%3A%2F%2Fraw.githubusercontent.com%2FOpen-Assistant%2Foasst-model-eval%2Fmain%2Fsampling_reports%2Foasst-sft%2F2023-08-26_OpenAssistant_codellama-13b-oasst-sft-v10_sampling_noprefix2.json)
271
+ - **License:** [LLAMA 2 COMMUNITY LICENSE AGREEMENT](https://huggingface.co/meta-llama/Llama-2-70b/raw/main/LICENSE.txt)
272
+ - **Contact:** [Open-Assistant Discord](https://ykilcher.com/open-assistant-discord)
273
+
274
+ ## Prompting / Prompt Template
275
+
276
+ Due to public demand (see [survey](https://twitter.com/erhartford/status/1682403597525430272)) we changed the prompt-template for this model from custom prompter/assistant tokens to OpenAI's [chatml](https://github.com/openai/openai-python/blob/main/chatml.md) standard prompt format.
277
+ We hope that this leads to greater compatibility with chat inference/frontend applications.
278
+
279
+ Prompt dialogue template:
280
+
281
+ ```
282
+ """
283
+ <|im_start|>system
284
+ {system_message}<|im_end|>
285
+ <|im_start|>user
286
+ {prompt}<|im_end|>
287
+ <|im_start|>assistant
288
+ """
289
+ ```
290
+
291
+ The model input can contain multiple conversation turns between user and assistant, e.g.
292
+ ```
293
+ <|im_start|>user
294
+ {prompt 1}<|im_end|>
295
+ <|im_start|>assistant
296
+ {reply 1}<|im_end|>
297
+ <|im_start|>user
298
+ {prompt 2}<|im_end|>
299
+ <|im_start|>assistant
300
+ (...)
301
+ ```
302
+
303
+ The model was partly trained with orca system messages.
304
+ For inference we recommend to use the official [Llama2 system message](https://github.com/facebookresearch/llama/blob/ea9f33d6d3ea8ed7d560d270986407fd6c2e52b7/example_chat_completion.py#L57-L61):
305
+ ```
306
+ <|im_start|>system
307
+ You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
308
+
309
+ If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
310
+ <|im_end|>
311
+ ```
312
+
313
+ ### Credits & Special Thanks
314
+
315
+ - Thanks to [Meta AI](https://ai.meta.com/) for training and releasing the CodeLLlama model.
316
+ - Distributed training support was provided by EPFL's [Machine Learning and Optimization Laboratory](https://www.epfl.ch/labs/mlo/), and [Natural Language Processing Lab](https://nlp.epfl.ch/).
317
+ - The open-source [epfLLM/Megatron-LLM](https://github.com/epfLLM/Megatron-LLM) trainer was used for fine-tuning.
318
+ - [rombodawg](https://huggingface.co/rombodawg) curated the [LosslessMegaCodeTrainingV2_1m_Evol_Uncensored](https://huggingface.co/datasets/rombodawg/LosslessMegaCodeTrainingV2_1m_Evol_Uncensored) dataset.
319
+ - [ehartford](https://huggingface.co/ehartford) generated and published the [ehartford/dolphin](https://huggingface.co/datasets/ehartford/dolphin).
320
+ - [shahules786](https://github.com/shahules786) de-duped and filtered the Dolphin and Megacode dataset with a clustering/controid approach and generated orca-best & bestofmegacode.
321
+ - [andreaskoepf](https://github.com/andreaskoepf/) prepared & orchestrated the training.
322
+
323
+ ## Ethical Considerations and Limitations
324
+
325
+ Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios.
326
+ For these reasons, as with all LLMs, the potential outputs of codellama-13b-oasst-sft-v10 cannot be predicted
327
+ in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses
328
+ to user prompts. Therefore, before deploying any applications of codellama-13b-oasst-sft-v10, developers should
329
+ perform safety testing and tuning tailored to their specific applications of the model.
330
+
331
+ Please see Meta's [Responsible Use Guide](https://ai.meta.com/llama/responsible-use-guide/).
332
+
333
+ ## Configuration Details
334
+
335
+ The "pretokenizer" utility used to tokenize the datamix is part of the Open-Assistant github repository and can be found here: [model/pretokenizer](https://github.com/LAION-AI/Open-Assistant/tree/main/model/pretokenizer).
336
+
337
+
338
+ ### Pretokenizer Configuration
339
+
340
+
341
+ ```
342
+ orca_megacode_oasst_best:
343
+ datasets:
344
+ - orca-chat:
345
+ val_split: 0.01
346
+ max_val_set: 1000
347
+ - bestofmegacode:
348
+ val_split: 0.01
349
+ max_val_set: 1000
350
+ - oasst_export:
351
+ lang: "bg,ca,cs,da,de,en,es,fr,hr,hu,it,nl,pl,pt,ro,ru,sl,sr,sv,uk"
352
+ #hf_dataset_name: OpenAssistant/oasst1
353
+ input_file_path: 2023-08-25_oasst_ready.jsonl.gz
354
+ top_k: 1
355
+ val_split: 0.025
356
+ output_dir: "output/orca_megacode_oasst_best"
357
+ filename_prefix: "orca_megacode_oasst_best"
358
+ min_assistant_tokens: 1
359
+ ```
360
+