TheBloke commited on
Commit
a03ad07
·
1 Parent(s): 836ebee

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +210 -0
README.md ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ language:
4
+ - en
5
+ license: other
6
+ model_type: llama
7
+ pipeline_tag: text-generation
8
+ tags:
9
+ - upstage
10
+ - llama
11
+ - instruct
12
+ - instruction
13
+ ---
14
+
15
+ <!-- header start -->
16
+ <div style="width: 100%;">
17
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
18
+ </div>
19
+ <div style="display: flex; justify-content: space-between; width: 100%;">
20
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
21
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
22
+ </div>
23
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
24
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
25
+ </div>
26
+ </div>
27
+ <!-- header end -->
28
+
29
+ # Upstage's Llama 30B Instruct 2048 GPTQ
30
+
31
+ These files are GPTQ model files for [Upstage's Llama 30B Instruct 2048](https://huggingface.co/upstage/llama-30b-instruct-2048).
32
+
33
+ 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.
34
+
35
+ Many thanks to William Beauchamp from [Chai](https://chai-research.com/) for providing the hardware used to make and upload these files!
36
+
37
+ ## Repositories available
38
+
39
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/upstage-llama-30b-instruct-2048-GPTQ)
40
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/upstage-llama-30b-instruct-2048-GGML)
41
+ * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/upstage/llama-30b-instruct-2048)
42
+
43
+ ## Prompt template: Unknown
44
+
45
+ ```
46
+ {prompt}
47
+ ```
48
+
49
+ ## Provided files
50
+
51
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
52
+
53
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
54
+
55
+ | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
56
+ | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
57
+ | main | 4 | None | True | 16.94 GB | True | AutoGPTQ | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
58
+ | gptq-4bit-32g-actorder_True | 4 | 32 | True | 19.44 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. |
59
+ | gptq-4bit-64g-actorder_True | 4 | 64 | True | 18.18 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. |
60
+ | gptq-4bit-128g-actorder_True | 4 | 128 | True | 17.55 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. |
61
+ | gptq-8bit--1g-actorder_True | 8 | None | True | 32.99 GB | False | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
62
+ | gptq-8bit-128g-actorder_False | 8 | 128 | False | 33.73 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
63
+ | gptq-3bit-128g-actorder_False | 3 | 128 | False | 13.51 GB | False | AutoGPTQ | 3-bit, with group size 128g but no act-order. Slightly higher VRAM requirements than 3-bit None. |
64
+ | gptq-3bit-128g-actorder_True | 3 | 128 | True | 13.51 GB | False | AutoGPTQ | 3-bit, with group size 128g and act-order. Higher quality than 128g-False but poor AutoGPTQ CUDA speed. |
65
+
66
+ ## How to download from branches
67
+
68
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/upstage-llama-30b-instruct-2048-GPTQ:gptq-4bit-32g-actorder_True`
69
+ - With Git, you can clone a branch with:
70
+ ```
71
+ git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/upstage-llama-30b-instruct-2048-GPTQ`
72
+ ```
73
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
74
+
75
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
76
+
77
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
78
+
79
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
80
+
81
+ 1. Click the **Model tab**.
82
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/upstage-llama-30b-instruct-2048-GPTQ`.
83
+ - To download from a specific branch, enter for example `TheBloke/upstage-llama-30b-instruct-2048-GPTQ:gptq-4bit-32g-actorder_True`
84
+ - see Provided Files above for the list of branches for each option.
85
+ 3. Click **Download**.
86
+ 4. The model will start downloading. Once it's finished it will say "Done"
87
+ 5. In the top left, click the refresh icon next to **Model**.
88
+ 6. In the **Model** dropdown, choose the model you just downloaded: `upstage-llama-30b-instruct-2048-GPTQ`
89
+ 7. The model will automatically load, and is now ready for use!
90
+ 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.
91
+ * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
92
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
93
+
94
+ ## How to use this GPTQ model from Python code
95
+
96
+ First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
97
+
98
+ `GITHUB_ACTIONS=true pip install auto-gptq`
99
+
100
+ Then try the following example code:
101
+
102
+ ```python
103
+ from transformers import AutoTokenizer, pipeline, logging
104
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
105
+
106
+ model_name_or_path = "TheBloke/upstage-llama-30b-instruct-2048-GPTQ"
107
+ model_basename = "gptq_model-4bit--1g"
108
+
109
+ use_triton = False
110
+
111
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
112
+
113
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
114
+ model_basename=model_basename,
115
+ use_safetensors=True,
116
+ trust_remote_code=False,
117
+ device="cuda:0",
118
+ use_triton=use_triton,
119
+ quantize_config=None)
120
+
121
+ """
122
+ To download from a specific branch, use the revision parameter, as in this example:
123
+
124
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
125
+ revision="gptq-4bit-32g-actorder_True",
126
+ model_basename=model_basename,
127
+ use_safetensors=True,
128
+ trust_remote_code=False,
129
+ device="cuda:0",
130
+ quantize_config=None)
131
+ """
132
+
133
+ prompt = "Tell me about AI"
134
+ prompt_template=f'''{prompt}
135
+ '''
136
+
137
+ print("\n\n*** Generate:")
138
+
139
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
140
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
141
+ print(tokenizer.decode(output[0]))
142
+
143
+ # Inference can also be done using transformers' pipeline
144
+
145
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
146
+ logging.set_verbosity(logging.CRITICAL)
147
+
148
+ print("*** Pipeline:")
149
+ pipe = pipeline(
150
+ "text-generation",
151
+ model=model,
152
+ tokenizer=tokenizer,
153
+ max_new_tokens=512,
154
+ temperature=0.7,
155
+ top_p=0.95,
156
+ repetition_penalty=1.15
157
+ )
158
+
159
+ print(pipe(prompt_template)[0]['generated_text'])
160
+ ```
161
+
162
+ ## Compatibility
163
+
164
+ 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.
165
+
166
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
167
+
168
+ <!-- footer start -->
169
+ ## Discord
170
+
171
+ For further support, and discussions on these models and AI in general, join us at:
172
+
173
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
174
+
175
+ ## Thanks, and how to contribute.
176
+
177
+ Thanks to the [chirper.ai](https://chirper.ai) team!
178
+
179
+ 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.
180
+
181
+ 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.
182
+
183
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
184
+
185
+ * Patreon: https://patreon.com/TheBlokeAI
186
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
187
+
188
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
189
+
190
+ **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
191
+
192
+
193
+ Thank you to all my generous patrons and donaters!
194
+
195
+ <!-- footer end -->
196
+
197
+ # Original model card: Upstage's Llama 30B Instruct 2048
198
+
199
+ # LLaMa-30b-instruct-2048 model card
200
+
201
+ ## Contact Us, Why Upstage LLM?
202
+ - [Upstage](https://en.upstage.ai)'s LLM research has yielded remarkable results. Our 30B model size **outperforms all models worldwide**, establishing itself as the leading performer. Recognizing the immense potential for private LLM adoption within companies, we invite you to effortlessly implement a private LLM and fine-tune it with your own data. For a seamless and tailored solution, please don't hesitate to reach out to us [(click here to mail)].
203
+
204
+ ## Model and Dataset Details
205
+ - 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.
206
+
207
+ ## License
208
+ - 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.
209
+
210
+ [(click here to mail)]: mailto:[email protected]