TheBloke commited on
Commit
bcba202
1 Parent(s): 125553b

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +104 -56
README.md CHANGED
@@ -2,9 +2,13 @@
2
  inference: false
3
  language:
4
  - en
5
- license: other
 
 
 
6
  model_type: llama
7
  pipeline_tag: text-classification
 
8
  tags:
9
  - llama-2
10
  ---
@@ -26,114 +30,154 @@ tags:
26
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
27
  <!-- header end -->
28
 
29
- # Mikael110's Llama2 7B Guanaco QLoRA GPTQ
 
 
30
 
31
- These files are GPTQ model files for [Mikael110's Llama2 7B Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-7b-guanaco-fp16).
 
 
 
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/llama-2-7B-Guanaco-QLoRA-GPTQ)
40
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GGML)
41
- * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Mikael110/llama-2-7b-guanaco-fp16)
 
 
42
 
 
43
  ## Prompt template: Guanaco
44
 
45
  ```
46
  ### Human: {prompt}
47
  ### Assistant:
 
48
  ```
49
 
50
- ## Provided files
 
 
 
51
 
52
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
53
 
54
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
55
 
56
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
57
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
58
- | main | 4 | 128 | False | 3.90 GB | True | AutoGPTQ | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
59
- | gptq-4bit-32g-actorder_True | 4 | 32 | True | 4.28 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. |
60
- | gptq-4bit-64g-actorder_True | 4 | 64 | True | 4.02 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. |
61
- | gptq-4bit-128g-actorder_True | 4 | 128 | True | 3.90 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. |
62
- | gptq-8bit--1g-actorder_True | 8 | None | True | 7.01 GB | False | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
63
- | gptq-8bit-128g-actorder_False | 8 | 128 | False | 7.16 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
64
- | gptq-8bit-128g-actorder_True | 8 | 128 | True | 7.16 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. |
65
- | gptq-8bit-64g-actorder_True | 8 | 64 | True | 7.31 GB | False | AutoGPTQ | 8-bit, with group size 64g and Act Order for maximum inference quality. 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/llama-2-7B-Guanaco-QLoRA-GPTQ:gptq-4bit-32g-actorder_True`
70
  - With Git, you can clone a branch with:
71
  ```
72
- git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-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/llama-2-7B-Guanaco-QLoRA-GPTQ`.
84
  - To download from a specific branch, enter for example `TheBloke/llama-2-7B-Guanaco-QLoRA-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: `llama-2-7B-Guanaco-QLoRA-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/llama-2-7B-Guanaco-QLoRA-GPTQ"
108
- model_basename = "model"
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'''### Human: {prompt}
136
  ### Assistant:
 
137
  '''
138
 
139
  print("\n\n*** Generate:")
@@ -144,9 +188,6 @@ print(tokenizer.decode(output[0]))
144
 
145
  # Inference can also be done using transformers' pipeline
146
 
147
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
148
- logging.set_verbosity(logging.CRITICAL)
149
-
150
  print("*** Pipeline:")
151
  pipe = pipeline(
152
  "text-generation",
@@ -160,12 +201,17 @@ pipe = pipeline(
160
 
161
  print(pipe(prompt_template)[0]['generated_text'])
162
  ```
 
163
 
 
164
  ## Compatibility
165
 
166
- 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.
167
 
168
- ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
 
 
 
169
 
170
  <!-- footer start -->
171
  <!-- 200823 -->
@@ -190,7 +236,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
190
 
191
  **Special thanks to**: Aemon Algiz.
192
 
193
- **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
194
 
195
 
196
  Thank you to all my generous patrons and donaters!
@@ -199,10 +245,12 @@ And thank you again to a16z for their generous grant.
199
 
200
  <!-- footer end -->
201
 
202
- # Original model card: Mikael110's Llama2 7B Guanaco QLoRA
203
 
204
  This is a Llama-2 version of [Guanaco](https://huggingface.co/timdettmers/guanaco-7b). It was finetuned from the base [Llama-7b](https://huggingface.co/meta-llama/Llama-2-7b-hf) model using the official training scripts found in the [QLoRA repo](https://github.com/artidoro/qlora). I wanted it to be as faithful as possible and therefore changed nothing in the training script beyond the model it was pointing to. The model prompt is therefore also the same as the original Guanaco model.
205
 
206
  This repo contains the merged f16 model. The QLoRA adaptor can be found [here](https://huggingface.co/Mikael110/llama-2-7b-guanaco-qlora).
207
 
 
 
208
  **Legal Disclaimer: This model is bound by the usage restrictions of the original Llama-2 model. And comes with no warranty or gurantees of any kind.**
 
2
  inference: false
3
  language:
4
  - en
5
+ license: llama2
6
+ model_creator: Mikael
7
+ model_link: https://huggingface.co/Mikael110/llama-2-7b-guanaco-fp16
8
+ model_name: Llama2 7B Guanaco QLoRA
9
  model_type: llama
10
  pipeline_tag: text-classification
11
+ quantized_by: TheBloke
12
  tags:
13
  - llama-2
14
  ---
 
30
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
31
  <!-- header end -->
32
 
33
+ # Llama2 7B Guanaco QLoRA - GPTQ
34
+ - Model creator: [Mikael](https://huggingface.co/Mikael110)
35
+ - Original model: [Llama2 7B Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-7b-guanaco-fp16)
36
 
37
+ <!-- description start -->
38
+ ## Description
39
+
40
+ This repo contains GPTQ model files for [Mikael10's Llama2 7B Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-7b-guanaco-fp16).
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
  Many thanks to William Beauchamp from [Chai](https://chai-research.com/) for providing the hardware used to make and upload these files!
45
 
46
+ <!-- description end -->
47
+ <!-- repositories-available start -->
48
  ## Repositories available
49
 
50
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ)
51
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GGUF)
52
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference (deprecated)](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GGML)
53
+ * [Mikael's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Mikael110/llama-2-7b-guanaco-fp16)
54
+ <!-- repositories-available end -->
55
 
56
+ <!-- prompt-template start -->
57
  ## Prompt template: Guanaco
58
 
59
  ```
60
  ### Human: {prompt}
61
  ### Assistant:
62
+
63
  ```
64
 
65
+ <!-- prompt-template end -->
66
+
67
+ <!-- README_GPTQ.md-provided-files start -->
68
+ ## Provided files and GPTQ parameters
69
 
70
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
71
 
72
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
73
 
74
+ 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.
75
+
76
+ <details>
77
+ <summary>Explanation of GPTQ parameters</summary>
78
+
79
+ - Bits: The bit size of the quantised model.
80
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
81
+ - 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.
82
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
83
+ - 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).
84
+ - 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.
85
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
86
+
87
+ </details>
88
 
89
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
90
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
91
+ | [main](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ/tree/main) | 4 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.90 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
92
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.28 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
93
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.02 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
94
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.90 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
95
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.01 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
96
+ | [gptq-8bit-128g-actorder_False](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ/tree/gptq-8bit-128g-actorder_False) | 8 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.16 GB | No | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
97
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.16 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. |
98
+ | [gptq-8bit-64g-actorder_True](https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ/tree/gptq-8bit-64g-actorder_True) | 8 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.31 GB | No | 8-bit, with group size 64g and Act Order for even higher inference quality. Poor AutoGPTQ CUDA speed. |
99
+
100
+ <!-- README_GPTQ.md-provided-files end -->
101
+
102
+ <!-- README_GPTQ.md-download-from-branches start -->
103
  ## How to download from branches
104
 
105
  - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ:gptq-4bit-32g-actorder_True`
106
  - With Git, you can clone a branch with:
107
  ```
108
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ
109
  ```
110
  - In Python Transformers code, the branch is the `revision` parameter; see below.
111
+ <!-- README_GPTQ.md-download-from-branches end -->
112
+ <!-- README_GPTQ.md-text-generation-webui start -->
113
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
114
 
115
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
116
 
117
+ 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.
118
 
119
  1. Click the **Model tab**.
120
  2. Under **Download custom model or LoRA**, enter `TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ`.
121
  - To download from a specific branch, enter for example `TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ:gptq-4bit-32g-actorder_True`
122
  - see Provided Files above for the list of branches for each option.
123
  3. Click **Download**.
124
+ 4. The model will start downloading. Once it's finished it will say "Done".
125
  5. In the top left, click the refresh icon next to **Model**.
126
  6. In the **Model** dropdown, choose the model you just downloaded: `llama-2-7B-Guanaco-QLoRA-GPTQ`
127
  7. The model will automatically load, and is now ready for use!
128
  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.
129
+ * 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`.
130
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
131
+ <!-- README_GPTQ.md-text-generation-webui end -->
132
 
133
+ <!-- README_GPTQ.md-use-from-python start -->
134
  ## How to use this GPTQ model from Python code
135
 
136
+ ### Install the necessary packages
137
 
138
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
139
 
140
+ ```shell
141
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
142
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
143
+ ```
144
+
145
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
146
+
147
+ ```shell
148
+ pip3 uninstall -y auto-gptq
149
+ git clone https://github.com/PanQiWei/AutoGPTQ
150
+ cd AutoGPTQ
151
+ pip3 install .
152
+ ```
153
+
154
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
155
+
156
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
157
+ ```shell
158
+ pip3 uninstall -y transformers
159
+ pip3 install git+https://github.com/huggingface/transformers.git
160
+ ```
161
+
162
+ ### You can then use the following code
163
 
164
  ```python
165
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
166
 
167
  model_name_or_path = "TheBloke/llama-2-7B-Guanaco-QLoRA-GPTQ"
168
+ # To use a different branch, change revision
169
+ # For example: revision="gptq-4bit-32g-actorder_True"
170
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
171
+ torch_dtype=torch.float16,
172
+ device_map="auto",
173
+ revision="main")
174
 
175
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
176
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  prompt = "Tell me about AI"
178
  prompt_template=f'''### Human: {prompt}
179
  ### Assistant:
180
+
181
  '''
182
 
183
  print("\n\n*** Generate:")
 
188
 
189
  # Inference can also be done using transformers' pipeline
190
 
 
 
 
191
  print("*** Pipeline:")
192
  pipe = pipeline(
193
  "text-generation",
 
201
 
202
  print(pipe(prompt_template)[0]['generated_text'])
203
  ```
204
+ <!-- README_GPTQ.md-use-from-python end -->
205
 
206
+ <!-- README_GPTQ.md-compatibility start -->
207
  ## Compatibility
208
 
209
+ 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).
210
 
211
+ [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.
212
+
213
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
214
+ <!-- README_GPTQ.md-compatibility end -->
215
 
216
  <!-- footer start -->
217
  <!-- 200823 -->
 
236
 
237
  **Special thanks to**: Aemon Algiz.
238
 
239
+ **Patreon special mentions**: Russ Johnson, J, alfie_i, Alex, NimbleBox.ai, Chadd, Mandus, Nikolai Manek, Ken Nordquist, ya boyyy, Illia Dulskyi, Viktor Bowallius, vamX, Iucharbius, zynix, Magnesian, Clay Pascal, Pierre Kircher, Enrico Ros, Tony Hughes, Elle, Andrey, knownsqashed, Deep Realms, Jerry Meng, Lone Striker, Derek Yates, Pyrater, Mesiah Bishop, James Bentley, Femi Adebogun, Brandon Frisco, SuperWojo, Alps Aficionado, Michael Dempsey, Vitor Caleffi, Will Dee, Edmond Seymore, usrbinkat, LangChain4j, Kacper Wikieł, Luke Pendergrass, John Detwiler, theTransient, Nathan LeClaire, Tiffany J. Kim, biorpg, Eugene Pentland, Stanislav Ovsiannikov, Fred von Graf, terasurfer, Kalila, Dan Guido, Nitin Borwankar, 阿明, Ai Maven, John Villwock, Gabriel Puliatti, Stephen Murray, Asp the Wyvern, danny, Chris Smitley, ReadyPlayerEmma, S_X, Daniel P. Andersen, Olakabola, Jeffrey Morgan, Imad Khwaja, Caitlyn Gatomon, webtim, Alicia Loh, Trenton Dambrowitz, Swaroop Kallakuri, Erik Bjäreholt, Leonard Tan, Spiking Neurons AB, Luke @flexchar, Ajan Kanaga, Thomas Belote, Deo Leter, RoA, Willem Michiel, transmissions 11, subjectnull, Matthew Berman, Joseph William Delisle, David Ziegler, Michael Davis, Johann-Peter Hartmann, Talal Aujan, senxiiz, Artur Olbinski, Rainer Wilmers, Spencer Kim, Fen Risland, Cap'n Zoog, Rishabh Srivastava, Michael Levine, Geoffrey Montalvo, Sean Connelly, Alexandros Triantafyllidis, Pieter, Gabriel Tamborski, Sam, Subspace Studios, Junyu Yang, Pedro Madruga, Vadim, Cory Kujawski, K, Raven Klaugh, Randy H, Mano Prime, Sebastain Graf, Space Cruiser
240
 
241
 
242
  Thank you to all my generous patrons and donaters!
 
245
 
246
  <!-- footer end -->
247
 
248
+ # Original model card: Mikael10's Llama2 7B Guanaco QLoRA
249
 
250
  This is a Llama-2 version of [Guanaco](https://huggingface.co/timdettmers/guanaco-7b). It was finetuned from the base [Llama-7b](https://huggingface.co/meta-llama/Llama-2-7b-hf) model using the official training scripts found in the [QLoRA repo](https://github.com/artidoro/qlora). I wanted it to be as faithful as possible and therefore changed nothing in the training script beyond the model it was pointing to. The model prompt is therefore also the same as the original Guanaco model.
251
 
252
  This repo contains the merged f16 model. The QLoRA adaptor can be found [here](https://huggingface.co/Mikael110/llama-2-7b-guanaco-qlora).
253
 
254
+ A 13b version of the model can be found [here](https://huggingface.co/Mikael110/llama-2-13b-guanaco-fp16).
255
+
256
  **Legal Disclaimer: This model is bound by the usage restrictions of the original Llama-2 model. And comes with no warranty or gurantees of any kind.**