TheBloke commited on
Commit
0b0ea68
1 Parent(s): 09b008b

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +416 -0
README.md ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Undi95/Xwin-MLewd-7B-V0.2
3
+ inference: false
4
+ license: cc-by-nc-4.0
5
+ model_creator: Undi
6
+ model_name: Xwin Mlewd 7B V0.2
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
+ tags:
22
+ - not-for-all-audiences
23
+ - nsfw
24
+ ---
25
+ <!-- markdownlint-disable MD041 -->
26
+
27
+ <!-- header start -->
28
+ <!-- 200823 -->
29
+ <div style="width: auto; margin-left: auto; margin-right: auto">
30
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
31
+ </div>
32
+ <div style="display: flex; justify-content: space-between; width: 100%;">
33
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
34
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
35
+ </div>
36
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
37
+ <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>
38
+ </div>
39
+ </div>
40
+ <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>
41
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
42
+ <!-- header end -->
43
+
44
+ # Xwin Mlewd 7B V0.2 - AWQ
45
+ - Model creator: [Undi](https://huggingface.co/Undi95)
46
+ - Original model: [Xwin Mlewd 7B V0.2](https://huggingface.co/Undi95/Xwin-MLewd-7B-V0.2)
47
+
48
+ <!-- description start -->
49
+ ## Description
50
+
51
+ This repo contains AWQ model files for [Undi's Xwin Mlewd 7B V0.2](https://huggingface.co/Undi95/Xwin-MLewd-7B-V0.2).
52
+
53
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
54
+
55
+
56
+ ### About AWQ
57
+
58
+ 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.
59
+
60
+ It is supported by:
61
+
62
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
63
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
64
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
65
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
66
+
67
+ <!-- description end -->
68
+ <!-- repositories-available start -->
69
+ ## Repositories available
70
+
71
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Xwin-MLewd-7B-V0.2-AWQ)
72
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Xwin-MLewd-7B-V0.2-GPTQ)
73
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Xwin-MLewd-7B-V0.2-GGUF)
74
+ * [Undi's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Undi95/Xwin-MLewd-7B-V0.2)
75
+ <!-- repositories-available end -->
76
+
77
+ <!-- prompt-template start -->
78
+ ## Prompt template: Alpaca
79
+
80
+ ```
81
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
82
+
83
+ ### Instruction:
84
+ {prompt}
85
+
86
+ ### Response:
87
+
88
+ ```
89
+
90
+ <!-- prompt-template end -->
91
+ <!-- licensing start -->
92
+ ## Licensing
93
+
94
+ The creator of the source model has listed its license as `cc-by-nc-4.0`, and this quantization has therefore used that same license.
95
+
96
+ 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.
97
+
98
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Undi's Xwin Mlewd 7B V0.2](https://huggingface.co/Undi95/Xwin-MLewd-7B-V0.2).
99
+ <!-- licensing end -->
100
+ <!-- README_AWQ.md-provided-files start -->
101
+ ## Provided files, and AWQ parameters
102
+
103
+ 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.
104
+
105
+ Models are released as sharded safetensors files.
106
+
107
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
108
+ | ------ | ---- | -- | ----------- | ------- | ---- |
109
+ | [main](https://huggingface.co/TheBloke/Xwin-MLewd-7B-V0.2-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.89 GB
110
+
111
+ <!-- README_AWQ.md-provided-files end -->
112
+
113
+ <!-- README_AWQ.md-text-generation-webui start -->
114
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
115
+
116
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
117
+
118
+ 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.
119
+
120
+ 1. Click the **Model tab**.
121
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Xwin-MLewd-7B-V0.2-AWQ`.
122
+ 3. Click **Download**.
123
+ 4. The model will start downloading. Once it's finished it will say "Done".
124
+ 5. In the top left, click the refresh icon next to **Model**.
125
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Xwin-MLewd-7B-V0.2-AWQ`
126
+ 7. Select **Loader: AutoAWQ**.
127
+ 8. Click Load, and the model will load and is now ready for use.
128
+ 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.
129
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
130
+ <!-- README_AWQ.md-text-generation-webui end -->
131
+
132
+ <!-- README_AWQ.md-use-from-vllm start -->
133
+ ## Multi-user inference server: vLLM
134
+
135
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
136
+
137
+ - Please ensure you are using vLLM version 0.2 or later.
138
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
139
+
140
+ For example:
141
+
142
+ ```shell
143
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Xwin-MLewd-7B-V0.2-AWQ --quantization awq
144
+ ```
145
+
146
+ - When using vLLM from Python code, again set `quantization=awq`.
147
+
148
+ For example:
149
+
150
+ ```python
151
+ from vllm import LLM, SamplingParams
152
+
153
+ prompts = [
154
+ "Tell me about AI",
155
+ "Write a story about llamas",
156
+ "What is 291 - 150?",
157
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
158
+ ]
159
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
160
+
161
+ ### Instruction:
162
+ {prompt}
163
+
164
+ ### Response:
165
+ '''
166
+
167
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
168
+
169
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
170
+
171
+ llm = LLM(model="TheBloke/Xwin-MLewd-7B-V0.2-AWQ", quantization="awq", dtype="auto")
172
+
173
+ outputs = llm.generate(prompts, sampling_params)
174
+
175
+ # Print the outputs.
176
+ for output in outputs:
177
+ prompt = output.prompt
178
+ generated_text = output.outputs[0].text
179
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
180
+ ```
181
+ <!-- README_AWQ.md-use-from-vllm start -->
182
+
183
+ <!-- README_AWQ.md-use-from-tgi start -->
184
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
185
+
186
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
187
+
188
+ Example Docker parameters:
189
+
190
+ ```shell
191
+ --model-id TheBloke/Xwin-MLewd-7B-V0.2-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
192
+ ```
193
+
194
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
195
+
196
+ ```shell
197
+ pip3 install huggingface-hub
198
+ ```
199
+
200
+ ```python
201
+ from huggingface_hub import InferenceClient
202
+
203
+ endpoint_url = "https://your-endpoint-url-here"
204
+
205
+ prompt = "Tell me about AI"
206
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
207
+
208
+ ### Instruction:
209
+ {prompt}
210
+
211
+ ### Response:
212
+ '''
213
+
214
+ client = InferenceClient(endpoint_url)
215
+ response = client.text_generation(prompt,
216
+ max_new_tokens=128,
217
+ do_sample=True,
218
+ temperature=0.7,
219
+ top_p=0.95,
220
+ top_k=40,
221
+ repetition_penalty=1.1)
222
+
223
+ print(f"Model output: ", response)
224
+ ```
225
+ <!-- README_AWQ.md-use-from-tgi end -->
226
+
227
+ <!-- README_AWQ.md-use-from-python start -->
228
+ ## Inference from Python code using AutoAWQ
229
+
230
+ ### Install the AutoAWQ package
231
+
232
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later.
233
+
234
+ ```shell
235
+ pip3 install autoawq
236
+ ```
237
+
238
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
239
+
240
+ ```shell
241
+ pip3 uninstall -y autoawq
242
+ git clone https://github.com/casper-hansen/AutoAWQ
243
+ cd AutoAWQ
244
+ pip3 install .
245
+ ```
246
+
247
+ ### AutoAWQ example code
248
+
249
+ ```python
250
+ from awq import AutoAWQForCausalLM
251
+ from transformers import AutoTokenizer
252
+
253
+ model_name_or_path = "TheBloke/Xwin-MLewd-7B-V0.2-AWQ"
254
+
255
+ # Load tokenizer
256
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
257
+ # Load model
258
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
259
+ trust_remote_code=False, safetensors=True)
260
+
261
+ prompt = "Tell me about AI"
262
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
263
+
264
+ ### Instruction:
265
+ {prompt}
266
+
267
+ ### Response:
268
+ '''
269
+
270
+ print("*** Running model.generate:")
271
+
272
+ token_input = tokenizer(
273
+ prompt_template,
274
+ return_tensors='pt'
275
+ ).input_ids.cuda()
276
+
277
+ # Generate output
278
+ generation_output = model.generate(
279
+ token_input,
280
+ do_sample=True,
281
+ temperature=0.7,
282
+ top_p=0.95,
283
+ top_k=40,
284
+ max_new_tokens=512
285
+ )
286
+
287
+ # Get the tokens from the output, decode them, print them
288
+ token_output = generation_output[0]
289
+ text_output = tokenizer.decode(token_output)
290
+ print("LLM output: ", text_output)
291
+
292
+ """
293
+ # Inference should be possible with transformers pipeline as well in future
294
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
295
+ from transformers import pipeline
296
+
297
+ print("*** Pipeline:")
298
+ pipe = pipeline(
299
+ "text-generation",
300
+ model=model,
301
+ tokenizer=tokenizer,
302
+ max_new_tokens=512,
303
+ do_sample=True,
304
+ temperature=0.7,
305
+ top_p=0.95,
306
+ top_k=40,
307
+ repetition_penalty=1.1
308
+ )
309
+
310
+ print(pipe(prompt_template)[0]['generated_text'])
311
+ """
312
+ ```
313
+ <!-- README_AWQ.md-use-from-python end -->
314
+
315
+ <!-- README_AWQ.md-compatibility start -->
316
+ ## Compatibility
317
+
318
+ The files provided are tested to work with:
319
+
320
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
321
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
322
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
323
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
324
+
325
+ <!-- README_AWQ.md-compatibility end -->
326
+
327
+ <!-- footer start -->
328
+ <!-- 200823 -->
329
+ ## Discord
330
+
331
+ For further support, and discussions on these models and AI in general, join us at:
332
+
333
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
334
+
335
+ ## Thanks, and how to contribute
336
+
337
+ Thanks to the [chirper.ai](https://chirper.ai) team!
338
+
339
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
340
+
341
+ 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.
342
+
343
+ 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.
344
+
345
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
346
+
347
+ * Patreon: https://patreon.com/TheBlokeAI
348
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
349
+
350
+ **Special thanks to**: Aemon Algiz.
351
+
352
+ **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
353
+
354
+
355
+ Thank you to all my generous patrons and donaters!
356
+
357
+ And thank you again to a16z for their generous grant.
358
+
359
+ <!-- footer end -->
360
+
361
+ # Original model card: Undi's Xwin Mlewd 7B V0.2
362
+
363
+
364
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63ab1241ad514ca8d1430003/VjlbZcxzuvMjwOjnYddRK.png)
365
+
366
+ THIS MODEL IS MADE FOR LEWD
367
+
368
+ SEXUAL, CRUDE AND KINKY CONTENT IN OUTPUT CAN AND WILL HAPPEN. YOU'RE WARNED
369
+
370
+ This is MLewd applied on [Xwin-LM/Xwin-LM-7B-V0.2](https://huggingface.co/Xwin-LM/Xwin-LM-7B-V0.2)
371
+
372
+ <!-- description start -->
373
+ ## Description
374
+
375
+ This repo contains fp16 files of Xwin-MLewd-7B-V0.2, very hot and lewd model based on Xwin 0.2 7B.
376
+
377
+ <!-- description end -->
378
+ <!-- description start -->
379
+ ## Models and loras used
380
+
381
+ - Undi95/ReMM-S-Light (base/private)
382
+ - Undi95/CreativeEngine
383
+ - Brouz/Slerpeno
384
+ - The-Face-Of-Goonery/Huginn-v3-13b
385
+ - zattio770/120-Days-of-LORA-v2-13B
386
+ - PygmalionAI/pygmalion-2-13b
387
+ - Undi95/StoryTelling
388
+ - TokenBender/sakhi_13B_roleplayer_NSFW_chat_adapter
389
+ - nRuaif/Kimiko-v2-13B
390
+ - The-Face-Of-Goonery/Huginn-13b-FP16
391
+ - lemonilia/LimaRP-Llama2-13B-v3-EXPERIMENT
392
+ - Xwin-LM/Xwin-LM-7B-V0.2
393
+
394
+ <!-- description end -->
395
+ <!-- prompt-template start -->
396
+ ## Prompt template: Alpaca
397
+
398
+ ```
399
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
400
+
401
+ ### Instruction:
402
+ {prompt}
403
+
404
+ ### Response:
405
+
406
+ ```
407
+ ## The secret sauce
408
+
409
+ ```
410
+ Xwin 7B 0.2 with a homemade MLewd LoRA applied at 0.66 weight.
411
+ Since the OG MLewd was 13B, it was my only solution.
412
+ ```
413
+
414
+ Special thanks to Sushi and Shena ♥
415
+
416
+ If you want to support me, you can [here](https://ko-fi.com/undiai).