TheBloke commited on
Commit
0347ad2
1 Parent(s): 8453984

Upload README.md

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