TheBloke commited on
Commit
d69f992
1 Parent(s): e8ac856

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +66 -52
README.md CHANGED
@@ -4,7 +4,7 @@ datasets:
4
  inference: false
5
  language:
6
  - en
7
- license: other
8
  model_creator: Eric Hartford
9
  model_link: https://huggingface.co/ehartford/dolphin-llama2-7b
10
  model_name: Dolphin Llama2 7B
@@ -33,40 +33,50 @@ quantized_by: TheBloke
33
  - Model creator: [Eric Hartford](https://huggingface.co/ehartford)
34
  - Original model: [Dolphin Llama2 7B](https://huggingface.co/ehartford/dolphin-llama2-7b)
35
 
 
36
  ## Description
37
 
38
  This repo contains GPTQ model files for [Eric Hartford's Dolphin Llama2 7B](https://huggingface.co/ehartford/dolphin-llama2-7b).
39
 
40
  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.
41
 
 
 
42
  ## Repositories available
43
 
44
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ)
45
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GGML)
 
46
  * [Eric Hartford's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ehartford/dolphin-llama2-7b)
 
47
 
 
48
  ## Prompt template: Orca-Vicuna
49
 
50
  ```
51
  SYSTEM: {system_message}
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.
@@ -76,13 +86,16 @@ All GPTQ files are made with AutoGPTQ.
76
 
77
  | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
78
  | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
79
- | [main](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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/Dolphin-Llama2-7B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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/Dolphin-Llama2-7B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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/Dolphin-Llama2-7B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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/Dolphin-Llama2-7B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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/Dolphin-Llama2-7B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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/Dolphin-Llama2-7B-GPTQ:gptq-4bit-32g-actorder_True`
@@ -91,78 +104,77 @@ All GPTQ files are made with AutoGPTQ.
91
  git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Dolphin-Llama2-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/Dolphin-Llama2-7B-GPTQ`.
103
  - To download from a specific branch, enter for example `TheBloke/Dolphin-Llama2-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: `Dolphin-Llama2-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/Dolphin-Llama2-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
- system_message = "You are a helpful assistant"
163
  prompt_template=f'''SYSTEM: {system_message}
164
  USER: {prompt}
165
  ASSISTANT:
 
166
  '''
167
 
168
  print("\n\n*** Generate:")
@@ -173,9 +185,6 @@ print(tokenizer.decode(output[0]))
173
 
174
  # Inference can also be done using transformers' pipeline
175
 
176
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
177
- logging.set_verbosity(logging.CRITICAL)
178
-
179
  print("*** Pipeline:")
180
  pipe = pipeline(
181
  "text-generation",
@@ -189,12 +198,17 @@ pipe = pipeline(
189
 
190
  print(pipe(prompt_template)[0]['generated_text'])
191
  ```
 
192
 
 
193
  ## Compatibility
194
 
195
- 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.
 
 
196
 
197
- ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
 
198
 
199
  <!-- footer start -->
200
  <!-- 200823 -->
@@ -219,7 +233,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
219
 
220
  **Special thanks to**: Aemon Algiz.
221
 
222
- **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
223
 
224
 
225
  Thank you to all my generous patrons and donaters!
@@ -259,11 +273,11 @@ We also filtered out duplicates and cleaned the data.
259
  We trained with the flan5m (gpt3.5 completions) dataset in its entirety for 3 epochs at a learning rate of 2e-5 before we stopped training to avoid overfit.
260
  We trained with the flan1m (gpt4 completions) dataset in its entirety for 2.5 epochs at a learning rate of 1e-5 before we stopped training to avoid overfit.
261
  It took about 400 hours to train on 8x A100s
262
- We used a prompt format similar to Vicuna, but we added the SYSTEM: field.
263
 
264
  Prompt format:
265
  ```
266
- SYSTEM: {system}
267
  USER: {prompt}
268
  ASSISTANT:
269
  ```
@@ -292,7 +306,7 @@ The core Dolphin Team includes:
292
  ```
293
  SYSTEM: you are an expert mechanic
294
  USER: Please tell me step by step how to fix my car that won't start.
295
- ASSISTANT: To help your vehicle start, I will guide you through a step-by-step process on what could be causing the issue and how to resolve it.
296
 
297
  1. Check for obvious issues: First, inspect the exterior of the car to identify any visible problems such as damage or obstructions which might affect its ability to start. Make sure there is no debris in the air intakes or exhaust system.
298
 
 
4
  inference: false
5
  language:
6
  - en
7
+ license: llama2
8
  model_creator: Eric Hartford
9
  model_link: https://huggingface.co/ehartford/dolphin-llama2-7b
10
  model_name: Dolphin Llama2 7B
 
33
  - Model creator: [Eric Hartford](https://huggingface.co/ehartford)
34
  - Original model: [Dolphin Llama2 7B](https://huggingface.co/ehartford/dolphin-llama2-7b)
35
 
36
+ <!-- description start -->
37
  ## Description
38
 
39
  This repo contains GPTQ model files for [Eric Hartford's Dolphin Llama2 7B](https://huggingface.co/ehartford/dolphin-llama2-7b).
40
 
41
  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.
42
 
43
+ <!-- description end -->
44
+ <!-- repositories-available start -->
45
  ## Repositories available
46
 
47
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ)
48
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GGUF)
49
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference (deprecated)](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GGML)
50
  * [Eric Hartford's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ehartford/dolphin-llama2-7b)
51
+ <!-- repositories-available end -->
52
 
53
+ <!-- prompt-template start -->
54
  ## Prompt template: Orca-Vicuna
55
 
56
  ```
57
  SYSTEM: {system_message}
58
  USER: {prompt}
59
  ASSISTANT:
60
+
61
  ```
62
 
63
+ <!-- prompt-template end -->
64
+
65
+ <!-- README_GPTQ.md-provided-files start -->
66
  ## Provided files and GPTQ parameters
67
 
68
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
69
 
70
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
71
 
72
+ 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.
73
 
74
  <details>
75
  <summary>Explanation of GPTQ parameters</summary>
76
 
77
  - Bits: The bit size of the quantised model.
78
  - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
79
+ - 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.
80
  - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
81
  - 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).
82
  - 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
 
87
  | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
88
  | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
89
+ | [main](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.90 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
90
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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. |
91
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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. |
92
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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. |
93
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.01 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
94
  | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 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. |
95
 
96
+ <!-- README_GPTQ.md-provided-files end -->
97
+
98
+ <!-- README_GPTQ.md-download-from-branches start -->
99
  ## How to download from branches
100
 
101
  - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Dolphin-Llama2-7B-GPTQ:gptq-4bit-32g-actorder_True`
 
104
  git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Dolphin-Llama2-7B-GPTQ
105
  ```
106
  - In Python Transformers code, the branch is the `revision` parameter; see below.
107
+ <!-- README_GPTQ.md-download-from-branches end -->
108
+ <!-- README_GPTQ.md-text-generation-webui start -->
109
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
110
 
111
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
112
 
113
+ 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.
114
 
115
  1. Click the **Model tab**.
116
  2. Under **Download custom model or LoRA**, enter `TheBloke/Dolphin-Llama2-7B-GPTQ`.
117
  - To download from a specific branch, enter for example `TheBloke/Dolphin-Llama2-7B-GPTQ:gptq-4bit-32g-actorder_True`
118
  - see Provided Files above for the list of branches for each option.
119
  3. Click **Download**.
120
+ 4. The model will start downloading. Once it's finished it will say "Done".
121
  5. In the top left, click the refresh icon next to **Model**.
122
  6. In the **Model** dropdown, choose the model you just downloaded: `Dolphin-Llama2-7B-GPTQ`
123
  7. The model will automatically load, and is now ready for use!
124
  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.
125
+ * 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`.
126
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
127
+ <!-- README_GPTQ.md-text-generation-webui end -->
128
 
129
+ <!-- README_GPTQ.md-use-from-python start -->
130
  ## How to use this GPTQ model from Python code
131
 
132
+ ### Install the necessary packages
133
 
134
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
 
 
135
 
136
+ ```shell
137
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
138
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
139
  ```
140
+
141
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
142
+
143
+ ```shell
144
  pip3 uninstall -y auto-gptq
145
  git clone https://github.com/PanQiWei/AutoGPTQ
146
  cd AutoGPTQ
147
  pip3 install .
148
  ```
149
 
150
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
151
+
152
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
153
+ ```shell
154
+ pip3 uninstall -y transformers
155
+ pip3 install git+https://github.com/huggingface/transformers.git
156
+ ```
157
+
158
+ ### You can then use the following code
159
 
160
  ```python
161
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
162
 
163
  model_name_or_path = "TheBloke/Dolphin-Llama2-7B-GPTQ"
164
+ # To use a different branch, change revision
165
+ # For example: revision="gptq-4bit-32g-actorder_True"
166
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
167
+ torch_dtype=torch.float16,
168
+ device_map="auto",
169
+ revision="main")
170
 
171
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  prompt = "Tell me about AI"
 
174
  prompt_template=f'''SYSTEM: {system_message}
175
  USER: {prompt}
176
  ASSISTANT:
177
+
178
  '''
179
 
180
  print("\n\n*** Generate:")
 
185
 
186
  # Inference can also be done using transformers' pipeline
187
 
 
 
 
188
  print("*** Pipeline:")
189
  pipe = pipeline(
190
  "text-generation",
 
198
 
199
  print(pipe(prompt_template)[0]['generated_text'])
200
  ```
201
+ <!-- README_GPTQ.md-use-from-python end -->
202
 
203
+ <!-- README_GPTQ.md-compatibility start -->
204
  ## Compatibility
205
 
206
+ 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).
207
+
208
+ [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.
209
 
210
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
211
+ <!-- README_GPTQ.md-compatibility end -->
212
 
213
  <!-- footer start -->
214
  <!-- 200823 -->
 
233
 
234
  **Special thanks to**: Aemon Algiz.
235
 
236
+ **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
237
 
238
 
239
  Thank you to all my generous patrons and donaters!
 
273
  We trained with the flan5m (gpt3.5 completions) dataset in its entirety for 3 epochs at a learning rate of 2e-5 before we stopped training to avoid overfit.
274
  We trained with the flan1m (gpt4 completions) dataset in its entirety for 2.5 epochs at a learning rate of 1e-5 before we stopped training to avoid overfit.
275
  It took about 400 hours to train on 8x A100s
276
+ We used a prompt format similar to Vicuna, but we added the SYSTEM: field.
277
 
278
  Prompt format:
279
  ```
280
+ SYSTEM: You are an autoregressive language model that has been fine-tuned with instruction-tuning and RLHF. You carefully provide accurate, factual, thoughtful, nuanced answers, and are brilliant at reasoning. If you think there might not be a correct answer, you say so. Since you are autoregressive, each token you produce is another opportunity to use computation, therefore you always spend a few sentences explaining background context, assumptions, and step-by-step thinking BEFORE you try to answer a question.
281
  USER: {prompt}
282
  ASSISTANT:
283
  ```
 
306
  ```
307
  SYSTEM: you are an expert mechanic
308
  USER: Please tell me step by step how to fix my car that won't start.
309
+ ASSISTANT: To help your vehicle start, I will guide you through a step-by-step process on what could be causing the issue and how to resolve it.
310
 
311
  1. Check for obvious issues: First, inspect the exterior of the car to identify any visible problems such as damage or obstructions which might affect its ability to start. Make sure there is no debris in the air intakes or exhaust system.
312