Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
4-bit precision
gptq
TheBloke commited on
Commit
69b1ac0
1 Parent(s): c101112

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +202 -63
README.md CHANGED
@@ -1,4 +1,5 @@
1
  ---
 
2
  datasets:
3
  - databricks/databricks-dolly-15k
4
  - OpenAssistant/oasst1
@@ -7,7 +8,17 @@ inference: false
7
  language:
8
  - en
9
  license: other
 
 
10
  model_type: llama
 
 
 
 
 
 
 
 
11
  ---
12
 
13
  <!-- header start -->
@@ -27,146 +38,196 @@ model_type: llama
27
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
28
  <!-- header end -->
29
 
30
- # Allen AI's Tulu 7B GPTQ
 
 
31
 
32
- These files are GPTQ model files for [Allen AI's Tulu 7B](https://huggingface.co/allenai/tulu-7b).
 
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/tulu-7B-GPTQ)
41
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/tulu-7B-GGML)
42
- * [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/tulu-7B-fp16)
 
43
 
 
44
  ## Prompt template: Tulu
45
 
46
  ```
47
  <|user|>
48
  {prompt}
49
  <|assistant|>
 
50
  ```
51
 
52
- ## Provided files
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
55
 
56
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
57
 
58
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
59
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
60
- | main | 4 | 128 | False | 3.90 GB | True | AutoGPTQ | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
61
- | 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. |
62
- | 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. |
63
- | 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. |
64
- | 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. |
65
- | 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. |
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  ## How to download from branches
68
 
69
- - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/tulu-7B-GPTQ:gptq-4bit-32g-actorder_True`
70
  - With Git, you can clone a branch with:
71
  ```
72
- git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/tulu-7B-GPTQ`
73
  ```
74
  - In Python Transformers code, the branch is the `revision` parameter; see below.
75
-
 
76
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
77
 
78
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
79
 
80
- It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
81
 
82
  1. Click the **Model tab**.
83
  2. Under **Download custom model or LoRA**, enter `TheBloke/tulu-7B-GPTQ`.
84
- - To download from a specific branch, enter for example `TheBloke/tulu-7B-GPTQ:gptq-4bit-32g-actorder_True`
85
  - see Provided Files above for the list of branches for each option.
86
  3. Click **Download**.
87
- 4. The model will start downloading. Once it's finished it will say "Done"
88
  5. In the top left, click the refresh icon next to **Model**.
89
  6. In the **Model** dropdown, choose the model you just downloaded: `tulu-7B-GPTQ`
90
  7. The model will automatically load, and is now ready for use!
91
  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.
92
- * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
93
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
 
94
 
 
95
  ## How to use this GPTQ model from Python code
96
 
97
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
 
99
- `GITHUB_ACTIONS=true pip install auto-gptq`
 
 
 
 
100
 
101
- Then try the following example code:
102
 
103
  ```python
104
- from transformers import AutoTokenizer, pipeline, logging
105
- from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
106
 
107
  model_name_or_path = "TheBloke/tulu-7B-GPTQ"
108
- model_basename = "model"
109
-
110
- use_triton = False
 
 
 
111
 
112
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
113
 
114
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
115
- model_basename=model_basename
116
- use_safetensors=True,
117
- trust_remote_code=True,
118
- device="cuda:0",
119
- use_triton=use_triton,
120
- quantize_config=None)
121
-
122
- """
123
- To download from a specific branch, use the revision parameter, as in this example:
124
-
125
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
126
- revision="gptq-4bit-32g-actorder_True",
127
- model_basename=model_basename,
128
- use_safetensors=True,
129
- trust_remote_code=True,
130
- device="cuda:0",
131
- quantize_config=None)
132
- """
133
-
134
  prompt = "Tell me about AI"
135
  prompt_template=f'''<|user|>
136
  {prompt}
137
  <|assistant|>
 
138
  '''
139
 
140
  print("\n\n*** Generate:")
141
 
142
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
143
- output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
144
  print(tokenizer.decode(output[0]))
145
 
146
  # Inference can also be done using transformers' pipeline
147
 
148
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
149
- logging.set_verbosity(logging.CRITICAL)
150
-
151
  print("*** Pipeline:")
152
  pipe = pipeline(
153
  "text-generation",
154
  model=model,
155
  tokenizer=tokenizer,
156
  max_new_tokens=512,
 
157
  temperature=0.7,
158
  top_p=0.95,
159
- repetition_penalty=1.15
 
160
  )
161
 
162
  print(pipe(prompt_template)[0]['generated_text'])
163
  ```
 
164
 
 
165
  ## Compatibility
166
 
167
- 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.
168
 
169
- ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
 
 
 
170
 
171
  <!-- footer start -->
172
  <!-- 200823 -->
@@ -176,10 +237,12 @@ For further support, and discussions on these models and AI in general, join us
176
 
177
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
178
 
179
- ## Thanks, and how to contribute.
180
 
181
  Thanks to the [chirper.ai](https://chirper.ai) team!
182
 
 
 
183
  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.
184
 
185
  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.
@@ -191,7 +254,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
191
 
192
  **Special thanks to**: Aemon Algiz.
193
 
194
- **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
195
 
196
 
197
  Thank you to all my generous patrons and donaters!
@@ -203,6 +266,82 @@ And thank you again to a16z for their generous grant.
203
  # Original model card: Allen AI's Tulu 7B
204
 
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  # Tulu 7B
207
 
208
  This model is a 7B LLaMa model finetuned on a mixture of instruction datasets (FLAN V2, CoT, Dolly, Open Assistant 1, GPT4-Alpaca, Code-Alpaca, and ShareGPT).
@@ -237,7 +376,7 @@ Your message here!
237
  <|assistant|>
238
  ```
239
 
240
- For best results, format all inputs in this manner. **Make sure to include a newline after `<|assistant|>`, this can affect generation quality quite a bit.**
241
 
242
  ## Performance
243
 
@@ -251,7 +390,7 @@ If you use this model, please cite our work, the llama paper, and the original d
251
 
252
  ```
253
  @misc{wang2023far,
254
- title={How Far Can Camels Go? Exploring the State of Instruction Tuning on Open Resources},
255
  author={Yizhong Wang and Hamish Ivison and Pradeep Dasigi and Jack Hessel and Tushar Khot and Khyathi Raghavi Chandu and David Wadden and Kelsey MacMillan and Noah A. Smith and Iz Beltagy and Hannaneh Hajishirzi},
256
  year={2023},
257
  eprint={2306.04751},
@@ -262,7 +401,7 @@ If you use this model, please cite our work, the llama paper, and the original d
262
 
263
  ```
264
  @misc{touvron2023llama,
265
- title={LLaMA: Open and Efficient Foundation Language Models},
266
  author={Hugo Touvron and Thibaut Lavril and Gautier Izacard and Xavier Martinet and Marie-Anne Lachaux and Timothée Lacroix and Baptiste Rozière and Naman Goyal and Eric Hambro and Faisal Azhar and Aurelien Rodriguez and Armand Joulin and Edouard Grave and Guillaume Lample},
267
  year={2023},
268
  eprint={2302.13971},
@@ -294,7 +433,7 @@ If you use this model, please cite our work, the llama paper, and the original d
294
 
295
  ```
296
  @misc{köpf2023openassistant,
297
- title={OpenAssistant Conversations -- Democratizing Large Language Model Alignment},
298
  author={Andreas Köpf and Yannic Kilcher and Dimitri von Rütte and Sotiris Anagnostidis and Zhi-Rui Tam and Keith Stevens and Abdullah Barhoum and Nguyen Minh Duc and Oliver Stanley and Richárd Nagyfi and Shahul ES and Sameer Suri and David Glushkov and Arnav Dantuluri and Andrew Maguire and Christoph Schuhmann and Huu Nguyen and Alexander Mattick},
299
  year={2023},
300
  eprint={2304.07327},
 
1
  ---
2
+ base_model: https://huggingface.co/allenai/tulu-7b
3
  datasets:
4
  - databricks/databricks-dolly-15k
5
  - OpenAssistant/oasst1
 
8
  language:
9
  - en
10
  license: other
11
+ model_creator: Allen Institute for AI
12
+ model_name: Tulu 7B
13
  model_type: llama
14
+ prompt_template: '<|user|>
15
+
16
+ {prompt}
17
+
18
+ <|assistant|>
19
+
20
+ '
21
+ quantized_by: TheBloke
22
  ---
23
 
24
  <!-- header start -->
 
38
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
39
  <!-- header end -->
40
 
41
+ # Tulu 7B - GPTQ
42
+ - Model creator: [Allen Institute for AI](https://huggingface.co/allenai)
43
+ - Original model: [Tulu 7B](https://huggingface.co/allenai/tulu-7b)
44
 
45
+ <!-- description start -->
46
+ ## Description
47
 
48
+ This repo contains GPTQ model files for [Allen AI's Tulu 7B](https://huggingface.co/allenai/tulu-7b).
49
 
50
+ 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.
51
 
52
+ <!-- description end -->
53
+ <!-- repositories-available start -->
54
  ## Repositories available
55
 
56
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/tulu-7B-AWQ)
57
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/tulu-7B-GPTQ)
58
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/tulu-7B-GGUF)
59
+ * [Allen Institute for AI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/tulu-7B-fp16)
60
+ <!-- repositories-available end -->
61
 
62
+ <!-- prompt-template start -->
63
  ## Prompt template: Tulu
64
 
65
  ```
66
  <|user|>
67
  {prompt}
68
  <|assistant|>
69
+
70
  ```
71
 
72
+ <!-- prompt-template end -->
73
+ <!-- licensing start -->
74
+ ## Licensing
75
+
76
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
77
+
78
+ 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.
79
+
80
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Allen AI's Tulu 7B](https://huggingface.co/allenai/tulu-7b).
81
+ <!-- licensing end -->
82
+ <!-- README_GPTQ.md-provided-files start -->
83
+ ## Provided files and GPTQ parameters
84
 
85
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
86
 
87
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
88
 
89
+ 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.
90
+
91
+ <details>
92
+ <summary>Explanation of GPTQ parameters</summary>
 
 
 
 
93
 
94
+ - Bits: The bit size of the quantised model.
95
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
96
+ - 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.
97
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
98
+ - 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).
99
+ - 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.
100
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
101
+
102
+ </details>
103
+
104
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
105
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
106
+ | [main](https://huggingface.co/TheBloke/tulu-7B-GPTQ/tree/main) | 4 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 3.90 GB | Yes | 4-bit, without Act Order and group size 128g. |
107
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/tulu-7B-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. |
108
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/tulu-7B-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. |
109
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/tulu-7B-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. |
110
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/tulu-7B-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. |
111
+ | [gptq-8bit-128g-actorder_False](https://huggingface.co/TheBloke/tulu-7B-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. |
112
+
113
+ <!-- README_GPTQ.md-provided-files end -->
114
+
115
+ <!-- README_GPTQ.md-download-from-branches start -->
116
  ## How to download from branches
117
 
118
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/tulu-7B-GPTQ:main`
119
  - With Git, you can clone a branch with:
120
  ```
121
+ git clone --single-branch --branch main https://huggingface.co/TheBloke/tulu-7B-GPTQ
122
  ```
123
  - In Python Transformers code, the branch is the `revision` parameter; see below.
124
+ <!-- README_GPTQ.md-download-from-branches end -->
125
+ <!-- README_GPTQ.md-text-generation-webui start -->
126
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
127
 
128
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
129
 
130
+ 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.
131
 
132
  1. Click the **Model tab**.
133
  2. Under **Download custom model or LoRA**, enter `TheBloke/tulu-7B-GPTQ`.
134
+ - To download from a specific branch, enter for example `TheBloke/tulu-7B-GPTQ:main`
135
  - see Provided Files above for the list of branches for each option.
136
  3. Click **Download**.
137
+ 4. The model will start downloading. Once it's finished it will say "Done".
138
  5. In the top left, click the refresh icon next to **Model**.
139
  6. In the **Model** dropdown, choose the model you just downloaded: `tulu-7B-GPTQ`
140
  7. The model will automatically load, and is now ready for use!
141
  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.
142
+ * 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`.
143
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
144
+ <!-- README_GPTQ.md-text-generation-webui end -->
145
 
146
+ <!-- README_GPTQ.md-use-from-python start -->
147
  ## How to use this GPTQ model from Python code
148
 
149
+ ### Install the necessary packages
150
+
151
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
152
+
153
+ ```shell
154
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
155
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
156
+ ```
157
+
158
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
159
+
160
+ ```shell
161
+ pip3 uninstall -y auto-gptq
162
+ git clone https://github.com/PanQiWei/AutoGPTQ
163
+ cd AutoGPTQ
164
+ pip3 install .
165
+ ```
166
+
167
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
168
 
169
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
170
+ ```shell
171
+ pip3 uninstall -y transformers
172
+ pip3 install git+https://github.com/huggingface/transformers.git
173
+ ```
174
 
175
+ ### You can then use the following code
176
 
177
  ```python
178
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
179
 
180
  model_name_or_path = "TheBloke/tulu-7B-GPTQ"
181
+ # To use a different branch, change revision
182
+ # For example: revision="main"
183
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
184
+ device_map="auto",
185
+ trust_remote_code=True,
186
+ revision="main")
187
 
188
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  prompt = "Tell me about AI"
191
  prompt_template=f'''<|user|>
192
  {prompt}
193
  <|assistant|>
194
+
195
  '''
196
 
197
  print("\n\n*** Generate:")
198
 
199
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
200
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
201
  print(tokenizer.decode(output[0]))
202
 
203
  # Inference can also be done using transformers' pipeline
204
 
 
 
 
205
  print("*** Pipeline:")
206
  pipe = pipeline(
207
  "text-generation",
208
  model=model,
209
  tokenizer=tokenizer,
210
  max_new_tokens=512,
211
+ do_sample=True,
212
  temperature=0.7,
213
  top_p=0.95,
214
+ top_k=40,
215
+ repetition_penalty=1.1
216
  )
217
 
218
  print(pipe(prompt_template)[0]['generated_text'])
219
  ```
220
+ <!-- README_GPTQ.md-use-from-python end -->
221
 
222
+ <!-- README_GPTQ.md-compatibility start -->
223
  ## Compatibility
224
 
225
+ 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).
226
 
227
+ [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.
228
+
229
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
230
+ <!-- README_GPTQ.md-compatibility end -->
231
 
232
  <!-- footer start -->
233
  <!-- 200823 -->
 
237
 
238
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
239
 
240
+ ## Thanks, and how to contribute
241
 
242
  Thanks to the [chirper.ai](https://chirper.ai) team!
243
 
244
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
245
+
246
  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.
247
 
248
  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.
 
254
 
255
  **Special thanks to**: Aemon Algiz.
256
 
257
+ **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
258
 
259
 
260
  Thank you to all my generous patrons and donaters!
 
266
  # Original model card: Allen AI's Tulu 7B
267
 
268
 
269
+ <!-- header start -->
270
+ <div style="width: 100%;">
271
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
272
+ </div>
273
+ <div style="display: flex; justify-content: space-between; width: 100%;">
274
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
275
+ <p><a href="https://discord.gg/Jq4vkcDakD">Chat & support: my new Discord server</a></p>
276
+ </div>
277
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
278
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
279
+ </div>
280
+ </div>
281
+ <!-- header end -->
282
+
283
+ # Allen AI's Tulu 7B fp16
284
+
285
+ These files are pytorch format fp16 model files for [Allen AI's Tulu 7B](https://huggingface.co/allenai/tulu-7b).
286
+
287
+ It is the result of merging and/or converting the source repository to float16.
288
+
289
+ ## Repositories available
290
+
291
+ * [4-bit GPTQ models for GPU inference](https://huggingface.co/TheBloke/tulu-7B-fp16)
292
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/tulu-7B-GGML)
293
+ * [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/tulu-7B-fp16)
294
+
295
+ ## Prompt template
296
+
297
+ The following template should be used:
298
+
299
+ ```
300
+ <|user|>
301
+ prompt goes here
302
+ <|assistant|>
303
+
304
+ ```
305
+
306
+ **Note**: There should be a newline after `<|assistant|>`. This appears to be very important for getting this model to respond correctly.
307
+
308
+ In other words, the prompt is:
309
+
310
+ ```
311
+ <|user|>\nprompt goes here\n<|assistant|>\n
312
+ ```
313
+
314
+ <!-- footer start -->
315
+ ## Discord
316
+
317
+ For further support, and discussions on these models and AI in general, join us at:
318
+
319
+ [TheBloke AI's Discord server](https://discord.gg/Jq4vkcDakD)
320
+
321
+ ## Thanks, and how to contribute.
322
+
323
+ Thanks to the [chirper.ai](https://chirper.ai) team!
324
+
325
+ 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.
326
+
327
+ 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.
328
+
329
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
330
+
331
+ * Patreon: https://patreon.com/TheBlokeAI
332
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
333
+
334
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz, Dmitriy Samsonov.
335
+
336
+ **Patreon special mentions**: Oscar Rangel, Eugene Pentland, Talal Aujan, Cory Kujawski, Luke, Asp the Wyvern, Ai Maven, Pyrater, Alps Aficionado, senxiiz, Willem Michiel, Junyu Yang, trip7s trip, Sebastain Graf, Joseph William Delisle, Lone Striker, Jonathan Leane, Johann-Peter Hartmann, David Flickinger, Spiking Neurons AB, Kevin Schuppel, Mano Prime, Dmitriy Samsonov, Sean Connelly, Nathan LeClaire, Alain Rossmann, Fen Risland, Derek Yates, Luke Pendergrass, Nikolai Manek, Khalefa Al-Ahmad, Artur Olbinski, John Detwiler, Ajan Kanaga, Imad Khwaja, Trenton Dambrowitz, Kalila, vamX, webtim, Illia Dulskyi.
337
+
338
+ Thank you to all my generous patrons and donaters!
339
+
340
+ <!-- footer end -->
341
+
342
+ # Original model card: Allen AI's Tulu 7B
343
+
344
+
345
  # Tulu 7B
346
 
347
  This model is a 7B LLaMa model finetuned on a mixture of instruction datasets (FLAN V2, CoT, Dolly, Open Assistant 1, GPT4-Alpaca, Code-Alpaca, and ShareGPT).
 
376
  <|assistant|>
377
  ```
378
 
379
+ For best results, format all inputs in this manner.
380
 
381
  ## Performance
382
 
 
390
 
391
  ```
392
  @misc{wang2023far,
393
+ title={How Far Can Camels Go? Exploring the State of Instruction Tuning on Open Resources},
394
  author={Yizhong Wang and Hamish Ivison and Pradeep Dasigi and Jack Hessel and Tushar Khot and Khyathi Raghavi Chandu and David Wadden and Kelsey MacMillan and Noah A. Smith and Iz Beltagy and Hannaneh Hajishirzi},
395
  year={2023},
396
  eprint={2306.04751},
 
401
 
402
  ```
403
  @misc{touvron2023llama,
404
+ title={LLaMA: Open and Efficient Foundation Language Models},
405
  author={Hugo Touvron and Thibaut Lavril and Gautier Izacard and Xavier Martinet and Marie-Anne Lachaux and Timothée Lacroix and Baptiste Rozière and Naman Goyal and Eric Hambro and Faisal Azhar and Aurelien Rodriguez and Armand Joulin and Edouard Grave and Guillaume Lample},
406
  year={2023},
407
  eprint={2302.13971},
 
433
 
434
  ```
435
  @misc{köpf2023openassistant,
436
+ title={OpenAssistant Conversations -- Democratizing Large Language Model Alignment},
437
  author={Andreas Köpf and Yannic Kilcher and Dimitri von Rütte and Sotiris Anagnostidis and Zhi-Rui Tam and Keith Stevens and Abdullah Barhoum and Nguyen Minh Duc and Oliver Stanley and Richárd Nagyfi and Shahul ES and Sameer Suri and David Glushkov and Arnav Dantuluri and Andrew Maguire and Christoph Schuhmann and Huu Nguyen and Alexander Mattick},
438
  year={2023},
439
  eprint={2304.07327},