TheBloke commited on
Commit
99536ff
1 Parent(s): 62b4ef9

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +445 -0
README.md ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: dreamgen/opus-v0.5-70b
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: llama2
7
+ model_creator: DreamGen
8
+ model_name: Opus V0.5 70B
9
+ model_type: llama
10
+ pipeline_tag: text-generation
11
+ prompt_template: '<setting>
12
+
13
+ {system_message}
14
+
15
+ </setting>
16
+
17
+
18
+ <instruction>
19
+
20
+ {prompt}
21
+
22
+ </instruction>
23
+
24
+ '
25
+ quantized_by: TheBloke
26
+ ---
27
+ <!-- markdownlint-disable MD041 -->
28
+
29
+ <!-- header start -->
30
+ <!-- 200823 -->
31
+ <div style="width: auto; margin-left: auto; margin-right: auto">
32
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
33
+ </div>
34
+ <div style="display: flex; justify-content: space-between; width: 100%;">
35
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
36
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
37
+ </div>
38
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
39
+ <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>
40
+ </div>
41
+ </div>
42
+ <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>
43
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
44
+ <!-- header end -->
45
+
46
+ # Opus V0.5 70B - AWQ
47
+ - Model creator: [DreamGen](https://huggingface.co/dreamgen)
48
+ - Original model: [Opus V0.5 70B](https://huggingface.co/dreamgen/opus-v0.5-70b)
49
+
50
+ <!-- description start -->
51
+ ## Description
52
+
53
+ This repo contains AWQ model files for [DreamGen's Opus V0.5 70B](https://huggingface.co/dreamgen/opus-v0.5-70b).
54
+
55
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
56
+
57
+
58
+ ### About AWQ
59
+
60
+ 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.
61
+
62
+ It is supported by:
63
+
64
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
65
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
66
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
67
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
68
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
69
+
70
+ <!-- description end -->
71
+ <!-- repositories-available start -->
72
+ ## Repositories available
73
+
74
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/opus-v0.5-70B-AWQ)
75
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/opus-v0.5-70B-GPTQ)
76
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/opus-v0.5-70B-GGUF)
77
+ * [DreamGen's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/dreamgen/opus-v0.5-70b)
78
+ <!-- repositories-available end -->
79
+
80
+ <!-- prompt-template start -->
81
+ ## Prompt template: DreamGen
82
+
83
+ ```
84
+ <setting>
85
+ {system_message}
86
+ </setting>
87
+
88
+ <instruction>
89
+ {prompt}
90
+ </instruction>
91
+
92
+ ```
93
+
94
+ <!-- prompt-template end -->
95
+
96
+
97
+ <!-- README_AWQ.md-provided-files start -->
98
+ ## Provided files, and AWQ parameters
99
+
100
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
101
+
102
+ Models are released as sharded safetensors files.
103
+
104
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
105
+ | ------ | ---- | -- | ----------- | ------- | ---- |
106
+ | [main](https://huggingface.co/TheBloke/opus-v0.5-70B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-raw-v1) | 4096 | 36.61 GB
107
+
108
+ <!-- README_AWQ.md-provided-files end -->
109
+
110
+ <!-- README_AWQ.md-text-generation-webui start -->
111
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
112
+
113
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
114
+
115
+ 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.
116
+
117
+ 1. Click the **Model tab**.
118
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/opus-v0.5-70B-AWQ`.
119
+ 3. Click **Download**.
120
+ 4. The model will start downloading. Once it's finished it will say "Done".
121
+ 5. In the top left, click the refresh icon next to **Model**.
122
+ 6. In the **Model** dropdown, choose the model you just downloaded: `opus-v0.5-70B-AWQ`
123
+ 7. Select **Loader: AutoAWQ**.
124
+ 8. Click Load, and the model will load and is now ready for use.
125
+ 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.
126
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
127
+ <!-- README_AWQ.md-text-generation-webui end -->
128
+
129
+ <!-- README_AWQ.md-use-from-vllm start -->
130
+ ## Multi-user inference server: vLLM
131
+
132
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
133
+
134
+ - Please ensure you are using vLLM version 0.2 or later.
135
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
136
+
137
+ For example:
138
+
139
+ ```shell
140
+ python3 -m vllm.entrypoints.api_server --model TheBloke/opus-v0.5-70B-AWQ --quantization awq --dtype auto
141
+ ```
142
+
143
+ - When using vLLM from Python code, again set `quantization=awq`.
144
+
145
+ For example:
146
+
147
+ ```python
148
+ from vllm import LLM, SamplingParams
149
+
150
+ prompts = [
151
+ "Tell me about AI",
152
+ "Write a story about llamas",
153
+ "What is 291 - 150?",
154
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
155
+ ]
156
+ prompt_template=f'''<setting>
157
+ {system_message}
158
+ </setting>
159
+
160
+ <instruction>
161
+ {prompt}
162
+ </instruction>
163
+ '''
164
+
165
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
166
+
167
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
168
+
169
+ llm = LLM(model="TheBloke/opus-v0.5-70B-AWQ", quantization="awq", dtype="auto")
170
+
171
+ outputs = llm.generate(prompts, sampling_params)
172
+
173
+ # Print the outputs.
174
+ for output in outputs:
175
+ prompt = output.prompt
176
+ generated_text = output.outputs[0].text
177
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
178
+ ```
179
+ <!-- README_AWQ.md-use-from-vllm start -->
180
+
181
+ <!-- README_AWQ.md-use-from-tgi start -->
182
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
183
+
184
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
185
+
186
+ Example Docker parameters:
187
+
188
+ ```shell
189
+ --model-id TheBloke/opus-v0.5-70B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
190
+ ```
191
+
192
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
193
+
194
+ ```shell
195
+ pip3 install huggingface-hub
196
+ ```
197
+
198
+ ```python
199
+ from huggingface_hub import InferenceClient
200
+
201
+ endpoint_url = "https://your-endpoint-url-here"
202
+
203
+ prompt = "Tell me about AI"
204
+ prompt_template=f'''<setting>
205
+ {system_message}
206
+ </setting>
207
+
208
+ <instruction>
209
+ {prompt}
210
+ </instruction>
211
+ '''
212
+
213
+ client = InferenceClient(endpoint_url)
214
+ response = client.text_generation(prompt,
215
+ max_new_tokens=128,
216
+ do_sample=True,
217
+ temperature=0.7,
218
+ top_p=0.95,
219
+ top_k=40,
220
+ repetition_penalty=1.1)
221
+
222
+ print(f"Model output: ", response)
223
+ ```
224
+ <!-- README_AWQ.md-use-from-tgi end -->
225
+
226
+ <!-- README_AWQ.md-use-from-python start -->
227
+ ## Inference from Python code using Transformers
228
+
229
+ ### Install the necessary packages
230
+
231
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
232
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
233
+
234
+ ```shell
235
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
236
+ ```
237
+
238
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
239
+
240
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
241
+
242
+ ```shell
243
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
244
+ ```
245
+
246
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
247
+
248
+ ```shell
249
+ pip3 uninstall -y autoawq
250
+ git clone https://github.com/casper-hansen/AutoAWQ
251
+ cd AutoAWQ
252
+ pip3 install .
253
+ ```
254
+
255
+ ### Transformers example code (requires Transformers 4.35.0 and later)
256
+
257
+ ```python
258
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
259
+
260
+ model_name_or_path = "TheBloke/opus-v0.5-70B-AWQ"
261
+
262
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
263
+ model = AutoModelForCausalLM.from_pretrained(
264
+ model_name_or_path,
265
+ low_cpu_mem_usage=True,
266
+ device_map="cuda:0"
267
+ )
268
+
269
+ # Using the text streamer to stream output one token at a time
270
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
271
+
272
+ prompt = "Tell me about AI"
273
+ prompt_template=f'''<setting>
274
+ {system_message}
275
+ </setting>
276
+
277
+ <instruction>
278
+ {prompt}
279
+ </instruction>
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**: 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
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: DreamGen's Opus V0.5 70B
379
+
380
+
381
+ # DreamGen Opus V0 70B
382
+
383
+ **DreamGen Opus** is a family of **uncensored** models fine-tuned for **(steerable) story writing** and the model also works great for **chat / RP**.
384
+ The DreamGen Opus V0.5 70B model is derived from [meta-llama/Llama-2-70b-hf](https://huggingface.co/meta-llama/Llama-2-70b-hf).
385
+
386
+ You can **try the Opus V0 70B** (AWQ) model for free on [dreamgen.com](https://dreamgen.com).
387
+
388
+ Other sizes:
389
+
390
+ - 7B: [dreamgen/opus-v0-7b](https://huggingface.co/dreamgen/opus-v0-7b)
391
+
392
+ ## Difference from [dreamgen/opus-v0-70b](https://huggingface.co/dreamgen/opus-v0-70b)
393
+
394
+ The model should be even better at role-play and chat, and be slighly more "open-minded" in NSFW contexts.
395
+
396
+ ## Prompting
397
+
398
+ Please see the [official documentation](https://dreamgen.com/docs/stories) for more detailed guide, including how to prompt the model for chat / RP.
399
+
400
+ The (collaborative / steerable) story writing task teaches the model to respect `<setting>` and `<instruction>` inserted into the prompt.
401
+
402
+ Example prompt:
403
+
404
+ ```
405
+ <setting>
406
+ (Setting provides general overview of the story and characters)
407
+ This story is a twist on the traditional Little Red Riding Hood story.
408
+ In this variation, the Little Red Riding Hood and her grandma are secretely werevoles.
409
+ </setting>
410
+
411
+ (Previous part of the story, potentially empty)
412
+
413
+ <instruction>
414
+ (Setting tells the model what should happen in the next few sentences / paragraphs)
415
+ The Little Red Riding hood confronts The Big Bad Wolf, transforming into her wolf form.
416
+ </instruction>
417
+ ```
418
+
419
+ ## Dataset
420
+
421
+ The fine-tuning dataset consisted of >1M tokens of collaborative writing task examples, each example being up to 4096 tokens. On top of that, >20M tokens of more general, but less instructed examples were included to help preserve generalization.
422
+
423
+ All prose in the dataset is from actual humans, not AI generated.
424
+
425
+ ## Community
426
+
427
+ Join the DreamGen community on [**Discord**](https://dreamgen.com/discord), or follow our [**X/Twitter account**](https://dreamgen.com/twitter) for new model releases and other news.
428
+ We will soon be releasing models with longer context window, as well as models specifically fine-tuned for character chat & roleplay.
429
+
430
+ Help us shape the future of DreamGen.
431
+
432
+ ## Running the model
433
+
434
+ The model is should be compatible with any software that supports [meta-llama/Llama-2-70b-hf](https://huggingface.co/meta-llama/Llama-2-70b-hf).
435
+ Note that because this is a 70B model, the resource requirements are large. You can try the quantized versions linked at the top, but expect a quality drop.
436
+
437
+ ### Running on DreamGen.com (free)
438
+
439
+ You can try the 70B (AWQ) model for free at [dreamgen.com](https://dreamgen.com) — note that an account is required.
440
+ The version used for the website is the official AWQ 4bit quant [dreamgen/opus-v0-70b-awq](https://huggingface.co/dreamgen/opus-v0-70b-awq).
441
+
442
+ ## License
443
+
444
+ - For personal and academic use: Same license as the base model, in this case https://ai.meta.com/resources/models-and-libraries/llama-downloads/.
445
+ - For commercial use: Please reach out to [email protected].