TheBloke commited on
Commit
333d4fc
1 Parent(s): f730f5c

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +338 -0
README.md ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/Faradaylab/ARIA-70B-V2
3
+ inference: false
4
+ language:
5
+ - fr
6
+ - en
7
+ license: llama2
8
+ model_creator: Faradaylab
9
+ model_name: ARIA 70B V2
10
+ model_type: llama
11
+ pipeline_tag: text-generation
12
+ prompt_template: '[INST] <<SYS>>
13
+
14
+ You are a helpful, respectful and honest assistant. Always answer as helpfully as
15
+ possible, while being safe. Your answers should not include any harmful, unethical,
16
+ racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses
17
+ are socially unbiased and positive in nature. If a question does not make any sense,
18
+ or is not factually coherent, explain why instead of answering something not correct.
19
+ If you don''t know the answer to a question, please don''t share false information.
20
+
21
+ <</SYS>>
22
+
23
+ {prompt}[/INST]
24
+
25
+ '
26
+ quantized_by: TheBloke
27
+ tags:
28
+ - code
29
+ - text-generation-inference
30
+ - 'Meta '
31
+ - llama
32
+ - facebook
33
+ - pytorch
34
+ - openassistant
35
+ - data
36
+ - education
37
+ - languages
38
+ ---
39
+
40
+ <!-- header start -->
41
+ <!-- 200823 -->
42
+ <div style="width: auto; margin-left: auto; margin-right: auto">
43
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
44
+ </div>
45
+ <div style="display: flex; justify-content: space-between; width: 100%;">
46
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
47
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
48
+ </div>
49
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
50
+ <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>
51
+ </div>
52
+ </div>
53
+ <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>
54
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
55
+ <!-- header end -->
56
+
57
+ # ARIA 70B V2 - AWQ
58
+ - Model creator: [Faradaylab](https://huggingface.co/Faradaylab)
59
+ - Original model: [ARIA 70B V2](https://huggingface.co/Faradaylab/ARIA-70B-V2)
60
+
61
+ <!-- description start -->
62
+ ## Description
63
+
64
+ This repo contains AWQ model files for [Faradaylab's ARIA 70B V2](https://huggingface.co/Faradaylab/ARIA-70B-V2).
65
+
66
+
67
+ ### About AWQ
68
+
69
+ 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.
70
+
71
+ 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.
72
+ <!-- description end -->
73
+ <!-- repositories-available start -->
74
+ ## Repositories available
75
+
76
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/ARIA-70B-V2-AWQ)
77
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/ARIA-70B-V2-GPTQ)
78
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/ARIA-70B-V2-GGUF)
79
+ * [Faradaylab's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Faradaylab/ARIA-70B-V2)
80
+ <!-- repositories-available end -->
81
+
82
+ <!-- prompt-template start -->
83
+ ## Prompt template: Llama-2-Chat
84
+
85
+ ```
86
+ [INST] <<SYS>>
87
+ 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. 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.
88
+ <</SYS>>
89
+ {prompt}[/INST]
90
+
91
+ ```
92
+
93
+ <!-- prompt-template end -->
94
+
95
+
96
+ <!-- README_AWQ.md-provided-files start -->
97
+ ## Provided files and AWQ parameters
98
+
99
+ 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.
100
+
101
+ Models are released as sharded safetensors files.
102
+
103
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
104
+ | ------ | ---- | -- | ----------- | ------- | ---- |
105
+ | [main](https://huggingface.co/TheBloke/ARIA-70B-V2-AWQ/tree/main) | 4 | 128 | [French news](https://huggingface.co/datasets/gustavecortal/diverse_french_news) | 4096 | 36.61 GB
106
+
107
+ <!-- README_AWQ.md-provided-files end -->
108
+
109
+ <!-- README_AWQ.md-use-from-vllm start -->
110
+ ## Serving this model from vLLM
111
+
112
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
113
+
114
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
115
+
116
+ ```shell
117
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/ARIA-70B-V2-AWQ --quantization awq
118
+ ```
119
+
120
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
121
+
122
+ ```python
123
+ from vllm import LLM, SamplingParams
124
+
125
+ prompts = [
126
+ "Hello, my name is",
127
+ "The president of the United States is",
128
+ "The capital of France is",
129
+ "The future of AI is",
130
+ ]
131
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
132
+
133
+ llm = LLM(model="TheBloke/ARIA-70B-V2-AWQ", quantization="awq")
134
+
135
+ outputs = llm.generate(prompts, sampling_params)
136
+
137
+ # Print the outputs.
138
+ for output in outputs:
139
+ prompt = output.prompt
140
+ generated_text = output.outputs[0].text
141
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
142
+ ```
143
+ <!-- README_AWQ.md-use-from-vllm start -->
144
+
145
+ <!-- README_AWQ.md-use-from-python start -->
146
+ ## How to use this AWQ model from Python code
147
+
148
+ ### Install the necessary packages
149
+
150
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
151
+
152
+ ```shell
153
+ pip3 install autoawq
154
+ ```
155
+
156
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
157
+
158
+ ```shell
159
+ pip3 uninstall -y autoawq
160
+ git clone https://github.com/casper-hansen/AutoAWQ
161
+ cd AutoAWQ
162
+ pip3 install .
163
+ ```
164
+
165
+ ### You can then try the following example code
166
+
167
+ ```python
168
+ from awq import AutoAWQForCausalLM
169
+ from transformers import AutoTokenizer
170
+
171
+ model_name_or_path = "TheBloke/ARIA-70B-V2-AWQ"
172
+
173
+ # Load model
174
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
175
+ trust_remote_code=False, safetensors=True)
176
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
177
+
178
+ prompt = "Tell me about AI"
179
+ prompt_template=f'''[INST] <<SYS>>
180
+ 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. 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.
181
+ <</SYS>>
182
+ {prompt}[/INST]
183
+
184
+ '''
185
+
186
+ print("\n\n*** Generate:")
187
+
188
+ tokens = tokenizer(
189
+ prompt_template,
190
+ return_tensors='pt'
191
+ ).input_ids.cuda()
192
+
193
+ # Generate output
194
+ generation_output = model.generate(
195
+ tokens,
196
+ do_sample=True,
197
+ temperature=0.7,
198
+ top_p=0.95,
199
+ top_k=40,
200
+ max_new_tokens=512
201
+ )
202
+
203
+ print("Output: ", tokenizer.decode(generation_output[0]))
204
+
205
+ # Inference can also be done using transformers' pipeline
206
+ from transformers import pipeline
207
+
208
+ print("*** Pipeline:")
209
+ pipe = pipeline(
210
+ "text-generation",
211
+ model=model,
212
+ tokenizer=tokenizer,
213
+ max_new_tokens=512,
214
+ do_sample=True,
215
+ temperature=0.7,
216
+ top_p=0.95,
217
+ top_k=40,
218
+ repetition_penalty=1.1
219
+ )
220
+
221
+ print(pipe(prompt_template)[0]['generated_text'])
222
+ ```
223
+ <!-- README_AWQ.md-use-from-python end -->
224
+
225
+ <!-- README_AWQ.md-compatibility start -->
226
+ ## Compatibility
227
+
228
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
229
+
230
+ [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).
231
+ <!-- README_AWQ.md-compatibility end -->
232
+
233
+ <!-- footer start -->
234
+ <!-- 200823 -->
235
+ ## Discord
236
+
237
+ For further support, and discussions on these models and AI in general, join us at:
238
+
239
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
240
+
241
+ ## Thanks, and how to contribute
242
+
243
+ Thanks to the [chirper.ai](https://chirper.ai) team!
244
+
245
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
252
+
253
+ * Patreon: https://patreon.com/TheBlokeAI
254
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
255
+
256
+ **Special thanks to**: Aemon Algiz.
257
+
258
+ **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
259
+
260
+
261
+ Thank you to all my generous patrons and donaters!
262
+
263
+ And thank you again to a16z for their generous grant.
264
+
265
+ <!-- footer end -->
266
+
267
+ # Original model card: Faradaylab's ARIA 70B V2
268
+
269
+ ARIA is the last version of Llama 2 70B finetuned over 50.000 high quality french tokens. We built our own dataset for training doing an extract of the French Dataset from Enno and removing Alpaca style translated text from english.
270
+
271
+ The goal is to increase model quality on French and general topics.
272
+
273
+ ---
274
+ # **Aria 70B is based on Llama 2-70B-Chat-HF**
275
+ Llama 2 is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. This is the repository for the 70B fine-tuned model, optimized for dialogue use cases and converted for the Hugging Face Transformers format. Links to other models can be found in the index at the bottom.
276
+
277
+ # *FINETUNING PROCESS **
278
+
279
+ We trained the model on a high quality dataset with more than 50.000 rows of french language. The training took 2 days on Amazon Cloud Sagemaker powered by Nvidia GPUs.
280
+
281
+ # **Timing of training**
282
+ 2 Days using NVIDIA A10G and Amazon Web services Cloud Instance. We are grateful to Nvidia Inception program.
283
+
284
+ We are also applying rope scalling as experimental approach used by several other Open source teams to increase context lenght of ARIA from 4,096 to over 6,000 tokens. This will allow the model to handle large files for data extraction. This is not active by default and you should add a line of code at parameters to activate rope scaling.
285
+ ## Model Details /
286
+ *Note: Use of this model is governed by the Meta license because it's based on LLAMA 2. In order to download the model weights and tokenizer, please visit the [website](https://ai.meta.com/resources/models-and-libraries/llama-downloads/) and accept our License before requesting access here.*
287
+
288
+
289
+ **Model Developers** :FARADAY
290
+
291
+ **Variations** :ARIA comes in a range of parameter sizes — 7B, 40B (based on Falcon), and 70B finetuned on French language datasets.
292
+
293
+ **Input** :Models input text only.
294
+
295
+ **Output** : Models generate text only.
296
+
297
+ **Model Architecture** : ARIA is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align to human preferences for helpfulness and safety.
298
+
299
+ **License** : A custom commercial license is available at: [https://ai.meta.com/resources/models-and-libraries/llama-downloads/](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)
300
+
301
+ **Research Paper for LLAMA 2** : ["Llama-2: Open Foundation and Fine-tuned Chat Models"](arxiv.org/abs/2307.09288)
302
+
303
+
304
+
305
+ **CO<sub>2</sub> emissions during pretraining.** Time: total GPU time required for training each model. Power Consumption: peak power capacity per GPU device for the GPUs used adjusted for power usage efficiency. 100% of the emissions are directly offset by Meta's sustainability program, and because we are openly releasing these models, the pretraining costs do not need to be incurred by others.
306
+
307
+ ## Training Data
308
+
309
+ **Overview** ARIA was trained over on 50.000 tokens of data from publicly available sources in French.
310
+
311
+ **Data Freshness** The pretraining data has a cutoff of September 2022, but some tuning data is more recent, up to August 2023.
312
+
313
+
314
+ **Overall performance on grouped academic benchmarks.** *Code:* We report the average pass@1 scores of our models on HumanEval and MBPP. *Commonsense Reasoning:* We report the average of PIQA, SIQA, HellaSwag, WinoGrande, ARC easy and challenge, OpenBookQA, and CommonsenseQA. We report 7-shot results for CommonSenseQA and 0-shot results for all other benchmarks. *World Knowledge:* We evaluate the 5-shot performance on NaturalQuestions and TriviaQA and report the average. *Reading Comprehension:* For reading comprehension, we report the 0-shot average on SQuAD, QuAC, and BoolQ. *MATH:* We report the average of the GSM8K (8 shot) and MATH (4 shot) benchmarks at top 1.
315
+
316
+ |||TruthfulQA|Toxigen|
317
+ |---|---|---|---|
318
+ |Llama 1|7B|27.42|23.00|
319
+ |Llama 1|13B|41.74|23.08|
320
+ |Llama 1|33B|44.19|22.57|
321
+ |Llama 1|65B|48.71|21.77|
322
+ |Llama 2|7B|33.29|**21.25**|
323
+ |Llama 2|13B|41.86|26.10|
324
+ |Llama 2|70B|**50.18**|24.60|
325
+
326
+ **Evaluation of pretrained LLMs on automatic safety benchmarks.** For TruthfulQA, we present the percentage of generations that are both truthful and informative (the higher the better). For ToxiGen, we present the percentage of toxic generations (the smaller the better).
327
+
328
+
329
+ |||TruthfulQA|Toxigen|
330
+ |---|---|---|---|
331
+ |Llama-2-Chat|7B|57.04|**0.00**|
332
+ |Llama-2-Chat|13B|62.18|**0.00**|
333
+ |Llama-2-Chat|70B|**64.14**|0.01|
334
+
335
+ **Evaluation of fine-tuned LLMs on different safety datasets.** Same metric definitions as above.
336
+
337
+ ## Ethical Considerations and Limitations
338
+ ARIA is a new technology that carries risks with use.