TheBloke commited on
Commit
ec50f13
1 Parent(s): 4b11d4e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +369 -0
README.md ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: teknium/Mistral-Trismegistus-7B
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: apache-2.0
7
+ model-index:
8
+ - name: Mistral-Trismegistus-7B
9
+ results: []
10
+ model_creator: Teknium
11
+ model_name: Mistral Trismegistus 7B
12
+ model_type: mistral
13
+ prompt_template: 'USER: {prompt}
14
+
15
+ ASSISTANT:
16
+
17
+ '
18
+ quantized_by: TheBloke
19
+ tags:
20
+ - mistral-7b
21
+ - instruct
22
+ - finetune
23
+ - gpt4
24
+ - synthetic data
25
+ - distillation
26
+ ---
27
+
28
+ <!-- header start -->
29
+ <!-- 200823 -->
30
+ <div style="width: auto; margin-left: auto; margin-right: auto">
31
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
32
+ </div>
33
+ <div style="display: flex; justify-content: space-between; width: 100%;">
34
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
35
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
36
+ </div>
37
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
38
+ <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>
39
+ </div>
40
+ </div>
41
+ <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>
42
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
43
+ <!-- header end -->
44
+
45
+ # Mistral Trismegistus 7B - AWQ
46
+ - Model creator: [Teknium](https://huggingface.co/teknium)
47
+ - Original model: [Mistral Trismegistus 7B](https://huggingface.co/teknium/Mistral-Trismegistus-7B)
48
+
49
+ <!-- description start -->
50
+ ## Description
51
+
52
+ This repo contains AWQ model files for [Teknium's Mistral Trismegistus 7B](https://huggingface.co/teknium/Mistral-Trismegistus-7B).
53
+
54
+
55
+ ### About AWQ
56
+
57
+ 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.
58
+
59
+ It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of Llama AWQ models for high-throughput concurrent inference in multi-user server scenarios.
60
+
61
+ As of September 25th 2023, preliminary Llama-only AWQ support has also been added to [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference).
62
+
63
+ Note that, at the time of writing, overall throughput is still lower than running vLLM or TGI 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.
64
+ <!-- description end -->
65
+ <!-- repositories-available start -->
66
+ ## Repositories available
67
+
68
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Mistral-Trismegistus-7B-AWQ)
69
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mistral-Trismegistus-7B-GPTQ)
70
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mistral-Trismegistus-7B-GGUF)
71
+ * [Teknium's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/teknium/Mistral-Trismegistus-7B)
72
+ <!-- repositories-available end -->
73
+
74
+ <!-- prompt-template start -->
75
+ ## Prompt template: User-Assistant
76
+
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/Mistral-Trismegistus-7B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.15 GB
96
+
97
+ <!-- README_AWQ.md-provided-files end -->
98
+
99
+ <!-- README_AWQ.md-use-from-vllm start -->
100
+ ## Serving this model from vLLM
101
+
102
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
103
+
104
+ Note: at the time of writing, vLLM has not yet done a new release with AWQ support.
105
+
106
+ If you try the vLLM examples below and get an error about `quantization` being unrecognised, or other AWQ-related issues, please install vLLM from Github source.
107
+
108
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
109
+
110
+ ```shell
111
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Mistral-Trismegistus-7B-AWQ --quantization awq --dtype half
112
+ ```
113
+
114
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
115
+
116
+ ```python
117
+ from vllm import LLM, SamplingParams
118
+
119
+ prompts = [
120
+ "Hello, my name is",
121
+ "The president of the United States is",
122
+ "The capital of France is",
123
+ "The future of AI is",
124
+ ]
125
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
126
+
127
+ llm = LLM(model="TheBloke/Mistral-Trismegistus-7B-AWQ", quantization="awq", dtype="half")
128
+
129
+ outputs = llm.generate(prompts, sampling_params)
130
+
131
+ # Print the outputs.
132
+ for output in outputs:
133
+ prompt = output.prompt
134
+ generated_text = output.outputs[0].text
135
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
136
+ ```
137
+ <!-- README_AWQ.md-use-from-vllm start -->
138
+
139
+ <!-- README_AWQ.md-use-from-tgi start -->
140
+ ## Serving this model from Text Generation Inference (TGI)
141
+
142
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
143
+
144
+ Example Docker parameters:
145
+
146
+ ```shell
147
+ --model-id TheBloke/Mistral-Trismegistus-7B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
148
+ ```
149
+
150
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
151
+
152
+ ```shell
153
+ pip3 install huggingface-hub
154
+ ```
155
+
156
+ ```python
157
+ from huggingface_hub import InferenceClient
158
+
159
+ endpoint_url = "https://your-endpoint-url-here"
160
+
161
+ prompt = "Tell me about AI"
162
+ prompt_template=f'''USER: {prompt}
163
+ ASSISTANT:
164
+
165
+ '''
166
+
167
+ client = InferenceClient(endpoint_url)
168
+ response = client.text_generation(prompt,
169
+ max_new_tokens=128,
170
+ do_sample=True,
171
+ temperature=0.7,
172
+ top_p=0.95,
173
+ top_k=40,
174
+ repetition_penalty=1.1)
175
+
176
+ print(f"Model output: {response}")
177
+ ```
178
+ <!-- README_AWQ.md-use-from-tgi end -->
179
+
180
+ <!-- README_AWQ.md-use-from-python start -->
181
+ ## How to use this AWQ model from Python code
182
+
183
+ ### Install the necessary packages
184
+
185
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later
186
+
187
+ ```shell
188
+ pip3 install autoawq
189
+ ```
190
+
191
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
192
+
193
+ ```shell
194
+ pip3 uninstall -y autoawq
195
+ git clone https://github.com/casper-hansen/AutoAWQ
196
+ cd AutoAWQ
197
+ pip3 install .
198
+ ```
199
+
200
+ ### You can then try the following example code
201
+
202
+ ```python
203
+ from awq import AutoAWQForCausalLM
204
+ from transformers import AutoTokenizer
205
+
206
+ model_name_or_path = "TheBloke/Mistral-Trismegistus-7B-AWQ"
207
+
208
+ # Load model
209
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
210
+ trust_remote_code=False, safetensors=True)
211
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
212
+
213
+ prompt = "Tell me about AI"
214
+ prompt_template=f'''USER: {prompt}
215
+ ASSISTANT:
216
+
217
+ '''
218
+
219
+ print("\n\n*** Generate:")
220
+
221
+ tokens = tokenizer(
222
+ prompt_template,
223
+ return_tensors='pt'
224
+ ).input_ids.cuda()
225
+
226
+ # Generate output
227
+ generation_output = model.generate(
228
+ tokens,
229
+ do_sample=True,
230
+ temperature=0.7,
231
+ top_p=0.95,
232
+ top_k=40,
233
+ max_new_tokens=512
234
+ )
235
+
236
+ print("Output: ", tokenizer.decode(generation_output[0]))
237
+
238
+ """
239
+ # Inference should be possible with transformers pipeline as well in future
240
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
241
+ from transformers import pipeline
242
+
243
+ print("*** Pipeline:")
244
+ pipe = pipeline(
245
+ "text-generation",
246
+ model=model,
247
+ tokenizer=tokenizer,
248
+ max_new_tokens=512,
249
+ do_sample=True,
250
+ temperature=0.7,
251
+ top_p=0.95,
252
+ top_k=40,
253
+ repetition_penalty=1.1
254
+ )
255
+
256
+ print(pipe(prompt_template)[0]['generated_text'])
257
+ """
258
+ ```
259
+ <!-- README_AWQ.md-use-from-python end -->
260
+
261
+ <!-- README_AWQ.md-compatibility start -->
262
+ ## Compatibility
263
+
264
+ The files provided are tested to work with:
265
+
266
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ)
267
+ - [vLLM](https://github.com/vllm-project/vllm)
268
+ - [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
269
+
270
+ TGI merged AWQ support on September 25th, 2023: [TGI PR #1054](https://github.com/huggingface/text-generation-inference/pull/1054). Use the `:latest` Docker container until the next TGI release is made.
271
+
272
+ <!-- README_AWQ.md-compatibility end -->
273
+
274
+ <!-- footer start -->
275
+ <!-- 200823 -->
276
+ ## Discord
277
+
278
+ For further support, and discussions on these models and AI in general, join us at:
279
+
280
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
281
+
282
+ ## Thanks, and how to contribute
283
+
284
+ Thanks to the [chirper.ai](https://chirper.ai) team!
285
+
286
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
287
+
288
+ 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.
289
+
290
+ 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.
291
+
292
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
293
+
294
+ * Patreon: https://patreon.com/TheBlokeAI
295
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
296
+
297
+ **Special thanks to**: Aemon Algiz.
298
+
299
+ **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
300
+
301
+
302
+ Thank you to all my generous patrons and donaters!
303
+
304
+ And thank you again to a16z for their generous grant.
305
+
306
+ <!-- footer end -->
307
+
308
+ # Original model card: Teknium's Mistral Trismegistus 7B
309
+
310
+ **Mistral Trismegistus 7B**
311
+
312
+ <div style="display: flex; justify-content: center;">
313
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/3VJvztFDB1XOWfShuHnb6.png" alt="Mistral Trismegistus" width="50%" style="display: block; margin: 0 auto;">
314
+ </div>
315
+
316
+ ## Model Description:
317
+
318
+ Transcendence is All You Need! Mistral Trismegistus is a model made for people interested in the esoteric, occult, and spiritual.
319
+
320
+ Here are some outputs:
321
+
322
+ Answer questions about occult artifacts:
323
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/WeLd-zbZVwRe6HjxyRYMh.png)
324
+
325
+ Play the role of a hypnotist:
326
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/fdYQacOpD3GrLCdgCrMLu.png)
327
+
328
+
329
+ ## Special Features:
330
+ - **The First Powerful Occult Expert Model**: 35,000 high quality, deep, rich, instructions on the occult, esoteric, and spiritual.
331
+ - **Fast**: Trained on Mistral, a state of the art 7B parameter model, you can run this model FAST on even a cpu.
332
+ - **Not a positivity-nazi**: This model was trained on all forms of esoteric tasks and knowledge, and is not burdened by the flowery nature of many other models, who chose positivity over creativity.
333
+
334
+ ## Acknowledgements:
335
+
336
+ Special thanks to @a16z.
337
+
338
+ ## Dataset:
339
+
340
+ This model was trained on a 100% synthetic, gpt-4 generated dataset, about 35,000 examples, on a wide and diverse set of both tasks and knowledge about the esoteric, occult, and spiritual.
341
+
342
+ The dataset will be released soon!
343
+
344
+ ## Usage:
345
+
346
+ Prompt Format:
347
+ ```
348
+ USER: <prompt>
349
+ ASSISTANT:
350
+ ```
351
+ OR
352
+ ```
353
+ <system message>
354
+ USER: <prompt>
355
+ ASSISTANT:
356
+ ```
357
+
358
+ ## Benchmarks:
359
+
360
+ No benchmark can capture the nature and essense of the quality of spirituality and esoteric knowledge and tasks. You will have to try testing it yourself!
361
+
362
+ Training run on wandb here: https://wandb.ai/teknium1/occult-expert-mistral-7b/runs/coccult-expert-mistral-6/overview
363
+
364
+ ## Licensing:
365
+
366
+ Apache 2.0
367
+
368
+ ---
369
+