TheBloke commited on
Commit
804ccca
1 Parent(s): 8db3e67

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +105 -117
README.md CHANGED
@@ -3,8 +3,12 @@ inference: false
3
  language:
4
  - en
5
  license: other
 
 
 
6
  model_type: llama
7
  pipeline_tag: text-generation
 
8
  tags:
9
  - facebook
10
  - meta
@@ -30,168 +34,150 @@ tags:
30
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
31
  <!-- header end -->
32
 
33
- # Meta's Llama 2 70B GPTQ
 
 
34
 
35
- These files are GPTQ model files for [Meta's Llama 2 70B](https://huggingface.co/meta-llama/Llama-2-70b-hf).
 
36
 
37
- 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.
38
-
39
- Many thanks to William Beauchamp from [Chai](https://chai-research.com/) for providing the hardware for these quantisations!
40
-
41
- ## ExLlama support for 70B is here!
42
-
43
- As of [this commit](https://github.com/turboderp/exllama/commit/b3aea521859b83cfd889c4c00c05a323313b7fee), ExLlama has support for Llama 2 70B models.
44
-
45
- Please make sure you update ExLlama to the latest version. If you are a text-generation-webui one-click user, you must first uninstall the ExLlama wheel, then update ExLlama in `text-generation-webui/repositories`; full instructions are below.
46
-
47
- Now that we have ExLlama, that is the recommended loader to use for these models, as performance should be better than with AutoGPTQ and GPTQ-for-LLaMa, and you will be able to use the higher accuracy models, eg 128g + Act-Order.
48
-
49
- Reminder: ExLlama does not support 3-bit models, so if you wish to try those quants, you will need to use AutoGPTQ or GPTQ-for-LLaMa.
50
-
51
- ## AutoGPTQ and GPTQ-for-LLaMa requires latest version of Transformers
52
-
53
- If you plan to use any of these quants with AutoGPTQ or GPTQ-for-LLaMa, your Transformers needs to be be using the latest Github code.
54
-
55
- If you're using text-generation-webui and have updated to the latest version, this is done for you automatically.
56
-
57
- If not, you can update it manually with:
58
 
59
- ```
60
- pip3 install git+https://github.com/huggingface/transformers
61
- ```
62
 
 
 
63
  ## Repositories available
64
 
65
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ)
66
- * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/Llama-2-70B-fp16)
 
 
 
67
 
 
68
  ## Prompt template: None
69
 
70
  ```
71
  {prompt}
 
72
  ```
73
 
74
- ## Provided files
 
 
 
75
 
76
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
77
 
78
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
79
 
80
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
81
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
82
- | main | 4 | 128 | False | 35.33 GB | True | AutoGPTQ | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
83
- | gptq-4bit-32g-actorder_True | 4 | 32 | True | 40.66 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. |
84
- | gptq-4bit-64g-actorder_True | 4 | 64 | True | 37.99 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. |
85
- | gptq-4bit-128g-actorder_True | 4 | 128 | True | 36.65 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. |
86
- | gptq-3bit--1g-actorder_True | 3 | None | True | 26.78 GB | False | AutoGPTQ | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
87
- | gptq-3bit-128g-actorder_False | 3 | 128 | False | 28.03 GB | False | AutoGPTQ | 3-bit, with group size 128g but no act-order. Slightly higher VRAM requirements than 3-bit None. |
88
- | gptq-3bit-128g-actorder_True | 3 | 128 | True | 28.03 GB | False | AutoGPTQ | 3-bit, with group size 128g and act-order. Higher quality than 128g-False but poor AutoGPTQ CUDA speed. |
89
- | gptq-3bit-64g-actorder_True | 3 | 64 | True | 29.30 GB | False | AutoGPTQ | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. Poor AutoGPTQ CUDA speed. |
90
-
91
- ## How to download from branches
92
-
93
- - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Llama-2-70B-GPTQ:gptq-4bit-32g-actorder_True`
94
- - With Git, you can clone a branch with:
95
- ```
96
- git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Llama-2-70B-GPTQ`
97
- ```
98
- - In Python Transformers code, the branch is the `revision` parameter; see below.
99
-
100
- ### How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
101
-
102
- Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui), which includes support for Llama 2 models.
103
 
104
- It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
 
105
 
106
- ### Use ExLlama (4-bit models only) - recommended option if you have enough VRAM for 4-bit
 
 
 
 
 
 
107
 
108
- ExLlama has now been updated to support Llama 2 70B, but you will need to update ExLlama to the latest version.
109
 
110
- By default text-generation-webui installs a pre-compiled wheel for ExLlama. Until text-generation-webui updates to reflect the ExLlama changes - which hopefully won't be long - you must uninstall that and then clone ExLlama into the `text-generation-webui/repositories` directory. ExLlama will then compile its kernel on model load.
 
 
 
 
 
 
 
 
 
111
 
112
- Note that this requires that your system is capable of compiling CUDA extensions, which may be an issue on Windows.
113
 
114
- Instructions for Linux One Click Installer:
 
115
 
116
- 1. Change directory into the text-generation-webui main folder: `cd /path/to/text-generation-webui`
117
- 2. Activate the conda env of text-generation-webui:
118
  ```
119
- source "installer_files/conda/etc/profile.d/conda.sh"
120
- conda activate installer_files/env
121
  ```
122
- 3. Run: `pip3 uninstall exllama`
123
- 4. Run: `cd repositories/exllama` followed by `git pull` to update exllama.
124
- 6. Now launch text-generation-webui and follow the instructions below for downloading and running the model. ExLlama should build its kernel when the model first loads.
 
125
 
126
- ### Downloading and running the model in text-generation-webui
 
 
127
 
128
  1. Click the **Model tab**.
129
  2. Under **Download custom model or LoRA**, enter `TheBloke/Llama-2-70B-GPTQ`.
130
  - To download from a specific branch, enter for example `TheBloke/Llama-2-70B-GPTQ:gptq-4bit-32g-actorder_True`
131
  - see Provided Files above for the list of branches for each option.
132
  3. Click **Download**.
133
- 4. The model will start downloading. Once it's finished it will say "Done"
134
- 5. Set Loader to ExLlama if you plan to use a 4-bit file, or else choose AutoGPTQ or GPTQ-for-LLaMA.
135
- - If you use AutoGPTQ, make sure "No inject fused attention" is ticked
136
- 6. In the top left, click the refresh icon next to **Model**.
137
- 7. In the **Model** dropdown, choose the model you just downloaded: `TheBloke/Llama-2-70B-GPTQ`
138
- 8. The model will automatically load, and is now ready for use!
139
- 9. Then click **Save settings for this model** followed by **Reload the Model** in the top right to make sure your settings are persisted.
140
- 10. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
141
-
 
142
  ## How to use this GPTQ model from Python code
143
 
144
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
145
 
146
- ```
147
- GITHUB_ACTIONS=true pip3 install auto-gptq
 
 
 
148
  ```
149
 
150
- You also need the latest Transformers code from Github:
151
 
152
- ```
153
- pip3 install git+https://github.com/huggingface/transformers
 
 
 
154
  ```
155
 
156
- You must set `inject_fused_attention=False` as shown below.
 
 
 
 
 
 
157
 
158
- Then try the following example code:
159
 
160
  ```python
161
- from transformers import AutoTokenizer, pipeline, logging
162
- from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
163
 
164
  model_name_or_path = "TheBloke/Llama-2-70B-GPTQ"
165
- model_basename = "model"
166
-
167
- use_triton = False
 
 
 
168
 
169
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
170
 
171
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
172
- model_basename=model_basename,
173
- inject_fused_attention=False, # Required for Llama 2 70B model at this time.
174
- use_safetensors=True,
175
- trust_remote_code=False,
176
- device="cuda:0",
177
- use_triton=use_triton,
178
- quantize_config=None)
179
-
180
- """
181
- To download from a specific branch, use the revision parameter, as in this example:
182
-
183
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
184
- revision="gptq-4bit-32g-actorder_True",
185
- model_basename=model_basename,
186
- inject_fused_attention=False, # Required for Llama 2 70B model at this time.
187
- use_safetensors=True,
188
- trust_remote_code=False,
189
- device="cuda:0",
190
- quantize_config=None)
191
- """
192
-
193
  prompt = "Tell me about AI"
194
  prompt_template=f'''{prompt}
 
195
  '''
196
 
197
  print("\n\n*** Generate:")
@@ -202,9 +188,6 @@ print(tokenizer.decode(output[0]))
202
 
203
  # Inference can also be done using transformers' pipeline
204
 
205
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
206
- logging.set_verbosity(logging.CRITICAL)
207
-
208
  print("*** Pipeline:")
209
  pipe = pipeline(
210
  "text-generation",
@@ -218,14 +201,17 @@ pipe = pipeline(
218
 
219
  print(pipe(prompt_template)[0]['generated_text'])
220
  ```
 
221
 
 
222
  ## Compatibility
223
 
224
- 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.
225
 
226
- ExLlama is now compatible with Llama 2 70B models, as of [this commit](https://github.com/turboderp/exllama/commit/b3aea521859b83cfd889c4c00c05a323313b7fee).
227
 
228
- Please see the Provided Files table above for per-file compatibility.
 
229
 
230
  <!-- footer start -->
231
  <!-- 200823 -->
@@ -250,7 +236,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
250
 
251
  **Special thanks to**: Aemon Algiz.
252
 
253
- **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
254
 
255
 
256
  Thank you to all my generous patrons and donaters!
@@ -259,7 +245,7 @@ And thank you again to a16z for their generous grant.
259
 
260
  <!-- footer end -->
261
 
262
- # Original model card: Meta's Llama 2 70B
263
 
264
  # **Llama 2**
265
  Llama 2 is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. This is the repository for the 70B pretrained model, converted for the Hugging Face Transformers format. Links to other models can be found in the index at the bottom.
@@ -294,6 +280,8 @@ Meta developed and publicly released the Llama 2 family of large language models
294
 
295
  **License** A custom commercial license is available at: [https://ai.meta.com/resources/models-and-libraries/llama-downloads/](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)
296
 
 
 
297
  ## Intended Use
298
  **Intended Use Cases** Llama 2 is intended for commercial and research use in English. Tuned models are intended for assistant-like chat, whereas pretrained models can be adapted for a variety of natural language generation tasks.
299
 
 
3
  language:
4
  - en
5
  license: other
6
+ model_creator: Meta Llama 2
7
+ model_link: https://huggingface.co/meta-llama/Llama-2-70b-hf
8
+ model_name: Llama 2 70B
9
  model_type: llama
10
  pipeline_tag: text-generation
11
+ quantized_by: TheBloke
12
  tags:
13
  - facebook
14
  - meta
 
34
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
35
  <!-- header end -->
36
 
37
+ # Llama 2 70B - GPTQ
38
+ - Model creator: [Meta Llama 2](https://huggingface.co/meta-llama)
39
+ - Original model: [Llama 2 70B](https://huggingface.co/meta-llama/Llama-2-70b-hf)
40
 
41
+ <!-- description start -->
42
+ ## Description
43
 
44
+ This repo contains GPTQ model files for [Meta Llama 2's Llama 2 70B](https://huggingface.co/meta-llama/Llama-2-70b-hf).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
+ 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.
 
 
47
 
48
+ <!-- description end -->
49
+ <!-- repositories-available start -->
50
  ## Repositories available
51
 
52
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ)
53
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Llama-2-70B-GGUF)
54
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference (deprecated)](https://huggingface.co/TheBloke/Llama-2-70B-GGML)
55
+ * [Meta Llama 2's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/meta-llama/Llama-2-70b-hf)
56
+ <!-- repositories-available end -->
57
 
58
+ <!-- prompt-template start -->
59
  ## Prompt template: None
60
 
61
  ```
62
  {prompt}
63
+
64
  ```
65
 
66
+ <!-- prompt-template end -->
67
+
68
+ <!-- README_GPTQ.md-provided-files start -->
69
+ ## Provided files and GPTQ parameters
70
 
71
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
72
 
73
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
74
 
75
+ 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.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
+ <details>
78
+ <summary>Explanation of GPTQ parameters</summary>
79
 
80
+ - Bits: The bit size of the quantised model.
81
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
82
+ - 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.
83
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
84
+ - 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).
85
+ - 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.
86
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
87
 
88
+ </details>
89
 
90
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
91
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
92
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 40.66 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
93
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 37.99 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. |
94
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 36.65 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. |
95
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 28.03 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False but poor AutoGPTQ CUDA speed. |
96
+ | [gptq-3bit-128g-actorder_False](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ/tree/gptq-3bit-128g-actorder_False) | 3 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 28.03 GB | No | 3-bit, with group size 128g but no act-order. Slightly higher VRAM requirements than 3-bit None. |
97
+ | [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 26.78 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
98
+ | [gptq-3bit-64g-actorder_True](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ/tree/gptq-3bit-64g-actorder_True) | 3 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 29.30 GB | No | 3-bit, with group size 64g and act-order. Poor AutoGPTQ CUDA speed. |
99
+ | [main](https://huggingface.co/TheBloke/Llama-2-70B-GPTQ/tree/main) | 4 | None | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 35.33 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
100
 
101
+ <!-- README_GPTQ.md-provided-files end -->
102
 
103
+ <!-- README_GPTQ.md-download-from-branches start -->
104
+ ## How to download from branches
105
 
106
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Llama-2-70B-GPTQ:gptq-4bit-32g-actorder_True`
107
+ - With Git, you can clone a branch with:
108
  ```
109
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Llama-2-70B-GPTQ
 
110
  ```
111
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
112
+ <!-- README_GPTQ.md-download-from-branches end -->
113
+ <!-- README_GPTQ.md-text-generation-webui start -->
114
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
115
 
116
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
117
+
118
+ 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.
119
 
120
  1. Click the **Model tab**.
121
  2. Under **Download custom model or LoRA**, enter `TheBloke/Llama-2-70B-GPTQ`.
122
  - To download from a specific branch, enter for example `TheBloke/Llama-2-70B-GPTQ:gptq-4bit-32g-actorder_True`
123
  - see Provided Files above for the list of branches for each option.
124
  3. Click **Download**.
125
+ 4. The model will start downloading. Once it's finished it will say "Done".
126
+ 5. In the top left, click the refresh icon next to **Model**.
127
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Llama-2-70B-GPTQ`
128
+ 7. The model will automatically load, and is now ready for use!
129
+ 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.
130
+ * 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`.
131
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
132
+ <!-- README_GPTQ.md-text-generation-webui end -->
133
+
134
+ <!-- README_GPTQ.md-use-from-python start -->
135
  ## How to use this GPTQ model from Python code
136
 
137
+ ### Install the necessary packages
138
 
139
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
140
+
141
+ ```shell
142
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
143
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
144
  ```
145
 
146
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
147
 
148
+ ```shell
149
+ pip3 uninstall -y auto-gptq
150
+ git clone https://github.com/PanQiWei/AutoGPTQ
151
+ cd AutoGPTQ
152
+ pip3 install .
153
  ```
154
 
155
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
156
+
157
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
158
+ ```shell
159
+ pip3 uninstall -y transformers
160
+ pip3 install git+https://github.com/huggingface/transformers.git
161
+ ```
162
 
163
+ ### You can then use the following code
164
 
165
  ```python
166
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
167
 
168
  model_name_or_path = "TheBloke/Llama-2-70B-GPTQ"
169
+ # To use a different branch, change revision
170
+ # For example: revision="gptq-4bit-32g-actorder_True"
171
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
172
+ torch_dtype=torch.float16,
173
+ device_map="auto",
174
+ revision="main")
175
 
176
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  prompt = "Tell me about AI"
179
  prompt_template=f'''{prompt}
180
+
181
  '''
182
 
183
  print("\n\n*** Generate:")
 
188
 
189
  # Inference can also be done using transformers' pipeline
190
 
 
 
 
191
  print("*** Pipeline:")
192
  pipe = pipeline(
193
  "text-generation",
 
201
 
202
  print(pipe(prompt_template)[0]['generated_text'])
203
  ```
204
+ <!-- README_GPTQ.md-use-from-python end -->
205
 
206
+ <!-- README_GPTQ.md-compatibility start -->
207
  ## Compatibility
208
 
209
+ 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).
210
 
211
+ [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.
212
 
213
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
214
+ <!-- README_GPTQ.md-compatibility end -->
215
 
216
  <!-- footer start -->
217
  <!-- 200823 -->
 
236
 
237
  **Special thanks to**: Aemon Algiz.
238
 
239
+ **Patreon special mentions**: Russ Johnson, J, alfie_i, Alex, NimbleBox.ai, Chadd, Mandus, Nikolai Manek, Ken Nordquist, ya boyyy, Illia Dulskyi, Viktor Bowallius, vamX, Iucharbius, zynix, Magnesian, Clay Pascal, Pierre Kircher, Enrico Ros, Tony Hughes, Elle, Andrey, knownsqashed, Deep Realms, Jerry Meng, Lone Striker, Derek Yates, Pyrater, Mesiah Bishop, James Bentley, Femi Adebogun, Brandon Frisco, SuperWojo, Alps Aficionado, Michael Dempsey, Vitor Caleffi, Will Dee, Edmond Seymore, usrbinkat, LangChain4j, Kacper Wikieł, Luke Pendergrass, John Detwiler, theTransient, Nathan LeClaire, Tiffany J. Kim, biorpg, Eugene Pentland, Stanislav Ovsiannikov, Fred von Graf, terasurfer, Kalila, Dan Guido, Nitin Borwankar, 阿明, Ai Maven, John Villwock, Gabriel Puliatti, Stephen Murray, Asp the Wyvern, danny, Chris Smitley, ReadyPlayerEmma, S_X, Daniel P. Andersen, Olakabola, Jeffrey Morgan, Imad Khwaja, Caitlyn Gatomon, webtim, Alicia Loh, Trenton Dambrowitz, Swaroop Kallakuri, Erik Bjäreholt, Leonard Tan, Spiking Neurons AB, Luke @flexchar, Ajan Kanaga, Thomas Belote, Deo Leter, RoA, Willem Michiel, transmissions 11, subjectnull, Matthew Berman, Joseph William Delisle, David Ziegler, Michael Davis, Johann-Peter Hartmann, Talal Aujan, senxiiz, Artur Olbinski, Rainer Wilmers, Spencer Kim, Fen Risland, Cap'n Zoog, Rishabh Srivastava, Michael Levine, Geoffrey Montalvo, Sean Connelly, Alexandros Triantafyllidis, Pieter, Gabriel Tamborski, Sam, Subspace Studios, Junyu Yang, Pedro Madruga, Vadim, Cory Kujawski, K, Raven Klaugh, Randy H, Mano Prime, Sebastain Graf, Space Cruiser
240
 
241
 
242
  Thank you to all my generous patrons and donaters!
 
245
 
246
  <!-- footer end -->
247
 
248
+ # Original model card: Meta Llama 2's Llama 2 70B
249
 
250
  # **Llama 2**
251
  Llama 2 is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. This is the repository for the 70B pretrained model, converted for the Hugging Face Transformers format. Links to other models can be found in the index at the bottom.
 
280
 
281
  **License** A custom commercial license is available at: [https://ai.meta.com/resources/models-and-libraries/llama-downloads/](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)
282
 
283
+ **Research Paper** ["Llama-2: Open Foundation and Fine-tuned Chat Models"](arxiv.org/abs/2307.09288)
284
+
285
  ## Intended Use
286
  **Intended Use Cases** Llama 2 is intended for commercial and research use in English. Tuned models are intended for assistant-like chat, whereas pretrained models can be adapted for a variety of natural language generation tasks.
287