TheBloke commited on
Commit
5f8f312
1 Parent(s): 816a553

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +279 -0
README.md ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/augtoma/qCammel-13
3
+ inference: false
4
+ language:
5
+ - en
6
+ library_name: transformers
7
+ license: other
8
+ model_creator: augtoma
9
+ model_name: qCammel 13
10
+ model_type: llama
11
+ pipeline_tag: text-generation
12
+ prompt_template: 'A chat between a curious user and an artificial intelligence assistant.
13
+ The assistant gives helpful, detailed, and polite answers to the user''s questions.
14
+ USER: {prompt} ASSISTANT:
15
+
16
+ '
17
+ quantized_by: TheBloke
18
+ tags:
19
+ - pytorch
20
+ - llama
21
+ - llama-2
22
+ - qCammel-13
23
+ ---
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
+ # qCammel 13 - AWQ
43
+ - Model creator: [augtoma](https://huggingface.co/augtoma)
44
+ - Original model: [qCammel 13](https://huggingface.co/augtoma/qCammel-13)
45
+
46
+ <!-- description start -->
47
+ ## Description
48
+
49
+ This repo contains AWQ model files for [augtoma's qCammel 13](https://huggingface.co/augtoma/qCammel-13).
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.
55
+
56
+ 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.
57
+ <!-- description end -->
58
+ <!-- repositories-available start -->
59
+ ## Repositories available
60
+
61
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/qCammel-13-AWQ)
62
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/qCammel-13-GPTQ)
63
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/qCammel-13-GGUF)
64
+ * [augtoma's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/augtoma/qCammel-13)
65
+ <!-- repositories-available end -->
66
+
67
+ <!-- prompt-template start -->
68
+ ## Prompt template: Vicuna
69
+
70
+ ```
71
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
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 `other`, 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: [augtoma's qCammel 13](https://huggingface.co/augtoma/qCammel-13).
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/qCammel-13-AWQ/tree/main) | 4 | 128 | [Medical Meadow WikiDoc](https://huggingface.co/datasets/medalpaca/medical_meadow_wikidoc) | 4096 | 7.25 GB
95
+
96
+ <!-- README_AWQ.md-provided-files end -->
97
+
98
+ <!-- README_AWQ.md-use-from-vllm start -->
99
+ ## Serving this model from vLLM
100
+
101
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
102
+
103
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
104
+
105
+ ```shell
106
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/qCammel-13-AWQ --quantization awq
107
+ ```
108
+
109
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
110
+
111
+ ```python
112
+ from vllm import LLM, SamplingParams
113
+
114
+ prompts = [
115
+ "Hello, my name is",
116
+ "The president of the United States is",
117
+ "The capital of France is",
118
+ "The future of AI is",
119
+ ]
120
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
121
+
122
+ llm = LLM(model="TheBloke/qCammel-13-AWQ", quantization="awq")
123
+
124
+ outputs = llm.generate(prompts, sampling_params)
125
+
126
+ # Print the outputs.
127
+ for output in outputs:
128
+ prompt = output.prompt
129
+ generated_text = output.outputs[0].text
130
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
131
+ ```
132
+ <!-- README_AWQ.md-use-from-vllm start -->
133
+
134
+ <!-- README_AWQ.md-use-from-python start -->
135
+ ## How to use this AWQ model from Python code
136
+
137
+ ### Install the necessary packages
138
+
139
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
140
+
141
+ ```shell
142
+ pip3 install autoawq
143
+ ```
144
+
145
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
146
+
147
+ ```shell
148
+ pip3 uninstall -y autoawq
149
+ git clone https://github.com/casper-hansen/AutoAWQ
150
+ cd AutoAWQ
151
+ pip3 install .
152
+ ```
153
+
154
+ ### You can then try the following example code
155
+
156
+ ```python
157
+ from awq import AutoAWQForCausalLM
158
+ from transformers import AutoTokenizer
159
+
160
+ model_name_or_path = "TheBloke/qCammel-13-AWQ"
161
+
162
+ # Load model
163
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
164
+ trust_remote_code=False, safetensors=True)
165
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
166
+
167
+ prompt = "Tell me about AI"
168
+ prompt_template=f'''A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
169
+
170
+ '''
171
+
172
+ print("\n\n*** Generate:")
173
+
174
+ tokens = tokenizer(
175
+ prompt_template,
176
+ return_tensors='pt'
177
+ ).input_ids.cuda()
178
+
179
+ # Generate output
180
+ generation_output = model.generate(
181
+ tokens,
182
+ do_sample=True,
183
+ temperature=0.7,
184
+ top_p=0.95,
185
+ top_k=40,
186
+ max_new_tokens=512
187
+ )
188
+
189
+ print("Output: ", tokenizer.decode(generation_output[0]))
190
+
191
+ # Inference can also be done using transformers' pipeline
192
+ from transformers import pipeline
193
+
194
+ print("*** Pipeline:")
195
+ pipe = pipeline(
196
+ "text-generation",
197
+ model=model,
198
+ tokenizer=tokenizer,
199
+ max_new_tokens=512,
200
+ do_sample=True,
201
+ temperature=0.7,
202
+ top_p=0.95,
203
+ top_k=40,
204
+ repetition_penalty=1.1
205
+ )
206
+
207
+ print(pipe(prompt_template)[0]['generated_text'])
208
+ ```
209
+ <!-- README_AWQ.md-use-from-python end -->
210
+
211
+ <!-- README_AWQ.md-compatibility start -->
212
+ ## Compatibility
213
+
214
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
215
+
216
+ [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).
217
+ <!-- README_AWQ.md-compatibility end -->
218
+
219
+ <!-- footer start -->
220
+ <!-- 200823 -->
221
+ ## Discord
222
+
223
+ For further support, and discussions on these models and AI in general, join us at:
224
+
225
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
226
+
227
+ ## Thanks, and how to contribute
228
+
229
+ Thanks to the [chirper.ai](https://chirper.ai) team!
230
+
231
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
232
+
233
+ 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.
234
+
235
+ 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.
236
+
237
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
238
+
239
+ * Patreon: https://patreon.com/TheBlokeAI
240
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
241
+
242
+ **Special thanks to**: Aemon Algiz.
243
+
244
+ **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
245
+
246
+
247
+ Thank you to all my generous patrons and donaters!
248
+
249
+ And thank you again to a16z for their generous grant.
250
+
251
+ <!-- footer end -->
252
+
253
+ # Original model card: augtoma's qCammel 13
254
+
255
+ # qCammel-13
256
+ qCammel-13 is a fine-tuned version of Llama-2 13B model, trained on a distilled dataset of 15,000 instructions using QLoRA. This model is optimized for academic medical knowledge and instruction-following capabilities.
257
+
258
+ ## Model Details
259
+ *Note: Use of this model is governed by the Meta license. In order to download the model weights and tokenizer, please visit the [website](https://ai.meta.com/resources/models-and-libraries/llama-downloads/) and accept their License before downloading this model .*
260
+
261
+ The fine-tuning process applied to qCammel-13 involves a distilled dataset of 15,000 instructions and is trained with QLoRA,
262
+
263
+
264
+ **Variations** The original Llama 2 has parameter sizes of 7B, 13B, and 70B. This is the fine-tuned version of the 13B model.
265
+
266
+ **Input** Models input text only.
267
+
268
+ **Output** Models generate text only.
269
+
270
+ **Model Architecture** qCammel-13 is based on the Llama 2 architecture, an auto-regressive language model that uses a decoder only transformer architecture.
271
+
272
+ **License** A custom commercial license is available at: [https://ai.meta.com/resources/models-and-libraries/llama-downloads/](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)
273
+ Llama 2 is licensed under the LLAMA 2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved
274
+
275
+ **Research Papers**
276
+ - [Clinical Camel: An Open-Source Expert-Level Medical Language Model with Dialogue-Based Knowledge Encoding](https://arxiv.org/abs/2305.12031)
277
+ - [QLoRA: Efficient Finetuning of Quantized LLMs](https://arxiv.org/abs/2305.14314)
278
+ - [LLaMA: Open and Efficient Foundation Language Models](https://arxiv.org/abs/2302.13971)
279
+