Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
4-bit precision
gptq
TheBloke commited on
Commit
e224de7
1 Parent(s): 23f3de2

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +94 -54
README.md CHANGED
@@ -7,7 +7,7 @@ datasets:
7
  inference: false
8
  language:
9
  - en
10
- license: other
11
  model_creator: Stability AI
12
  model_link: https://huggingface.co/stabilityai/StableBeluga-7b
13
  model_name: StableBeluga 7B
@@ -37,120 +37,156 @@ quantized_by: TheBloke
37
  - Model creator: [Stability AI](https://huggingface.co/stabilityai)
38
  - Original model: [StableBeluga 7B](https://huggingface.co/stabilityai/StableBeluga-7b)
39
 
 
40
  ## Description
41
 
42
  This repo contains GPTQ model files for [Stability AI's StableBeluga 7B](https://huggingface.co/stabilityai/StableBeluga-7b).
43
 
44
  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.
45
 
 
 
46
  ## Repositories available
47
 
48
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ)
49
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/StableBeluga-7B-GGML)
 
50
  * [Stability AI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/stabilityai/StableBeluga-7b)
 
51
 
 
52
  ## Prompt template: Orca-Hashes
53
 
54
  ```
55
  ### System:
56
- This is a system prompt, please behave and help the user.
57
 
58
  ### User:
59
  {prompt}
60
 
61
  ### Assistant:
 
62
  ```
63
 
64
- ## Provided files
 
 
 
65
 
66
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
67
 
68
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
69
 
70
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
71
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
72
- | [main](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/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. |
73
- | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/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. |
74
- | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/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. |
75
- | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/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 than 64g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
76
- | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/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. |
77
- | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/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. |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
 
 
 
79
  ## How to download from branches
80
 
81
  - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/StableBeluga-7B-GPTQ:gptq-4bit-32g-actorder_True`
82
  - With Git, you can clone a branch with:
83
  ```
84
- git clone --branch --single-branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ
85
  ```
86
  - In Python Transformers code, the branch is the `revision` parameter; see below.
87
-
 
88
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
89
 
90
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
91
 
92
- It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
93
 
94
  1. Click the **Model tab**.
95
  2. Under **Download custom model or LoRA**, enter `TheBloke/StableBeluga-7B-GPTQ`.
96
  - To download from a specific branch, enter for example `TheBloke/StableBeluga-7B-GPTQ:gptq-4bit-32g-actorder_True`
97
  - see Provided Files above for the list of branches for each option.
98
  3. Click **Download**.
99
- 4. The model will start downloading. Once it's finished it will say "Done"
100
  5. In the top left, click the refresh icon next to **Model**.
101
  6. In the **Model** dropdown, choose the model you just downloaded: `StableBeluga-7B-GPTQ`
102
  7. The model will automatically load, and is now ready for use!
103
  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.
104
- * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
105
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
 
106
 
 
107
  ## How to use this GPTQ model from Python code
108
 
109
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
 
 
110
 
111
- `GITHUB_ACTIONS=true pip install auto-gptq`
 
 
 
 
 
112
 
113
- Then try the following example code:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
115
  ```python
116
- from transformers import AutoTokenizer, pipeline, logging
117
- from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
118
 
119
  model_name_or_path = "TheBloke/StableBeluga-7B-GPTQ"
120
- model_basename = "model"
121
-
122
- use_triton = False
 
 
 
123
 
124
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
125
 
126
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
127
- model_basename=model_basename,
128
- use_safetensors=True,
129
- trust_remote_code=False,
130
- device="cuda:0",
131
- use_triton=use_triton,
132
- quantize_config=None)
133
-
134
- """
135
- To download from a specific branch, use the revision parameter, as in this example:
136
-
137
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
138
- revision="gptq-4bit-32g-actorder_True",
139
- model_basename=model_basename,
140
- use_safetensors=True,
141
- trust_remote_code=False,
142
- device="cuda:0",
143
- quantize_config=None)
144
- """
145
-
146
  prompt = "Tell me about AI"
147
  prompt_template=f'''### System:
148
- This is a system prompt, please behave and help the user.
149
 
150
  ### User:
151
  {prompt}
152
 
153
  ### Assistant:
 
154
  '''
155
 
156
  print("\n\n*** Generate:")
@@ -161,9 +197,6 @@ print(tokenizer.decode(output[0]))
161
 
162
  # Inference can also be done using transformers' pipeline
163
 
164
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
165
- logging.set_verbosity(logging.CRITICAL)
166
-
167
  print("*** Pipeline:")
168
  pipe = pipeline(
169
  "text-generation",
@@ -177,12 +210,17 @@ pipe = pipeline(
177
 
178
  print(pipe(prompt_template)[0]['generated_text'])
179
  ```
 
180
 
 
181
  ## Compatibility
182
 
183
- 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.
 
 
184
 
185
- ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
 
186
 
187
  <!-- footer start -->
188
  <!-- 200823 -->
@@ -207,7 +245,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
207
 
208
  **Special thanks to**: Aemon Algiz.
209
 
210
- **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
211
 
212
 
213
  Thank you to all my generous patrons and donaters!
@@ -220,6 +258,8 @@ And thank you again to a16z for their generous grant.
220
 
221
  # Stable Beluga 7B
222
 
 
 
223
  ## Model Description
224
 
225
  `Stable Beluga 7B` is a Llama2 7B model finetuned on an Orca style Dataset
@@ -286,7 +326,7 @@ Beluga is a new technology that carries risks with use. Testing conducted to dat
286
 
287
  ```bibtext
288
  @misc{touvron2023llama,
289
- title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
290
  author={Hugo Touvron and Louis Martin and Kevin Stone and Peter Albert and Amjad Almahairi and Yasmine Babaei and Nikolay Bashlykov and Soumya Batra and Prajjwal Bhargava and Shruti Bhosale and Dan Bikel and Lukas Blecher and Cristian Canton Ferrer and Moya Chen and Guillem Cucurull and David Esiobu and Jude Fernandes and Jeremy Fu and Wenyin Fu and Brian Fuller and Cynthia Gao and Vedanuj Goswami and Naman Goyal and Anthony Hartshorn and Saghar Hosseini and Rui Hou and Hakan Inan and Marcin Kardas and Viktor Kerkez and Madian Khabsa and Isabel Kloumann and Artem Korenev and Punit Singh Koura and Marie-Anne Lachaux and Thibaut Lavril and Jenya Lee and Diana Liskovich and Yinghai Lu and Yuning Mao and Xavier Martinet and Todor Mihaylov and Pushkar Mishra and Igor Molybog and Yixin Nie and Andrew Poulton and Jeremy Reizenstein and Rashi Rungta and Kalyan Saladi and Alan Schelten and Ruan Silva and Eric Michael Smith and Ranjan Subramanian and Xiaoqing Ellen Tan and Binh Tang and Ross Taylor and Adina Williams and Jian Xiang Kuan and Puxin Xu and Zheng Yan and Iliyan Zarov and Yuchen Zhang and Angela Fan and Melanie Kambadur and Sharan Narang and Aurelien Rodriguez and Robert Stojnic and Sergey Edunov and Thomas Scialom},
291
  year={2023},
292
  eprint={2307.09288},
@@ -297,7 +337,7 @@ Beluga is a new technology that carries risks with use. Testing conducted to dat
297
 
298
  ```bibtext
299
  @misc{mukherjee2023orca,
300
- title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
301
  author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
302
  year={2023},
303
  eprint={2306.02707},
 
7
  inference: false
8
  language:
9
  - en
10
+ license: llama2
11
  model_creator: Stability AI
12
  model_link: https://huggingface.co/stabilityai/StableBeluga-7b
13
  model_name: StableBeluga 7B
 
37
  - Model creator: [Stability AI](https://huggingface.co/stabilityai)
38
  - Original model: [StableBeluga 7B](https://huggingface.co/stabilityai/StableBeluga-7b)
39
 
40
+ <!-- description start -->
41
  ## Description
42
 
43
  This repo contains GPTQ model files for [Stability AI's StableBeluga 7B](https://huggingface.co/stabilityai/StableBeluga-7b).
44
 
45
  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.
46
 
47
+ <!-- description end -->
48
+ <!-- repositories-available start -->
49
  ## Repositories available
50
 
51
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ)
52
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/StableBeluga-7B-GGUF)
53
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference (deprecated)](https://huggingface.co/TheBloke/StableBeluga-7B-GGML)
54
  * [Stability AI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/stabilityai/StableBeluga-7b)
55
+ <!-- repositories-available end -->
56
 
57
+ <!-- prompt-template start -->
58
  ## Prompt template: Orca-Hashes
59
 
60
  ```
61
  ### System:
62
+ {system_message}
63
 
64
  ### User:
65
  {prompt}
66
 
67
  ### Assistant:
68
+
69
  ```
70
 
71
+ <!-- prompt-template end -->
72
+
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/StableBeluga-7B-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [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. |
98
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [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. |
99
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [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. |
100
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [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. |
101
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [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. |
102
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [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. |
103
 
104
+ <!-- README_GPTQ.md-provided-files end -->
105
+
106
+ <!-- README_GPTQ.md-download-from-branches start -->
107
  ## How to download from branches
108
 
109
  - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/StableBeluga-7B-GPTQ:gptq-4bit-32g-actorder_True`
110
  - With Git, you can clone a branch with:
111
  ```
112
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ
113
  ```
114
  - In Python Transformers code, the branch is the `revision` parameter; see below.
115
+ <!-- README_GPTQ.md-download-from-branches end -->
116
+ <!-- README_GPTQ.md-text-generation-webui start -->
117
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
118
 
119
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
120
 
121
+ 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.
122
 
123
  1. Click the **Model tab**.
124
  2. Under **Download custom model or LoRA**, enter `TheBloke/StableBeluga-7B-GPTQ`.
125
  - To download from a specific branch, enter for example `TheBloke/StableBeluga-7B-GPTQ:gptq-4bit-32g-actorder_True`
126
  - see Provided Files above for the list of branches for each option.
127
  3. Click **Download**.
128
+ 4. The model will start downloading. Once it's finished it will say "Done".
129
  5. In the top left, click the refresh icon next to **Model**.
130
  6. In the **Model** dropdown, choose the model you just downloaded: `StableBeluga-7B-GPTQ`
131
  7. The model will automatically load, and is now ready for use!
132
  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.
133
+ * 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`.
134
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
135
+ <!-- README_GPTQ.md-text-generation-webui end -->
136
 
137
+ <!-- README_GPTQ.md-use-from-python start -->
138
  ## How to use this GPTQ model from Python code
139
 
140
+ ### Install the necessary packages
141
+
142
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
143
 
144
+ ```shell
145
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
146
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
147
+ ```
148
+
149
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
150
 
151
+ ```shell
152
+ pip3 uninstall -y auto-gptq
153
+ git clone https://github.com/PanQiWei/AutoGPTQ
154
+ cd AutoGPTQ
155
+ pip3 install .
156
+ ```
157
+
158
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
159
+
160
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
161
+ ```shell
162
+ pip3 uninstall -y transformers
163
+ pip3 install git+https://github.com/huggingface/transformers.git
164
+ ```
165
+
166
+ ### You can then use the following code
167
 
168
  ```python
169
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
170
 
171
  model_name_or_path = "TheBloke/StableBeluga-7B-GPTQ"
172
+ # To use a different branch, change revision
173
+ # For example: revision="gptq-4bit-32g-actorder_True"
174
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
175
+ torch_dtype=torch.float16,
176
+ device_map="auto",
177
+ revision="main")
178
 
179
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  prompt = "Tell me about AI"
182
  prompt_template=f'''### System:
183
+ {system_message}
184
 
185
  ### User:
186
  {prompt}
187
 
188
  ### Assistant:
189
+
190
  '''
191
 
192
  print("\n\n*** Generate:")
 
197
 
198
  # Inference can also be done using transformers' pipeline
199
 
 
 
 
200
  print("*** Pipeline:")
201
  pipe = pipeline(
202
  "text-generation",
 
210
 
211
  print(pipe(prompt_template)[0]['generated_text'])
212
  ```
213
+ <!-- README_GPTQ.md-use-from-python end -->
214
 
215
+ <!-- README_GPTQ.md-compatibility start -->
216
  ## Compatibility
217
 
218
+ 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).
219
+
220
+ [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.
221
 
222
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
223
+ <!-- README_GPTQ.md-compatibility end -->
224
 
225
  <!-- footer start -->
226
  <!-- 200823 -->
 
245
 
246
  **Special thanks to**: Aemon Algiz.
247
 
248
+ **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
249
 
250
 
251
  Thank you to all my generous patrons and donaters!
 
258
 
259
  # Stable Beluga 7B
260
 
261
+ Use [Stable Chat (Research Preview)](https://chat.stability.ai/chat) to test Stability AI's best language models for free
262
+
263
  ## Model Description
264
 
265
  `Stable Beluga 7B` is a Llama2 7B model finetuned on an Orca style Dataset
 
326
 
327
  ```bibtext
328
  @misc{touvron2023llama,
329
+ title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
330
  author={Hugo Touvron and Louis Martin and Kevin Stone and Peter Albert and Amjad Almahairi and Yasmine Babaei and Nikolay Bashlykov and Soumya Batra and Prajjwal Bhargava and Shruti Bhosale and Dan Bikel and Lukas Blecher and Cristian Canton Ferrer and Moya Chen and Guillem Cucurull and David Esiobu and Jude Fernandes and Jeremy Fu and Wenyin Fu and Brian Fuller and Cynthia Gao and Vedanuj Goswami and Naman Goyal and Anthony Hartshorn and Saghar Hosseini and Rui Hou and Hakan Inan and Marcin Kardas and Viktor Kerkez and Madian Khabsa and Isabel Kloumann and Artem Korenev and Punit Singh Koura and Marie-Anne Lachaux and Thibaut Lavril and Jenya Lee and Diana Liskovich and Yinghai Lu and Yuning Mao and Xavier Martinet and Todor Mihaylov and Pushkar Mishra and Igor Molybog and Yixin Nie and Andrew Poulton and Jeremy Reizenstein and Rashi Rungta and Kalyan Saladi and Alan Schelten and Ruan Silva and Eric Michael Smith and Ranjan Subramanian and Xiaoqing Ellen Tan and Binh Tang and Ross Taylor and Adina Williams and Jian Xiang Kuan and Puxin Xu and Zheng Yan and Iliyan Zarov and Yuchen Zhang and Angela Fan and Melanie Kambadur and Sharan Narang and Aurelien Rodriguez and Robert Stojnic and Sergey Edunov and Thomas Scialom},
331
  year={2023},
332
  eprint={2307.09288},
 
337
 
338
  ```bibtext
339
  @misc{mukherjee2023orca,
340
+ title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
341
  author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
342
  year={2023},
343
  eprint={2306.02707},