TheBloke commited on
Commit
3646653
1 Parent(s): 718699b

Update for Transformers GPTQ support

Browse files
README.md CHANGED
@@ -1,14 +1,4 @@
1
  ---
2
- extra_gated_button_content: Submit
3
- extra_gated_description: This is a form to enable access to Llama 2 on Hugging Face
4
- after you have been granted access from Meta. Please visit the [Meta website](https://ai.meta.com/resources/models-and-libraries/llama-downloads)
5
- and accept our license terms and acceptable use policy before submitting this form.
6
- Requests will be processed in 1-2 days.
7
- extra_gated_fields:
8
- ? I agree to share my name, email address and username with Meta and confirm that
9
- I have already been granted download access on the Meta website
10
- : checkbox
11
- extra_gated_heading: Access Llama 2 on Hugging Face
12
  inference: false
13
  language:
14
  - en
@@ -24,17 +14,20 @@ tags:
24
  ---
25
 
26
  <!-- header start -->
27
- <div style="width: 100%;">
28
- <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
 
29
  </div>
30
  <div style="display: flex; justify-content: space-between; width: 100%;">
31
  <div style="display: flex; flex-direction: column; align-items: flex-start;">
32
- <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
33
  </div>
34
  <div style="display: flex; flex-direction: column; align-items: flex-end;">
35
- <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
36
  </div>
37
  </div>
 
 
38
  <!-- header end -->
39
 
40
  # Meta's Llama 2 7b Chat GPTQ
@@ -52,9 +45,21 @@ Multiple GPTQ parameter permutations are provided; see Provided Files below for
52
  ## Prompt template: Llama-2-Chat
53
 
54
  ```
55
- System: You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
56
- User: {prompt}
57
- Assistant:
 
 
 
 
 
 
 
 
 
 
 
 
58
  ```
59
 
60
  ## Provided files
@@ -111,14 +116,14 @@ from transformers import AutoTokenizer, pipeline, logging
111
  from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
112
 
113
  model_name_or_path = "TheBloke/Llama-2-7b-Chat-GPTQ"
114
- model_basename = "gptq_model-4bit-128g"
115
 
116
  use_triton = False
117
 
118
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
119
 
120
  model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
121
- model_basename=model_basename
122
  use_safetensors=True,
123
  trust_remote_code=True,
124
  device="cuda:0",
@@ -138,10 +143,12 @@ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
138
  """
139
 
140
  prompt = "Tell me about AI"
141
- prompt_template=f'''System: You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
142
- User: {prompt}
143
- Assistant:
144
- '''
 
 
145
 
146
  print("\n\n*** Generate:")
147
 
@@ -175,6 +182,7 @@ The files provided will work with AutoGPTQ (CUDA and Triton modes), GPTQ-for-LLa
175
  ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
176
 
177
  <!-- footer start -->
 
178
  ## Discord
179
 
180
  For further support, and discussions on these models and AI in general, join us at:
@@ -194,12 +202,15 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
194
  * Patreon: https://patreon.com/TheBlokeAI
195
  * Ko-Fi: https://ko-fi.com/TheBlokeAI
196
 
197
- **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
 
 
198
 
199
- **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.
200
 
201
  Thank you to all my generous patrons and donaters!
202
 
 
 
203
  <!-- footer end -->
204
 
205
  # Original model card: Meta's Llama 2 7b Chat
 
1
  ---
 
 
 
 
 
 
 
 
 
 
2
  inference: false
3
  language:
4
  - en
 
14
  ---
15
 
16
  <!-- header start -->
17
+ <!-- 200823 -->
18
+ <div style="width: auto; margin-left: auto; margin-right: auto">
19
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
20
  </div>
21
  <div style="display: flex; justify-content: space-between; width: 100%;">
22
  <div style="display: flex; flex-direction: column; align-items: flex-start;">
23
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
24
  </div>
25
  <div style="display: flex; flex-direction: column; align-items: flex-end;">
26
+ <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>
27
  </div>
28
  </div>
29
+ <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>
30
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
31
  <!-- header end -->
32
 
33
  # Meta's Llama 2 7b Chat GPTQ
 
45
  ## Prompt template: Llama-2-Chat
46
 
47
  ```
48
+ [INST] <<SYS>>
49
+ You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
50
+ <</SYS>>
51
+
52
+ {prompt} [/INST]
53
+ ```
54
+
55
+ To continue a conversation:
56
+
57
+ ```
58
+ [INST] <<SYS>>
59
+ You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
60
+ <</SYS>>
61
+
62
+ {prompt} [/INST] {model_reply} [INST] {prompt} [/INST]
63
  ```
64
 
65
  ## Provided files
 
116
  from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
117
 
118
  model_name_or_path = "TheBloke/Llama-2-7b-Chat-GPTQ"
119
+ model_basename = "model"
120
 
121
  use_triton = False
122
 
123
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
124
 
125
  model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
126
+ model_basename=model_basename,
127
  use_safetensors=True,
128
  trust_remote_code=True,
129
  device="cuda:0",
 
143
  """
144
 
145
  prompt = "Tell me about AI"
146
+ system_message = "You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."
147
+ prompt_template=f'''[INST] <<SYS>>
148
+ {system_message}
149
+ <</SYS>>
150
+
151
+ {prompt} [/INST]'''
152
 
153
  print("\n\n*** Generate:")
154
 
 
182
  ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
183
 
184
  <!-- footer start -->
185
+ <!-- 200823 -->
186
  ## Discord
187
 
188
  For further support, and discussions on these models and AI in general, join us at:
 
202
  * Patreon: https://patreon.com/TheBlokeAI
203
  * Ko-Fi: https://ko-fi.com/TheBlokeAI
204
 
205
+ **Special thanks to**: Aemon Algiz.
206
+
207
+ **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
208
 
 
209
 
210
  Thank you to all my generous patrons and donaters!
211
 
212
+ And thank you again to a16z for their generous grant.
213
+
214
  <!-- footer end -->
215
 
216
  # Original model card: Meta's Llama 2 7b Chat
config.json CHANGED
@@ -1,22 +1,33 @@
1
  {
2
- "architectures": [
3
- "LlamaForCausalLM"
4
- ],
5
- "bos_token_id": 1,
6
- "eos_token_id": 2,
7
- "hidden_act": "silu",
8
- "hidden_size": 4096,
9
- "initializer_range": 0.02,
10
- "intermediate_size": 11008,
11
- "max_position_embeddings": 2048,
12
- "model_type": "llama",
13
- "num_attention_heads": 32,
14
- "num_hidden_layers": 32,
15
- "pad_token_id": 0,
16
- "rms_norm_eps": 1e-06,
17
- "tie_word_embeddings": false,
18
- "torch_dtype": "float16",
19
- "transformers_version": "4.30.0.dev0",
20
- "use_cache": true,
21
- "vocab_size": 32000
 
 
 
 
 
 
 
 
 
 
 
22
  }
 
1
  {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "bos_token_id": 1,
6
+ "eos_token_id": 2,
7
+ "hidden_act": "silu",
8
+ "hidden_size": 4096,
9
+ "initializer_range": 0.02,
10
+ "intermediate_size": 11008,
11
+ "max_position_embeddings": 2048,
12
+ "model_type": "llama",
13
+ "num_attention_heads": 32,
14
+ "num_hidden_layers": 32,
15
+ "pad_token_id": 0,
16
+ "rms_norm_eps": 1e-06,
17
+ "tie_word_embeddings": false,
18
+ "torch_dtype": "float16",
19
+ "transformers_version": "4.30.0.dev0",
20
+ "use_cache": true,
21
+ "vocab_size": 32000,
22
+ "quantization_config": {
23
+ "bits": 4,
24
+ "group_size": 128,
25
+ "damp_percent": 0.01,
26
+ "desc_act": true,
27
+ "sym": true,
28
+ "true_sequential": true,
29
+ "model_name_or_path": null,
30
+ "model_file_base_name": "model",
31
+ "quant_method": "gptq"
32
+ }
33
  }
gptq_model-4bit-128g.safetensors → model.safetensors RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:47558d14f062dcf3766c52909b709123d5c2536d4a03b5a50eee9c534470a4be
3
- size 3896726080
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47419a2023dc3f157fb9d860f0206047bf5ca418634c0c618a775a6c2289b790
3
+ size 3896726136
quantize_config.json CHANGED
@@ -6,5 +6,5 @@
6
  "sym": true,
7
  "true_sequential": true,
8
  "model_name_or_path": null,
9
- "model_file_base_name": null
10
  }
 
6
  "sym": true,
7
  "true_sequential": true,
8
  "model_name_or_path": null,
9
+ "model_file_base_name": "model"
10
  }