TheBloke commited on
Commit
8182f7f
1 Parent(s): a21e87f

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +239 -0
README.md ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ license: llama2
4
+ model_creator: MayaPH
5
+ model_link: https://huggingface.co/MayaPH/GodziLLa2-70B
6
+ model_name: GodziLLa2 70B
7
+ model_type: llama
8
+ pipeline_tag: text-generation
9
+ quantized_by: TheBloke
10
+ tags:
11
+ - merge
12
+ - mix
13
+ - cot
14
+ ---
15
+
16
+ <!-- header start -->
17
+ <div style="width: 100%;">
18
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
19
+ </div>
20
+ <div style="display: flex; justify-content: space-between; width: 100%;">
21
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
22
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
23
+ </div>
24
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
25
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
26
+ </div>
27
+ </div>
28
+ <!-- header end -->
29
+
30
+ # GodziLLa2 70B - GPTQ
31
+ - Model creator: [MayaPH](https://huggingface.co/mayaph)
32
+ - Original model: [GodziLLa2 70B](https://huggingface.co/MayaPH/GodziLLa2-70B)
33
+
34
+ ## Description
35
+
36
+ This repo contains GPTQ model files for [MayaPH's GodziLLa2 70B](https://huggingface.co/MayaPH/GodziLLa2-70B).
37
+
38
+ Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
39
+
40
+ ## Repositories available
41
+
42
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/GodziLLa2-70B-GPTQ)
43
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/GodziLLa2-70B-GGML)
44
+ * [MayaPH's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/MayaPH/GodziLLa2-70B)
45
+
46
+ ## Prompt template: Alpaca
47
+
48
+ ```
49
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
50
+
51
+ ### Instruction:
52
+ {prompt}
53
+
54
+ ### Response:
55
+ ```
56
+
57
+ ## Provided files and GPTQ parameters
58
+
59
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
60
+
61
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
62
+
63
+ All GPTQ files are made with AutoGPTQ.
64
+
65
+ <details>
66
+ <summary>Explanation of GPTQ parameters</summary>
67
+
68
+ - Bits: The bit size of the quantised model.
69
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
70
+ - Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have issues with models that use Act Order plus Group Size.
71
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
72
+ - GPTQ dataset: The dataset used for quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
73
+ - Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
74
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
75
+
76
+ </details>
77
+
78
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
79
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
80
+ | [main](https://huggingface.co/TheBloke/GodziLLa2-70B-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 35.33 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
81
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/GodziLLa2-70B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 40.66 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
82
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/GodziLLa2-70B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 37.99 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
83
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/GodziLLa2-70B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 36.65 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
84
+ | [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/GodziLLa2-70B-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 26.77 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
85
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/GodziLLa2-70B-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 28.03 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False but poor AutoGPTQ CUDA speed. |
86
+
87
+ ## How to download from branches
88
+
89
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/GodziLLa2-70B-GPTQ:gptq-4bit-32g-actorder_True`
90
+ - With Git, you can clone a branch with:
91
+ ```
92
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/GodziLLa2-70B-GPTQ
93
+ ```
94
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
95
+
96
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
97
+
98
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
99
+
100
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
101
+
102
+ 1. Click the **Model tab**.
103
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/GodziLLa2-70B-GPTQ`.
104
+ - To download from a specific branch, enter for example `TheBloke/GodziLLa2-70B-GPTQ:gptq-4bit-32g-actorder_True`
105
+ - see Provided Files above for the list of branches for each option.
106
+ 3. Click **Download**.
107
+ 4. The model will start downloading. Once it's finished it will say "Done"
108
+ 5. In the top left, click the refresh icon next to **Model**.
109
+ 6. In the **Model** dropdown, choose the model you just downloaded: `GodziLLa2-70B-GPTQ`
110
+ 7. The model will automatically load, and is now ready for use!
111
+ 8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
112
+ * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
113
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
114
+
115
+ ## How to use this GPTQ model from Python code
116
+
117
+ First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) 0.3.1 or later installed:
118
+
119
+ ```
120
+ pip3 install auto-gptq
121
+ ```
122
+
123
+ If you have problems installing AutoGPTQ, please build from source instead:
124
+ ```
125
+ pip3 uninstall -y auto-gptq
126
+ git clone https://github.com/PanQiWei/AutoGPTQ
127
+ cd AutoGPTQ
128
+ pip3 install .
129
+ ```
130
+
131
+ Then try the following example code:
132
+
133
+ ```python
134
+ from transformers import AutoTokenizer, pipeline, logging
135
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
136
+
137
+ model_name_or_path = "TheBloke/GodziLLa2-70B-GPTQ"
138
+
139
+ use_triton = False
140
+
141
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
142
+
143
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
144
+ use_safetensors=True,
145
+ trust_remote_code=False,
146
+ device="cuda:0",
147
+ use_triton=use_triton,
148
+ quantize_config=None)
149
+
150
+ """
151
+ # To download from a specific branch, use the revision parameter, as in this example:
152
+ # Note that `revision` requires AutoGPTQ 0.3.1 or later!
153
+
154
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
155
+ revision="gptq-4bit-32g-actorder_True",
156
+ use_safetensors=True,
157
+ trust_remote_code=False,
158
+ device="cuda:0",
159
+ quantize_config=None)
160
+ """
161
+
162
+ prompt = "Tell me about AI"
163
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
164
+
165
+ ### Instruction:
166
+ {prompt}
167
+
168
+ ### Response:
169
+ '''
170
+
171
+ print("\n\n*** Generate:")
172
+
173
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
174
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
175
+ print(tokenizer.decode(output[0]))
176
+
177
+ # Inference can also be done using transformers' pipeline
178
+
179
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
180
+ logging.set_verbosity(logging.CRITICAL)
181
+
182
+ print("*** Pipeline:")
183
+ pipe = pipeline(
184
+ "text-generation",
185
+ model=model,
186
+ tokenizer=tokenizer,
187
+ max_new_tokens=512,
188
+ temperature=0.7,
189
+ top_p=0.95,
190
+ repetition_penalty=1.15
191
+ )
192
+
193
+ print(pipe(prompt_template)[0]['generated_text'])
194
+ ```
195
+
196
+ ## Compatibility
197
+
198
+ The files provided will work with AutoGPTQ (CUDA and Triton modes), GPTQ-for-LLaMa (only CUDA has been tested), and Occ4m's GPTQ-for-LLaMa fork.
199
+
200
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
201
+
202
+ <!-- footer start -->
203
+ ## Discord
204
+
205
+ For further support, and discussions on these models and AI in general, join us at:
206
+
207
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
208
+
209
+ ## Thanks, and how to contribute.
210
+
211
+ Thanks to the [chirper.ai](https://chirper.ai) team!
212
+
213
+ 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.
214
+
215
+ 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.
216
+
217
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
218
+
219
+ * Patreon: https://patreon.com/TheBlokeAI
220
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
221
+
222
+ **Special thanks to**: Aemon Algiz.
223
+
224
+ **Patreon special mentions**: Ajan Kanaga, David Ziegler, Raymond Fosdick, SuperWojo, Sam, webtim, Steven Wood, knownsqashed, Tony Hughes, Junyu Yang, J, Olakabola, Dan Guido, Stephen Murray, John Villwock, vamX, William Sang, Sean Connelly, LangChain4j, Olusegun Samson, Fen Risland, Derek Yates, Karl Bernard, transmissions 11, Trenton Dambrowitz, Pieter, Preetika Verma, Swaroop Kallakuri, Andrey, Slarti, Jonathan Leane, Michael Levine, Kalila, Joseph William Delisle, Rishabh Srivastava, Deo Leter, Luke Pendergrass, Spencer Kim, Geoffrey Montalvo, Thomas Belote, Jeffrey Morgan, Mandus, ya boyyy, Matthew Berman, Magnesian, Ai Maven, senxiiz, Alps Aficionado, Luke @flexchar, Raven Klaugh, Imad Khwaja, Gabriel Puliatti, Johann-Peter Hartmann, usrbinkat, Spiking Neurons AB, Artur Olbinski, chris gileta, danny, Willem Michiel, WelcomeToTheClub, Deep Realms, alfie_i, Dave, Leonard Tan, NimbleBox.ai, Randy H, Daniel P. Andersen, Pyrater, Will Dee, Elle, Space Cruiser, Gabriel Tamborski, Asp the Wyvern, Illia Dulskyi, Nikolai Manek, Sid, Brandon Frisco, Nathan LeClaire, Edmond Seymore, Enrico Ros, Pedro Madruga, Eugene Pentland, John Detwiler, Mano Prime, Stanislav Ovsiannikov, Alex, Vitor Caleffi, K, biorpg, Michael Davis, Lone Striker, Pierre Kircher, theTransient, Fred von Graf, Sebastain Graf, Vadim, Iucharbius, Clay Pascal, Chadd, Mesiah Bishop, terasurfer, Rainer Wilmers, Alexandros Triantafyllidis, Stefan Sabev, Talal Aujan, Cory Kujawski, Viktor Bowallius, subjectnull, ReadyPlayerEmma, zynix
225
+
226
+
227
+ Thank you to all my generous patrons and donaters!
228
+
229
+ <!-- footer end -->
230
+
231
+ # Original model card: MayaPH's GodziLLa2 70B
232
+
233
+
234
+ <img src="https://drive.google.com/uc?export=view&id=1D8wxXkS1nsq3uqbOzOLwgx1cLJhY1nvN" alt="GodziLLa2-70B">
235
+ Released August 11, 2023
236
+
237
+ <b>Model card coming soon!</b>
238
+
239
+ GodziLLa-30B can be found [here](https://huggingface.co/MayaPH/GodziLLa-30B).