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0
|
9 |
+
model-index:
|
10 |
+
- name: CollectiveCognition-v1-Mistral-7B
|
11 |
+
results: []
|
12 |
+
model_creator: Teknium
|
13 |
+
model_name: CollectiveCognition v1 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 |
+
- sharegpt
|
29 |
+
---
|
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 |
+
# CollectiveCognition v1 Mistral 7B - GPTQ
|
49 |
+
- Model creator: [Teknium](https://huggingface.co/teknium)
|
50 |
+
- Original model: [CollectiveCognition v1 Mistral 7B](https://huggingface.co/teknium/CollectiveCognition-v1-Mistral-7B)
|
51 |
+
|
52 |
+
<!-- description start -->
|
53 |
+
## Description
|
54 |
+
|
55 |
+
This repo contains GPTQ model files for [Teknium's CollectiveCognition v1 Mistral 7B](https://huggingface.co/teknium/CollectiveCognition-v1-Mistral-7B).
|
56 |
+
|
57 |
+
Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
|
58 |
+
|
59 |
+
<!-- description end -->
|
60 |
+
<!-- repositories-available start -->
|
61 |
+
## Repositories available
|
62 |
+
|
63 |
+
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-AWQ)
|
64 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ)
|
65 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-GGUF)
|
66 |
+
* [Teknium's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/teknium/CollectiveCognition-v1-Mistral-7B)
|
67 |
+
<!-- repositories-available end -->
|
68 |
+
|
69 |
+
<!-- prompt-template start -->
|
70 |
+
## Prompt template: User-Assistant
|
71 |
+
|
72 |
+
```
|
73 |
+
USER: {prompt}
|
74 |
+
ASSISTANT:
|
75 |
+
|
76 |
+
```
|
77 |
+
|
78 |
+
<!-- prompt-template end -->
|
79 |
+
|
80 |
+
|
81 |
+
<!-- README_GPTQ.md-provided-files start -->
|
82 |
+
## Provided files, and GPTQ parameters
|
83 |
+
|
84 |
+
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
85 |
+
|
86 |
+
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
87 |
+
|
88 |
+
Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
|
89 |
+
|
90 |
+
<details>
|
91 |
+
<summary>Explanation of GPTQ parameters</summary>
|
92 |
+
|
93 |
+
- Bits: The bit size of the quantised model.
|
94 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
95 |
+
- Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
|
96 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
97 |
+
- GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
|
98 |
+
- Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
|
99 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
|
100 |
+
|
101 |
+
</details>
|
102 |
+
|
103 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
104 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
105 |
+
| [main](https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.16 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
|
106 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.57 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
|
107 |
+
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.52 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
|
108 |
+
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.68 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
|
109 |
+
| [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 8.17 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
|
110 |
+
| [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.29 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
|
111 |
+
|
112 |
+
<!-- README_GPTQ.md-provided-files end -->
|
113 |
+
|
114 |
+
<!-- README_GPTQ.md-download-from-branches start -->
|
115 |
+
## How to download, including from branches
|
116 |
+
|
117 |
+
### In text-generation-webui
|
118 |
+
|
119 |
+
To download from the `main` branch, enter `TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ` in the "Download model" box.
|
120 |
+
|
121 |
+
To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ:gptq-4bit-32g-actorder_True`
|
122 |
+
|
123 |
+
### From the command line
|
124 |
+
|
125 |
+
I recommend using the `huggingface-hub` Python library:
|
126 |
+
|
127 |
+
```shell
|
128 |
+
pip3 install huggingface-hub
|
129 |
+
```
|
130 |
+
|
131 |
+
To download the `main` branch to a folder called `CollectiveCognition-v1-Mistral-7B-GPTQ`:
|
132 |
+
|
133 |
+
```shell
|
134 |
+
mkdir CollectiveCognition-v1-Mistral-7B-GPTQ
|
135 |
+
huggingface-cli download TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ --local-dir CollectiveCognition-v1-Mistral-7B-GPTQ --local-dir-use-symlinks False
|
136 |
+
```
|
137 |
+
|
138 |
+
To download from a different branch, add the `--revision` parameter:
|
139 |
+
|
140 |
+
```shell
|
141 |
+
mkdir CollectiveCognition-v1-Mistral-7B-GPTQ
|
142 |
+
huggingface-cli download TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir CollectiveCognition-v1-Mistral-7B-GPTQ --local-dir-use-symlinks False
|
143 |
+
```
|
144 |
+
|
145 |
+
<details>
|
146 |
+
<summary>More advanced huggingface-cli download usage</summary>
|
147 |
+
|
148 |
+
If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Huggingface cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
|
149 |
+
|
150 |
+
The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
|
151 |
+
|
152 |
+
For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
|
153 |
+
|
154 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
155 |
+
|
156 |
+
```shell
|
157 |
+
pip3 install hf_transfer
|
158 |
+
```
|
159 |
+
|
160 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
161 |
+
|
162 |
+
```shell
|
163 |
+
mkdir CollectiveCognition-v1-Mistral-7B-GPTQ
|
164 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ --local-dir CollectiveCognition-v1-Mistral-7B-GPTQ --local-dir-use-symlinks False
|
165 |
+
```
|
166 |
+
|
167 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
168 |
+
</details>
|
169 |
+
|
170 |
+
### With `git` (**not** recommended)
|
171 |
+
|
172 |
+
To clone a specific branch with `git`, use a command like this:
|
173 |
+
|
174 |
+
```shell
|
175 |
+
git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ
|
176 |
+
```
|
177 |
+
|
178 |
+
Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)
|
179 |
+
|
180 |
+
<!-- README_GPTQ.md-download-from-branches end -->
|
181 |
+
<!-- README_GPTQ.md-text-generation-webui start -->
|
182 |
+
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
183 |
+
|
184 |
+
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
185 |
+
|
186 |
+
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.
|
187 |
+
|
188 |
+
1. Click the **Model tab**.
|
189 |
+
2. Under **Download custom model or LoRA**, enter `TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ`.
|
190 |
+
- To download from a specific branch, enter for example `TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ:gptq-4bit-32g-actorder_True`
|
191 |
+
- see Provided Files above for the list of branches for each option.
|
192 |
+
3. Click **Download**.
|
193 |
+
4. The model will start downloading. Once it's finished it will say "Done".
|
194 |
+
5. In the top left, click the refresh icon next to **Model**.
|
195 |
+
6. In the **Model** dropdown, choose the model you just downloaded: `CollectiveCognition-v1-Mistral-7B-GPTQ`
|
196 |
+
7. The model will automatically load, and is now ready for use!
|
197 |
+
8. 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.
|
198 |
+
* Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
|
199 |
+
9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
|
200 |
+
|
201 |
+
<!-- README_GPTQ.md-text-generation-webui end -->
|
202 |
+
|
203 |
+
<!-- README_GPTQ.md-use-from-tgi start -->
|
204 |
+
## Serving this model from Text Generation Inference (TGI)
|
205 |
+
|
206 |
+
It's recommended to use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
|
207 |
+
|
208 |
+
Example Docker parameters:
|
209 |
+
|
210 |
+
```shell
|
211 |
+
--model-id TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
|
212 |
+
```
|
213 |
+
|
214 |
+
Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
|
215 |
+
|
216 |
+
```shell
|
217 |
+
pip3 install huggingface-hub
|
218 |
+
```
|
219 |
+
|
220 |
+
```python
|
221 |
+
from huggingface_hub import InferenceClient
|
222 |
+
|
223 |
+
endpoint_url = "https://your-endpoint-url-here"
|
224 |
+
|
225 |
+
prompt = "Tell me about AI"
|
226 |
+
prompt_template=f'''USER: {prompt}
|
227 |
+
ASSISTANT:
|
228 |
+
'''
|
229 |
+
|
230 |
+
client = InferenceClient(endpoint_url)
|
231 |
+
response = client.text_generation(prompt,
|
232 |
+
max_new_tokens=128,
|
233 |
+
do_sample=True,
|
234 |
+
temperature=0.7,
|
235 |
+
top_p=0.95,
|
236 |
+
top_k=40,
|
237 |
+
repetition_penalty=1.1)
|
238 |
+
|
239 |
+
print(f"Model output: {response}")
|
240 |
+
```
|
241 |
+
<!-- README_GPTQ.md-use-from-tgi end -->
|
242 |
+
<!-- README_GPTQ.md-use-from-python start -->
|
243 |
+
## How to use this GPTQ model from Python code
|
244 |
+
|
245 |
+
### Install the necessary packages
|
246 |
+
|
247 |
+
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
248 |
+
|
249 |
+
```shell
|
250 |
+
pip3 install transformers optimum
|
251 |
+
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
|
252 |
+
```
|
253 |
+
|
254 |
+
If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
|
255 |
+
|
256 |
+
```shell
|
257 |
+
pip3 uninstall -y auto-gptq
|
258 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
259 |
+
cd AutoGPTQ
|
260 |
+
git checkout v0.4.2
|
261 |
+
pip3 install .
|
262 |
+
```
|
263 |
+
|
264 |
+
### You can then use the following code
|
265 |
+
|
266 |
+
```python
|
267 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
268 |
+
|
269 |
+
model_name_or_path = "TheBloke/CollectiveCognition-v1-Mistral-7B-GPTQ"
|
270 |
+
# To use a different branch, change revision
|
271 |
+
# For example: revision="gptq-4bit-32g-actorder_True"
|
272 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
273 |
+
device_map="auto",
|
274 |
+
trust_remote_code=False,
|
275 |
+
revision="main")
|
276 |
+
|
277 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
278 |
+
|
279 |
+
prompt = "Tell me about AI"
|
280 |
+
prompt_template=f'''USER: {prompt}
|
281 |
+
ASSISTANT:
|
282 |
+
'''
|
283 |
+
|
284 |
+
print("\n\n*** Generate:")
|
285 |
+
|
286 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
287 |
+
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
288 |
+
print(tokenizer.decode(output[0]))
|
289 |
+
|
290 |
+
# Inference can also be done using transformers' pipeline
|
291 |
+
|
292 |
+
print("*** Pipeline:")
|
293 |
+
pipe = pipeline(
|
294 |
+
"text-generation",
|
295 |
+
model=model,
|
296 |
+
tokenizer=tokenizer,
|
297 |
+
max_new_tokens=512,
|
298 |
+
do_sample=True,
|
299 |
+
temperature=0.7,
|
300 |
+
top_p=0.95,
|
301 |
+
top_k=40,
|
302 |
+
repetition_penalty=1.1
|
303 |
+
)
|
304 |
+
|
305 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
306 |
+
```
|
307 |
+
<!-- README_GPTQ.md-use-from-python end -->
|
308 |
+
|
309 |
+
<!-- README_GPTQ.md-compatibility start -->
|
310 |
+
## Compatibility
|
311 |
+
|
312 |
+
The files provided are tested to work with AutoGPTQ, both via Transformers and using AutoGPTQ directly. They should also work with [Occ4m's GPTQ-for-LLaMa fork](https://github.com/0cc4m/KoboldAI).
|
313 |
+
|
314 |
+
[ExLlama](https://github.com/turboderp/exllama) is compatible with Llama and Mistral models in 4-bit. Please see the Provided Files table above for per-file compatibility.
|
315 |
+
|
316 |
+
[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
|
317 |
+
<!-- README_GPTQ.md-compatibility end -->
|
318 |
+
|
319 |
+
<!-- footer start -->
|
320 |
+
<!-- 200823 -->
|
321 |
+
## Discord
|
322 |
+
|
323 |
+
For further support, and discussions on these models and AI in general, join us at:
|
324 |
+
|
325 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
326 |
+
|
327 |
+
## Thanks, and how to contribute
|
328 |
+
|
329 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
330 |
+
|
331 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
332 |
+
|
333 |
+
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.
|
334 |
+
|
335 |
+
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.
|
336 |
+
|
337 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
338 |
+
|
339 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
340 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
341 |
+
|
342 |
+
**Special thanks to**: Aemon Algiz.
|
343 |
+
|
344 |
+
**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
|
345 |
+
|
346 |
+
|
347 |
+
Thank you to all my generous patrons and donaters!
|
348 |
+
|
349 |
+
And thank you again to a16z for their generous grant.
|
350 |
+
|
351 |
+
<!-- footer end -->
|
352 |
+
|
353 |
+
# Original model card: Teknium's CollectiveCognition v1 Mistral 7B
|
354 |
+
|
355 |
+
|
356 |
+
**Collective Cognition v1 - Mistral 7B**
|
357 |
+
<div style="display: flex; justify-content: center;">
|
358 |
+
<a href="https://collectivecognition.ai" target="_blank" style="display: inline-block; text-align: center;">
|
359 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/DNZXsJE5oC_rM8eYY6H_x.png" alt="Collective Cognition Logo" width="50%" style="display: block; margin: 0 auto;">
|
360 |
+
</a>
|
361 |
+
</div>
|
362 |
+
|
363 |
+
## Model Description:
|
364 |
+
|
365 |
+
Collective Cognition v1 is a Mistral model fine-tuned using just 100 GPT-4 chats shared on Collective Cognition.
|
366 |
+
|
367 |
+
## Special Features:
|
368 |
+
- **Quick Training**: This model was trained in just 3 minutes on a single 4090 with a qlora, and competes with 70B scale Llama-2 Models at TruthfulQA.
|
369 |
+
- **Limited Data**: Despite its exceptional performance, it was trained on only ONE HUNDRED data points, all of which were gathered from Collective Cognition, a platform reminiscent of ShareGPT.
|
370 |
+
- **Extreme TruthfulQA Benchmark**: The collective cognition models are competing strongly with top 70B models on the TruthfulQA benchmark despite the small dataset and qlora training!
|
371 |
+
|
372 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/-pnifxPcMeeUONyE3efo3.png)
|
373 |
+
|
374 |
+
## Acknowledgements:
|
375 |
+
|
376 |
+
Special thanks to @a16z and all contributors to the Collective Cognition dataset for making the development of this model possible.
|
377 |
+
|
378 |
+
|
379 |
+
## Dataset:
|
380 |
+
|
381 |
+
The model was trained using data from the Collective Cognition website. The efficacy of this dataset is demonstrated by the model's stellar performance, suggesting that further expansion of this dataset could yield even more promising results. The data is reminiscent of that collected from platforms like ShareGPT.
|
382 |
+
|
383 |
+
You can contribute to the growth of the dataset by sharing your own ChatGPT chats [here](https://CollectiveCognition.ai).
|
384 |
+
|
385 |
+
You can download the datasets created by Collective Cognition here: https://huggingface.co/CollectiveCognition
|
386 |
+
|
387 |
+
## Performance:
|
388 |
+
|
389 |
+
- **TruthfulQA**: Collective Cognition v1 and v1.1 in particular have notably outperformed several models on the TruthfulQA benchmark, highlighting its ability to understand and rectify common misconceptions.
|
390 |
+
|
391 |
+
The model follows a LIMA approach, by minimizing the base model's original training as little as possible and giving a small but very high quality dataset to enhance it's performance and style.
|
392 |
+
|
393 |
+
## Usage:
|
394 |
+
|
395 |
+
Prompt Format:
|
396 |
+
```
|
397 |
+
USER: <prompt>
|
398 |
+
ASSISTANT:
|
399 |
+
```
|
400 |
+
OR
|
401 |
+
```
|
402 |
+
<system message>
|
403 |
+
USER: <prompt>
|
404 |
+
ASSISTANT:
|
405 |
+
```
|
406 |
+
|
407 |
+
## Benchmarks:
|
408 |
+
|
409 |
+
Collective Cognition v1.0 TruthfulQA:
|
410 |
+
```
|
411 |
+
| Task |Version|Metric|Value | |Stderr|
|
412 |
+
|-------------|------:|------|-----:|---|-----:|
|
413 |
+
|truthfulqa_mc| 1|mc1 |0.3794|± |0.0170|
|
414 |
+
| | |mc2 |0.5394|± |0.0158|
|
415 |
+
```
|
416 |
+
|
417 |
+
GPT4All Benchmark Suite:
|
418 |
+
```
|
419 |
+
Collective Cognition v1.0 GPT4All:
|
420 |
+
| Task |Version| Metric |Value | |Stderr|
|
421 |
+
|-------------|------:|--------|-----:|---|-----:|
|
422 |
+
|arc_challenge| 0|acc |0.5401|± |0.0146|
|
423 |
+
| | |acc_norm|0.5572|± |0.0145|
|
424 |
+
|arc_easy | 0|acc |0.8102|± |0.0080|
|
425 |
+
| | |acc_norm|0.7992|± |0.0082|
|
426 |
+
|boolq | 1|acc |0.8538|± |0.0062|
|
427 |
+
|hellaswag | 0|acc |0.6459|± |0.0048|
|
428 |
+
| | |acc_norm|0.8297|± |0.0038|
|
429 |
+
|openbookqa | 0|acc |0.3380|± |0.0212|
|
430 |
+
| | |acc_norm|0.4360|± |0.0222|
|
431 |
+
|piqa | 0|acc |0.8085|± |0.0092|
|
432 |
+
| | |acc_norm|0.8232|± |0.0089|
|
433 |
+
|winogrande | 0|acc |0.7451|± |0.0122|
|
434 |
+
Average: 72.06%
|
435 |
+
```
|
436 |
+
|
437 |
+
AGIEval:
|
438 |
+
```
|
439 |
+
| Task |Version| Metric |Value | |Stderr|
|
440 |
+
|------------------------------|------:|--------|-----:|---|-----:|
|
441 |
+
|agieval_aqua_rat | 0|acc |0.1890|± |0.0246|
|
442 |
+
| | |acc_norm|0.2047|± |0.0254|
|
443 |
+
|agieval_logiqa_en | 0|acc |0.2611|± |0.0172|
|
444 |
+
| | |acc_norm|0.3134|± |0.0182|
|
445 |
+
|agieval_lsat_ar | 0|acc |0.2087|± |0.0269|
|
446 |
+
| | |acc_norm|0.2217|± |0.0275|
|
447 |
+
|agieval_lsat_lr | 0|acc |0.3373|± |0.0210|
|
448 |
+
| | |acc_norm|0.3196|± |0.0207|
|
449 |
+
|agieval_lsat_rc | 0|acc |0.4201|± |0.0301|
|
450 |
+
| | |acc_norm|0.3978|± |0.0299|
|
451 |
+
|agieval_sat_en | 0|acc |0.5971|± |0.0343|
|
452 |
+
| | |acc_norm|0.5631|± |0.0346|
|
453 |
+
|agieval_sat_en_without_passage| 0|acc |0.4029|± |0.0343|
|
454 |
+
| | |acc_norm|0.3398|± |0.0331|
|
455 |
+
|agieval_sat_math | 0|acc |0.3045|± |0.0311|
|
456 |
+
| | |acc_norm|0.2864|± |0.0305|
|
457 |
+
Average: 33.08%
|
458 |
+
```
|
459 |
+
|
460 |
+
Training run on wandb here: https://wandb.ai/teknium1/collectivecognition-mistral-7b/runs/collectivecognition-mistral-6/workspace
|
461 |
+
|
462 |
+
|
463 |
+
## Licensing:
|
464 |
+
|
465 |
+
Apache 2.0
|
466 |
+
|
467 |
+
---
|