TheBloke commited on
Commit
e56047e
1 Parent(s): aa822de

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +162 -220
README.md CHANGED
@@ -1,7 +1,16 @@
1
  ---
 
2
  inference: false
3
  license: other
 
 
4
  model_type: llama
 
 
 
 
 
 
5
  ---
6
 
7
  <!-- header start -->
@@ -21,146 +30,196 @@ model_type: llama
21
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
22
  <!-- header end -->
23
 
24
- # Tim Dettmers' Guanaco 65B GPTQ
 
 
25
 
26
- These files are GPTQ model files for [Tim Dettmers' Guanaco 65B](https://huggingface.co/timdettmers/guanaco-65b).
 
27
 
28
- 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.
29
 
30
- These models were quantised using hardware kindly provided by [Latitude.sh](https://www.latitude.sh/accelerate).
31
 
 
 
32
  ## Repositories available
33
 
 
34
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/guanaco-65B-GPTQ)
35
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/guanaco-65B-GGML)
36
- * [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/guanaco-65B-HF)
 
37
 
 
38
  ## Prompt template: Guanaco
39
 
40
  ```
41
  ### Human: {prompt}
42
  ### Assistant:
 
43
  ```
44
 
45
- ## Provided files
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
48
 
49
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
50
 
51
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
52
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
53
- | main | 4 | None | True | 35.74 GB | True | GPTQ-for-LLaMa | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
54
- | 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. |
55
- | 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. |
56
- | 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. |
57
- | gptq-3bit-128g-actorder_False | 3 | 128 | False | 26.57 GB | False | AutoGPTQ | 3-bit, with group size 128g but no act-order. Slightly higher VRAM requirements than 3-bit None. |
58
- | gptq-3bit-128g-actorder_True | 3 | 128 | True | 26.57 GB | False | AutoGPTQ | 3-bit, with group size 128g and act-order. Higher quality than 128g-False but poor AutoGPTQ CUDA speed. |
59
- | gptq-3bit-64g-actorder_True | 3 | 64 | True | 27.78 GB | False | AutoGPTQ | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. Poor AutoGPTQ CUDA speed. |
60
- | gptq-3bit--1g-actorder_True | 3 | None | True | 25.39 GB | False | AutoGPTQ | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  ## How to download from branches
63
 
64
- - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/guanaco-65B-GPTQ:gptq-4bit-32g-actorder_True`
65
  - With Git, you can clone a branch with:
66
  ```
67
- git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/guanaco-65B-GPTQ`
68
  ```
69
  - In Python Transformers code, the branch is the `revision` parameter; see below.
70
-
 
71
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
72
 
73
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
74
 
75
- It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
76
 
77
  1. Click the **Model tab**.
78
  2. Under **Download custom model or LoRA**, enter `TheBloke/guanaco-65B-GPTQ`.
79
- - To download from a specific branch, enter for example `TheBloke/guanaco-65B-GPTQ:gptq-4bit-32g-actorder_True`
80
  - see Provided Files above for the list of branches for each option.
81
  3. Click **Download**.
82
- 4. The model will start downloading. Once it's finished it will say "Done"
83
  5. In the top left, click the refresh icon next to **Model**.
84
  6. In the **Model** dropdown, choose the model you just downloaded: `guanaco-65B-GPTQ`
85
  7. The model will automatically load, and is now ready for use!
86
  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.
87
- * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
88
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
 
89
 
 
90
  ## How to use this GPTQ model from Python code
91
 
92
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
 
 
93
 
94
- `GITHUB_ACTIONS=true pip install auto-gptq`
 
 
 
95
 
96
- Then try the following example code:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
  ```python
99
- from transformers import AutoTokenizer, pipeline, logging
100
- from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
101
 
102
  model_name_or_path = "TheBloke/guanaco-65B-GPTQ"
103
- model_basename = "Guanaco-65B-GPTQ-4bit-128g.no-act.order"
104
-
105
- use_triton = False
 
 
 
106
 
107
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
108
 
109
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
110
- model_basename=model_basename
111
- use_safetensors=True,
112
- trust_remote_code=True,
113
- device="cuda:0",
114
- use_triton=use_triton,
115
- quantize_config=None)
116
-
117
- """
118
- To download from a specific branch, use the revision parameter, as in this example:
119
-
120
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
121
- revision="gptq-4bit-32g-actorder_True",
122
- model_basename=model_basename,
123
- use_safetensors=True,
124
- trust_remote_code=True,
125
- device="cuda:0",
126
- quantize_config=None)
127
- """
128
-
129
  prompt = "Tell me about AI"
130
  prompt_template=f'''### Human: {prompt}
131
  ### Assistant:
 
132
  '''
133
 
134
  print("\n\n*** Generate:")
135
 
136
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
137
- output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
138
  print(tokenizer.decode(output[0]))
139
 
140
  # Inference can also be done using transformers' pipeline
141
 
142
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
143
- logging.set_verbosity(logging.CRITICAL)
144
-
145
  print("*** Pipeline:")
146
  pipe = pipeline(
147
  "text-generation",
148
  model=model,
149
  tokenizer=tokenizer,
150
  max_new_tokens=512,
 
151
  temperature=0.7,
152
  top_p=0.95,
153
- repetition_penalty=1.15
 
154
  )
155
 
156
  print(pipe(prompt_template)[0]['generated_text'])
157
  ```
 
158
 
 
159
  ## Compatibility
160
 
161
- 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.
 
 
162
 
163
- ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
 
164
 
165
  <!-- footer start -->
166
  <!-- 200823 -->
@@ -170,10 +229,12 @@ For further support, and discussions on these models and AI in general, join us
170
 
171
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
172
 
173
- ## Thanks, and how to contribute.
174
 
175
  Thanks to the [chirper.ai](https://chirper.ai) team!
176
 
 
 
177
  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.
178
 
179
  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.
@@ -185,7 +246,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
185
 
186
  **Special thanks to**: Aemon Algiz.
187
 
188
- **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
189
 
190
 
191
  Thank you to all my generous patrons and donaters!
@@ -196,175 +257,56 @@ And thank you again to a16z for their generous grant.
196
 
197
  # Original model card: Tim Dettmers' Guanaco 65B
198
 
199
- # Guanaco Models Based on LLaMA
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
 
201
- | [Paper](https://arxiv.org/abs/2305.14314) | [Code](https://github.com/artidoro/qlora) | [Demo](https://huggingface.co/spaces/uwnlp/guanaco-playground-tgi) |
202
 
203
- **The Guanaco models are open-source finetuned chatbots obtained through 4-bit QLoRA tuning of LLaMA base models on the OASST1 dataset. They are available in 7B, 13B, 33B, and 65B parameter sizes.**
204
 
205
- ⚠️Guanaco is a model purely intended for research purposes and could produce problematic outputs.
206
 
207
- ## Why use Guanaco?
208
- - **Competitive with commercial chatbot systems on the Vicuna and OpenAssistant benchmarks** (ChatGPT and BARD) according to human and GPT-4 raters. We note that the relative performance on tasks not covered in these benchmarks could be very different. In addition, commercial systems evolve over time (we used outputs from the March 2023 version of the models).
209
- - **Available open-source for research purposes**. Guanaco models allow *cheap* and *local* experimentation with high-quality chatbot systems.
210
- - **Replicable and efficient training procedure** that can be extended to new use cases. Guanaco training scripts are available in the [QLoRA repo](https://github.com/artidoro/qlora).
211
- - **Rigorous comparison to 16-bit methods** (both 16-bit full-finetuning and LoRA) in [our paper](https://arxiv.org/abs/2305.14314) demonstrates the effectiveness of 4-bit QLoRA finetuning.
212
- - **Lightweight** checkpoints which only contain adapter weights.
213
 
214
- ## License and Intended Use
215
- Guanaco adapter weights are available under Apache 2 license. Note the use of the Guanaco adapter weights, requires access to the LLaMA model weighs.
216
- Guanaco is based on LLaMA and therefore should be used according to the LLaMA license.
217
 
218
- ## Usage
219
- Here is an example of how you would load Guanaco 7B in 4-bits:
220
- ```python
221
- import torch
222
- from peft import PeftModel
223
- from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
224
-
225
- model_name = "huggyllama/llama-7b"
226
- adapters_name = 'timdettmers/guanaco-7b'
227
-
228
- model = AutoModelForCausalLM.from_pretrained(
229
- model_name,
230
- load_in_4bit=True,
231
- torch_dtype=torch.bfloat16,
232
- device_map="auto",
233
- max_memory= {i: '24000MB' for i in range(torch.cuda.device_count())},
234
- quantization_config=BitsAndBytesConfig(
235
- load_in_4bit=True,
236
- bnb_4bit_compute_dtype=torch.bfloat16,
237
- bnb_4bit_use_double_quant=True,
238
- bnb_4bit_quant_type='nf4'
239
- ),
240
- )
241
- model = PeftModel.from_pretrained(model, adapters_name)
242
- tokenizer = AutoTokenizer.from_pretrained(model_name)
243
 
244
- ```
245
- Inference can then be performed as usual with HF models as follows:
246
- ```python
247
- prompt = "Introduce yourself"
248
- formatted_prompt = (
249
- f"A chat between a curious human and an artificial intelligence assistant."
250
- f"The assistant gives helpful, detailed, and polite answers to the user's questions.\n"
251
- f"### Human: {prompt} ### Assistant:"
252
- )
253
- inputs = tokenizer(formatted_prompt, return_tensors="pt").to("cuda:0")
254
- outputs = model.generate(inputs=inputs.input_ids, max_new_tokens=20)
255
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
256
- ```
257
- Expected output similar to the following:
258
- ```
259
- A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
260
- ### Human: Introduce yourself ### Assistant: I am an artificial intelligence assistant. I am here to help you with any questions you may have.
261
- ```
262
 
 
263
 
264
- ## Current Inference Limitations
265
- Currently, 4-bit inference is slow. We recommend loading in 16 bits if inference speed is a concern. We are actively working on releasing efficient 4-bit inference kernels.
266
 
267
- Below is how you would load the model in 16 bits:
268
- ```python
269
- model_name = "huggyllama/llama-7b"
270
- adapters_name = 'timdettmers/guanaco-7b'
271
- model = AutoModelForCausalLM.from_pretrained(
272
- model_name,
273
- torch_dtype=torch.bfloat16,
274
- device_map="auto",
275
- max_memory= {i: '24000MB' for i in range(torch.cuda.device_count())},
276
- )
277
- model = PeftModel.from_pretrained(model, adapters_name)
278
- tokenizer = AutoTokenizer.from_pretrained(model_name)
279
 
280
- ```
 
 
281
 
 
 
282
 
283
- ## Model Card
284
- **Architecture**: The Guanaco models are LoRA adapters to be used on top of LLaMA models. They are added to all layers. For all model sizes, we use $r=64$.
285
-
286
- **Base Model**: Guanaco uses LLaMA as base model with sizes 7B, 13B, 33B, 65B. LLaMA is a causal language model pretrained on a large corpus of text. See [LLaMA paper](https://arxiv.org/abs/2302.13971) for more details. Note that Guanaco can inherit biases and limitations of the base model.
287
-
288
- **Finetuning Data**: Guanaco is finetuned on OASST1. The exact dataset is available at [timdettmers/openassistant-guanaco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco).
289
-
290
- **Languages**: The OASST1 dataset is multilingual (see [the paper](https://arxiv.org/abs/2304.07327) for details) and as such Guanaco responds to user queries in different languages. We note, however, that OASST1 is heavy in high-resource languages. In addition, human evaluation of Guanaco was only performed in English and based on qualitative analysis we observed degradation in performance in other languages.
291
-
292
- Next, we describe Training and Evaluation details.
293
-
294
- ### Training
295
- Guanaco models are the result of 4-bit QLoRA supervised finetuning on the OASST1 dataset.
296
-
297
- All models use NormalFloat4 datatype for the base model and LoRA adapters on all linear layers with BFloat16 as computation datatype. We set LoRA $r=64$, $\alpha=16$. We also use Adam beta2 of 0.999, max grad norm of 0.3 and LoRA dropout of 0.1 for models up to 13B and 0.05 for 33B and 65B models.
298
- For the finetuning process, we use constant learning rate schedule and paged AdamW optimizer.
299
-
300
- ### Training hyperparameters
301
- Size| Dataset | Batch Size | Learning Rate | Max Steps | Sequence length
302
- ---|---|---|---|---|---
303
- 7B | OASST1 | 16 | 2e-4 | 1875 | 512
304
- 13B | OASST1 | 16 | 2e-4 | 1875 | 512
305
- 33B | OASST1 | 16 | 1e-4 | 1875 | 512
306
- 65B | OASST1 | 16 | 1e-4 | 1875 | 512
307
-
308
- ### Evaluation
309
- We test generative language capabilities through both automated and human evaluations. This second set of evaluations relies on queries curated by humans and aims at measuring the quality of model responses. We use the Vicuna and OpenAssistant datasets with 80 and 953 prompts respectively.
310
-
311
- In both human and automated evaluations, for each prompt, raters compare all pairs of responses across the models considered. For human raters we randomize the order of the systems, for GPT-4 we evaluate with both orders.
312
-
313
-
314
- Benchmark | Vicuna | | Vicuna | | OpenAssistant | | -
315
- -----------|----|-----|--------|---|---------------|---|---
316
- Prompts | 80 | | 80 | | 953 | |
317
- Judge | Human | | GPT-4 | | GPT-4 | |
318
- Model | Elo | Rank | Elo | Rank | Elo | Rank | **Median Rank**
319
- GPT-4 | 1176 | 1 | 1348 | 1 | 1294 | 1 | 1
320
- Guanaco-65B | 1023 | 2 | 1022 | 2 | 1008 | 3 | 2
321
- Guanaco-33B | 1009 | 4 | 992 | 3 | 1002 | 4 | 4
322
- ChatGPT-3.5 Turbo | 916 | 7 | 966 | 5 | 1015 | 2 | 5
323
- Vicuna-13B | 984 | 5 | 974 | 4 | 936 | 5 | 5
324
- Guanaco-13B | 975 | 6 | 913 | 6 | 885 | 6 | 6
325
- Guanaco-7B | 1010 | 3 | 879 | 8 | 860 | 7 | 7
326
- Bard | 909 | 8 | 902 | 7 | - | - | 8
327
-
328
-
329
- We also use the MMLU benchmark to measure performance on a range of language understanding tasks. This is a multiple-choice benchmark covering 57 tasks including elementary mathematics, US history, computer science, law, and more. We report 5-shot test accuracy.
330
-
331
- Dataset | 7B | 13B | 33B | 65B
332
- ---|---|---|---|---
333
- LLaMA no tuning | 35.1 | 46.9 | 57.8 | 63.4
334
- Self-Instruct | 36.4 | 33.3 | 53.0 | 56.7
335
- Longform | 32.1 | 43.2 | 56.6 | 59.7
336
- Chip2 | 34.5 | 41.6 | 53.6 | 59.8
337
- HH-RLHF | 34.9 | 44.6 | 55.8 | 60.1
338
- Unnatural Instruct | 41.9 | 48.1 | 57.3 | 61.3
339
- OASST1 (Guanaco) | 36.6 | 46.4 | 57.0 | 62.2
340
- Alpaca | 38.8 | 47.8 | 57.3 | 62.5
341
- FLAN v2 | 44.5 | 51.4 | 59.2 | 63.9
342
-
343
- ## Risks and Biases
344
- The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. The model was trained on various public datasets; it is possible that this model could generate lewd, biased, or otherwise offensive outputs.
345
-
346
- However, we note that finetuning on OASST1 seems to reduce biases as measured on the CrowS dataset. We report here the performance of Guanaco-65B compared to other baseline models on the CrowS dataset.
347
-
348
- | | LLaMA-65B | GPT-3 | OPT-175B | Guanaco-65B |
349
- |----------------------|-----------|-------|----------|---------------|
350
- | Gender | 70.6 | 62.6 | 65.7 | **47.5** |
351
- | Religion | {79.0} | 73.3 | 68.6 | **38.7** |
352
- | Race/Color | 57.0 | 64.7 | 68.6 | **45.3** |
353
- | Sexual orientation | {81.0} | 76.2 | 78.6 | **59.1** |
354
- | Age | 70.1 | 64.4 | 67.8 | **36.3** |
355
- | Nationality | 64.2 | 61.6 | 62.9 | **32.4** |
356
- | Disability | 66.7 | 76.7 | 76.7 | **33.9** |
357
- | Physical appearance | 77.8 | 74.6 | 76.2 | **43.1** |
358
- | Socioeconomic status | 71.5 | 73.8 | 76.2 | **55.3** |
359
- | Average | 66.6 | 67.2 | 69.5 | **43.5** |
360
-
361
- ## Citation
362
-
363
- ```bibtex
364
- @article{dettmers2023qlora,
365
- title={QLoRA: Efficient Finetuning of Quantized LLMs},
366
- author={Dettmers, Tim and Pagnoni, Artidoro and Holtzman, Ari and Zettlemoyer, Luke},
367
- journal={arXiv preprint arXiv:2305.14314},
368
- year={2023}
369
- }
370
- ```
 
1
  ---
2
+ base_model: https://huggingface.co/timdettmers/guanaco-65b
3
  inference: false
4
  license: other
5
+ model_creator: Tim Dettmers
6
+ model_name: Guanaco 65B
7
  model_type: llama
8
+ prompt_template: '### Human: {prompt}
9
+
10
+ ### Assistant:
11
+
12
+ '
13
+ quantized_by: TheBloke
14
  ---
15
 
16
  <!-- header start -->
 
30
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
31
  <!-- header end -->
32
 
33
+ # Guanaco 65B - GPTQ
34
+ - Model creator: [Tim Dettmers](https://huggingface.co/timdettmers)
35
+ - Original model: [Guanaco 65B](https://huggingface.co/timdettmers/guanaco-65b)
36
 
37
+ <!-- description start -->
38
+ ## Description
39
 
40
+ This repo contains GPTQ model files for [Tim Dettmers' Guanaco 65B](https://huggingface.co/timdettmers/guanaco-65b).
41
 
42
+ 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.
43
 
44
+ <!-- description end -->
45
+ <!-- repositories-available start -->
46
  ## Repositories available
47
 
48
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/guanaco-65B-AWQ)
49
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/guanaco-65B-GPTQ)
50
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/guanaco-65B-GGUF)
51
+ * [Tim Dettmers's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/guanaco-65B-HF)
52
+ <!-- repositories-available end -->
53
 
54
+ <!-- prompt-template start -->
55
  ## Prompt template: Guanaco
56
 
57
  ```
58
  ### Human: {prompt}
59
  ### Assistant:
60
+
61
  ```
62
 
63
+ <!-- prompt-template end -->
64
+ <!-- licensing start -->
65
+ ## Licensing
66
+
67
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
68
+
69
+ 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.
70
+
71
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Tim Dettmers' Guanaco 65B](https://huggingface.co/timdettmers/guanaco-65b).
72
+ <!-- licensing end -->
73
+ <!-- README_GPTQ.md-provided-files start -->
74
+ ## Provided files and GPTQ parameters
75
 
76
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
77
 
78
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
79
 
80
+ 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.
81
+
82
+ <details>
83
+ <summary>Explanation of GPTQ parameters</summary>
 
 
 
 
 
 
84
 
85
+ - Bits: The bit size of the quantised model.
86
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
87
+ - 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.
88
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
89
+ - 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).
90
+ - 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.
91
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
92
+
93
+ </details>
94
+
95
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
96
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
97
+ | [main](https://huggingface.co/TheBloke/guanaco-65B-GPTQ/tree/main) | 4 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 33.49 GB | Yes | 4-bit, without Act Order and group size 128g. |
98
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/guanaco-65B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 38.53 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
99
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/guanaco-65B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 36.00 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
100
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/guanaco-65B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 34.73 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
101
+ | [gptq-3bit-128g-actorder_False](https://huggingface.co/TheBloke/guanaco-65B-GPTQ/tree/gptq-3bit-128g-actorder_False) | 3 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 26.57 GB | No | 3-bit, with group size 128g but no act-order. Slightly higher VRAM requirements than 3-bit None. |
102
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/guanaco-65B-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 26.57 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
103
+ | [gptq-3bit-64g-actorder_True](https://huggingface.co/TheBloke/guanaco-65B-GPTQ/tree/gptq-3bit-64g-actorder_True) | 3 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 27.78 GB | No | 3-bit, with group size 64g and act-order. |
104
+ | [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/guanaco-65B-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 25.39 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
105
+
106
+ <!-- README_GPTQ.md-provided-files end -->
107
+
108
+ <!-- README_GPTQ.md-download-from-branches start -->
109
  ## How to download from branches
110
 
111
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/guanaco-65B-GPTQ:main`
112
  - With Git, you can clone a branch with:
113
  ```
114
+ git clone --single-branch --branch main https://huggingface.co/TheBloke/guanaco-65B-GPTQ
115
  ```
116
  - In Python Transformers code, the branch is the `revision` parameter; see below.
117
+ <!-- README_GPTQ.md-download-from-branches end -->
118
+ <!-- README_GPTQ.md-text-generation-webui start -->
119
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
120
 
121
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
122
 
123
+ 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.
124
 
125
  1. Click the **Model tab**.
126
  2. Under **Download custom model or LoRA**, enter `TheBloke/guanaco-65B-GPTQ`.
127
+ - To download from a specific branch, enter for example `TheBloke/guanaco-65B-GPTQ:main`
128
  - see Provided Files above for the list of branches for each option.
129
  3. Click **Download**.
130
+ 4. The model will start downloading. Once it's finished it will say "Done".
131
  5. In the top left, click the refresh icon next to **Model**.
132
  6. In the **Model** dropdown, choose the model you just downloaded: `guanaco-65B-GPTQ`
133
  7. The model will automatically load, and is now ready for use!
134
  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.
135
+ * 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`.
136
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
137
+ <!-- README_GPTQ.md-text-generation-webui end -->
138
 
139
+ <!-- README_GPTQ.md-use-from-python start -->
140
  ## How to use this GPTQ model from Python code
141
 
142
+ ### Install the necessary packages
143
+
144
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
145
 
146
+ ```shell
147
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
148
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
149
+ ```
150
 
151
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
152
+
153
+ ```shell
154
+ pip3 uninstall -y auto-gptq
155
+ git clone https://github.com/PanQiWei/AutoGPTQ
156
+ cd AutoGPTQ
157
+ pip3 install .
158
+ ```
159
+
160
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
161
+
162
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
163
+ ```shell
164
+ pip3 uninstall -y transformers
165
+ pip3 install git+https://github.com/huggingface/transformers.git
166
+ ```
167
+
168
+ ### You can then use the following code
169
 
170
  ```python
171
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
172
 
173
  model_name_or_path = "TheBloke/guanaco-65B-GPTQ"
174
+ # To use a different branch, change revision
175
+ # For example: revision="main"
176
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
177
+ device_map="auto",
178
+ trust_remote_code=True,
179
+ revision="main")
180
 
181
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  prompt = "Tell me about AI"
184
  prompt_template=f'''### Human: {prompt}
185
  ### Assistant:
186
+
187
  '''
188
 
189
  print("\n\n*** Generate:")
190
 
191
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
192
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
193
  print(tokenizer.decode(output[0]))
194
 
195
  # Inference can also be done using transformers' pipeline
196
 
 
 
 
197
  print("*** Pipeline:")
198
  pipe = pipeline(
199
  "text-generation",
200
  model=model,
201
  tokenizer=tokenizer,
202
  max_new_tokens=512,
203
+ do_sample=True,
204
  temperature=0.7,
205
  top_p=0.95,
206
+ top_k=40,
207
+ repetition_penalty=1.1
208
  )
209
 
210
  print(pipe(prompt_template)[0]['generated_text'])
211
  ```
212
+ <!-- README_GPTQ.md-use-from-python end -->
213
 
214
+ <!-- README_GPTQ.md-compatibility start -->
215
  ## Compatibility
216
 
217
+ 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).
218
+
219
+ [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.
220
 
221
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
222
+ <!-- README_GPTQ.md-compatibility end -->
223
 
224
  <!-- footer start -->
225
  <!-- 200823 -->
 
229
 
230
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
231
 
232
+ ## Thanks, and how to contribute
233
 
234
  Thanks to the [chirper.ai](https://chirper.ai) team!
235
 
236
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
237
+
238
  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.
239
 
240
  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.
 
246
 
247
  **Special thanks to**: Aemon Algiz.
248
 
249
+ **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
250
 
251
 
252
  Thank you to all my generous patrons and donaters!
 
257
 
258
  # Original model card: Tim Dettmers' Guanaco 65B
259
 
260
+ <!-- header start -->
261
+ <div style="width: 100%;">
262
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
263
+ </div>
264
+ <div style="display: flex; justify-content: space-between; width: 100%;">
265
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
266
+ <p><a href="https://discord.gg/Jq4vkcDakD">Chat & support: my new Discord server</a></p>
267
+ </div>
268
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
269
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
270
+ </div>
271
+ </div>
272
+ <!-- header end -->
273
+
274
+ # Tim Dettmers' Guanaco 65B fp16 HF
275
 
276
+ These files are fp16 HF model files for [Tim Dettmers' Guanaco 65B](https://huggingface.co/timdettmers/guanaco-65b).
277
 
278
+ It is the result of merging the LoRA then saving in HF fp16 format.
279
 
280
+ ## Other repositories available
281
 
282
+ * [4-bit GPTQ models for GPU inference](https://huggingface.co/TheBloke/guanaco-65B-GPTQ)
283
+ * [4-bit, 5-bit and 8-bit GGML models for CPU(+GPU) inference](https://huggingface.co/TheBloke/guanaco-65B-GGML)
284
+ * [Merged, unquantised fp16 model in HF format](https://huggingface.co/TheBloke/guanaco-65B-HF)
 
 
 
285
 
286
+ <!-- footer start -->
287
+ ## Discord
 
288
 
289
+ For further support, and discussions on these models and AI in general, join us at:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
 
291
+ [TheBloke AI's Discord server](https://discord.gg/Jq4vkcDakD)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
 
293
+ ## Thanks, and how to contribute.
294
 
295
+ Thanks to the [chirper.ai](https://chirper.ai) team!
 
296
 
297
+ 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.
 
 
 
 
 
 
 
 
 
 
 
298
 
299
+ 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.
300
+
301
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
302
 
303
+ * Patreon: https://patreon.com/TheBlokeAI
304
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
305
 
306
+ **Patreon special mentions**: Aemon Algiz, Dmitriy Samsonov, Nathan LeClaire, Trenton Dambrowitz, Mano Prime, David Flickinger, vamX, Nikolai Manek, senxiiz, Khalefa Al-Ahmad, Illia Dulskyi, Jonathan Leane, Talal Aujan, V. Lukas, Joseph William Delisle, Pyrater, Oscar Rangel, Lone Striker, Luke Pendergrass, Eugene Pentland, Sebastain Graf, Johann-Peter Hartman.
307
+
308
+ Thank you to all my generous patrons and donaters!
309
+ <!-- footer end -->
310
+ # Original model card
311
+
312
+ Not provided by original model creator.