TheBloke commited on
Commit
c68f3a6
·
1 Parent(s): 0727990

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +497 -0
README.md ADDED
@@ -0,0 +1,497 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: llmware/bling-stable-lm-3b-4e1t-v0
3
+ inference: false
4
+ license: apache-2.0
5
+ model_creator: llmware
6
+ model_name: Bling Stable LM 3B 4E1T V0
7
+ model_type: stablelm
8
+ prompt_template: '<human>: {prompt}
9
+
10
+ <bot>:
11
+
12
+ '
13
+ quantized_by: TheBloke
14
+ ---
15
+ <!-- markdownlint-disable MD041 -->
16
+
17
+ <!-- header start -->
18
+ <!-- 200823 -->
19
+ <div style="width: auto; margin-left: auto; margin-right: auto">
20
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
21
+ </div>
22
+ <div style="display: flex; justify-content: space-between; width: 100%;">
23
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
24
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
25
+ </div>
26
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
27
+ <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>
28
+ </div>
29
+ </div>
30
+ <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>
31
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
32
+ <!-- header end -->
33
+
34
+ # Bling Stable LM 3B 4E1T V0 - GPTQ
35
+ - Model creator: [llmware](https://huggingface.co/llmware)
36
+ - Original model: [Bling Stable LM 3B 4E1T V0](https://huggingface.co/llmware/bling-stable-lm-3b-4e1t-v0)
37
+
38
+ <!-- description start -->
39
+ # Description
40
+
41
+ This repo contains GPTQ model files for [llmware's Bling Stable LM 3B 4E1T V0](https://huggingface.co/llmware/bling-stable-lm-3b-4e1t-v0).
42
+
43
+ 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.
44
+
45
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
46
+
47
+ <!-- description end -->
48
+ <!-- repositories-available start -->
49
+ ## Repositories available
50
+
51
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ)
52
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/bling-stable-lm-3b-4e1t-v0-GGUF)
53
+ * [llmware's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/llmware/bling-stable-lm-3b-4e1t-v0)
54
+ <!-- repositories-available end -->
55
+
56
+ <!-- prompt-template start -->
57
+ ## Prompt template: human-bot
58
+
59
+ ```
60
+ <human>: {prompt}
61
+ <bot>:
62
+
63
+ ```
64
+
65
+ <!-- prompt-template end -->
66
+
67
+
68
+
69
+ <!-- README_GPTQ.md-compatible clients start -->
70
+ ## Known compatible clients / servers
71
+
72
+ GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
73
+
74
+ These GPTQ models are known to work in the following inference servers/webuis.
75
+
76
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
77
+ - [KoboldAI United](https://github.com/henk717/koboldai)
78
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
79
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
80
+
81
+ This may not be a complete list; if you know of others, please let me know!
82
+ <!-- README_GPTQ.md-compatible clients end -->
83
+
84
+ <!-- README_GPTQ.md-provided-files start -->
85
+ ## Provided files, and GPTQ parameters
86
+
87
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
88
+
89
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
90
+
91
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
92
+
93
+ <details>
94
+ <summary>Explanation of GPTQ parameters</summary>
95
+
96
+ - Bits: The bit size of the quantised model.
97
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
98
+ - 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.
99
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
100
+ - 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).
101
+ - 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.
102
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
103
+
104
+ </details>
105
+
106
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
107
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
108
+ | [main](https://huggingface.co/TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 1.84 GB | No | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
109
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 1.99 GB | No | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
110
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 3.06 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
111
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 3.12 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
112
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 3.30 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
113
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 1.89 GB | No | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
114
+
115
+ <!-- README_GPTQ.md-provided-files end -->
116
+
117
+ <!-- README_GPTQ.md-download-from-branches start -->
118
+ ## How to download, including from branches
119
+
120
+ ### In text-generation-webui
121
+
122
+ To download from the `main` branch, enter `TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ` in the "Download model" box.
123
+
124
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ:gptq-4bit-32g-actorder_True`
125
+
126
+ ### From the command line
127
+
128
+ I recommend using the `huggingface-hub` Python library:
129
+
130
+ ```shell
131
+ pip3 install huggingface-hub
132
+ ```
133
+
134
+ To download the `main` branch to a folder called `bling-stable-lm-3b-4e1t-v0-GPTQ`:
135
+
136
+ ```shell
137
+ mkdir bling-stable-lm-3b-4e1t-v0-GPTQ
138
+ huggingface-cli download TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ --local-dir bling-stable-lm-3b-4e1t-v0-GPTQ --local-dir-use-symlinks False
139
+ ```
140
+
141
+ To download from a different branch, add the `--revision` parameter:
142
+
143
+ ```shell
144
+ mkdir bling-stable-lm-3b-4e1t-v0-GPTQ
145
+ huggingface-cli download TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir bling-stable-lm-3b-4e1t-v0-GPTQ --local-dir-use-symlinks False
146
+ ```
147
+
148
+ <details>
149
+ <summary>More advanced huggingface-cli download usage</summary>
150
+
151
+ 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.
152
+
153
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
154
+
155
+ 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).
156
+
157
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
158
+
159
+ ```shell
160
+ pip3 install hf_transfer
161
+ ```
162
+
163
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
164
+
165
+ ```shell
166
+ mkdir bling-stable-lm-3b-4e1t-v0-GPTQ
167
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ --local-dir bling-stable-lm-3b-4e1t-v0-GPTQ --local-dir-use-symlinks False
168
+ ```
169
+
170
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
171
+ </details>
172
+
173
+ ### With `git` (**not** recommended)
174
+
175
+ To clone a specific branch with `git`, use a command like this:
176
+
177
+ ```shell
178
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ
179
+ ```
180
+
181
+ 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.)
182
+
183
+ <!-- README_GPTQ.md-download-from-branches end -->
184
+ <!-- README_GPTQ.md-text-generation-webui start -->
185
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
186
+
187
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
188
+
189
+ 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.
190
+
191
+ 1. Click the **Model tab**.
192
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ`.
193
+
194
+ - To download from a specific branch, enter for example `TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ:gptq-4bit-32g-actorder_True`
195
+ - see Provided Files above for the list of branches for each option.
196
+
197
+ 3. Click **Download**.
198
+ 4. The model will start downloading. Once it's finished it will say "Done".
199
+ 5. In the top left, click the refresh icon next to **Model**.
200
+ 6. In the **Model** dropdown, choose the model you just downloaded: `bling-stable-lm-3b-4e1t-v0-GPTQ`
201
+ 7. The model will automatically load, and is now ready for use!
202
+ 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.
203
+
204
+ - 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`.
205
+
206
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
207
+
208
+ <!-- README_GPTQ.md-text-generation-webui end -->
209
+
210
+ <!-- README_GPTQ.md-use-from-tgi start -->
211
+ ## Serving this model from Text Generation Inference (TGI)
212
+
213
+ 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`
214
+
215
+ Example Docker parameters:
216
+
217
+ ```shell
218
+ --model-id TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
219
+ ```
220
+
221
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
222
+
223
+ ```shell
224
+ pip3 install huggingface-hub
225
+ ```
226
+
227
+ ```python
228
+ from huggingface_hub import InferenceClient
229
+
230
+ endpoint_url = "https://your-endpoint-url-here"
231
+
232
+ prompt = "Tell me about AI"
233
+ prompt_template=f'''<human>: {prompt}
234
+ <bot>:
235
+ '''
236
+
237
+ client = InferenceClient(endpoint_url)
238
+ response = client.text_generation(prompt,
239
+ max_new_tokens=128,
240
+ do_sample=True,
241
+ temperature=0.7,
242
+ top_p=0.95,
243
+ top_k=40,
244
+ repetition_penalty=1.1)
245
+
246
+ print(f"Model output: {response}")
247
+ ```
248
+ <!-- README_GPTQ.md-use-from-tgi end -->
249
+ <!-- README_GPTQ.md-use-from-python start -->
250
+ ## Python code example: inference from this GPTQ model
251
+
252
+ ### Install the necessary packages
253
+
254
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
255
+
256
+ ```shell
257
+ pip3 install --upgrade transformers optimum
258
+ # If using PyTorch 2.1 + CUDA 12.x:
259
+ pip3 install --upgrade auto-gptq
260
+ # or, if using PyTorch 2.1 + CUDA 11.x:
261
+ pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
262
+ ```
263
+
264
+ 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:
265
+
266
+ ```shell
267
+ pip3 uninstall -y auto-gptq
268
+ git clone https://github.com/PanQiWei/AutoGPTQ
269
+ cd AutoGPTQ
270
+ git checkout v0.5.1
271
+ pip3 install .
272
+ ```
273
+
274
+ ### Example Python code
275
+
276
+ ```python
277
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
278
+
279
+ model_name_or_path = "TheBloke/bling-stable-lm-3b-4e1t-v0-GPTQ"
280
+ # To use a different branch, change revision
281
+ # For example: revision="gptq-4bit-32g-actorder_True"
282
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
283
+ device_map="auto",
284
+ trust_remote_code=True,
285
+ revision="main")
286
+
287
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
288
+
289
+ prompt = "Tell me about AI"
290
+ prompt_template=f'''<human>: {prompt}
291
+ <bot>:
292
+ '''
293
+
294
+ print("\n\n*** Generate:")
295
+
296
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
297
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
298
+ print(tokenizer.decode(output[0]))
299
+
300
+ # Inference can also be done using transformers' pipeline
301
+
302
+ print("*** Pipeline:")
303
+ pipe = pipeline(
304
+ "text-generation",
305
+ model=model,
306
+ tokenizer=tokenizer,
307
+ max_new_tokens=512,
308
+ do_sample=True,
309
+ temperature=0.7,
310
+ top_p=0.95,
311
+ top_k=40,
312
+ repetition_penalty=1.1
313
+ )
314
+
315
+ print(pipe(prompt_template)[0]['generated_text'])
316
+ ```
317
+ <!-- README_GPTQ.md-use-from-python end -->
318
+
319
+ <!-- README_GPTQ.md-compatibility start -->
320
+ ## Compatibility
321
+
322
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
323
+
324
+ [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.
325
+
326
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
327
+ <!-- README_GPTQ.md-compatibility end -->
328
+
329
+ <!-- footer start -->
330
+ <!-- 200823 -->
331
+ ## Discord
332
+
333
+ For further support, and discussions on these models and AI in general, join us at:
334
+
335
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
336
+
337
+ ## Thanks, and how to contribute
338
+
339
+ Thanks to the [chirper.ai](https://chirper.ai) team!
340
+
341
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
342
+
343
+ 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.
344
+
345
+ 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.
346
+
347
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
348
+
349
+ * Patreon: https://patreon.com/TheBlokeAI
350
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
351
+
352
+ **Special thanks to**: Aemon Algiz.
353
+
354
+ **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
355
+
356
+
357
+ Thank you to all my generous patrons and donaters!
358
+
359
+ And thank you again to a16z for their generous grant.
360
+
361
+ <!-- footer end -->
362
+
363
+ # Original model card: llmware's Bling Stable LM 3B 4E1T V0
364
+
365
+
366
+ # Model Card for Model ID
367
+
368
+ <!-- Provide a quick summary of what the model is/does. -->
369
+
370
+ bling-stable-lm-3b-4e1t-0.1 part of the BLING ("Best Little Instruction-following No-GPU-required") model series, RAG-instruct trained on top of a StabilityAI stablelm-3b-4e1t base model.
371
+
372
+ BLING models are fine-tuned with distilled high-quality custom instruct datasets, targeted at a specific subset of instruct tasks with
373
+ the objective of providing a high-quality Instruct model that is 'inference-ready' on a CPU laptop even
374
+ without using any advanced quantization optimizations.
375
+
376
+
377
+ ### Benchmark Tests
378
+
379
+ Evaluated against the benchmark test: [RAG-Instruct-Benchmark-Tester](https://www.huggingface.co/datasets/llmware/rag_instruct_benchmark_tester)
380
+ Average of 2 Test Runs with 1 point for correct answer, 0.5 point for partial correct or blank / NF, 0.0 points for incorrect, and -1 points for hallucinations.
381
+
382
+ --**Accuracy Score**: **94.0** correct out of 100
383
+ --Not Found Classification: 67.5%
384
+ --Boolean: 77.5%
385
+ --Math/Logic: 29%
386
+ --Complex Questions (1-5): 3 (Low)
387
+ --Summarization Quality (1-5): 3 (Coherent, extractive)
388
+ --Hallucinations: No hallucinations observed in test runs.
389
+
390
+ For test run results (and good indicator of target use cases), please see the files ("core_rag_test" and "answer_sheet" in this repo).
391
+
392
+ ### Model Description
393
+
394
+ <!-- Provide a longer summary of what this model is. -->
395
+
396
+ - **Developed by:** llmware
397
+ - **Model type:** Instruct-trained decoder
398
+ - **Language(s) (NLP):** English
399
+ - **License:** [CC BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/)
400
+ - **Finetuned from model:** stabilityai/stablelm-3b-4e1t
401
+
402
+
403
+ ## Uses
404
+
405
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
406
+
407
+ The intended use of BLING models is two-fold:
408
+
409
+ 1. Provide high-quality Instruct models that can run on a laptop for local testing. We have found it extremely useful when building a
410
+ proof-of-concept, or working with sensitive enterprise data that must be closely guarded, especially in RAG use cases.
411
+
412
+ 2. Push the state of the art for smaller Instruct-following models in the sub-7B parameter range, especially 1B-3B, as single-purpose
413
+ automation tools for specific tasks through targeted fine-tuning datasets and focused "instruction" tasks.
414
+
415
+
416
+ ### Direct Use
417
+
418
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
419
+
420
+ BLING is designed for enterprise automation use cases, especially in knowledge-intensive industries, such as financial services,
421
+ legal and regulatory industries with complex information sources. Rather than try to be "all things to all people," BLING models try to focus on a narrower set of Instructions more suitable to a ~1-3B parameter GPT model.
422
+
423
+ BLING is ideal for rapid prototyping, testing, and the ability to perform an end-to-end workflow locally on a laptop without
424
+ having to send sensitive information over an Internet-based API.
425
+
426
+ The first BLING models have been trained for common RAG scenarios, specifically: question-answering, key-value extraction, and basic summarization as the core instruction types
427
+ without the need for a lot of complex instruction verbiage - provide a text passage context, ask questions, and get clear fact-based responses.
428
+
429
+
430
+ ## Bias, Risks, and Limitations
431
+
432
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
433
+
434
+ Any model can provide inaccurate or incomplete information, and should be used in conjunction with appropriate safeguards and fact-checking mechanisms.
435
+
436
+
437
+ ## How to Get Started with the Model
438
+
439
+ The fastest way to get started with BLING is through direct import in transformers:
440
+
441
+ from transformers import AutoTokenizer, AutoModelForCausalLM
442
+ tokenizer = AutoTokenizer.from_pretrained("llmware/bling-stable-lm-3b-4e1t-0.1")
443
+ model = AutoModelForCausalLM.from_pretrained("llmware/bling-stable-lm-3b-4e1t-0.1")
444
+
445
+ Please refer to the generation_test .py files in the Files repository, which includes 200 samples and script to test the model. The **generation_test_llmware_script.py** includes built-in llmware capabilities for fact-checking, as well as easy integration with document parsing and actual retrieval to swap out the test set for RAG workflow consisting of business documents.
446
+
447
+ The BLING model was fine-tuned with a simple "\<human> and \<bot> wrapper", so to get the best results, wrap inference entries as:
448
+
449
+ full_prompt = "<human>: " + my_prompt + "\n" + "<bot>:"
450
+
451
+ The BLING model was fine-tuned with closed-context samples, which assume generally that the prompt consists of two sub-parts:
452
+
453
+ 1. Text Passage Context, and
454
+ 2. Specific question or instruction based on the text passage
455
+
456
+ To get the best results, package "my_prompt" as follows:
457
+
458
+ my_prompt = {{text_passage}} + "\n" + {{question/instruction}}
459
+
460
+
461
+ If you are using a HuggingFace generation script:
462
+
463
+ # prepare prompt packaging used in fine-tuning process
464
+ new_prompt = "<human>: " + entries["context"] + "\n" + entries["query"] + "\n" + "<bot>:"
465
+
466
+ inputs = tokenizer(new_prompt, return_tensors="pt")
467
+ start_of_output = len(inputs.input_ids[0])
468
+
469
+ # temperature: set at 0.3 for consistency of output
470
+ # max_new_tokens: set at 100 - may prematurely stop a few of the summaries
471
+
472
+ outputs = model.generate(
473
+ inputs.input_ids.to(device),
474
+ eos_token_id=tokenizer.eos_token_id,
475
+ pad_token_id=tokenizer.eos_token_id,
476
+ do_sample=True,
477
+ temperature=0.3,
478
+ max_new_tokens=100,
479
+ )
480
+
481
+ output_only = tokenizer.decode(outputs[0][start_of_output:],skip_special_tokens=True)
482
+
483
+
484
+ ## Citations
485
+
486
+ This model has been fine-tuned on the base StableLM-3B-4E1T model from StabilityAI. For more information about this base model, please see the citation below:
487
+
488
+ @misc{StableLM-3B-4E1T,
489
+ url={[https://huggingface.co/stabilityai/stablelm-3b-4e1t](https://huggingface.co/stabilityai/stablelm-3b-4e1t)},
490
+ title={StableLM 3B 4E1T},
491
+ author={Tow, Jonathan and Bellagente, Marco and Mahan, Dakota and Riquelme, Carlos}
492
+ }
493
+
494
+
495
+ ## Model Card Contact
496
+
497
+ Darren Oberst & llmware team