TheBloke commited on
Commit
034f380
1 Parent(s): 8b22e2e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +283 -0
README.md ADDED
@@ -0,0 +1,283 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/deepse/CodeUp-alpha-13b-hf
3
+ datasets:
4
+ - rombodawg/Legacy_MegaCodeTraining200k
5
+ inference: false
6
+ language:
7
+ - en
8
+ license: openrail++
9
+ model_creator: DeepSE
10
+ model_name: CodeUp Alpha 13B HF
11
+ model_type: llama
12
+ prompt_template: 'Below is an instruction that describes a task. Write a response
13
+ that appropriately completes the request.
14
+
15
+
16
+ ### Instruction:
17
+
18
+ {prompt}
19
+
20
+
21
+ ### Response:
22
+
23
+ '
24
+ quantized_by: TheBloke
25
+ tags:
26
+ - text-to-code
27
+ - multilingual-code-generation
28
+ ---
29
+
30
+ <!-- header start -->
31
+ <!-- 200823 -->
32
+ <div style="width: auto; margin-left: auto; margin-right: auto">
33
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
34
+ </div>
35
+ <div style="display: flex; justify-content: space-between; width: 100%;">
36
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
37
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
38
+ </div>
39
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
40
+ <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>
41
+ </div>
42
+ </div>
43
+ <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>
44
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
45
+ <!-- header end -->
46
+
47
+ # CodeUp Alpha 13B HF - AWQ
48
+ - Model creator: [DeepSE](https://huggingface.co/deepse)
49
+ - Original model: [CodeUp Alpha 13B HF](https://huggingface.co/deepse/CodeUp-alpha-13b-hf)
50
+
51
+ <!-- description start -->
52
+ ## Description
53
+
54
+ This repo contains AWQ model files for [DeepSE's CodeUp Alpha 13B HF](https://huggingface.co/deepse/CodeUp-alpha-13b-hf).
55
+
56
+
57
+ ### About AWQ
58
+
59
+ 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.
60
+
61
+ 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.
62
+ <!-- description end -->
63
+ <!-- repositories-available start -->
64
+ ## Repositories available
65
+
66
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/CodeUp-Alpha-13B-HF-AWQ)
67
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/CodeUp-Alpha-13B-HF-GPTQ)
68
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/CodeUp-Alpha-13B-HF-GGUF)
69
+ * [DeepSE's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/deepse/CodeUp-alpha-13b-hf)
70
+ <!-- repositories-available end -->
71
+
72
+ <!-- prompt-template start -->
73
+ ## Prompt template: Alpaca
74
+
75
+ ```
76
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
77
+
78
+ ### Instruction:
79
+ {prompt}
80
+
81
+ ### Response:
82
+
83
+ ```
84
+
85
+ <!-- prompt-template end -->
86
+ <!-- licensing start -->
87
+ ## Licensing
88
+
89
+ The creator of the source model has listed its license as `openrail++`, and this quantization has therefore used that same license.
90
+
91
+ 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.
92
+
93
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [DeepSE's CodeUp Alpha 13B HF](https://huggingface.co/deepse/CodeUp-alpha-13b-hf).
94
+ <!-- licensing end -->
95
+ <!-- README_AWQ.md-provided-files start -->
96
+ ## Provided files and AWQ parameters
97
+
98
+ 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.
99
+
100
+ Models are released as sharded safetensors files.
101
+
102
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
103
+ | ------ | ---- | -- | ----------- | ------- | ---- |
104
+ | [main](https://huggingface.co/TheBloke/CodeUp-Alpha-13B-HF-AWQ/tree/main) | 4 | 128 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 4096 | 7.25 GB
105
+
106
+ <!-- README_AWQ.md-provided-files end -->
107
+
108
+ <!-- README_AWQ.md-use-from-vllm start -->
109
+ ## Serving this model from vLLM
110
+
111
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
112
+
113
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
114
+
115
+ ```shell
116
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/CodeUp-Alpha-13B-HF-AWQ --quantization awq
117
+ ```
118
+
119
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
120
+
121
+ ```python
122
+ from vllm import LLM, SamplingParams
123
+
124
+ prompts = [
125
+ "Hello, my name is",
126
+ "The president of the United States is",
127
+ "The capital of France is",
128
+ "The future of AI is",
129
+ ]
130
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
131
+
132
+ llm = LLM(model="TheBloke/CodeUp-Alpha-13B-HF-AWQ", quantization="awq")
133
+
134
+ outputs = llm.generate(prompts, sampling_params)
135
+
136
+ # Print the outputs.
137
+ for output in outputs:
138
+ prompt = output.prompt
139
+ generated_text = output.outputs[0].text
140
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
141
+ ```
142
+ <!-- README_AWQ.md-use-from-vllm start -->
143
+
144
+ <!-- README_AWQ.md-use-from-python start -->
145
+ ## How to use this AWQ model from Python code
146
+
147
+ ### Install the necessary packages
148
+
149
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
150
+
151
+ ```shell
152
+ pip3 install autoawq
153
+ ```
154
+
155
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
156
+
157
+ ```shell
158
+ pip3 uninstall -y autoawq
159
+ git clone https://github.com/casper-hansen/AutoAWQ
160
+ cd AutoAWQ
161
+ pip3 install .
162
+ ```
163
+
164
+ ### You can then try the following example code
165
+
166
+ ```python
167
+ from awq import AutoAWQForCausalLM
168
+ from transformers import AutoTokenizer
169
+
170
+ model_name_or_path = "TheBloke/CodeUp-Alpha-13B-HF-AWQ"
171
+
172
+ # Load model
173
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
174
+ trust_remote_code=False, safetensors=True)
175
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
176
+
177
+ prompt = "Tell me about AI"
178
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
179
+
180
+ ### Instruction:
181
+ {prompt}
182
+
183
+ ### Response:
184
+
185
+ '''
186
+
187
+ print("\n\n*** Generate:")
188
+
189
+ tokens = tokenizer(
190
+ prompt_template,
191
+ return_tensors='pt'
192
+ ).input_ids.cuda()
193
+
194
+ # Generate output
195
+ generation_output = model.generate(
196
+ tokens,
197
+ do_sample=True,
198
+ temperature=0.7,
199
+ top_p=0.95,
200
+ top_k=40,
201
+ max_new_tokens=512
202
+ )
203
+
204
+ print("Output: ", tokenizer.decode(generation_output[0]))
205
+
206
+ # Inference can also be done using transformers' pipeline
207
+ from transformers import pipeline
208
+
209
+ print("*** Pipeline:")
210
+ pipe = pipeline(
211
+ "text-generation",
212
+ model=model,
213
+ tokenizer=tokenizer,
214
+ max_new_tokens=512,
215
+ do_sample=True,
216
+ temperature=0.7,
217
+ top_p=0.95,
218
+ top_k=40,
219
+ repetition_penalty=1.1
220
+ )
221
+
222
+ print(pipe(prompt_template)[0]['generated_text'])
223
+ ```
224
+ <!-- README_AWQ.md-use-from-python end -->
225
+
226
+ <!-- README_AWQ.md-compatibility start -->
227
+ ## Compatibility
228
+
229
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
230
+
231
+ [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).
232
+ <!-- README_AWQ.md-compatibility end -->
233
+
234
+ <!-- footer start -->
235
+ <!-- 200823 -->
236
+ ## Discord
237
+
238
+ For further support, and discussions on these models and AI in general, join us at:
239
+
240
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
241
+
242
+ ## Thanks, and how to contribute
243
+
244
+ Thanks to the [chirper.ai](https://chirper.ai) team!
245
+
246
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
247
+
248
+ 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.
249
+
250
+ 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.
251
+
252
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
253
+
254
+ * Patreon: https://patreon.com/TheBlokeAI
255
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
256
+
257
+ **Special thanks to**: Aemon Algiz.
258
+
259
+ **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
260
+
261
+
262
+ Thank you to all my generous patrons and donaters!
263
+
264
+ And thank you again to a16z for their generous grant.
265
+
266
+ <!-- footer end -->
267
+
268
+ # Original model card: DeepSE's CodeUp Alpha 13B HF
269
+
270
+
271
+ <!-- <p align="center" width="70%">
272
+ <img src="assets/Logo.jpg" alt="HKUST CodeUp" style="width: 50%; min-width: 250px; display: block; margin: auto;">
273
+ </p> -->
274
+ ![HKUST CodeUp](assets/Logo.jpg)
275
+ # CodeUp: A Multilingual Code Generation Llama2 Model with Parameter-Efficient Instruction-Tuning on a Single RTX 3090
276
+
277
+ ## Description
278
+
279
+ ![](assets/Codeup-alpha-13b.jpg)
280
+
281
+
282
+ ## Training & Inference
283
+ Detailed instructions can be found at [https://github.com/juyongjiang/CodeUp](https://github.com/juyongjiang/CodeUp).