TheBloke commited on
Commit
13a4397
1 Parent(s): 54db26c

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +597 -0
README.md ADDED
@@ -0,0 +1,597 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: budecosystem/genz-13b-v2
3
+ inference: false
4
+ language:
5
+ - en
6
+ library_name: transformers
7
+ license: llama2
8
+ model_creator: Bud
9
+ model_name: GenZ 13B v2
10
+ model_type: llama
11
+ pipeline_tag: text-generation
12
+ prompt_template: '### User:
13
+
14
+ {prompt}
15
+
16
+
17
+ ### Assistant:
18
+
19
+ '
20
+ quantized_by: TheBloke
21
+ ---
22
+
23
+ <!-- header start -->
24
+ <!-- 200823 -->
25
+ <div style="width: auto; margin-left: auto; margin-right: auto">
26
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
27
+ </div>
28
+ <div style="display: flex; justify-content: space-between; width: 100%;">
29
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
30
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
31
+ </div>
32
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
33
+ <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>
34
+ </div>
35
+ </div>
36
+ <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>
37
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
38
+ <!-- header end -->
39
+
40
+ # GenZ 13B v2 - GPTQ
41
+ - Model creator: [Bud](https://huggingface.co/budecosystem)
42
+ - Original model: [GenZ 13B v2](https://huggingface.co/budecosystem/genz-13b-v2)
43
+
44
+ <!-- description start -->
45
+ ## Description
46
+
47
+ This repo contains GPTQ model files for [Bud's GenZ 13B v2](https://huggingface.co/budecosystem/genz-13b-v2).
48
+
49
+ 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.
50
+
51
+ <!-- description end -->
52
+ <!-- repositories-available start -->
53
+ ## Repositories available
54
+
55
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/genz-13B-v2-AWQ)
56
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/genz-13B-v2-GPTQ)
57
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/genz-13B-v2-GGUF)
58
+ * [Bud's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/budecosystem/genz-13b-v2)
59
+ <!-- repositories-available end -->
60
+
61
+ <!-- prompt-template start -->
62
+ ## Prompt template: User-Assistant-Newlines
63
+
64
+ ```
65
+ ### User:
66
+ {prompt}
67
+
68
+ ### Assistant:
69
+
70
+ ```
71
+
72
+ <!-- prompt-template end -->
73
+
74
+
75
+ <!-- README_GPTQ.md-provided-files start -->
76
+ ## Provided files, and GPTQ parameters
77
+
78
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
79
+
80
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
81
+
82
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
83
+
84
+ <details>
85
+ <summary>Explanation of GPTQ parameters</summary>
86
+
87
+ - Bits: The bit size of the quantised model.
88
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
89
+ - 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.
90
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
91
+ - 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).
92
+ - 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.
93
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
94
+
95
+ </details>
96
+
97
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
98
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
99
+ | [main](https://huggingface.co/TheBloke/genz-13B-v2-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
100
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/genz-13B-v2-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
101
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/genz-13B-v2-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
102
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/genz-13B-v2-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
103
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/genz-13B-v2-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 14.54 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
104
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/genz-13B-v2-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
105
+
106
+ <!-- README_GPTQ.md-provided-files end -->
107
+
108
+ <!-- README_GPTQ.md-download-from-branches start -->
109
+ ## How to download, including from branches
110
+
111
+ ### In text-generation-webui
112
+
113
+ To download from the `main` branch, enter `TheBloke/genz-13B-v2-GPTQ` in the "Download model" box.
114
+
115
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/genz-13B-v2-GPTQ:gptq-4bit-32g-actorder_True`
116
+
117
+ ### From the command line
118
+
119
+ I recommend using the `huggingface-hub` Python library:
120
+
121
+ ```shell
122
+ pip3 install huggingface-hub
123
+ ```
124
+
125
+ To download the `main` branch to a folder called `genz-13B-v2-GPTQ`:
126
+
127
+ ```shell
128
+ mkdir genz-13B-v2-GPTQ
129
+ huggingface-cli download TheBloke/genz-13B-v2-GPTQ --local-dir genz-13B-v2-GPTQ --local-dir-use-symlinks False
130
+ ```
131
+
132
+ To download from a different branch, add the `--revision` parameter:
133
+
134
+ ```shell
135
+ mkdir genz-13B-v2-GPTQ
136
+ huggingface-cli download TheBloke/genz-13B-v2-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir genz-13B-v2-GPTQ --local-dir-use-symlinks False
137
+ ```
138
+
139
+ <details>
140
+ <summary>More advanced huggingface-cli download usage</summary>
141
+
142
+ 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.
143
+
144
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
145
+
146
+ 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).
147
+
148
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
149
+
150
+ ```shell
151
+ pip3 install hf_transfer
152
+ ```
153
+
154
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
155
+
156
+ ```shell
157
+ mkdir genz-13B-v2-GPTQ
158
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/genz-13B-v2-GPTQ --local-dir genz-13B-v2-GPTQ --local-dir-use-symlinks False
159
+ ```
160
+
161
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
162
+ </details>
163
+
164
+ ### With `git` (**not** recommended)
165
+
166
+ To clone a specific branch with `git`, use a command like this:
167
+
168
+ ```shell
169
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/genz-13B-v2-GPTQ
170
+ ```
171
+
172
+ 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.)
173
+
174
+ <!-- README_GPTQ.md-download-from-branches end -->
175
+ <!-- README_GPTQ.md-text-generation-webui start -->
176
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
177
+
178
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
179
+
180
+ 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.
181
+
182
+ 1. Click the **Model tab**.
183
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/genz-13B-v2-GPTQ`.
184
+ - To download from a specific branch, enter for example `TheBloke/genz-13B-v2-GPTQ:gptq-4bit-32g-actorder_True`
185
+ - see Provided Files above for the list of branches for each option.
186
+ 3. Click **Download**.
187
+ 4. The model will start downloading. Once it's finished it will say "Done".
188
+ 5. In the top left, click the refresh icon next to **Model**.
189
+ 6. In the **Model** dropdown, choose the model you just downloaded: `genz-13B-v2-GPTQ`
190
+ 7. The model will automatically load, and is now ready for use!
191
+ 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.
192
+ * 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`.
193
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
194
+
195
+ <!-- README_GPTQ.md-text-generation-webui end -->
196
+
197
+ <!-- README_GPTQ.md-use-from-tgi start -->
198
+ ## Serving this model from Text Generation Inference (TGI)
199
+
200
+ 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`
201
+
202
+ Example Docker parameters:
203
+
204
+ ```shell
205
+ --model-id TheBloke/genz-13B-v2-GPTQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
206
+ ```
207
+
208
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
209
+
210
+ ```shell
211
+ pip3 install huggingface-hub
212
+ ```
213
+
214
+ ```python
215
+ from huggingface_hub import InferenceClient
216
+
217
+ endpoint_url = "https://your-endpoint-url-here"
218
+
219
+ prompt = "Tell me about AI"
220
+ prompt_template=f'''### User:
221
+ {prompt}
222
+
223
+ ### Assistant:
224
+ '''
225
+
226
+ client = InferenceClient(endpoint_url)
227
+ response = client.text_generation(prompt,
228
+ max_new_tokens=128,
229
+ do_sample=True,
230
+ temperature=0.7,
231
+ top_p=0.95,
232
+ top_k=40,
233
+ repetition_penalty=1.1)
234
+
235
+ print(f"Model output: {response}")
236
+ ```
237
+ <!-- README_GPTQ.md-use-from-tgi end -->
238
+ <!-- README_GPTQ.md-use-from-python start -->
239
+ ## How to use this GPTQ model from Python code
240
+
241
+ ### Install the necessary packages
242
+
243
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
244
+
245
+ ```shell
246
+ pip3 install transformers optimum
247
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
248
+ ```
249
+
250
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
251
+
252
+ ```shell
253
+ pip3 uninstall -y auto-gptq
254
+ git clone https://github.com/PanQiWei/AutoGPTQ
255
+ cd AutoGPTQ
256
+ git checkout v0.4.2
257
+ pip3 install .
258
+ ```
259
+
260
+ ### You can then use the following code
261
+
262
+ ```python
263
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
264
+
265
+ model_name_or_path = "TheBloke/genz-13B-v2-GPTQ"
266
+ # To use a different branch, change revision
267
+ # For example: revision="gptq-4bit-32g-actorder_True"
268
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
269
+ device_map="auto",
270
+ trust_remote_code=False,
271
+ revision="main")
272
+
273
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
274
+
275
+ prompt = "Tell me about AI"
276
+ prompt_template=f'''### User:
277
+ {prompt}
278
+
279
+ ### Assistant:
280
+ '''
281
+
282
+ print("\n\n*** Generate:")
283
+
284
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
285
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
286
+ print(tokenizer.decode(output[0]))
287
+
288
+ # Inference can also be done using transformers' pipeline
289
+
290
+ print("*** Pipeline:")
291
+ pipe = pipeline(
292
+ "text-generation",
293
+ model=model,
294
+ tokenizer=tokenizer,
295
+ max_new_tokens=512,
296
+ do_sample=True,
297
+ temperature=0.7,
298
+ top_p=0.95,
299
+ top_k=40,
300
+ repetition_penalty=1.1
301
+ )
302
+
303
+ print(pipe(prompt_template)[0]['generated_text'])
304
+ ```
305
+ <!-- README_GPTQ.md-use-from-python end -->
306
+
307
+ <!-- README_GPTQ.md-compatibility start -->
308
+ ## Compatibility
309
+
310
+ 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).
311
+
312
+ [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.
313
+
314
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
315
+ <!-- README_GPTQ.md-compatibility end -->
316
+
317
+ <!-- footer start -->
318
+ <!-- 200823 -->
319
+ ## Discord
320
+
321
+ For further support, and discussions on these models and AI in general, join us at:
322
+
323
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
324
+
325
+ ## Thanks, and how to contribute
326
+
327
+ Thanks to the [chirper.ai](https://chirper.ai) team!
328
+
329
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
330
+
331
+ 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.
332
+
333
+ 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.
334
+
335
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
336
+
337
+ * Patreon: https://patreon.com/TheBlokeAI
338
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
339
+
340
+ **Special thanks to**: Aemon Algiz.
341
+
342
+ **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
343
+
344
+
345
+ Thank you to all my generous patrons and donaters!
346
+
347
+ And thank you again to a16z for their generous grant.
348
+
349
+ <!-- footer end -->
350
+
351
+ # Original model card: Bud's GenZ 13B v2
352
+
353
+ ---
354
+
355
+ <div align="center"><h1 align="center">~ GenZ ~</h1><img src="https://raw.githubusercontent.com/BudEcosystem/GenZ/main/assets/genz-logo.png" width=150></div>
356
+
357
+
358
+ <p align="center"><i>Democratizing access to LLMs for the open-source community.<br>Let's advance AI, together. </i></p>
359
+
360
+ ---
361
+
362
+
363
+ ## Introduction 🎉
364
+
365
+ Welcome to **GenZ**, an advanced Large Language Model (LLM) fine-tuned on the foundation of Meta's open-source Llama V2 13B parameter model. At Bud Ecosystem, we believe in the power of open-source collaboration to drive the advancement of technology at an accelerated pace. Our vision is to democratize access to fine-tuned LLMs, and to that end, we will be releasing a series of models across different parameter counts (7B, 13B, and 70B) and quantizations (32-bit and 4-bit) for the open-source community to use, enhance, and build upon.
366
+
367
+ <p align="center"><img src="https://raw.githubusercontent.com/BudEcosystem/GenZ/main/assets/MTBench_CompareChart_28July2023.png" width="500"></p>
368
+
369
+ The smaller quantization version of our models makes them more accessible, enabling their use even on personal computers. This opens up a world of possibilities for developers, researchers, and enthusiasts to experiment with these models and contribute to the collective advancement of language model technology.
370
+
371
+ GenZ isn't just a powerful text generator—it's a sophisticated AI assistant, capable of understanding and responding to user prompts with high-quality responses. We've taken the robust capabilities of Llama V2 and fine-tuned them to offer a more user-focused experience. Whether you're seeking informative responses or engaging interactions, GenZ is designed to deliver.
372
+
373
+ And this isn't the end. It's just the beginning of a journey towards creating more advanced, more efficient, and more accessible language models. We invite you to join us on this exciting journey. 🚀
374
+
375
+ ---
376
+
377
+ <h2>Milestone Releases ️🏁</h2>
378
+
379
+ **[27 July 2023]**
380
+ [_GenZ-13B V2 (ggml)_](https://huggingface.co/budecosystem/genz-13b-v2-ggml) : Announcing our GenZ-13B v2 with ggml. This variant of GenZ can run inferencing using only CPU and without the need of GPU. Download the model from [HuggingFace](https://huggingface.co/budecosystem/genz-13b-v2-ggml).
381
+
382
+ **[27 July 2023]**
383
+ [_GenZ-13B V2 (4-bit)_](https://huggingface.co/budecosystem/genz-13b-v2-4bit) : Announcing our GenZ-13B v2 with 4-bit quantisation. Enabling inferencing with much lesser GPU memory than the 32-bit variant. Download the model from [HuggingFace](https://huggingface.co/budecosystem/genz-13b-v2-4bit).
384
+
385
+ **[26 July 2023]**
386
+ [_GenZ-13B V2_](https://huggingface.co/budecosystem/genz-13b-v2) : We're excited to announce the release of our Genz 13B v2 model, a step forward with improved evaluation results compared to v1. Experience the advancements by downloading the model from [HuggingFace](https://huggingface.co/budecosystem/genz-13b-v2).
387
+
388
+ **[20 July 2023]**
389
+ [_GenZ-13B_](https://huggingface.co/budecosystem/genz-13b) : We marked an important milestone with the release of the Genz 13B model. The journey began here, and you can partake in it by downloading the model from [Hugging Face](https://huggingface.co/budecosystem/genz-13b).
390
+
391
+ ---
392
+
393
+
394
+ <img src="https://raw.githubusercontent.com/BudEcosystem/GenZ/main/assets/screenshot_genz13bv2.png" width="100%">
395
+
396
+ | ![Python](https://raw.githubusercontent.com/BudEcosystem/GenZ/main/assets/Python.gif) | ![Poem](https://raw.githubusercontent.com/BudEcosystem/GenZ/main/assets/Poem.gif) | ![Email](https://raw.githubusercontent.com/BudEcosystem/GenZ/main/assets/Email.gif)
397
+ |:--:|:--:|:--:|
398
+ | *Code Generation* | *Poem Generation* | *Email Generation* |
399
+
400
+ <!--
401
+ <p align="center"><img src="https://raw.githubusercontent.com/adrot-dev/git-test/blob/main/assets/Python.gif" width="33%" alt="Python Code"><img src="https://raw.githubusercontent.com/adrot-dev/git-test/blob/main/assets/Poem.gif" width="33%"><img src="https://raw.githubusercontent.com/adrot-dev/git-test/blob/main/assets/Email.gif" width="33%"></p>
402
+ -->
403
+
404
+
405
+ <h2>Getting Started on Hugging Face 🤗</h2>
406
+
407
+ Getting up and running with our models on Hugging Face is a breeze. Follow these steps:
408
+
409
+ <h3>1️⃣ : Import necessary modules</h3>
410
+
411
+
412
+ Start by importing the necessary modules from the ‘transformers’ library and ‘torch’.
413
+
414
+ ```python
415
+ import torch
416
+ from transformers import AutoTokenizer, AutoModelForCausalLM
417
+ ```
418
+
419
+ <h3>2️⃣ : Load the tokenizer and the model</h3>
420
+
421
+ Next, load up the tokenizer and the model for ‘budecosystem/genz-13b-v2’ from Hugging Face using the ‘from_pretrained’ method.
422
+
423
+ ```python
424
+ tokenizer = AutoTokenizer.from_pretrained("budecosystem/genz-13b-v2", trust_remote_code=True)
425
+ model = AutoModelForCausalLM.from_pretrained("budecosystem/genz-13b-v2", torch_dtype=torch.bfloat16)
426
+ ```
427
+
428
+ <h3>3️⃣ : Generate responses</h3>
429
+
430
+
431
+ Now that you have the model and tokenizer, you're ready to generate responses. Here's how you can do it:
432
+
433
+ ```python
434
+ inputs = tokenizer("The meaning of life is", return_tensors="pt")
435
+ sample = model.generate(**inputs, max_length=128)
436
+ print(tokenizer.decode(sample[0]))
437
+ ```
438
+
439
+ In this example, "The meaning of life is" is the prompt template used for inference. You can replace it with any string you like.
440
+
441
+ Want to interact with the model in a more intuitive way? We have a Gradio interface set up for that. Head over to our GitHub page, clone the repository, and run the ‘generate.py’ script to try it out. Happy experimenting! 😄
442
+
443
+ <h2>Fine-tuning 🎯</h2>
444
+
445
+
446
+ It's time to upgrade the model by fine-tuning the model. You can do this using our provided finetune.py script. Here's an example command:
447
+
448
+ ```bash
449
+ python finetune.py \
450
+ --model_name meta-llama/Llama-2-13b \
451
+ --data_path dataset.json \
452
+ --output_dir output \
453
+ --trust_remote_code \
454
+ --prompt_column instruction \
455
+ --response_column output \
456
+ --pad_token_id 50256
457
+ ```
458
+
459
+ ---
460
+
461
+ <h2 >Bonus: Colab Notebooks 📚 <b><i>(WIP)</i></b></h2>
462
+
463
+
464
+ Looking for an even simpler way to get started with GenZ? We've got you covered. We've prepared a pair of detailed Colab notebooks - one for Inference and one for Fine-tuning. These notebooks come pre-filled with all the information and code you'll need. All you'll have to do is run them!
465
+
466
+ Keep an eye out for these notebooks. They'll be added to the repository soon!
467
+
468
+ ---
469
+
470
+ <h2>Why Use GenZ? 💡</h2>
471
+
472
+
473
+ You might be wondering, "Why should I choose GenZ over a pretrained model?" The answer lies in the extra mile we've gone to fine-tune our models.
474
+
475
+ While pretrained models are undeniably powerful, GenZ brings something extra to the table. We've fine-tuned it with curated datasets, which means it has additional skills and capabilities beyond what a pretrained model can offer. Whether you need it for a simple task or a complex project, GenZ is up for the challenge.
476
+
477
+ What's more, we are committed to continuously enhancing GenZ. We believe in the power of constant learning and improvement. That's why we'll be regularly fine-tuning our models with various curated datasets to make them even better. Our goal is to reach the state of the art and beyond - and we're committed to staying the course until we get there.
478
+
479
+ But don't just take our word for it. We've provided detailed evaluations and performance details in a later section, so you can see the difference for yourself.
480
+
481
+ Choose GenZ and join us on this journey. Together, we can push the boundaries of what's possible with large language models.
482
+
483
+ ---
484
+
485
+ <h2>Model Card for GenZ 13B 📄</h2>
486
+
487
+ Here's a quick overview of everything you need to know about GenZ 13B.
488
+
489
+ <h3>Model Details:</h3>
490
+
491
+
492
+ - Developed by: Bud Ecosystem
493
+ - Base pretrained model type: Llama V2 13B
494
+ - Model Architecture: GenZ 13B, fine-tuned on Llama V2 13B, is an auto-regressive language model that employs an optimized transformer architecture. The fine-tuning process for GenZ 13B leveraged Supervised Fine-Tuning (SFT)
495
+ - License: The model is available for commercial use under a custom commercial license. For more information, please visit: [Meta AI Model and Library Downloads](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)
496
+
497
+ ---
498
+
499
+ <h2>Intended Use 💼</h2>
500
+
501
+ When we created GenZ 13B, we had a clear vision of how it could be used to push the boundaries of what's possible with large language models. We also understand the importance of using such models responsibly. Here's a brief overview of the intended and out-of-scope uses for GenZ 13B.
502
+
503
+ <h3>Direct Use</h3>
504
+
505
+ GenZ 13B is designed to be a powerful tool for research on large language models. It's also an excellent foundation for further specialization and fine-tuning for specific use cases, such as:
506
+ - Text summarization
507
+ - Text generation
508
+ - Chatbot creation
509
+ - And much more!
510
+
511
+ <h3>Out-of-Scope Use 🚩</h3>
512
+
513
+ While GenZ 13B is versatile, there are certain uses that are out of scope:
514
+
515
+ - Production use without adequate assessment of risks and mitigation
516
+ - Any use cases which may be considered irresponsible or harmful
517
+ - Use in any manner that violates applicable laws or regulations, including trade compliance laws
518
+ - Use in any other way that is prohibited by the Acceptable Use Policy and Licensing Agreement for Llama 2
519
+
520
+ Remember, GenZ 13B, like any large language model, is trained on a large-scale corpora representative of the web, and therefore, may carry the stereotypes and biases commonly encountered online.
521
+
522
+ <h3>Recommendations 🧠</h3>
523
+
524
+ We recommend users of GenZ 13B to consider fine-tuning it for the specific set of tasks of interest. Appropriate precautions and guardrails should be taken for any production use. Using GenZ 13B responsibly is key to unlocking its full potential while maintaining a safe and respectful environment.
525
+
526
+ ---
527
+
528
+ <h2>Training Details 📚</h2>
529
+
530
+ When fine-tuning GenZ 13B, we took a meticulous approach to ensure we were building on the solid base of the pretrained Llama V2 13B model in the most effective way. Here's a look at the key details of our training process:
531
+
532
+ <h3>Fine-Tuning Training Data</h3>
533
+
534
+ For the fine-tuning process, we used a carefully curated mix of datasets. These included data from OpenAssistant, an instruction fine-tuning dataset, and Thought Source for the Chain Of Thought (CoT) approach. This diverse mix of data sources helped us enhance the model's capabilities across a range of tasks.
535
+
536
+ <h3>Fine-Tuning Procedure</h3>
537
+
538
+ We performed a full-parameter fine-tuning using Supervised Fine-Tuning (SFT). This was carried out on 4 A100 80GB GPUs, and the process took under 100 hours. To make the process more efficient, we used DeepSpeed's ZeRO-3 optimization.
539
+
540
+ <h3>Tokenizer</h3>
541
+
542
+ We used the SentencePiece tokenizer during the fine-tuning process. This tokenizer is known for its capability to handle open-vocabulary language tasks efficiently.
543
+
544
+
545
+ <h3>Hyperparameters</h3>
546
+
547
+
548
+ Here are the hyperparameters we used for fine-tuning:
549
+
550
+ | Hyperparameter | Value |
551
+ | -------------- | ----- |
552
+ | Warmup Ratio | 0.04 |
553
+ | Learning Rate Scheduler Type | Cosine |
554
+ | Learning Rate | 2e-5 |
555
+ | Number of Training Epochs | 3 |
556
+ | Per Device Training Batch Size | 4 |
557
+ | Gradient Accumulation Steps | 4 |
558
+ | Precision | FP16 |
559
+ | Optimizer | AdamW |
560
+
561
+ ---
562
+
563
+ <h2>Evaluations 🎯</h2>
564
+
565
+ Evaluating our model is a key part of our fine-tuning process. It helps us understand how our model is performing and how it stacks up against other models. Here's a look at some of the key evaluations for GenZ 13B:
566
+
567
+ <h3>Benchmark Comparison</h3>
568
+
569
+ We've compared GenZ V1 with V2 to understand the improvements our fine-tuning has achieved.
570
+
571
+ | Model Name | MT Bench | Vicuna Bench | MMLU | Human Eval | Hellaswag | BBH |
572
+ |:----------:|:--------:|:------------:|:----:|:----------:|:---------:|:----:|
573
+ | Genz 13B | 6.12 | 86.1 | 53.62| 17.68 | 77.38 | 37.76|
574
+ | Genz 13B v2| 6.79 | 87.2 | 53.68| 21.95 | 77.48 | 38.1 |
575
+
576
+ <h3>MT Bench Score</h3>
577
+
578
+ A key evaluation metric we use is the MT Bench score. This score provides a comprehensive assessment of our model's performance across a range of tasks.
579
+
580
+ We're proud to say that our model performs at a level that's close to the Llama-70B-chat model on the MT Bench and top of the list among 13B models.
581
+
582
+ <p align="center"><img src="https://raw.githubusercontent.com/BudEcosystem/GenZ/main/assets/mt_bench_score.png" width="500"></p>
583
+
584
+ In the transition from GenZ V1 to V2, we noticed some fascinating performance shifts. While we saw a slight dip in coding performance, two other areas, Roleplay and Math, saw noticeable improvements.
585
+
586
+ ---
587
+
588
+ <h2>Looking Ahead 👀</h2>
589
+
590
+ We're excited about the journey ahead with GenZ. We're committed to continuously improving and enhancing our models, and we're excited to see what the open-source community will build with them. We believe in the power of collaboration, and we can't wait to see what we can achieve together.
591
+
592
+ Remember, we're just getting started. This is just the beginning of a journey that we believe will revolutionize the world of large language models. We invite you to join us on this exciting journey. Together, we can push the boundaries of what's possible with AI. 🚀
593
+
594
+ ---
595
+
596
+
597
+ Check the GitHub for the code -> [GenZ](https://raw.githubusercontent.com/BudEcosystem/GenZ)