TheBloke commited on
Commit
6a97b9b
1 Parent(s): dd85d7c

Upload README.md

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