TheBloke commited on
Commit
a594ed3
1 Parent(s): 889b585

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +257 -0
README.md ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/flozi00/Llama-2-13B-german-assistant-v2
3
+ datasets:
4
+ - flozi00/conversations
5
+ inference: false
6
+ language:
7
+ - en
8
+ - de
9
+ license: llama2
10
+ model_creator: Florian Zimmermeister
11
+ model_name: Llama 2 13B German Assistant v2
12
+ model_type: llama
13
+ prompt_template: '<|prompter|>{prompt}<|endoftext|><|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
+ # Llama 2 13B German Assistant v2 - AWQ
37
+ - Model creator: [Florian Zimmermeister](https://huggingface.co/flozi00)
38
+ - Original model: [Llama 2 13B German Assistant v2](https://huggingface.co/flozi00/Llama-2-13B-german-assistant-v2)
39
+
40
+ <!-- description start -->
41
+ ## Description
42
+
43
+ This repo contains AWQ model files for [flozi00's Llama 2 13B German Assistant v2](https://huggingface.co/flozi00/Llama-2-13B-german-assistant-v2).
44
+
45
+ Many thanks to William Beauchamp from [Chai](https://chai-research.com/) for providing the hardware used to make and upload these files!
46
+
47
+
48
+ ### About AWQ
49
+
50
+ 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.
51
+
52
+ It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of AWQ models for high-throughput concurrent inference in multi-user server scenarios. Note that, at the time of writing, overall throughput is still lower than running vLLM 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.
53
+ <!-- description end -->
54
+ <!-- repositories-available start -->
55
+ ## Repositories available
56
+
57
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/llama-2-13B-German-Assistant-v2-AWQ)
58
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/llama-2-13B-German-Assistant-v2-GPTQ)
59
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/llama-2-13B-German-Assistant-v2-GGUF)
60
+ * [Florian Zimmermeister's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/flozi00/Llama-2-13B-german-assistant-v2)
61
+ <!-- repositories-available end -->
62
+
63
+ <!-- prompt-template start -->
64
+ ## Prompt template: OpenAssistant
65
+
66
+ ```
67
+ <|prompter|>{prompt}<|endoftext|><|assistant|>
68
+
69
+ ```
70
+
71
+ <!-- prompt-template end -->
72
+
73
+
74
+ <!-- README_AWQ.md-provided-files start -->
75
+ ## Provided files and AWQ parameters
76
+
77
+ 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.
78
+
79
+ Models are released as sharded safetensors files.
80
+
81
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
82
+ | ------ | ---- | -- | ----------- | ------- | ---- |
83
+ | [main](https://huggingface.co/TheBloke/llama-2-13B-German-Assistant-v2-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
84
+
85
+ <!-- README_AWQ.md-provided-files end -->
86
+
87
+ <!-- README_AWQ.md-use-from-vllm start -->
88
+ ## Serving this model from vLLM
89
+
90
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
91
+
92
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
93
+
94
+ ```shell
95
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/llama-2-13B-German-Assistant-v2-AWQ --quantization awq
96
+ ```
97
+
98
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
99
+
100
+ ```python
101
+ from vllm import LLM, SamplingParams
102
+
103
+ prompts = [
104
+ "Hello, my name is",
105
+ "The president of the United States is",
106
+ "The capital of France is",
107
+ "The future of AI is",
108
+ ]
109
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
110
+
111
+ llm = LLM(model="TheBloke/llama-2-13B-German-Assistant-v2-AWQ", quantization="awq")
112
+
113
+ outputs = llm.generate(prompts, sampling_params)
114
+
115
+ # Print the outputs.
116
+ for output in outputs:
117
+ prompt = output.prompt
118
+ generated_text = output.outputs[0].text
119
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
120
+ ```
121
+ <!-- README_AWQ.md-use-from-vllm start -->
122
+
123
+ <!-- README_AWQ.md-use-from-python start -->
124
+ ## How to use this AWQ model from Python code
125
+
126
+ ### Install the necessary packages
127
+
128
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
129
+
130
+ ```shell
131
+ pip3 install autoawq
132
+ ```
133
+
134
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
135
+
136
+ ```shell
137
+ pip3 uninstall -y autoawq
138
+ git clone https://github.com/casper-hansen/AutoAWQ
139
+ cd AutoAWQ
140
+ pip3 install .
141
+ ```
142
+
143
+ ### You can then try the following example code
144
+
145
+ ```python
146
+ from awq import AutoAWQForCausalLM
147
+ from transformers import AutoTokenizer
148
+
149
+ model_name_or_path = "TheBloke/llama-2-13B-German-Assistant-v2-AWQ"
150
+
151
+ # Load model
152
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
153
+ trust_remote_code=False, safetensors=True)
154
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
155
+
156
+ prompt = "Tell me about AI"
157
+ prompt_template=f'''<|prompter|>{prompt}<|endoftext|><|assistant|>
158
+
159
+ '''
160
+
161
+ print("\n\n*** Generate:")
162
+
163
+ tokens = tokenizer(
164
+ prompt_template,
165
+ return_tensors='pt'
166
+ ).input_ids.cuda()
167
+
168
+ # Generate output
169
+ generation_output = model.generate(
170
+ tokens,
171
+ do_sample=True,
172
+ temperature=0.7,
173
+ top_p=0.95,
174
+ top_k=40,
175
+ max_new_tokens=512
176
+ )
177
+
178
+ print("Output: ", tokenizer.decode(generation_output[0]))
179
+
180
+ # Inference can also be done using transformers' pipeline
181
+ from transformers import pipeline
182
+
183
+ print("*** Pipeline:")
184
+ pipe = pipeline(
185
+ "text-generation",
186
+ model=model,
187
+ tokenizer=tokenizer,
188
+ max_new_tokens=512,
189
+ do_sample=True,
190
+ temperature=0.7,
191
+ top_p=0.95,
192
+ top_k=40,
193
+ repetition_penalty=1.1
194
+ )
195
+
196
+ print(pipe(prompt_template)[0]['generated_text'])
197
+ ```
198
+ <!-- README_AWQ.md-use-from-python end -->
199
+
200
+ <!-- README_AWQ.md-compatibility start -->
201
+ ## Compatibility
202
+
203
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
204
+
205
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is not yet compatible with AWQ, but a PR is open which should bring support soon: [TGI PR #781](https://github.com/huggingface/text-generation-inference/issues/781).
206
+ <!-- README_AWQ.md-compatibility end -->
207
+
208
+ <!-- footer start -->
209
+ <!-- 200823 -->
210
+ ## Discord
211
+
212
+ For further support, and discussions on these models and AI in general, join us at:
213
+
214
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
215
+
216
+ ## Thanks, and how to contribute
217
+
218
+ Thanks to the [chirper.ai](https://chirper.ai) team!
219
+
220
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
221
+
222
+ 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.
223
+
224
+ 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.
225
+
226
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
227
+
228
+ * Patreon: https://patreon.com/TheBlokeAI
229
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
230
+
231
+ **Special thanks to**: Aemon Algiz.
232
+
233
+ **Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
234
+
235
+
236
+ Thank you to all my generous patrons and donaters!
237
+
238
+ And thank you again to a16z for their generous grant.
239
+
240
+ <!-- footer end -->
241
+
242
+ # Original model card: flozi00's Llama 2 13B German Assistant v2
243
+
244
+
245
+ ## This project is sponsored by [ ![PrimeLine](https://www.primeline-solutions.com/skin/frontend/default/theme566/images/primeline-solutions-logo.png) ](https://www.primeline-solutions.com/de/server/nach-einsatzzweck/gpu-rendering-hpc/)
246
+
247
+ Please Use V3 of this model instead
248
+
249
+ # Model Card
250
+
251
+ This model is an finetuned version for german instructions and conversations in style of Open Assistant tokens. "<|prompter|>" "<|endoftext|>" "<|assistant|>"
252
+
253
+ The dataset used is deduplicated and cleaned, with no codes inside. The focus is on instruction following and conversational tasks.
254
+
255
+ The model archictecture is based on Llama version 2 with 13B parameters, trained on 100% renewable energy powered hardware.
256
+
257
+ This work is contributed by private research of [flozi00](https://huggingface.co/flozi00)