TheBloke commited on
Commit
05ab13a
1 Parent(s): 368a5f3

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +408 -0
README.md ADDED
@@ -0,0 +1,408 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: athirdpath/Iambe-Storyteller-20b
3
+ inference: false
4
+ license: cc-by-nc-4.0
5
+ model_creator: Raven
6
+ model_name: Iambe Storyteller 20B
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
+ # Iambe Storyteller 20B - AWQ
42
+ - Model creator: [Raven](https://huggingface.co/athirdpath)
43
+ - Original model: [Iambe Storyteller 20B](https://huggingface.co/athirdpath/Iambe-Storyteller-20b)
44
+
45
+ <!-- description start -->
46
+ ## Description
47
+
48
+ This repo contains AWQ model files for [Raven's Iambe Storyteller 20B](https://huggingface.co/athirdpath/Iambe-Storyteller-20b).
49
+
50
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
51
+
52
+
53
+ ### About AWQ
54
+
55
+ 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.
56
+
57
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
58
+
59
+ It is supported by:
60
+
61
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
62
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
63
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
64
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
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/Iambe-Storyteller-20B-AWQ)
72
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Iambe-Storyteller-20B-GPTQ)
73
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Iambe-Storyteller-20B-GGUF)
74
+ * [Raven's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/athirdpath/Iambe-Storyteller-20b)
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: [Raven's Iambe Storyteller 20B](https://huggingface.co/athirdpath/Iambe-Storyteller-20b).
99
+ <!-- licensing end -->
100
+ <!-- README_AWQ.md-provided-files start -->
101
+ ## Provided files, and AWQ parameters
102
+
103
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
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/Iambe-Storyteller-20B-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 10.87 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/Iambe-Storyteller-20B-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: `Iambe-Storyteller-20B-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 -m vllm.entrypoints.api_server --model TheBloke/Iambe-Storyteller-20B-AWQ --quantization awq --dtype auto
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/Iambe-Storyteller-20B-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/Iambe-Storyteller-20B-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 Transformers
229
+
230
+ ### Install the necessary packages
231
+
232
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
233
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
234
+
235
+ ```shell
236
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
237
+ ```
238
+
239
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
240
+
241
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
242
+
243
+ ```shell
244
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
245
+ ```
246
+
247
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
248
+
249
+ ```shell
250
+ pip3 uninstall -y autoawq
251
+ git clone https://github.com/casper-hansen/AutoAWQ
252
+ cd AutoAWQ
253
+ pip3 install .
254
+ ```
255
+
256
+ ### Transformers example code (requires Transformers 4.35.0 and later)
257
+
258
+ ```python
259
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
260
+
261
+ model_name_or_path = "TheBloke/Iambe-Storyteller-20B-AWQ"
262
+
263
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
264
+ model = AutoModelForCausalLM.from_pretrained(
265
+ model_name_or_path,
266
+ low_cpu_mem_usage=True,
267
+ device_map="cuda:0"
268
+ )
269
+
270
+ # Using the text streamer to stream output one token at a time
271
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
272
+
273
+ prompt = "Tell me about AI"
274
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
275
+
276
+ ### Instruction:
277
+ {prompt}
278
+
279
+ ### Response:
280
+ '''
281
+
282
+ # Convert prompt to tokens
283
+ tokens = tokenizer(
284
+ prompt_template,
285
+ return_tensors='pt'
286
+ ).input_ids.cuda()
287
+
288
+ generation_params = {
289
+ "do_sample": True,
290
+ "temperature": 0.7,
291
+ "top_p": 0.95,
292
+ "top_k": 40,
293
+ "max_new_tokens": 512,
294
+ "repetition_penalty": 1.1
295
+ }
296
+
297
+ # Generate streamed output, visible one token at a time
298
+ generation_output = model.generate(
299
+ tokens,
300
+ streamer=streamer,
301
+ **generation_params
302
+ )
303
+
304
+ # Generation without a streamer, which will include the prompt in the output
305
+ generation_output = model.generate(
306
+ tokens,
307
+ **generation_params
308
+ )
309
+
310
+ # Get the tokens from the output, decode them, print them
311
+ token_output = generation_output[0]
312
+ text_output = tokenizer.decode(token_output)
313
+ print("model.generate output: ", text_output)
314
+
315
+ # Inference is also possible via Transformers' pipeline
316
+ from transformers import pipeline
317
+
318
+ pipe = pipeline(
319
+ "text-generation",
320
+ model=model,
321
+ tokenizer=tokenizer,
322
+ **generation_params
323
+ )
324
+
325
+ pipe_output = pipe(prompt_template)[0]['generated_text']
326
+ print("pipeline output: ", pipe_output)
327
+
328
+ ```
329
+ <!-- README_AWQ.md-use-from-python end -->
330
+
331
+ <!-- README_AWQ.md-compatibility start -->
332
+ ## Compatibility
333
+
334
+ The files provided are tested to work with:
335
+
336
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
337
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
338
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
339
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
340
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
341
+
342
+ <!-- README_AWQ.md-compatibility end -->
343
+
344
+ <!-- footer start -->
345
+ <!-- 200823 -->
346
+ ## Discord
347
+
348
+ For further support, and discussions on these models and AI in general, join us at:
349
+
350
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
351
+
352
+ ## Thanks, and how to contribute
353
+
354
+ Thanks to the [chirper.ai](https://chirper.ai) team!
355
+
356
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
357
+
358
+ 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.
359
+
360
+ 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.
361
+
362
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
363
+
364
+ * Patreon: https://patreon.com/TheBlokeAI
365
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
366
+
367
+ **Special thanks to**: Aemon Algiz.
368
+
369
+ **Patreon special mentions**: Michael Levine, 阿明, Trailburnt, Nikolai Manek, John Detwiler, Randy H, Will Dee, Sebastain Graf, NimbleBox.ai, Eugene Pentland, Emad Mostaque, Ai Maven, Jim Angel, Jeff Scroggin, Michael Davis, Manuel Alberto Morcote, Stephen Murray, Robert, Justin Joy, Luke @flexchar, Brandon Frisco, Elijah Stavena, S_X, Dan Guido, Undi ., Komninos Chatzipapas, Shadi, theTransient, Lone Striker, Raven Klaugh, jjj, Cap'n Zoog, Michel-Marie MAUDET (LINAGORA), Matthew Berman, David, Fen Risland, Omer Bin Jawed, Luke Pendergrass, Kalila, OG, Erik Bjäreholt, Rooh Singh, Joseph William Delisle, Dan Lewis, TL, John Villwock, AzureBlack, Brad, Pedro Madruga, Caitlyn Gatomon, K, jinyuan sun, Mano Prime, Alex, Jeffrey Morgan, Alicia Loh, Illia Dulskyi, Chadd, transmissions 11, fincy, Rainer Wilmers, ReadyPlayerEmma, knownsqashed, Mandus, biorpg, Deo Leter, Brandon Phillips, SuperWojo, Sean Connelly, Iucharbius, Jack West, Harry Royden McLaughlin, Nicholas, terasurfer, Vitor Caleffi, Duane Dunston, Johann-Peter Hartmann, David Ziegler, Olakabola, Ken Nordquist, Trenton Dambrowitz, Tom X Nguyen, Vadim, Ajan Kanaga, Leonard Tan, Clay Pascal, Alexandros Triantafyllidis, JM33133, Xule, vamX, ya boyyy, subjectnull, Talal Aujan, Alps Aficionado, wassieverse, Ari Malik, James Bentley, Woland, Spencer Kim, Michael Dempsey, Fred von Graf, Elle, zynix, William Richards, Stanislav Ovsiannikov, Edmond Seymore, Jonathan Leane, Martin Kemka, usrbinkat, Enrico Ros
370
+
371
+
372
+ Thank you to all my generous patrons and donaters!
373
+
374
+ And thank you again to a16z for their generous grant.
375
+
376
+ <!-- footer end -->
377
+
378
+ # Original model card: Raven's Iambe Storyteller 20B
379
+
380
+ <p align="center"><font size="7"> <b>Dumb assistant, 🔥 author.</b></font></p>
381
+ <p align="center"><font size="5"> <b>4-bit Examples with Alpaca</b></font></p>
382
+ <p align="center"><img src="https://i.postimg.cc/VNXpwDCY/Screenshot-2023-12-06-212944.png"/>
383
+ <p align="center"><img src="https://i.ibb.co/TPDsD2z/Screenshot-2023-12-06-211216.png"/>
384
+ <p align="center"><font size="5"><b><a href="https://i.ibb.co/4PhnXjK/Screenshot-2023-12-06-205831.png">!!NSFW!! - 🔥Erotica Writing Example🔥 - !!NSFW!!</font></a></b></p>
385
+
386
+ Thanks to [Charles Goddard](https://huggingface.co/chargoddard) for the recipe.
387
+
388
+ The idea here is to "move" Iambe from being based on vanilla L2 to being based on sequelbox/DynamicFactor instead.
389
+
390
+ Because task_arithmetic uses the raw deltas, this should be similar to if the SFT had been done over DynamicFactor.
391
+
392
+ ## Recipe
393
+
394
+ merge_method: task_arithmetic
395
+
396
+ base_model: athirdpath/BigLlama-20b-v1.1 # Base model you want to "move out" from
397
+
398
+ models:
399
+
400
+ - model: athirdpath/Iambe-20b-DARE-v2 # SFTd model you want to transfer
401
+
402
+ - model: athirdpath/DoubleFactor-20b # Base model you want to "move in" to
403
+
404
+ parameters:
405
+
406
+ - weight: 1.0
407
+
408
+ dtype: bfloat16