TheBloke commited on
Commit
ee305bb
1 Parent(s): b5e519b

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +272 -0
README.md ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ language:
4
+ - de
5
+ - en
6
+ license: other
7
+ model_type: llama
8
+ pipeline_tag: text-generation
9
+ ---
10
+
11
+ <!-- header start -->
12
+ <div style="width: 100%;">
13
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
14
+ </div>
15
+ <div style="display: flex; justify-content: space-between; width: 100%;">
16
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
17
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
18
+ </div>
19
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
20
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
21
+ </div>
22
+ </div>
23
+ <!-- header end -->
24
+
25
+ # Jan Philipp Harries' Vicuna 13B v1.3 German GPTQ
26
+
27
+ These files are GPTQ model files for [Jan Philipp Harries' Vicuna 13B v1.3 German](https://huggingface.co/jphme/vicuna-13b-v1.3-ger).
28
+
29
+ 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.
30
+
31
+
32
+ ## Repositories available
33
+
34
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Vicuna-13B-v1.3-German-GPTQ)
35
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/Vicuna-13B-v1.3-German-GGML)
36
+ * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/jphme/vicuna-13b-v1.3-ger)
37
+
38
+ ## Prompt template: Vicuna
39
+
40
+ ```
41
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
42
+
43
+ USER: {prompt}
44
+ ASSISTANT:
45
+ ```
46
+
47
+ ## Provided files
48
+
49
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
50
+
51
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
52
+
53
+ | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
54
+ | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
55
+ | 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. |
56
+ | 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. |
57
+ | 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. |
58
+ | 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. |
59
+ | 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. |
60
+ | 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. |
61
+ | 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. |
62
+ | 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. |
63
+
64
+ ## How to download from branches
65
+
66
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Vicuna-13B-v1.3-German-GPTQ:gptq-4bit-32g-actorder_True`
67
+ - With Git, you can clone a branch with:
68
+ ```
69
+ git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Vicuna-13B-v1.3-German-GPTQ`
70
+ ```
71
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
72
+
73
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
74
+
75
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
76
+
77
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
78
+
79
+ 1. Click the **Model tab**.
80
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Vicuna-13B-v1.3-German-GPTQ`.
81
+ - To download from a specific branch, enter for example `TheBloke/Vicuna-13B-v1.3-German-GPTQ:gptq-4bit-32g-actorder_True`
82
+ - see Provided Files above for the list of branches for each option.
83
+ 3. Click **Download**.
84
+ 4. The model will start downloading. Once it's finished it will say "Done"
85
+ 5. In the top left, click the refresh icon next to **Model**.
86
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Vicuna-13B-v1.3-German-GPTQ`
87
+ 7. The model will automatically load, and is now ready for use!
88
+ 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.
89
+ * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
90
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
91
+
92
+ ## How to use this GPTQ model from Python code
93
+
94
+ First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
95
+
96
+ `GITHUB_ACTIONS=true pip install auto-gptq`
97
+
98
+ Then try the following example code:
99
+
100
+ ```python
101
+ from transformers import AutoTokenizer, pipeline, logging
102
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
103
+
104
+ model_name_or_path = "TheBloke/Vicuna-13B-v1.3-German-GPTQ"
105
+ model_basename = "gptq_model-4bit-128g"
106
+
107
+ use_triton = False
108
+
109
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
110
+
111
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
112
+ model_basename=model_basename,
113
+ use_safetensors=True,
114
+ trust_remote_code=True,
115
+ device="cuda:0",
116
+ use_triton=use_triton,
117
+ quantize_config=None)
118
+
119
+ """
120
+ To download from a specific branch, use the revision parameter, as in this example:
121
+
122
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
123
+ revision="gptq-4bit-32g-actorder_True",
124
+ model_basename=model_basename,
125
+ use_safetensors=True,
126
+ trust_remote_code=True,
127
+ device="cuda:0",
128
+ quantize_config=None)
129
+ """
130
+
131
+ prompt = "Tell me about AI"
132
+ prompt_template=f'''A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
133
+
134
+ USER: {prompt}
135
+ 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**: 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
192
+
193
+
194
+ Thank you to all my generous patrons and donaters!
195
+
196
+ <!-- footer end -->
197
+
198
+ # Original model card: Jan Philipp Harries' Vicuna 13B v1.3 German
199
+
200
+
201
+ # Vicuna 13b v1.3 German
202
+
203
+ vicuna-13b-v1.3-ger is a variant of [LMSYS](https://huggingface.co/lmsys)´s [Vicuna 13b v1.3](https://huggingface.co/lmsys/vicuna-13b-v1.3) model, finetuned on an additional dataset in German language. The original model has been trained on explain tuned datasets, created using instructions and input from WizardLM, Alpaca & Dolly-V2 datasets and applying Orca Research Paper dataset construction approaches.
204
+
205
+ This model is optimized for German text, providing proficiency in understanding, generating, and interacting with German language content. However the model is not yet fully optimized for German language, as it has been trained on a small, experimental dataset and has limited capabilities due to the small parameter count.
206
+ Some of the fineunting data is also targeted towards factual retrieval (only answer questions from information in the context and refuse to hallucinate) and the model should perform better for these tasks than original Vicuna.
207
+
208
+ I am working on improving the model´s capabilities and will update the model if there is sufficient interest.
209
+
210
+ A quantized GGML version for use with llama.cpp, kobold.cpp and other GUIs for CPU inference can be found [here](https://huggingface.co/jphme/vicuna-13b-v1.3-ger-GGML).
211
+
212
+ ## Prompt Template
213
+
214
+ ```
215
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
216
+
217
+ USER: Hello!
218
+ ASSISTANT: Hello!</s>
219
+ USER: How are you?
220
+ ASSISTANT: I am good.</s>
221
+ ```
222
+
223
+ ## Results
224
+
225
+ I did only evaluate the output on a small, handcrafted sample on test prompts in German, confirming that the model's ability to understand and generate German text is above the base model in many situations.
226
+
227
+ ## Problems
228
+
229
+ There might be inconsistencies in multi-turn chat applications, as there was a small problem with the <eos> tokens during preparation of the finetuning dataset.
230
+ Please report any problems so I can fix this for the next version.
231
+
232
+ ---------------------------
233
+ # Original Vicuna Model Card
234
+
235
+ ## Model Details
236
+
237
+ Vicuna is a chat assistant trained by fine-tuning LLaMA on user-shared conversations collected from ShareGPT.
238
+
239
+ - **Developed by:** [LMSYS](https://lmsys.org/)
240
+ - **Model type:** An auto-regressive language model based on the transformer architecture.
241
+ - **License:** Non-commercial license
242
+ - **Finetuned from model:** [LLaMA](https://arxiv.org/abs/2302.13971).
243
+
244
+ ### Model Sources
245
+
246
+ - **Repository:** https://github.com/lm-sys/FastChat
247
+ - **Blog:** https://lmsys.org/blog/2023-03-30-vicuna/
248
+ - **Paper:** https://arxiv.org/abs/2306.05685
249
+ - **Demo:** https://chat.lmsys.org/
250
+
251
+ ## Uses
252
+
253
+ The primary use of Vicuna is research on large language models and chatbots.
254
+ The primary intended users of the model are researchers and hobbyists in natural language processing, machine learning, and artificial intelligence.
255
+
256
+ ## How to Get Started with the Model
257
+
258
+ - Command line interface: https://github.com/lm-sys/FastChat#vicuna-weights.
259
+ - APIs (OpenAI API, Huggingface API): https://github.com/lm-sys/FastChat/tree/main#api.
260
+
261
+ ## Training Details
262
+
263
+ Vicuna v1.3 is fine-tuned from LLaMA with supervised instruction fine-tuning.
264
+ The training data is around 140K conversations collected from ShareGPT.com.
265
+ See more details in the "Training Details of Vicuna Models" section in the appendix of this [paper](https://arxiv.org/pdf/2306.05685.pdf).
266
+
267
+ ## Evaluation
268
+
269
+ Vicuna is evaluated with standard benchmarks, human preference, and LLM-as-a-judge. See more details in this [paper](https://arxiv.org/pdf/2306.05685.pdf) and [leaderboard](https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard).
270
+
271
+ ## Difference between different versions of Vicuna
272
+ See [vicuna_weights_version.md](https://github.com/lm-sys/FastChat/blob/main/docs/vicuna_weights_version.md)