TheBloke commited on
Commit
9b4ddee
1 Parent(s): d6dbf6b

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +229 -77
README.md CHANGED
@@ -1,16 +1,27 @@
1
  ---
2
- datasets:
3
- - sciq
4
- - metaeval/ScienceQA_text_only
5
- - GAIR/lima
6
- - Open-Orca/OpenOrca
7
- - openbookqa
8
  inference: false
9
  language:
10
  - en
11
  license: other
 
 
12
  model_type: llama
13
  pipeline_tag: text-generation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  tags:
15
  - upstage
16
  - llama
@@ -35,155 +46,199 @@ tags:
35
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
36
  <!-- header end -->
37
 
38
- # Upstage's Llama 65B Instruct GPTQ
 
 
39
 
40
- These files are GPTQ model files for [Upstage's Llama 65B Instruct](https://huggingface.co/upstage/llama-65b-instruct).
 
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
 
 
 
45
  ## Repositories available
46
 
 
47
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-GPTQ)
48
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-GGML)
49
- * [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/upstage/llama-65b-instruct)
 
50
 
 
51
  ## Prompt template: Orca-Hashes
52
 
53
  ```
54
  ### System:
55
- {System}
56
 
57
  ### User:
58
  {prompt}
59
 
60
  ### Assistant:
 
61
  ```
62
 
63
- ## Provided files
 
 
 
 
64
 
65
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
66
 
67
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
68
 
69
- | Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description |
70
- | ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- |
71
- | main | 4 | 128 | False | 34.73 GB | True | AutoGPTQ | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
72
- | 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. |
73
- | 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. |
74
- | 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. |
75
- | 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. |
76
- | 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. |
77
- | 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. |
78
- | 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. |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
 
 
 
80
  ## How to download from branches
81
 
82
- - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Upstage-Llama1-65B-Instruct-GPTQ:gptq-4bit-32g-actorder_True`
83
  - With Git, you can clone a branch with:
84
  ```
85
- git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-GPTQ`
86
  ```
87
  - In Python Transformers code, the branch is the `revision` parameter; see below.
88
-
 
89
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
90
 
91
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
92
 
93
- It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
94
 
95
  1. Click the **Model tab**.
96
  2. Under **Download custom model or LoRA**, enter `TheBloke/Upstage-Llama1-65B-Instruct-GPTQ`.
97
- - To download from a specific branch, enter for example `TheBloke/Upstage-Llama1-65B-Instruct-GPTQ:gptq-4bit-32g-actorder_True`
98
  - see Provided Files above for the list of branches for each option.
99
  3. Click **Download**.
100
- 4. The model will start downloading. Once it's finished it will say "Done"
101
  5. In the top left, click the refresh icon next to **Model**.
102
  6. In the **Model** dropdown, choose the model you just downloaded: `Upstage-Llama1-65B-Instruct-GPTQ`
103
  7. The model will automatically load, and is now ready for use!
104
  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.
105
- * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
106
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
 
107
 
 
108
  ## How to use this GPTQ model from Python code
109
 
110
- First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed:
 
 
 
 
 
 
 
111
 
112
- `GITHUB_ACTIONS=true pip install auto-gptq`
113
 
114
- Then try the following example code:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
  ```python
117
- from transformers import AutoTokenizer, pipeline, logging
118
- from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
119
 
120
  model_name_or_path = "TheBloke/Upstage-Llama1-65B-Instruct-GPTQ"
121
- model_basename = "model"
122
-
123
- use_triton = False
 
 
 
124
 
125
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
126
 
127
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
128
- model_basename=model_basename,
129
- use_safetensors=True,
130
- trust_remote_code=False,
131
- device="cuda:0",
132
- use_triton=use_triton,
133
- quantize_config=None)
134
-
135
- """
136
- To download from a specific branch, use the revision parameter, as in this example:
137
-
138
- model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
139
- revision="gptq-4bit-32g-actorder_True",
140
- model_basename=model_basename,
141
- use_safetensors=True,
142
- trust_remote_code=False,
143
- device="cuda:0",
144
- quantize_config=None)
145
- """
146
-
147
  prompt = "Tell me about AI"
148
- system = "You are a helpful assistant"
149
  prompt_template=f'''### System:
150
- {system}
151
 
152
  ### User:
153
  {prompt}
154
 
155
- ### Assistant:'''
 
 
156
 
157
  print("\n\n*** Generate:")
158
 
159
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
160
- output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
161
  print(tokenizer.decode(output[0]))
162
 
163
  # Inference can also be done using transformers' pipeline
164
 
165
- # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
166
- logging.set_verbosity(logging.CRITICAL)
167
-
168
  print("*** Pipeline:")
169
  pipe = pipeline(
170
  "text-generation",
171
  model=model,
172
  tokenizer=tokenizer,
173
  max_new_tokens=512,
 
174
  temperature=0.7,
175
  top_p=0.95,
176
- repetition_penalty=1.15
 
177
  )
178
 
179
  print(pipe(prompt_template)[0]['generated_text'])
180
  ```
 
181
 
 
182
  ## Compatibility
183
 
184
- 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.
185
 
186
- ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
 
 
 
187
 
188
  <!-- footer start -->
189
  <!-- 200823 -->
@@ -193,10 +248,12 @@ For further support, and discussions on these models and AI in general, join us
193
 
194
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
195
 
196
- ## Thanks, and how to contribute.
197
 
198
  Thanks to the [chirper.ai](https://chirper.ai) team!
199
 
 
 
200
  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.
201
 
202
  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.
@@ -208,7 +265,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
208
 
209
  **Special thanks to**: Aemon Algiz.
210
 
211
- **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
212
 
213
 
214
  Thank you to all my generous patrons and donaters!
@@ -221,13 +278,108 @@ And thank you again to a16z for their generous grant.
221
 
222
  # LLaMa-65b-instruct model card
223
 
224
- ## Contact Us, Why Upstage LLM?
225
- - [Upstage](https://en.upstage.ai)'s LLM research has yielded remarkable results. Our 30B model **outperforms all models around the world**, positioning itself as the leading performer. Recognizing the immense potential in implementing private LLM to actual businesses, we invite you to easily apply private LLM and fine-tune it with your own data. For a seamless and tailored solution, please do not hesitate to reach out to us. ► [click here to contact].
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
 
227
- ## Model and Dataset Details
228
- - Please refer to the model card of [upstage/llama-30b-instruct](https://huggingface.co/upstage/llama-30b-instruct) as this one is almost the same.
229
 
230
- ## License
231
- - This model is under a **Non-commercial** Bespoke License and governed by the Meta license. You should only use this repository if you have been granted access to the model by filling out [this form](https://docs.google.com/forms/d/e/1FAIpQLSfqNECQnMkycAp2jP4Z9TFX0cGR4uf7b_fBxjY_OjhJILlKGA/viewform), but have either lost your copy of the weights or encountered issues converting them to the Transformers format.
232
 
233
- [click here to contact]: mailto:contact@upstage.ai
 
 
1
  ---
2
+ base_model: https://huggingface.co/upstage/llama-65b-instruct
 
 
 
 
 
3
  inference: false
4
  language:
5
  - en
6
  license: other
7
+ model_creator: upstage
8
+ model_name: Llama 65B Instruct
9
  model_type: llama
10
  pipeline_tag: text-generation
11
+ prompt_template: '### System:
12
+
13
+ {system_message}
14
+
15
+
16
+ ### User:
17
+
18
+ {prompt}
19
+
20
+
21
+ ### Assistant:
22
+
23
+ '
24
+ quantized_by: TheBloke
25
  tags:
26
  - upstage
27
  - llama
 
46
  <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
47
  <!-- header end -->
48
 
49
+ # Llama 65B Instruct - GPTQ
50
+ - Model creator: [upstage](https://huggingface.co/upstage)
51
+ - Original model: [Llama 65B Instruct](https://huggingface.co/upstage/llama-65b-instruct)
52
 
53
+ <!-- description start -->
54
+ ## Description
55
 
56
+ This repo contains GPTQ model files for [Upstage's Llama 65B Instruct](https://huggingface.co/upstage/llama-65b-instruct).
57
 
58
+ 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.
59
 
60
+ <!-- description end -->
61
+ <!-- repositories-available start -->
62
  ## Repositories available
63
 
64
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-AWQ)
65
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-GPTQ)
66
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-GGUF)
67
+ * [upstage's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/upstage/llama-65b-instruct)
68
+ <!-- repositories-available end -->
69
 
70
+ <!-- prompt-template start -->
71
  ## Prompt template: Orca-Hashes
72
 
73
  ```
74
  ### System:
75
+ {system_message}
76
 
77
  ### User:
78
  {prompt}
79
 
80
  ### Assistant:
81
+
82
  ```
83
 
84
+ <!-- prompt-template end -->
85
+
86
+
87
+ <!-- README_GPTQ.md-provided-files start -->
88
+ ## Provided files and GPTQ parameters
89
 
90
  Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
91
 
92
  Each separate quant is in a different branch. See below for instructions on fetching from different branches.
93
 
94
+ 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.
95
+
96
+ <details>
97
+ <summary>Explanation of GPTQ parameters</summary>
98
+
99
+ - Bits: The bit size of the quantised model.
100
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
101
+ - 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.
102
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
103
+ - 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).
104
+ - 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.
105
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
106
+
107
+ </details>
108
+
109
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
110
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
111
+ | [main](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-GPTQ/tree/main) | 4 | 128 | No | 0.01 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 2048 | 34.73 GB | Yes | 4-bit, without Act Order and group size 128g. |
112
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-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. |
113
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-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. |
114
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-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. |
115
+ | [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-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. |
116
+ | [gptq-3bit-128g-actorder_False](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-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. |
117
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-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. |
118
+ | [gptq-3bit-64g-actorder_True](https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-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. |
119
 
120
+ <!-- README_GPTQ.md-provided-files end -->
121
+
122
+ <!-- README_GPTQ.md-download-from-branches start -->
123
  ## How to download from branches
124
 
125
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Upstage-Llama1-65B-Instruct-GPTQ:main`
126
  - With Git, you can clone a branch with:
127
  ```
128
+ git clone --single-branch --branch main https://huggingface.co/TheBloke/Upstage-Llama1-65B-Instruct-GPTQ
129
  ```
130
  - In Python Transformers code, the branch is the `revision` parameter; see below.
131
+ <!-- README_GPTQ.md-download-from-branches end -->
132
+ <!-- README_GPTQ.md-text-generation-webui start -->
133
  ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
134
 
135
  Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
136
 
137
+ 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.
138
 
139
  1. Click the **Model tab**.
140
  2. Under **Download custom model or LoRA**, enter `TheBloke/Upstage-Llama1-65B-Instruct-GPTQ`.
141
+ - To download from a specific branch, enter for example `TheBloke/Upstage-Llama1-65B-Instruct-GPTQ:main`
142
  - see Provided Files above for the list of branches for each option.
143
  3. Click **Download**.
144
+ 4. The model will start downloading. Once it's finished it will say "Done".
145
  5. In the top left, click the refresh icon next to **Model**.
146
  6. In the **Model** dropdown, choose the model you just downloaded: `Upstage-Llama1-65B-Instruct-GPTQ`
147
  7. The model will automatically load, and is now ready for use!
148
  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.
149
+ * 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`.
150
  9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
151
+ <!-- README_GPTQ.md-text-generation-webui end -->
152
 
153
+ <!-- README_GPTQ.md-use-from-python start -->
154
  ## How to use this GPTQ model from Python code
155
 
156
+ ### Install the necessary packages
157
+
158
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
159
+
160
+ ```shell
161
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
162
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
163
+ ```
164
 
165
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
166
 
167
+ ```shell
168
+ pip3 uninstall -y auto-gptq
169
+ git clone https://github.com/PanQiWei/AutoGPTQ
170
+ cd AutoGPTQ
171
+ pip3 install .
172
+ ```
173
+
174
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
175
+
176
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
177
+ ```shell
178
+ pip3 uninstall -y transformers
179
+ pip3 install git+https://github.com/huggingface/transformers.git
180
+ ```
181
+
182
+ ### You can then use the following code
183
 
184
  ```python
185
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
186
 
187
  model_name_or_path = "TheBloke/Upstage-Llama1-65B-Instruct-GPTQ"
188
+ # To use a different branch, change revision
189
+ # For example: revision="main"
190
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
191
+ device_map="auto",
192
+ trust_remote_code=False,
193
+ revision="main")
194
 
195
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  prompt = "Tell me about AI"
 
198
  prompt_template=f'''### System:
199
+ {system_message}
200
 
201
  ### User:
202
  {prompt}
203
 
204
+ ### Assistant:
205
+
206
+ '''
207
 
208
  print("\n\n*** Generate:")
209
 
210
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
211
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
212
  print(tokenizer.decode(output[0]))
213
 
214
  # Inference can also be done using transformers' pipeline
215
 
 
 
 
216
  print("*** Pipeline:")
217
  pipe = pipeline(
218
  "text-generation",
219
  model=model,
220
  tokenizer=tokenizer,
221
  max_new_tokens=512,
222
+ do_sample=True,
223
  temperature=0.7,
224
  top_p=0.95,
225
+ top_k=40,
226
+ repetition_penalty=1.1
227
  )
228
 
229
  print(pipe(prompt_template)[0]['generated_text'])
230
  ```
231
+ <!-- README_GPTQ.md-use-from-python end -->
232
 
233
+ <!-- README_GPTQ.md-compatibility start -->
234
  ## Compatibility
235
 
236
+ 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).
237
 
238
+ [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.
239
+
240
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
241
+ <!-- README_GPTQ.md-compatibility end -->
242
 
243
  <!-- footer start -->
244
  <!-- 200823 -->
 
248
 
249
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
250
 
251
+ ## Thanks, and how to contribute
252
 
253
  Thanks to the [chirper.ai](https://chirper.ai) team!
254
 
255
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
256
+
257
  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.
258
 
259
  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.
 
265
 
266
  **Special thanks to**: Aemon Algiz.
267
 
268
+ **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
269
 
270
 
271
  Thank you to all my generous patrons and donaters!
 
278
 
279
  # LLaMa-65b-instruct model card
280
 
281
+ ## Model Details
282
+
283
+ * **Developed by**: [Upstage](https://en.upstage.ai)
284
+ * **Backbone Model**: [LLaMA](https://github.com/facebookresearch/llama/tree/llama_v1)
285
+ * **Variations**: It has different model parameter sizes and sequence lengths: [30B/1024](https://huggingface.co/upstage/llama-30b-instruct), [30B/2048](https://huggingface.co/upstage/llama-30b-instruct-2048), [65B/1024](https://huggingface.co/upstage/llama-65b-instruct)
286
+ * **Language(s)**: English
287
+ * **Library**: [HuggingFace Transformers](https://github.com/huggingface/transformers)
288
+ * **License**: This model is under a **Non-commercial** Bespoke License and governed by the Meta license. You should only use this repository if you have been granted access to the model by filling out [this form](https://docs.google.com/forms/d/e/1FAIpQLSfqNECQnMkycAp2jP4Z9TFX0cGR4uf7b_fBxjY_OjhJILlKGA/viewform), but have either lost your copy of the weights or encountered issues converting them to the Transformers format
289
+ * **Where to send comments**: Instructions on how to provide feedback or comments on a model can be found by opening an issue in the [Hugging Face community's model repository](https://huggingface.co/upstage/llama-30b-instruct-2048/discussions)
290
+ * **Contact**: For questions and comments about the model, please email [contact@upstage.ai](mailto:contact@upstage.ai)
291
+
292
+ ## Dataset Details
293
+
294
+ ### Used Datasets
295
+
296
+ - Orca-style dataset
297
+ - No other data was used except for the dataset mentioned above
298
+
299
+ ### Prompt Template
300
+ ```
301
+ ### System:
302
+ {System}
303
+
304
+ ### User:
305
+ {User}
306
+
307
+ ### Assistant:
308
+ {Assistant}
309
+ ```
310
+
311
+ ## Usage
312
+
313
+ - Tested on A100 80GB
314
+ - Our model can handle up to 10k+ input tokens, thanks to the `rope_scaling` option
315
+
316
+ ```python
317
+ import torch
318
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
319
+
320
+ tokenizer = AutoTokenizer.from_pretrained("upstage/llama-65b-instruct")
321
+ model = AutoModelForCausalLM.from_pretrained(
322
+ "upstage/llama-65b-instruct",
323
+ device_map="auto",
324
+ torch_dtype=torch.float16,
325
+ load_in_8bit=True,
326
+ rope_scaling={"type": "dynamic", "factor": 2} # allows handling of longer inputs
327
+ )
328
+
329
+ prompt = "### User:\nThomas is healthy, but he has to go to the hospital. What could be the reasons?\n\n### Assistant:\n"
330
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
331
+ del inputs["token_type_ids"]
332
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
333
+
334
+ output = model.generate(**inputs, streamer=streamer, use_cache=True, max_new_tokens=float('inf'))
335
+ output_text = tokenizer.decode(output[0], skip_special_tokens=True)
336
+ ```
337
+
338
+ ## Hardware and Software
339
+
340
+ * **Hardware**: We utilized an A100x8 * 4 for training our model
341
+ * **Training Factors**: We fine-tuned this model using a combination of the [DeepSpeed library](https://github.com/microsoft/DeepSpeed) and the [HuggingFace Trainer](https://huggingface.co/docs/transformers/main_classes/trainer)
342
+
343
+ ## Evaluation Results
344
+
345
+ ### Overview
346
+ - We conducted a performance evaluation based on the tasks being evaluated on the [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
347
+ We evaluated our model on four benchmark datasets, which include `ARC-Challenge`, `HellaSwag`, `MMLU`, and `TruthfulQA`.
348
+ We used the [lm-evaluation-harness repository](https://github.com/EleutherAI/lm-evaluation-harness), specifically commit [b281b0921b636bc36ad05c0b0b0763bd6dd43463](https://github.com/EleutherAI/lm-evaluation-harness/tree/b281b0921b636bc36ad05c0b0b0763bd6dd43463)
349
+ - We used [MT-bench](https://github.com/lm-sys/FastChat/tree/main/fastchat/llm_judge), a set of challenging multi-turn open-ended questions, to evaluate the models
350
+
351
+ ### Main Results
352
+ | Model | H4(Avg) | ARC | HellaSwag | MMLU | TruthfulQA | | MT_Bench |
353
+ |--------------------------------------------------------------------|----------|----------|----------|------|----------|-|-------------|
354
+ | **[Llama-2-70b-instruct-v2](https://huggingface.co/upstage/Llama-2-70b-instruct-v2)**(Ours, Open LLM Leaderboard) | **73** | **71.1** | **87.9** | **70.6** | **62.2** | | **7.44063** |
355
+ | [Llama-2-70b-instruct](https://huggingface.co/upstage/Llama-2-70b-instruct) (Ours, Open LLM Leaderboard) | 72.3 | 70.9 | 87.5 | 69.8 | 61 | | 7.24375 |
356
+ | [llama-65b-instruct](https://huggingface.co/upstage/llama-65b-instruct) (***Ours***, ***Open LLM Leaderboard***) | 69.4 | 67.6 | 86.5 | 64.9 | 58.8 | | |
357
+ | Llama-2-70b-hf | 67.3 | 67.3 | 87.3 | 69.8 | 44.9 | | |
358
+ | [llama-30b-instruct-2048](https://huggingface.co/upstage/llama-30b-instruct-2048) (Ours, Open LLM Leaderboard) | 67.0 | 64.9 | 84.9 | 61.9 | 56.3 | | |
359
+ | [llama-30b-instruct](https://huggingface.co/upstage/llama-30b-instruct) (Ours, Open LLM Leaderboard) | 65.2 | 62.5 | 86.2 | 59.4 | 52.8 | | |
360
+ | llama-65b | 64.2 | 63.5 | 86.1 | 63.9 | 43.4 | | |
361
+ | falcon-40b-instruct | 63.4 | 61.6 | 84.3 | 55.4 | 52.5 | | |
362
+
363
+
364
+ ### Scripts for H4 Score Reproduction
365
+ - Prepare evaluation environments:
366
+ ```
367
+ # clone the repository
368
+ git clone https://github.com/EleutherAI/lm-evaluation-harness.git
369
+
370
+ # check out the specific commit
371
+ git checkout b281b0921b636bc36ad05c0b0b0763bd6dd43463
372
+
373
+ # change to the repository directory
374
+ cd lm-evaluation-harness
375
+ ```
376
+
377
+ ## Ethical Issues
378
 
379
+ ### Ethical Considerations
380
+ - There were no ethical issues involved, as we did not include the benchmark test set or the training set in the model's training process
381
 
382
+ ## Contact Us
 
383
 
384
+ ### Why Upstage LLM?
385
+ - [Upstage](https://en.upstage.ai)'s LLM research has yielded remarkable results. As of August 1st, our 70B model has reached the top spot in openLLM rankings, marking itself as the current leading performer globally. Recognizing the immense potential in implementing private LLM to actual businesses, we invite you to easily apply private LLM and fine-tune it with your own data. For a seamless and tailored solution, please do not hesitate to reach out to us. ► [click here to contact](https://www.upstage.ai/private-llm?utm_source=huggingface&utm_medium=link&utm_campaign=privatellm)