TheBloke commited on
Commit
034ccc1
1 Parent(s): 087b871

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +325 -0
README.md ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/PygmalionAI/mythalion-13b
3
+ datasets:
4
+ - PygmalionAI/PIPPA
5
+ - Open-Orca/OpenOrca
6
+ - Norquinal/claude_multiround_chat_30k
7
+ - jondurbin/airoboros-gpt4-1.4.1
8
+ - databricks/databricks-dolly-15k
9
+ inference: false
10
+ language:
11
+ - en
12
+ license: llama2
13
+ model_creator: PygmalionAI
14
+ model_name: Mythalion 13B
15
+ model_type: llama
16
+ pipeline_tag: text-generation
17
+ prompt_template: 'Below is an instruction that describes a task. Write a response
18
+ that appropriately completes the request.
19
+
20
+
21
+ ### Instruction:
22
+
23
+ {prompt}
24
+
25
+
26
+ ### Response:
27
+
28
+ '
29
+ quantized_by: TheBloke
30
+ tags:
31
+ - text generation
32
+ - instruct
33
+ thumbnail: null
34
+ ---
35
+
36
+ <!-- header start -->
37
+ <!-- 200823 -->
38
+ <div style="width: auto; margin-left: auto; margin-right: auto">
39
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
40
+ </div>
41
+ <div style="display: flex; justify-content: space-between; width: 100%;">
42
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
43
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
44
+ </div>
45
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
46
+ <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>
47
+ </div>
48
+ </div>
49
+ <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>
50
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
51
+ <!-- header end -->
52
+
53
+ # Mythalion 13B - AWQ
54
+ - Model creator: [PygmalionAI](https://huggingface.co/PygmalionAI)
55
+ - Original model: [Mythalion 13B](https://huggingface.co/PygmalionAI/mythalion-13b)
56
+
57
+ <!-- description start -->
58
+ ## Description
59
+
60
+ This repo contains AWQ model files for [PygmalionAI's Mythalion 13B](https://huggingface.co/PygmalionAI/mythalion-13b).
61
+
62
+
63
+ ### About AWQ
64
+
65
+ 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.
66
+
67
+ 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.
68
+ <!-- description end -->
69
+ <!-- repositories-available start -->
70
+ ## Repositories available
71
+
72
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Mythalion-13B-AWQ)
73
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mythalion-13B-GPTQ)
74
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mythalion-13B-GGUF)
75
+ * [PygmalionAI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/PygmalionAI/mythalion-13b)
76
+ <!-- repositories-available end -->
77
+
78
+ <!-- prompt-template start -->
79
+ ## Prompt template: Alpaca
80
+
81
+ ```
82
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
83
+
84
+ ### Instruction:
85
+ {prompt}
86
+
87
+ ### Response:
88
+
89
+ ```
90
+
91
+ <!-- prompt-template end -->
92
+
93
+
94
+ <!-- README_AWQ.md-provided-files start -->
95
+ ## Provided files and AWQ parameters
96
+
97
+ 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.
98
+
99
+ Models are released as sharded safetensors files.
100
+
101
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
102
+ | ------ | ---- | -- | ----------- | ------- | ---- |
103
+ | [main](https://huggingface.co/TheBloke/Mythalion-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
104
+
105
+ <!-- README_AWQ.md-provided-files end -->
106
+
107
+ <!-- README_AWQ.md-use-from-vllm start -->
108
+ ## Serving this model from vLLM
109
+
110
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
111
+
112
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
113
+
114
+ ```shell
115
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Mythalion-13B-AWQ --quantization awq
116
+ ```
117
+
118
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
119
+
120
+ ```python
121
+ from vllm import LLM, SamplingParams
122
+
123
+ prompts = [
124
+ "Hello, my name is",
125
+ "The president of the United States is",
126
+ "The capital of France is",
127
+ "The future of AI is",
128
+ ]
129
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
130
+
131
+ llm = LLM(model="TheBloke/Mythalion-13B-AWQ", quantization="awq")
132
+
133
+ outputs = llm.generate(prompts, sampling_params)
134
+
135
+ # Print the outputs.
136
+ for output in outputs:
137
+ prompt = output.prompt
138
+ generated_text = output.outputs[0].text
139
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
140
+ ```
141
+ <!-- README_AWQ.md-use-from-vllm start -->
142
+
143
+ <!-- README_AWQ.md-use-from-python start -->
144
+ ## How to use this AWQ model from Python code
145
+
146
+ ### Install the necessary packages
147
+
148
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
149
+
150
+ ```shell
151
+ pip3 install autoawq
152
+ ```
153
+
154
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
155
+
156
+ ```shell
157
+ pip3 uninstall -y autoawq
158
+ git clone https://github.com/casper-hansen/AutoAWQ
159
+ cd AutoAWQ
160
+ pip3 install .
161
+ ```
162
+
163
+ ### You can then try the following example code
164
+
165
+ ```python
166
+ from awq import AutoAWQForCausalLM
167
+ from transformers import AutoTokenizer
168
+
169
+ model_name_or_path = "TheBloke/Mythalion-13B-AWQ"
170
+
171
+ # Load model
172
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
173
+ trust_remote_code=False, safetensors=True)
174
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
175
+
176
+ prompt = "Tell me about AI"
177
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
178
+
179
+ ### Instruction:
180
+ {prompt}
181
+
182
+ ### Response:
183
+
184
+ '''
185
+
186
+ print("\n\n*** Generate:")
187
+
188
+ tokens = tokenizer(
189
+ prompt_template,
190
+ return_tensors='pt'
191
+ ).input_ids.cuda()
192
+
193
+ # Generate output
194
+ generation_output = model.generate(
195
+ tokens,
196
+ do_sample=True,
197
+ temperature=0.7,
198
+ top_p=0.95,
199
+ top_k=40,
200
+ max_new_tokens=512
201
+ )
202
+
203
+ print("Output: ", tokenizer.decode(generation_output[0]))
204
+
205
+ # Inference can also be done using transformers' pipeline
206
+ from transformers import pipeline
207
+
208
+ print("*** Pipeline:")
209
+ pipe = pipeline(
210
+ "text-generation",
211
+ model=model,
212
+ tokenizer=tokenizer,
213
+ max_new_tokens=512,
214
+ do_sample=True,
215
+ temperature=0.7,
216
+ top_p=0.95,
217
+ top_k=40,
218
+ repetition_penalty=1.1
219
+ )
220
+
221
+ print(pipe(prompt_template)[0]['generated_text'])
222
+ ```
223
+ <!-- README_AWQ.md-use-from-python end -->
224
+
225
+ <!-- README_AWQ.md-compatibility start -->
226
+ ## Compatibility
227
+
228
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
229
+
230
+ [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).
231
+ <!-- README_AWQ.md-compatibility end -->
232
+
233
+ <!-- footer start -->
234
+ <!-- 200823 -->
235
+ ## Discord
236
+
237
+ For further support, and discussions on these models and AI in general, join us at:
238
+
239
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
240
+
241
+ ## Thanks, and how to contribute
242
+
243
+ Thanks to the [chirper.ai](https://chirper.ai) team!
244
+
245
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
252
+
253
+ * Patreon: https://patreon.com/TheBlokeAI
254
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
255
+
256
+ **Special thanks to**: Aemon Algiz.
257
+
258
+ **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
259
+
260
+
261
+ Thank you to all my generous patrons and donaters!
262
+
263
+ And thank you again to a16z for their generous grant.
264
+
265
+ <!-- footer end -->
266
+
267
+ # Original model card: PygmalionAI's Mythalion 13B
268
+
269
+ <h1 style="text-align: center">Mythalion 13B</h1>
270
+ <h2 style="text-align: center">A merge of Pygmalion-2 13B and MythoMax 13B</h2>
271
+
272
+ ## Model Details
273
+
274
+ The long-awaited release of our new models based on Llama-2 is finally here. This model was created in
275
+ collaboration with [Gryphe](https://huggingface.co/Gryphe), a mixture of our [Pygmalion-2 13B](https://huggingface.co/PygmalionAI/pygmalion-2-13b)
276
+ and Gryphe's [Mythomax L2 13B](https://huggingface.co/Gryphe/MythoMax-L2-13b).
277
+
278
+ Finer details of the merge are available in [our blogpost](https://pygmalionai.github.io/blog/posts/introducing_pygmalion_2/#mythalion-13b).
279
+ According to our testers, this model seems to outperform MythoMax in RP/Chat. **Please make sure you follow the recommended
280
+ generation settings for SillyTavern [here](https://pygmalionai.github.io/blog/posts/introducing_pygmalion_2/#sillytavern) for
281
+ the best results!**
282
+
283
+ This model is freely available for both commercial and non-commercial use, as per the Llama-2 license.
284
+
285
+
286
+ ## Prompting
287
+
288
+ This model can be prompted using both the Alpaca and [Pygmalion formatting](https://huggingface.co/PygmalionAI/pygmalion-2-13b#prompting).
289
+
290
+ **Alpaca formatting**:
291
+ ```
292
+ ### Instruction:
293
+ <prompt>
294
+
295
+ ### Response:
296
+ <leave a newline blank for model to respond>
297
+ ```
298
+
299
+ **Pygmalion/Metharme formatting**:
300
+ ```
301
+ <|system|>Enter RP mode. Pretend to be {{char}} whose persona follows:
302
+ {{persona}}
303
+
304
+ You shall reply to the user while staying in character, and generate long responses.
305
+ <|user|>Hello!<|model|>{model's response goes here}
306
+
307
+ ```
308
+
309
+
310
+ The model has been trained on prompts using three different roles, which are denoted by the following tokens: `<|system|>`, `<|user|>` and `<|model|>`.
311
+
312
+ The `<|system|>` prompt can be used to inject out-of-channel information behind the scenes, while the `<|user|>` prompt should be used to indicate user input.
313
+ The `<|model|>` token should then be used to indicate that the model should generate a response. These tokens can happen multiple times and be chained up to
314
+ form a conversation history.
315
+
316
+ ## Limitations and biases
317
+
318
+ The intended use-case for this model is fictional writing for entertainment purposes. Any other sort of usage is out of scope.
319
+
320
+ As such, it was **not** fine-tuned to be safe and harmless: the base model _and_ this fine-tune have been trained on data known to contain profanity and texts that are lewd or otherwise offensive. It may produce socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive. Outputs might often be factually wrong or misleading.
321
+
322
+ ## Acknowledgements
323
+ We would like to thank [SpicyChat](https://spicychat.ai/) for sponsoring the training for the [Pygmalion-2 13B](https://huggingface.co/PygmalionAI/pygmalion-2-13b) model.
324
+
325
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)