Initial GPTQ model commit
Browse files
README.md
ADDED
@@ -0,0 +1,436 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
inference: false
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
library_name: transformers
|
6 |
+
license: llama2
|
7 |
+
model_creator: Pankaj Mathur
|
8 |
+
model_link: https://huggingface.co/psmathur/model_007
|
9 |
+
model_name: Model 007 70B
|
10 |
+
model_type: llama
|
11 |
+
quantized_by: TheBloke
|
12 |
+
---
|
13 |
+
|
14 |
+
<!-- header start -->
|
15 |
+
<!-- 200823 -->
|
16 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
17 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
18 |
+
</div>
|
19 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
20 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
21 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
22 |
+
</div>
|
23 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
24 |
+
<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>
|
25 |
+
</div>
|
26 |
+
</div>
|
27 |
+
<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>
|
28 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
29 |
+
<!-- header end -->
|
30 |
+
|
31 |
+
# Model 007 70B - GPTQ
|
32 |
+
- Model creator: [Pankaj Mathur](https://huggingface.co/psmathur)
|
33 |
+
- Original model: [Model 007 70B](https://huggingface.co/psmathur/model_007)
|
34 |
+
|
35 |
+
<!-- description start -->
|
36 |
+
## Description
|
37 |
+
|
38 |
+
This repo contains GPTQ model files for [Pankaj Mathur's Model 007 70B](https://huggingface.co/psmathur/model_007).
|
39 |
+
|
40 |
+
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.
|
41 |
+
|
42 |
+
<!-- description end -->
|
43 |
+
<!-- repositories-available start -->
|
44 |
+
## Repositories available
|
45 |
+
|
46 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/model_007-70B-GPTQ)
|
47 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/model_007-70B-GGUF)
|
48 |
+
* [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference (deprecated)](https://huggingface.co/TheBloke/model_007-70B-GGML)
|
49 |
+
* [Pankaj Mathur's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/psmathur/model_007)
|
50 |
+
<!-- repositories-available end -->
|
51 |
+
|
52 |
+
<!-- prompt-template start -->
|
53 |
+
## Prompt template: Orca-Hashes
|
54 |
+
|
55 |
+
```
|
56 |
+
### System:
|
57 |
+
{system_message}
|
58 |
+
|
59 |
+
### User:
|
60 |
+
{prompt}
|
61 |
+
|
62 |
+
### Assistant:
|
63 |
+
|
64 |
+
```
|
65 |
+
|
66 |
+
<!-- prompt-template end -->
|
67 |
+
|
68 |
+
<!-- README_GPTQ.md-provided-files start -->
|
69 |
+
## Provided files and GPTQ parameters
|
70 |
+
|
71 |
+
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
72 |
+
|
73 |
+
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
74 |
+
|
75 |
+
All GPTQ files are made with AutoGPTQ.
|
76 |
+
|
77 |
+
<details>
|
78 |
+
<summary>Explanation of GPTQ parameters</summary>
|
79 |
+
|
80 |
+
- Bits: The bit size of the quantised model.
|
81 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
82 |
+
- 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.
|
83 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
84 |
+
- 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).
|
85 |
+
- 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.
|
86 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
|
87 |
+
|
88 |
+
</details>
|
89 |
+
|
90 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
91 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
92 |
+
| [main](https://huggingface.co/TheBloke/model_007-70B-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 35.33 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
|
93 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/model_007-70B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 40.66 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
|
94 |
+
| [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/model_007-70B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 37.99 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
|
95 |
+
| [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/model_007-70B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 36.65 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
|
96 |
+
| [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/model_007-70B-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 26.77 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
|
97 |
+
| [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/model_007-70B-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 28.03 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False but poor AutoGPTQ CUDA speed. |
|
98 |
+
|
99 |
+
<!-- README_GPTQ.md-provided-files end -->
|
100 |
+
|
101 |
+
<!-- README_GPTQ.md-download-from-branches start -->
|
102 |
+
## How to download from branches
|
103 |
+
|
104 |
+
- In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/model_007-70B-GPTQ:gptq-4bit-32g-actorder_True`
|
105 |
+
- With Git, you can clone a branch with:
|
106 |
+
```
|
107 |
+
git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/model_007-70B-GPTQ
|
108 |
+
```
|
109 |
+
- In Python Transformers code, the branch is the `revision` parameter; see below.
|
110 |
+
<!-- README_GPTQ.md-download-from-branches end -->
|
111 |
+
<!-- README_GPTQ.md-text-generation-webui start -->
|
112 |
+
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
113 |
+
|
114 |
+
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
115 |
+
|
116 |
+
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.
|
117 |
+
|
118 |
+
1. Click the **Model tab**.
|
119 |
+
2. Under **Download custom model or LoRA**, enter `TheBloke/model_007-70B-GPTQ`.
|
120 |
+
- To download from a specific branch, enter for example `TheBloke/model_007-70B-GPTQ:gptq-4bit-32g-actorder_True`
|
121 |
+
- see Provided Files above for the list of branches for each option.
|
122 |
+
3. Click **Download**.
|
123 |
+
4. The model will start downloading. Once it's finished it will say "Done".
|
124 |
+
5. In the top left, click the refresh icon next to **Model**.
|
125 |
+
6. In the **Model** dropdown, choose the model you just downloaded: `model_007-70B-GPTQ`
|
126 |
+
7. The model will automatically load, and is now ready for use!
|
127 |
+
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.
|
128 |
+
* Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
|
129 |
+
9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
|
130 |
+
<!-- README_GPTQ.md-text-generation-webui end -->
|
131 |
+
|
132 |
+
<!-- README_GPTQ.md-use-from-python start -->
|
133 |
+
## How to use this GPTQ model from Python code
|
134 |
+
|
135 |
+
### Install the necessary packages
|
136 |
+
|
137 |
+
Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
138 |
+
|
139 |
+
```shell
|
140 |
+
pip3 install transformers>=4.32.0 optimum>=1.12.0
|
141 |
+
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
|
142 |
+
```
|
143 |
+
|
144 |
+
If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
|
145 |
+
|
146 |
+
```shell
|
147 |
+
pip3 uninstall -y auto-gptq
|
148 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
149 |
+
cd AutoGPTQ
|
150 |
+
pip3 install .
|
151 |
+
```
|
152 |
+
|
153 |
+
### For CodeLlama models only: you must use Transformers 4.33.0 or later.
|
154 |
+
|
155 |
+
If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
|
156 |
+
```shell
|
157 |
+
pip3 uninstall -y transformers
|
158 |
+
pip3 install git+https://github.com/huggingface/transformers.git
|
159 |
+
```
|
160 |
+
|
161 |
+
### You can then use the following code
|
162 |
+
|
163 |
+
```python
|
164 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
165 |
+
|
166 |
+
model_name_or_path = "TheBloke/model_007-70B-GPTQ"
|
167 |
+
# To use a different branch, change revision
|
168 |
+
# For example: revision="gptq-4bit-32g-actorder_True"
|
169 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
170 |
+
torch_dtype=torch.float16,
|
171 |
+
device_map="auto",
|
172 |
+
revision="main")
|
173 |
+
|
174 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
175 |
+
|
176 |
+
prompt = "Tell me about AI"
|
177 |
+
prompt_template=f'''### System:
|
178 |
+
{system_message}
|
179 |
+
|
180 |
+
### User:
|
181 |
+
{prompt}
|
182 |
+
|
183 |
+
### Assistant:
|
184 |
+
|
185 |
+
'''
|
186 |
+
|
187 |
+
print("\n\n*** Generate:")
|
188 |
+
|
189 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
190 |
+
output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
|
191 |
+
print(tokenizer.decode(output[0]))
|
192 |
+
|
193 |
+
# Inference can also be done using transformers' pipeline
|
194 |
+
|
195 |
+
print("*** Pipeline:")
|
196 |
+
pipe = pipeline(
|
197 |
+
"text-generation",
|
198 |
+
model=model,
|
199 |
+
tokenizer=tokenizer,
|
200 |
+
max_new_tokens=512,
|
201 |
+
temperature=0.7,
|
202 |
+
top_p=0.95,
|
203 |
+
repetition_penalty=1.15
|
204 |
+
)
|
205 |
+
|
206 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
207 |
+
```
|
208 |
+
<!-- README_GPTQ.md-use-from-python end -->
|
209 |
+
|
210 |
+
<!-- README_GPTQ.md-compatibility start -->
|
211 |
+
## Compatibility
|
212 |
+
|
213 |
+
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).
|
214 |
+
|
215 |
+
[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.
|
216 |
+
|
217 |
+
[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
|
218 |
+
<!-- README_GPTQ.md-compatibility end -->
|
219 |
+
|
220 |
+
<!-- footer start -->
|
221 |
+
<!-- 200823 -->
|
222 |
+
## Discord
|
223 |
+
|
224 |
+
For further support, and discussions on these models and AI in general, join us at:
|
225 |
+
|
226 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
227 |
+
|
228 |
+
## Thanks, and how to contribute.
|
229 |
+
|
230 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
231 |
+
|
232 |
+
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.
|
233 |
+
|
234 |
+
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.
|
235 |
+
|
236 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
237 |
+
|
238 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
239 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
240 |
+
|
241 |
+
**Special thanks to**: Aemon Algiz.
|
242 |
+
|
243 |
+
**Patreon special mentions**: Kacper Wikieł, knownsqashed, Leonard Tan, Asp the Wyvern, Daniel P. Andersen, Luke Pendergrass, Stanislav Ovsiannikov, RoA, Dave, Ai Maven, Kalila, Will Dee, Imad Khwaja, Nitin Borwankar, Joseph William Delisle, Tony Hughes, Cory Kujawski, Rishabh Srivastava, Russ Johnson, Stephen Murray, Lone Striker, Johann-Peter Hartmann, Elle, J, Deep Realms, SuperWojo, Raven Klaugh, Sebastain Graf, ReadyPlayerEmma, Alps Aficionado, Mano Prime, Derek Yates, Gabriel Puliatti, Mesiah Bishop, Magnesian, Sean Connelly, biorpg, Iucharbius, Olakabola, Fen Risland, Space Cruiser, theTransient, Illia Dulskyi, Thomas Belote, Spencer Kim, Pieter, John Detwiler, Fred von Graf, Michael Davis, Swaroop Kallakuri, subjectnull, Clay Pascal, Subspace Studios, Chris Smitley, Enrico Ros, usrbinkat, Steven Wood, alfie_i, David Ziegler, Willem Michiel, Matthew Berman, Andrey, Pyrater, Jeffrey Morgan, vamX, LangChain4j, Luke @flexchar, Trenton Dambrowitz, Pierre Kircher, Alex, Sam, James Bentley, Edmond Seymore, Eugene Pentland, Pedro Madruga, Rainer Wilmers, Dan Guido, Nathan LeClaire, Spiking Neurons AB, Talal Aujan, zynix, Artur Olbinski, Michael Levine, 阿明, K, John Villwock, Nikolai Manek, Femi Adebogun, senxiiz, Deo Leter, NimbleBox.ai, Viktor Bowallius, Geoffrey Montalvo, Mandus, Ajan Kanaga, ya boyyy, Jonathan Leane, webtim, Brandon Frisco, danny, Alexandros Triantafyllidis, Gabriel Tamborski, Randy H, terasurfer, Vadim, Junyu Yang, Vitor Caleffi, Chadd, transmissions 11
|
244 |
+
|
245 |
+
|
246 |
+
Thank you to all my generous patrons and donaters!
|
247 |
+
|
248 |
+
And thank you again to a16z for their generous grant.
|
249 |
+
|
250 |
+
<!-- footer end -->
|
251 |
+
|
252 |
+
# Original model card: Pankaj Mathur's Model 007 70B
|
253 |
+
|
254 |
+
|
255 |
+
|
256 |
+
# model_007
|
257 |
+
|
258 |
+
A hybrid (explain + instruct) style Llama2-70b model, Pleae check examples below for both style prompts, Here is the list of datasets used:
|
259 |
+
|
260 |
+
* Open-Platypus
|
261 |
+
* Alpaca
|
262 |
+
* WizardLM
|
263 |
+
* Dolly-V2
|
264 |
+
* Dolphin Samples (~200K)
|
265 |
+
* Orca_minis_v1
|
266 |
+
* Alpaca_orca
|
267 |
+
* WizardLM_orca
|
268 |
+
* Dolly-V2_orca
|
269 |
+
|
270 |
+
|
271 |
+
<br>
|
272 |
+
|
273 |
+
**P.S. If you're interested to collaborate, please connect with me at www.linkedin.com/in/pankajam.**
|
274 |
+
|
275 |
+
<br>
|
276 |
+
|
277 |
+
|
278 |
+
|
279 |
+
### quantized versions
|
280 |
+
|
281 |
+
|
282 |
+
<br>
|
283 |
+
|
284 |
+
#### license disclaimer:
|
285 |
+
|
286 |
+
This model is bound by the license & usage restrictions of the original Llama-2 model. And comes with no warranty or gurantees of any kind.
|
287 |
+
|
288 |
+
<br>
|
289 |
+
|
290 |
+
## Evaluation
|
291 |
+
|
292 |
+
We evaluated model_007 on a wide range of tasks using [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) from EleutherAI.
|
293 |
+
|
294 |
+
Here are the results on metrics used by [HuggingFaceH4 Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
295 |
+
|
296 |
+
|||||
|
297 |
+
|:------:|:--------:|:-------:|:--------:|
|
298 |
+
|**Task**|**Metric**|**Value**|**Stderr**|
|
299 |
+
|*arc_challenge*|acc_norm|0.6314|0.0141|
|
300 |
+
|*hellaswag*|acc_norm|0.8242|0.0038|
|
301 |
+
|*mmlu*|acc_norm|0.5637|0.0351|
|
302 |
+
|*truthfulqa_mc*|mc2|0.5127|0.0157|
|
303 |
+
|**Total Average**|-|**0.6329877193**||
|
304 |
+
|
305 |
+
|
306 |
+
<br>
|
307 |
+
|
308 |
+
## Example Usage
|
309 |
+
|
310 |
+
Here is the Orca prompt format
|
311 |
+
|
312 |
+
```
|
313 |
+
### System:
|
314 |
+
You are an AI assistant that follows instruction extremely well. Help as much as you can.
|
315 |
+
|
316 |
+
### User:
|
317 |
+
Tell me about Orcas.
|
318 |
+
|
319 |
+
### Assistant:
|
320 |
+
|
321 |
+
```
|
322 |
+
|
323 |
+
Below shows a code example on how to use this model
|
324 |
+
|
325 |
+
```python
|
326 |
+
import torch
|
327 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
328 |
+
|
329 |
+
tokenizer = AutoTokenizer.from_pretrained("psmathur/model_007")
|
330 |
+
model = AutoModelForCausalLM.from_pretrained(
|
331 |
+
"psmathur/model_007",
|
332 |
+
torch_dtype=torch.float16,
|
333 |
+
load_in_8bit=True,
|
334 |
+
low_cpu_mem_usage=True,
|
335 |
+
device_map="auto"
|
336 |
+
)
|
337 |
+
system_prompt = "### System:\nYou are an AI assistant that follows instruction extremely well. Help as much as you can.\n\n"
|
338 |
+
|
339 |
+
#generate text steps
|
340 |
+
instruction = "Tell me about Orcas."
|
341 |
+
prompt = f"{system_prompt}### User: {instruction}\n\n### Assistant:\n"
|
342 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
343 |
+
output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=4096)
|
344 |
+
|
345 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
346 |
+
|
347 |
+
```
|
348 |
+
|
349 |
+
|
350 |
+
Here is the Alpaca prompt format
|
351 |
+
|
352 |
+
```
|
353 |
+
|
354 |
+
### User:
|
355 |
+
Tell me about Alpacas.
|
356 |
+
|
357 |
+
### Assistant:
|
358 |
+
|
359 |
+
```
|
360 |
+
|
361 |
+
Below shows a code example on how to use this model
|
362 |
+
|
363 |
+
```python
|
364 |
+
import torch
|
365 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
366 |
+
|
367 |
+
tokenizer = AutoTokenizer.from_pretrained("psmathur/model_007")
|
368 |
+
model = AutoModelForCausalLM.from_pretrained(
|
369 |
+
"psmathur/model_007",
|
370 |
+
torch_dtype=torch.float16,
|
371 |
+
load_in_8bit=True,
|
372 |
+
low_cpu_mem_usage=True,
|
373 |
+
device_map="auto"
|
374 |
+
)
|
375 |
+
#generate text steps
|
376 |
+
instruction = "Tell me about Alpacas."
|
377 |
+
prompt = f"### User: {instruction}\n\n### Assistant:\n"
|
378 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
379 |
+
output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=4096)
|
380 |
+
|
381 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
382 |
+
|
383 |
+
```
|
384 |
+
|
385 |
+
<br>
|
386 |
+
|
387 |
+
#### Limitations & Biases:
|
388 |
+
|
389 |
+
While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
|
390 |
+
|
391 |
+
Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content.
|
392 |
+
|
393 |
+
Exercise caution and cross-check information when necessary.
|
394 |
+
|
395 |
+
|
396 |
+
<br>
|
397 |
+
|
398 |
+
### Citiation:
|
399 |
+
|
400 |
+
Please kindly cite using the following BibTeX:
|
401 |
+
|
402 |
+
```
|
403 |
+
@misc{model_007,
|
404 |
+
author = {Pankaj Mathur},
|
405 |
+
title = {model_007: A hybrid (explain + instruct) style Llama2-70b model},
|
406 |
+
year = {2023},
|
407 |
+
publisher = {HuggingFace},
|
408 |
+
journal = {HuggingFace repository},
|
409 |
+
howpublished = {\url{https://https://huggingface.co/psmathur/model_007},
|
410 |
+
}
|
411 |
+
```
|
412 |
+
|
413 |
+
```
|
414 |
+
@misc{mukherjee2023orca,
|
415 |
+
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
|
416 |
+
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
|
417 |
+
year={2023},
|
418 |
+
eprint={2306.02707},
|
419 |
+
archivePrefix={arXiv},
|
420 |
+
primaryClass={cs.CL}
|
421 |
+
}
|
422 |
+
```
|
423 |
+
|
424 |
+
```
|
425 |
+
@software{touvron2023llama2,
|
426 |
+
title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
|
427 |
+
author={Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava,
|
428 |
+
Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller,
|
429 |
+
Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez Madian Khabsa, Isabel Kloumann,
|
430 |
+
Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov,
|
431 |
+
Pushkar Mishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith,
|
432 |
+
Ranjan Subramanian, Xiaoqing Ellen Tan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu , Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan,
|
433 |
+
Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, Thomas Scialom},
|
434 |
+
year={2023}
|
435 |
+
}
|
436 |
+
```
|