Adapters
Safetensors
mistral
chemistry
biology
climate
science
philosophy
nature
ecology
biomimicry
fauna
flora
4-bit precision
awq
TheBloke commited on
Commit
71c892a
1 Parent(s): 91a1344

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +387 -0
README.md ADDED
@@ -0,0 +1,387 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Severian/ANIMA-Phi-Neptune-Mistral-7B
3
+ datasets:
4
+ - Severian/Biomimicry
5
+ - emrgnt-cmplxty/sciphi-textbooks-are-all-you-need
6
+ - fmars/wiki_stem
7
+ - fblgit/tree-of-knowledge
8
+ - Severian/Bio-Design-Process
9
+ inference: false
10
+ library_name: adapter-transformers
11
+ license: mit
12
+ model_creator: Severian
13
+ model_name: Anima Phi Neptune Mistral 7B
14
+ model_type: mistral
15
+ prompt_template: '[INST] {prompt} [/INST]
16
+
17
+ '
18
+ quantized_by: TheBloke
19
+ tags:
20
+ - chemistry
21
+ - biology
22
+ - climate
23
+ - science
24
+ - philosophy
25
+ - nature
26
+ - ecology
27
+ - biomimicry
28
+ - fauna
29
+ - flora
30
+ ---
31
+
32
+ <!-- header start -->
33
+ <!-- 200823 -->
34
+ <div style="width: auto; margin-left: auto; margin-right: auto">
35
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
36
+ </div>
37
+ <div style="display: flex; justify-content: space-between; width: 100%;">
38
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
39
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
40
+ </div>
41
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
42
+ <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>
43
+ </div>
44
+ </div>
45
+ <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>
46
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
47
+ <!-- header end -->
48
+
49
+ # Anima Phi Neptune Mistral 7B - AWQ
50
+ - Model creator: [Severian](https://huggingface.co/Severian)
51
+ - Original model: [Anima Phi Neptune Mistral 7B](https://huggingface.co/Severian/ANIMA-Phi-Neptune-Mistral-7B)
52
+
53
+ <!-- description start -->
54
+ ## Description
55
+
56
+ This repo contains AWQ model files for [Severian's Anima Phi Neptune Mistral 7B](https://huggingface.co/Severian/ANIMA-Phi-Neptune-Mistral-7B).
57
+
58
+
59
+ ### About AWQ
60
+
61
+ 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.
62
+
63
+ 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.
64
+
65
+ 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).
66
+
67
+ 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.
68
+ <!-- description end -->
69
+ <!-- repositories-available start -->
70
+ ## Repositories available
71
+
72
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/ANIMA-Phi-Neptune-Mistral-7B-AWQ)
73
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/ANIMA-Phi-Neptune-Mistral-7B-GPTQ)
74
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/ANIMA-Phi-Neptune-Mistral-7B-GGUF)
75
+ * [Severian's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Severian/ANIMA-Phi-Neptune-Mistral-7B)
76
+ <!-- repositories-available end -->
77
+
78
+ <!-- prompt-template start -->
79
+ ## Prompt template: INST
80
+
81
+ ```
82
+ [INST] {prompt} [/INST]
83
+
84
+ ```
85
+
86
+ <!-- prompt-template end -->
87
+
88
+
89
+ <!-- README_AWQ.md-provided-files start -->
90
+ ## Provided files, and AWQ parameters
91
+
92
+ 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.
93
+
94
+ Models are released as sharded safetensors files.
95
+
96
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
97
+ | ------ | ---- | -- | ----------- | ------- | ---- |
98
+ | [main](https://huggingface.co/TheBloke/ANIMA-Phi-Neptune-Mistral-7B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.15 GB
99
+
100
+ <!-- README_AWQ.md-provided-files end -->
101
+
102
+ <!-- README_AWQ.md-use-from-vllm start -->
103
+ ## Serving this model from vLLM
104
+
105
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
106
+
107
+ Note: at the time of writing, vLLM has not yet done a new release with AWQ support.
108
+
109
+ 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.
110
+
111
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
112
+
113
+ ```shell
114
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/ANIMA-Phi-Neptune-Mistral-7B-AWQ --quantization awq --dtype half
115
+ ```
116
+
117
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
118
+
119
+ ```python
120
+ from vllm import LLM, SamplingParams
121
+
122
+ prompts = [
123
+ "Hello, my name is",
124
+ "The president of the United States is",
125
+ "The capital of France is",
126
+ "The future of AI is",
127
+ ]
128
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
129
+
130
+ llm = LLM(model="TheBloke/ANIMA-Phi-Neptune-Mistral-7B-AWQ", quantization="awq", dtype="half")
131
+
132
+ outputs = llm.generate(prompts, sampling_params)
133
+
134
+ # Print the outputs.
135
+ for output in outputs:
136
+ prompt = output.prompt
137
+ generated_text = output.outputs[0].text
138
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
139
+ ```
140
+ <!-- README_AWQ.md-use-from-vllm start -->
141
+
142
+ <!-- README_AWQ.md-use-from-tgi start -->
143
+ ## Serving this model from Text Generation Inference (TGI)
144
+
145
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
146
+
147
+ Example Docker parameters:
148
+
149
+ ```shell
150
+ --model-id TheBloke/ANIMA-Phi-Neptune-Mistral-7B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
151
+ ```
152
+
153
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
154
+
155
+ ```shell
156
+ pip3 install huggingface-hub
157
+ ```
158
+
159
+ ```python
160
+ from huggingface_hub import InferenceClient
161
+
162
+ endpoint_url = "https://your-endpoint-url-here"
163
+
164
+ prompt = "Tell me about AI"
165
+ prompt_template=f'''[INST] {prompt} [/INST]
166
+
167
+ '''
168
+
169
+ client = InferenceClient(endpoint_url)
170
+ response = client.text_generation(prompt,
171
+ max_new_tokens=128,
172
+ do_sample=True,
173
+ temperature=0.7,
174
+ top_p=0.95,
175
+ top_k=40,
176
+ repetition_penalty=1.1)
177
+
178
+ print(f"Model output: {response}")
179
+ ```
180
+ <!-- README_AWQ.md-use-from-tgi end -->
181
+
182
+ <!-- README_AWQ.md-use-from-python start -->
183
+ ## How to use this AWQ model from Python code
184
+
185
+ ### Install the necessary packages
186
+
187
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later
188
+
189
+ ```shell
190
+ pip3 install autoawq
191
+ ```
192
+
193
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
194
+
195
+ ```shell
196
+ pip3 uninstall -y autoawq
197
+ git clone https://github.com/casper-hansen/AutoAWQ
198
+ cd AutoAWQ
199
+ pip3 install .
200
+ ```
201
+
202
+ ### You can then try the following example code
203
+
204
+ ```python
205
+ from awq import AutoAWQForCausalLM
206
+ from transformers import AutoTokenizer
207
+
208
+ model_name_or_path = "TheBloke/ANIMA-Phi-Neptune-Mistral-7B-AWQ"
209
+
210
+ # Load model
211
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
212
+ trust_remote_code=False, safetensors=True)
213
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
214
+
215
+ prompt = "Tell me about AI"
216
+ prompt_template=f'''[INST] {prompt} [/INST]
217
+
218
+ '''
219
+
220
+ print("\n\n*** Generate:")
221
+
222
+ tokens = tokenizer(
223
+ prompt_template,
224
+ return_tensors='pt'
225
+ ).input_ids.cuda()
226
+
227
+ # Generate output
228
+ generation_output = model.generate(
229
+ tokens,
230
+ do_sample=True,
231
+ temperature=0.7,
232
+ top_p=0.95,
233
+ top_k=40,
234
+ max_new_tokens=512
235
+ )
236
+
237
+ print("Output: ", tokenizer.decode(generation_output[0]))
238
+
239
+ """
240
+ # Inference should be possible with transformers pipeline as well in future
241
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
242
+ from transformers import pipeline
243
+
244
+ print("*** Pipeline:")
245
+ pipe = pipeline(
246
+ "text-generation",
247
+ model=model,
248
+ tokenizer=tokenizer,
249
+ max_new_tokens=512,
250
+ do_sample=True,
251
+ temperature=0.7,
252
+ top_p=0.95,
253
+ top_k=40,
254
+ repetition_penalty=1.1
255
+ )
256
+
257
+ print(pipe(prompt_template)[0]['generated_text'])
258
+ """
259
+ ```
260
+ <!-- README_AWQ.md-use-from-python end -->
261
+
262
+ <!-- README_AWQ.md-compatibility start -->
263
+ ## Compatibility
264
+
265
+ The files provided are tested to work with:
266
+
267
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ)
268
+ - [vLLM](https://github.com/vllm-project/vllm)
269
+ - [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
270
+
271
+ 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.
272
+
273
+ <!-- README_AWQ.md-compatibility end -->
274
+
275
+ <!-- footer start -->
276
+ <!-- 200823 -->
277
+ ## Discord
278
+
279
+ For further support, and discussions on these models and AI in general, join us at:
280
+
281
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
282
+
283
+ ## Thanks, and how to contribute
284
+
285
+ Thanks to the [chirper.ai](https://chirper.ai) team!
286
+
287
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
288
+
289
+ 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.
290
+
291
+ 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.
292
+
293
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
294
+
295
+ * Patreon: https://patreon.com/TheBlokeAI
296
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
297
+
298
+ **Special thanks to**: Aemon Algiz.
299
+
300
+ **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
301
+
302
+
303
+ Thank you to all my generous patrons and donaters!
304
+
305
+ And thank you again to a16z for their generous grant.
306
+
307
+ <!-- footer end -->
308
+
309
+ # Original model card: Severian's Anima Phi Neptune Mistral 7B
310
+
311
+ # ANIMA-Phi-Neptune-Mistral-7B: Biomimicry Enhanced LLM
312
+
313
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/64740cf7485a7c8e1bd51ac9/JZH6p50t_j3-OUph4Wq6y.png" width="500">
314
+
315
+ ## Overview
316
+
317
+ **ANIMA** (Advanced Nature Inspired Multidisciplinary Assistant) is an expert in various scientific disciplines, including but not limited to biomimicry, biology, and environmental science.
318
+
319
+ ---
320
+
321
+ ## Model Description
322
+
323
+ ANIMA is fine-tuned on a rich dataset encompassing:
324
+
325
+ - 4,000+ Nature-Biomimicry examples
326
+ - 60k Biomimicry Design Process examples
327
+ - 600k STEM facts from Wikipedia
328
+ - Science/Philosophy focused 'All-You-Need-Is-Textbooks' dataset
329
+ - Additional Tree of Knowledge + Biomimicry data combined fine-tuning
330
+
331
+ The model aims to assist users in solving problems using nature-inspired strategies and concepts.
332
+
333
+ ### Special Features
334
+
335
+ - **Multi-disciplinary Expertise**: Knowledge across various scientific and philosophical domains.
336
+ - **Biomimicry Design Process**: Incorporates a dataset generated by Mistral and Minotaur-15B. The dataset was then intricately processed by a real person to ensure factuality and grounding.
337
+
338
+ ---
339
+
340
+ ## Datasets
341
+
342
+ - `Severian/Biomimicry` (1st Fine-Tune)
343
+ - `emrgnt-cmplxty/sciphi-textbooks-are-all-you-need` (2nd Fine-Tune)
344
+ - `Severian/Bio-Design-Process` & `fmars/wiki_stem` (3rd Fine-Tune)
345
+ - `fblgit/tree-of-knowledge & `Severian/Biomimicry` (4th Fine-Tune)
346
+ - Combined all previous datasets into one giant dataset for a quick fine-tuning for a total of 730k data points (5th Fine-Tune)
347
+
348
+ ## Training Stages
349
+
350
+ 1. **Base Model**: `ehartford/dolphin-2.0-mistral-7b`
351
+ 2. **1st Fine-Tune**: `ANIMA-Echo-Mistral-7B-v1` - 1 Epoch x 5hrs on 1 x T4 Small
352
+ 3. **2nd Fine-Tune**: `ANIMA-Phi-Neptune-Mistral-v1`-: 1 Epoch x 1hr on 1 x A100
353
+ 4. **3rd Fine-Tune**: `ANIMA-Phi-Neptune-Mistral-7B-v2` - 1 Epoch x 1hr on 1 x A100
354
+ 5. **4th Fine-Tune**: 'ANIMA-Phi-Neptune-Mistral-7B-v3' - 1 Epoch x 1hr on 1 x A100
355
+ 6. **5th Fine-Tune**: 'ANIMA-Phi-Neptune-Mistral-7B-v4' - 1 Epoch x 15mins on 1 x A100
356
+
357
+ ---
358
+
359
+ ## 📝 Usage
360
+
361
+ ANIMA is designed around the Biomimicry Design Process to guide users in solving problems through biomimicry. For more information and examples, please visit [Biomimicry Design Process](https://toolbox.biomimicry.org/methods/process/).
362
+
363
+ ## 🏁 Benchmarks
364
+
365
+ - Average - 62.22
366
+ - ARC - 56.83
367
+ - HellaSwag - 78.82
368
+ - MMLU - 53.84
369
+ - TruthfulQA - 59.40
370
+
371
+ ---
372
+
373
+ - **EXAMPLE OUTPUT**
374
+
375
+ [INST] How can biomimicry help in water purification? [/INST]
376
+
377
+ Biomimicry involves taking inspiration from natural processes and organisms to solve human problems. In the context of water purification, biomimicry can help develop sustainable and efficient methods for cleaning water. One specific example of a nature-inspired strategy to solve this problem is the use of biofiltration, which involves using microorganisms to remove pollutants from water.
378
+
379
+ Biofiltration has been successfully applied to the removal of various contaminants, including heavy metals, organic pollutants, and pathogens. For example, a study by Zhang et al. (2011) demonstrated that a mixed culture of Pseudomonas putida and Bacillus subtilis could effectively remove lead and cadmium from contaminated water. The researchers found that the biofilm formed by the mixed culture had a higher removal efficiency than that formed by either species alone. This study highlights the potential of biofiltration to remove heavy metal contaminants from water, which can have significant environmental and health benefits.
380
+
381
+ In summary, biomimicry can help in water purification by providing insights into natural processes and organisms that can inspire the development of sustainable and efficient methods for cleaning water. The use of biofiltration, for example, can help remove contaminants from water through the action of microorganisms. Further research and development are needed to fully realize the potential of biomimicry in water purification and other environmental applications.
382
+
383
+ ---
384
+
385
+ ## 📜 License
386
+
387
+ This project is licensed under MIT