TheBloke commited on
Commit
951defa
1 Parent(s): e25d0ef

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 13B Guanaco QLoRA GPTQ
27
+
28
+ These files are GPTQ model files for [Mikael10's Llama2 13B Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-13b-guanaco-fp16).
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
+ Many thanks to William Beauchamp from [Chai](https://chai-research.com/) for providing the hardware used to make and upload these files!
33
+
34
+ ## Repositories available
35
+
36
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/llama-2-13B-Guanaco-QLoRA-GPTQ)
37
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/llama-2-13B-Guanaco-QLoRA-GGML)
38
+ * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Mikael110/llama-2-13b-guanaco-fp16)
39
+
40
+ ## Prompt template: Guanaco
41
+
42
+ ```
43
+ ### Human: {prompt}
44
+ ### Assistant:
45
+ ```
46
+
47
+ ## Provided files
48
+
49
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
50
+
51
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
52
+
53
+ | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
54
+ | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
55
+ | main | 4 | 128 | False | 7.26 GB | True | AutoGPTQ | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
56
+ | gptq-4bit-32g-actorder_True | 4 | 32 | True | 8.00 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. |
57
+ | gptq-4bit-64g-actorder_True | 4 | 64 | True | 7.51 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. |
58
+ | gptq-4bit-128g-actorder_True | 4 | 128 | True | 7.26 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. |
59
+ | gptq-8bit--1g-actorder_True | 8 | None | True | 13.36 GB | False | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
60
+ | gptq-8bit-128g-actorder_False | 8 | 128 | False | 13.65 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
61
+ | gptq-8bit-128g-actorder_True | 8 | 128 | True | 13.65 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. |
62
+ | gptq-8bit-64g-actorder_True | 8 | 64 | True | 13.95 GB | False | AutoGPTQ | 8-bit, with group size 64g and Act Order for maximum inference quality. Poor AutoGPTQ CUDA speed. |
63
+
64
+ ## How to download from branches
65
+
66
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/llama-2-13B-Guanaco-QLoRA-GPTQ:gptq-4bit-32g-actorder_True`
67
+ - With Git, you can clone a branch with:
68
+ ```
69
+ git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/llama-2-13B-Guanaco-QLoRA-GPTQ`
70
+ ```
71
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
72
+
73
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
74
+
75
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
76
+
77
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
78
+
79
+ 1. Click the **Model tab**.
80
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/llama-2-13B-Guanaco-QLoRA-GPTQ`.
81
+ - To download from a specific branch, enter for example `TheBloke/llama-2-13B-Guanaco-QLoRA-GPTQ:gptq-4bit-32g-actorder_True`
82
+ - see Provided Files above for the list of branches for each option.
83
+ 3. Click **Download**.
84
+ 4. The model will start downloading. Once it's finished it will say "Done"
85
+ 5. In the top left, click the refresh icon next to **Model**.
86
+ 6. In the **Model** dropdown, choose the model you just downloaded: `llama-2-13B-Guanaco-QLoRA-GPTQ`
87
+ 7. The model will automatically load, and is now ready for use!
88
+ 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.
89
+ * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
90
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
91
+
92
+ ## How to use this GPTQ model from Python code
93
+
94
+ First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
95
+
96
+ `GITHUB_ACTIONS=true pip install auto-gptq`
97
+
98
+ Then try the following example code:
99
+
100
+ ```python
101
+ from transformers import AutoTokenizer, pipeline, logging
102
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
103
+
104
+ model_name_or_path = "TheBloke/llama-2-13B-Guanaco-QLoRA-GPTQ"
105
+ model_basename = "gptq_model-4bit-128g"
106
+
107
+ use_triton = False
108
+
109
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
110
+
111
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
112
+ model_basename=model_basename,
113
+ use_safetensors=True,
114
+ trust_remote_code=False,
115
+ device="cuda:0",
116
+ use_triton=use_triton,
117
+ quantize_config=None)
118
+
119
+ """
120
+ To download from a specific branch, use the revision parameter, as in this example:
121
+
122
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
123
+ revision="gptq-4bit-32g-actorder_True",
124
+ model_basename=model_basename,
125
+ use_safetensors=True,
126
+ trust_remote_code=False,
127
+ device="cuda:0",
128
+ quantize_config=None)
129
+ """
130
+
131
+ prompt = "Tell me about AI"
132
+ prompt_template=f'''### Human: {prompt}
133
+ ### Assistant:
134
+ '''
135
+
136
+ print("\n\n*** Generate:")
137
+
138
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
139
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
140
+ print(tokenizer.decode(output[0]))
141
+
142
+ # Inference can also be done using transformers' pipeline
143
+
144
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
145
+ logging.set_verbosity(logging.CRITICAL)
146
+
147
+ print("*** Pipeline:")
148
+ pipe = pipeline(
149
+ "text-generation",
150
+ model=model,
151
+ tokenizer=tokenizer,
152
+ max_new_tokens=512,
153
+ temperature=0.7,
154
+ top_p=0.95,
155
+ repetition_penalty=1.15
156
+ )
157
+
158
+ print(pipe(prompt_template)[0]['generated_text'])
159
+ ```
160
+
161
+ ## Compatibility
162
+
163
+ 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.
164
+
165
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
166
+
167
+ <!-- footer start -->
168
+ ## Discord
169
+
170
+ For further support, and discussions on these models and AI in general, join us at:
171
+
172
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
173
+
174
+ ## Thanks, and how to contribute.
175
+
176
+ Thanks to the [chirper.ai](https://chirper.ai) team!
177
+
178
+ 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.
179
+
180
+ 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.
181
+
182
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
183
+
184
+ * Patreon: https://patreon.com/TheBlokeAI
185
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
186
+
187
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
188
+
189
+ **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
190
+
191
+
192
+ Thank you to all my generous patrons and donaters!
193
+
194
+ <!-- footer end -->
195
+
196
+ # Original model card: Mikael10's Llama2 13B Guanaco QLoRA
197
+
198
+ This is a Llama-2 version of [Guanaco](https://huggingface.co/timdettmers/guanaco-13b). It was finetuned from the base [Llama-13b](https://huggingface.co/meta-llama/Llama-2-13b-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.
199
+
200
+ This repo contains the merged f16 model. The QLoRA adaptor can be found [here](https://huggingface.co/Mikael110/llama-2-13b-guanaco-qlora).
201
+
202
+ A 7b version of the model can be found [here](https://huggingface.co/Mikael110/llama-2-7b-guanaco-fp16).
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.**