Update README.md
Browse files
README.md
CHANGED
|
@@ -21,6 +21,8 @@ The TinyLlama project aims to **pretrain** a **1.1B Llama model on 3 trillion to
|
|
| 21 |
|
| 22 |
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.
|
| 23 |
|
|
|
|
|
|
|
| 24 |
|
| 25 |
#### Releases Schedule
|
| 26 |
We will be rolling out intermediate checkpoints following the below schedule. We also include some baseline models for comparison.
|
|
@@ -38,31 +40,31 @@ We will be rolling out intermediate checkpoints following the below schedule. We
|
|
| 38 |
| 2023-11-15 | -- | 2.5T | -- | -- |
|
| 39 |
| 2023-12-01 | -- | 3T | -- | -- |
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
| Sequence Length | 2048 |
|
| 60 |
-
| Batch Size | 2 million tokens (2048 * 1024) |
|
| 61 |
-
| Learning Rate | 4e-4 |
|
| 62 |
-
| Learning Rate Schedule | Cosine with 2000 warmup steps |
|
| 63 |
-
| Training Data | [Slimpajama](https://huggingface.co/datasets/cerebras/slimpajama-627b) & [Starcoderdata](https://huggingface.co/datasets/bigcode/starcoderdata) |
|
| 64 |
-
| Data Preprocessing | Excluded GitHub subset of Slimpajama; Sampled all code from Starcoderdata |
|
| 65 |
-
| Combined Dataset Size | 1 trillion tokens |
|
| 66 |
-
| Total Tokens During Training | 3 trillion (3 epochs/1430k steps) |
|
| 67 |
-
| Natural Language to Code Ratio | 7:3 |
|
| 68 |
-
| Hardware | 16 A100-40G GPUs |
|
|
|
|
| 21 |
|
| 22 |
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.
|
| 23 |
|
| 24 |
+
#### This Model
|
| 25 |
+
This is an intermediate checkpoint with 50K steps and 105B tokens.
|
| 26 |
|
| 27 |
#### Releases Schedule
|
| 28 |
We will be rolling out intermediate checkpoints following the below schedule. We also include some baseline models for comparison.
|
|
|
|
| 40 |
| 2023-11-15 | -- | 2.5T | -- | -- |
|
| 41 |
| 2023-12-01 | -- | 3T | -- | -- |
|
| 42 |
|
| 43 |
+
#### How to use
|
| 44 |
+
You will need the transformers>=4.31
|
| 45 |
+
Do check the [TinyLlama](https://github.com/jzhang38/TinyLlama) github page for more information.
|
| 46 |
+
```
|
| 47 |
+
from transformers import AutoTokenizer
|
| 48 |
+
import transformers
|
| 49 |
+
import torch
|
| 50 |
+
model = "PY007/TinyLlama-1.1B-step-50K-105b"
|
| 51 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
| 52 |
+
pipeline = transformers.pipeline(
|
| 53 |
+
"text-generation",
|
| 54 |
+
model=model,
|
| 55 |
+
torch_dtype=torch.float16,
|
| 56 |
+
device_map="auto",
|
| 57 |
+
)
|
| 58 |
|
| 59 |
+
sequences = pipeline(
|
| 60 |
+
'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.',
|
| 61 |
+
do_sample=True,
|
| 62 |
+
top_k=10,
|
| 63 |
+
num_return_sequences=1,
|
| 64 |
+
repetition_penalty=1.5,
|
| 65 |
+
eos_token_id=tokenizer.eos_token_id,
|
| 66 |
+
max_length=500,
|
| 67 |
+
)
|
| 68 |
+
for seq in sequences:
|
| 69 |
+
print(f"Result: {seq['generated_text']}")
|
| 70 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|