TheBloke commited on
Commit
fa07761
1 Parent(s): 9d382f7

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +436 -0
README.md ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: abideen/DareVox-7B
3
+ inference: false
4
+ license: apache-2.0
5
+ model_creator: Zain ul Abideen
6
+ model_name: DareVox 7B
7
+ model_type: mistral
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
+ - merge
23
+ - mergekit
24
+ - lazymergekit
25
+ - teknium/OpenHermes-2.5-Mistral-7B
26
+ - abacusai/Slerp-CM-mist-dpo
27
+ - berkeley-nest/Starling-LM-7B-alpha
28
+ ---
29
+ <!-- markdownlint-disable MD041 -->
30
+
31
+ <!-- header start -->
32
+ <!-- 200823 -->
33
+ <div style="width: auto; margin-left: auto; margin-right: auto">
34
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
35
+ </div>
36
+ <div style="display: flex; justify-content: space-between; width: 100%;">
37
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
38
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
39
+ </div>
40
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
41
+ <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>
42
+ </div>
43
+ </div>
44
+ <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>
45
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
46
+ <!-- header end -->
47
+
48
+ # DareVox 7B - AWQ
49
+ - Model creator: [Zain ul Abideen](https://huggingface.co/abideen)
50
+ - Original model: [DareVox 7B](https://huggingface.co/abideen/DareVox-7B)
51
+
52
+ <!-- description start -->
53
+ ## Description
54
+
55
+ This repo contains AWQ model files for [Zain ul Abideen's DareVox 7B](https://huggingface.co/abideen/DareVox-7B).
56
+
57
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
58
+
59
+
60
+ ### About AWQ
61
+
62
+ 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.
63
+
64
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
65
+
66
+ It is supported by:
67
+
68
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
69
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
70
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
71
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
72
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
73
+
74
+ <!-- description end -->
75
+ <!-- repositories-available start -->
76
+ ## Repositories available
77
+
78
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/DareVox-7B-AWQ)
79
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/DareVox-7B-GPTQ)
80
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/DareVox-7B-GGUF)
81
+ * [Zain ul Abideen's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/abideen/DareVox-7B)
82
+ <!-- repositories-available end -->
83
+
84
+ <!-- prompt-template start -->
85
+ ## Prompt template: Alpaca
86
+
87
+ ```
88
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
89
+
90
+ ### Instruction:
91
+ {prompt}
92
+
93
+ ### Response:
94
+
95
+ ```
96
+
97
+ <!-- prompt-template end -->
98
+
99
+
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/DareVox-7B-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.15 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/DareVox-7B-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: `DareVox-7B-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/DareVox-7B-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/DareVox-7B-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/DareVox-7B-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/DareVox-7B-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: Zain ul Abideen's DareVox 7B
379
+
380
+
381
+ # DareVox-7B
382
+
383
+ DareVox-7B is a merge of the following models:
384
+ * [teknium/OpenHermes-2.5-Mistral-7B](https://huggingface.co/teknium/OpenHermes-2.5-Mistral-7B)
385
+ * [abacusai/Slerp-CM-mist-dpo](https://huggingface.co/abacusai/Slerp-CM-mist-dpo)
386
+ * [berkeley-nest/Starling-LM-7B-alpha](https://huggingface.co/berkeley-nest/Starling-LM-7B-alpha)
387
+
388
+ ## 🧩 Configuration
389
+
390
+ ```yaml
391
+ models:
392
+ - model: mistralai/Mistral-7B-v0.1
393
+ # No parameters necessary for base model
394
+ - model: teknium/OpenHermes-2.5-Mistral-7B
395
+ parameters:
396
+ density: 0.53
397
+ weight: 0.4
398
+ - model: abacusai/Slerp-CM-mist-dpo
399
+ parameters:
400
+ density: 0.53
401
+ weight: 0.3
402
+ - model: berkeley-nest/Starling-LM-7B-alpha
403
+ parameters:
404
+ density: 0.5
405
+ weight: 0.4
406
+ merge_method: dare_ties
407
+ base_model: mistralai/Mistral-7B-v0.1
408
+ parameters:
409
+ int8_mask: true
410
+ dtype: bfloat16
411
+ ```
412
+
413
+ ## 💻 Usage
414
+
415
+ ```python
416
+ !pip install -qU transformers accelerate
417
+
418
+ from transformers import AutoTokenizer
419
+ import transformers
420
+ import torch
421
+
422
+ model = "abideen/DareVox-7B"
423
+ messages = [{"role": "user", "content": "What is a large language model?"}]
424
+
425
+ tokenizer = AutoTokenizer.from_pretrained(model)
426
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
427
+ pipeline = transformers.pipeline(
428
+ "text-generation",
429
+ model=model,
430
+ torch_dtype=torch.float16,
431
+ device_map="auto",
432
+ )
433
+
434
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
435
+ print(outputs[0]["generated_text"])
436
+ ```