TheBloke commited on
Commit
26144ce
1 Parent(s): 0c9eef4

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +339 -0
README.md ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Undi95/Emerhyst-20B
3
+ inference: false
4
+ license: cc-by-nc-4.0
5
+ model_creator: Undi
6
+ model_name: Emerhyst 20B
7
+ model_type: llama
8
+ prompt_template: 'Below is an instruction that describes a task. Write a response
9
+ that appropriately completes the request.
10
+
11
+
12
+ ### Instruction:
13
+
14
+ {prompt}
15
+
16
+
17
+ ### Response:
18
+
19
+ '
20
+ quantized_by: TheBloke
21
+ tags:
22
+ - not-for-all-audiences
23
+ - nsfw
24
+ ---
25
+
26
+ <!-- header start -->
27
+ <!-- 200823 -->
28
+ <div style="width: auto; margin-left: auto; margin-right: auto">
29
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
30
+ </div>
31
+ <div style="display: flex; justify-content: space-between; width: 100%;">
32
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
33
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
34
+ </div>
35
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
36
+ <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>
37
+ </div>
38
+ </div>
39
+ <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>
40
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
41
+ <!-- header end -->
42
+
43
+ # Emerhyst 20B - AWQ
44
+ - Model creator: [Undi](https://huggingface.co/Undi95)
45
+ - Original model: [Emerhyst 20B](https://huggingface.co/Undi95/Emerhyst-20B)
46
+
47
+ <!-- description start -->
48
+ ## Description
49
+
50
+ This repo contains AWQ model files for [Undi's Emerhyst 20B](https://huggingface.co/Undi95/Emerhyst-20B).
51
+
52
+
53
+ ### About AWQ
54
+
55
+ 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.
56
+
57
+ It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of Llama AWQ models for high-throughput concurrent inference in multi-user server scenarios.
58
+
59
+ As of September 25th 2023, preliminary Llama-only AWQ support has also been added to [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference).
60
+
61
+ Note that, at the time of writing, overall throughput is still lower than running vLLM or TGI 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.
62
+ <!-- description end -->
63
+ <!-- repositories-available start -->
64
+ ## Repositories available
65
+
66
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Emerhyst-20B-AWQ)
67
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Emerhyst-20B-GPTQ)
68
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Emerhyst-20B-GGUF)
69
+ * [Undi's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Undi95/Emerhyst-20B)
70
+ <!-- repositories-available end -->
71
+
72
+ <!-- prompt-template start -->
73
+ ## Prompt template: Alpaca
74
+
75
+ ```
76
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
77
+
78
+ ### Instruction:
79
+ {prompt}
80
+
81
+ ### Response:
82
+
83
+ ```
84
+
85
+ <!-- prompt-template end -->
86
+ <!-- licensing start -->
87
+ ## Licensing
88
+
89
+ The creator of the source model has listed its license as `cc-by-nc-4.0`, and this quantization has therefore used that same license.
90
+
91
+ As this model is based on Llama 2, it is also subject to the Meta Llama 2 license terms, and the license files for that are additionally included. It should therefore be considered as being claimed to be licensed under both licenses. I contacted Hugging Face for clarification on dual licensing but they do not yet have an official position. Should this change, or should Meta provide any feedback on this situation, I will update this section accordingly.
92
+
93
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Undi's Emerhyst 20B](https://huggingface.co/Undi95/Emerhyst-20B).
94
+ <!-- licensing end -->
95
+ <!-- README_AWQ.md-provided-files start -->
96
+ ## Provided files, and AWQ parameters
97
+
98
+ 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.
99
+
100
+ Models are released as sharded safetensors files.
101
+
102
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
103
+ | ------ | ---- | -- | ----------- | ------- | ---- |
104
+ | [main](https://huggingface.co/TheBloke/Emerhyst-20B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 10.87 GB
105
+
106
+ <!-- README_AWQ.md-provided-files end -->
107
+
108
+ <!-- README_AWQ.md-use-from-vllm start -->
109
+ ## Serving this model from vLLM
110
+
111
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
112
+
113
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
114
+
115
+ ```shell
116
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Emerhyst-20B-AWQ --quantization awq --dtype half
117
+ ```
118
+
119
+ Note: at the time of writing, vLLM has not yet done a new release with support for the `quantization` parameter.
120
+
121
+ If you try the code below and get an error about `quantization` being unrecognised, please install vLLM from Github source.
122
+
123
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
124
+
125
+ ```python
126
+ from vllm import LLM, SamplingParams
127
+
128
+ prompts = [
129
+ "Hello, my name is",
130
+ "The president of the United States is",
131
+ "The capital of France is",
132
+ "The future of AI is",
133
+ ]
134
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
135
+
136
+ llm = LLM(model="TheBloke/Emerhyst-20B-AWQ", quantization="awq", dtype="half")
137
+
138
+ outputs = llm.generate(prompts, sampling_params)
139
+
140
+ # Print the outputs.
141
+ for output in outputs:
142
+ prompt = output.prompt
143
+ generated_text = output.outputs[0].text
144
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
145
+ ```
146
+ <!-- README_AWQ.md-use-from-vllm start -->
147
+
148
+ <!-- README_AWQ.md-use-from-python start -->
149
+ ## Serving this model from TGI
150
+
151
+ TGI merged support for AWQ on September 25th, 2023. At the time of writing you need to use the `:latest` Docker container: `ghcr.io/huggingface/text-generation-inference:latest`
152
+
153
+ Add the parameter `--quantize awq` for AWQ support.
154
+
155
+ Example parameters:
156
+ ```shell
157
+ --model-id TheBloke/Emerhyst-20B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
158
+ ```
159
+
160
+ ## How to use this AWQ model from Python code
161
+
162
+ ### Install the necessary packages
163
+
164
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
165
+
166
+ ```shell
167
+ pip3 install autoawq
168
+ ```
169
+
170
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
171
+
172
+ ```shell
173
+ pip3 uninstall -y autoawq
174
+ git clone https://github.com/casper-hansen/AutoAWQ
175
+ cd AutoAWQ
176
+ pip3 install .
177
+ ```
178
+
179
+ ### You can then try the following example code
180
+
181
+ ```python
182
+ from awq import AutoAWQForCausalLM
183
+ from transformers import AutoTokenizer
184
+
185
+ model_name_or_path = "TheBloke/Emerhyst-20B-AWQ"
186
+
187
+ # Load model
188
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
189
+ trust_remote_code=False, safetensors=True)
190
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
191
+
192
+ prompt = "Tell me about AI"
193
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
194
+
195
+ ### Instruction:
196
+ {prompt}
197
+
198
+ ### Response:
199
+
200
+ '''
201
+
202
+ print("\n\n*** Generate:")
203
+
204
+ tokens = tokenizer(
205
+ prompt_template,
206
+ return_tensors='pt'
207
+ ).input_ids.cuda()
208
+
209
+ # Generate output
210
+ generation_output = model.generate(
211
+ tokens,
212
+ do_sample=True,
213
+ temperature=0.7,
214
+ top_p=0.95,
215
+ top_k=40,
216
+ max_new_tokens=512
217
+ )
218
+
219
+ print("Output: ", tokenizer.decode(generation_output[0]))
220
+
221
+ """
222
+ # Inference should be possible with transformers pipeline as well in future
223
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
224
+ from transformers import pipeline
225
+
226
+ print("*** Pipeline:")
227
+ pipe = pipeline(
228
+ "text-generation",
229
+ model=model,
230
+ tokenizer=tokenizer,
231
+ max_new_tokens=512,
232
+ do_sample=True,
233
+ temperature=0.7,
234
+ top_p=0.95,
235
+ top_k=40,
236
+ repetition_penalty=1.1
237
+ )
238
+
239
+ print(pipe(prompt_template)[0]['generated_text'])
240
+ """
241
+ ```
242
+ <!-- README_AWQ.md-use-from-python end -->
243
+
244
+ <!-- README_AWQ.md-compatibility start -->
245
+ ## Compatibility
246
+
247
+ The files provided are tested to work with:
248
+
249
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ)
250
+ - [vLLM](https://github.com/vllm-project/vllm)
251
+ - [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
252
+
253
+ TGI merged AWQ support on September 25th, 2023: [TGI PR #1054](https://github.com/huggingface/text-generation-inference/pull/1054). Use the `:latest` Docker container until the next TGI release is made.
254
+
255
+ <!-- README_AWQ.md-compatibility end -->
256
+
257
+ <!-- footer start -->
258
+ <!-- 200823 -->
259
+ ## Discord
260
+
261
+ For further support, and discussions on these models and AI in general, join us at:
262
+
263
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
264
+
265
+ ## Thanks, and how to contribute
266
+
267
+ Thanks to the [chirper.ai](https://chirper.ai) team!
268
+
269
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
270
+
271
+ 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.
272
+
273
+ 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.
274
+
275
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
276
+
277
+ * Patreon: https://patreon.com/TheBlokeAI
278
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
279
+
280
+ **Special thanks to**: Aemon Algiz.
281
+
282
+ **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
283
+
284
+
285
+ Thank you to all my generous patrons and donaters!
286
+
287
+ And thank you again to a16z for their generous grant.
288
+
289
+ <!-- footer end -->
290
+
291
+ # Original model card: Undi's Emerhyst 20B
292
+
293
+
294
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63ab1241ad514ca8d1430003/mvc3UyLtqKdLY1wzAdB_O.png)
295
+
296
+ Merge of [Amethyst 13B](https://huggingface.co/Undi95/Amethyst-13B) and [Emerald 13B](https://huggingface.co/Undi95/Emerald-13B).
297
+
298
+ In addition, [LimaRP v3](https://huggingface.co/lemonilia/LimaRP-Llama2-13B-v3-EXPERIMENT) was used, is it recommanded to read the documentation.
299
+
300
+ <!-- description start -->
301
+ ## Description
302
+
303
+ This repo contains fp16 files of Emerhyst-20B.
304
+
305
+ <!-- description end -->
306
+ <!-- description start -->
307
+ ## Models and loras used
308
+
309
+ - PygmalionAI/pygmalion-2-13b
310
+ - Xwin-LM/Xwin-LM-13B-V0.1
311
+ - The-Face-Of-Goonery/Huginn-13b-FP16
312
+ - zattio770/120-Days-of-LORA-v2-13B
313
+ - lemonilia/LimaRP-Llama2-13B-v3-EXPERIMENT
314
+
315
+ <!-- description end -->
316
+ <!-- prompt-template start -->
317
+ ## Prompt template: Alpaca
318
+
319
+ ```
320
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
321
+
322
+ ### Instruction:
323
+ {prompt}
324
+
325
+ ### Response:
326
+
327
+ ```
328
+
329
+ ## LimaRP v3 usage and suggested settings
330
+
331
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63ab1241ad514ca8d1430003/ZC_iP2KkcEcRdgG_iyxYE.png)
332
+
333
+ You can follow these instruction format settings in SillyTavern. Replace tiny with your desired response length:
334
+
335
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63ab1241ad514ca8d1430003/PIn8_HSPTJEMdSEpNVSdm.png)
336
+
337
+ Special thanks to Sushi.
338
+
339
+ If you want to support me, you can [here](https://ko-fi.com/undiai).