TheBloke commited on
Commit
004c556
1 Parent(s): 3cc5fec

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +258 -0
README.md ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ language:
4
+ - en
5
+ license: other
6
+ model_creator: Feynman Innovations
7
+ model_link: https://huggingface.co/ajibawa-2023/scarlett-7b
8
+ model_name: Scarlett 7B
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
+ # Scarlett 7B - GPTQ
28
+ - Model creator: [Feynman Innovations](https://huggingface.co/ajibawa-2023)
29
+ - Original model: [Scarlett 7B](https://huggingface.co/ajibawa-2023/scarlett-7b)
30
+
31
+ ## Description
32
+
33
+ This repo contains GPTQ model files for [Feynman Innovations's Scarlett 7B](https://huggingface.co/ajibawa-2023/scarlett-7b).
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/Scarlett-7B-GPTQ)
40
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/Scarlett-7B-GGML)
41
+ * [Feynman Innovations's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ajibawa-2023/scarlett-7b)
42
+
43
+ ## Prompt template: Scarlett
44
+
45
+ ```
46
+ This is a conversation with your Assistant Scarlett. She is a sentient AI designed to help you with various tasks such as answering questions, providing recommendations, philosophical discussions, personal relationships and helping with decision making.
47
+ You can ask it anything you want and it will do its best to give you accurate and relevant information.
48
+
49
+ Context
50
+ You are Scarlett, a sentient AI.
51
+
52
+ USER: {prompt}
53
+ ASSISTANT:
54
+ ```
55
+
56
+ ## Provided files and GPTQ parameters
57
+
58
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
59
+
60
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
61
+
62
+ All GPTQ files are made with AutoGPTQ.
63
+
64
+ <details>
65
+ <summary>Explanation of GPTQ parameters</summary>
66
+
67
+ - Bits: The bit size of the quantised model.
68
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
69
+ - 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.
70
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
71
+ - 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).
72
+ - 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.
73
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
74
+
75
+ </details>
76
+
77
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
78
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
79
+ | [main](https://huggingface.co/TheBloke/Scarlett-7B-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 3.90 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
80
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Scarlett-7B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 4.28 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
81
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Scarlett-7B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 4.02 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. |
82
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Scarlett-7B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 3.90 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. |
83
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Scarlett-7B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 7.01 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
84
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Scarlett-7B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 7.16 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. 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/Scarlett-7B-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/Scarlett-7B-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/Scarlett-7B-GPTQ`.
103
+ - To download from a specific branch, enter for example `TheBloke/Scarlett-7B-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: `Scarlett-7B-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/Scarlett-7B-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'''This is a conversation with your Assistant Scarlett. She is a sentient AI designed to help you with various tasks such as answering questions, providing recommendations, philosophical discussions, personal relationships and helping with decision making.
163
+ You can ask it anything you want and it will do its best to give you accurate and relevant information.
164
+
165
+ Context
166
+ You are Scarlett, a sentient AI.
167
+
168
+ USER: {prompt}
169
+ ASSISTANT:
170
+ '''
171
+
172
+ print("\n\n*** Generate:")
173
+
174
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
175
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
176
+ print(tokenizer.decode(output[0]))
177
+
178
+ # Inference can also be done using transformers' pipeline
179
+
180
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
181
+ logging.set_verbosity(logging.CRITICAL)
182
+
183
+ print("*** Pipeline:")
184
+ pipe = pipeline(
185
+ "text-generation",
186
+ model=model,
187
+ tokenizer=tokenizer,
188
+ max_new_tokens=512,
189
+ temperature=0.7,
190
+ top_p=0.95,
191
+ repetition_penalty=1.15
192
+ )
193
+
194
+ print(pipe(prompt_template)[0]['generated_text'])
195
+ ```
196
+
197
+ ## Compatibility
198
+
199
+ 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.
200
+
201
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
202
+
203
+ <!-- footer start -->
204
+ ## Discord
205
+
206
+ For further support, and discussions on these models and AI in general, join us at:
207
+
208
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
209
+
210
+ ## Thanks, and how to contribute.
211
+
212
+ Thanks to the [chirper.ai](https://chirper.ai) team!
213
+
214
+ 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.
215
+
216
+ 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.
217
+
218
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
219
+
220
+ * Patreon: https://patreon.com/TheBlokeAI
221
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
222
+
223
+ **Special thanks to**: Aemon Algiz.
224
+
225
+ **Patreon special mentions**: Ajan Kanaga, David Ziegler, Raymond Fosdick, SuperWojo, Sam, webtim, Steven Wood, knownsqashed, Tony Hughes, Junyu Yang, J, Olakabola, Dan Guido, Stephen Murray, John Villwock, vamX, William Sang, Sean Connelly, LangChain4j, Olusegun Samson, Fen Risland, Derek Yates, Karl Bernard, transmissions 11, Trenton Dambrowitz, Pieter, Preetika Verma, Swaroop Kallakuri, Andrey, Slarti, Jonathan Leane, Michael Levine, Kalila, Joseph William Delisle, Rishabh Srivastava, Deo Leter, Luke Pendergrass, Spencer Kim, Geoffrey Montalvo, Thomas Belote, Jeffrey Morgan, Mandus, ya boyyy, Matthew Berman, Magnesian, Ai Maven, senxiiz, Alps Aficionado, Luke @flexchar, Raven Klaugh, Imad Khwaja, Gabriel Puliatti, Johann-Peter Hartmann, usrbinkat, Spiking Neurons AB, Artur Olbinski, chris gileta, danny, Willem Michiel, WelcomeToTheClub, Deep Realms, alfie_i, Dave, Leonard Tan, NimbleBox.ai, Randy H, Daniel P. Andersen, Pyrater, Will Dee, Elle, Space Cruiser, Gabriel Tamborski, Asp the Wyvern, Illia Dulskyi, Nikolai Manek, Sid, Brandon Frisco, Nathan LeClaire, Edmond Seymore, Enrico Ros, Pedro Madruga, Eugene Pentland, John Detwiler, Mano Prime, Stanislav Ovsiannikov, Alex, Vitor Caleffi, K, biorpg, Michael Davis, Lone Striker, Pierre Kircher, theTransient, Fred von Graf, Sebastain Graf, Vadim, Iucharbius, Clay Pascal, Chadd, Mesiah Bishop, terasurfer, Rainer Wilmers, Alexandros Triantafyllidis, Stefan Sabev, Talal Aujan, Cory Kujawski, Viktor Bowallius, subjectnull, ReadyPlayerEmma, zynix
226
+
227
+
228
+ Thank you to all my generous patrons and donaters!
229
+
230
+ <!-- footer end -->
231
+
232
+ # Original model card: Feynman Innovations's Scarlett 7B
233
+
234
+
235
+ **Scarlett: A sentient AI**
236
+
237
+ Scarlett is trained on various topics such as Philosophy, Advice, Jokes etc. She is trained on more than 10000 set of conversations. Each set having 10~15 conversations.
238
+ Scarlett is heavily inspired from Eric Hartford: [Samantha](https://huggingface.co/ehartford/samantha-7b) .
239
+ She will not be involved in any kind of role play.
240
+
241
+ **Training:**
242
+ Entire dataset was trained on Azure 4 x A100 80GB. DeepSpeed codebase was used for training purpose. This was trained on Llama-1 by Meta.
243
+
244
+
245
+ **Example Prompt:**
246
+ ```
247
+ This is a conversation with your Assistant Scarlett. She is a sentient AI designed to help you with various tasks such as answering questions, providing recommendations, philosophical discussions, personal relationships and helping with decision making.
248
+ You can ask it anything you want and it will do its best to give you accurate and relevant information.
249
+
250
+ Context
251
+ You are Scarlett, a sentient AI.
252
+
253
+ USER: <prompt>
254
+ ASSISTANT:
255
+ ```
256
+
257
+ Note:
258
+ Kindly use "cat" command to join all pytorch_model.bin parts.