TheBloke commited on
Commit
2c53500
1 Parent(s): 15733d8

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +121 -70
README.md CHANGED
@@ -2,8 +2,12 @@
2
  inference: false
3
  language:
4
  - en
5
- license: other
 
 
 
6
  model_type: llama
 
7
  tags:
8
  - llama-2
9
  - self-instruct
@@ -28,151 +32,196 @@ tags:
28
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
29
  <!-- header end -->
30
 
31
- # Nous Research's Nous Hermes Llama 2 13B GPTQ
 
 
32
 
33
- These files are GPTQ model files for [Nous Research's Nous Hermes Llama 2 13B](https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b).
 
34
 
35
- 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.
36
 
 
37
 
 
 
38
  ## Repositories available
39
 
40
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ)
41
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GGML)
42
- * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b)
 
 
43
 
 
44
  ## Prompt template: Alpaca
45
 
46
  ```
47
  Below is an instruction that describes a task. Write a response that appropriately completes the request.
48
 
49
- ### Instruction: {prompt}
 
50
 
51
  ### Response:
 
52
  ```
53
 
54
- ## Provided files
 
 
 
55
 
56
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
57
 
58
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
59
 
60
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
61
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
62
- | main | 4 | 128 | False | 7.26 GB | True | AutoGPTQ | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
63
- | gptq-4bit-32g-actorder_True | 4 | 32 | True | 8.00 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 32g gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
64
- | gptq-4bit-64g-actorder_True | 4 | 64 | True | 7.51 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 64g uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
65
- | gptq-4bit-128g-actorder_True | 4 | 128 | True | 7.26 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 128g uses even less VRAM, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
66
- | gptq-8bit-128g-actorder_True | 8 | 128 | True | 13.65 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. |
67
- | gptq-8bit-64g-actorder_True | 8 | 64 | True | 13.95 GB | False | AutoGPTQ | 8-bit, with group size 64g and Act Order for maximum inference quality. Poor AutoGPTQ CUDA speed. |
68
- | gptq-8bit-128g-actorder_False | 8 | 128 | False | 13.65 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
69
- | gptq-8bit--1g-actorder_True | 8 | None | True | 13.36 GB | False | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
 
 
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  ## How to download from branches
72
 
73
  - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Nous-Hermes-Llama2-GPTQ:gptq-4bit-32g-actorder_True`
74
  - With Git, you can clone a branch with:
75
  ```
76
- git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ`
77
  ```
78
  - In Python Transformers code, the branch is the `revision` parameter; see below.
79
-
 
80
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
81
 
82
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
83
 
84
- It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
85
 
86
  1. Click the **Model tab**.
87
  2. Under **Download custom model or LoRA**, enter `TheBloke/Nous-Hermes-Llama2-GPTQ`.
88
  - To download from a specific branch, enter for example `TheBloke/Nous-Hermes-Llama2-GPTQ:gptq-4bit-32g-actorder_True`
89
  - see Provided Files above for the list of branches for each option.
90
  3. Click **Download**.
91
- 4. The model will start downloading. Once it's finished it will say "Done"
92
  5. In the top left, click the refresh icon next to **Model**.
93
  6. In the **Model** dropdown, choose the model you just downloaded: `Nous-Hermes-Llama2-GPTQ`
94
  7. The model will automatically load, and is now ready for use!
95
  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.
96
- * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
97
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
 
98
 
 
99
  ## How to use this GPTQ model from Python code
100
 
101
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
102
 
103
- `GITHUB_ACTIONS=true pip install auto-gptq`
104
 
105
- Then try the following example code:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
  ```python
108
- from transformers import AutoTokenizer, pipeline, logging
109
- from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
110
 
111
  model_name_or_path = "TheBloke/Nous-Hermes-Llama2-GPTQ"
112
- model_basename = "model"
113
-
114
- use_triton = False
 
 
 
115
 
116
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
117
 
118
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
119
- model_basename=model_basename,
120
- use_safetensors=True,
121
- trust_remote_code=False,
122
- device="cuda:0",
123
- use_triton=use_triton,
124
- quantize_config=None)
125
-
126
- """
127
- To download from a specific branch, use the revision parameter, as in this example:
128
-
129
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
130
- revision="gptq-4bit-32g-actorder_True",
131
- model_basename=model_basename,
132
- use_safetensors=True,
133
- trust_remote_code=False,
134
- device="cuda:0",
135
- quantize_config=None)
136
- """
137
-
138
  prompt = "Tell me about AI"
139
  prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
140
 
141
- ### Instruction: {prompt}
 
142
 
143
  ### Response:
 
144
  '''
145
 
146
  print("\n\n*** Generate:")
147
 
148
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
149
- output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
150
  print(tokenizer.decode(output[0]))
151
 
152
  # Inference can also be done using transformers' pipeline
153
 
154
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
155
- logging.set_verbosity(logging.CRITICAL)
156
-
157
  print("*** Pipeline:")
158
  pipe = pipeline(
159
  "text-generation",
160
  model=model,
161
  tokenizer=tokenizer,
162
  max_new_tokens=512,
 
163
  temperature=0.7,
164
  top_p=0.95,
165
- repetition_penalty=1.15
 
166
  )
167
 
168
  print(pipe(prompt_template)[0]['generated_text'])
169
  ```
 
170
 
 
171
  ## Compatibility
172
 
173
- 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.
174
 
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
  <!-- 200823 -->
@@ -197,7 +246,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
197
 
198
  **Special thanks to**: Aemon Algiz.
199
 
200
- **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
201
 
202
 
203
  Thank you to all my generous patrons and donaters!
@@ -234,16 +283,16 @@ The model was trained almost entirely on synthetic GPT-4 outputs. Curating high
234
  This includes data from diverse sources such as GPTeacher, the general, roleplay v1&2, code instruct datasets, Nous Instruct & PDACTL (unpublished), and several others, detailed further below
235
 
236
  ## Collaborators
237
- The model fine-tuning and the datasets were a collaboration of efforts and resources between Teknium, Karan4D, Emozilla, Huemin Art, and Redmond AI.
238
-
239
  Special mention goes to @winglian for assisting in some of the training issues.
240
 
241
- Huge shoutout and acknowledgement is deserved for all the dataset creators who generously share their datasets openly.
242
 
243
  Among the contributors of datasets:
244
  - GPTeacher was made available by Teknium
245
  - Wizard LM by nlpxucan
246
- - Nous Research Instruct Dataset was provided by Karan4D and HueminArt.
247
  - GPT4-LLM and Unnatural Instructions were provided by Microsoft
248
  - Airoboros dataset by jondurbin
249
  - Camel-AI's domain expert datasets are from Camel-AI
@@ -263,7 +312,7 @@ The model follows the Alpaca prompt format:
263
 
264
  ```
265
 
266
- or
267
 
268
  ```
269
  ### Instruction:
@@ -275,7 +324,7 @@ or
275
  ### Response:
276
  <leave a newline blank for model to respond>
277
 
278
- ```
279
 
280
  ## Benchmark Results
281
  AGI-Eval
@@ -344,15 +393,17 @@ These are the highest benchmarks Hermes has seen on every metric, achieving the
344
  - 0.3657 on BigBench, up from 0.328 on hermes-llama1
345
  - 0.372 on AGIEval, up from 0.354 on Hermes-llama1
346
 
347
- These benchmarks currently have us at #1 on ARC-c, ARC-e, Hellaswag, and OpenBookQA, and 2nd place on Winogrande, comparing to GPT4all's benchmarking list, supplanting Hermes 1 for the new top position.
348
 
349
  ## Resources for Applied Use Cases:
350
- For an example of a back and forth chatbot using huggingface transformers and discord, check out: https://github.com/teknium1/alpaca-discord
351
- For an example of a roleplaying discord chatbot, check out this: https://github.com/teknium1/alpaca-roleplay-discordbot
 
352
 
353
  ## Future Plans
354
- We plan to continue to iterate on both more high quality data, and new data filtering techniques to eliminate lower quality data going forward.
355
 
356
  ## Model Usage
357
  The model is available for download on Hugging Face. It is suitable for a wide range of language tasks, from generating creative text to understanding and following complex instructions.
358
 
 
 
2
  inference: false
3
  language:
4
  - en
5
+ license: llama2
6
+ model_creator: NousResearch
7
+ model_link: https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b
8
+ model_name: Nous Hermes Llama 2 13B
9
  model_type: llama
10
+ quantized_by: TheBloke
11
  tags:
12
  - llama-2
13
  - self-instruct
 
32
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
33
  <!-- header end -->
34
 
35
+ # Nous Hermes Llama 2 13B - GPTQ
36
+ - Model creator: [NousResearch](https://huggingface.co/NousResearch)
37
+ - Original model: [Nous Hermes Llama 2 13B](https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b)
38
 
39
+ <!-- description start -->
40
+ ## Description
41
 
42
+ This repo contains GPTQ model files for [Nous Research's Nous Hermes Llama 2 13B](https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b).
43
 
44
+ 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.
45
 
46
+ <!-- description end -->
47
+ <!-- repositories-available start -->
48
  ## Repositories available
49
 
50
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ)
51
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GGUF)
52
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference (deprecated)](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GGML)
53
+ * [NousResearch's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b)
54
+ <!-- repositories-available end -->
55
 
56
+ <!-- prompt-template start -->
57
  ## Prompt template: Alpaca
58
 
59
  ```
60
  Below is an instruction that describes a task. Write a response that appropriately completes the request.
61
 
62
+ ### Instruction:
63
+ {prompt}
64
 
65
  ### Response:
66
+
67
  ```
68
 
69
+ <!-- prompt-template end -->
70
+
71
+ <!-- README_GPTQ.md-provided-files start -->
72
+ ## Provided files and GPTQ parameters
73
 
74
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
75
 
76
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
77
 
78
+ 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.
79
+
80
+ <details>
81
+ <summary>Explanation of GPTQ parameters</summary>
82
+
83
+ - Bits: The bit size of the quantised model.
84
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
85
+ - 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.
86
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
87
+ - 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).
88
+ - 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.
89
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
90
 
91
+ </details>
92
+
93
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
94
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
95
+ | [main](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ/tree/main) | 4 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.26 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
96
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
97
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.51 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. |
98
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.26 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. |
99
+ | [gptq-8bit-64g-actorder_True](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ/tree/gptq-8bit-64g-actorder_True) | 8 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.95 GB | No | 8-bit, with group size 64g and Act Order for even higher inference quality. Poor AutoGPTQ CUDA speed. |
100
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. |
101
+ | [gptq-8bit-128g-actorder_False](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ/tree/gptq-8bit-128g-actorder_False) | 8 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
102
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
103
+
104
+ <!-- README_GPTQ.md-provided-files end -->
105
+
106
+ <!-- README_GPTQ.md-download-from-branches start -->
107
  ## How to download from branches
108
 
109
  - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Nous-Hermes-Llama2-GPTQ:gptq-4bit-32g-actorder_True`
110
  - With Git, you can clone a branch with:
111
  ```
112
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ
113
  ```
114
  - In Python Transformers code, the branch is the `revision` parameter; see below.
115
+ <!-- README_GPTQ.md-download-from-branches end -->
116
+ <!-- README_GPTQ.md-text-generation-webui start -->
117
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
118
 
119
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
120
 
121
+ 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.
122
 
123
  1. Click the **Model tab**.
124
  2. Under **Download custom model or LoRA**, enter `TheBloke/Nous-Hermes-Llama2-GPTQ`.
125
  - To download from a specific branch, enter for example `TheBloke/Nous-Hermes-Llama2-GPTQ:gptq-4bit-32g-actorder_True`
126
  - see Provided Files above for the list of branches for each option.
127
  3. Click **Download**.
128
+ 4. The model will start downloading. Once it's finished it will say "Done".
129
  5. In the top left, click the refresh icon next to **Model**.
130
  6. In the **Model** dropdown, choose the model you just downloaded: `Nous-Hermes-Llama2-GPTQ`
131
  7. The model will automatically load, and is now ready for use!
132
  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.
133
+ * 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`.
134
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
135
+ <!-- README_GPTQ.md-text-generation-webui end -->
136
 
137
+ <!-- README_GPTQ.md-use-from-python start -->
138
  ## How to use this GPTQ model from Python code
139
 
140
+ ### Install the necessary packages
141
 
142
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
143
 
144
+ ```shell
145
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
146
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
147
+ ```
148
+
149
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
150
+
151
+ ```shell
152
+ pip3 uninstall -y auto-gptq
153
+ git clone https://github.com/PanQiWei/AutoGPTQ
154
+ cd AutoGPTQ
155
+ pip3 install .
156
+ ```
157
+
158
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
159
+
160
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
161
+ ```shell
162
+ pip3 uninstall -y transformers
163
+ pip3 install git+https://github.com/huggingface/transformers.git
164
+ ```
165
+
166
+ ### You can then use the following code
167
 
168
  ```python
169
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
170
 
171
  model_name_or_path = "TheBloke/Nous-Hermes-Llama2-GPTQ"
172
+ # To use a different branch, change revision
173
+ # For example: revision="gptq-4bit-32g-actorder_True"
174
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
175
+ device_map="auto",
176
+ trust_remote_code=False,
177
+ revision="main")
178
 
179
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  prompt = "Tell me about AI"
182
  prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
183
 
184
+ ### Instruction:
185
+ {prompt}
186
 
187
  ### Response:
188
+
189
  '''
190
 
191
  print("\n\n*** Generate:")
192
 
193
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
194
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
195
  print(tokenizer.decode(output[0]))
196
 
197
  # Inference can also be done using transformers' pipeline
198
 
 
 
 
199
  print("*** Pipeline:")
200
  pipe = pipeline(
201
  "text-generation",
202
  model=model,
203
  tokenizer=tokenizer,
204
  max_new_tokens=512,
205
+ do_sample=True,
206
  temperature=0.7,
207
  top_p=0.95,
208
+ top_k=40,
209
+ repetition_penalty=1.1
210
  )
211
 
212
  print(pipe(prompt_template)[0]['generated_text'])
213
  ```
214
+ <!-- README_GPTQ.md-use-from-python end -->
215
 
216
+ <!-- README_GPTQ.md-compatibility start -->
217
  ## Compatibility
218
 
219
+ 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).
220
 
221
+ [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.
222
+
223
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
224
+ <!-- README_GPTQ.md-compatibility end -->
225
 
226
  <!-- footer start -->
227
  <!-- 200823 -->
 
246
 
247
  **Special thanks to**: Aemon Algiz.
248
 
249
+ **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
250
 
251
 
252
  Thank you to all my generous patrons and donaters!
 
283
  This includes data from diverse sources such as GPTeacher, the general, roleplay v1&2, code instruct datasets, Nous Instruct & PDACTL (unpublished), and several others, detailed further below
284
 
285
  ## Collaborators
286
+ The model fine-tuning and the datasets were a collaboration of efforts and resources between Teknium, Karan4D, Emozilla, Huemin Art, and Redmond AI.
287
+
288
  Special mention goes to @winglian for assisting in some of the training issues.
289
 
290
+ Huge shoutout and acknowledgement is deserved for all the dataset creators who generously share their datasets openly.
291
 
292
  Among the contributors of datasets:
293
  - GPTeacher was made available by Teknium
294
  - Wizard LM by nlpxucan
295
+ - Nous Research Instruct Dataset was provided by Karan4D and HueminArt.
296
  - GPT4-LLM and Unnatural Instructions were provided by Microsoft
297
  - Airoboros dataset by jondurbin
298
  - Camel-AI's domain expert datasets are from Camel-AI
 
312
 
313
  ```
314
 
315
+ or
316
 
317
  ```
318
  ### Instruction:
 
324
  ### Response:
325
  <leave a newline blank for model to respond>
326
 
327
+ ```
328
 
329
  ## Benchmark Results
330
  AGI-Eval
 
393
  - 0.3657 on BigBench, up from 0.328 on hermes-llama1
394
  - 0.372 on AGIEval, up from 0.354 on Hermes-llama1
395
 
396
+ These benchmarks currently have us at #1 on ARC-c, ARC-e, Hellaswag, and OpenBookQA, and 2nd place on Winogrande, comparing to GPT4all's benchmarking list, supplanting Hermes 1 for the new top position.
397
 
398
  ## Resources for Applied Use Cases:
399
+ Check out LM Studio for a nice chatgpt style interface here: https://lmstudio.ai/
400
+ For an example of a back and forth chatbot using huggingface transformers and discord, check out: https://github.com/teknium1/alpaca-discord
401
+ For an example of a roleplaying discord chatbot, check out this: https://github.com/teknium1/alpaca-roleplay-discordbot
402
 
403
  ## Future Plans
404
+ We plan to continue to iterate on both more high quality data, and new data filtering techniques to eliminate lower quality data going forward.
405
 
406
  ## Model Usage
407
  The model is available for download on Hugging Face. It is suitable for a wide range of language tasks, from generating creative text to understanding and following complex instructions.
408
 
409
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)