TheBloke commited on
Commit
f4e531a
1 Parent(s): 874ed9e

Upload README.md

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