TheBloke commited on
Commit
0c3d775
1 Parent(s): 8555bb7

Update for Transformers GPTQ support

Browse files
README.md CHANGED
@@ -3,17 +3,20 @@ inference: false
3
  license: other
4
  ---
5
  <!-- header start -->
6
- <div style="width: 100%;">
7
- <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
 
8
  </div>
9
  <div style="display: flex; justify-content: space-between; width: 100%;">
10
  <div style="display: flex; flex-direction: column; align-items: flex-start;">
11
- <p><a href="https://discord.gg/Jq4vkcDakD">Chat & support: my new Discord server</a></p>
12
  </div>
13
  <div style="display: flex; flex-direction: column; align-items: flex-end;">
14
- <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
15
  </div>
16
  </div>
 
 
17
  <!-- header end -->
18
 
19
  # Tim Dettmers' Guanaco 13B GPTQ
@@ -72,11 +75,12 @@ It was created with groupsize 128 to ensure higher quality inference, and withou
72
  ```
73
 
74
  <!-- footer start -->
 
75
  ## Discord
76
 
77
  For further support, and discussions on these models and AI in general, join us at:
78
 
79
- [TheBloke AI's Discord server](https://discord.gg/Jq4vkcDakD)
80
 
81
  ## Thanks, and how to contribute.
82
 
@@ -91,15 +95,21 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
91
  * Patreon: https://patreon.com/TheBlokeAI
92
  * Ko-Fi: https://ko-fi.com/TheBlokeAI
93
 
94
- **Patreon special mentions**: Aemon Algiz, Dmitriy Samsonov, Nathan LeClaire, Trenton Dambrowitz, Mano Prime, David Flickinger, vamX, Nikolai Manek, senxiiz, Khalefa Al-Ahmad, Illia Dulskyi, Jonathan Leane, Talal Aujan, V. Lukas, Joseph William Delisle, Pyrater, Oscar Rangel, Lone Striker, Luke Pendergrass, Eugene Pentland, Sebastain Graf, Johann-Peter Hartman.
 
 
 
95
 
96
  Thank you to all my generous patrons and donaters!
 
 
 
97
  <!-- footer end -->
98
  # Original model card
99
 
100
  # Guanaco Models Based on LLaMA
101
 
102
- | [Paper](https://arxiv.org/abs/2305.14314) | [Code](https://github.com/artidoro/qlora) | [Demo](https://huggingface.co/spaces/uwnlp/guanaco-playground-tgi) |
103
 
104
  **The Guanaco models are open-source finetuned chatbots obtained through 4-bit QLoRA tuning of LLaMA base models on the OASST1 dataset. They are available in 7B, 13B, 33B, and 65B parameter sizes.**
105
 
@@ -109,18 +119,18 @@ Thank you to all my generous patrons and donaters!
109
  - **Competitive with commercial chatbot systems on the Vicuna and OpenAssistant benchmarks** (ChatGPT and BARD) according to human and GPT-4 raters. We note that the relative performance on tasks not covered in these benchmarks could be very different. In addition, commercial systems evolve over time (we used outputs from the March 2023 version of the models).
110
  - **Available open-source for research purposes**. Guanaco models allow *cheap* and *local* experimentation with high-quality chatbot systems.
111
  - **Replicable and efficient training procedure** that can be extended to new use cases. Guanaco training scripts are available in the [QLoRA repo](https://github.com/artidoro/qlora).
112
- - **Rigorous comparison to 16-bit methods** (both 16-bit full-finetuning and LoRA) in [our paper](https://arxiv.org/abs/2305.14314) demonstrates the effectiveness of 4-bit QLoRA finetuning.
113
  - **Lightweight** checkpoints which only contain adapter weights.
114
 
115
  ## License and Intended Use
116
- Guanaco adapter weights are available under Apache 2 license. Note the use of the Guanaco adapter weights, requires access to the LLaMA model weighs.
117
- Guanaco is based on LLaMA and therefore should be used according to the LLaMA license.
118
 
119
  ## Usage
120
  Here is an example of how you would load Guanaco 7B in 4-bits:
121
  ```python
122
  import torch
123
- from peft import PeftModel
124
  from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
125
 
126
  model_name = "huggyllama/llama-7b"
@@ -162,7 +172,7 @@ A chat between a curious human and an artificial intelligence assistant. The ass
162
  ```
163
 
164
 
165
- ## Current Inference Limitations
166
  Currently, 4-bit inference is slow. We recommend loading in 16 bits if inference speed is a concern. We are actively working on releasing efficient 4-bit inference kernels.
167
 
168
  Below is how you would load the model in 16 bits:
@@ -188,18 +198,18 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
188
 
189
  **Finetuning Data**: Guanaco is finetuned on OASST1. The exact dataset is available at [timdettmers/openassistant-guanaco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco).
190
 
191
- **Languages**: The OASST1 dataset is multilingual (see [the paper](https://arxiv.org/abs/2304.07327) for details) and as such Guanaco responds to user queries in different languages. We note, however, that OASST1 is heavy in high-resource languages. In addition, human evaluation of Guanaco was only performed in English and based on qualitative analysis we observed degradation in performance in other languages.
192
 
193
  Next, we describe Training and Evaluation details.
194
 
195
  ### Training
196
- Guanaco models are the result of 4-bit QLoRA supervised finetuning on the OASST1 dataset.
197
 
198
  All models use NormalFloat4 datatype for the base model and LoRA adapters on all linear layers with BFloat16 as computation datatype. We set LoRA $r=64$, $\alpha=16$. We also use Adam beta2 of 0.999, max grad norm of 0.3 and LoRA dropout of 0.1 for models up to 13B and 0.05 for 33B and 65B models.
199
- For the finetuning process, we use constant learning rate schedule and paged AdamW optimizer.
200
 
201
  ### Training hyperparameters
202
- Size| Dataset | Batch Size | Learning Rate | Max Steps | Sequence length
203
  ---|---|---|---|---|---
204
  7B | OASST1 | 16 | 2e-4 | 1875 | 512
205
  13B | OASST1 | 16 | 2e-4 | 1875 | 512
@@ -207,39 +217,39 @@ Size| Dataset | Batch Size | Learning Rate | Max Steps | Sequence length
207
  65B | OASST1 | 16 | 1e-4 | 1875 | 512
208
 
209
  ### Evaluation
210
- We test generative language capabilities through both automated and human evaluations. This second set of evaluations relies on queries curated by humans and aims at measuring the quality of model responses. We use the Vicuna and OpenAssistant datasets with 80 and 953 prompts respectively.
211
 
212
  In both human and automated evaluations, for each prompt, raters compare all pairs of responses across the models considered. For human raters we randomize the order of the systems, for GPT-4 we evaluate with both orders.
213
 
214
-
215
  Benchmark | Vicuna | | Vicuna | | OpenAssistant | | -
216
  -----------|----|-----|--------|---|---------------|---|---
217
  Prompts | 80 | | 80 | | 953 | |
218
- Judge | Human | | GPT-4 | | GPT-4 | |
219
- Model | Elo | Rank | Elo | Rank | Elo | Rank | **Median Rank**
220
- GPT-4 | 1176 | 1 | 1348 | 1 | 1294 | 1 | 1
221
- Guanaco-65B | 1023 | 2 | 1022 | 2 | 1008 | 3 | 2
222
- Guanaco-33B | 1009 | 4 | 992 | 3 | 1002 | 4 | 4
223
- ChatGPT-3.5 Turbo | 916 | 7 | 966 | 5 | 1015 | 2 | 5
224
- Vicuna-13B | 984 | 5 | 974 | 4 | 936 | 5 | 5
225
- Guanaco-13B | 975 | 6 | 913 | 6 | 885 | 6 | 6
226
- Guanaco-7B | 1010 | 3 | 879 | 8 | 860 | 7 | 7
227
- Bard | 909 | 8 | 902 | 7 | - | - | 8
228
 
229
 
230
  We also use the MMLU benchmark to measure performance on a range of language understanding tasks. This is a multiple-choice benchmark covering 57 tasks including elementary mathematics, US history, computer science, law, and more. We report 5-shot test accuracy.
231
 
232
- Dataset | 7B | 13B | 33B | 65B
233
  ---|---|---|---|---
234
- LLaMA no tuning | 35.1 | 46.9 | 57.8 | 63.4
235
- Self-Instruct | 36.4 | 33.3 | 53.0 | 56.7
236
- Longform | 32.1 | 43.2 | 56.6 | 59.7
237
- Chip2 | 34.5 | 41.6 | 53.6 | 59.8
238
- HH-RLHF | 34.9 | 44.6 | 55.8 | 60.1
239
- Unnatural Instruct | 41.9 | 48.1 | 57.3 | 61.3
240
- OASST1 (Guanaco) | 36.6 | 46.4 | 57.0 | 62.2
241
- Alpaca | 38.8 | 47.8 | 57.3 | 62.5
242
- FLAN v2 | 44.5 | 51.4 | 59.2 | 63.9
243
 
244
  ## Risks and Biases
245
  The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. The model was trained on various public datasets; it is possible that this model could generate lewd, biased, or otherwise offensive outputs.
 
3
  license: other
4
  ---
5
  <!-- header start -->
6
+ <!-- 200823 -->
7
+ <div style="width: auto; margin-left: auto; margin-right: auto">
8
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
9
  </div>
10
  <div style="display: flex; justify-content: space-between; width: 100%;">
11
  <div style="display: flex; flex-direction: column; align-items: flex-start;">
12
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
13
  </div>
14
  <div style="display: flex; flex-direction: column; align-items: flex-end;">
15
+ <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>
16
  </div>
17
  </div>
18
+ <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>
19
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
20
  <!-- header end -->
21
 
22
  # Tim Dettmers' Guanaco 13B GPTQ
 
75
  ```
76
 
77
  <!-- footer start -->
78
+ <!-- 200823 -->
79
  ## Discord
80
 
81
  For further support, and discussions on these models and AI in general, join us at:
82
 
83
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
84
 
85
  ## Thanks, and how to contribute.
86
 
 
95
  * Patreon: https://patreon.com/TheBlokeAI
96
  * Ko-Fi: https://ko-fi.com/TheBlokeAI
97
 
98
+ **Special thanks to**: Aemon Algiz.
99
+
100
+ **Patreon special mentions**: Sam, theTransient, Jonathan Leane, Steven Wood, webtim, Johann-Peter Hartmann, Geoffrey Montalvo, Gabriel Tamborski, Willem Michiel, John Villwock, Derek Yates, Mesiah Bishop, Eugene Pentland, Pieter, Chadd, Stephen Murray, Daniel P. Andersen, terasurfer, Brandon Frisco, Thomas Belote, Sid, Nathan LeClaire, Magnesian, Alps Aficionado, Stanislav Ovsiannikov, Alex, Joseph William Delisle, Nikolai Manek, Michael Davis, Junyu Yang, K, J, Spencer Kim, Stefan Sabev, Olusegun Samson, transmissions 11, Michael Levine, Cory Kujawski, Rainer Wilmers, zynix, Kalila, Luke @flexchar, Ajan Kanaga, Mandus, vamX, Ai Maven, Mano Prime, Matthew Berman, subjectnull, Vitor Caleffi, Clay Pascal, biorpg, alfie_i, 阿明, Jeffrey Morgan, ya boyyy, Raymond Fosdick, knownsqashed, Olakabola, Leonard Tan, ReadyPlayerEmma, Enrico Ros, Dave, Talal Aujan, Illia Dulskyi, Sean Connelly, senxiiz, Artur Olbinski, Elle, Raven Klaugh, Fen Risland, Deep Realms, Imad Khwaja, Fred von Graf, Will Dee, usrbinkat, SuperWojo, Alexandros Triantafyllidis, Swaroop Kallakuri, Dan Guido, John Detwiler, Pedro Madruga, Iucharbius, Viktor Bowallius, Asp the Wyvern, Edmond Seymore, Trenton Dambrowitz, Space Cruiser, Spiking Neurons AB, Pyrater, LangChain4j, Tony Hughes, Kacper Wikieł, Rishabh Srivastava, David Ziegler, Luke Pendergrass, Andrey, Gabriel Puliatti, Lone Striker, Sebastain Graf, Pierre Kircher, Randy H, NimbleBox.ai, Vadim, danny, Deo Leter
101
+
102
 
103
  Thank you to all my generous patrons and donaters!
104
+
105
+ And thank you again to a16z for their generous grant.
106
+
107
  <!-- footer end -->
108
  # Original model card
109
 
110
  # Guanaco Models Based on LLaMA
111
 
112
+ | [Paper](https://arxiv.org/abs/2305.14314) | [Code](https://github.com/artidoro/qlora) | [Demo](https://huggingface.co/spaces/uwnlp/guanaco-playground-tgi) |
113
 
114
  **The Guanaco models are open-source finetuned chatbots obtained through 4-bit QLoRA tuning of LLaMA base models on the OASST1 dataset. They are available in 7B, 13B, 33B, and 65B parameter sizes.**
115
 
 
119
  - **Competitive with commercial chatbot systems on the Vicuna and OpenAssistant benchmarks** (ChatGPT and BARD) according to human and GPT-4 raters. We note that the relative performance on tasks not covered in these benchmarks could be very different. In addition, commercial systems evolve over time (we used outputs from the March 2023 version of the models).
120
  - **Available open-source for research purposes**. Guanaco models allow *cheap* and *local* experimentation with high-quality chatbot systems.
121
  - **Replicable and efficient training procedure** that can be extended to new use cases. Guanaco training scripts are available in the [QLoRA repo](https://github.com/artidoro/qlora).
122
+ - **Rigorous comparison to 16-bit methods** (both 16-bit full-finetuning and LoRA) in [our paper](https://arxiv.org/abs/2305.14314) demonstrates the effectiveness of 4-bit QLoRA finetuning.
123
  - **Lightweight** checkpoints which only contain adapter weights.
124
 
125
  ## License and Intended Use
126
+ Guanaco adapter weights are available under Apache 2 license. Note the use of the Guanaco adapter weights, requires access to the LLaMA model weighs.
127
+ Guanaco is based on LLaMA and therefore should be used according to the LLaMA license.
128
 
129
  ## Usage
130
  Here is an example of how you would load Guanaco 7B in 4-bits:
131
  ```python
132
  import torch
133
+ from peft import PeftModel
134
  from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
135
 
136
  model_name = "huggyllama/llama-7b"
 
172
  ```
173
 
174
 
175
+ ## Current Inference Limitations
176
  Currently, 4-bit inference is slow. We recommend loading in 16 bits if inference speed is a concern. We are actively working on releasing efficient 4-bit inference kernels.
177
 
178
  Below is how you would load the model in 16 bits:
 
198
 
199
  **Finetuning Data**: Guanaco is finetuned on OASST1. The exact dataset is available at [timdettmers/openassistant-guanaco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco).
200
 
201
+ **Languages**: The OASST1 dataset is multilingual (see [the paper](https://arxiv.org/abs/2304.07327) for details) and as such Guanaco responds to user queries in different languages. We note, however, that OASST1 is heavy in high-resource languages. In addition, human evaluation of Guanaco was only performed in English and based on qualitative analysis we observed degradation in performance in other languages.
202
 
203
  Next, we describe Training and Evaluation details.
204
 
205
  ### Training
206
+ Guanaco models are the result of 4-bit QLoRA supervised finetuning on the OASST1 dataset.
207
 
208
  All models use NormalFloat4 datatype for the base model and LoRA adapters on all linear layers with BFloat16 as computation datatype. We set LoRA $r=64$, $\alpha=16$. We also use Adam beta2 of 0.999, max grad norm of 0.3 and LoRA dropout of 0.1 for models up to 13B and 0.05 for 33B and 65B models.
209
+ For the finetuning process, we use constant learning rate schedule and paged AdamW optimizer.
210
 
211
  ### Training hyperparameters
212
+ Size| Dataset | Batch Size | Learning Rate | Max Steps | Sequence length
213
  ---|---|---|---|---|---
214
  7B | OASST1 | 16 | 2e-4 | 1875 | 512
215
  13B | OASST1 | 16 | 2e-4 | 1875 | 512
 
217
  65B | OASST1 | 16 | 1e-4 | 1875 | 512
218
 
219
  ### Evaluation
220
+ We test generative language capabilities through both automated and human evaluations. This second set of evaluations relies on queries curated by humans and aims at measuring the quality of model responses. We use the Vicuna and OpenAssistant datasets with 80 and 953 prompts respectively.
221
 
222
  In both human and automated evaluations, for each prompt, raters compare all pairs of responses across the models considered. For human raters we randomize the order of the systems, for GPT-4 we evaluate with both orders.
223
 
224
+
225
  Benchmark | Vicuna | | Vicuna | | OpenAssistant | | -
226
  -----------|----|-----|--------|---|---------------|---|---
227
  Prompts | 80 | | 80 | | 953 | |
228
+ Judge | Human | | GPT-4 | | GPT-4 | |
229
+ Model | Elo | Rank | Elo | Rank | Elo | Rank | **Median Rank**
230
+ GPT-4 | 1176 | 1 | 1348 | 1 | 1294 | 1 | 1
231
+ Guanaco-65B | 1023 | 2 | 1022 | 2 | 1008 | 3 | 2
232
+ Guanaco-33B | 1009 | 4 | 992 | 3 | 1002 | 4 | 4
233
+ ChatGPT-3.5 Turbo | 916 | 7 | 966 | 5 | 1015 | 2 | 5
234
+ Vicuna-13B | 984 | 5 | 974 | 4 | 936 | 5 | 5
235
+ Guanaco-13B | 975 | 6 | 913 | 6 | 885 | 6 | 6
236
+ Guanaco-7B | 1010 | 3 | 879 | 8 | 860 | 7 | 7
237
+ Bard | 909 | 8 | 902 | 7 | - | - | 8
238
 
239
 
240
  We also use the MMLU benchmark to measure performance on a range of language understanding tasks. This is a multiple-choice benchmark covering 57 tasks including elementary mathematics, US history, computer science, law, and more. We report 5-shot test accuracy.
241
 
242
+ Dataset | 7B | 13B | 33B | 65B
243
  ---|---|---|---|---
244
+ LLaMA no tuning | 35.1 | 46.9 | 57.8 | 63.4
245
+ Self-Instruct | 36.4 | 33.3 | 53.0 | 56.7
246
+ Longform | 32.1 | 43.2 | 56.6 | 59.7
247
+ Chip2 | 34.5 | 41.6 | 53.6 | 59.8
248
+ HH-RLHF | 34.9 | 44.6 | 55.8 | 60.1
249
+ Unnatural Instruct | 41.9 | 48.1 | 57.3 | 61.3
250
+ OASST1 (Guanaco) | 36.6 | 46.4 | 57.0 | 62.2
251
+ Alpaca | 38.8 | 47.8 | 57.3 | 62.5
252
+ FLAN v2 | 44.5 | 51.4 | 59.2 | 63.9
253
 
254
  ## Risks and Biases
255
  The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. The model was trained on various public datasets; it is possible that this model could generate lewd, biased, or otherwise offensive outputs.
config.json CHANGED
@@ -20,5 +20,15 @@
20
  "torch_dtype": "float16",
21
  "transformers_version": "4.29.2",
22
  "use_cache": true,
23
- "vocab_size": 32000
24
- }
 
 
 
 
 
 
 
 
 
 
 
20
  "torch_dtype": "float16",
21
  "transformers_version": "4.29.2",
22
  "use_cache": true,
23
+ "vocab_size": 32000,
24
+ "quantization_config": {
25
+ "bits": 4,
26
+ "group_size": 128,
27
+ "damp_percent": 0.01,
28
+ "desc_act": false,
29
+ "sym": true,
30
+ "true_sequential": true,
31
+ "model_file_base_name": "model",
32
+ "quant_method": "gptq"
33
+ }
34
+ }
Guanaco-13B-GPTQ-4bit-128g.no-act-order.safetensors → model.safetensors RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:195f72d6bc787effa39870cfd782a1fa8ff59c68c63d328bf78c27e4fc0d77eb
3
- size 7454797160
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d655095d1de43eafa0cec53355cfb820a52a95ce7744f260bb5786481de9606
3
+ size 7454797216
quantize_config.json CHANGED
@@ -4,5 +4,6 @@
4
  "damp_percent": 0.01,
5
  "desc_act": false,
6
  "sym": true,
7
- "true_sequential": true
 
8
  }
 
4
  "damp_percent": 0.01,
5
  "desc_act": false,
6
  "sym": true,
7
+ "true_sequential": true,
8
+ "model_file_base_name": "model"
9
  }