TheBloke commited on
Commit
ee605f7
1 Parent(s): 396be0e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +303 -0
README.md ADDED
@@ -0,0 +1,303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/Gryphe/MythoMax-L2-13b
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: other
7
+ model_creator: Gryphe
8
+ model_name: MythoMax L2 13B
9
+ model_type: llama
10
+ prompt_template: '```
11
+
12
+ {system_message}
13
+
14
+
15
+ ### Instruction:
16
+
17
+ {prompt}
18
+
19
+ (For roleplay purposes, I suggest the following - Write <CHAR NAME>''s next reply
20
+ in a chat between <YOUR NAME> and <CHAR NAME>. Write a single reply only.)
21
+
22
+
23
+ ### Response:
24
+
25
+
26
+ ```
27
+
28
+ '
29
+ quantized_by: TheBloke
30
+ ---
31
+
32
+ <!-- header start -->
33
+ <!-- 200823 -->
34
+ <div style="width: auto; margin-left: auto; margin-right: auto">
35
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
36
+ </div>
37
+ <div style="display: flex; justify-content: space-between; width: 100%;">
38
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
39
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
40
+ </div>
41
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
42
+ <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>
43
+ </div>
44
+ </div>
45
+ <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>
46
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
47
+ <!-- header end -->
48
+
49
+ # MythoMax L2 13B - AWQ
50
+ - Model creator: [Gryphe](https://huggingface.co/Gryphe)
51
+ - Original model: [MythoMax L2 13B](https://huggingface.co/Gryphe/MythoMax-L2-13b)
52
+
53
+ <!-- description start -->
54
+ ## Description
55
+
56
+ This repo contains AWQ model files for [Gryphe's MythoMax L2 13B](https://huggingface.co/Gryphe/MythoMax-L2-13b).
57
+
58
+
59
+ ### About AWQ
60
+
61
+ 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.
62
+
63
+ 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.
64
+ <!-- description end -->
65
+ <!-- repositories-available start -->
66
+ ## Repositories available
67
+
68
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/MythoMax-L2-13B-AWQ)
69
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/MythoMax-L2-13B-GPTQ)
70
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/MythoMax-L2-13B-GGUF)
71
+ * [Gryphe's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Gryphe/MythoMax-L2-13b)
72
+ <!-- repositories-available end -->
73
+
74
+ <!-- prompt-template start -->
75
+ ## Prompt template: Custom
76
+
77
+ ```
78
+ {system_message}
79
+
80
+ ### Instruction:
81
+ {prompt}
82
+ (For roleplay purposes, I suggest the following - Write <CHAR NAME>'s next reply in a chat between <YOUR NAME> and <CHAR NAME>. Write a single reply only.)
83
+
84
+ ### Response:
85
+
86
+ ```
87
+
88
+
89
+ <!-- prompt-template end -->
90
+ <!-- licensing start -->
91
+ ## Licensing
92
+
93
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
94
+
95
+ 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.
96
+
97
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Gryphe's MythoMax L2 13B](https://huggingface.co/Gryphe/MythoMax-L2-13b).
98
+ <!-- licensing end -->
99
+ <!-- README_AWQ.md-provided-files start -->
100
+ ## Provided files and AWQ parameters
101
+
102
+ 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.
103
+
104
+ Models are released as sharded safetensors files.
105
+
106
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
107
+ | ------ | ---- | -- | ----------- | ------- | ---- |
108
+ | [main](https://huggingface.co/TheBloke/MythoMax-L2-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
109
+
110
+ <!-- README_AWQ.md-provided-files end -->
111
+
112
+ <!-- README_AWQ.md-use-from-vllm start -->
113
+ ## Serving this model from vLLM
114
+
115
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
116
+
117
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
118
+
119
+ ```shell
120
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/MythoMax-L2-13B-AWQ --quantization awq
121
+ ```
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/MythoMax-L2-13B-AWQ", quantization="awq")
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
+ ## How to use this AWQ model from Python code
150
+
151
+ ### Install the necessary packages
152
+
153
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
154
+
155
+ ```shell
156
+ pip3 install autoawq
157
+ ```
158
+
159
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
160
+
161
+ ```shell
162
+ pip3 uninstall -y autoawq
163
+ git clone https://github.com/casper-hansen/AutoAWQ
164
+ cd AutoAWQ
165
+ pip3 install .
166
+ ```
167
+
168
+ ### You can then try the following example code
169
+
170
+ ```python
171
+ from awq import AutoAWQForCausalLM
172
+ from transformers import AutoTokenizer
173
+
174
+ model_name_or_path = "TheBloke/MythoMax-L2-13B-AWQ"
175
+
176
+ # Load model
177
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
178
+ trust_remote_code=False, safetensors=True)
179
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
180
+
181
+ prompt = "Tell me about AI"
182
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
183
+
184
+ ### Instruction:
185
+ {prompt}
186
+
187
+ ### Response:
188
+
189
+ '''
190
+
191
+ print("\n\n*** Generate:")
192
+
193
+ tokens = tokenizer(
194
+ prompt_template,
195
+ return_tensors='pt'
196
+ ).input_ids.cuda()
197
+
198
+ # Generate output
199
+ generation_output = model.generate(
200
+ tokens,
201
+ do_sample=True,
202
+ temperature=0.7,
203
+ top_p=0.95,
204
+ top_k=40,
205
+ max_new_tokens=512
206
+ )
207
+
208
+ print("Output: ", tokenizer.decode(generation_output[0]))
209
+
210
+ # Inference can also be done using transformers' pipeline
211
+ from transformers import pipeline
212
+
213
+ print("*** Pipeline:")
214
+ pipe = pipeline(
215
+ "text-generation",
216
+ model=model,
217
+ tokenizer=tokenizer,
218
+ max_new_tokens=512,
219
+ do_sample=True,
220
+ temperature=0.7,
221
+ top_p=0.95,
222
+ top_k=40,
223
+ repetition_penalty=1.1
224
+ )
225
+
226
+ print(pipe(prompt_template)[0]['generated_text'])
227
+ ```
228
+ <!-- README_AWQ.md-use-from-python end -->
229
+
230
+ <!-- README_AWQ.md-compatibility start -->
231
+ ## Compatibility
232
+
233
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
234
+
235
+ [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).
236
+ <!-- README_AWQ.md-compatibility end -->
237
+
238
+ <!-- footer start -->
239
+ <!-- 200823 -->
240
+ ## Discord
241
+
242
+ For further support, and discussions on these models and AI in general, join us at:
243
+
244
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
245
+
246
+ ## Thanks, and how to contribute
247
+
248
+ Thanks to the [chirper.ai](https://chirper.ai) team!
249
+
250
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
251
+
252
+ 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.
253
+
254
+ 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.
255
+
256
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
257
+
258
+ * Patreon: https://patreon.com/TheBlokeAI
259
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
260
+
261
+ **Special thanks to**: Aemon Algiz.
262
+
263
+ **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
264
+
265
+
266
+ Thank you to all my generous patrons and donaters!
267
+
268
+ And thank you again to a16z for their generous grant.
269
+
270
+ <!-- footer end -->
271
+
272
+ # Original model card: Gryphe's MythoMax L2 13B
273
+
274
+ An improved, potentially even perfected variant of MythoMix, my [MythoLogic-L2](https://huggingface.co/Gryphe/MythoLogic-L2-13b) and [Huginn](https://huggingface.co/The-Face-Of-Goonery/Huginn-13b-FP16) merge using a highly experimental tensor type merge technique. The main difference with MythoMix is that I allowed more of Huginn to intermingle with the single tensors located at the front and end of a model, resulting in increased coherency across the entire structure.
275
+
276
+ The script and the acccompanying templates I used to produce both can [be found here](https://github.com/Gryphe/BlockMerge_Gradient/tree/main/YAML).
277
+
278
+ This model is proficient at both roleplaying and storywriting due to its unique nature.
279
+
280
+ Quantized models are available from TheBloke: [GGML](https://huggingface.co/TheBloke/MythoMax-L2-13B-GGML) - [GPTQ](https://huggingface.co/TheBloke/MythoMax-L2-13B-GPTQ) (You're the best!)
281
+
282
+ ## Model details
283
+
284
+ The idea behind this merge is that each layer is composed of several tensors, which are in turn responsible for specific functions. Using MythoLogic-L2's robust understanding as its input and Huginn's extensive writing capability as its output seems to have resulted in a model that exceeds at both, confirming my theory. (More details to be released at a later time)
285
+
286
+ This type of merge is incapable of being illustrated, as each of its 363 tensors had an unique ratio applied to it. As with my prior merges, gradients were part of these ratios to further finetune its behaviour.
287
+
288
+ ## Prompt Format
289
+
290
+ This model primarily uses Alpaca formatting, so for optimal model performance, use:
291
+ ```
292
+ <System prompt/Character Card>
293
+
294
+ ### Instruction:
295
+ Your instruction or question here.
296
+ For roleplay purposes, I suggest the following - Write <CHAR NAME>'s next reply in a chat between <YOUR NAME> and <CHAR NAME>. Write a single reply only.
297
+
298
+ ### Response:
299
+ ```
300
+
301
+ ---
302
+ license: other
303
+ ---