TheBloke commited on
Commit
379fe6f
1 Parent(s): d542674

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +292 -0
README.md ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/Gryphe/MythoLogic-L2-13b
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: other
7
+ model_creator: Gryphe
8
+ model_name: Mythologic L2 13B
9
+ model_type: llama
10
+ prompt_template: 'Below is an instruction that describes a task. Write a response
11
+ that appropriately completes the request.
12
+
13
+
14
+ ### Instruction:
15
+
16
+ {prompt}
17
+
18
+
19
+ ### Response:
20
+
21
+ '
22
+ quantized_by: TheBloke
23
+ ---
24
+
25
+ <!-- header start -->
26
+ <!-- 200823 -->
27
+ <div style="width: auto; margin-left: auto; margin-right: auto">
28
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
29
+ </div>
30
+ <div style="display: flex; justify-content: space-between; width: 100%;">
31
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
32
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
33
+ </div>
34
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
35
+ <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>
36
+ </div>
37
+ </div>
38
+ <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>
39
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
40
+ <!-- header end -->
41
+
42
+ # Mythologic L2 13B - AWQ
43
+ - Model creator: [Gryphe](https://huggingface.co/Gryphe)
44
+ - Original model: [Mythologic L2 13B](https://huggingface.co/Gryphe/MythoLogic-L2-13b)
45
+
46
+ <!-- description start -->
47
+ ## Description
48
+
49
+ This repo contains AWQ model files for [Gryphe's Mythologic L2 13B](https://huggingface.co/Gryphe/MythoLogic-L2-13b).
50
+
51
+
52
+ ### About AWQ
53
+
54
+ 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.
55
+
56
+ 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.
57
+ <!-- description end -->
58
+ <!-- repositories-available start -->
59
+ ## Repositories available
60
+
61
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/MythoLogic-L2-13B-AWQ)
62
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/MythoLogic-L2-13B-GPTQ)
63
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/MythoLogic-L2-13B-GGUF)
64
+ * [Gryphe's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Gryphe/MythoLogic-L2-13b)
65
+ <!-- repositories-available end -->
66
+
67
+ <!-- prompt-template start -->
68
+ ## Prompt template: Alpaca
69
+
70
+ ```
71
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
72
+
73
+ ### Instruction:
74
+ {prompt}
75
+
76
+ ### Response:
77
+
78
+ ```
79
+
80
+ <!-- prompt-template end -->
81
+ <!-- licensing start -->
82
+ ## Licensing
83
+
84
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
85
+
86
+ 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.
87
+
88
+ 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 Mythologic L2 13B](https://huggingface.co/Gryphe/MythoLogic-L2-13b).
89
+ <!-- licensing end -->
90
+ <!-- README_AWQ.md-provided-files start -->
91
+ ## Provided files and AWQ parameters
92
+
93
+ 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.
94
+
95
+ Models are released as sharded safetensors files.
96
+
97
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
98
+ | ------ | ---- | -- | ----------- | ------- | ---- |
99
+ | [main](https://huggingface.co/TheBloke/MythoLogic-L2-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
100
+
101
+ <!-- README_AWQ.md-provided-files end -->
102
+
103
+ <!-- README_AWQ.md-use-from-vllm start -->
104
+ ## Serving this model from vLLM
105
+
106
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
107
+
108
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
109
+
110
+ ```shell
111
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/MythoLogic-L2-13B-AWQ --quantization awq
112
+ ```
113
+
114
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
115
+
116
+ ```python
117
+ from vllm import LLM, SamplingParams
118
+
119
+ prompts = [
120
+ "Hello, my name is",
121
+ "The president of the United States is",
122
+ "The capital of France is",
123
+ "The future of AI is",
124
+ ]
125
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
126
+
127
+ llm = LLM(model="TheBloke/MythoLogic-L2-13B-AWQ", quantization="awq")
128
+
129
+ outputs = llm.generate(prompts, sampling_params)
130
+
131
+ # Print the outputs.
132
+ for output in outputs:
133
+ prompt = output.prompt
134
+ generated_text = output.outputs[0].text
135
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
136
+ ```
137
+ <!-- README_AWQ.md-use-from-vllm start -->
138
+
139
+ <!-- README_AWQ.md-use-from-python start -->
140
+ ## How to use this AWQ model from Python code
141
+
142
+ ### Install the necessary packages
143
+
144
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
145
+
146
+ ```shell
147
+ pip3 install autoawq
148
+ ```
149
+
150
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
151
+
152
+ ```shell
153
+ pip3 uninstall -y autoawq
154
+ git clone https://github.com/casper-hansen/AutoAWQ
155
+ cd AutoAWQ
156
+ pip3 install .
157
+ ```
158
+
159
+ ### You can then try the following example code
160
+
161
+ ```python
162
+ from awq import AutoAWQForCausalLM
163
+ from transformers import AutoTokenizer
164
+
165
+ model_name_or_path = "TheBloke/MythoLogic-L2-13B-AWQ"
166
+
167
+ # Load model
168
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
169
+ trust_remote_code=False, safetensors=True)
170
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
171
+
172
+ prompt = "Tell me about AI"
173
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
174
+
175
+ ### Instruction:
176
+ {prompt}
177
+
178
+ ### Response:
179
+
180
+ '''
181
+
182
+ print("\n\n*** Generate:")
183
+
184
+ tokens = tokenizer(
185
+ prompt_template,
186
+ return_tensors='pt'
187
+ ).input_ids.cuda()
188
+
189
+ # Generate output
190
+ generation_output = model.generate(
191
+ tokens,
192
+ do_sample=True,
193
+ temperature=0.7,
194
+ top_p=0.95,
195
+ top_k=40,
196
+ max_new_tokens=512
197
+ )
198
+
199
+ print("Output: ", tokenizer.decode(generation_output[0]))
200
+
201
+ # Inference can also be done using transformers' pipeline
202
+ from transformers import pipeline
203
+
204
+ print("*** Pipeline:")
205
+ pipe = pipeline(
206
+ "text-generation",
207
+ model=model,
208
+ tokenizer=tokenizer,
209
+ max_new_tokens=512,
210
+ do_sample=True,
211
+ temperature=0.7,
212
+ top_p=0.95,
213
+ top_k=40,
214
+ repetition_penalty=1.1
215
+ )
216
+
217
+ print(pipe(prompt_template)[0]['generated_text'])
218
+ ```
219
+ <!-- README_AWQ.md-use-from-python end -->
220
+
221
+ <!-- README_AWQ.md-compatibility start -->
222
+ ## Compatibility
223
+
224
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
225
+
226
+ [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).
227
+ <!-- README_AWQ.md-compatibility end -->
228
+
229
+ <!-- footer start -->
230
+ <!-- 200823 -->
231
+ ## Discord
232
+
233
+ For further support, and discussions on these models and AI in general, join us at:
234
+
235
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
236
+
237
+ ## Thanks, and how to contribute
238
+
239
+ Thanks to the [chirper.ai](https://chirper.ai) team!
240
+
241
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
242
+
243
+ 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.
244
+
245
+ 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.
246
+
247
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
248
+
249
+ * Patreon: https://patreon.com/TheBlokeAI
250
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
251
+
252
+ **Special thanks to**: Aemon Algiz.
253
+
254
+ **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
255
+
256
+
257
+ Thank you to all my generous patrons and donaters!
258
+
259
+ And thank you again to a16z for their generous grant.
260
+
261
+ <!-- footer end -->
262
+
263
+ # Original model card: Gryphe's Mythologic L2 13B
264
+
265
+ The Llama 2 sequel to my [original experiment](https://huggingface.co/Gryphe/MythoLogic-13b) with gradient merges using [the following script](https://github.com/Gryphe/BlockMerge_Gradient). Its three models ([Hermes](https://huggingface.co/NousResearch/Nous-Hermes-Llama2-13b), [Chronos](https://huggingface.co/elinas/chronos-13b-v2) and [Airoboros](https://huggingface.co/jondurbin/airoboros-l2-13b-gpt4-2.0)) are almost evenly divided over the layer structure this time. Airoboros was the "wildcard model" due to its superior ability to understand complex instructions.
266
+
267
+ Quantized models are available from TheBloke: [GGML](https://huggingface.co/TheBloke/MythoLogic-L2-13B-GGML) - [GPTQ](https://huggingface.co/TheBloke/MythoLogic-L2-13B-GPTQ) (You're the best!)
268
+
269
+ ## Model details
270
+
271
+ As before, the main objective was to create an all-round model with improved roleplaying capabilities. MythoLogic-L2 differs from its predecessor in that it focuses primarily on the understanding of instructions and personalities of complex character cards.
272
+
273
+ Illustrated below are the gradients used for this specific L2 recipe, with the top of the image representing layer 0 and the bottom layer 40.
274
+
275
+ ![](MythoLogic-L2.png)
276
+
277
+ ## Prompt Format
278
+
279
+ This model primarily uses (and was heavily tested with) Alpaca formatting, so for optimal model performance, use:
280
+ ```
281
+ <System prompt/Character Card>
282
+
283
+ ### Instruction:
284
+ Your instruction or question here.
285
+ 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.
286
+
287
+ ### Response:
288
+ ```
289
+
290
+ ---
291
+ license: other
292
+ ---