TheBloke commited on
Commit
a51f2d7
1 Parent(s): b90c26b

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +215 -0
README.md ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - sciq
4
+ - metaeval/ScienceQA_text_only
5
+ - GAIR/lima
6
+ - Open-Orca/OpenOrca
7
+ - openbookqa
8
+ inference: false
9
+ language:
10
+ - en
11
+ license: other
12
+ model_type: llama
13
+ pipeline_tag: text-generation
14
+ tags:
15
+ - upstage
16
+ - llama
17
+ - instruct
18
+ - instruction
19
+ ---
20
+
21
+ <!-- header start -->
22
+ <div style="width: 100%;">
23
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
24
+ </div>
25
+ <div style="display: flex; justify-content: space-between; width: 100%;">
26
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
27
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
28
+ </div>
29
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
30
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
31
+ </div>
32
+ </div>
33
+ <!-- header end -->
34
+
35
+ # Upstage's Llama 65B Instruct GPTQ
36
+
37
+ These files are GPTQ model files for [Upstage's Llama 65B Instruct](https://huggingface.co/upstage/llama-65b-instruct).
38
+
39
+ 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.
40
+
41
+
42
+ ## Repositories available
43
+
44
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-GPTQ)
45
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-GGML)
46
+ * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/upstage/llama-65b-instruct)
47
+
48
+ ## Prompt template: Unknown
49
+
50
+ ```
51
+ {prompt}
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 | 34.73 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 | 38.53 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 | 36.00 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 | 34.73 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-3bit--1g-actorder_True | 3 | None | True | Processing, coming soon | False | AutoGPTQ | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
67
+ | gptq-3bit-128g-actorder_False | 3 | 128 | False | Processing, coming soon | False | AutoGPTQ | 3-bit, with group size 128g but no act-order. Slightly higher VRAM requirements than 3-bit None. |
68
+ | gptq-3bit-128g-actorder_True | 3 | 128 | True | Processing, coming soon | False | AutoGPTQ | 3-bit, with group size 128g and act-order. Higher quality than 128g-False but poor AutoGPTQ CUDA speed. |
69
+ | gptq-3bit-64g-actorder_True | 3 | 64 | True | Processing, coming soon | False | AutoGPTQ | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. Poor AutoGPTQ CUDA 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/Upstage-Llama1-65B-Instruct-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/Upstage-Llama1-65B-Instruct-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/Upstage-Llama1-65B-Instruct-GPTQ`.
88
+ - To download from a specific branch, enter for example `TheBloke/Upstage-Llama1-65B-Instruct-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: `Upstage-Llama1-65B-Instruct-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/Upstage-Llama1-65B-Instruct-GPTQ"
112
+ model_basename = "gptq_model-4bit-128g"
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'''{prompt}
140
+ '''
141
+
142
+ print("\n\n*** Generate:")
143
+
144
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
145
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
146
+ print(tokenizer.decode(output[0]))
147
+
148
+ # Inference can also be done using transformers' pipeline
149
+
150
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
151
+ logging.set_verbosity(logging.CRITICAL)
152
+
153
+ print("*** Pipeline:")
154
+ pipe = pipeline(
155
+ "text-generation",
156
+ model=model,
157
+ tokenizer=tokenizer,
158
+ max_new_tokens=512,
159
+ temperature=0.7,
160
+ top_p=0.95,
161
+ repetition_penalty=1.15
162
+ )
163
+
164
+ print(pipe(prompt_template)[0]['generated_text'])
165
+ ```
166
+
167
+ ## Compatibility
168
+
169
+ 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.
170
+
171
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
172
+
173
+ <!-- footer start -->
174
+ ## Discord
175
+
176
+ For further support, and discussions on these models and AI in general, join us at:
177
+
178
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
179
+
180
+ ## Thanks, and how to contribute.
181
+
182
+ Thanks to the [chirper.ai](https://chirper.ai) team!
183
+
184
+ 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.
185
+
186
+ 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.
187
+
188
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
189
+
190
+ * Patreon: https://patreon.com/TheBlokeAI
191
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
192
+
193
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
194
+
195
+ **Patreon special mentions**: Slarti, Chadd, John Detwiler, Pieter, zynix, K, Mano Prime, ReadyPlayerEmma, Ai Maven, Leonard Tan, Edmond Seymore, Joseph William Delisle, Luke @flexchar, Fred von Graf, Viktor Bowallius, Rishabh Srivastava, Nikolai Manek, Matthew Berman, Johann-Peter Hartmann, ya boyyy, Greatston Gnanesh, Femi Adebogun, Talal Aujan, Jonathan Leane, terasurfer, David Flickinger, William Sang, Ajan Kanaga, Vadim, Artur Olbinski, Raven Klaugh, Michael Levine, Oscar Rangel, Randy H, Cory Kujawski, RoA, Dave, Alex, Alexandros Triantafyllidis, Fen Risland, Eugene Pentland, vamX, Elle, Nathan LeClaire, Khalefa Al-Ahmad, Rainer Wilmers, subjectnull, Junyu Yang, Daniel P. Andersen, SuperWojo, LangChain4j, Mandus, Kalila, Illia Dulskyi, Trenton Dambrowitz, Asp the Wyvern, Derek Yates, Jeffrey Morgan, Deep Realms, Imad Khwaja, Pyrater, Preetika Verma, biorpg, Gabriel Tamborski, Stephen Murray, Spiking Neurons AB, Iucharbius, Chris Smitley, Willem Michiel, Luke Pendergrass, Sebastain Graf, senxiiz, Will Dee, Space Cruiser, Karl Bernard, Clay Pascal, Lone Striker, transmissions 11, webtim, WelcomeToTheClub, Sam, theTransient, Pierre Kircher, chris gileta, John Villwock, Sean Connelly, Willian Hasse
196
+
197
+
198
+ Thank you to all my generous patrons and donaters!
199
+
200
+ <!-- footer end -->
201
+
202
+ # Original model card: Upstage's Llama 65B Instruct
203
+
204
+ # LLaMa-65b-instruct model card
205
+
206
+ ## Contact Us, Why Upstage LLM?
207
+ - [Upstage](https://en.upstage.ai)'s LLM research has yielded remarkable results. Our 30B model **outperforms all models around the world**, positioning itself as the leading performer. Recognizing the immense potential in implementing private LLM to actual businesses, we invite you to easily apply private LLM and fine-tune it with your own data. For a seamless and tailored solution, please do not hesitate to reach out to us. ► [click here to contact].
208
+
209
+ ## Model and Dataset Details
210
+ - Please refer to the model card of [upstage/llama-30b-instruct](https://huggingface.co/upstage/llama-30b-instruct) as this one is almost the same.
211
+
212
+ ## License
213
+ - This model is under a **Non-commercial** Bespoke License and governed by the Meta license. You should only use this repository if you have been granted access to the model by filling out [this form](https://docs.google.com/forms/d/e/1FAIpQLSfqNECQnMkycAp2jP4Z9TFX0cGR4uf7b_fBxjY_OjhJILlKGA/viewform), but have either lost your copy of the weights or encountered issues converting them to the Transformers format.
214
+
215
+ [click here to contact]: mailto:contact@upstage.ai