TheBloke commited on
Commit
7e2f47a
·
1 Parent(s): f45b16a

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +291 -0
README.md ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - Open-Orca/OpenOrca
4
+ - anon8231489123/ShareGPT_Vicuna_unfiltered
5
+ - jondurbin/airoboros-uncensored
6
+ inference: false
7
+ language:
8
+ - en
9
+ license: other
10
+ metrics:
11
+ - accuracy
12
+ model_type: llama
13
+ pipeline_tag: text-generation
14
+ tags:
15
+ - llama
16
+ - alpaca
17
+ - vicuna
18
+ - uncensored
19
+ - merge
20
+ - mix
21
+ - airoboros
22
+ - openorca
23
+ - orcamini
24
+ - orca
25
+ - instruct
26
+ - mixtune
27
+ ---
28
+
29
+ <!-- header start -->
30
+ <div style="width: 100%;">
31
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
32
+ </div>
33
+ <div style="display: flex; justify-content: space-between; width: 100%;">
34
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
35
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
36
+ </div>
37
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
38
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
39
+ </div>
40
+ </div>
41
+ <!-- header end -->
42
+
43
+ # CalderaAI's 13B Ouroboros GPTQ
44
+
45
+ These files are GPTQ model files for [CalderaAI's 13B Ouroboros](https://huggingface.co/CalderaAI/13B-Ouroboros).
46
+
47
+ 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.
48
+
49
+
50
+ ## Repositories available
51
+
52
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/13B-Ouroboros-GPTQ)
53
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/13B-Ouroboros-GGML)
54
+ * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/CalderaAI/13B-Ouroboros)
55
+
56
+ ## Prompt template: Alpaca
57
+
58
+ ```
59
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
60
+
61
+ ### Instruction: {prompt}
62
+
63
+ ### Response:
64
+ ```
65
+
66
+ ## Provided files
67
+
68
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
69
+
70
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
71
+
72
+ | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
73
+ | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
74
+ | 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. |
75
+ | 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. |
76
+ | 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. |
77
+ | 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. |
78
+ | gptq-8bit-128g-actorder_True | 8 | 128 | True | Processing, coming soon | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. |
79
+ | gptq-8bit-64g-actorder_True | 8 | 64 | True | Processing, coming soon | False | AutoGPTQ | 8-bit, with group size 64g and Act Order for maximum inference quality. Poor AutoGPTQ CUDA speed. |
80
+ | gptq-8bit-128g-actorder_False | 8 | 128 | False | Processing, coming soon | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
81
+ | gptq-8bit--1g-actorder_True | 8 | None | True | Processing, coming soon | False | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
82
+
83
+ ## How to download from branches
84
+
85
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/13B-Ouroboros-GPTQ:gptq-4bit-32g-actorder_True`
86
+ - With Git, you can clone a branch with:
87
+ ```
88
+ git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/13B-Ouroboros-GPTQ`
89
+ ```
90
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
91
+
92
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
93
+
94
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
95
+
96
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
97
+
98
+ 1. Click the **Model tab**.
99
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/13B-Ouroboros-GPTQ`.
100
+ - To download from a specific branch, enter for example `TheBloke/13B-Ouroboros-GPTQ:gptq-4bit-32g-actorder_True`
101
+ - see Provided Files above for the list of branches for each option.
102
+ 3. Click **Download**.
103
+ 4. The model will start downloading. Once it's finished it will say "Done"
104
+ 5. In the top left, click the refresh icon next to **Model**.
105
+ 6. In the **Model** dropdown, choose the model you just downloaded: `13B-Ouroboros-GPTQ`
106
+ 7. The model will automatically load, and is now ready for use!
107
+ 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.
108
+ * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
109
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
110
+
111
+ ## How to use this GPTQ model from Python code
112
+
113
+ First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
114
+
115
+ `GITHUB_ACTIONS=true pip install auto-gptq`
116
+
117
+ Then try the following example code:
118
+
119
+ ```python
120
+ from transformers import AutoTokenizer, pipeline, logging
121
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
122
+
123
+ model_name_or_path = "TheBloke/13B-Ouroboros-GPTQ"
124
+ model_basename = "gptq_model-4bit-128g"
125
+
126
+ use_triton = False
127
+
128
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
129
+
130
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
131
+ model_basename=model_basename,
132
+ use_safetensors=True,
133
+ trust_remote_code=True,
134
+ device="cuda:0",
135
+ use_triton=use_triton,
136
+ quantize_config=None)
137
+
138
+ """
139
+ To download from a specific branch, use the revision parameter, as in this example:
140
+
141
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
142
+ revision="gptq-4bit-32g-actorder_True",
143
+ model_basename=model_basename,
144
+ use_safetensors=True,
145
+ trust_remote_code=True,
146
+ device="cuda:0",
147
+ quantize_config=None)
148
+ """
149
+
150
+ prompt = "Tell me about AI"
151
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
152
+
153
+ ### Instruction: {prompt}
154
+
155
+ ### Response:
156
+ '''
157
+
158
+ print("\n\n*** Generate:")
159
+
160
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
161
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
162
+ print(tokenizer.decode(output[0]))
163
+
164
+ # Inference can also be done using transformers' pipeline
165
+
166
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
167
+ logging.set_verbosity(logging.CRITICAL)
168
+
169
+ print("*** Pipeline:")
170
+ pipe = pipeline(
171
+ "text-generation",
172
+ model=model,
173
+ tokenizer=tokenizer,
174
+ max_new_tokens=512,
175
+ temperature=0.7,
176
+ top_p=0.95,
177
+ repetition_penalty=1.15
178
+ )
179
+
180
+ print(pipe(prompt_template)[0]['generated_text'])
181
+ ```
182
+
183
+ ## Compatibility
184
+
185
+ 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.
186
+
187
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
188
+
189
+ <!-- footer start -->
190
+ ## Discord
191
+
192
+ For further support, and discussions on these models and AI in general, join us at:
193
+
194
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
195
+
196
+ ## Thanks, and how to contribute.
197
+
198
+ Thanks to the [chirper.ai](https://chirper.ai) team!
199
+
200
+ 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.
201
+
202
+ 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.
203
+
204
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
205
+
206
+ * Patreon: https://patreon.com/TheBlokeAI
207
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
208
+
209
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
210
+
211
+ **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
212
+
213
+
214
+ Thank you to all my generous patrons and donaters!
215
+
216
+ <!-- footer end -->
217
+
218
+ # Original model card: CalderaAI's 13B Ouroboros
219
+
220
+
221
+ ## 13B-Ouroboros
222
+ Ouroboros is an experimental model based on Meta's LLaMA [v1] 13B base model using a custom merging technique, tweaking
223
+ each layer's merge % based on internal tests against the PTB dataset, scoring ~26.31 according to internal evaluation
224
+ (6 samples, sequence length 1024; this testing is not empirical, it's a quick way to find near-optimum values). Testing,
225
+ evaluating, and remixing this model is absolutely permissible and even encouraged (within the bounds of Meta's LLaMAv1
226
+ license agreement); the more feedback the better we can tune our process! 😊
227
+
228
+ ## Composition:
229
+ Ouroboros is comprised of 40 layers [LLaMAv1 13B standard] mixed at optimized
230
+ ratios VS the PTB dataset for lowest perplexity score. Listed below are the
231
+ paired models and ratios merged per layer.
232
+
233
+ Tier One Merge:
234
+
235
+ 13B-airoboros-gpt4-1.4 > 13B-orca_mini_v2
236
+
237
+ [0.22, 0.85, 0.89, 0.98, 0.3, 0.41, 0.71, 0.83, 0.32, 0.1, 0.44, 0.6, 0.53, 0.15, 0.86, 0.79, 0.93, 0.02, 0.19, 0.82, 0.01, 0.52, 0.07, 0.27, 0.73, 0.86, 0.08, 0.67, 0.42, 0.28, 0.37, 0.08, 0.95, 0.68, 0.45, 0.08, 0.7, 0.93, 0.96, 0.43]
238
+
239
+ 13B-gpt4-x-alpaca > 13B-Vicuna-cocktail
240
+
241
+ [0.65, 0.94, 0.98, 0.87, 0.28, 0.64, 0.73, 0.7, 0.95, 0.89, 0.84, 0.9, 0.59, 0.92, 0.28, 0.61, 0.88, 0.73, 0.34, 0.85, 0.98, 0.05, 0.74, 0.92, 0.5, 0.78, 0.26, 0.4, 0.27, 0.65, 0.71, 0.7, 0.8, 0.93, 0.36, 0.03, 0.45, 0.39, 0.77, 0.06]
242
+
243
+ Tier Two Merge:
244
+
245
+ [13B-airoboros-gpt4-1.4 + 13B-orca_mini_v2] offspring > [13B-gpt4-x-alpaca + 13B-Vicuna-cocktail] offspring
246
+
247
+ [0.2, 0.83, 0.24, 0.03, 0.37, 0.62, 0.02, 0.82, 0.65, 0.63, 0.45, 0.65, 0.48, 0.45, 0.24, 0.76, 0.06, 0.31, 0.45, 0.86, 0.23, 0.99, 0.93, 0.84, 0.96, 0.53, 0.95, 0.32, 0.19, 0.06, 0.4, 0.08, 0.62, 0.4, 0.26, 0.12, 0.16, 0.91, 0.14, 0.0]
248
+
249
+ Result:
250
+
251
+ 13B-Ouroboros, a model that seems uncensored and highly competent. So far only Alpaca instruction promting has been tested and seems to work solidly well.
252
+
253
+ ## Use:
254
+
255
+ Alpaca's instruct format can be used to do many things, including control of the terms of behavior
256
+ between a user and a response from an agent in chat. Below is an example of a command injected into
257
+ memory.
258
+
259
+ ```
260
+ ### Instruction:
261
+ Make Narrator function as a text based adventure game that responds with verbose, detailed, and creative descriptions of what happens next after Player's response.
262
+ Make Player function as the player input for Narrator's text based adventure game, controlling a character named (insert character name here, their short bio, and
263
+ whatever quest or other information to keep consistent in the interaction).
264
+
265
+ ### Response:
266
+ {an empty new line here}
267
+ ```
268
+
269
+ ## Language Models Used Credits:
270
+
271
+ 13B-airoboros-gpt4-1.4 by jondurbin
272
+
273
+ https://huggingface.co/jondurbin/airoboros-13b-gpt4-1.4
274
+
275
+ 13B-orca_mini_v2 by psmathur
276
+
277
+ https://huggingface.co/psmathur/orca_mini_v2_13b
278
+
279
+ 13B-gpt4-x-alpaca by chavinlo
280
+
281
+ https://huggingface.co/chavinlo/gpt4-x-alpaca
282
+
283
+ 13B-Vicuna-cocktail by reeducator
284
+
285
+ https://huggingface.co/reeducator/vicuna-13b-cocktail
286
+
287
+ Also thanks to Meta for LLaMA.
288
+
289
+ Each model and LoRA was hand picked and considered for what it could contribute to this ensemble.
290
+ Thanks to each and every one of you for your incredible work developing some of the best things
291
+ to come out of this community.