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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: https://huggingface.co/totally-not-an-llm/EverythingLM-13b-16k
|
3 |
+
datasets:
|
4 |
+
- totally-not-an-llm/EverythingLM-data
|
5 |
+
inference: false
|
6 |
+
license: llama2
|
7 |
+
model_creator: Kai Howard
|
8 |
+
model_name: EverythingLM 13B 16K
|
9 |
+
model_type: llama
|
10 |
+
prompt_template: 'You are a helpful AI assistant.
|
11 |
+
|
12 |
+
|
13 |
+
USER: {prompt}
|
14 |
+
|
15 |
+
ASSISTANT:
|
16 |
+
|
17 |
+
'
|
18 |
+
quantized_by: TheBloke
|
19 |
+
---
|
20 |
+
|
21 |
+
<!-- header start -->
|
22 |
+
<!-- 200823 -->
|
23 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
24 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
25 |
+
</div>
|
26 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
27 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
28 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
29 |
+
</div>
|
30 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
31 |
+
<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>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
<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>
|
35 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
36 |
+
<!-- header end -->
|
37 |
+
|
38 |
+
# EverythingLM 13B 16K - AWQ
|
39 |
+
- Model creator: [Kai Howard](https://huggingface.co/totally-not-an-llm)
|
40 |
+
- Original model: [EverythingLM 13B 16K](https://huggingface.co/totally-not-an-llm/EverythingLM-13b-16k)
|
41 |
+
|
42 |
+
<!-- description start -->
|
43 |
+
## Description
|
44 |
+
|
45 |
+
This repo contains AWQ model files for [Kai Howard's EverythingLM 13B 16K](https://huggingface.co/totally-not-an-llm/EverythingLM-13b-16k).
|
46 |
+
|
47 |
+
|
48 |
+
### About AWQ
|
49 |
+
|
50 |
+
AWQ is an efficient, accurate and blazing-fast low-bit weight quantization method, currently supporting 4-bit quantization. Compared to GPTQ, it offers faster Transformers-based inference.
|
51 |
+
|
52 |
+
It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of AWQ models for high-throughput concurrent inference in multi-user server scenarios. Note that, at the time of writing, overall throughput is still lower than running vLLM with unquantised models, however using AWQ enables using much smaller GPUs which can lead to easier deployment and overall cost savings. For example, a 70B model can be run on 1 x 48GB GPU instead of 2 x 80GB.
|
53 |
+
<!-- description end -->
|
54 |
+
<!-- repositories-available start -->
|
55 |
+
## Repositories available
|
56 |
+
|
57 |
+
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/EverythingLM-13B-16K-AWQ)
|
58 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/EverythingLM-13B-16K-GPTQ)
|
59 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/EverythingLM-13B-16K-GGUF)
|
60 |
+
* [Kai Howard's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/totally-not-an-llm/EverythingLM-13b-16k)
|
61 |
+
<!-- repositories-available end -->
|
62 |
+
|
63 |
+
<!-- prompt-template start -->
|
64 |
+
## Prompt template: Vicuna-Short
|
65 |
+
|
66 |
+
```
|
67 |
+
You are a helpful AI assistant.
|
68 |
+
|
69 |
+
USER: {prompt}
|
70 |
+
ASSISTANT:
|
71 |
+
|
72 |
+
```
|
73 |
+
|
74 |
+
<!-- prompt-template end -->
|
75 |
+
|
76 |
+
|
77 |
+
<!-- README_AWQ.md-provided-files start -->
|
78 |
+
## Provided files and AWQ parameters
|
79 |
+
|
80 |
+
For my first release of AWQ models, I am releasing 128g models only. I will consider adding 32g as well if there is interest, and once I have done perplexity and evaluation comparisons, but at this time 32g models are still not fully tested with AutoAWQ and vLLM.
|
81 |
+
|
82 |
+
Models are released as sharded safetensors files.
|
83 |
+
|
84 |
+
| Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
|
85 |
+
| ------ | ---- | -- | ----------- | ------- | ---- |
|
86 |
+
| [main](https://huggingface.co/TheBloke/EverythingLM-13B-16K-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
|
87 |
+
|
88 |
+
<!-- README_AWQ.md-provided-files end -->
|
89 |
+
|
90 |
+
<!-- README_AWQ.md-use-from-vllm start -->
|
91 |
+
## Serving this model from vLLM
|
92 |
+
|
93 |
+
Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
|
94 |
+
|
95 |
+
- When using vLLM as a server, pass the `--quantization awq` parameter, for example:
|
96 |
+
|
97 |
+
```shell
|
98 |
+
python3 python -m vllm.entrypoints.api_server --model TheBloke/EverythingLM-13B-16K-AWQ --quantization awq
|
99 |
+
```
|
100 |
+
|
101 |
+
When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
|
102 |
+
|
103 |
+
```python
|
104 |
+
from vllm import LLM, SamplingParams
|
105 |
+
|
106 |
+
prompts = [
|
107 |
+
"Hello, my name is",
|
108 |
+
"The president of the United States is",
|
109 |
+
"The capital of France is",
|
110 |
+
"The future of AI is",
|
111 |
+
]
|
112 |
+
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
|
113 |
+
|
114 |
+
llm = LLM(model="TheBloke/EverythingLM-13B-16K-AWQ", quantization="awq")
|
115 |
+
|
116 |
+
outputs = llm.generate(prompts, sampling_params)
|
117 |
+
|
118 |
+
# Print the outputs.
|
119 |
+
for output in outputs:
|
120 |
+
prompt = output.prompt
|
121 |
+
generated_text = output.outputs[0].text
|
122 |
+
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
|
123 |
+
```
|
124 |
+
<!-- README_AWQ.md-use-from-vllm start -->
|
125 |
+
|
126 |
+
<!-- README_AWQ.md-use-from-python start -->
|
127 |
+
## How to use this AWQ model from Python code
|
128 |
+
|
129 |
+
### Install the necessary packages
|
130 |
+
|
131 |
+
Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
|
132 |
+
|
133 |
+
```shell
|
134 |
+
pip3 install autoawq
|
135 |
+
```
|
136 |
+
|
137 |
+
If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
|
138 |
+
|
139 |
+
```shell
|
140 |
+
pip3 uninstall -y autoawq
|
141 |
+
git clone https://github.com/casper-hansen/AutoAWQ
|
142 |
+
cd AutoAWQ
|
143 |
+
pip3 install .
|
144 |
+
```
|
145 |
+
|
146 |
+
### You can then try the following example code
|
147 |
+
|
148 |
+
```python
|
149 |
+
from awq import AutoAWQForCausalLM
|
150 |
+
from transformers import AutoTokenizer
|
151 |
+
|
152 |
+
model_name_or_path = "TheBloke/EverythingLM-13B-16K-AWQ"
|
153 |
+
|
154 |
+
# Load model
|
155 |
+
model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
|
156 |
+
trust_remote_code=False, safetensors=True)
|
157 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
|
158 |
+
|
159 |
+
prompt = "Tell me about AI"
|
160 |
+
prompt_template=f'''You are a helpful AI assistant.
|
161 |
+
|
162 |
+
USER: {prompt}
|
163 |
+
ASSISTANT:
|
164 |
+
|
165 |
+
'''
|
166 |
+
|
167 |
+
print("\n\n*** Generate:")
|
168 |
+
|
169 |
+
tokens = tokenizer(
|
170 |
+
prompt_template,
|
171 |
+
return_tensors='pt'
|
172 |
+
).input_ids.cuda()
|
173 |
+
|
174 |
+
# Generate output
|
175 |
+
generation_output = model.generate(
|
176 |
+
tokens,
|
177 |
+
do_sample=True,
|
178 |
+
temperature=0.7,
|
179 |
+
top_p=0.95,
|
180 |
+
top_k=40,
|
181 |
+
max_new_tokens=512
|
182 |
+
)
|
183 |
+
|
184 |
+
print("Output: ", tokenizer.decode(generation_output[0]))
|
185 |
+
|
186 |
+
# Inference can also be done using transformers' pipeline
|
187 |
+
from transformers import pipeline
|
188 |
+
|
189 |
+
print("*** Pipeline:")
|
190 |
+
pipe = pipeline(
|
191 |
+
"text-generation",
|
192 |
+
model=model,
|
193 |
+
tokenizer=tokenizer,
|
194 |
+
max_new_tokens=512,
|
195 |
+
do_sample=True,
|
196 |
+
temperature=0.7,
|
197 |
+
top_p=0.95,
|
198 |
+
top_k=40,
|
199 |
+
repetition_penalty=1.1
|
200 |
+
)
|
201 |
+
|
202 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
203 |
+
```
|
204 |
+
<!-- README_AWQ.md-use-from-python end -->
|
205 |
+
|
206 |
+
<!-- README_AWQ.md-compatibility start -->
|
207 |
+
## Compatibility
|
208 |
+
|
209 |
+
The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
|
210 |
+
|
211 |
+
[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is not yet compatible with AWQ, but a PR is open which should bring support soon: [TGI PR #781](https://github.com/huggingface/text-generation-inference/issues/781).
|
212 |
+
<!-- README_AWQ.md-compatibility end -->
|
213 |
+
|
214 |
+
<!-- footer start -->
|
215 |
+
<!-- 200823 -->
|
216 |
+
## Discord
|
217 |
+
|
218 |
+
For further support, and discussions on these models and AI in general, join us at:
|
219 |
+
|
220 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
221 |
+
|
222 |
+
## Thanks, and how to contribute
|
223 |
+
|
224 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
225 |
+
|
226 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
227 |
+
|
228 |
+
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.
|
229 |
+
|
230 |
+
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.
|
231 |
+
|
232 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
233 |
+
|
234 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
235 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
236 |
+
|
237 |
+
**Special thanks to**: Aemon Algiz.
|
238 |
+
|
239 |
+
**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
|
240 |
+
|
241 |
+
|
242 |
+
Thank you to all my generous patrons and donaters!
|
243 |
+
|
244 |
+
And thank you again to a16z for their generous grant.
|
245 |
+
|
246 |
+
<!-- footer end -->
|
247 |
+
|
248 |
+
# Original model card: Kai Howard's EverythingLM 13B 16K
|
249 |
+
|
250 |
+
|
251 |
+
# EverythingLM-13b-16k
|
252 |
+
|
253 |
+
Introducing EverythingLM, a llama-2 based, general-purpose 13b model with 16k context thanks to LlongMa. The model is trained on the EverythingLM dataset, more info can be found on the dataset page.
|
254 |
+
|
255 |
+
The model is completely uncensored.
|
256 |
+
|
257 |
+
This model is an early test of the EverythingLM dataset and some new experimental principles, so don't consider it SOTA.
|
258 |
+
|
259 |
+
### GGML quants:
|
260 |
+
https://huggingface.co/TheBloke/EverythingLM-13B-16K-GGML
|
261 |
+
|
262 |
+
Make sure to use correct rope scaling settings:
|
263 |
+
`-c 16384 --rope-freq-base 10000 --rope-freq-scale 0.25`
|
264 |
+
### GPTQ quants:
|
265 |
+
https://huggingface.co/TheBloke/EverythingLM-13B-16K-GPTQ
|
266 |
+
|
267 |
+
### Notable features:
|
268 |
+
- Automatically triggered CoT reasoning.
|
269 |
+
- Verbose and detailed replies.
|
270 |
+
- Creative stories.
|
271 |
+
- Better prompt understanding.
|
272 |
+
|
273 |
+
### Prompt format:
|
274 |
+
It is a modified Vicuna format, the same used in many of ehartford's models.
|
275 |
+
```
|
276 |
+
You are a helpful AI assistant.
|
277 |
+
|
278 |
+
USER: <prompt>
|
279 |
+
ASSISTANT:
|
280 |
+
```
|
281 |
+
|
282 |
+
Training took about 1 hour using QLoRa on 1xA100, so this model can be recreated for about $3. QLoRa model can be found here: https://huggingface.co/totally-not-an-llm/EverythingLM-13b-peft.
|
283 |
+
|
284 |
+
### Model quirks:
|
285 |
+
- Due to the nature of the dataset, it does better with more detail. I've found it gives much better stories when I provide more requirements.
|
286 |
+
- It really likes to use numbered lists. I don't necessarilly have a problem with this but it's something to note when training on the dataset.
|
287 |
+
- It likes to write fairy tales over anything else, which is strange. This can easily be fixed by prompting.
|
288 |
+
- Occasionally it will fall into repetition, this seems to be a commmon issue with llama-2 models.
|
289 |
+
- Haven't tested pushing it all the way to 16k context.
|
290 |
+
|
291 |
+
### Future plans:
|
292 |
+
- Native finetune.
|
293 |
+
- Other model sizes.
|
294 |
+
- Improve dataset by:
|
295 |
+
- Regenerating using gpt-4.
|
296 |
+
- A bit more data with more diversity.
|
297 |
+
- Refactor dataset generation script.
|
298 |
+
- Test some model merges using this model.
|