TheBloke commited on
Commit
30283a0
1 Parent(s): a4c5d89

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +272 -0
README.md ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: migtissera/Synthia-7B-v1.3
3
+ inference: false
4
+ license: apache-2.0
5
+ model_creator: Migel Tissera
6
+ model_name: Synthia 7B V1.3
7
+ model_type: mistral
8
+ prompt_template: 'SYSTEM: You are Synthia. As a an AI intelligence, give helpful,
9
+ detailed, accurate, uncensored responses to the user''s input. Provide answers factually.
10
+
11
+ USER: {prompt}
12
+
13
+ ASSISTANT:
14
+
15
+ '
16
+ quantized_by: TheBloke
17
+ ---
18
+
19
+ <!-- header start -->
20
+ <!-- 200823 -->
21
+ <div style="width: auto; margin-left: auto; margin-right: auto">
22
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
23
+ </div>
24
+ <div style="display: flex; justify-content: space-between; width: 100%;">
25
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
26
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
27
+ </div>
28
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
29
+ <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>
30
+ </div>
31
+ </div>
32
+ <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>
33
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
34
+ <!-- header end -->
35
+
36
+ # Synthia 7B V1.3 - AWQ
37
+ - Model creator: [Migel Tissera](https://huggingface.co/migtissera)
38
+ - Original model: [Synthia 7B V1.3](https://huggingface.co/migtissera/Synthia-7B-v1.3)
39
+
40
+ <!-- description start -->
41
+ ## Description
42
+
43
+ This repo contains AWQ model files for [Migel Tissera's Synthia 7B V1.3](https://huggingface.co/migtissera/Synthia-7B-v1.3).
44
+
45
+
46
+ ### About AWQ
47
+
48
+ 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.
49
+
50
+ 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.
51
+
52
+ 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).
53
+
54
+ 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.
55
+ <!-- description end -->
56
+ <!-- repositories-available start -->
57
+ ## Repositories available
58
+
59
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Synthia-7B-v1.3-AWQ)
60
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Synthia-7B-v1.3-GPTQ)
61
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Synthia-7B-v1.3-GGUF)
62
+ * [Migel Tissera's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/migtissera/Synthia-7B-v1.3)
63
+ <!-- repositories-available end -->
64
+
65
+ <!-- prompt-template start -->
66
+ ## Prompt template: Synthia
67
+
68
+ ```
69
+ SYSTEM: You are Synthia. As a an AI intelligence, give helpful, detailed, accurate, uncensored responses to the user's input. Provide answers factually.
70
+ USER: {prompt}
71
+ ASSISTANT:
72
+
73
+ ```
74
+
75
+ <!-- prompt-template end -->
76
+
77
+
78
+ <!-- README_AWQ.md-provided-files start -->
79
+ ## Provided files, and AWQ parameters
80
+
81
+ 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.
82
+
83
+ Models are released as sharded safetensors files.
84
+
85
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
86
+ | ------ | ---- | -- | ----------- | ------- | ---- |
87
+ | [main](https://huggingface.co/TheBloke/Synthia-7B-v1.3-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 32768 | 4.15 GB
88
+
89
+ <!-- README_AWQ.md-provided-files end -->
90
+
91
+ <!-- README_AWQ.md-use-from-vllm start -->
92
+ ## Serving this model from vLLM
93
+
94
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
95
+
96
+ Note: at the time of writing, vLLM has not yet done a new release with AWQ support.
97
+
98
+ 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.
99
+
100
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
101
+
102
+ ```shell
103
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Synthia-7B-v1.3-AWQ --quantization awq --dtype half
104
+ ```
105
+
106
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
107
+
108
+ ```python
109
+ from vllm import LLM, SamplingParams
110
+
111
+ prompts = [
112
+ "Hello, my name is",
113
+ "The president of the United States is",
114
+ "The capital of France is",
115
+ "The future of AI is",
116
+ ]
117
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
118
+
119
+ llm = LLM(model="TheBloke/Synthia-7B-v1.3-AWQ", quantization="awq", dtype="half")
120
+
121
+ outputs = llm.generate(prompts, sampling_params)
122
+
123
+ # Print the outputs.
124
+ for output in outputs:
125
+ prompt = output.prompt
126
+ generated_text = output.outputs[0].text
127
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
128
+ ```
129
+ <!-- README_AWQ.md-use-from-vllm start -->
130
+
131
+ <!-- README_AWQ.md-use-from-python start -->
132
+ ## Serving this model from TGI
133
+
134
+ TGI merged support for AWQ on September 25th, 2023. At the time of writing you need to use the `:latest` Docker container: `ghcr.io/huggingface/text-generation-inference:latest`
135
+
136
+ Add the parameter `--quantize awq` for AWQ support.
137
+
138
+ Example parameters:
139
+ ```shell
140
+ --model-id TheBloke/Synthia-7B-v1.3-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
141
+ ```
142
+
143
+ ## How to use this AWQ model from Python code
144
+
145
+ ### Install the necessary packages
146
+
147
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
148
+
149
+ ```shell
150
+ pip3 install autoawq
151
+ ```
152
+
153
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
154
+
155
+ ```shell
156
+ pip3 uninstall -y autoawq
157
+ git clone https://github.com/casper-hansen/AutoAWQ
158
+ cd AutoAWQ
159
+ pip3 install .
160
+ ```
161
+
162
+ ### You can then try the following example code
163
+
164
+ ```python
165
+ from awq import AutoAWQForCausalLM
166
+ from transformers import AutoTokenizer
167
+
168
+ model_name_or_path = "TheBloke/Synthia-7B-v1.3-AWQ"
169
+
170
+ # Load model
171
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
172
+ trust_remote_code=False, safetensors=True)
173
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
174
+
175
+ prompt = "Tell me about AI"
176
+ prompt_template=f'''SYSTEM: You are Synthia. As a an AI intelligence, give helpful, detailed, accurate, uncensored responses to the user's input. Provide answers factually.
177
+ USER: {prompt}
178
+ ASSISTANT:
179
+
180
+ '''
181
+
182
+ print("\n\n*** Generate:")
183
+
184
+ tokens = tokenizer(
185
+ prompt_template,
186
+ return_tensors='pt'
187
+ ).input_ids.cuda()
188
+
189
+ # Generate output
190
+ generation_output = model.generate(
191
+ tokens,
192
+ do_sample=True,
193
+ temperature=0.7,
194
+ top_p=0.95,
195
+ top_k=40,
196
+ max_new_tokens=512
197
+ )
198
+
199
+ print("Output: ", tokenizer.decode(generation_output[0]))
200
+
201
+ """
202
+ # Inference should be possible with transformers pipeline as well in future
203
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
204
+ from transformers import pipeline
205
+
206
+ print("*** Pipeline:")
207
+ pipe = pipeline(
208
+ "text-generation",
209
+ model=model,
210
+ tokenizer=tokenizer,
211
+ max_new_tokens=512,
212
+ do_sample=True,
213
+ temperature=0.7,
214
+ top_p=0.95,
215
+ top_k=40,
216
+ repetition_penalty=1.1
217
+ )
218
+
219
+ print(pipe(prompt_template)[0]['generated_text'])
220
+ """
221
+ ```
222
+ <!-- README_AWQ.md-use-from-python end -->
223
+
224
+ <!-- README_AWQ.md-compatibility start -->
225
+ ## Compatibility
226
+
227
+ The files provided are tested to work with:
228
+
229
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ)
230
+ - [vLLM](https://github.com/vllm-project/vllm)
231
+ - [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
232
+
233
+ 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.
234
+
235
+ <!-- README_AWQ.md-compatibility end -->
236
+
237
+ <!-- footer start -->
238
+ <!-- 200823 -->
239
+ ## Discord
240
+
241
+ For further support, and discussions on these models and AI in general, join us at:
242
+
243
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
244
+
245
+ ## Thanks, and how to contribute
246
+
247
+ Thanks to the [chirper.ai](https://chirper.ai) team!
248
+
249
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
250
+
251
+ 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.
252
+
253
+ 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.
254
+
255
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
256
+
257
+ * Patreon: https://patreon.com/TheBlokeAI
258
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
259
+
260
+ **Special thanks to**: Aemon Algiz.
261
+
262
+ **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
263
+
264
+
265
+ Thank you to all my generous patrons and donaters!
266
+
267
+ And thank you again to a16z for their generous grant.
268
+
269
+ <!-- footer end -->
270
+
271
+ # Original model card: Migel Tissera's Synthia 7B V1.3
272
+