TheBloke commited on
Commit
0b63f8f
1 Parent(s): 016c578

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +398 -0
README.md ADDED
@@ -0,0 +1,398 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: lizpreciatior/lzlv_70b_fp16_hf
3
+ inference: false
4
+ license: cc-by-nc-2.0
5
+ model_creator: A Guy
6
+ model_name: Lzlv 70B
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
+ ---
22
+ <!-- markdownlint-disable MD041 -->
23
+
24
+ <!-- header start -->
25
+ <!-- 200823 -->
26
+ <div style="width: auto; margin-left: auto; margin-right: auto">
27
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
28
+ </div>
29
+ <div style="display: flex; justify-content: space-between; width: 100%;">
30
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
31
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
32
+ </div>
33
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
34
+ <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>
35
+ </div>
36
+ </div>
37
+ <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>
38
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
39
+ <!-- header end -->
40
+
41
+ # Lzlv 70B - AWQ
42
+ - Model creator: [A Guy](https://huggingface.co/lizpreciatior)
43
+ - Original model: [Lzlv 70B](https://huggingface.co/lizpreciatior/lzlv_70b_fp16_hf)
44
+
45
+ <!-- description start -->
46
+ ## Description
47
+
48
+ This repo contains AWQ model files for [A Guy's Lzlv 70B](https://huggingface.co/lizpreciatior/lzlv_70b_fp16_hf).
49
+
50
+
51
+ ### About AWQ
52
+
53
+ 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.
54
+
55
+ It is supported by:
56
+
57
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
58
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
59
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
60
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
61
+
62
+ <!-- description end -->
63
+ <!-- repositories-available start -->
64
+ ## Repositories available
65
+
66
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/lzlv_70B-AWQ)
67
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/lzlv_70B-GPTQ)
68
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/lzlv_70B-GGUF)
69
+ * [A Guy's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/lizpreciatior/lzlv_70b_fp16_hf)
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-2.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: [A Guy's Lzlv 70B](https://huggingface.co/lizpreciatior/lzlv_70b_fp16_hf).
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/lzlv_70B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 36.61 GB
105
+
106
+ <!-- README_AWQ.md-provided-files end -->
107
+
108
+ <!-- README_AWQ.md-text-generation-webui start -->
109
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
110
+
111
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
112
+
113
+ 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.
114
+
115
+ 1. Click the **Model tab**.
116
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/lzlv_70B-AWQ`.
117
+ 3. Click **Download**.
118
+ 4. The model will start downloading. Once it's finished it will say "Done".
119
+ 5. In the top left, click the refresh icon next to **Model**.
120
+ 6. In the **Model** dropdown, choose the model you just downloaded: `lzlv_70B-AWQ`
121
+ 7. Select **Loader: AutoAWQ**.
122
+ 8. Click Load, and the model will load and is now ready for use.
123
+ 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.
124
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
125
+ <!-- README_AWQ.md-text-generation-webui end -->
126
+
127
+ <!-- README_AWQ.md-use-from-vllm start -->
128
+ ## Multi-user inference server: vLLM
129
+
130
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
131
+
132
+ - Please ensure you are using vLLM version 0.2 or later.
133
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
134
+
135
+ For example:
136
+
137
+ ```shell
138
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/lzlv_70B-AWQ --quantization awq
139
+ ```
140
+
141
+ - When using vLLM from Python code, again set `quantization=awq`.
142
+
143
+ For example:
144
+
145
+ ```python
146
+ from vllm import LLM, SamplingParams
147
+
148
+ prompts = [
149
+ "Tell me about AI",
150
+ "Write a story about llamas",
151
+ "What is 291 - 150?",
152
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
153
+ ]
154
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
155
+
156
+ ### Instruction:
157
+ {prompt}
158
+
159
+ ### Response:
160
+ '''
161
+
162
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
163
+
164
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
165
+
166
+ llm = LLM(model="TheBloke/lzlv_70B-AWQ", quantization="awq", dtype="auto")
167
+
168
+ outputs = llm.generate(prompts, sampling_params)
169
+
170
+ # Print the outputs.
171
+ for output in outputs:
172
+ prompt = output.prompt
173
+ generated_text = output.outputs[0].text
174
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
175
+ ```
176
+ <!-- README_AWQ.md-use-from-vllm start -->
177
+
178
+ <!-- README_AWQ.md-use-from-tgi start -->
179
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
180
+
181
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
182
+
183
+ Example Docker parameters:
184
+
185
+ ```shell
186
+ --model-id TheBloke/lzlv_70B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
187
+ ```
188
+
189
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
190
+
191
+ ```shell
192
+ pip3 install huggingface-hub
193
+ ```
194
+
195
+ ```python
196
+ from huggingface_hub import InferenceClient
197
+
198
+ endpoint_url = "https://your-endpoint-url-here"
199
+
200
+ prompt = "Tell me about AI"
201
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
202
+
203
+ ### Instruction:
204
+ {prompt}
205
+
206
+ ### Response:
207
+ '''
208
+
209
+ client = InferenceClient(endpoint_url)
210
+ response = client.text_generation(prompt,
211
+ max_new_tokens=128,
212
+ do_sample=True,
213
+ temperature=0.7,
214
+ top_p=0.95,
215
+ top_k=40,
216
+ repetition_penalty=1.1)
217
+
218
+ print(f"Model output: ", response)
219
+ ```
220
+ <!-- README_AWQ.md-use-from-tgi end -->
221
+
222
+ <!-- README_AWQ.md-use-from-python start -->
223
+ ## Inference from Python code using AutoAWQ
224
+
225
+ ### Install the AutoAWQ package
226
+
227
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later.
228
+
229
+ ```shell
230
+ pip3 install autoawq
231
+ ```
232
+
233
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
234
+
235
+ ```shell
236
+ pip3 uninstall -y autoawq
237
+ git clone https://github.com/casper-hansen/AutoAWQ
238
+ cd AutoAWQ
239
+ pip3 install .
240
+ ```
241
+
242
+ ### AutoAWQ example code
243
+
244
+ ```python
245
+ from awq import AutoAWQForCausalLM
246
+ from transformers import AutoTokenizer
247
+
248
+ model_name_or_path = "TheBloke/lzlv_70B-AWQ"
249
+
250
+ # Load tokenizer
251
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
252
+ # Load model
253
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
254
+ trust_remote_code=False, safetensors=True)
255
+
256
+ prompt = "Tell me about AI"
257
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
258
+
259
+ ### Instruction:
260
+ {prompt}
261
+
262
+ ### Response:
263
+ '''
264
+
265
+ print("*** Running model.generate:")
266
+
267
+ token_input = tokenizer(
268
+ prompt_template,
269
+ return_tensors='pt'
270
+ ).input_ids.cuda()
271
+
272
+ # Generate output
273
+ generation_output = model.generate(
274
+ token_input,
275
+ do_sample=True,
276
+ temperature=0.7,
277
+ top_p=0.95,
278
+ top_k=40,
279
+ max_new_tokens=512
280
+ )
281
+
282
+ # Get the tokens from the output, decode them, print them
283
+ token_output = generation_output[0]
284
+ text_output = tokenizer.decode(token_output)
285
+ print("LLM output: ", text_output)
286
+
287
+ """
288
+ # Inference should be possible with transformers pipeline as well in future
289
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
290
+ from transformers import pipeline
291
+
292
+ print("*** Pipeline:")
293
+ pipe = pipeline(
294
+ "text-generation",
295
+ model=model,
296
+ tokenizer=tokenizer,
297
+ max_new_tokens=512,
298
+ do_sample=True,
299
+ temperature=0.7,
300
+ top_p=0.95,
301
+ top_k=40,
302
+ repetition_penalty=1.1
303
+ )
304
+
305
+ print(pipe(prompt_template)[0]['generated_text'])
306
+ """
307
+ ```
308
+ <!-- README_AWQ.md-use-from-python end -->
309
+
310
+ <!-- README_AWQ.md-compatibility start -->
311
+ ## Compatibility
312
+
313
+ The files provided are tested to work with:
314
+
315
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
316
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
317
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
318
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
319
+
320
+ <!-- README_AWQ.md-compatibility end -->
321
+
322
+ <!-- footer start -->
323
+ <!-- 200823 -->
324
+ ## Discord
325
+
326
+ For further support, and discussions on these models and AI in general, join us at:
327
+
328
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
329
+
330
+ ## Thanks, and how to contribute
331
+
332
+ Thanks to the [chirper.ai](https://chirper.ai) team!
333
+
334
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
335
+
336
+ 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.
337
+
338
+ 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.
339
+
340
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
341
+
342
+ * Patreon: https://patreon.com/TheBlokeAI
343
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
344
+
345
+ **Special thanks to**: Aemon Algiz.
346
+
347
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
348
+
349
+
350
+ Thank you to all my generous patrons and donaters!
351
+
352
+ And thank you again to a16z for their generous grant.
353
+
354
+ <!-- footer end -->
355
+
356
+ # Original model card: A Guy's Lzlv 70B
357
+
358
+
359
+
360
+ # lzlv_70B
361
+ ## A Mythomax/MLewd_13B-style merge of selected 70B models
362
+
363
+ A multi-model merge of several LLaMA2 70B finetunes for roleplaying and creative work. The goal was to create a model that combines creativity with intelligence for an enhanced experience.
364
+
365
+ Did it work? Probably, maybe. It seemed subjectively better than each of the individual models in my tests.
366
+
367
+
368
+
369
+ GGUF 4_K_M + 5_K_M can be found here: https://huggingface.co/lizpreciatior/lzlv_70b_fp16_hf/settings
370
+
371
+
372
+ ## Procedure:
373
+
374
+ Models used:
375
+ - **NousResearch/Nous-Hermes-Llama2-70b** - A great model for roleplaying, but not the best at following complex instructions.
376
+ - **Xwin-LM/Xwin-LM-7B-V0.1** - Excellent at following instructions and quite creative out of the box, so it seemed like the best available model to act as the base for the merge.
377
+ - **Doctor-Shotgun/Mythospice-70b** - The wildcard of the three. I was looking for a creative, NSFW-oriented model and came across this while digging through hf. I hadn't heard of it before and apparently no one had bothered to release a quantized version of this model. So I downloaded it and did it myself to test it. It turned out to be more or less what I was looking for as my third component, so I used it here.
378
+
379
+ A big thank you to the creators of the models above. If you look up Mythospice, you will notice that it also includes Nous-Hermes so it's technically present twice in this mix. This is apparently common practice amongst the cool kids who do 13B models so I don't think this hurts the model.
380
+
381
+
382
+ The merging process was heavily inspired by Undi95's approach in Undi95/MXLewdMini-L2-13B. To be specific, the ratios are:
383
+
384
+ Component 1: Merge of Mythospice x Xwin with SLERP gradient [0.25, 0.3, 0.5].
385
+ Component 2: Merge Xwin x Hermes with SLERP gradient [0.4, 0.3, 0.25].
386
+
387
+ Finally, both Component 1 and Component 2 were merged with SLERP using weight 0.5.
388
+
389
+ ## Peformance
390
+
391
+ I tested this model for a few days before publishing it. It seems to more or less retain the instruction-following capabilities of Xwin-70B, while seeming to have adopted a lot of the creativity of the other two models.
392
+ It handled my more complex scenarios that creative models otherwise tend to struggle with quite well. At the same time, its outputs felt more creative and possibly a bit more nsfw-inclined than Xwin-70b.
393
+ So, is it better? Feels like it to me, subjectively. Is it really better? No clue, test it.
394
+
395
+ ## Prompt format:
396
+ Vicuna
397
+ USER: [Prompt]
398
+ ASSISTANT: