TheBloke commited on
Commit
c84c23e
1 Parent(s): 71886c5

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +124 -69
README.md CHANGED
@@ -1,11 +1,20 @@
1
  ---
 
2
  datasets:
3
  - ehartford/wizard_vicuna_70k_unfiltered
4
  inference: false
5
  language:
6
  - en
7
  license: other
 
 
8
  model_type: llama
 
 
 
 
 
 
9
  tags:
10
  - uncensored
11
  ---
@@ -27,150 +36,194 @@ tags:
27
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
28
  <!-- header end -->
29
 
30
- # Wizard-Vicuna-7B-Uncensored GPTQ
 
 
31
 
32
- These files are GPTQ model files for [Wizard-Vicuna-7B-Uncensored](https://huggingface.co/ehartford/Wizard-Vicuna-7B-Uncensored).
 
33
 
34
- 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.
35
 
36
- These models were quantised using hardware kindly provided by [Latitude.sh](https://www.latitude.sh/accelerate).
37
 
 
 
38
  ## Repositories available
39
 
 
40
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ)
41
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GGML)
42
- * [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ehartford/Wizard-Vicuna-7B-Uncensored)
 
43
 
 
44
  ## Prompt template: Vicuna
45
 
46
  ```
47
- A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
48
 
49
- USER: {prompt}
50
- ASSISTANT:
51
  ```
52
 
53
- ## Provided files
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
56
 
57
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
58
 
59
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
60
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
61
- | main | 4 | 128 | False | 4.52 GB | True | GPTQ-for-LLaMa | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
62
- | gptq-4bit-32g-actorder_True | 4 | 32 | True | 4.28 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. |
63
- | gptq-4bit-64g-actorder_True | 4 | 64 | True | 4.02 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. |
64
- | gptq-4bit-128g-actorder_True | 4 | 128 | True | 3.90 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. |
65
- | gptq-8bit--1g-actorder_True | 8 | None | True | 7.01 GB | False | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
66
- | gptq-8bit-128g-actorder_False | 8 | 128 | False | 7.16 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
67
- | gptq-8bit-128g-actorder_True | 8 | 128 | True | 7.16 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. |
68
- | gptq-8bit-64g-actorder_True | 8 | 64 | True | 7.31 GB | False | AutoGPTQ | 8-bit, with group size 64g and Act Order for maximum inference quality. Poor AutoGPTQ CUDA speed. |
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  ## How to download from branches
71
 
72
- - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ:gptq-4bit-32g-actorder_True`
73
  - With Git, you can clone a branch with:
74
  ```
75
- git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ`
76
  ```
77
  - In Python Transformers code, the branch is the `revision` parameter; see below.
78
-
 
79
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
80
 
81
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
82
 
83
- It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
84
 
85
  1. Click the **Model tab**.
86
  2. Under **Download custom model or LoRA**, enter `TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ`.
87
- - To download from a specific branch, enter for example `TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ:gptq-4bit-32g-actorder_True`
88
  - see Provided Files above for the list of branches for each option.
89
  3. Click **Download**.
90
- 4. The model will start downloading. Once it's finished it will say "Done"
91
  5. In the top left, click the refresh icon next to **Model**.
92
  6. In the **Model** dropdown, choose the model you just downloaded: `Wizard-Vicuna-7B-Uncensored-GPTQ`
93
  7. The model will automatically load, and is now ready for use!
94
  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.
95
- * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
96
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
 
97
 
 
98
  ## How to use this GPTQ model from Python code
99
 
100
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
101
 
102
- `GITHUB_ACTIONS=true pip install auto-gptq`
103
 
104
- Then try the following example code:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
  ```python
107
- from transformers import AutoTokenizer, pipeline, logging
108
- from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
109
 
110
  model_name_or_path = "TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ"
111
- model_basename = "Wizard-Vicuna-7B-Uncensored-GPTQ-4bit-128g.no-act.order"
112
-
113
- use_triton = False
 
 
 
114
 
115
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
116
 
117
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
118
- model_basename=model_basename
119
- use_safetensors=True,
120
- trust_remote_code=True,
121
- device="cuda:0",
122
- use_triton=use_triton,
123
- quantize_config=None)
124
-
125
- """
126
- To download from a specific branch, use the revision parameter, as in this example:
127
-
128
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
129
- revision="gptq-4bit-32g-actorder_True",
130
- model_basename=model_basename,
131
- use_safetensors=True,
132
- trust_remote_code=True,
133
- device="cuda:0",
134
- quantize_config=None)
135
- """
136
-
137
  prompt = "Tell me about AI"
138
- 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.
139
 
140
- USER: {prompt}
141
- ASSISTANT:
142
  '''
143
 
144
  print("\n\n*** Generate:")
145
 
146
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
147
- output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
148
  print(tokenizer.decode(output[0]))
149
 
150
  # Inference can also be done using transformers' pipeline
151
 
152
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
153
- logging.set_verbosity(logging.CRITICAL)
154
-
155
  print("*** Pipeline:")
156
  pipe = pipeline(
157
  "text-generation",
158
  model=model,
159
  tokenizer=tokenizer,
160
  max_new_tokens=512,
 
161
  temperature=0.7,
162
  top_p=0.95,
163
- repetition_penalty=1.15
 
164
  )
165
 
166
  print(pipe(prompt_template)[0]['generated_text'])
167
  ```
 
168
 
 
169
  ## Compatibility
170
 
171
- 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.
 
 
172
 
173
- ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
 
174
 
175
  <!-- footer start -->
176
  <!-- 200823 -->
@@ -180,10 +233,12 @@ For further support, and discussions on these models and AI in general, join us
180
 
181
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
182
 
183
- ## Thanks, and how to contribute.
184
 
185
  Thanks to the [chirper.ai](https://chirper.ai) team!
186
 
 
 
187
  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.
188
 
189
  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.
@@ -195,7 +250,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
195
 
196
  **Special thanks to**: Aemon Algiz.
197
 
198
- **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
199
 
200
 
201
  Thank you to all my generous patrons and donaters!
@@ -211,9 +266,9 @@ This is [wizard-vicuna-13b](https://huggingface.co/junelee/wizard-vicuna-13b) tr
211
 
212
  Shout out to the open source AI/ML community, and everyone who helped me out.
213
 
214
- Note:
215
 
216
- An uncensored model has no guardrails.
217
 
218
  You are responsible for anything you do with the model, just as you are responsible for anything you do with any dangerous object such as a knife, gun, lighter, or car.
219
 
 
1
  ---
2
+ base_model: https://huggingface.co/ehartford/Wizard-Vicuna-7B-Uncensored
3
  datasets:
4
  - ehartford/wizard_vicuna_70k_unfiltered
5
  inference: false
6
  language:
7
  - en
8
  license: other
9
+ model_creator: Eric Hartford
10
+ model_name: Wizard Vicuna 7B Uncensored
11
  model_type: llama
12
+ prompt_template: 'A chat between a curious user and an artificial intelligence assistant.
13
+ The assistant gives helpful, detailed, and polite answers to the user''s questions.
14
+ USER: {prompt} ASSISTANT:
15
+
16
+ '
17
+ quantized_by: TheBloke
18
  tags:
19
  - uncensored
20
  ---
 
36
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
37
  <!-- header end -->
38
 
39
+ # Wizard Vicuna 7B Uncensored - GPTQ
40
+ - Model creator: [Eric Hartford](https://huggingface.co/ehartford)
41
+ - Original model: [Wizard Vicuna 7B Uncensored](https://huggingface.co/ehartford/Wizard-Vicuna-7B-Uncensored)
42
 
43
+ <!-- description start -->
44
+ ## Description
45
 
46
+ This repo contains GPTQ model files for [Wizard-Vicuna-7B-Uncensored](https://huggingface.co/ehartford/Wizard-Vicuna-7B-Uncensored).
47
 
48
+ 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.
49
 
50
+ <!-- description end -->
51
+ <!-- repositories-available start -->
52
  ## Repositories available
53
 
54
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-AWQ)
55
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ)
56
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GGUF)
57
+ * [Eric Hartford's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ehartford/Wizard-Vicuna-7B-Uncensored)
58
+ <!-- repositories-available end -->
59
 
60
+ <!-- prompt-template start -->
61
  ## Prompt template: Vicuna
62
 
63
  ```
64
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
65
 
 
 
66
  ```
67
 
68
+ <!-- prompt-template end -->
69
+ <!-- licensing start -->
70
+ ## Licensing
71
+
72
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
73
+
74
+ 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.
75
+
76
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Wizard-Vicuna-7B-Uncensored](https://huggingface.co/ehartford/Wizard-Vicuna-7B-Uncensored).
77
+ <!-- licensing end -->
78
+ <!-- README_GPTQ.md-provided-files start -->
79
+ ## Provided files and GPTQ parameters
80
 
81
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
82
 
83
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
84
 
85
+ 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.
86
+
87
+ <details>
88
+ <summary>Explanation of GPTQ parameters</summary>
 
 
 
 
 
 
89
 
90
+ - Bits: The bit size of the quantised model.
91
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
92
+ - 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.
93
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
94
+ - 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).
95
+ - 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.
96
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
97
+
98
+ </details>
99
+
100
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
101
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
102
+ | [main](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ/tree/main) | 4 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 4.52 GB | Yes | 4-bit, without Act Order and group size 128g. |
103
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 4.28 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
104
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 4.02 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
105
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 3.90 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
106
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 7.01 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
107
+ | [gptq-8bit-128g-actorder_False](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ/tree/gptq-8bit-128g-actorder_False) | 8 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 7.16 GB | No | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
108
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 7.16 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
109
+ | [gptq-8bit-64g-actorder_True](https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ/tree/gptq-8bit-64g-actorder_True) | 8 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 7.31 GB | No | 8-bit, with group size 64g and Act Order for even higher inference quality. Poor AutoGPTQ CUDA speed. |
110
+
111
+ <!-- README_GPTQ.md-provided-files end -->
112
+
113
+ <!-- README_GPTQ.md-download-from-branches start -->
114
  ## How to download from branches
115
 
116
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ:main`
117
  - With Git, you can clone a branch with:
118
  ```
119
+ git clone --single-branch --branch main https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ
120
  ```
121
  - In Python Transformers code, the branch is the `revision` parameter; see below.
122
+ <!-- README_GPTQ.md-download-from-branches end -->
123
+ <!-- README_GPTQ.md-text-generation-webui start -->
124
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
125
 
126
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
127
 
128
+ 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.
129
 
130
  1. Click the **Model tab**.
131
  2. Under **Download custom model or LoRA**, enter `TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ`.
132
+ - To download from a specific branch, enter for example `TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ:main`
133
  - see Provided Files above for the list of branches for each option.
134
  3. Click **Download**.
135
+ 4. The model will start downloading. Once it's finished it will say "Done".
136
  5. In the top left, click the refresh icon next to **Model**.
137
  6. In the **Model** dropdown, choose the model you just downloaded: `Wizard-Vicuna-7B-Uncensored-GPTQ`
138
  7. The model will automatically load, and is now ready for use!
139
  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.
140
+ * 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`.
141
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
142
+ <!-- README_GPTQ.md-text-generation-webui end -->
143
 
144
+ <!-- README_GPTQ.md-use-from-python start -->
145
  ## How to use this GPTQ model from Python code
146
 
147
+ ### Install the necessary packages
148
 
149
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
150
 
151
+ ```shell
152
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
153
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
154
+ ```
155
+
156
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
157
+
158
+ ```shell
159
+ pip3 uninstall -y auto-gptq
160
+ git clone https://github.com/PanQiWei/AutoGPTQ
161
+ cd AutoGPTQ
162
+ pip3 install .
163
+ ```
164
+
165
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
166
+
167
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
168
+ ```shell
169
+ pip3 uninstall -y transformers
170
+ pip3 install git+https://github.com/huggingface/transformers.git
171
+ ```
172
+
173
+ ### You can then use the following code
174
 
175
  ```python
176
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
177
 
178
  model_name_or_path = "TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ"
179
+ # To use a different branch, change revision
180
+ # For example: revision="main"
181
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
182
+ device_map="auto",
183
+ trust_remote_code=True,
184
+ revision="main")
185
 
186
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  prompt = "Tell me about AI"
189
+ 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. USER: {prompt} 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!
 
266
 
267
  Shout out to the open source AI/ML community, and everyone who helped me out.
268
 
269
+ Note:
270
 
271
+ An uncensored model has no guardrails.
272
 
273
  You are responsible for anything you do with the model, just as you are responsible for anything you do with any dangerous object such as a knife, gun, lighter, or car.
274