TheBloke commited on
Commit
42c8a0e
1 Parent(s): 02f4849

Upload README.md

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