TheBloke commited on
Commit
d67a996
1 Parent(s): d2c767e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +375 -0
README.md ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Walmart-the-bag/MysticFusion-13B
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: llama2
7
+ model_creator: wbag
8
+ model_name: MysticFusion 13B
9
+ model_type: llama
10
+ pipeline_tag: text-generation
11
+ prompt_template: "### Instruction: \n{prompt}\n### Response:\n"
12
+ quantized_by: TheBloke
13
+ ---
14
+ <!-- markdownlint-disable MD041 -->
15
+
16
+ <!-- header start -->
17
+ <!-- 200823 -->
18
+ <div style="width: auto; margin-left: auto; margin-right: auto">
19
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
20
+ </div>
21
+ <div style="display: flex; justify-content: space-between; width: 100%;">
22
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
23
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
24
+ </div>
25
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
26
+ <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>
27
+ </div>
28
+ </div>
29
+ <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>
30
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
31
+ <!-- header end -->
32
+
33
+ # MysticFusion 13B - AWQ
34
+ - Model creator: [wbag](https://huggingface.co/Walmart-the-bag)
35
+ - Original model: [MysticFusion 13B](https://huggingface.co/Walmart-the-bag/MysticFusion-13B)
36
+
37
+ <!-- description start -->
38
+ ## Description
39
+
40
+ This repo contains AWQ model files for [wbag's MysticFusion 13B](https://huggingface.co/Walmart-the-bag/MysticFusion-13B).
41
+
42
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
43
+
44
+
45
+ ### About AWQ
46
+
47
+ 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 with equivalent or better quality compared to the most commonly used GPTQ settings.
48
+
49
+ It is supported by:
50
+
51
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
52
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
53
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
54
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
55
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
56
+
57
+ <!-- description end -->
58
+ <!-- repositories-available start -->
59
+ ## Repositories available
60
+
61
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/MysticFusion-13B-AWQ)
62
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/MysticFusion-13B-GPTQ)
63
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/MysticFusion-13B-GGUF)
64
+ * [wbag's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Walmart-the-bag/MysticFusion-13B)
65
+ <!-- repositories-available end -->
66
+
67
+ <!-- prompt-template start -->
68
+ ## Prompt template: Alpaca-Tiefighter
69
+
70
+ ```
71
+ ### Instruction:
72
+ {prompt}
73
+ ### Response:
74
+
75
+ ```
76
+
77
+ <!-- prompt-template end -->
78
+
79
+
80
+ <!-- README_AWQ.md-provided-files start -->
81
+ ## Provided files, and AWQ parameters
82
+
83
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
84
+
85
+ Models are released as sharded safetensors files.
86
+
87
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
88
+ | ------ | ---- | -- | ----------- | ------- | ---- |
89
+ | [main](https://huggingface.co/TheBloke/MysticFusion-13B-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 7.25 GB
90
+
91
+ <!-- README_AWQ.md-provided-files end -->
92
+
93
+ <!-- README_AWQ.md-text-generation-webui start -->
94
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
95
+
96
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
97
+
98
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
99
+
100
+ 1. Click the **Model tab**.
101
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/MysticFusion-13B-AWQ`.
102
+ 3. Click **Download**.
103
+ 4. The model will start downloading. Once it's finished it will say "Done".
104
+ 5. In the top left, click the refresh icon next to **Model**.
105
+ 6. In the **Model** dropdown, choose the model you just downloaded: `MysticFusion-13B-AWQ`
106
+ 7. Select **Loader: AutoAWQ**.
107
+ 8. Click Load, and the model will load and is now ready for use.
108
+ 9. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
109
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
110
+ <!-- README_AWQ.md-text-generation-webui end -->
111
+
112
+ <!-- README_AWQ.md-use-from-vllm start -->
113
+ ## Multi-user inference server: vLLM
114
+
115
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
116
+
117
+ - Please ensure you are using vLLM version 0.2 or later.
118
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
119
+
120
+ For example:
121
+
122
+ ```shell
123
+ python3 -m vllm.entrypoints.api_server --model TheBloke/MysticFusion-13B-AWQ --quantization awq --dtype auto
124
+ ```
125
+
126
+ - When using vLLM from Python code, again set `quantization=awq`.
127
+
128
+ For example:
129
+
130
+ ```python
131
+ from vllm import LLM, SamplingParams
132
+
133
+ prompts = [
134
+ "Tell me about AI",
135
+ "Write a story about llamas",
136
+ "What is 291 - 150?",
137
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
138
+ ]
139
+ prompt_template=f'''### Instruction:
140
+ {prompt}
141
+ ### Response:
142
+ '''
143
+
144
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
145
+
146
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
147
+
148
+ llm = LLM(model="TheBloke/MysticFusion-13B-AWQ", quantization="awq", dtype="auto")
149
+
150
+ outputs = llm.generate(prompts, sampling_params)
151
+
152
+ # Print the outputs.
153
+ for output in outputs:
154
+ prompt = output.prompt
155
+ generated_text = output.outputs[0].text
156
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
157
+ ```
158
+ <!-- README_AWQ.md-use-from-vllm start -->
159
+
160
+ <!-- README_AWQ.md-use-from-tgi start -->
161
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
162
+
163
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
164
+
165
+ Example Docker parameters:
166
+
167
+ ```shell
168
+ --model-id TheBloke/MysticFusion-13B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
169
+ ```
170
+
171
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
172
+
173
+ ```shell
174
+ pip3 install huggingface-hub
175
+ ```
176
+
177
+ ```python
178
+ from huggingface_hub import InferenceClient
179
+
180
+ endpoint_url = "https://your-endpoint-url-here"
181
+
182
+ prompt = "Tell me about AI"
183
+ prompt_template=f'''### Instruction:
184
+ {prompt}
185
+ ### Response:
186
+ '''
187
+
188
+ client = InferenceClient(endpoint_url)
189
+ response = client.text_generation(prompt,
190
+ max_new_tokens=128,
191
+ do_sample=True,
192
+ temperature=0.7,
193
+ top_p=0.95,
194
+ top_k=40,
195
+ repetition_penalty=1.1)
196
+
197
+ print(f"Model output: ", response)
198
+ ```
199
+ <!-- README_AWQ.md-use-from-tgi end -->
200
+
201
+ <!-- README_AWQ.md-use-from-python start -->
202
+ ## Inference from Python code using Transformers
203
+
204
+ ### Install the necessary packages
205
+
206
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
207
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
208
+
209
+ ```shell
210
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
211
+ ```
212
+
213
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
214
+
215
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
216
+
217
+ ```shell
218
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
219
+ ```
220
+
221
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
222
+
223
+ ```shell
224
+ pip3 uninstall -y autoawq
225
+ git clone https://github.com/casper-hansen/AutoAWQ
226
+ cd AutoAWQ
227
+ pip3 install .
228
+ ```
229
+
230
+ ### Transformers example code (requires Transformers 4.35.0 and later)
231
+
232
+ ```python
233
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
234
+
235
+ model_name_or_path = "TheBloke/MysticFusion-13B-AWQ"
236
+
237
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
238
+ model = AutoModelForCausalLM.from_pretrained(
239
+ model_name_or_path,
240
+ low_cpu_mem_usage=True,
241
+ device_map="cuda:0"
242
+ )
243
+
244
+ # Using the text streamer to stream output one token at a time
245
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
246
+
247
+ prompt = "Tell me about AI"
248
+ prompt_template=f'''### Instruction:
249
+ {prompt}
250
+ ### Response:
251
+ '''
252
+
253
+ # Convert prompt to tokens
254
+ tokens = tokenizer(
255
+ prompt_template,
256
+ return_tensors='pt'
257
+ ).input_ids.cuda()
258
+
259
+ generation_params = {
260
+ "do_sample": True,
261
+ "temperature": 0.7,
262
+ "top_p": 0.95,
263
+ "top_k": 40,
264
+ "max_new_tokens": 512,
265
+ "repetition_penalty": 1.1
266
+ }
267
+
268
+ # Generate streamed output, visible one token at a time
269
+ generation_output = model.generate(
270
+ tokens,
271
+ streamer=streamer,
272
+ **generation_params
273
+ )
274
+
275
+ # Generation without a streamer, which will include the prompt in the output
276
+ generation_output = model.generate(
277
+ tokens,
278
+ **generation_params
279
+ )
280
+
281
+ # Get the tokens from the output, decode them, print them
282
+ token_output = generation_output[0]
283
+ text_output = tokenizer.decode(token_output)
284
+ print("model.generate output: ", text_output)
285
+
286
+ # Inference is also possible via Transformers' pipeline
287
+ from transformers import pipeline
288
+
289
+ pipe = pipeline(
290
+ "text-generation",
291
+ model=model,
292
+ tokenizer=tokenizer,
293
+ **generation_params
294
+ )
295
+
296
+ pipe_output = pipe(prompt_template)[0]['generated_text']
297
+ print("pipeline output: ", pipe_output)
298
+
299
+ ```
300
+ <!-- README_AWQ.md-use-from-python end -->
301
+
302
+ <!-- README_AWQ.md-compatibility start -->
303
+ ## Compatibility
304
+
305
+ The files provided are tested to work with:
306
+
307
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
308
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
309
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
310
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
311
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
312
+
313
+ <!-- README_AWQ.md-compatibility end -->
314
+
315
+ <!-- footer start -->
316
+ <!-- 200823 -->
317
+ ## Discord
318
+
319
+ For further support, and discussions on these models and AI in general, join us at:
320
+
321
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
322
+
323
+ ## Thanks, and how to contribute
324
+
325
+ Thanks to the [chirper.ai](https://chirper.ai) team!
326
+
327
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
328
+
329
+ 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.
330
+
331
+ 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.
332
+
333
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
334
+
335
+ * Patreon: https://patreon.com/TheBlokeAI
336
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
337
+
338
+ **Special thanks to**: Aemon Algiz.
339
+
340
+ **Patreon special mentions**: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
341
+
342
+
343
+ Thank you to all my generous patrons and donaters!
344
+
345
+ And thank you again to a16z for their generous grant.
346
+
347
+ <!-- footer end -->
348
+
349
+ # Original model card: wbag's MysticFusion 13B
350
+
351
+
352
+ YAML:
353
+ ```
354
+ models:
355
+ - model: KoboldAI/LLaMA2-13B-Tiefighter
356
+ parameters:
357
+ weight: 0.3
358
+ - model: NeverSleep/Noromaid-13b-v0.1.1
359
+ parameters:
360
+ weight: 0.5
361
+ - model: lmsys/vicuna-13b-v1.5
362
+ parameters:
363
+ weight: 0.2
364
+ merge_method: linear
365
+ dtype: float16
366
+ ```
367
+
368
+ # Prompt Template:
369
+ ### Alpaca
370
+ ```
371
+ ### Instruction:
372
+
373
+ ### Response:
374
+
375
+ ```