TheBloke commited on
Commit
10134af
1 Parent(s): d38b68e

Upload README.md

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