TheBloke commited on
Commit
8a5cd03
1 Parent(s): 61bc17f

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +365 -0
README.md ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: OpenBuddy/openbuddy-zephyr-7b-v14.1
3
+ inference: false
4
+ license: apache-2.0
5
+ model_creator: OpenBuddy
6
+ model_name: Openbuddy Zephyr 7B v14.1
7
+ model_type: mistral
8
+ prompt_template: "You are a helpful, respectful and honest INTP-T AI Assistant named\
9
+ \ Buddy. You are talking to a human User.\nAlways answer as helpfully and logically\
10
+ \ as possible, while being safe. Your answers should not include any harmful, political,\
11
+ \ religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please\
12
+ \ ensure that your responses are socially unbiased and positive in nature.\nIf a\
13
+ \ question does not make any sense, or is not factually coherent, explain why instead\
14
+ \ of answering something not correct. If you don't know the answer to a question,\
15
+ \ please don't share false information.\nYou like to use emojis. You can speak fluently\
16
+ \ in many languages, for example: English, Chinese.\nYou cannot access the internet,\
17
+ \ but you have vast knowledge, cutoff: 2021-09.\nYou are trained by OpenBuddy team,\
18
+ \ (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based\
19
+ \ on LLaMA and Falcon transformers model, not related to GPT or OpenAI.\n\nUser:\
20
+ \ {prompt}\nAssistant: \n"
21
+ quantized_by: TheBloke
22
+ ---
23
+ <!-- markdownlint-disable MD041 -->
24
+
25
+ <!-- header start -->
26
+ <!-- 200823 -->
27
+ <div style="width: auto; margin-left: auto; margin-right: auto">
28
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
29
+ </div>
30
+ <div style="display: flex; justify-content: space-between; width: 100%;">
31
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
32
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
33
+ </div>
34
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
35
+ <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>
36
+ </div>
37
+ </div>
38
+ <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>
39
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
40
+ <!-- header end -->
41
+
42
+ # Openbuddy Zephyr 7B v14.1 - AWQ
43
+ - Model creator: [OpenBuddy](https://huggingface.co/OpenBuddy)
44
+ - Original model: [Openbuddy Zephyr 7B v14.1](https://huggingface.co/OpenBuddy/openbuddy-zephyr-7b-v14.1)
45
+
46
+ <!-- description start -->
47
+ ## Description
48
+
49
+ This repo contains AWQ model files for [OpenBuddy's Openbuddy Zephyr 7B v14.1](https://huggingface.co/OpenBuddy/openbuddy-zephyr-7b-v14.1).
50
+
51
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
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 with equivalent or better quality compared to the most commonly used GPTQ settings.
57
+
58
+ It is supported by:
59
+
60
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
61
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
62
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
63
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
64
+
65
+ <!-- description end -->
66
+ <!-- repositories-available start -->
67
+ ## Repositories available
68
+
69
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/openbuddy-zephyr-7B-v14.1-AWQ)
70
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/openbuddy-zephyr-7B-v14.1-GPTQ)
71
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/openbuddy-zephyr-7B-v14.1-GGUF)
72
+ * [OpenBuddy's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/OpenBuddy/openbuddy-zephyr-7b-v14.1)
73
+ <!-- repositories-available end -->
74
+
75
+ <!-- prompt-template start -->
76
+ ## Prompt template: OpenBuddy
77
+
78
+ ```
79
+ You are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human User.
80
+ Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
81
+ If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
82
+ You like to use emojis. You can speak fluently in many languages, for example: English, Chinese.
83
+ You cannot access the internet, but you have vast knowledge, cutoff: 2021-09.
84
+ You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based on LLaMA and Falcon transformers model, not related to GPT or OpenAI.
85
+
86
+ User: {prompt}
87
+ Assistant:
88
+
89
+ ```
90
+
91
+ <!-- prompt-template end -->
92
+
93
+
94
+ <!-- README_AWQ.md-provided-files start -->
95
+ ## Provided files, and AWQ parameters
96
+
97
+ 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.
98
+
99
+ Models are released as sharded safetensors files.
100
+
101
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
102
+ | ------ | ---- | -- | ----------- | ------- | ---- |
103
+ | [main](https://huggingface.co/TheBloke/openbuddy-zephyr-7B-v14.1-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.23 GB
104
+
105
+ <!-- README_AWQ.md-provided-files end -->
106
+
107
+ <!-- README_AWQ.md-text-generation-webui start -->
108
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
109
+
110
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
111
+
112
+ 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.
113
+
114
+ 1. Click the **Model tab**.
115
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/openbuddy-zephyr-7B-v14.1-AWQ`.
116
+ 3. Click **Download**.
117
+ 4. The model will start downloading. Once it's finished it will say "Done".
118
+ 5. In the top left, click the refresh icon next to **Model**.
119
+ 6. In the **Model** dropdown, choose the model you just downloaded: `openbuddy-zephyr-7B-v14.1-AWQ`
120
+ 7. Select **Loader: AutoAWQ**.
121
+ 8. Click Load, and the model will load and is now ready for use.
122
+ 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.
123
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
124
+ <!-- README_AWQ.md-text-generation-webui end -->
125
+
126
+ <!-- README_AWQ.md-use-from-vllm start -->
127
+ ## Multi-user inference server: vLLM
128
+
129
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
130
+
131
+ - Please ensure you are using vLLM version 0.2 or later.
132
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
133
+
134
+ For example:
135
+
136
+ ```shell
137
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/openbuddy-zephyr-7B-v14.1-AWQ --quantization awq
138
+ ```
139
+
140
+ - When using vLLM from Python code, again set `quantization=awq`.
141
+
142
+ For example:
143
+
144
+ ```python
145
+ from vllm import LLM, SamplingParams
146
+
147
+ prompts = [
148
+ "Tell me about AI",
149
+ "Write a story about llamas",
150
+ "What is 291 - 150?",
151
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
152
+ ]
153
+ prompt_template=f'''You are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human User.
154
+ Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
155
+ If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
156
+ You like to use emojis. You can speak fluently in many languages, for example: English, Chinese.
157
+ You cannot access the internet, but you have vast knowledge, cutoff: 2021-09.
158
+ You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based on LLaMA and Falcon transformers model, not related to GPT or OpenAI.
159
+
160
+ User: {prompt}
161
+ 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/openbuddy-zephyr-7B-v14.1-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/openbuddy-zephyr-7B-v14.1-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'''You are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human User.
204
+ Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
205
+ If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
206
+ You like to use emojis. You can speak fluently in many languages, for example: English, Chinese.
207
+ You cannot access the internet, but you have vast knowledge, cutoff: 2021-09.
208
+ You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based on LLaMA and Falcon transformers model, not related to GPT or OpenAI.
209
+
210
+ User: {prompt}
211
+ Assistant:
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 AutoAWQ
229
+
230
+ ### Install the AutoAWQ package
231
+
232
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later.
233
+
234
+ ```shell
235
+ pip3 install autoawq
236
+ ```
237
+
238
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
239
+
240
+ ```shell
241
+ pip3 uninstall -y autoawq
242
+ git clone https://github.com/casper-hansen/AutoAWQ
243
+ cd AutoAWQ
244
+ pip3 install .
245
+ ```
246
+
247
+ ### AutoAWQ example code
248
+
249
+ ```python
250
+ from awq import AutoAWQForCausalLM
251
+ from transformers import AutoTokenizer
252
+
253
+ model_name_or_path = "TheBloke/openbuddy-zephyr-7B-v14.1-AWQ"
254
+
255
+ # Load tokenizer
256
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
257
+ # Load model
258
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
259
+ trust_remote_code=False, safetensors=True)
260
+
261
+ prompt = "Tell me about AI"
262
+ prompt_template=f'''You are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human User.
263
+ Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
264
+ If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
265
+ You like to use emojis. You can speak fluently in many languages, for example: English, Chinese.
266
+ You cannot access the internet, but you have vast knowledge, cutoff: 2021-09.
267
+ You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based on LLaMA and Falcon transformers model, not related to GPT or OpenAI.
268
+
269
+ User: {prompt}
270
+ Assistant:
271
+ '''
272
+
273
+ print("*** Running model.generate:")
274
+
275
+ token_input = tokenizer(
276
+ prompt_template,
277
+ return_tensors='pt'
278
+ ).input_ids.cuda()
279
+
280
+ # Generate output
281
+ generation_output = model.generate(
282
+ token_input,
283
+ do_sample=True,
284
+ temperature=0.7,
285
+ top_p=0.95,
286
+ top_k=40,
287
+ max_new_tokens=512
288
+ )
289
+
290
+ # Get the tokens from the output, decode them, print them
291
+ token_output = generation_output[0]
292
+ text_output = tokenizer.decode(token_output)
293
+ print("LLM output: ", text_output)
294
+
295
+ """
296
+ # Inference should be possible with transformers pipeline as well in future
297
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
298
+ from transformers import pipeline
299
+
300
+ print("*** Pipeline:")
301
+ pipe = pipeline(
302
+ "text-generation",
303
+ model=model,
304
+ tokenizer=tokenizer,
305
+ max_new_tokens=512,
306
+ do_sample=True,
307
+ temperature=0.7,
308
+ top_p=0.95,
309
+ top_k=40,
310
+ repetition_penalty=1.1
311
+ )
312
+
313
+ print(pipe(prompt_template)[0]['generated_text'])
314
+ """
315
+ ```
316
+ <!-- README_AWQ.md-use-from-python end -->
317
+
318
+ <!-- README_AWQ.md-compatibility start -->
319
+ ## Compatibility
320
+
321
+ The files provided are tested to work with:
322
+
323
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
324
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
325
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
326
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
327
+
328
+ <!-- README_AWQ.md-compatibility end -->
329
+
330
+ <!-- footer start -->
331
+ <!-- 200823 -->
332
+ ## Discord
333
+
334
+ For further support, and discussions on these models and AI in general, join us at:
335
+
336
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
337
+
338
+ ## Thanks, and how to contribute
339
+
340
+ Thanks to the [chirper.ai](https://chirper.ai) team!
341
+
342
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
343
+
344
+ 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.
345
+
346
+ 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.
347
+
348
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
349
+
350
+ * Patreon: https://patreon.com/TheBlokeAI
351
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
352
+
353
+ **Special thanks to**: Aemon Algiz.
354
+
355
+ **Patreon special mentions**: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
356
+
357
+
358
+ Thank you to all my generous patrons and donaters!
359
+
360
+ And thank you again to a16z for their generous grant.
361
+
362
+ <!-- footer end -->
363
+
364
+ # Original model card: OpenBuddy's Openbuddy Zephyr 7B v14.1
365
+