PY007 commited on
Commit
ae666e2
β€’
1 Parent(s): c1f1ef6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -27
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
- <!-- | Baseline | [Pythia-1B-intermediate-52b](https://huggingface.co/EleutherAI/pythia-1b/tree/step25000) | 52B | 25k | 38.81 | -->
42
- <!-- | Baseline | [Pythia-1.4B-intermediate-52b](https://huggingface.co/EleutherAI/pythia-1.4b/tree/step25000) | 52B | 25k | 42.49 | -->
43
- <!-- | Baseline | [Pythia-1.4B-intermediate-105b](https://huggingface.co/EleutherAI/pythia-1.4b/tree/step50000) | 105B | 50k | 46.14 | -->
44
- <!-- | 2023-09-04 | [TinyLlama-1.1B-intermediate-52b](https://huggingface.co/PY007/TinyLlama-1.1B-52b) | 52B | 25k | 40.85 |
45
- | 2023-09-04 | [TinyLlama-1.1B-intermediate-84b](https://huggingface.co/PY007/TinyLlama-1.1B-84b) | 84B | 40k | 42.65 | -->
 
 
 
 
 
 
 
 
 
 
46
 
47
- It can be observed that TinyLlama has so far progressed well πŸŽ‰πŸŽ‰.
48
-
49
- Meanwhile, you can track the live cross entropy loss [here](https://wandb.ai/lance777/lightning_logs/reports/metric-train_loss-23-09-02-15-26-17---Vmlldzo1MjkzNzMw?accessToken=9843chbl7rfi1w03hxttpcnbo9z8t6088pw3ddn4h8teunaq0cy7j8hw9c5i02ve).
50
-
51
- ## Training Details
52
- Below are some details of our training setup:
53
-
54
- | Setting | Description |
55
- |---------------------------------|----------------------------------------------------------------|
56
- | Parameters | 1.1B |
57
- | Attention Variant | Grouped Query Attention |
58
- | Model Size | Layers: 22, Heads: 32, Query Groups: 4, Embedding Size: 2048, Intermediate Size (Swiglu): 5632|
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
+ ```