TheBloke commited on
Commit
8d3ab81
1 Parent(s): 7332b4b

Update for Transformers GPTQ support

Browse files
README.md CHANGED
@@ -7,205 +7,20 @@ model_type: llama
7
  ---
8
 
9
  <!-- header start -->
10
- <div style="width: 100%;">
11
- <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
 
12
  </div>
13
  <div style="display: flex; justify-content: space-between; width: 100%;">
14
  <div style="display: flex; flex-direction: column; align-items: flex-start;">
15
- <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
16
  </div>
17
  <div style="display: flex; flex-direction: column; align-items: flex-end;">
18
- <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
19
- </div>
20
- </div>
21
- <!-- header end -->
22
-
23
- # Open BMB's UltraLM 13B GPTQ
24
-
25
- These files are GPTQ model files for [Open BMB's UltraLM 13B](https://huggingface.co/TheBloke/UltraLM-13B-fp16).
26
-
27
- 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.
28
-
29
- These models were quantised using hardware kindly provided by [Latitude.sh](https://www.latitude.sh/accelerate).
30
-
31
- ## Repositories available
32
-
33
- * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/UltraLM-13B-GPTQ)
34
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/UltraLM-13B-GGML)
35
- * [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/UltraLM-13B-fp16)
36
-
37
- ## Prompt template: Vicuna
38
-
39
- ```
40
- A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
41
-
42
- USER: {prompt}
43
- ASSISTANT:
44
- ```
45
-
46
- ## Provided files
47
-
48
- Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
49
-
50
- Each separate quant is in a different branch. See below for instructions on fetching from different branches.
51
-
52
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
53
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
54
- | main | 4 | 128 | False | 7.45 GB | True | GPTQ-for-LLaMa | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
55
- | 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. |
56
- | 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. |
57
- | 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. |
58
- | gptq-8bit--1g-actorder_True | 8 | None | True | 13.36 GB | False | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
59
- | gptq-8bit-128g-actorder_False | 8 | 128 | False | 13.65 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
60
-
61
- ## How to download from branches
62
-
63
- - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/UltraLM-13B-GPTQ:gptq-4bit-32g-actorder_True`
64
- - With Git, you can clone a branch with:
65
- ```
66
- git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/UltraLM-13B-GPTQ`
67
- ```
68
- - In Python Transformers code, the branch is the `revision` parameter; see below.
69
-
70
- ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
71
-
72
- Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
73
-
74
- It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
75
-
76
- 1. Click the **Model tab**.
77
- 2. Under **Download custom model or LoRA**, enter `TheBloke/UltraLM-13B-GPTQ`.
78
- - To download from a specific branch, enter for example `TheBloke/UltraLM-13B-GPTQ:gptq-4bit-32g-actorder_True`
79
- - see Provided Files above for the list of branches for each option.
80
- 3. Click **Download**.
81
- 4. The model will start downloading. Once it's finished it will say "Done"
82
- 5. In the top left, click the refresh icon next to **Model**.
83
- 6. In the **Model** dropdown, choose the model you just downloaded: `UltraLM-13B-GPTQ`
84
- 7. The model will automatically load, and is now ready for use!
85
- 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.
86
- * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
87
- 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
88
-
89
- ## How to use this GPTQ model from Python code
90
-
91
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
92
-
93
- `GITHUB_ACTIONS=true pip install auto-gptq`
94
-
95
- Then try the following example code:
96
-
97
- ```python
98
- from transformers import AutoTokenizer, pipeline, logging
99
- from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
100
-
101
- model_name_or_path = "TheBloke/UltraLM-13B-GPTQ"
102
- model_basename = "ultralm-13b-GPTQ-4bit-128g.no-act.order"
103
-
104
- use_triton = False
105
-
106
- tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
107
-
108
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
109
- model_basename=model_basename
110
- use_safetensors=True,
111
- trust_remote_code=True,
112
- device="cuda:0",
113
- use_triton=use_triton,
114
- quantize_config=None)
115
-
116
- """
117
- To download from a specific branch, use the revision parameter, as in this example:
118
-
119
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
120
- revision="gptq-4bit-32g-actorder_True",
121
- model_basename=model_basename,
122
- use_safetensors=True,
123
- trust_remote_code=True,
124
- device="cuda:0",
125
- quantize_config=None)
126
- """
127
-
128
- prompt = "Tell me about AI"
129
- prompt_template=f'''A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
130
-
131
- USER: {prompt}
132
- ASSISTANT:
133
- '''
134
-
135
- print("\n\n*** Generate:")
136
-
137
- input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
138
- output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
139
- print(tokenizer.decode(output[0]))
140
-
141
- # Inference can also be done using transformers' pipeline
142
-
143
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
144
- logging.set_verbosity(logging.CRITICAL)
145
-
146
- print("*** Pipeline:")
147
- pipe = pipeline(
148
- "text-generation",
149
- model=model,
150
- tokenizer=tokenizer,
151
- max_new_tokens=512,
152
- temperature=0.7,
153
- top_p=0.95,
154
- repetition_penalty=1.15
155
- )
156
-
157
- print(pipe(prompt_template)[0]['generated_text'])
158
- ```
159
-
160
- ## Compatibility
161
-
162
- 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.
163
-
164
- ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
165
-
166
- <!-- footer start -->
167
- ## Discord
168
-
169
- For further support, and discussions on these models and AI in general, join us at:
170
-
171
- [TheBloke AI's Discord server](https://discord.gg/theblokeai)
172
-
173
- ## Thanks, and how to contribute.
174
-
175
- Thanks to the [chirper.ai](https://chirper.ai) team!
176
-
177
- 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.
178
-
179
- 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.
180
-
181
- Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
182
-
183
- * Patreon: https://patreon.com/TheBlokeAI
184
- * Ko-Fi: https://ko-fi.com/TheBlokeAI
185
-
186
- **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
187
-
188
- **Patreon special mentions**: Space Cruiser, Nikolai Manek, Sam, Chris McCloskey, Rishabh Srivastava, Kalila, Spiking Neurons AB, Khalefa Al-Ahmad, WelcomeToTheClub, Chadd, Lone Striker, Viktor Bowallius, Edmond Seymore, Ai Maven, Chris Smitley, Dave, Alexandros Triantafyllidis, Luke @flexchar, Elle, ya boyyy, Talal Aujan, Alex , Jonathan Leane, Deep Realms, Randy H, subjectnull, Preetika Verma, Joseph William Delisle, Michael Levine, chris gileta, K, Oscar Rangel, LangChain4j, Trenton Dambrowitz, Eugene Pentland, Johann-Peter Hartmann, Femi Adebogun, Illia Dulskyi, senxiiz, Daniel P. Andersen, Sean Connelly, Artur Olbinski, RoA, Mano Prime, Derek Yates, Raven Klaugh, David Flickinger, Willem Michiel, Pieter, Willian Hasse, vamX, Luke Pendergrass, webtim, Ghost , Rainer Wilmers, Nathan LeClaire, Will Dee, Cory Kujawski, John Detwiler, Fred von Graf, biorpg, Iucharbius , Imad Khwaja, Pierre Kircher, terasurfer , Asp the Wyvern, John Villwock, theTransient, zynix , Gabriel Tamborski, Fen Risland, Gabriel Puliatti, Matthew Berman, Pyrater, SuperWojo, Stephen Murray, Karl Bernard, Ajan Kanaga, Greatston Gnanesh, Junyu Yang.
189
-
190
- Thank you to all my generous patrons and donaters!
191
-
192
- <!-- footer end -->
193
-
194
- # Original model card: Open BMB's UltraLM 13B
195
-
196
-
197
- <!-- header start -->
198
- <div style="width: 100%;">
199
- <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
200
- </div>
201
- <div style="display: flex; justify-content: space-between; width: 100%;">
202
- <div style="display: flex; flex-direction: column; align-items: flex-start;">
203
- <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
204
- </div>
205
- <div style="display: flex; flex-direction: column; align-items: flex-end;">
206
- <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
207
  </div>
208
  </div>
 
 
209
  <!-- header end -->
210
 
211
  # Open BMB's UltraLM 13B fp16
@@ -228,6 +43,7 @@ ASSISTANT:
228
  ```
229
 
230
  <!-- footer start -->
 
231
  ## Discord
232
 
233
  For further support, and discussions on these models and AI in general, join us at:
@@ -247,12 +63,15 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
247
  * Patreon: https://patreon.com/TheBlokeAI
248
  * Ko-Fi: https://ko-fi.com/TheBlokeAI
249
 
250
- **Special thanks to**: Luke from CarbonQuill, Aemon Algiz, Dmitriy Samsonov.
 
 
251
 
252
- **Patreon special mentions**: zynix, ya boyyy, Trenton Dambrowitz, Imad Khwaja, Alps Aficionado, chris gileta, John Detwiler, Willem Michiel, RoA, Mano Prime, Rainer Wilmers, Fred von Graf, Matthew Berman, Ghost , Nathan LeClaire, Iucharbius , Ai Maven, Illia Dulskyi, Joseph William Delisle, Space Cruiser, Lone Striker, Karl Bernard, Eugene Pentland, Greatston Gnanesh, Jonathan Leane, Randy H, Pierre Kircher, Willian Hasse, Stephen Murray, Alex , terasurfer , Edmond Seymore, Oscar Rangel, Luke Pendergrass, Asp the Wyvern, Junyu Yang, David Flickinger, Luke, Spiking Neurons AB, subjectnull, Pyrater, Nikolai Manek, senxiiz, Ajan Kanaga, Johann-Peter Hartmann, Artur Olbinski, Kevin Schuppel, Derek Yates, Kalila, K, Talal Aujan, Khalefa Al-Ahmad, Gabriel Puliatti, John Villwock, WelcomeToTheClub, Daniel P. Andersen, Preetika Verma, Deep Realms, Fen Risland, trip7s trip, webtim, Sean Connelly, Michael Levine, Chris McCloskey, biorpg, vamX, Viktor Bowallius, Cory Kujawski.
253
 
254
  Thank you to all my generous patrons and donaters!
255
 
 
 
256
  <!-- footer end -->
257
 
258
  # Original model card: Open BMB's UltraLM 13B
@@ -300,5 +119,5 @@ To use this model, you need to [recover](https://github.com/thunlp/UltraChat/tre
300
  ```
301
  [Optional]User: system prompt<eos_token>
302
  User: user input<eos_token>
303
- Assistant:
304
  ```
 
7
  ---
8
 
9
  <!-- header start -->
10
+ <!-- 200823 -->
11
+ <div style="width: auto; margin-left: auto; margin-right: auto">
12
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
13
  </div>
14
  <div style="display: flex; justify-content: space-between; width: 100%;">
15
  <div style="display: flex; flex-direction: column; align-items: flex-start;">
16
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
17
  </div>
18
  <div style="display: flex; flex-direction: column; align-items: flex-end;">
19
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  </div>
21
  </div>
22
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
23
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
24
  <!-- header end -->
25
 
26
  # Open BMB's UltraLM 13B fp16
 
43
  ```
44
 
45
  <!-- footer start -->
46
+ <!-- 200823 -->
47
  ## Discord
48
 
49
  For further support, and discussions on these models and AI in general, join us at:
 
63
  * Patreon: https://patreon.com/TheBlokeAI
64
  * Ko-Fi: https://ko-fi.com/TheBlokeAI
65
 
66
+ **Special thanks to**: Aemon Algiz.
67
+
68
+ **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
69
 
 
70
 
71
  Thank you to all my generous patrons and donaters!
72
 
73
+ And thank you again to a16z for their generous grant.
74
+
75
  <!-- footer end -->
76
 
77
  # Original model card: Open BMB's UltraLM 13B
 
119
  ```
120
  [Optional]User: system prompt<eos_token>
121
  User: user input<eos_token>
122
+ Assistant:
123
  ```
config.json CHANGED
@@ -1,24 +1,34 @@
1
  {
2
- "_name_or_path": "/workspace/process/ultralm-13b/source",
3
- "architectures": [
4
- "LlamaForCausalLM"
5
- ],
6
- "bos_token_id": 1,
7
- "eos_token_id": 2,
8
- "hidden_act": "silu",
9
- "hidden_size": 5120,
10
- "initializer_range": 0.02,
11
- "intermediate_size": 13824,
12
- "max_position_embeddings": 2048,
13
- "max_sequence_length": 2048,
14
- "model_type": "llama",
15
- "num_attention_heads": 40,
16
- "num_hidden_layers": 40,
17
- "pad_token_id": 0,
18
- "rms_norm_eps": 1e-06,
19
- "tie_word_embeddings": false,
20
- "torch_dtype": "float16",
21
- "transformers_version": "4.30.0.dev0",
22
- "use_cache": true,
23
- "vocab_size": 32001
 
 
 
 
 
 
 
 
 
 
24
  }
 
1
  {
2
+ "_name_or_path": "/workspace/process/ultralm-13b/source",
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "bos_token_id": 1,
7
+ "eos_token_id": 2,
8
+ "hidden_act": "silu",
9
+ "hidden_size": 5120,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 13824,
12
+ "max_position_embeddings": 2048,
13
+ "max_sequence_length": 2048,
14
+ "model_type": "llama",
15
+ "num_attention_heads": 40,
16
+ "num_hidden_layers": 40,
17
+ "pad_token_id": 0,
18
+ "rms_norm_eps": 1e-06,
19
+ "tie_word_embeddings": false,
20
+ "torch_dtype": "float16",
21
+ "transformers_version": "4.30.0.dev0",
22
+ "use_cache": true,
23
+ "vocab_size": 32001,
24
+ "quantization_config": {
25
+ "bits": 4,
26
+ "group_size": 128,
27
+ "damp_percent": 0.01,
28
+ "desc_act": false,
29
+ "sym": true,
30
+ "true_sequential": true,
31
+ "model_file_base_name": "model",
32
+ "quant_method": "gptq"
33
+ }
34
  }
ultralm-13b-GPTQ-4bit-128g.no-act.order.safetensors → model.safetensors RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:753782e7e9782634bcf6a5c98e7749c2b98095a39ccbb5d970fcf5f80dfc86d4
3
- size 7454817640
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46036b7c51afe7d4d801f98f1fa6099c8f3d977296bb7fccc965fba21be4b194
3
+ size 7454817696
quantize_config.json CHANGED
@@ -1,8 +1,9 @@
1
  {
2
- "bits": 4,
3
- "group_size": 128,
4
- "damp_percent": 0.01,
5
- "desc_act": false,
6
- "sym": true,
7
- "true_sequential": true
 
8
  }
 
1
  {
2
+ "bits": 4,
3
+ "group_size": 128,
4
+ "damp_percent": 0.01,
5
+ "desc_act": false,
6
+ "sym": true,
7
+ "true_sequential": true,
8
+ "model_file_base_name": "model"
9
  }