TheBloke commited on
Commit
7ba4332
1 Parent(s): 613c5d2

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +416 -0
README.md ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: PY007/TinyLlama-1.1B-intermediate-step-715k-1.5T
3
+ datasets:
4
+ - cerebras/SlimPajama-627B
5
+ - bigcode/starcoderdata
6
+ inference: false
7
+ language:
8
+ - en
9
+ license: apache-2.0
10
+ model_creator: Zhang Peiyuan
11
+ model_name: TinyLlama 1.1B Intermediate Step 715K 1.5T
12
+ model_type: tinyllama
13
+ prompt_template: '{prompt}
14
+
15
+ '
16
+ quantized_by: TheBloke
17
+ ---
18
+ <!-- markdownlint-disable MD041 -->
19
+
20
+ <!-- header start -->
21
+ <!-- 200823 -->
22
+ <div style="width: auto; margin-left: auto; margin-right: auto">
23
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
24
+ </div>
25
+ <div style="display: flex; justify-content: space-between; width: 100%;">
26
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
27
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
28
+ </div>
29
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
30
+ <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>
31
+ </div>
32
+ </div>
33
+ <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>
34
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
35
+ <!-- header end -->
36
+
37
+ # TinyLlama 1.1B Intermediate Step 715K 1.5T - GPTQ
38
+ - Model creator: [Zhang Peiyuan](https://huggingface.co/PY007)
39
+ - Original model: [TinyLlama 1.1B Intermediate Step 715K 1.5T](https://huggingface.co/PY007/TinyLlama-1.1B-intermediate-step-715k-1.5T)
40
+
41
+ <!-- description start -->
42
+ ## Description
43
+
44
+ This repo contains GPTQ model files for [Zhang Peiyuan's TinyLlama 1.1B Intermediate Step 715K 1.5T](https://huggingface.co/PY007/TinyLlama-1.1B-intermediate-step-715k-1.5T).
45
+
46
+ 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.
47
+
48
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
49
+
50
+ <!-- description end -->
51
+ <!-- repositories-available start -->
52
+ ## Repositories available
53
+
54
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-AWQ)
55
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ)
56
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GGUF)
57
+ * [Zhang Peiyuan's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/PY007/TinyLlama-1.1B-intermediate-step-715k-1.5T)
58
+ <!-- repositories-available end -->
59
+
60
+ <!-- prompt-template start -->
61
+ ## Prompt template: None
62
+
63
+ ```
64
+ {prompt}
65
+
66
+ ```
67
+
68
+ <!-- prompt-template end -->
69
+
70
+
71
+
72
+ <!-- README_GPTQ.md-compatible clients start -->
73
+ ## Known compatible clients / servers
74
+
75
+ These GPTQ models are known to work in the following inference servers/webuis.
76
+
77
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
78
+ - [KoboldAI United](https://github.com/henk717/koboldai)
79
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
80
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
81
+
82
+ This may not be a complete list; if you know of others, please let me know!
83
+ <!-- README_GPTQ.md-compatible clients end -->
84
+
85
+ <!-- README_GPTQ.md-provided-files start -->
86
+ ## Provided files, and GPTQ parameters
87
+
88
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
89
+
90
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
91
+
92
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
93
+
94
+ <details>
95
+ <summary>Explanation of GPTQ parameters</summary>
96
+
97
+ - Bits: The bit size of the quantised model.
98
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
99
+ - 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.
100
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
101
+ - 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).
102
+ - 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.
103
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
104
+
105
+ </details>
106
+
107
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
108
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
109
+ | [main](https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](<bound method CalibrationDataset.dataset_url of <calibration_datasets.WikitextDataset object at 0x7f12b81c3ac0>>) | 2048 | 0.77 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
110
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](<bound method CalibrationDataset.dataset_url of <calibration_datasets.WikitextDataset object at 0x7f12b81c3ac0>>) | 2048 | 0.82 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
111
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](<bound method CalibrationDataset.dataset_url of <calibration_datasets.WikitextDataset object at 0x7f12b81c3ac0>>) | 2048 | 1.23 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
112
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](<bound method CalibrationDataset.dataset_url of <calibration_datasets.WikitextDataset object at 0x7f12b81c3ac0>>) | 2048 | 1.26 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
113
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](<bound method CalibrationDataset.dataset_url of <calibration_datasets.WikitextDataset object at 0x7f12b81c3ac0>>) | 2048 | 1.32 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
114
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](<bound method CalibrationDataset.dataset_url of <calibration_datasets.WikitextDataset object at 0x7f12b81c3ac0>>) | 2048 | 0.79 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
115
+
116
+ <!-- README_GPTQ.md-provided-files end -->
117
+
118
+ <!-- README_GPTQ.md-download-from-branches start -->
119
+ ## How to download, including from branches
120
+
121
+ ### In text-generation-webui
122
+
123
+ To download from the `main` branch, enter `TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ` in the "Download model" box.
124
+
125
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ:gptq-4bit-32g-actorder_True`
126
+
127
+ ### From the command line
128
+
129
+ I recommend using the `huggingface-hub` Python library:
130
+
131
+ ```shell
132
+ pip3 install huggingface-hub
133
+ ```
134
+
135
+ To download the `main` branch to a folder called `TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ`:
136
+
137
+ ```shell
138
+ mkdir TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ
139
+ huggingface-cli download TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ --local-dir TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ --local-dir-use-symlinks False
140
+ ```
141
+
142
+ To download from a different branch, add the `--revision` parameter:
143
+
144
+ ```shell
145
+ mkdir TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ
146
+ huggingface-cli download TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ --local-dir-use-symlinks False
147
+ ```
148
+
149
+ <details>
150
+ <summary>More advanced huggingface-cli download usage</summary>
151
+
152
+ 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.
153
+
154
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
155
+
156
+ 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).
157
+
158
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
159
+
160
+ ```shell
161
+ pip3 install hf_transfer
162
+ ```
163
+
164
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
165
+
166
+ ```shell
167
+ mkdir TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ
168
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ --local-dir TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ --local-dir-use-symlinks False
169
+ ```
170
+
171
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
172
+ </details>
173
+
174
+ ### With `git` (**not** recommended)
175
+
176
+ To clone a specific branch with `git`, use a command like this:
177
+
178
+ ```shell
179
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ
180
+ ```
181
+
182
+ 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.)
183
+
184
+ <!-- README_GPTQ.md-download-from-branches end -->
185
+ <!-- README_GPTQ.md-text-generation-webui start -->
186
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
187
+
188
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
189
+
190
+ 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.
191
+
192
+ 1. Click the **Model tab**.
193
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ`.
194
+
195
+ - To download from a specific branch, enter for example `TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ:gptq-4bit-32g-actorder_True`
196
+ - see Provided Files above for the list of branches for each option.
197
+
198
+ 3. Click **Download**.
199
+ 4. The model will start downloading. Once it's finished it will say "Done".
200
+ 5. In the top left, click the refresh icon next to **Model**.
201
+ 6. In the **Model** dropdown, choose the model you just downloaded: `TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ`
202
+ 7. The model will automatically load, and is now ready for use!
203
+ 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.
204
+
205
+ - 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`.
206
+
207
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
208
+
209
+ <!-- README_GPTQ.md-text-generation-webui end -->
210
+
211
+ <!-- README_GPTQ.md-use-from-tgi start -->
212
+ ## Serving this model from Text Generation Inference (TGI)
213
+
214
+ 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`
215
+
216
+ Example Docker parameters:
217
+
218
+ ```shell
219
+ --model-id TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
220
+ ```
221
+
222
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
223
+
224
+ ```shell
225
+ pip3 install huggingface-hub
226
+ ```
227
+
228
+ ```python
229
+ from huggingface_hub import InferenceClient
230
+
231
+ endpoint_url = "https://your-endpoint-url-here"
232
+
233
+ prompt = "Tell me about AI"
234
+ prompt_template=f'''{prompt}
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
+ ## How to use this GPTQ model from Python code
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 transformers optimum
258
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
259
+ ```
260
+
261
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
262
+
263
+ ```shell
264
+ pip3 uninstall -y auto-gptq
265
+ git clone https://github.com/PanQiWei/AutoGPTQ
266
+ cd AutoGPTQ
267
+ git checkout v0.4.2
268
+ pip3 install .
269
+ ```
270
+
271
+ ### You can then use the following code
272
+
273
+ ```python
274
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
275
+
276
+ model_name_or_path = "TheBloke/TinyLlama-1.1B-intermediate-step-715k-1.5T-GPTQ"
277
+ # To use a different branch, change revision
278
+ # For example: revision="gptq-4bit-32g-actorder_True"
279
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
280
+ device_map="auto",
281
+ trust_remote_code=False,
282
+ revision="main")
283
+
284
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
285
+
286
+ prompt = "Tell me about AI"
287
+ prompt_template=f'''{prompt}
288
+ '''
289
+
290
+ print("\n\n*** Generate:")
291
+
292
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
293
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
294
+ print(tokenizer.decode(output[0]))
295
+
296
+ # Inference can also be done using transformers' pipeline
297
+
298
+ print("*** Pipeline:")
299
+ pipe = pipeline(
300
+ "text-generation",
301
+ model=model,
302
+ tokenizer=tokenizer,
303
+ max_new_tokens=512,
304
+ do_sample=True,
305
+ temperature=0.7,
306
+ top_p=0.95,
307
+ top_k=40,
308
+ repetition_penalty=1.1
309
+ )
310
+
311
+ print(pipe(prompt_template)[0]['generated_text'])
312
+ ```
313
+ <!-- README_GPTQ.md-use-from-python end -->
314
+
315
+ <!-- README_GPTQ.md-compatibility start -->
316
+ ## Compatibility
317
+
318
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
319
+
320
+ [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.
321
+
322
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
323
+ <!-- README_GPTQ.md-compatibility end -->
324
+
325
+ <!-- footer start -->
326
+ <!-- 200823 -->
327
+ ## Discord
328
+
329
+ For further support, and discussions on these models and AI in general, join us at:
330
+
331
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
332
+
333
+ ## Thanks, and how to contribute
334
+
335
+ Thanks to the [chirper.ai](https://chirper.ai) team!
336
+
337
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
338
+
339
+ 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.
340
+
341
+ 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.
342
+
343
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
344
+
345
+ * Patreon: https://patreon.com/TheBlokeAI
346
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
347
+
348
+ **Special thanks to**: Aemon Algiz.
349
+
350
+ **Patreon special mentions**: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
351
+
352
+
353
+ Thank you to all my generous patrons and donaters!
354
+
355
+ And thank you again to a16z for their generous grant.
356
+
357
+ <!-- footer end -->
358
+
359
+ # Original model card: Zhang Peiyuan's TinyLlama 1.1B Intermediate Step 715K 1.5T
360
+
361
+ <div align="center">
362
+
363
+ # TinyLlama-1.1B
364
+ </div>
365
+
366
+ https://github.com/jzhang38/TinyLlama
367
+
368
+ The TinyLlama project aims to **pretrain** a **1.1B Llama model on 3 trillion tokens**. With some proper optimization, we can achieve this within a span of "just" 90 days using 16 A100-40G GPUs 🚀🚀. The training has started on 2023-09-01.
369
+
370
+ <div align="center">
371
+ <img src="https://huggingface.co/PY007/TinyLlama-1.1B-intermediate-step-240k-503b/resolve/main/TinyLlama_logo.png" width="300"/>
372
+ </div>
373
+
374
+ We adopted exactly the same architecture and tokenizer as Llama 2. This means TinyLlama can be plugged and played in many open-source projects built upon Llama. Besides, TinyLlama is compact with only 1.1B parameters. This compactness allows it to cater to a multitude of applications demanding a restricted computation and memory footprint.
375
+
376
+ #### This Model
377
+ This is an intermediate checkpoint with 715K steps and 1.49T tokens. **We suggest you not use this directly for inference.**
378
+
379
+
380
+ #### How to use
381
+ You will need the transformers>=4.31
382
+ Do check the [TinyLlama](https://github.com/jzhang38/TinyLlama) github page for more information.
383
+ ```
384
+ from transformers import AutoTokenizer
385
+ import transformers
386
+ import torch
387
+ model = "PY007/TinyLlama-1.1B-intermediate-step-715k-1.5T"
388
+ tokenizer = AutoTokenizer.from_pretrained(model)
389
+ pipeline = transformers.pipeline(
390
+ "text-generation",
391
+ model=model,
392
+ torch_dtype=torch.float16,
393
+ device_map="auto",
394
+ )
395
+
396
+ sequences = pipeline(
397
+ 'The TinyLlama project aims to pretrain a 1.1B Llama model on 3 trillion tokens. With some proper optimization, we can achieve this within a span of "just" 90 days using 16 A100-40G GPUs 🚀🚀. The training has started on 2023-09-01.',
398
+ do_sample=True,
399
+ top_k=10,
400
+ num_return_sequences=1,
401
+ repetition_penalty=1.5,
402
+ eos_token_id=tokenizer.eos_token_id,
403
+ max_length=500,
404
+ )
405
+ for seq in sequences:
406
+ print(f"Result: {seq['generated_text']}")
407
+ ```
408
+
409
+ #### Eval
410
+ | Model | Pretrain Tokens | HellaSwag | Obqa | WinoGrande | ARC_c | ARC_e | boolq | piqa | avg |
411
+ |-------------------------------------------|-----------------|-----------|------|------------|-------|-------|-------|------|-----|
412
+ | Pythia-1.0B | 300B | 47.16 | 31.40| 53.43 | 27.05 | 48.99 | 60.83 | 69.21 | 48.30 |
413
+ | TinyLlama-1.1B-intermediate-step-50K-104b | 103B | 43.50 | 29.80| 53.28 | 24.32 | 44.91 | 59.66 | 67.30 | 46.11|
414
+ | TinyLlama-1.1B-intermediate-step-240k-503b| 503B | 49.56 |31.40 |55.80 |26.54 |48.32 |56.91 |69.42 | 48.28 |
415
+ | TinyLlama-1.1B-intermediate-step-480k-1007B | 1007B | 52.54 | 33.40 | 55.96 | 27.82 | 52.36 | 59.54 | 69.91 | 50.22 |
416
+ | TinyLlama-1.1B-intermediate-step-715k-1.5T | 1.49T | 53.68 | 35.20 | 58.33 | 29.18 | 51.89 | 59.08 | 71.65 | 51.29 |