TheBloke commited on
Commit
3f062c9
1 Parent(s): f5ffc96

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +204 -0
README.md ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ language:
4
+ - en
5
+ license: other
6
+ model_type: llama
7
+ pipeline_tag: text-classification
8
+ tags:
9
+ - llama-2
10
+ ---
11
+
12
+ <!-- header start -->
13
+ <div style="width: 100%;">
14
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
15
+ </div>
16
+ <div style="display: flex; justify-content: space-between; width: 100%;">
17
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
18
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
19
+ </div>
20
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
21
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
22
+ </div>
23
+ </div>
24
+ <!-- header end -->
25
+
26
+ # Mikael10's Llama2 70b Guanaco QLoRA GPTQ
27
+
28
+ These files are GPTQ model files for [Mikael10's Llama2 70b Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora).
29
+
30
+ 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.
31
+
32
+
33
+ ## Repositories available
34
+
35
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-GPTQ)
36
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-GGML)
37
+ * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora)
38
+
39
+ ## Prompt template: Guanaco
40
+
41
+ ```
42
+ ### Human: {prompt}
43
+ ### Assistant:
44
+ ```
45
+
46
+ ## Provided files
47
+
48
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
49
+
50
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
51
+
52
+ | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
53
+ | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
54
+ | main | 4 | 128 | False | 36.65 GB | True | AutoGPTQ | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
55
+ | gptq-4bit-32g-actorder_True | 4 | 32 | True | 40.66 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 32g gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
56
+ | gptq-4bit-64g-actorder_True | 4 | 64 | True | 37.99 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 64g uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
57
+ | gptq-4bit-128g-actorder_True | 4 | 128 | True | 36.65 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 128g uses even less VRAM, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
58
+ | gptq-3bit--1g-actorder_True | 3 | None | True | Processing, coming soon | False | AutoGPTQ | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
59
+ | gptq-3bit-128g-actorder_False | 3 | 128 | False | Processing, coming soon | False | AutoGPTQ | 3-bit, with group size 128g but no act-order. Slightly higher VRAM requirements than 3-bit None. |
60
+ | gptq-3bit-128g-actorder_True | 3 | 128 | True | Processing, coming soon | False | AutoGPTQ | 3-bit, with group size 128g and act-order. Higher quality than 128g-False but poor AutoGPTQ CUDA speed. |
61
+ | gptq-3bit-64g-actorder_True | 3 | 64 | True | Processing, coming soon | False | AutoGPTQ | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. Poor AutoGPTQ CUDA speed. |
62
+
63
+ ## How to download from branches
64
+
65
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/llama-2-70b-Guanaco-QLoRA-GPTQ:gptq-4bit-32g-actorder_True`
66
+ - With Git, you can clone a branch with:
67
+ ```
68
+ git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-GPTQ`
69
+ ```
70
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
71
+
72
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
73
+
74
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
75
+
76
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
77
+
78
+ 1. Click the **Model tab**.
79
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/llama-2-70b-Guanaco-QLoRA-GPTQ`.
80
+ - To download from a specific branch, enter for example `TheBloke/llama-2-70b-Guanaco-QLoRA-GPTQ:gptq-4bit-32g-actorder_True`
81
+ - see Provided Files above for the list of branches for each option.
82
+ 3. Click **Download**.
83
+ 4. The model will start downloading. Once it's finished it will say "Done"
84
+ 5. In the top left, click the refresh icon next to **Model**.
85
+ 6. In the **Model** dropdown, choose the model you just downloaded: `llama-2-70b-Guanaco-QLoRA-GPTQ`
86
+ 7. The model will automatically load, and is now ready for use!
87
+ 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.
88
+ * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
89
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
90
+
91
+ ## How to use this GPTQ model from Python code
92
+
93
+ First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
94
+
95
+ `GITHUB_ACTIONS=true pip install auto-gptq`
96
+
97
+ Then try the following example code:
98
+
99
+ ```python
100
+ from transformers import AutoTokenizer, pipeline, logging
101
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
102
+
103
+ model_name_or_path = "TheBloke/llama-2-70b-Guanaco-QLoRA-GPTQ"
104
+ model_basename = "gptq_model-4bit-128g"
105
+
106
+ use_triton = False
107
+
108
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
109
+
110
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
111
+ model_basename=model_basename,
112
+ use_safetensors=True,
113
+ trust_remote_code=False,
114
+ device="cuda:0",
115
+ use_triton=use_triton,
116
+ quantize_config=None)
117
+
118
+ """
119
+ To download from a specific branch, use the revision parameter, as in this example:
120
+
121
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
122
+ revision="gptq-4bit-32g-actorder_True",
123
+ model_basename=model_basename,
124
+ use_safetensors=True,
125
+ trust_remote_code=False,
126
+ device="cuda:0",
127
+ quantize_config=None)
128
+ """
129
+
130
+ prompt = "Tell me about AI"
131
+ prompt_template=f'''### Human: {prompt}
132
+ ### Assistant:
133
+ '''
134
+
135
+ print("\n\n*** Generate:")
136
+
137
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
138
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
139
+ print(tokenizer.decode(output[0]))
140
+
141
+ # Inference can also be done using transformers' pipeline
142
+
143
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
144
+ logging.set_verbosity(logging.CRITICAL)
145
+
146
+ print("*** Pipeline:")
147
+ pipe = pipeline(
148
+ "text-generation",
149
+ model=model,
150
+ tokenizer=tokenizer,
151
+ max_new_tokens=512,
152
+ temperature=0.7,
153
+ top_p=0.95,
154
+ repetition_penalty=1.15
155
+ )
156
+
157
+ print(pipe(prompt_template)[0]['generated_text'])
158
+ ```
159
+
160
+ ## Compatibility
161
+
162
+ 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.
163
+
164
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
165
+
166
+ <!-- footer start -->
167
+ ## Discord
168
+
169
+ For further support, and discussions on these models and AI in general, join us at:
170
+
171
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
172
+
173
+ ## Thanks, and how to contribute.
174
+
175
+ Thanks to the [chirper.ai](https://chirper.ai) team!
176
+
177
+ 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.
178
+
179
+ 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.
180
+
181
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
182
+
183
+ * Patreon: https://patreon.com/TheBlokeAI
184
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
185
+
186
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
187
+
188
+ **Patreon special mentions**: Slarti, Chadd, John Detwiler, Pieter, zynix, K, Mano Prime, ReadyPlayerEmma, Ai Maven, Leonard Tan, Edmond Seymore, Joseph William Delisle, Luke @flexchar, Fred von Graf, Viktor Bowallius, Rishabh Srivastava, Nikolai Manek, Matthew Berman, Johann-Peter Hartmann, ya boyyy, Greatston Gnanesh, Femi Adebogun, Talal Aujan, Jonathan Leane, terasurfer, David Flickinger, William Sang, Ajan Kanaga, Vadim, Artur Olbinski, Raven Klaugh, Michael Levine, Oscar Rangel, Randy H, Cory Kujawski, RoA, Dave, Alex, Alexandros Triantafyllidis, Fen Risland, Eugene Pentland, vamX, Elle, Nathan LeClaire, Khalefa Al-Ahmad, Rainer Wilmers, subjectnull, Junyu Yang, Daniel P. Andersen, SuperWojo, LangChain4j, Mandus, Kalila, Illia Dulskyi, Trenton Dambrowitz, Asp the Wyvern, Derek Yates, Jeffrey Morgan, Deep Realms, Imad Khwaja, Pyrater, Preetika Verma, biorpg, Gabriel Tamborski, Stephen Murray, Spiking Neurons AB, Iucharbius, Chris Smitley, Willem Michiel, Luke Pendergrass, Sebastain Graf, senxiiz, Will Dee, Space Cruiser, Karl Bernard, Clay Pascal, Lone Striker, transmissions 11, webtim, WelcomeToTheClub, Sam, theTransient, Pierre Kircher, chris gileta, John Villwock, Sean Connelly, Willian Hasse
189
+
190
+
191
+ Thank you to all my generous patrons and donaters!
192
+
193
+ <!-- footer end -->
194
+
195
+ # Original model card: Mikael10's Llama2 70b Guanaco QLoRA
196
+
197
+ This is a Llama-2 version of [Guanaco](https://huggingface.co/timdettmers/guanaco-65b). It was finetuned from the base [Llama-70b](https://huggingface.co/meta-llama/Llama-2-70b-hf) model using the official training scripts found in the [QLoRA repo](https://github.com/artidoro/qlora). I wanted it to be as faithful as possible and therefore changed nothing in the training script beyond the model it was pointing to. The model prompt is therefore also the same as the original Guanaco model.
198
+
199
+ This repo contains the QLoRA adapter.
200
+
201
+ A 7b version of the adapter can be found [here](https://huggingface.co/Mikael110/llama-2-7b-guanaco-qlora).
202
+ A 13b version of the adapter can be found [here](https://huggingface.co/Mikael110/llama-2-13b-guanaco-qlora).
203
+
204
+ **Legal Disclaimer: This model is bound by the usage restrictions of the original Llama-2 model. And comes with no warranty or gurantees of any kind.**