TheBloke commited on
Commit
c322e77
1 Parent(s): 75526f1

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +382 -0
README.md ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: THUDM/agentlm-7b
3
+ datasets:
4
+ - THUDM/AgentInstruct
5
+ inference: false
6
+ license: llama2
7
+ model_creator: Knowledge Engineering Group (KEG
8
+ model_name: AgentLM 7B
9
+ model_type: llama
10
+ prompt_template: '[INST] <<SYS>>
11
+
12
+ You are a helpful, respectful and honest assistant.
13
+
14
+ <</SYS>>
15
+
16
+ {prompt} [/INST]
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
+ # AgentLM 7B - AWQ
41
+ - Model creator: [Knowledge Engineering Group (KEG](https://huggingface.co/THUDM)
42
+ - Original model: [AgentLM 7B](https://huggingface.co/THUDM/agentlm-7b)
43
+
44
+ <!-- description start -->
45
+ ## Description
46
+
47
+ This repo contains AWQ model files for [Knowledge Engineering Group (KEG's AgentLM 7B](https://huggingface.co/THUDM/agentlm-7b).
48
+
49
+
50
+ ### About AWQ
51
+
52
+ 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.
53
+
54
+ It is supported by:
55
+
56
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
57
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
58
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
59
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
60
+
61
+ <!-- description end -->
62
+ <!-- repositories-available start -->
63
+ ## Repositories available
64
+
65
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/agentlm-7B-AWQ)
66
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/agentlm-7B-GPTQ)
67
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/agentlm-7B-GGUF)
68
+ * [Knowledge Engineering Group (KEG's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/THUDM/agentlm-7b)
69
+ <!-- repositories-available end -->
70
+
71
+ <!-- prompt-template start -->
72
+ ## Prompt template: THUDM-Llama-2-Chat
73
+
74
+ ```
75
+ [INST] <<SYS>>
76
+ You are a helpful, respectful and honest assistant.
77
+ <</SYS>>
78
+ {prompt} [/INST]
79
+
80
+ ```
81
+
82
+ <!-- prompt-template end -->
83
+
84
+
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/agentlm-7B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.89 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/agentlm-7B-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: `agentlm-7B-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 python -m vllm.entrypoints.api_server --model TheBloke/agentlm-7B-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'''[INST] <<SYS>>
145
+ You are a helpful, respectful and honest assistant.
146
+ <</SYS>>
147
+ {prompt} [/INST]
148
+ '''
149
+
150
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
151
+
152
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
153
+
154
+ llm = LLM(model="TheBloke/agentlm-7B-AWQ", quantization="awq", dtype="auto")
155
+
156
+ outputs = llm.generate(prompts, sampling_params)
157
+
158
+ # Print the outputs.
159
+ for output in outputs:
160
+ prompt = output.prompt
161
+ generated_text = output.outputs[0].text
162
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
163
+ ```
164
+ <!-- README_AWQ.md-use-from-vllm start -->
165
+
166
+ <!-- README_AWQ.md-use-from-tgi start -->
167
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
168
+
169
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
170
+
171
+ Example Docker parameters:
172
+
173
+ ```shell
174
+ --model-id TheBloke/agentlm-7B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
175
+ ```
176
+
177
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
178
+
179
+ ```shell
180
+ pip3 install huggingface-hub
181
+ ```
182
+
183
+ ```python
184
+ from huggingface_hub import InferenceClient
185
+
186
+ endpoint_url = "https://your-endpoint-url-here"
187
+
188
+ prompt = "Tell me about AI"
189
+ prompt_template=f'''[INST] <<SYS>>
190
+ You are a helpful, respectful and honest assistant.
191
+ <</SYS>>
192
+ {prompt} [/INST]
193
+ '''
194
+
195
+ client = InferenceClient(endpoint_url)
196
+ response = client.text_generation(prompt,
197
+ max_new_tokens=128,
198
+ do_sample=True,
199
+ temperature=0.7,
200
+ top_p=0.95,
201
+ top_k=40,
202
+ repetition_penalty=1.1)
203
+
204
+ print(f"Model output: ", response)
205
+ ```
206
+ <!-- README_AWQ.md-use-from-tgi end -->
207
+
208
+ <!-- README_AWQ.md-use-from-python start -->
209
+ ## Inference from Python code using AutoAWQ
210
+
211
+ ### Install the AutoAWQ package
212
+
213
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later.
214
+
215
+ ```shell
216
+ pip3 install autoawq
217
+ ```
218
+
219
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
220
+
221
+ ```shell
222
+ pip3 uninstall -y autoawq
223
+ git clone https://github.com/casper-hansen/AutoAWQ
224
+ cd AutoAWQ
225
+ pip3 install .
226
+ ```
227
+
228
+ ### AutoAWQ example code
229
+
230
+ ```python
231
+ from awq import AutoAWQForCausalLM
232
+ from transformers import AutoTokenizer
233
+
234
+ model_name_or_path = "TheBloke/agentlm-7B-AWQ"
235
+
236
+ # Load tokenizer
237
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
238
+ # Load model
239
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
240
+ trust_remote_code=False, safetensors=True)
241
+
242
+ prompt = "Tell me about AI"
243
+ prompt_template=f'''[INST] <<SYS>>
244
+ You are a helpful, respectful and honest assistant.
245
+ <</SYS>>
246
+ {prompt} [/INST]
247
+ '''
248
+
249
+ print("*** Running model.generate:")
250
+
251
+ token_input = tokenizer(
252
+ prompt_template,
253
+ return_tensors='pt'
254
+ ).input_ids.cuda()
255
+
256
+ # Generate output
257
+ generation_output = model.generate(
258
+ token_input,
259
+ do_sample=True,
260
+ temperature=0.7,
261
+ top_p=0.95,
262
+ top_k=40,
263
+ max_new_tokens=512
264
+ )
265
+
266
+ # Get the tokens from the output, decode them, print them
267
+ token_output = generation_output[0]
268
+ text_output = tokenizer.decode(token_output)
269
+ print("LLM output: ", text_output)
270
+
271
+ """
272
+ # Inference should be possible with transformers pipeline as well in future
273
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
274
+ from transformers import pipeline
275
+
276
+ print("*** Pipeline:")
277
+ pipe = pipeline(
278
+ "text-generation",
279
+ model=model,
280
+ tokenizer=tokenizer,
281
+ max_new_tokens=512,
282
+ do_sample=True,
283
+ temperature=0.7,
284
+ top_p=0.95,
285
+ top_k=40,
286
+ repetition_penalty=1.1
287
+ )
288
+
289
+ print(pipe(prompt_template)[0]['generated_text'])
290
+ """
291
+ ```
292
+ <!-- README_AWQ.md-use-from-python end -->
293
+
294
+ <!-- README_AWQ.md-compatibility start -->
295
+ ## Compatibility
296
+
297
+ The files provided are tested to work with:
298
+
299
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
300
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
301
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
302
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
303
+
304
+ <!-- README_AWQ.md-compatibility end -->
305
+
306
+ <!-- footer start -->
307
+ <!-- 200823 -->
308
+ ## Discord
309
+
310
+ For further support, and discussions on these models and AI in general, join us at:
311
+
312
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
313
+
314
+ ## Thanks, and how to contribute
315
+
316
+ Thanks to the [chirper.ai](https://chirper.ai) team!
317
+
318
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
319
+
320
+ 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.
321
+
322
+ 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.
323
+
324
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
325
+
326
+ * Patreon: https://patreon.com/TheBlokeAI
327
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
328
+
329
+ **Special thanks to**: Aemon Algiz.
330
+
331
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
332
+
333
+
334
+ Thank you to all my generous patrons and donaters!
335
+
336
+ And thank you again to a16z for their generous grant.
337
+
338
+ <!-- footer end -->
339
+
340
+ # Original model card: Knowledge Engineering Group (KEG's AgentLM 7B
341
+
342
+
343
+ ## AgentLM-7B
344
+
345
+ <p align="center">
346
+ 🤗 <a href="https://huggingface.co/datasets/THUDM/AgentInstruct" target="_blank">[Dataset] </a> • 💻 <a href="https://github.com/THUDM/AgentTuning" target="_blank">[Github Repo]</a> • 📌 <a href="https://THUDM.github.io/AgentTuning/" target="_blank">[Project Page]</a> • 📃 <a href="https://arxiv.org/abs/2310.12823" target="_blank">[Paper]</a>
347
+ </p>
348
+
349
+ **AgentTuning** represents the very first attempt to instruction-tune LLMs using interaction trajectories across multiple agent tasks. Evaluation results indicate that AgentTuning enables the agent capabilities of LLMs with robust generalization on unseen agent tasks while remaining good on general language abilities. We have open-sourced the AgentInstruct dataset and AgentLM.
350
+
351
+ ## Models
352
+
353
+ **AgentLM** models are produced by mixed training on AgentInstruct dataset and ShareGPT dataset from Llama-2-chat models.
354
+
355
+ The models follow the conversation format of [Llama-2-chat](https://huggingface.co/blog/llama2#how-to-prompt-llama-2), with system prompt fixed as
356
+
357
+ ```
358
+ You are a helpful, respectful and honest assistant.
359
+ ```
360
+
361
+ 7B, 13B, and 70B models are available on Huggingface model hub.
362
+
363
+ |Model|Huggingface Repo|
364
+ |---|---|
365
+ |AgentLM-7B| [🤗Huggingface Repo](https://huggingface.co/THUDM/agentlm-7b) |
366
+ |AgentLM-13B| [🤗Huggingface Repo](https://huggingface.co/THUDM/agentlm-13b) |
367
+ |AgentLM-70B| [🤗Huggingface Repo](https://huggingface.co/THUDM/agentlm-70b) |
368
+
369
+ ## Citation
370
+
371
+ If you find our work useful, please consider citing AgentTuning:
372
+
373
+ ```
374
+ @misc{zeng2023agenttuning,
375
+ title={AgentTuning: Enabling Generalized Agent Abilities for LLMs},
376
+ author={Aohan Zeng and Mingdao Liu and Rui Lu and Bowen Wang and Xiao Liu and Yuxiao Dong and Jie Tang},
377
+ year={2023},
378
+ eprint={2310.12823},
379
+ archivePrefix={arXiv},
380
+ primaryClass={cs.CL}
381
+ }
382
+ ```