TheBloke commited on
Commit
086692f
1 Parent(s): 0ee3733

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +87 -85
README.md CHANGED
@@ -2,7 +2,7 @@
2
  inference: false
3
  language:
4
  - en
5
- license: other
6
  model_creator: Upstage
7
  model_link: https://huggingface.co/upstage/Llama-2-70b-instruct-v2
8
  model_name: Llama 2 70B Instruct v2
@@ -17,17 +17,20 @@ tags:
17
  ---
18
 
19
  <!-- header start -->
20
- <div style="width: 100%;">
21
- <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
 
22
  </div>
23
  <div style="display: flex; justify-content: space-between; width: 100%;">
24
  <div style="display: flex; flex-direction: column; align-items: flex-start;">
25
- <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
26
  </div>
27
  <div style="display: flex; flex-direction: column; align-items: flex-end;">
28
- <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
29
  </div>
30
  </div>
 
 
31
  <!-- header end -->
32
 
33
  # Llama 2 70B Instruct v2 - GGML
@@ -38,36 +41,50 @@ tags:
38
 
39
  This repo contains GGML format model files for [Upstage's Llama 2 70B Instruct v2](https://huggingface.co/upstage/Llama-2-70b-instruct-v2).
40
 
41
- CUDA GPU acceleration is now available for Llama 2 70B GGML files. Metal acceleration (macOS) is not yet available. I haven't tested AMD acceleration - let me know if it works. The following clients/libraries are known to work with these files, including with CUDA GPU acceleration:
 
 
 
 
 
 
 
 
42
  * [llama.cpp](https://github.com/ggerganov/llama.cpp), commit `e76d630` and later.
43
  * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI.
44
  * [KoboldCpp](https://github.com/LostRuins/koboldcpp), version 1.37 and later. A powerful GGML web UI, especially good for story telling.
45
- * [LM Studio](https://lmstudio.ai/), a fully featured local GUI with GPU acceleration. (GPU acceleration is Windows only for 70B models at the moment.)
46
  * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), version 0.1.77 and later. A Python library with LangChain support, and OpenAI-compatible API server.
47
  * [ctransformers](https://github.com/marella/ctransformers), version 0.2.15 and later. A Python library with LangChain support, and OpenAI-compatible API server.
48
 
49
  ## Repositories available
50
 
51
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GPTQ)
52
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML)
 
53
  * [Upstage's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/upstage/Llama-2-70b-instruct-v2)
54
 
55
  ## Prompt template: Orca-Hashes
56
 
57
  ```
58
  ### System:
59
- This is a system prompt, please behave and help the user.
60
 
61
  ### User:
62
  {prompt}
63
 
64
  ### Assistant:
 
65
  ```
66
 
67
  <!-- compatibility_ggml start -->
68
  ## Compatibility
69
 
70
- ### Requires llama.cpp [commit `e76d630`](https://github.com/ggerganov/llama.cpp/commit/e76d630df17e235e6b9ef416c45996765d2e36fb) or later.
 
 
 
 
71
 
72
  Or one of the other tools and libraries listed above.
73
 
@@ -96,70 +113,48 @@ Refer to the Provided Files table below to see what files use which methods, and
96
  | Name | Quant method | Bits | Size | Max RAM required | Use case |
97
  | ---- | ---- | ---- | ---- | ---- | ----- |
98
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q2_K.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q2_K.bin) | q2_K | 2 | 28.59 GB| 31.09 GB | New k-quant method. Uses GGML_TYPE_Q4_K for the attention.vw and feed_forward.w2 tensors, GGML_TYPE_Q2_K for the other tensors. |
99
- | [upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_L.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_L.bin) | q3_K_L | 3 | 36.15 GB| 38.65 GB | New k-quant method. Uses GGML_TYPE_Q5_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else GGML_TYPE_Q3_K |
100
- | [upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_M.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_M.bin) | q3_K_M | 3 | 33.04 GB| 35.54 GB | New k-quant method. Uses GGML_TYPE_Q4_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else GGML_TYPE_Q3_K |
101
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_S.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_S.bin) | q3_K_S | 3 | 29.75 GB| 32.25 GB | New k-quant method. Uses GGML_TYPE_Q3_K for all tensors |
 
 
102
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q4_0.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q4_0.bin) | q4_0 | 4 | 38.87 GB| 41.37 GB | Original quant method, 4-bit. |
103
- | [upstage-llama-2-70b-instruct-v2.ggmlv3.q4_1.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q4_1.bin) | q4_1 | 4 | 43.17 GB| 45.67 GB | Original quant method, 4-bit. Higher accuracy than q4_0 but not as high as q5_0. However has quicker inference than q5 models. |
104
- | [upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_M.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_M.bin) | q4_K_M | 4 | 41.38 GB| 43.88 GB | New k-quant method. Uses GGML_TYPE_Q6_K for half of the attention.wv and feed_forward.w2 tensors, else GGML_TYPE_Q4_K |
105
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_S.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_S.bin) | q4_K_S | 4 | 38.87 GB| 41.37 GB | New k-quant method. Uses GGML_TYPE_Q4_K for all tensors |
 
 
106
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q5_0.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q5_0.bin) | q5_0 | 5 | 47.46 GB| 49.96 GB | Original quant method, 5-bit. Higher accuracy, higher resource usage and slower inference. |
107
- | [upstage-llama-2-70b-instruct-v2.ggmlv3.q5_K_M.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q5_K_M.bin) | q5_K_M | 5 | 48.75 GB| 51.25 GB | New k-quant method. Uses GGML_TYPE_Q6_K for half of the attention.wv and feed_forward.w2 tensors, else GGML_TYPE_Q5_K |
108
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q5_K_S.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q5_K_S.bin) | q5_K_S | 5 | 47.46 GB| 49.96 GB | New k-quant method. Uses GGML_TYPE_Q5_K for all tensors |
109
- | upstage-llama-2-70b-instruct-v2.ggmlv3.q5_1.bin | q5_1 | 5 | 51.76 GB | 54.26 GB | Original quant method, 5-bit. Higher accuracy, slower inference than q5_0. |
110
- | upstage-llama-2-70b-instruct-v2.ggmlv3.q6_K.bin | q6_K | 6 | 56.59 GB | 59.09 GB | New k-quant method. Uses GGML_TYPE_Q8_K - 6-bit quantization - for all tensors |
111
- | upstage-llama-2-70b-instruct-v2.ggmlv3.q8_0.bin | q8_0 | 8 | 73.23 GB | 75.73 GB | Original llama.cpp quant method, 8-bit. Almost indistinguishable from float16. High resource use and slow. Not recommended for most users. |
112
-
113
- ### q5_1, q6_K and q8_0 files require expansion from archive
114
-
115
- **Note:** HF does not support uploading files larger than 50GB. Therefore I have uploaded the q6_K and q8_0 files as multi-part ZIP files. They are not compressed, they are just for storing a .bin file in two parts.
116
-
117
- <details>
118
- <summary>Click for instructions regarding q5_1, q6_K and q8_0 files</summary>
119
-
120
- ### q5_1
121
- Please download:
122
- * `upstage-llama-2-70b-instruct-v2.ggmlv3.q5_1.zip`
123
- * `upstage-llama-2-70b-instruct-v2.ggmlv3.q5_1.z01`
124
-
125
- ### q6_K
126
- Please download:
127
- * `upstage-llama-2-70b-instruct-v2.ggmlv3.q6_K.zip`
128
- * `upstage-llama-2-70b-instruct-v2.ggmlv3.q6_K.z01`
129
-
130
- ### q8_0
131
- Please download:
132
- * `upstage-llama-2-70b-instruct-v2.ggmlv3.q8_0.zip`
133
- * `upstage-llama-2-70b-instruct-v2.ggmlv3.q8_0.z01`
134
-
135
- Then extract the .zip archive. This will will expand both parts automatically. On Linux I found I had to use `7zip` - the basic `unzip` tool did not work. Example:
136
- ```
137
- sudo apt update -y && sudo apt install 7zip
138
- 7zz x upstage-llama-2-70b-instruct-v2.ggmlv3.q6_K.zip
139
- </details>
140
 
141
  **Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
142
 
143
  ## How to run in `llama.cpp`
144
 
 
 
 
 
145
  I use the following command line; adjust for your tastes and needs:
146
 
147
  ```
148
- ./main -t 10 -ngl 40 -gqa 8 -m upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_M.bin --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### System:\nThis is a system prompt, please behave and help the user.\n\n### User:\nWrite a story about llamas\n\n### Assistant:"
149
  ```
150
- Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`.
151
 
152
- Change -ngl 40 to the number of GPU layers you have VRAM for. Use -ngl 100 to offload all layers to VRAM, if you have a 48GB card, or 2 x 24GB, or similar. Otherwise you can partially offload as many as you have VRAM for, on one or more GPUs.
 
 
153
 
154
  Remember the `-gqa 8` argument, required for Llama 70B models.
155
 
156
- If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
 
 
157
 
158
  ## How to run in `text-generation-webui`
159
 
160
  Further instructions here: [text-generation-webui/docs/llama.cpp-models.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp-models.md).
161
 
162
  <!-- footer start -->
 
163
  ## Discord
164
 
165
  For further support, and discussions on these models and AI in general, join us at:
@@ -179,18 +174,21 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
179
  * Patreon: https://patreon.com/TheBlokeAI
180
  * Ko-Fi: https://ko-fi.com/TheBlokeAI
181
 
182
- **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
183
 
184
- **Patreon special mentions**: Slarti, Chadd, John Detwiler, Pieter, zynix, K, Mano Prime, ReadyPlayerEmma, Ai Maven, Leonard Tan, Edmond Seymore, Joseph William Delisle, Luke @flexchar, Fred von Graf, Viktor Bowallius, Rishabh Srivastava, Nikolai Manek, Matthew Berman, Johann-Peter Hartmann, ya boyyy, Greatston Gnanesh, Femi Adebogun, Talal Aujan, Jonathan Leane, terasurfer, David Flickinger, William Sang, Ajan Kanaga, Vadim, Artur Olbinski, Raven Klaugh, Michael Levine, Oscar Rangel, Randy H, Cory Kujawski, RoA, Dave, Alex, Alexandros Triantafyllidis, Fen Risland, Eugene Pentland, vamX, Elle, Nathan LeClaire, Khalefa Al-Ahmad, Rainer Wilmers, subjectnull, Junyu Yang, Daniel P. Andersen, SuperWojo, LangChain4j, Mandus, Kalila, Illia Dulskyi, Trenton Dambrowitz, Asp the Wyvern, Derek Yates, Jeffrey Morgan, Deep Realms, Imad Khwaja, Pyrater, Preetika Verma, biorpg, Gabriel Tamborski, Stephen Murray, Spiking Neurons AB, Iucharbius, Chris Smitley, Willem Michiel, Luke Pendergrass, Sebastain Graf, senxiiz, Will Dee, Space Cruiser, Karl Bernard, Clay Pascal, Lone Striker, transmissions 11, webtim, WelcomeToTheClub, Sam, theTransient, Pierre Kircher, chris gileta, John Villwock, Sean Connelly, Willian Hasse
185
 
186
 
187
  Thank you to all my generous patrons and donaters!
188
 
 
 
189
  <!-- footer end -->
190
 
191
  # Original model card: Upstage's Llama 2 70B Instruct v2
192
 
193
- # LLaMa-2-70b-instruct-v2 model card
 
194
 
195
  ## Model Details
196
 
@@ -206,69 +204,76 @@ Thank you to all my generous patrons and donaters!
206
 
207
  ### Used Datasets
208
  - Orca-style dataset
209
- - Alpaca-Style Dataset
 
 
210
 
211
 
212
  ### Prompt Template
213
  ```
214
  ### System:
215
  {System}
 
216
  ### User:
217
  {User}
 
218
  ### Assistant:
219
  {Assistant}
220
  ```
221
- ### Usage
222
 
223
- *Tested on A100 80GB*
 
 
 
224
 
225
  ```python
226
  import torch
227
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
 
228
  tokenizer = AutoTokenizer.from_pretrained("upstage/Llama-2-70b-instruct-v2")
229
  model = AutoModelForCausalLM.from_pretrained(
230
  "upstage/Llama-2-70b-instruct-v2",
231
- device_map='auto',
232
  torch_dtype=torch.float16,
233
  load_in_8bit=True,
234
- rope_scaling={'type': 'dynamic', 'factor': 2} # longer inputs possible
235
  )
236
- prompt = "### User:\nThomas is very healthy, but he has to go to the hospital every day. What could be the reasons?\n\n### Assistant:\n"
 
237
  inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
238
- del inputs['token_type_ids']
239
  streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
 
240
  output = model.generate(**inputs, streamer=streamer, use_cache=True, max_new_tokens=float('inf'))
241
  output_text = tokenizer.decode(output[0], skip_special_tokens=True)
242
  ```
243
 
244
- **Our model can handle >10k input tokens thanks to the `rope_scaling` option.**
245
-
246
  ## Hardware and Software
247
 
248
  * **Hardware**: We utilized an A100x8 * 4 for training our model
249
- * **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) / [HuggingFace Accelerate](https://huggingface.co/docs/accelerate/index)
250
 
251
  ## Evaluation Results
252
 
253
  ### Overview
254
- - We conducted a performance evaluation based on the tasks being evaluated on the [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
255
- We evaluated our model on four benchmark datasets, which include `ARC-Challenge`, `HellaSwag`, `MMLU`, and `TruthfulQA`.
256
  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).
 
257
 
258
  ### Main Results
259
- | Model | H4 Average | ARC | HellaSwag | MMLU | TruthfulQA | | MT_Bench |
260
- |-----------------------------------------------|---------|-------|-----------|-------|------------|-------|----------|
261
- | **Llama-2-70b-instruct-v2** (***Ours***, ***Local Reproduction***) | **72.7** | **71.6** | **87.7** | **69.7** | **61.6** | | 7.440625 |
262
- | Llama-2-70b-instruct (Ours, Local Reproduction) | 72.0 | 70.7 | 87.4 | 69.3 | 60.7 | | 7.24375 |
263
- | llama-65b-instruct (Ours, Local Reproduction) | 69.4 | 67.6 | 86.5 | 64.9 | 58.8 | | |
264
- | Llama-2-70b-hf | 67.3 | 67.3 | 87.3 | 69.8 | 44.9 | | |
265
- | llama-30b-instruct-2048 (Ours, Open LLM Leaderboard) | 67.0 | 64.9 | 84.9 | 61.9 | 56.3 | | |
266
- | llama-30b-instruct-2048 (Ours, Local Reproduction) | 67.0 | 64.9 | 85.0 | 61.9 | 56.0 | | 6.88125 |
267
- | llama-30b-instruct (Ours, Open LLM Leaderboard) | 65.2 | 62.5 | 86.2 | 59.4 | 52.8 | | |
268
- | llama-65b | 64.2 | 63.5 | 86.1 | 63.9 | 43.4 | | |
269
- | falcon-40b-instruct | 63.4 | 61.6 | 84.3 | 55.4 | 52.5 | | |
270
-
271
- ### Scripts
272
  - Prepare evaluation environments:
273
  ```
274
  # clone the repository
@@ -279,12 +284,9 @@ git checkout b281b0921b636bc36ad05c0b0b0763bd6dd43463
279
  cd lm-evaluation-harness
280
  ```
281
 
282
- ## Ethical Issues
283
-
284
- ### Ethical Considerations
285
- - 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.
286
-
287
  ## Contact Us
288
 
289
- ### Why Upstage LLM?
290
- - [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](https://www.upstage.ai/private-llm?utm_source=huggingface&utm_medium=link&utm_campaign=privatellm).
 
 
 
2
  inference: false
3
  language:
4
  - en
5
+ license: llama2
6
  model_creator: Upstage
7
  model_link: https://huggingface.co/upstage/Llama-2-70b-instruct-v2
8
  model_name: Llama 2 70B Instruct v2
 
17
  ---
18
 
19
  <!-- header start -->
20
+ <!-- 200823 -->
21
+ <div style="width: auto; margin-left: auto; margin-right: auto">
22
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
23
  </div>
24
  <div style="display: flex; justify-content: space-between; width: 100%;">
25
  <div style="display: flex; flex-direction: column; align-items: flex-start;">
26
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
27
  </div>
28
  <div style="display: flex; flex-direction: column; align-items: flex-end;">
29
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
30
  </div>
31
  </div>
32
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
33
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
34
  <!-- header end -->
35
 
36
  # Llama 2 70B Instruct v2 - GGML
 
41
 
42
  This repo contains GGML format model files for [Upstage's Llama 2 70B Instruct v2](https://huggingface.co/upstage/Llama-2-70b-instruct-v2).
43
 
44
+ ### Important note regarding GGML files.
45
+
46
+ The GGML format has now been superseded by GGUF. As of August 21st 2023, [llama.cpp](https://github.com/ggerganov/llama.cpp) no longer supports GGML models. Third party clients and libraries are expected to still support it for a time, but many may also drop support.
47
+
48
+ Please use the GGUF models instead.
49
+
50
+ ### About GGML
51
+
52
+ GPU acceleration is now available for Llama 2 70B GGML files, with both CUDA (NVidia) and Metal (macOS). The following clients/libraries are known to work with these files, including with GPU acceleration:
53
  * [llama.cpp](https://github.com/ggerganov/llama.cpp), commit `e76d630` and later.
54
  * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI.
55
  * [KoboldCpp](https://github.com/LostRuins/koboldcpp), version 1.37 and later. A powerful GGML web UI, especially good for story telling.
56
+ * [LM Studio](https://lmstudio.ai/), a fully featured local GUI with GPU acceleration for both Windows and macOS. Use 0.1.11 or later for macOS GPU acceleration with 70B models.
57
  * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), version 0.1.77 and later. A Python library with LangChain support, and OpenAI-compatible API server.
58
  * [ctransformers](https://github.com/marella/ctransformers), version 0.2.15 and later. A Python library with LangChain support, and OpenAI-compatible API server.
59
 
60
  ## Repositories available
61
 
62
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GPTQ)
63
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGUF)
64
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference (deprecated)](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML)
65
  * [Upstage's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/upstage/Llama-2-70b-instruct-v2)
66
 
67
  ## Prompt template: Orca-Hashes
68
 
69
  ```
70
  ### System:
71
+ {system_message}
72
 
73
  ### User:
74
  {prompt}
75
 
76
  ### Assistant:
77
+
78
  ```
79
 
80
  <!-- compatibility_ggml start -->
81
  ## Compatibility
82
 
83
+ ### Works with llama.cpp [commit `e76d630`](https://github.com/ggerganov/llama.cpp/commit/e76d630df17e235e6b9ef416c45996765d2e36fb) until August 21st, 2023
84
+
85
+ Will not work with `llama.cpp` after commit [dadbed99e65252d79f81101a392d0d6497b86caa](https://github.com/ggerganov/llama.cpp/commit/dadbed99e65252d79f81101a392d0d6497b86caa).
86
+
87
+ For compatibility with latest llama.cpp, please use GGUF files instead.
88
 
89
  Or one of the other tools and libraries listed above.
90
 
 
113
  | Name | Quant method | Bits | Size | Max RAM required | Use case |
114
  | ---- | ---- | ---- | ---- | ---- | ----- |
115
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q2_K.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q2_K.bin) | q2_K | 2 | 28.59 GB| 31.09 GB | New k-quant method. Uses GGML_TYPE_Q4_K for the attention.vw and feed_forward.w2 tensors, GGML_TYPE_Q2_K for the other tensors. |
 
 
116
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_S.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_S.bin) | q3_K_S | 3 | 29.75 GB| 32.25 GB | New k-quant method. Uses GGML_TYPE_Q3_K for all tensors |
117
+ | [upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_M.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_M.bin) | q3_K_M | 3 | 33.04 GB| 35.54 GB | New k-quant method. Uses GGML_TYPE_Q4_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else GGML_TYPE_Q3_K |
118
+ | [upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_L.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q3_K_L.bin) | q3_K_L | 3 | 36.15 GB| 38.65 GB | New k-quant method. Uses GGML_TYPE_Q5_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else GGML_TYPE_Q3_K |
119
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q4_0.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q4_0.bin) | q4_0 | 4 | 38.87 GB| 41.37 GB | Original quant method, 4-bit. |
 
 
120
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_S.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_S.bin) | q4_K_S | 4 | 38.87 GB| 41.37 GB | New k-quant method. Uses GGML_TYPE_Q4_K for all tensors |
121
+ | [upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_M.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_M.bin) | q4_K_M | 4 | 41.38 GB| 43.88 GB | New k-quant method. Uses GGML_TYPE_Q6_K for half of the attention.wv and feed_forward.w2 tensors, else GGML_TYPE_Q4_K |
122
+ | [upstage-llama-2-70b-instruct-v2.ggmlv3.q4_1.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q4_1.bin) | q4_1 | 4 | 43.17 GB| 45.67 GB | Original quant method, 4-bit. Higher accuracy than q4_0 but not as high as q5_0. However has quicker inference than q5 models. |
123
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q5_0.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q5_0.bin) | q5_0 | 5 | 47.46 GB| 49.96 GB | Original quant method, 5-bit. Higher accuracy, higher resource usage and slower inference. |
 
124
  | [upstage-llama-2-70b-instruct-v2.ggmlv3.q5_K_S.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q5_K_S.bin) | q5_K_S | 5 | 47.46 GB| 49.96 GB | New k-quant method. Uses GGML_TYPE_Q5_K for all tensors |
125
+ | [upstage-llama-2-70b-instruct-v2.ggmlv3.q5_K_M.bin](https://huggingface.co/TheBloke/Upstage-Llama-2-70B-instruct-v2-GGML/blob/main/upstage-llama-2-70b-instruct-v2.ggmlv3.q5_K_M.bin) | q5_K_M | 5 | 48.75 GB| 51.25 GB | New k-quant method. Uses GGML_TYPE_Q6_K for half of the attention.wv and feed_forward.w2 tensors, else GGML_TYPE_Q5_K |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
  **Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
128
 
129
  ## How to run in `llama.cpp`
130
 
131
+ Make sure you are using `llama.cpp` from commit [dadbed99e65252d79f81101a392d0d6497b86caa](https://github.com/ggerganov/llama.cpp/commit/dadbed99e65252d79f81101a392d0d6497b86caa) or earlier.
132
+
133
+ For compatibility with latest llama.cpp, please use GGUF files instead.
134
+
135
  I use the following command line; adjust for your tastes and needs:
136
 
137
  ```
138
+ ./main -t 10 -ngl 40 -gqa 8 -m upstage-llama-2-70b-instruct-v2.ggmlv3.q4_K_M.bin --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### System:\n{system_message}\n\n### User:\n{prompt}\n\n### Assistant:"
139
  ```
140
+ Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`. If you are fully offloading the model to GPU, use `-t 1`
141
 
142
+ Change `-ngl 40` to the number of GPU layers you have VRAM for. Use `-ngl 100` to offload all layers to VRAM - if you have a 48GB card, or 2 x 24GB, or similar. Otherwise you can partially offload as many as you have VRAM for, on one or more GPUs.
143
+
144
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
145
 
146
  Remember the `-gqa 8` argument, required for Llama 70B models.
147
 
148
+ Change `-c 4096` to the desired sequence length for this model. For models that use RoPE, add `--rope-freq-base 10000 --rope-freq-scale 0.5` for doubled context, or `--rope-freq-base 10000 --rope-freq-scale 0.25` for 4x context.
149
+
150
+ For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
151
 
152
  ## How to run in `text-generation-webui`
153
 
154
  Further instructions here: [text-generation-webui/docs/llama.cpp-models.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp-models.md).
155
 
156
  <!-- footer start -->
157
+ <!-- 200823 -->
158
  ## Discord
159
 
160
  For further support, and discussions on these models and AI in general, join us at:
 
174
  * Patreon: https://patreon.com/TheBlokeAI
175
  * Ko-Fi: https://ko-fi.com/TheBlokeAI
176
 
177
+ **Special thanks to**: Aemon Algiz.
178
 
179
+ **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
180
 
181
 
182
  Thank you to all my generous patrons and donaters!
183
 
184
+ And thank you again to a16z for their generous grant.
185
+
186
  <!-- footer end -->
187
 
188
  # Original model card: Upstage's Llama 2 70B Instruct v2
189
 
190
+ # SOLAR-0-70b-16bit model card
191
+ The model name has been changed from LLaMa-2-70b-instruct-v2 to SOLAR-0-70b-16bit
192
 
193
  ## Model Details
194
 
 
204
 
205
  ### Used Datasets
206
  - Orca-style dataset
207
+ - Alpaca-style dataset
208
+ - No other dataset was used except for the dataset mentioned above
209
+ - No benchmark test set or the training set are used
210
 
211
 
212
  ### Prompt Template
213
  ```
214
  ### System:
215
  {System}
216
+
217
  ### User:
218
  {User}
219
+
220
  ### Assistant:
221
  {Assistant}
222
  ```
 
223
 
224
+ ## Usage
225
+
226
+ - The followings are tested on A100 80GB
227
+ - Our model can handle up to 10k+ input tokens, thanks to the `rope_scaling` option
228
 
229
  ```python
230
  import torch
231
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
232
+
233
  tokenizer = AutoTokenizer.from_pretrained("upstage/Llama-2-70b-instruct-v2")
234
  model = AutoModelForCausalLM.from_pretrained(
235
  "upstage/Llama-2-70b-instruct-v2",
236
+ device_map="auto",
237
  torch_dtype=torch.float16,
238
  load_in_8bit=True,
239
+ rope_scaling={"type": "dynamic", "factor": 2} # allows handling of longer inputs
240
  )
241
+
242
+ prompt = "### User:\nThomas is healthy, but he has to go to the hospital. What could be the reasons?\n\n### Assistant:\n"
243
  inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
244
+ del inputs["token_type_ids"]
245
  streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
246
+
247
  output = model.generate(**inputs, streamer=streamer, use_cache=True, max_new_tokens=float('inf'))
248
  output_text = tokenizer.decode(output[0], skip_special_tokens=True)
249
  ```
250
 
 
 
251
  ## Hardware and Software
252
 
253
  * **Hardware**: We utilized an A100x8 * 4 for training our model
254
+ * **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) / [HuggingFace Accelerate](https://huggingface.co/docs/accelerate/index)
255
 
256
  ## Evaluation Results
257
 
258
  ### Overview
259
+ - We conducted a performance evaluation following the tasks being evaluated on the [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
260
+ We evaluated our model on four benchmark datasets, which include `ARC-Challenge`, `HellaSwag`, `MMLU`, and `TruthfulQA`
261
  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).
262
+ - 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
263
 
264
  ### Main Results
265
+ | Model | H4(Avg) | ARC | HellaSwag | MMLU | TruthfulQA | | MT_Bench |
266
+ |--------------------------------------------------------------------|----------|----------|----------|------|----------|-|-------------|
267
+ | **[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** |
268
+ | [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 |
269
+ | [llama-65b-instruct](https://huggingface.co/upstage/llama-65b-instruct) (Ours, Open LLM Leaderboard) | 69.4 | 67.6 | 86.5 | 64.9 | 58.8 | | |
270
+ | Llama-2-70b-hf | 67.3 | 67.3 | 87.3 | 69.8 | 44.9 | | |
271
+ | [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 | | |
272
+ | [llama-30b-instruct](https://huggingface.co/upstage/llama-30b-instruct) (Ours, Open LLM Leaderboard) | 65.2 | 62.5 | 86.2 | 59.4 | 52.8 | | |
273
+ | llama-65b | 64.2 | 63.5 | 86.1 | 63.9 | 43.4 | | |
274
+ | falcon-40b-instruct | 63.4 | 61.6 | 84.3 | 55.4 | 52.5 | | |
275
+
276
+ ### Scripts for H4 Score Reproduction
 
277
  - Prepare evaluation environments:
278
  ```
279
  # clone the repository
 
284
  cd lm-evaluation-harness
285
  ```
286
 
 
 
 
 
 
287
  ## Contact Us
288
 
289
+ ### About Upstage
290
+ - [Upstage](https://en.upstage.ai) is a company specialized in Large Language Models (LLMs) and AI. We will help you build private LLMs and related applications.
291
+ If you have a dataset to build domain specific LLMs or make LLM applications, please contact us at ► [click here to contact](https://www.upstage.ai/private-llm?utm_source=huggingface&utm_medium=link&utm_campaign=privatellm)
292
+ - As of August 1st, our 70B model has reached the top spot in openLLM rankings, marking itself as the current leading performer globally.