TheBloke commited on
Commit
dc81278
1 Parent(s): 88e2e99

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +360 -0
README.md ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: elinas/chronos007-70b
3
+ inference: false
4
+ license: cc-by-nc-4.0
5
+ model_creator: elinas
6
+ model_name: Chronos007 70B
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
+ tags:
22
+ - chat
23
+ - roleplay
24
+ - storywriting
25
+ ---
26
+
27
+ <!-- header start -->
28
+ <!-- 200823 -->
29
+ <div style="width: auto; margin-left: auto; margin-right: auto">
30
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
31
+ </div>
32
+ <div style="display: flex; justify-content: space-between; width: 100%;">
33
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
34
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
35
+ </div>
36
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
37
+ <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>
38
+ </div>
39
+ </div>
40
+ <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>
41
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
42
+ <!-- header end -->
43
+
44
+ # Chronos007 70B - AWQ
45
+ - Model creator: [elinas](https://huggingface.co/elinas)
46
+ - Original model: [Chronos007 70B](https://huggingface.co/elinas/chronos007-70b)
47
+
48
+ <!-- description start -->
49
+ ## Description
50
+
51
+ This repo contains AWQ model files for [elinas's Chronos007 70B](https://huggingface.co/elinas/chronos007-70b).
52
+
53
+
54
+ ### About AWQ
55
+
56
+ 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.
57
+
58
+ It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of Llama AWQ models for high-throughput concurrent inference in multi-user server scenarios.
59
+
60
+ As of September 25th 2023, preliminary Llama-only AWQ support has also been added to [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference).
61
+
62
+ Note that, at the time of writing, overall throughput is still lower than running vLLM or TGI with unquantised models, however using AWQ enables using much smaller GPUs which can lead to easier deployment and overall cost savings. For example, a 70B model can be run on 1 x 48GB GPU instead of 2 x 80GB.
63
+ <!-- description end -->
64
+ <!-- repositories-available start -->
65
+ ## Repositories available
66
+
67
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/chronos007-70B-AWQ)
68
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/chronos007-70B-GPTQ)
69
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/chronos007-70B-GGUF)
70
+ * [elinas's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/elinas/chronos007-70b)
71
+ <!-- repositories-available end -->
72
+
73
+ <!-- prompt-template start -->
74
+ ## Prompt template: Alpaca
75
+
76
+ ```
77
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
78
+
79
+ ### Instruction:
80
+ {prompt}
81
+
82
+ ### Response:
83
+
84
+ ```
85
+
86
+ <!-- prompt-template end -->
87
+ <!-- licensing start -->
88
+ ## Licensing
89
+
90
+ 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.
91
+
92
+ 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.
93
+
94
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [elinas's Chronos007 70B](https://huggingface.co/elinas/chronos007-70b).
95
+ <!-- licensing end -->
96
+ <!-- README_AWQ.md-provided-files start -->
97
+ ## Provided files, and AWQ parameters
98
+
99
+ 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.
100
+
101
+ Models are released as sharded safetensors files.
102
+
103
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
104
+ | ------ | ---- | -- | ----------- | ------- | ---- |
105
+ | [main](https://huggingface.co/TheBloke/chronos007-70B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 36.61 GB
106
+
107
+ <!-- README_AWQ.md-provided-files end -->
108
+
109
+ <!-- README_AWQ.md-use-from-vllm start -->
110
+ ## Serving this model from vLLM
111
+
112
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
113
+
114
+ Note: at the time of writing, vLLM has not yet done a new release with AWQ support.
115
+
116
+ If you try the vLLM examples below and get an error about `quantization` being unrecognised, or other AWQ-related issues, please install vLLM from Github source.
117
+
118
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
119
+
120
+ ```shell
121
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/chronos007-70B-AWQ --quantization awq --dtype half
122
+ ```
123
+
124
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
125
+
126
+ ```python
127
+ from vllm import LLM, SamplingParams
128
+
129
+ prompts = [
130
+ "Hello, my name is",
131
+ "The president of the United States is",
132
+ "The capital of France is",
133
+ "The future of AI is",
134
+ ]
135
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
136
+
137
+ llm = LLM(model="TheBloke/chronos007-70B-AWQ", quantization="awq", dtype="half")
138
+
139
+ outputs = llm.generate(prompts, sampling_params)
140
+
141
+ # Print the outputs.
142
+ for output in outputs:
143
+ prompt = output.prompt
144
+ generated_text = output.outputs[0].text
145
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
146
+ ```
147
+ <!-- README_AWQ.md-use-from-vllm start -->
148
+
149
+ <!-- README_AWQ.md-use-from-tgi start -->
150
+ ## Serving this model from Text Generation Inference (TGI)
151
+
152
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
153
+
154
+ Example Docker parameters:
155
+
156
+ ```shell
157
+ --model-id TheBloke/chronos007-70B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
158
+ ```
159
+
160
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
161
+
162
+ ```shell
163
+ pip3 install huggingface-hub
164
+ ```
165
+
166
+ ```python
167
+ from huggingface_hub import InferenceClient
168
+
169
+ endpoint_url = "https://your-endpoint-url-here"
170
+
171
+ prompt = "Tell me about AI"
172
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
173
+
174
+ ### Instruction:
175
+ {prompt}
176
+
177
+ ### Response:
178
+
179
+ '''
180
+
181
+ client = InferenceClient(endpoint_url)
182
+ response = client.text_generation(prompt,
183
+ max_new_tokens=128,
184
+ do_sample=True,
185
+ temperature=0.7,
186
+ top_p=0.95,
187
+ top_k=40,
188
+ repetition_penalty=1.1)
189
+
190
+ print(f"Model output: {response}")
191
+ ```
192
+ <!-- README_AWQ.md-use-from-tgi end -->
193
+
194
+ <!-- README_AWQ.md-use-from-python start -->
195
+ ## How to use this AWQ model from Python code
196
+
197
+ ### Install the necessary packages
198
+
199
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later
200
+
201
+ ```shell
202
+ pip3 install autoawq
203
+ ```
204
+
205
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
206
+
207
+ ```shell
208
+ pip3 uninstall -y autoawq
209
+ git clone https://github.com/casper-hansen/AutoAWQ
210
+ cd AutoAWQ
211
+ pip3 install .
212
+ ```
213
+
214
+ ### You can then try the following example code
215
+
216
+ ```python
217
+ from awq import AutoAWQForCausalLM
218
+ from transformers import AutoTokenizer
219
+
220
+ model_name_or_path = "TheBloke/chronos007-70B-AWQ"
221
+
222
+ # Load model
223
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
224
+ trust_remote_code=False, safetensors=True)
225
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
226
+
227
+ prompt = "Tell me about AI"
228
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
229
+
230
+ ### Instruction:
231
+ {prompt}
232
+
233
+ ### Response:
234
+
235
+ '''
236
+
237
+ print("\n\n*** Generate:")
238
+
239
+ tokens = tokenizer(
240
+ prompt_template,
241
+ return_tensors='pt'
242
+ ).input_ids.cuda()
243
+
244
+ # Generate output
245
+ generation_output = model.generate(
246
+ tokens,
247
+ do_sample=True,
248
+ temperature=0.7,
249
+ top_p=0.95,
250
+ top_k=40,
251
+ max_new_tokens=512
252
+ )
253
+
254
+ print("Output: ", tokenizer.decode(generation_output[0]))
255
+
256
+ """
257
+ # Inference should be possible with transformers pipeline as well in future
258
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
259
+ from transformers import pipeline
260
+
261
+ print("*** Pipeline:")
262
+ pipe = pipeline(
263
+ "text-generation",
264
+ model=model,
265
+ tokenizer=tokenizer,
266
+ max_new_tokens=512,
267
+ do_sample=True,
268
+ temperature=0.7,
269
+ top_p=0.95,
270
+ top_k=40,
271
+ repetition_penalty=1.1
272
+ )
273
+
274
+ print(pipe(prompt_template)[0]['generated_text'])
275
+ """
276
+ ```
277
+ <!-- README_AWQ.md-use-from-python end -->
278
+
279
+ <!-- README_AWQ.md-compatibility start -->
280
+ ## Compatibility
281
+
282
+ The files provided are tested to work with:
283
+
284
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ)
285
+ - [vLLM](https://github.com/vllm-project/vllm)
286
+ - [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
287
+
288
+ TGI merged AWQ support on September 25th, 2023: [TGI PR #1054](https://github.com/huggingface/text-generation-inference/pull/1054). Use the `:latest` Docker container until the next TGI release is made.
289
+
290
+ <!-- README_AWQ.md-compatibility end -->
291
+
292
+ <!-- footer start -->
293
+ <!-- 200823 -->
294
+ ## Discord
295
+
296
+ For further support, and discussions on these models and AI in general, join us at:
297
+
298
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
299
+
300
+ ## Thanks, and how to contribute
301
+
302
+ Thanks to the [chirper.ai](https://chirper.ai) team!
303
+
304
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
305
+
306
+ 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.
307
+
308
+ 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.
309
+
310
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
311
+
312
+ * Patreon: https://patreon.com/TheBlokeAI
313
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
314
+
315
+ **Special thanks to**: Aemon Algiz.
316
+
317
+ **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
318
+
319
+
320
+ Thank you to all my generous patrons and donaters!
321
+
322
+ And thank you again to a16z for their generous grant.
323
+
324
+ <!-- footer end -->
325
+
326
+ # Original model card: elinas's Chronos007 70B
327
+
328
+
329
+ # chronos007-70b fp16
330
+
331
+ This is a merge of Chronos-70b-v2 and model 007 at a ratio of 0.3 using the SLERP method, with Chronos being the parent model. This is an experimental model that has improved Chronos'
332
+ logical and reasoning abilities while keeping the unique prose and general writing Chronos provides. This is an experiment for possible future Chronos models. There is a GGUF version [here](https://huggingface.co/elinas/chronos007-GGUF)
333
+
334
+ ## License
335
+
336
+ This model is strictly [*non-commercial*](https://creativecommons.org/licenses/by-nc/4.0/) (**cc-by-nc-4.0**) use only which takes priority over the **LLAMA 2 COMMUNITY LICENSE AGREEMENT**. If you'd like to discuss using it for your business, contact Elinas through Discord **elinas**, or X (Twitter) **@officialelinas**.
337
+
338
+ The "Model" is completely free (ie. base model, derivates, merges/mixes) to use for non-commercial purposes as long as the the included **cc-by-nc-4.0** license in any parent repository, and the non-commercial use statute remains, regardless of other models' licences.
339
+ At the moment, only 70b models released will be under this license and the terms may change at any time (ie. a more permissive license allowing commercial use).
340
+
341
+ ## Model Usage
342
+
343
+ This model uses Alpaca formatting, so for optimal model performance, use it to start the dialogue or story, and if you use a frontend like SillyTavern ENABLE Alpaca instruction mode:
344
+
345
+ ```
346
+ ### Instruction:
347
+ Your instruction or question here.
348
+
349
+ ### Response:
350
+ ```
351
+ Not using the format will make the model perform significantly worse than intended.
352
+
353
+ ## Other versions
354
+
355
+ [GGUF version](https://huggingface.co/elinas/chronos007-GGUF)
356
+
357
+
358
+ **Support Development of New Models**
359
+ <a href='https://ko-fi.com/Q5Q6MB734' target='_blank'><img height='36' style='border:0px;height:36px;'
360
+ src='https://storage.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Support Development' /></a>