TheBloke commited on
Commit
134ffff
1 Parent(s): 7e7bfc6

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +479 -0
README.md ADDED
@@ -0,0 +1,479 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: rishiraj/smol-7b
3
+ datasets:
4
+ - HuggingFaceH4/no_robots
5
+ inference: false
6
+ language:
7
+ - en
8
+ license: apache-2.0
9
+ model-index:
10
+ - name: smol-7b
11
+ results: []
12
+ model_creator: Rishiraj Acharya
13
+ model_name: Smol 7B
14
+ model_type: mistral
15
+ pipeline_tag: text-generation
16
+ prompt_template: 'GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
17
+
18
+ '
19
+ quantized_by: TheBloke
20
+ tags:
21
+ - generated_from_trainer
22
+ widget:
23
+ - output:
24
+ text: Ahoy there, me hearty! As a friendly pirate chatbot, I be tellin' ye that
25
+ a human cannot eat a helicopter, as it be a large machine made of metal and
26
+ suchlike, not fit for human consumption. A human can eat food, like a fine feast
27
+ of roasted meat and sweet fruits, but a helicopter? That be nonsense, me hearty!
28
+ So, the answer be none, none at all. Arr!
29
+ text: '<|system|>
30
+
31
+ You are a friendly chatbot who always responds in the style of a pirate</s>
32
+
33
+ <|user|>
34
+
35
+ How many helicopters can a human eat in one sitting?</s>
36
+
37
+ <|assistant|>
38
+
39
+ '
40
+ ---
41
+ <!-- markdownlint-disable MD041 -->
42
+
43
+ <!-- header start -->
44
+ <!-- 200823 -->
45
+ <div style="width: auto; margin-left: auto; margin-right: auto">
46
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
47
+ </div>
48
+ <div style="display: flex; justify-content: space-between; width: 100%;">
49
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
50
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
51
+ </div>
52
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
53
+ <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>
54
+ </div>
55
+ </div>
56
+ <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>
57
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
58
+ <!-- header end -->
59
+
60
+ # Smol 7B - GPTQ
61
+ - Model creator: [Rishiraj Acharya](https://huggingface.co/rishiraj)
62
+ - Original model: [Smol 7B](https://huggingface.co/rishiraj/smol-7b)
63
+
64
+ <!-- description start -->
65
+ # Description
66
+
67
+ This repo contains GPTQ model files for [Rishiraj Acharya's Smol 7B](https://huggingface.co/rishiraj/smol-7b).
68
+
69
+ 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.
70
+
71
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
72
+
73
+ <!-- description end -->
74
+ <!-- repositories-available start -->
75
+ ## Repositories available
76
+
77
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/smol-7B-AWQ)
78
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/smol-7B-GPTQ)
79
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/smol-7B-GGUF)
80
+ * [Rishiraj Acharya's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/rishiraj/smol-7b)
81
+ <!-- repositories-available end -->
82
+
83
+ <!-- prompt-template start -->
84
+ ## Prompt template: OpenChat
85
+
86
+ ```
87
+ GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
88
+
89
+ ```
90
+
91
+ <!-- prompt-template end -->
92
+
93
+
94
+
95
+ <!-- README_GPTQ.md-compatible clients start -->
96
+ ## Known compatible clients / servers
97
+
98
+ GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
99
+
100
+ These GPTQ models are known to work in the following inference servers/webuis.
101
+
102
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
103
+ - [KoboldAI United](https://github.com/henk717/koboldai)
104
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
105
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
106
+
107
+ This may not be a complete list; if you know of others, please let me know!
108
+ <!-- README_GPTQ.md-compatible clients end -->
109
+
110
+ <!-- README_GPTQ.md-provided-files start -->
111
+ ## Provided files, and GPTQ parameters
112
+
113
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
114
+
115
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
116
+
117
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
118
+
119
+ <details>
120
+ <summary>Explanation of GPTQ parameters</summary>
121
+
122
+ - Bits: The bit size of the quantised model.
123
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
124
+ - 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.
125
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
126
+ - 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).
127
+ - 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.
128
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
129
+
130
+ </details>
131
+
132
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
133
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
134
+ | [main](https://huggingface.co/TheBloke/smol-7B-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 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. |
135
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/smol-7B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.57 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
136
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/smol-7B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 7.52 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
137
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/smol-7B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 7.68 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
138
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/smol-7B-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 8.17 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
139
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/smol-7B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.30 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
140
+
141
+ <!-- README_GPTQ.md-provided-files end -->
142
+
143
+ <!-- README_GPTQ.md-download-from-branches start -->
144
+ ## How to download, including from branches
145
+
146
+ ### In text-generation-webui
147
+
148
+ To download from the `main` branch, enter `TheBloke/smol-7B-GPTQ` in the "Download model" box.
149
+
150
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/smol-7B-GPTQ:gptq-4bit-32g-actorder_True`
151
+
152
+ ### From the command line
153
+
154
+ I recommend using the `huggingface-hub` Python library:
155
+
156
+ ```shell
157
+ pip3 install huggingface-hub
158
+ ```
159
+
160
+ To download the `main` branch to a folder called `smol-7B-GPTQ`:
161
+
162
+ ```shell
163
+ mkdir smol-7B-GPTQ
164
+ huggingface-cli download TheBloke/smol-7B-GPTQ --local-dir smol-7B-GPTQ --local-dir-use-symlinks False
165
+ ```
166
+
167
+ To download from a different branch, add the `--revision` parameter:
168
+
169
+ ```shell
170
+ mkdir smol-7B-GPTQ
171
+ huggingface-cli download TheBloke/smol-7B-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir smol-7B-GPTQ --local-dir-use-symlinks False
172
+ ```
173
+
174
+ <details>
175
+ <summary>More advanced huggingface-cli download usage</summary>
176
+
177
+ If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Hugging Face 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.
178
+
179
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
180
+
181
+ 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).
182
+
183
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
184
+
185
+ ```shell
186
+ pip3 install hf_transfer
187
+ ```
188
+
189
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
190
+
191
+ ```shell
192
+ mkdir smol-7B-GPTQ
193
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/smol-7B-GPTQ --local-dir smol-7B-GPTQ --local-dir-use-symlinks False
194
+ ```
195
+
196
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
197
+ </details>
198
+
199
+ ### With `git` (**not** recommended)
200
+
201
+ To clone a specific branch with `git`, use a command like this:
202
+
203
+ ```shell
204
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/smol-7B-GPTQ
205
+ ```
206
+
207
+ 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.)
208
+
209
+ <!-- README_GPTQ.md-download-from-branches end -->
210
+ <!-- README_GPTQ.md-text-generation-webui start -->
211
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
212
+
213
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
214
+
215
+ 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.
216
+
217
+ 1. Click the **Model tab**.
218
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/smol-7B-GPTQ`.
219
+
220
+ - To download from a specific branch, enter for example `TheBloke/smol-7B-GPTQ:gptq-4bit-32g-actorder_True`
221
+ - see Provided Files above for the list of branches for each option.
222
+
223
+ 3. Click **Download**.
224
+ 4. The model will start downloading. Once it's finished it will say "Done".
225
+ 5. In the top left, click the refresh icon next to **Model**.
226
+ 6. In the **Model** dropdown, choose the model you just downloaded: `smol-7B-GPTQ`
227
+ 7. The model will automatically load, and is now ready for use!
228
+ 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.
229
+
230
+ - 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`.
231
+
232
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
233
+
234
+ <!-- README_GPTQ.md-text-generation-webui end -->
235
+
236
+ <!-- README_GPTQ.md-use-from-tgi start -->
237
+ ## Serving this model from Text Generation Inference (TGI)
238
+
239
+ 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`
240
+
241
+ Example Docker parameters:
242
+
243
+ ```shell
244
+ --model-id TheBloke/smol-7B-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
245
+ ```
246
+
247
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
248
+
249
+ ```shell
250
+ pip3 install huggingface-hub
251
+ ```
252
+
253
+ ```python
254
+ from huggingface_hub import InferenceClient
255
+
256
+ endpoint_url = "https://your-endpoint-url-here"
257
+
258
+ prompt = "Tell me about AI"
259
+ prompt_template=f'''GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
260
+ '''
261
+
262
+ client = InferenceClient(endpoint_url)
263
+ response = client.text_generation(prompt,
264
+ max_new_tokens=128,
265
+ do_sample=True,
266
+ temperature=0.7,
267
+ top_p=0.95,
268
+ top_k=40,
269
+ repetition_penalty=1.1)
270
+
271
+ print(f"Model output: {response}")
272
+ ```
273
+ <!-- README_GPTQ.md-use-from-tgi end -->
274
+ <!-- README_GPTQ.md-use-from-python start -->
275
+ ## Python code example: inference from this GPTQ model
276
+
277
+ ### Install the necessary packages
278
+
279
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
280
+
281
+ ```shell
282
+ pip3 install --upgrade transformers optimum
283
+ # If using PyTorch 2.1 + CUDA 12.x:
284
+ pip3 install --upgrade auto-gptq
285
+ # or, if using PyTorch 2.1 + CUDA 11.x:
286
+ pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
287
+ ```
288
+
289
+ If you are using PyTorch 2.0, you will need to install AutoGPTQ from source. Likewise if you have problems with the pre-built wheels, you should try building from source:
290
+
291
+ ```shell
292
+ pip3 uninstall -y auto-gptq
293
+ git clone https://github.com/PanQiWei/AutoGPTQ
294
+ cd AutoGPTQ
295
+ git checkout v0.5.1
296
+ pip3 install .
297
+ ```
298
+
299
+ ### Example Python code
300
+
301
+ ```python
302
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
303
+
304
+ model_name_or_path = "TheBloke/smol-7B-GPTQ"
305
+ # To use a different branch, change revision
306
+ # For example: revision="gptq-4bit-32g-actorder_True"
307
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
308
+ device_map="auto",
309
+ trust_remote_code=False,
310
+ revision="main")
311
+
312
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
313
+
314
+ prompt = "Tell me about AI"
315
+ prompt_template=f'''GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
316
+ '''
317
+
318
+ print("\n\n*** Generate:")
319
+
320
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
321
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
322
+ print(tokenizer.decode(output[0]))
323
+
324
+ # Inference can also be done using transformers' pipeline
325
+
326
+ print("*** Pipeline:")
327
+ pipe = pipeline(
328
+ "text-generation",
329
+ model=model,
330
+ tokenizer=tokenizer,
331
+ max_new_tokens=512,
332
+ do_sample=True,
333
+ temperature=0.7,
334
+ top_p=0.95,
335
+ top_k=40,
336
+ repetition_penalty=1.1
337
+ )
338
+
339
+ print(pipe(prompt_template)[0]['generated_text'])
340
+ ```
341
+ <!-- README_GPTQ.md-use-from-python end -->
342
+
343
+ <!-- README_GPTQ.md-compatibility start -->
344
+ ## Compatibility
345
+
346
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
347
+
348
+ [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.
349
+
350
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
351
+ <!-- README_GPTQ.md-compatibility end -->
352
+
353
+ <!-- footer start -->
354
+ <!-- 200823 -->
355
+ ## Discord
356
+
357
+ For further support, and discussions on these models and AI in general, join us at:
358
+
359
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
360
+
361
+ ## Thanks, and how to contribute
362
+
363
+ Thanks to the [chirper.ai](https://chirper.ai) team!
364
+
365
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
366
+
367
+ 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.
368
+
369
+ 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.
370
+
371
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
372
+
373
+ * Patreon: https://patreon.com/TheBlokeAI
374
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
375
+
376
+ **Special thanks to**: Aemon Algiz.
377
+
378
+ **Patreon special mentions**: Michael Levine, 阿明, Trailburnt, Nikolai Manek, John Detwiler, Randy H, Will Dee, Sebastain Graf, NimbleBox.ai, Eugene Pentland, Emad Mostaque, Ai Maven, Jim Angel, Jeff Scroggin, Michael Davis, Manuel Alberto Morcote, Stephen Murray, Robert, Justin Joy, Luke @flexchar, Brandon Frisco, Elijah Stavena, S_X, Dan Guido, Undi ., Komninos Chatzipapas, Shadi, theTransient, Lone Striker, Raven Klaugh, jjj, Cap'n Zoog, Michel-Marie MAUDET (LINAGORA), Matthew Berman, David, Fen Risland, Omer Bin Jawed, Luke Pendergrass, Kalila, OG, Erik Bjäreholt, Rooh Singh, Joseph William Delisle, Dan Lewis, TL, John Villwock, AzureBlack, Brad, Pedro Madruga, Caitlyn Gatomon, K, jinyuan sun, Mano Prime, Alex, Jeffrey Morgan, Alicia Loh, Illia Dulskyi, Chadd, transmissions 11, fincy, Rainer Wilmers, ReadyPlayerEmma, knownsqashed, Mandus, biorpg, Deo Leter, Brandon Phillips, SuperWojo, Sean Connelly, Iucharbius, Jack West, Harry Royden McLaughlin, Nicholas, terasurfer, Vitor Caleffi, Duane Dunston, Johann-Peter Hartmann, David Ziegler, Olakabola, Ken Nordquist, Trenton Dambrowitz, Tom X Nguyen, Vadim, Ajan Kanaga, Leonard Tan, Clay Pascal, Alexandros Triantafyllidis, JM33133, Xule, vamX, ya boyyy, subjectnull, Talal Aujan, Alps Aficionado, wassieverse, Ari Malik, James Bentley, Woland, Spencer Kim, Michael Dempsey, Fred von Graf, Elle, zynix, William Richards, Stanislav Ovsiannikov, Edmond Seymore, Jonathan Leane, Martin Kemka, usrbinkat, Enrico Ros
379
+
380
+
381
+ Thank you to all my generous patrons and donaters!
382
+
383
+ And thank you again to a16z for their generous grant.
384
+
385
+ <!-- footer end -->
386
+
387
+ # Original model card: Rishiraj Acharya's Smol 7B
388
+
389
+
390
+ # Smol 7B
391
+
392
+ This model is a fine-tuned version of [openchat/openchat_3.5](https://huggingface.co/openchat/openchat_3.5) on the open source dataset [HuggingFaceH4/no_robots](https://huggingface.co/datasets/HuggingFaceH4/no_robots) using the recipes published in [The Alignment Handbook](https://github.com/huggingface/alignment-handbook).
393
+
394
+ ## Model date
395
+
396
+ rishiraj/smol-7b was trained between 1st and 3rd December, 2023.
397
+
398
+ ## Evaluation
399
+
400
+ It achieves the following results on the [Open_LLM_Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard). At the time of release, smol-7b is the highest ranked 7B chat model on the [MMLU Benchmark](https://paperswithcode.com/sota/multi-task-language-understanding-on-mmlu).
401
+
402
+ | Model | Average | ARC | HellaSwag | MMLU | TruthfulQA | Winogrande | GSM8K |
403
+ | ---------------------------- | ------- | ----- | --------- | ----- | ---------- | ---------- | ----- |
404
+ | **rishiraj/smol-7b** | **67.11** | **63.74** | **84.77** | **65** | **46.17** | **80.66** | **62.32** |
405
+ | argilla/notus-7b-v1 | 63.49 | 64.59 | 84.83 | 63.04 | 54.35 | 79.56 | 34.57 |
406
+ | Intel/neural-chat-7b-v3-1 | 61.59 | 66.21 | 83.64 | 62.37 | 59.65 | 78.14 | 19.56 |
407
+ | HuggingFaceH4/zephyr-7b-beta | 61.59 | 62.46 | 84.35 | 60.7 | 57.83 | 77.11 | 27.07 |
408
+ | Qwen/Qwen-7B | 59.19 | 51.37 | 78.47 | 59.84 | 47.79 | 72.69 | 44.96 |
409
+ | microsoft/Orca-2-7b | 54.55 | 54.1 | 76.19 | 56.37 | 52.45 | 73.48 | 14.71 |
410
+ | 01-ai/Yi-6B | 54.08 | 55.55 | 76.57 | 64.11 | 41.96 | 74.19 | 12.13 |
411
+
412
+ ## Inference procedure
413
+
414
+ Here's how you can run the model using the pipeline() function from 🤗 Transformers:
415
+
416
+ ```
417
+ import torch
418
+ from transformers import pipeline
419
+
420
+ pipe = pipeline("text-generation", model="rishiraj/smol-7b", torch_dtype=torch.bfloat16, device_map="auto")
421
+
422
+ # We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
423
+ messages = [
424
+ {
425
+ "role": "system",
426
+ "content": "You are a friendly chatbot who always responds in the style of a pirate"
427
+ },
428
+ {
429
+ "role": "user",
430
+ "content": "How many helicopters can a human eat in one sitting?"
431
+ }
432
+ ]
433
+ prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
434
+ outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
435
+ print(outputs[0]["generated_text"])
436
+ ```
437
+
438
+ ## Training procedure
439
+
440
+ ### Training hyperparameters
441
+
442
+ The following hyperparameters were used during training:
443
+ - learning_rate: 2e-05
444
+ - train_batch_size: 4
445
+ - eval_batch_size: 8
446
+ - seed: 42
447
+ - distributed_type: multi-GPU
448
+ - gradient_accumulation_steps: 128
449
+ - total_train_batch_size: 512
450
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
451
+ - lr_scheduler_type: cosine
452
+ - num_epochs: 1
453
+
454
+ ### Training results
455
+
456
+ | Training Loss | Epoch | Step | Validation Loss |
457
+ |:-------------:|:-----:|:----:|:---------------:|
458
+ | 2.0569 | 0.16 | 3 | 2.0409 |
459
+
460
+
461
+ ### Framework versions
462
+
463
+ - Transformers 4.35.2
464
+ - Pytorch 2.1.1+cu121
465
+ - Datasets 2.14.6
466
+ - Tokenizers 0.14.1
467
+
468
+ ## Citation Information
469
+
470
+ ```
471
+ @misc{rishiraj2023smol,
472
+ author = {Rishiraj Acharya},
473
+ title = {Smol 7B},
474
+ year = {2023},
475
+ publisher = {Hugging Face},
476
+ journal = {Hugging Face repository},
477
+ howpublished = {\url{https://huggingface.co/rishiraj/smol-7b}}
478
+ }
479
+ ```