TheBloke commited on
Commit
80f2ba4
·
1 Parent(s): f7645e1

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +372 -0
README.md ADDED
@@ -0,0 +1,372 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: PulsarAI/SlimOpenOrca-Mistral-7B
3
+ inference: false
4
+ license: cc-by-nc-4.0
5
+ model_creator: PulsarAI
6
+ model_name: SlimOpenOrca Mistral 7B
7
+ model_type: mistral
8
+ prompt_template: '<|im_start|>system
9
+
10
+ {system_message}<|im_end|>
11
+
12
+ <|im_start|>user
13
+
14
+ {prompt}<|im_end|>
15
+
16
+ <|im_start|>assistant
17
+
18
+ '
19
+ quantized_by: TheBloke
20
+ ---
21
+ <!-- markdownlint-disable MD041 -->
22
+
23
+ <!-- header start -->
24
+ <!-- 200823 -->
25
+ <div style="width: auto; margin-left: auto; margin-right: auto">
26
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
27
+ </div>
28
+ <div style="display: flex; justify-content: space-between; width: 100%;">
29
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
30
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
31
+ </div>
32
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
33
+ <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>
34
+ </div>
35
+ </div>
36
+ <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>
37
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
38
+ <!-- header end -->
39
+
40
+ # SlimOpenOrca Mistral 7B - AWQ
41
+ - Model creator: [PulsarAI](https://huggingface.co/PulsarAI)
42
+ - Original model: [SlimOpenOrca Mistral 7B](https://huggingface.co/PulsarAI/SlimOpenOrca-Mistral-7B)
43
+
44
+ <!-- description start -->
45
+ ## Description
46
+
47
+ This repo contains AWQ model files for [PulsarAI's SlimOpenOrca Mistral 7B](https://huggingface.co/PulsarAI/SlimOpenOrca-Mistral-7B).
48
+
49
+
50
+ ### About AWQ
51
+
52
+ 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.
53
+
54
+ It is supported by:
55
+
56
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
57
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
58
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
59
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
60
+
61
+ <!-- description end -->
62
+ <!-- repositories-available start -->
63
+ ## Repositories available
64
+
65
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/SlimOpenOrca-Mistral-7B-AWQ)
66
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/SlimOpenOrca-Mistral-7B-GPTQ)
67
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/SlimOpenOrca-Mistral-7B-GGUF)
68
+ * [PulsarAI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/PulsarAI/SlimOpenOrca-Mistral-7B)
69
+ <!-- repositories-available end -->
70
+
71
+ <!-- prompt-template start -->
72
+ ## Prompt template: ChatML
73
+
74
+ ```
75
+ <|im_start|>system
76
+ {system_message}<|im_end|>
77
+ <|im_start|>user
78
+ {prompt}<|im_end|>
79
+ <|im_start|>assistant
80
+
81
+ ```
82
+
83
+ <!-- prompt-template end -->
84
+
85
+
86
+ <!-- README_AWQ.md-provided-files start -->
87
+ ## Provided files, and AWQ parameters
88
+
89
+ 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.
90
+
91
+ Models are released as sharded safetensors files.
92
+
93
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
94
+ | ------ | ---- | -- | ----------- | ------- | ---- |
95
+ | [main](https://huggingface.co/TheBloke/SlimOpenOrca-Mistral-7B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.15 GB
96
+
97
+ <!-- README_AWQ.md-provided-files end -->
98
+
99
+ <!-- README_AWQ.md-text-generation-webui start -->
100
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
101
+
102
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
103
+
104
+ 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.
105
+
106
+ 1. Click the **Model tab**.
107
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/SlimOpenOrca-Mistral-7B-AWQ`.
108
+ 3. Click **Download**.
109
+ 4. The model will start downloading. Once it's finished it will say "Done".
110
+ 5. In the top left, click the refresh icon next to **Model**.
111
+ 6. In the **Model** dropdown, choose the model you just downloaded: `SlimOpenOrca-Mistral-7B-AWQ`
112
+ 7. Select **Loader: AutoAWQ**.
113
+ 8. Click Load, and the model will load and is now ready for use.
114
+ 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.
115
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
116
+ <!-- README_AWQ.md-text-generation-webui end -->
117
+
118
+ <!-- README_AWQ.md-use-from-vllm start -->
119
+ ## Multi-user inference server: vLLM
120
+
121
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
122
+
123
+ - Please ensure you are using vLLM version 0.2 or later.
124
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
125
+
126
+ For example:
127
+
128
+ ```shell
129
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/SlimOpenOrca-Mistral-7B-AWQ --quantization awq
130
+ ```
131
+
132
+ - When using vLLM from Python code, again set `quantization=awq`.
133
+
134
+ For example:
135
+
136
+ ```python
137
+ from vllm import LLM, SamplingParams
138
+
139
+ prompts = [
140
+ "Tell me about AI",
141
+ "Write a story about llamas",
142
+ "What is 291 - 150?",
143
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
144
+ ]
145
+ prompt_template=f'''<|im_start|>system
146
+ {system_message}<|im_end|>
147
+ <|im_start|>user
148
+ {prompt}<|im_end|>
149
+ <|im_start|>assistant
150
+ '''
151
+
152
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
153
+
154
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
155
+
156
+ llm = LLM(model="TheBloke/SlimOpenOrca-Mistral-7B-AWQ", quantization="awq", dtype="auto")
157
+
158
+ outputs = llm.generate(prompts, sampling_params)
159
+
160
+ # Print the outputs.
161
+ for output in outputs:
162
+ prompt = output.prompt
163
+ generated_text = output.outputs[0].text
164
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
165
+ ```
166
+ <!-- README_AWQ.md-use-from-vllm start -->
167
+
168
+ <!-- README_AWQ.md-use-from-tgi start -->
169
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
170
+
171
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
172
+
173
+ Example Docker parameters:
174
+
175
+ ```shell
176
+ --model-id TheBloke/SlimOpenOrca-Mistral-7B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
177
+ ```
178
+
179
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
180
+
181
+ ```shell
182
+ pip3 install huggingface-hub
183
+ ```
184
+
185
+ ```python
186
+ from huggingface_hub import InferenceClient
187
+
188
+ endpoint_url = "https://your-endpoint-url-here"
189
+
190
+ prompt = "Tell me about AI"
191
+ prompt_template=f'''<|im_start|>system
192
+ {system_message}<|im_end|>
193
+ <|im_start|>user
194
+ {prompt}<|im_end|>
195
+ <|im_start|>assistant
196
+ '''
197
+
198
+ client = InferenceClient(endpoint_url)
199
+ response = client.text_generation(prompt,
200
+ max_new_tokens=128,
201
+ do_sample=True,
202
+ temperature=0.7,
203
+ top_p=0.95,
204
+ top_k=40,
205
+ repetition_penalty=1.1)
206
+
207
+ print(f"Model output: ", response)
208
+ ```
209
+ <!-- README_AWQ.md-use-from-tgi end -->
210
+
211
+ <!-- README_AWQ.md-use-from-python start -->
212
+ ## Inference from Python code using AutoAWQ
213
+
214
+ ### Install the AutoAWQ package
215
+
216
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later.
217
+
218
+ ```shell
219
+ pip3 install autoawq
220
+ ```
221
+
222
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
223
+
224
+ ```shell
225
+ pip3 uninstall -y autoawq
226
+ git clone https://github.com/casper-hansen/AutoAWQ
227
+ cd AutoAWQ
228
+ pip3 install .
229
+ ```
230
+
231
+ ### AutoAWQ example code
232
+
233
+ ```python
234
+ from awq import AutoAWQForCausalLM
235
+ from transformers import AutoTokenizer
236
+
237
+ model_name_or_path = "TheBloke/SlimOpenOrca-Mistral-7B-AWQ"
238
+
239
+ # Load tokenizer
240
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
241
+ # Load model
242
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
243
+ trust_remote_code=False, safetensors=True)
244
+
245
+ prompt = "Tell me about AI"
246
+ prompt_template=f'''<|im_start|>system
247
+ {system_message}<|im_end|>
248
+ <|im_start|>user
249
+ {prompt}<|im_end|>
250
+ <|im_start|>assistant
251
+ '''
252
+
253
+ print("*** Running model.generate:")
254
+
255
+ token_input = tokenizer(
256
+ prompt_template,
257
+ return_tensors='pt'
258
+ ).input_ids.cuda()
259
+
260
+ # Generate output
261
+ generation_output = model.generate(
262
+ token_input,
263
+ do_sample=True,
264
+ temperature=0.7,
265
+ top_p=0.95,
266
+ top_k=40,
267
+ max_new_tokens=512
268
+ )
269
+
270
+ # Get the tokens from the output, decode them, print them
271
+ token_output = generation_output[0]
272
+ text_output = tokenizer.decode(token_output)
273
+ print("LLM output: ", text_output)
274
+
275
+ """
276
+ # Inference should be possible with transformers pipeline as well in future
277
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
278
+ from transformers import pipeline
279
+
280
+ print("*** Pipeline:")
281
+ pipe = pipeline(
282
+ "text-generation",
283
+ model=model,
284
+ tokenizer=tokenizer,
285
+ max_new_tokens=512,
286
+ do_sample=True,
287
+ temperature=0.7,
288
+ top_p=0.95,
289
+ top_k=40,
290
+ repetition_penalty=1.1
291
+ )
292
+
293
+ print(pipe(prompt_template)[0]['generated_text'])
294
+ """
295
+ ```
296
+ <!-- README_AWQ.md-use-from-python end -->
297
+
298
+ <!-- README_AWQ.md-compatibility start -->
299
+ ## Compatibility
300
+
301
+ The files provided are tested to work with:
302
+
303
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
304
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
305
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
306
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
307
+
308
+ <!-- README_AWQ.md-compatibility end -->
309
+
310
+ <!-- footer start -->
311
+ <!-- 200823 -->
312
+ ## Discord
313
+
314
+ For further support, and discussions on these models and AI in general, join us at:
315
+
316
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
317
+
318
+ ## Thanks, and how to contribute
319
+
320
+ Thanks to the [chirper.ai](https://chirper.ai) team!
321
+
322
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
323
+
324
+ 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.
325
+
326
+ 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.
327
+
328
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
329
+
330
+ * Patreon: https://patreon.com/TheBlokeAI
331
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
332
+
333
+ **Special thanks to**: Aemon Algiz.
334
+
335
+ **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
336
+
337
+
338
+ Thank you to all my generous patrons and donaters!
339
+
340
+ And thank you again to a16z for their generous grant.
341
+
342
+ <!-- footer end -->
343
+
344
+ # Original model card: PulsarAI's SlimOpenOrca Mistral 7B
345
+
346
+
347
+ <a href="https://www.buymeacoffee.com/PulsarAI" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
348
+
349
+ Merge of [Open-Orca/Mistral-7B-SlimOrca](https://huggingface.co/Open-Orca/Mistral-7B-SlimOrca) and [Open-Orca/Mistral-7B-OpenOrca](https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca) using ties merge.
350
+
351
+ ### *Weights*
352
+
353
+ - [Open-Orca/Mistral-7B-SlimOrca](https://huggingface.co/Open-Orca/Mistral-7B-SlimOrca): 0.5
354
+
355
+ - [Open-Orca/Mistral-7B-OpenOrca](https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca): 0.3
356
+
357
+ ### *Density*
358
+
359
+ - [Open-Orca/Mistral-7B-SlimOrca](https://huggingface.co/Open-Orca/Mistral-7B-SlimOrca): 0.5
360
+
361
+ - [Open-Orca/Mistral-7B-OpenOrca](https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca): 0.5
362
+
363
+
364
+ # Evulation Results ([Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard))
365
+
366
+ | Metric | Value |
367
+ |-----------------------|-------|
368
+ | Avg. | |
369
+ | ARC (25-shot) | |
370
+ | HellaSwag (10-shot) | |
371
+ | MMLU (5-shot) | |
372
+ | TruthfulQA (0-shot) | |