TheBloke commited on
Commit
8046c74
1 Parent(s): b983cee

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +267 -0
README.md ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ language:
4
+ - en
5
+ license: other
6
+ model_creator: Gryphe
7
+ model_link: https://huggingface.co/Gryphe/MythoMax-L2-13b
8
+ model_name: MythoMax L2 13B
9
+ model_type: llama
10
+ quantized_by: TheBloke
11
+ ---
12
+
13
+ <!-- header start -->
14
+ <div style="width: 100%;">
15
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
16
+ </div>
17
+ <div style="display: flex; justify-content: space-between; width: 100%;">
18
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
19
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
20
+ </div>
21
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
22
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
23
+ </div>
24
+ </div>
25
+ <!-- header end -->
26
+
27
+ # MythoMax L2 13B - GPTQ
28
+ - Model creator: [Gryphe](https://huggingface.co/Gryphe)
29
+ - Original model: [MythoMax L2 13B](https://huggingface.co/Gryphe/MythoMax-L2-13b)
30
+
31
+ ## Description
32
+
33
+ This repo contains GPTQ model files for [Gryphe's MythoMax L2 13B](https://huggingface.co/Gryphe/MythoMax-L2-13b).
34
+
35
+ 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.
36
+
37
+ ## Repositories available
38
+
39
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/MythoMax-L2-13B-GPTQ)
40
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/MythoMax-L2-13B-GGML)
41
+ * [Gryphe's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Gryphe/MythoMax-L2-13b)
42
+
43
+ ## Prompt template: Custom
44
+
45
+ ```
46
+ {system_message}
47
+
48
+ ### Instruction:
49
+ {prompt}
50
+ (For roleplay purposes, I suggest the following - Write <CHAR NAME>'s next reply in a chat between <YOUR NAME> and <CHAR NAME>. Write a single reply only.)
51
+
52
+ ### Response:
53
+
54
+ ```
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/MythoMax-L2-13B-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.26 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/MythoMax-L2-13B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 8.00 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/MythoMax-L2-13B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.51 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/MythoMax-L2-13B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.26 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-8bit--1g-actorder_True](https://huggingface.co/TheBloke/MythoMax-L2-13B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
85
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/MythoMax-L2-13B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. 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/MythoMax-L2-13B-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/MythoMax-L2-13B-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/MythoMax-L2-13B-GPTQ`.
104
+ - To download from a specific branch, enter for example `TheBloke/MythoMax-L2-13B-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: `MythoMax-L2-13B-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/MythoMax-L2-13B-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'''```
164
+ {system_message}
165
+
166
+ ### Instruction:
167
+ {prompt}
168
+ (For roleplay purposes, I suggest the following - Write <CHAR NAME>'s next reply in a chat between <YOUR NAME> and <CHAR NAME>. Write a single reply only.)
169
+
170
+ ### Response:
171
+
172
+ ```
173
+
174
+ '''
175
+
176
+ print("\n\n*** Generate:")
177
+
178
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
179
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
180
+ print(tokenizer.decode(output[0]))
181
+
182
+ # Inference can also be done using transformers' pipeline
183
+
184
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
185
+ logging.set_verbosity(logging.CRITICAL)
186
+
187
+ print("*** Pipeline:")
188
+ pipe = pipeline(
189
+ "text-generation",
190
+ model=model,
191
+ tokenizer=tokenizer,
192
+ max_new_tokens=512,
193
+ temperature=0.7,
194
+ top_p=0.95,
195
+ repetition_penalty=1.15
196
+ )
197
+
198
+ print(pipe(prompt_template)[0]['generated_text'])
199
+ ```
200
+
201
+ ## Compatibility
202
+
203
+ 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.
204
+
205
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
206
+
207
+ <!-- footer start -->
208
+ ## Discord
209
+
210
+ For further support, and discussions on these models and AI in general, join us at:
211
+
212
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
213
+
214
+ ## Thanks, and how to contribute.
215
+
216
+ Thanks to the [chirper.ai](https://chirper.ai) team!
217
+
218
+ 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.
219
+
220
+ 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.
221
+
222
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
223
+
224
+ * Patreon: https://patreon.com/TheBlokeAI
225
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
226
+
227
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
228
+
229
+ **Patreon special mentions**: Willem Michiel, Ajan Kanaga, Cory Kujawski, Alps Aficionado, Nikolai Manek, Jonathan Leane, Stanislav Ovsiannikov, Michael Levine, Luke Pendergrass, Sid, K, Gabriel Tamborski, Clay Pascal, Kalila, William Sang, Will Dee, Pieter, Nathan LeClaire, ya boyyy, David Flickinger, vamX, Derek Yates, Fen Risland, Jeffrey Morgan, webtim, Daniel P. Andersen, Chadd, Edmond Seymore, Pyrater, Olusegun Samson, Lone Striker, biorpg, alfie_i, Mano Prime, Chris Smitley, Dave, zynix, Trenton Dambrowitz, Johann-Peter Hartmann, Magnesian, Spencer Kim, John Detwiler, Iucharbius, Gabriel Puliatti, LangChain4j, Luke @flexchar, Vadim, Rishabh Srivastava, Preetika Verma, Ai Maven, Femi Adebogun, WelcomeToTheClub, Leonard Tan, Imad Khwaja, Steven Wood, Stefan Sabev, Sebastain Graf, usrbinkat, Dan Guido, Sam, Eugene Pentland, Mandus, transmissions 11, Slarti, Karl Bernard, Spiking Neurons AB, Artur Olbinski, Joseph William Delisle, ReadyPlayerEmma, Olakabola, Asp the Wyvern, Space Cruiser, Matthew Berman, Randy H, subjectnull, danny, John Villwock, Illia Dulskyi, Rainer Wilmers, theTransient, Pierre Kircher, Alexandros Triantafyllidis, Viktor Bowallius, terasurfer, Deep Realms, SuperWojo, senxiiz, Oscar Rangel, Alex, Stephen Murray, Talal Aujan, Raven Klaugh, Sean Connelly, Raymond Fosdick, Fred von Graf, chris gileta, Junyu Yang, Elle
230
+
231
+
232
+ Thank you to all my generous patrons and donaters!
233
+
234
+ <!-- footer end -->
235
+
236
+ # Original model card: Gryphe's MythoMax L2 13B
237
+
238
+ An improved, potentially even perfected variant of MythoMix, my [MythoLogic-L2](https://huggingface.co/Gryphe/MythoLogic-L2-13b) and [Huginn](https://huggingface.co/The-Face-Of-Goonery/Huginn-13b-FP16) merge using a highly experimental tensor type merge technique. The main difference with MythoMix is that I allowed more of Huginn to intermingle with the single tensors located at the front and end of a model, resulting in increased coherency across the entire structure.
239
+
240
+ The script and the acccompanying templates I used to produce both can [be found here](https://github.com/Gryphe/BlockMerge_Gradient/tree/main/YAML).
241
+
242
+ This model is proficient at both roleplaying and storywriting due to its unique nature.
243
+
244
+ Quantized models are available from TheBloke: [GGML](https://huggingface.co/TheBloke/MythoMax-L2-13B-GGML) - [GPTQ](https://huggingface.co/TheBloke/MythoMax-L2-13B-GPTQ) (You're the best!)
245
+
246
+ ## Model details
247
+
248
+ The idea behind this merge is that each layer is composed of several tensors, which are in turn responsible for specific functions. Using MythoLogic-L2's robust understanding as its input and Huginn's extensive writing capability as its output seems to have resulted in a model that exceeds at both, confirming my theory. (More details to be released at a later time)
249
+
250
+ This type of merge is incapable of being illustrated, as each of its 363 tensors had an unique ratio applied to it. As with my prior merges, gradients were part of these ratios to further finetune its behaviour.
251
+
252
+ ## Prompt Format
253
+
254
+ This model primarily uses Alpaca formatting, so for optimal model performance, use:
255
+ ```
256
+ <System prompt/Character Card>
257
+
258
+ ### Instruction:
259
+ Your instruction or question here.
260
+ For roleplay purposes, I suggest the following - Write <CHAR NAME>'s next reply in a chat between <YOUR NAME> and <CHAR NAME>. Write a single reply only.
261
+
262
+ ### Response:
263
+ ```
264
+
265
+ ---
266
+ license: other
267
+ ---