TheBloke commited on
Commit
2688b2b
1 Parent(s): 8a9c2aa

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +259 -0
README.md ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ language:
4
+ - en
5
+ license: other
6
+ model_creator: Gryphe
7
+ model_link: https://huggingface.co/Gryphe/MythoLogic-L2-13b
8
+ model_name: Mythologic 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
+ # Mythologic L2 13B - GPTQ
28
+ - Model creator: [Gryphe](https://huggingface.co/Gryphe)
29
+ - Original model: [Mythologic L2 13B](https://huggingface.co/Gryphe/MythoLogic-L2-13b)
30
+
31
+ ## Description
32
+
33
+ This repo contains GPTQ model files for [Gryphe's Mythologic L2 13B](https://huggingface.co/Gryphe/MythoLogic-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/MythoLogic-L2-13B-GPTQ)
40
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/MythoLogic-L2-13B-GGML)
41
+ * [Gryphe's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Gryphe/MythoLogic-L2-13b)
42
+
43
+ ## Prompt template: Alpaca
44
+
45
+ ```
46
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
47
+
48
+ ### Instruction:
49
+ {prompt}
50
+
51
+ ### Response:
52
+ ```
53
+
54
+ ## Provided files and GPTQ parameters
55
+
56
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
57
+
58
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
59
+
60
+ All GPTQ files are made with AutoGPTQ.
61
+
62
+ <details>
63
+ <summary>Explanation of GPTQ parameters</summary>
64
+
65
+ - Bits: The bit size of the quantised model.
66
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
67
+ - 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.
68
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
69
+ - 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).
70
+ - 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.
71
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
72
+
73
+ </details>
74
+
75
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
76
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
77
+ | [main](https://huggingface.co/TheBloke/MythoLogic-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. |
78
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/MythoLogic-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. |
79
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/MythoLogic-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. |
80
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/MythoLogic-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. |
81
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/MythoLogic-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. |
82
+ | [gptq-8bit-128g-actorder_False](https://huggingface.co/TheBloke/MythoLogic-L2-13B-GPTQ/tree/gptq-8bit-128g-actorder_False) | 8 | 128 | No | 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 without Act Order to improve AutoGPTQ speed. |
83
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/MythoLogic-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. |
84
+ | [gptq-8bit-64g-actorder_True](https://huggingface.co/TheBloke/MythoLogic-L2-13B-GPTQ/tree/gptq-8bit-64g-actorder_True) | 8 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.95 GB | No | 8-bit, with group size 64g and Act Order for maximum inference quality. Poor AutoGPTQ CUDA speed. |
85
+
86
+ ## How to download from branches
87
+
88
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/MythoLogic-L2-13B-GPTQ:gptq-4bit-32g-actorder_True`
89
+ - With Git, you can clone a branch with:
90
+ ```
91
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/MythoLogic-L2-13B-GPTQ
92
+ ```
93
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
94
+
95
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
96
+
97
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
98
+
99
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
100
+
101
+ 1. Click the **Model tab**.
102
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/MythoLogic-L2-13B-GPTQ`.
103
+ - To download from a specific branch, enter for example `TheBloke/MythoLogic-L2-13B-GPTQ:gptq-4bit-32g-actorder_True`
104
+ - see Provided Files above for the list of branches for each option.
105
+ 3. Click **Download**.
106
+ 4. The model will start downloading. Once it's finished it will say "Done"
107
+ 5. In the top left, click the refresh icon next to **Model**.
108
+ 6. In the **Model** dropdown, choose the model you just downloaded: `MythoLogic-L2-13B-GPTQ`
109
+ 7. The model will automatically load, and is now ready for use!
110
+ 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.
111
+ * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
112
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
113
+
114
+ ## How to use this GPTQ model from Python code
115
+
116
+ First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) 0.3.1 or later installed:
117
+
118
+ ```
119
+ pip3 install auto-gptq
120
+ ```
121
+
122
+ If you have problems installing AutoGPTQ, please build from source instead:
123
+ ```
124
+ pip3 uninstall -y auto-gptq
125
+ git clone https://github.com/PanQiWei/AutoGPTQ
126
+ cd AutoGPTQ
127
+ pip3 install .
128
+ ```
129
+
130
+ Then try the following example code:
131
+
132
+ ```python
133
+ from transformers import AutoTokenizer, pipeline, logging
134
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
135
+
136
+ model_name_or_path = "TheBloke/MythoLogic-L2-13B-GPTQ"
137
+
138
+ use_triton = False
139
+
140
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
141
+
142
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
143
+ use_safetensors=True,
144
+ trust_remote_code=False,
145
+ device="cuda:0",
146
+ use_triton=use_triton,
147
+ quantize_config=None)
148
+
149
+ """
150
+ # To download from a specific branch, use the revision parameter, as in this example:
151
+ # Note that `revision` requires AutoGPTQ 0.3.1 or later!
152
+
153
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
154
+ revision="gptq-4bit-32g-actorder_True",
155
+ use_safetensors=True,
156
+ trust_remote_code=False,
157
+ device="cuda:0",
158
+ quantize_config=None)
159
+ """
160
+
161
+ prompt = "Tell me about AI"
162
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
163
+
164
+ ### Instruction:
165
+ {prompt}
166
+
167
+ ### Response:
168
+ '''
169
+
170
+ print("\n\n*** Generate:")
171
+
172
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
173
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
174
+ print(tokenizer.decode(output[0]))
175
+
176
+ # Inference can also be done using transformers' pipeline
177
+
178
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
179
+ logging.set_verbosity(logging.CRITICAL)
180
+
181
+ print("*** Pipeline:")
182
+ pipe = pipeline(
183
+ "text-generation",
184
+ model=model,
185
+ tokenizer=tokenizer,
186
+ max_new_tokens=512,
187
+ temperature=0.7,
188
+ top_p=0.95,
189
+ repetition_penalty=1.15
190
+ )
191
+
192
+ print(pipe(prompt_template)[0]['generated_text'])
193
+ ```
194
+
195
+ ## Compatibility
196
+
197
+ 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.
198
+
199
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
200
+
201
+ <!-- footer start -->
202
+ ## Discord
203
+
204
+ For further support, and discussions on these models and AI in general, join us at:
205
+
206
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
207
+
208
+ ## Thanks, and how to contribute.
209
+
210
+ Thanks to the [chirper.ai](https://chirper.ai) team!
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
217
+
218
+ * Patreon: https://patreon.com/TheBlokeAI
219
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
220
+
221
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
222
+
223
+ **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
224
+
225
+
226
+ Thank you to all my generous patrons and donaters!
227
+
228
+ <!-- footer end -->
229
+
230
+ # Original model card: Gryphe's Mythologic L2 13B
231
+
232
+ The Llama 2 sequel to my [original experiment](https://huggingface.co/Gryphe/MythoLogic-13b) with gradient merges using [the following script](https://github.com/Gryphe/BlockMerge_Gradient). Its three models ([Hermes](https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b), [Chronos](https://huggingface.co/elinas/chronos-13b-v2) and [Airoboros](https://huggingface.co/jondurbin/airoboros-l2-13b-gpt4-2.0)) are almost evenly divided over the layer structure this time. Airoboros was the "wildcard model" due to its superior ability to understand complex instructions.
233
+
234
+ Quantized models are available from TheBloke: [GGML](https://huggingface.co/TheBloke/MythoLogic-L2-13B-GGML) - [GPTQ](https://huggingface.co/TheBloke/MythoLogic-L2-13B-GPTQ) (You're the best!)
235
+
236
+ ## Model details
237
+
238
+ As before, the main objective was to create an all-round model with improved roleplaying capabilities. MythoLogic-L2 differs from its predecessor in that it focuses primarily on the understanding of instructions and personalities of complex character cards.
239
+
240
+ Illustrated below are the gradients used for this specific L2 recipe, with the top of the image representing layer 0 and the bottom layer 40.
241
+
242
+ ![](MythoLogic-L2.png)
243
+
244
+ ## Prompt Format
245
+
246
+ This model primarily uses (and was heavily tested with) Alpaca formatting, so for optimal model performance, use:
247
+ ```
248
+ <System prompt/Character Card>
249
+
250
+ ### Instruction:
251
+ Your instruction or question here.
252
+ 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.
253
+
254
+ ### Response:
255
+ ```
256
+
257
+ ---
258
+ license: other
259
+ ---