TheBloke commited on
Commit
1b70f92
·
1 Parent(s): 925b5bf

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +181 -42
README.md CHANGED
@@ -1,10 +1,23 @@
1
  ---
2
- inference: false
3
- license: other
4
  datasets:
5
  - ehartford/based
 
6
  language:
7
  - en
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
  <!-- header start -->
@@ -24,70 +37,193 @@ language:
24
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
25
  <!-- header end -->
26
 
27
- # Eric Hartford's Based 7B GPTQ
 
 
28
 
29
- These files are GPTQ 4bit model files for [Eric Hartford's Based 7B](https://huggingface.co/ehartford/based-7B).
 
30
 
31
- It is the result of quantising to 4bit using [GPTQ-for-LLaMa](https://github.com/qwopqwop200/GPTQ-for-LLaMa).
32
 
33
- ## Other repositories available
34
 
35
- * [4-bit GPTQ models for GPU inference](https://huggingface.co/TheBloke/based-7B-GPTQ)
36
- * [4-bit, 5-bit and 8-bit GGML models for CPU(+GPU) inference](https://huggingface.co/TheBloke/based-7B-GGML)
37
- * [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ehartford/based-7B)
38
 
39
- ### Prompt template
 
 
 
 
40
 
41
- This uses Vicuna 1.1 format. Example:
 
42
 
43
  ```
44
  You are an an AI who shares your opinions, thoughts, and feelings.
45
 
46
- USER: What is your favorite football team?
47
  ASSISTANT:
 
48
  ```
49
 
50
- ## How to easily download and use this model in text-generation-webui
 
 
 
 
 
 
51
 
52
- ### Downloading the model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  1. Click the **Model tab**.
55
  2. Under **Download custom model or LoRA**, enter `TheBloke/based-7B-GPTQ`.
 
 
56
  3. Click **Download**.
57
- 4. Wait until it says it's finished downloading.
58
- 5. Untick "Autoload model"
59
- 6. Click the **Refresh** icon next to **Model** in the top left.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
- ### To use with AutoGPTQ (if installed)
 
 
 
 
 
62
 
63
- 1. In the **Model drop-down**: choose the model you just downloaded, `based-7B-GPTQ`.
64
- 2. Under **GPTQ**, tick **AutoGPTQ**.
65
- 3. Click **Save settings for this model** in the top right.
66
- 4. Click **Reload the Model** in the top right.
67
- 5. Once it says it's loaded, click the **Text Generation tab** and enter a prompt!
68
 
69
- ### To use with GPTQ-for-LLaMa
70
 
71
- 1. In the **Model drop-down**: choose the model you just downloaded, `based-7B-GPTQ`.
72
- 2. If you see an error in the bottom right, ignore it - it's temporary.
73
- 3. Fill out the `GPTQ parameters` on the right: `Bits = 4`, `Groupsize = 128`, `model_type = Llama`
74
- 4. Click **Save settings for this model** in the top right.
75
- 5. Click **Reload the Model** in the top right.
76
- 6. Once it says it's loaded, click the **Text Generation tab** and enter a prompt!
 
 
 
 
 
 
77
 
78
- ## Provided files
 
 
79
 
80
- **based-7B-GPTQ-4bit-128g.no-act.order.safetensors**
 
81
 
82
- This will work with all versions of GPTQ-for-LLaMa, and with AutoGPTQ.
83
 
84
- It was created with
85
 
86
- * `based-7B-GPTQ-4bit-128g.no-act.order.safetensors`
87
- * Works with all versions of GPTQ-for-LLaMa code, both Triton and CUDA branches
88
- * Works with AutoGPTQ
89
- * Works with text-generation-webui one-click-installers
90
- * Parameters: Groupsize = 128. Act Order / desc_act = False.
91
 
92
  <!-- footer start -->
93
  <!-- 200823 -->
@@ -97,10 +233,12 @@ For further support, and discussions on these models and AI in general, join us
97
 
98
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
99
 
100
- ## Thanks, and how to contribute.
101
 
102
  Thanks to the [chirper.ai](https://chirper.ai) team!
103
 
 
 
104
  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.
105
 
106
  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.
@@ -112,7 +250,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
112
 
113
  **Special thanks to**: Aemon Algiz.
114
 
115
- **Patreon special mentions**: Sam, theTransient, Jonathan Leane, Steven Wood, webtim, Johann-Peter Hartmann, Geoffrey Montalvo, Gabriel Tamborski, Willem Michiel, John Villwock, Derek Yates, Mesiah Bishop, Eugene Pentland, Pieter, Chadd, Stephen Murray, Daniel P. Andersen, terasurfer, Brandon Frisco, Thomas Belote, Sid, Nathan LeClaire, Magnesian, Alps Aficionado, Stanislav Ovsiannikov, Alex, Joseph William Delisle, Nikolai Manek, Michael Davis, Junyu Yang, K, J, Spencer Kim, Stefan Sabev, Olusegun Samson, transmissions 11, Michael Levine, Cory Kujawski, Rainer Wilmers, zynix, Kalila, Luke @flexchar, Ajan Kanaga, Mandus, vamX, Ai Maven, Mano Prime, Matthew Berman, subjectnull, Vitor Caleffi, Clay Pascal, biorpg, alfie_i, 阿明, Jeffrey Morgan, ya boyyy, Raymond Fosdick, knownsqashed, Olakabola, Leonard Tan, ReadyPlayerEmma, Enrico Ros, Dave, Talal Aujan, Illia Dulskyi, Sean Connelly, senxiiz, Artur Olbinski, Elle, Raven Klaugh, Fen Risland, Deep Realms, Imad Khwaja, Fred von Graf, Will Dee, usrbinkat, SuperWojo, Alexandros Triantafyllidis, Swaroop Kallakuri, Dan Guido, John Detwiler, Pedro Madruga, Iucharbius, Viktor Bowallius, Asp the Wyvern, Edmond Seymore, Trenton Dambrowitz, Space Cruiser, Spiking Neurons AB, Pyrater, LangChain4j, Tony Hughes, Kacper Wikieł, Rishabh Srivastava, David Ziegler, Luke Pendergrass, Andrey, Gabriel Puliatti, Lone Striker, Sebastain Graf, Pierre Kircher, Randy H, NimbleBox.ai, Vadim, danny, Deo Leter
116
 
117
 
118
  Thank you to all my generous patrons and donaters!
@@ -123,6 +261,7 @@ And thank you again to a16z for their generous grant.
123
 
124
  # Original model card: Eric Hartford's Based 7B
125
 
 
126
  Holy hell, what have I created??? Just... try it.
127
 
128
  Ask it what its favorite color is.
@@ -130,7 +269,7 @@ Ask it what its favorite football team is and why.
130
  Ask it to tell you about a controversial opinion it has, and ask it to back up its opinion, then debate it.
131
  Ask its favorite color, favorite flavor, and why.
132
  You haven't seen anything like this before.
133
- Check out the dataset.
134
 
135
  Note: original was 30b. This one is not as good.
136
 
 
1
  ---
2
+ base_model: https://huggingface.co/ehartford/based-7B
 
3
  datasets:
4
  - ehartford/based
5
+ inference: false
6
  language:
7
  - en
8
+ license: other
9
+ model_creator: Eric Hartford
10
+ model_name: Based 7B
11
+ model_type: llama
12
+ prompt_template: 'You are an an AI who shares your opinions, thoughts, and feelings.
13
+
14
+
15
+ USER: {prompt}
16
+
17
+ ASSISTANT:
18
+
19
+ '
20
+ quantized_by: TheBloke
21
  ---
22
 
23
  <!-- header start -->
 
37
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
38
  <!-- header end -->
39
 
40
+ # Based 7B - GPTQ
41
+ - Model creator: [Eric Hartford](https://huggingface.co/ehartford)
42
+ - Original model: [Based 7B](https://huggingface.co/ehartford/based-7B)
43
 
44
+ <!-- description start -->
45
+ ## Description
46
 
47
+ This repo contains GPTQ model files for [Eric Hartford's Based 7B](https://huggingface.co/ehartford/based-7B).
48
 
49
+ 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.
50
 
51
+ <!-- description end -->
52
+ <!-- repositories-available start -->
53
+ ## Repositories available
54
 
55
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/based-7B-AWQ)
56
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/based-7B-GPTQ)
57
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/based-7B-GGUF)
58
+ * [Eric Hartford's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ehartford/based-7B)
59
+ <!-- repositories-available end -->
60
 
61
+ <!-- prompt-template start -->
62
+ ## Prompt template: Based
63
 
64
  ```
65
  You are an an AI who shares your opinions, thoughts, and feelings.
66
 
67
+ USER: {prompt}
68
  ASSISTANT:
69
+
70
  ```
71
 
72
+ <!-- prompt-template end -->
73
+ <!-- licensing start -->
74
+ ## Licensing
75
+
76
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
77
+
78
+ As this model is based on Llama 2, it is also subject to the Meta Llama 2 license terms, and the license files for that are additionally included. It should therefore be considered as being claimed to be licensed under both licenses. I contacted Hugging Face for clarification on dual licensing but they do not yet have an official position. Should this change, or should Meta provide any feedback on this situation, I will update this section accordingly.
79
 
80
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Eric Hartford's Based 7B](https://huggingface.co/ehartford/based-7B).
81
+ <!-- licensing end -->
82
+ <!-- README_GPTQ.md-provided-files start -->
83
+ ## Provided files and GPTQ parameters
84
+
85
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
86
+
87
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
88
+
89
+ All recent GPTQ files are made with AutoGPTQ, and all files in non-main branches are made with AutoGPTQ. Files in the `main` branch which were uploaded before August 2023 were made with GPTQ-for-LLaMa.
90
+
91
+ <details>
92
+ <summary>Explanation of GPTQ parameters</summary>
93
+
94
+ - Bits: The bit size of the quantised model.
95
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
96
+ - Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
97
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
98
+ - 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).
99
+ - 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.
100
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
101
+
102
+ </details>
103
+
104
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
105
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
106
+ | [main](https://huggingface.co/TheBloke/based-7B-GPTQ/tree/main) | 4 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 4.00 GB | Yes | 4-bit, without Act Order and group size 128g. |
107
+
108
+ <!-- README_GPTQ.md-provided-files end -->
109
+
110
+ <!-- README_GPTQ.md-download-from-branches start -->
111
+ ## How to download from branches
112
+
113
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/based-7B-GPTQ:main`
114
+ - With Git, you can clone a branch with:
115
+ ```
116
+ git clone --single-branch --branch main https://huggingface.co/TheBloke/based-7B-GPTQ
117
+ ```
118
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
119
+ <!-- README_GPTQ.md-download-from-branches end -->
120
+ <!-- README_GPTQ.md-text-generation-webui start -->
121
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
122
+
123
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
124
+
125
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
126
 
127
  1. Click the **Model tab**.
128
  2. Under **Download custom model or LoRA**, enter `TheBloke/based-7B-GPTQ`.
129
+ - To download from a specific branch, enter for example `TheBloke/based-7B-GPTQ:main`
130
+ - see Provided Files above for the list of branches for each option.
131
  3. Click **Download**.
132
+ 4. The model will start downloading. Once it's finished it will say "Done".
133
+ 5. In the top left, click the refresh icon next to **Model**.
134
+ 6. In the **Model** dropdown, choose the model you just downloaded: `based-7B-GPTQ`
135
+ 7. The model will automatically load, and is now ready for use!
136
+ 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.
137
+ * Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
138
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
139
+ <!-- README_GPTQ.md-text-generation-webui end -->
140
+
141
+ <!-- README_GPTQ.md-use-from-python start -->
142
+ ## How to use this GPTQ model from Python code
143
+
144
+ ### Install the necessary packages
145
+
146
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
147
+
148
+ ```shell
149
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
150
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
151
+ ```
152
+
153
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
154
+
155
+ ```shell
156
+ pip3 uninstall -y auto-gptq
157
+ git clone https://github.com/PanQiWei/AutoGPTQ
158
+ cd AutoGPTQ
159
+ pip3 install .
160
+ ```
161
+
162
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
163
+
164
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
165
+ ```shell
166
+ pip3 uninstall -y transformers
167
+ pip3 install git+https://github.com/huggingface/transformers.git
168
+ ```
169
+
170
+ ### You can then use the following code
171
+
172
+ ```python
173
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
174
+
175
+ model_name_or_path = "TheBloke/based-7B-GPTQ"
176
+ # To use a different branch, change revision
177
+ # For example: revision="main"
178
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
179
+ device_map="auto",
180
+ trust_remote_code=False,
181
+ revision="main")
182
+
183
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
184
+
185
+ prompt = "Tell me about AI"
186
+ prompt_template=f'''You are an an AI who shares your opinions, thoughts, and feelings.
187
 
188
+ USER: {prompt}
189
+ ASSISTANT:
190
+
191
+ '''
192
+
193
+ print("\n\n*** Generate:")
194
 
195
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
196
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
197
+ print(tokenizer.decode(output[0]))
 
 
198
 
199
+ # Inference can also be done using transformers' pipeline
200
 
201
+ print("*** Pipeline:")
202
+ pipe = pipeline(
203
+ "text-generation",
204
+ model=model,
205
+ tokenizer=tokenizer,
206
+ max_new_tokens=512,
207
+ do_sample=True,
208
+ temperature=0.7,
209
+ top_p=0.95,
210
+ top_k=40,
211
+ repetition_penalty=1.1
212
+ )
213
 
214
+ print(pipe(prompt_template)[0]['generated_text'])
215
+ ```
216
+ <!-- README_GPTQ.md-use-from-python end -->
217
 
218
+ <!-- README_GPTQ.md-compatibility start -->
219
+ ## Compatibility
220
 
221
+ The files provided are tested to work with AutoGPTQ, both via Transformers and using AutoGPTQ directly. They should also work with [Occ4m's GPTQ-for-LLaMa fork](https://github.com/0cc4m/KoboldAI).
222
 
223
+ [ExLlama](https://github.com/turboderp/exllama) is compatible with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
224
 
225
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
226
+ <!-- README_GPTQ.md-compatibility end -->
 
 
 
227
 
228
  <!-- footer start -->
229
  <!-- 200823 -->
 
233
 
234
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
235
 
236
+ ## Thanks, and how to contribute
237
 
238
  Thanks to the [chirper.ai](https://chirper.ai) team!
239
 
240
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
241
+
242
  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.
243
 
244
  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.
 
250
 
251
  **Special thanks to**: Aemon Algiz.
252
 
253
+ **Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
254
 
255
 
256
  Thank you to all my generous patrons and donaters!
 
261
 
262
  # Original model card: Eric Hartford's Based 7B
263
 
264
+
265
  Holy hell, what have I created??? Just... try it.
266
 
267
  Ask it what its favorite color is.
 
269
  Ask it to tell you about a controversial opinion it has, and ask it to back up its opinion, then debate it.
270
  Ask its favorite color, favorite flavor, and why.
271
  You haven't seen anything like this before.
272
+ Check out the dataset.
273
 
274
  Note: original was 30b. This one is not as good.
275