TheBloke commited on
Commit
4773272
1 Parent(s): d6fbd91

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +136 -66
README.md CHANGED
@@ -1,9 +1,25 @@
1
  ---
 
2
  datasets:
3
  - bavest/fin-llama-dataset
4
  inference: false
5
- license: other
 
 
6
  model_type: llama
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  tags:
8
  - finance
9
  - llm
@@ -28,152 +44,204 @@ tags:
28
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
29
  <!-- header end -->
30
 
31
- # Bavest's Fin Llama 33B GPTQ
 
 
32
 
33
- These files are GPTQ model files for [Bavest's Fin Llama 33B](https://huggingface.co/bavest/fin-llama-33b-merged).
 
34
 
35
- 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.
36
 
37
- These models were quantised using hardware kindly provided by [Latitude.sh](https://www.latitude.sh/accelerate).
38
 
 
 
39
  ## Repositories available
40
 
 
41
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ)
42
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/fin-llama-33B-GGML)
43
- * [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/bavest/fin-llama-33b-merged)
 
44
 
 
45
  ## Prompt template: Alpaca
46
 
47
  ```
48
  Below is an instruction that describes a task. Write a response that appropriately completes the request.
49
 
50
- ### Instruction: {prompt}
 
51
 
52
  ### Response:
 
53
  ```
54
 
55
- ## Provided files
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
58
 
59
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
60
 
61
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
62
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
63
- | main | 4 | None | True | 16.94 GB | True | GPTQ-for-LLaMa | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
64
- | gptq-4bit-32g-actorder_True | 4 | 32 | True | 19.44 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 32g gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
65
- | gptq-4bit-64g-actorder_True | 4 | 64 | True | 18.18 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 64g uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
66
- | gptq-4bit-128g-actorder_True | 4 | 128 | True | 17.55 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 128g uses even less VRAM, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
67
- | gptq-8bit--1g-actorder_True | 8 | None | True | 32.99 GB | False | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
68
- | gptq-8bit-128g-actorder_False | 8 | 128 | False | 33.73 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
69
- | gptq-3bit--1g-actorder_True | 3 | None | True | 12.92 GB | False | AutoGPTQ | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
70
- | gptq-3bit-128g-actorder_False | 3 | 128 | False | 13.51 GB | False | AutoGPTQ | 3-bit, with group size 128g but no act-order. Slightly higher VRAM requirements than 3-bit None. |
 
 
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  ## How to download from branches
73
 
74
- - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/fin-llama-33B-GPTQ:gptq-4bit-32g-actorder_True`
75
  - With Git, you can clone a branch with:
76
  ```
77
- git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/fin-llama-33B-GPTQ`
78
  ```
79
  - In Python Transformers code, the branch is the `revision` parameter; see below.
80
-
 
81
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
82
 
83
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
84
 
85
- It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
86
 
87
  1. Click the **Model tab**.
88
  2. Under **Download custom model or LoRA**, enter `TheBloke/fin-llama-33B-GPTQ`.
89
- - To download from a specific branch, enter for example `TheBloke/fin-llama-33B-GPTQ:gptq-4bit-32g-actorder_True`
90
  - see Provided Files above for the list of branches for each option.
91
  3. Click **Download**.
92
- 4. The model will start downloading. Once it's finished it will say "Done"
93
  5. In the top left, click the refresh icon next to **Model**.
94
  6. In the **Model** dropdown, choose the model you just downloaded: `fin-llama-33B-GPTQ`
95
  7. The model will automatically load, and is now ready for use!
96
  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.
97
- * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
98
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
 
99
 
 
100
  ## How to use this GPTQ model from Python code
101
 
102
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
103
 
104
- `GITHUB_ACTIONS=true pip install auto-gptq`
105
 
106
- Then try the following example code:
 
 
 
107
 
108
- ```python
109
- from transformers import AutoTokenizer, pipeline, logging
110
- from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
111
 
112
- model_name_or_path = "TheBloke/fin-llama-33B-GPTQ"
113
- model_basename = "fin-llama-33b-GPTQ-4bit--1g.act.order"
 
 
 
 
114
 
115
- use_triton = False
116
 
117
- tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
 
 
 
 
118
 
119
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
120
- model_basename=model_basename
121
- use_safetensors=True,
122
- trust_remote_code=False,
123
- device="cuda:0",
124
- use_triton=use_triton,
125
- quantize_config=None)
126
 
127
- """
128
- To download from a specific branch, use the revision parameter, as in this example:
129
-
130
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
131
- revision="gptq-4bit-32g-actorder_True",
132
- model_basename=model_basename,
133
- use_safetensors=True,
134
- trust_remote_code=False,
135
- device="cuda:0",
136
- quantize_config=None)
137
- """
 
138
 
139
  prompt = "Tell me about AI"
140
  prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
141
 
142
- ### Instruction: {prompt}
 
143
 
144
  ### Response:
 
145
  '''
146
 
147
  print("\n\n*** Generate:")
148
 
149
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
150
- output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
151
  print(tokenizer.decode(output[0]))
152
 
153
  # Inference can also be done using transformers' pipeline
154
 
155
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
156
- logging.set_verbosity(logging.CRITICAL)
157
-
158
  print("*** Pipeline:")
159
  pipe = pipeline(
160
  "text-generation",
161
  model=model,
162
  tokenizer=tokenizer,
163
  max_new_tokens=512,
 
164
  temperature=0.7,
165
  top_p=0.95,
166
- repetition_penalty=1.15
 
167
  )
168
 
169
  print(pipe(prompt_template)[0]['generated_text'])
170
  ```
 
171
 
 
172
  ## Compatibility
173
 
174
- 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.
175
 
176
- ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
 
 
 
177
 
178
  <!-- footer start -->
179
  <!-- 200823 -->
@@ -183,10 +251,12 @@ For further support, and discussions on these models and AI in general, join us
183
 
184
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
185
 
186
- ## Thanks, and how to contribute.
187
 
188
  Thanks to the [chirper.ai](https://chirper.ai) team!
189
 
 
 
190
  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.
191
 
192
  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.
@@ -198,7 +268,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
198
 
199
  **Special thanks to**: Aemon Algiz.
200
 
201
- **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
202
 
203
 
204
  Thank you to all my generous patrons and donaters!
@@ -279,7 +349,7 @@ input = "" # context if needed
279
 
280
  prompt = f"""
281
  A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's question.
282
- '### Instruction:\n{question}\n\n### Input:{input}\n""\n\n### Response:
283
  """
284
 
285
  input_ids = tokenizer.encode(prompt, return_tensors="pt").to('cuda:0')
@@ -327,7 +397,7 @@ and [LMSYS FastChat](https://github.com/lm-sys/FastChat) repos.
327
  ## License and Intended Use
328
  We release the resources associated with QLoRA finetuning in this repository under GLP3 license. In addition, we release the FIN-LLAMA model family for base LLaMA model sizes of 7B, 13B, 33B, and 65B. These models are intended for purposes in line with the LLaMA license and require access to the LLaMA models.
329
 
330
- ## Prompts
331
  ### Act as an Accountant
332
  > I want you to act as an accountant and come up with creative ways to manage finances. You'll need to consider budgeting, investment strategies and risk management when creating a financial plan for your client. In some cases, you may also need to provide advice on taxation laws and regulations in order to help them maximize their profits. My first suggestion request is “Create a financial plan for a small business that focuses on cost savings and long-term investments".
333
 
 
1
  ---
2
+ base_model: https://huggingface.co/bavest/fin-llama-33b-merged
3
  datasets:
4
  - bavest/fin-llama-dataset
5
  inference: false
6
+ license: gpl
7
+ model_creator: Bavest
8
+ model_name: Fin Llama 33B
9
  model_type: llama
10
+ prompt_template: 'Below is an instruction that describes a task. Write a response
11
+ that appropriately completes the request.
12
+
13
+
14
+ ### Instruction:
15
+
16
+ {prompt}
17
+
18
+
19
+ ### Response:
20
+
21
+ '
22
+ quantized_by: TheBloke
23
  tags:
24
  - finance
25
  - llm
 
44
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
45
  <!-- header end -->
46
 
47
+ # Fin Llama 33B - GPTQ
48
+ - Model creator: [Bavest](https://huggingface.co/bavest)
49
+ - Original model: [Fin Llama 33B](https://huggingface.co/bavest/fin-llama-33b-merged)
50
 
51
+ <!-- description start -->
52
+ ## Description
53
 
54
+ This repo contains GPTQ model files for [Bavest's Fin Llama 33B](https://huggingface.co/bavest/fin-llama-33b-merged).
55
 
56
+ 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.
57
 
58
+ <!-- description end -->
59
+ <!-- repositories-available start -->
60
  ## Repositories available
61
 
62
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/fin-llama-33B-AWQ)
63
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ)
64
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/fin-llama-33B-GGUF)
65
+ * [Bavest's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/bavest/fin-llama-33b-merged)
66
+ <!-- repositories-available end -->
67
 
68
+ <!-- prompt-template start -->
69
  ## Prompt template: Alpaca
70
 
71
  ```
72
  Below is an instruction that describes a task. Write a response that appropriately completes the request.
73
 
74
+ ### Instruction:
75
+ {prompt}
76
 
77
  ### Response:
78
+
79
  ```
80
 
81
+ <!-- prompt-template end -->
82
+ <!-- licensing start -->
83
+ ## Licensing
84
+
85
+ The creator of the source model has listed its license as `gpl`, and this quantization has therefore used that same license.
86
+
87
+ 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.
88
+
89
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Bavest's Fin Llama 33B](https://huggingface.co/bavest/fin-llama-33b-merged).
90
+ <!-- licensing end -->
91
+ <!-- README_GPTQ.md-provided-files start -->
92
+ ## Provided files and GPTQ parameters
93
 
94
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
95
 
96
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
97
 
98
+ 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.
99
+
100
+ <details>
101
+ <summary>Explanation of GPTQ parameters</summary>
102
+
103
+ - Bits: The bit size of the quantised model.
104
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
105
+ - 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.
106
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
107
+ - 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).
108
+ - 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.
109
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
110
 
111
+ </details>
112
+
113
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
114
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
115
+ | [main](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ/tree/main) | 4 | None | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 16.94 GB | Yes | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
116
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 19.44 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
117
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 18.18 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
118
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 17.55 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
119
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 32.99 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
120
+ | [gptq-8bit-128g-actorder_False](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ/tree/gptq-8bit-128g-actorder_False) | 8 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 33.73 GB | No | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. |
121
+ | [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 12.92 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
122
+ | [gptq-3bit-128g-actorder_False](https://huggingface.co/TheBloke/fin-llama-33B-GPTQ/tree/gptq-3bit-128g-actorder_False) | 3 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 13.51 GB | No | 3-bit, with group size 128g but no act-order. Slightly higher VRAM requirements than 3-bit None. |
123
+
124
+ <!-- README_GPTQ.md-provided-files end -->
125
+
126
+ <!-- README_GPTQ.md-download-from-branches start -->
127
  ## How to download from branches
128
 
129
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/fin-llama-33B-GPTQ:main`
130
  - With Git, you can clone a branch with:
131
  ```
132
+ git clone --single-branch --branch main https://huggingface.co/TheBloke/fin-llama-33B-GPTQ
133
  ```
134
  - In Python Transformers code, the branch is the `revision` parameter; see below.
135
+ <!-- README_GPTQ.md-download-from-branches end -->
136
+ <!-- README_GPTQ.md-text-generation-webui start -->
137
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
138
 
139
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
140
 
141
+ 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.
142
 
143
  1. Click the **Model tab**.
144
  2. Under **Download custom model or LoRA**, enter `TheBloke/fin-llama-33B-GPTQ`.
145
+ - To download from a specific branch, enter for example `TheBloke/fin-llama-33B-GPTQ:main`
146
  - see Provided Files above for the list of branches for each option.
147
  3. Click **Download**.
148
+ 4. The model will start downloading. Once it's finished it will say "Done".
149
  5. In the top left, click the refresh icon next to **Model**.
150
  6. In the **Model** dropdown, choose the model you just downloaded: `fin-llama-33B-GPTQ`
151
  7. The model will automatically load, and is now ready for use!
152
  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.
153
+ * 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`.
154
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
155
+ <!-- README_GPTQ.md-text-generation-webui end -->
156
 
157
+ <!-- README_GPTQ.md-use-from-python start -->
158
  ## How to use this GPTQ model from Python code
159
 
160
+ ### Install the necessary packages
161
 
162
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
163
 
164
+ ```shell
165
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
166
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
167
+ ```
168
 
169
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
 
 
170
 
171
+ ```shell
172
+ pip3 uninstall -y auto-gptq
173
+ git clone https://github.com/PanQiWei/AutoGPTQ
174
+ cd AutoGPTQ
175
+ pip3 install .
176
+ ```
177
 
178
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
179
 
180
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
181
+ ```shell
182
+ pip3 uninstall -y transformers
183
+ pip3 install git+https://github.com/huggingface/transformers.git
184
+ ```
185
 
186
+ ### You can then use the following code
 
 
 
 
 
 
187
 
188
+ ```python
189
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
190
+
191
+ model_name_or_path = "TheBloke/fin-llama-33B-GPTQ"
192
+ # To use a different branch, change revision
193
+ # For example: revision="main"
194
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
195
+ device_map="auto",
196
+ trust_remote_code=False,
197
+ revision="main")
198
+
199
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
200
 
201
  prompt = "Tell me about AI"
202
  prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
203
 
204
+ ### Instruction:
205
+ {prompt}
206
 
207
  ### Response:
208
+
209
  '''
210
 
211
  print("\n\n*** Generate:")
212
 
213
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
214
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
215
  print(tokenizer.decode(output[0]))
216
 
217
  # Inference can also be done using transformers' pipeline
218
 
 
 
 
219
  print("*** Pipeline:")
220
  pipe = pipeline(
221
  "text-generation",
222
  model=model,
223
  tokenizer=tokenizer,
224
  max_new_tokens=512,
225
+ do_sample=True,
226
  temperature=0.7,
227
  top_p=0.95,
228
+ top_k=40,
229
+ repetition_penalty=1.1
230
  )
231
 
232
  print(pipe(prompt_template)[0]['generated_text'])
233
  ```
234
+ <!-- README_GPTQ.md-use-from-python end -->
235
 
236
+ <!-- README_GPTQ.md-compatibility start -->
237
  ## Compatibility
238
 
239
+ 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).
240
 
241
+ [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.
242
+
243
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
244
+ <!-- README_GPTQ.md-compatibility end -->
245
 
246
  <!-- footer start -->
247
  <!-- 200823 -->
 
251
 
252
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
253
 
254
+ ## Thanks, and how to contribute
255
 
256
  Thanks to the [chirper.ai](https://chirper.ai) team!
257
 
258
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
259
+
260
  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.
261
 
262
  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.
 
268
 
269
  **Special thanks to**: Aemon Algiz.
270
 
271
+ **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
272
 
273
 
274
  Thank you to all my generous patrons and donaters!
 
349
 
350
  prompt = f"""
351
  A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's question.
352
+ '### Instruction:\n{question}\n\n### Input:{input}\n""\n\n### Response:
353
  """
354
 
355
  input_ids = tokenizer.encode(prompt, return_tensors="pt").to('cuda:0')
 
397
  ## License and Intended Use
398
  We release the resources associated with QLoRA finetuning in this repository under GLP3 license. In addition, we release the FIN-LLAMA model family for base LLaMA model sizes of 7B, 13B, 33B, and 65B. These models are intended for purposes in line with the LLaMA license and require access to the LLaMA models.
399
 
400
+ ## Prompts
401
  ### Act as an Accountant
402
  > I want you to act as an accountant and come up with creative ways to manage finances. You'll need to consider budgeting, investment strategies and risk management when creating a financial plan for your client. In some cases, you may also need to provide advice on taxation laws and regulations in order to help them maximize their profits. My first suggestion request is “Create a financial plan for a small business that focuses on cost savings and long-term investments".
403