Text Generation
Transformers
Safetensors
llama
text-generation-inference
4-bit precision
gptq
TheBloke commited on
Commit
38a1704
1 Parent(s): 59a2612

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +252 -0
README.md ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - shahules786/orca-chat
4
+ - rombodawg/MegaCodeTraining112k
5
+ - theblackcat102/evol-codealpaca-v1
6
+ - nickrosh/Evol-Instruct-Code-80k-v1
7
+ inference: false
8
+ license: other
9
+ model_creator: OpenAssistant
10
+ model_link: https://huggingface.co/OpenAssistant/llama2-13b-orca-v2-8k-3166
11
+ model_name: Llama2 13B Orca v2 8K
12
+ model_type: llama
13
+ quantized_by: TheBloke
14
+ ---
15
+
16
+ <!-- header start -->
17
+ <div style="width: 100%;">
18
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
19
+ </div>
20
+ <div style="display: flex; justify-content: space-between; width: 100%;">
21
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
22
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
23
+ </div>
24
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
25
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
26
+ </div>
27
+ </div>
28
+ <!-- header end -->
29
+
30
+ # Llama2 13B Orca v2 8K - GPTQ
31
+ - Model creator: [OpenAssistant](https://huggingface.co/OpenAssistant)
32
+ - Original model: [Llama2 13B Orca v2 8K](https://huggingface.co/OpenAssistant/llama2-13b-orca-v2-8k-3166)
33
+
34
+ ## Description
35
+
36
+ This repo contains GPTQ model files for [OpenAssistant's Llama2 13B Orca v2 8K](https://huggingface.co/OpenAssistant/llama2-13b-orca-v2-8k-3166).
37
+
38
+ 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.
39
+
40
+ ## Repositories available
41
+
42
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ)
43
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GGML)
44
+ * [OpenAssistant's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/OpenAssistant/llama2-13b-orca-v2-8k-3166)
45
+
46
+ ## Prompt template: OpenAssistant
47
+
48
+ ```
49
+ <|prompter|>{prompt}<|endoftext|><|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) | GPTQ Dataset | Size | ExLlama Compat? | Made With | Desc |
59
+ | ------ | ---- | ---------- | -------------------- | ------------ | ---- | --------------- | --------- | ---- |
60
+ | [main](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/main) | 4 | 128 | No | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 7.26 GB | Yes | 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](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8.00 GB | Yes | 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](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 7.51 GB | Yes | 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](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | Processing, coming soon | Yes | AutoGPTQ | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
64
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | Processing, coming soon | No | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
65
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | Processing, coming soon | No | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA 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/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ:gptq-4bit-32g-actorder_True`
70
+ - With Git, you can clone a branch with:
71
+ ```
72
+ git clone --branch --single-branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-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/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ`.
84
+ - To download from a specific branch, enter for example `TheBloke/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-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: `OpenAssistant-Llama2-13B-Orca-v2-8K-3166-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/OpenAssistant-Llama2-13B-Orca-v2-8K-3166-GPTQ"
108
+ model_basename = "gptq_model-4bit-128g"
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=False,
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=False,
130
+ device="cuda:0",
131
+ quantize_config=None)
132
+ """
133
+
134
+ prompt = "Tell me about AI"
135
+ prompt_template=f'''<|prompter|>{prompt}<|endoftext|><|assistant|>
136
+ '''
137
+
138
+ print("\n\n*** Generate:")
139
+
140
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
141
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
142
+ print(tokenizer.decode(output[0]))
143
+
144
+ # Inference can also be done using transformers' pipeline
145
+
146
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
147
+ logging.set_verbosity(logging.CRITICAL)
148
+
149
+ print("*** Pipeline:")
150
+ pipe = pipeline(
151
+ "text-generation",
152
+ model=model,
153
+ tokenizer=tokenizer,
154
+ max_new_tokens=512,
155
+ temperature=0.7,
156
+ top_p=0.95,
157
+ repetition_penalty=1.15
158
+ )
159
+
160
+ print(pipe(prompt_template)[0]['generated_text'])
161
+ ```
162
+
163
+ ## Compatibility
164
+
165
+ 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.
166
+
167
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
168
+
169
+ <!-- footer start -->
170
+ ## Discord
171
+
172
+ For further support, and discussions on these models and AI in general, join us at:
173
+
174
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
175
+
176
+ ## Thanks, and how to contribute.
177
+
178
+ Thanks to the [chirper.ai](https://chirper.ai) team!
179
+
180
+ 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.
181
+
182
+ 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.
183
+
184
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
185
+
186
+ * Patreon: https://patreon.com/TheBlokeAI
187
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
188
+
189
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
190
+
191
+ **Patreon special mentions**: Willem Michiel, Ajan Kanaga, Cory Kujawski, Alps Aficionado, Nikolai Manek, Jonathan Leane, Stanislav Ovsiannikov, Michael Levine, Luke Pendergrass, Sid, K, Gabriel Tamborski, Clay Pascal, Kalila, William Sang, Will Dee, Pieter, Nathan LeClaire, ya boyyy, David Flickinger, vamX, Derek Yates, Fen Risland, Jeffrey Morgan, webtim, Daniel P. Andersen, Chadd, Edmond Seymore, Pyrater, Olusegun Samson, Lone Striker, biorpg, alfie_i, Mano Prime, Chris Smitley, Dave, zynix, Trenton Dambrowitz, Johann-Peter Hartmann, Magnesian, Spencer Kim, John Detwiler, Iucharbius, Gabriel Puliatti, LangChain4j, Luke @flexchar, Vadim, Rishabh Srivastava, Preetika Verma, Ai Maven, Femi Adebogun, WelcomeToTheClub, Leonard Tan, Imad Khwaja, Steven Wood, Stefan Sabev, Sebastain Graf, usrbinkat, Dan Guido, Sam, Eugene Pentland, Mandus, transmissions 11, Slarti, Karl Bernard, Spiking Neurons AB, Artur Olbinski, Joseph William Delisle, ReadyPlayerEmma, Olakabola, Asp the Wyvern, Space Cruiser, Matthew Berman, Randy H, subjectnull, danny, John Villwock, Illia Dulskyi, Rainer Wilmers, theTransient, Pierre Kircher, Alexandros Triantafyllidis, Viktor Bowallius, terasurfer, Deep Realms, SuperWojo, senxiiz, Oscar Rangel, Alex, Stephen Murray, Talal Aujan, Raven Klaugh, Sean Connelly, Raymond Fosdick, Fred von Graf, chris gileta, Junyu Yang, Elle
192
+
193
+
194
+ Thank you to all my generous patrons and donaters!
195
+
196
+ <!-- footer end -->
197
+
198
+ # Original model card: OpenAssistant's Llama2 13B Orca v2 8K
199
+
200
+ - wandb: [jlhr5cf2](https://wandb.ai/open-assistant/supervised-finetuning/runs/jlhr5cf2)
201
+ - sampling-report: [2023-07-31_OpenAssistant_llama2-13b-orca-v2-8k-3166_sampling_llama2_prompt.json](https://open-assistant.github.io/oasst-model-eval/?f=https%3A%2F%2Fraw.githubusercontent.com%2FOpen-Assistant%2Foasst-model-eval%2Fmain%2Fsampling_reports%2Foasst-pretrained%2F2023-07-31_OpenAssistant_llama2-13b-orca-v2-8k-3166_sampling_llama2_prompt.json)
202
+
203
+
204
+ ## Model Configuration
205
+ ```
206
+ llama2-13b-orca-v2-8k:
207
+ rng_seed: 0xe1291f21
208
+ show_dataset_stats: true
209
+ random_offset_probability: 0.0
210
+ use_custom_sampler: true
211
+ sort_by_length: false
212
+ dtype: fp16
213
+ log_dir: /mnt/data/ikka/data_cache/llama2_13b_orcav2_logs
214
+ output_dir: /mnt/data/ikka/data_cache/llama2_13b_orcav2
215
+ learning_rate: 1e-5
216
+ model_name: conceptofmind/LLongMA-2-13b
217
+ deepspeed_config: configs/zero_config_pretrain.json
218
+ weight_decay: 0.000001
219
+ max_length: 8192
220
+ warmup_steps: 100
221
+ peft_model: false
222
+ use_flash_attention: true
223
+ gradient_checkpointing: true
224
+ gradient_accumulation_steps: 4
225
+ per_device_train_batch_size: 2
226
+ per_device_eval_batch_size: 1
227
+ residual_dropout: 0.0
228
+ eval_steps: 200
229
+ save_steps: 200
230
+ num_train_epochs: 1
231
+ save_total_limit: 4
232
+ superhot: false
233
+ superhot_config:
234
+ type: linear
235
+ scaling_factor: 2
236
+ datasets:
237
+ - orca-chat: # shahules786/orca-chat
238
+ data_files: orca-chat-gpt4-8k.json
239
+ max_val_set: 5000
240
+ val_split: 0.1
241
+ - evol-codealpaca-v1: # theblackcat102/evol-codealpaca-v1
242
+ fill_min_length: 20000
243
+ val_split: 0.1
244
+ - megacode: # rombodawg/MegaCodeTraining112k
245
+ fill_min_length: 24000
246
+ val_split: 0.1
247
+ max_val_set: 1000
248
+ - evol_instruct_code: # nickrosh/Evol-Instruct-Code-80k-v1
249
+ fill_min_length: 24000
250
+ val_split: 0.1
251
+ max_val_set: 1000
252
+ ```