Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- cerebras/SlimPajama-627B
|
| 5 |
+
- bigcode/starcoderdata
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
---
|
| 9 |
+
<div align="center">
|
| 10 |
+
|
| 11 |
+
# TinyLlama-1.1B
|
| 12 |
+
</div>
|
| 13 |
+
|
| 14 |
+
https://github.com/jzhang38/TinyLlama
|
| 15 |
+
|
| 16 |
+
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.
|
| 17 |
+
|
| 18 |
+
<div align="center">
|
| 19 |
+
<img src="./TinyLlama_logo.png" width="300"/>
|
| 20 |
+
</div>
|
| 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 the chat model finetuned on [PY007/TinyLlama-1.1B-intermediate-step-240k-503b](https://huggingface.co/PY007/TinyLlama-1.1B-intermediate-step-240k-503b). The dataset used is [openassistant-guananco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco).
|
| 26 |
+
|
| 27 |
+
#### How to use
|
| 28 |
+
You will need the transformers>=4.31
|
| 29 |
+
Do check the [TinyLlama](https://github.com/jzhang38/TinyLlama) github page for more information.
|
| 30 |
+
```
|
| 31 |
+
from transformers import AutoTokenizer
|
| 32 |
+
import transformers
|
| 33 |
+
import torch
|
| 34 |
+
model = "PY007/TinyLlama-1.1B-step-50K-105b"
|
| 35 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
| 36 |
+
pipeline = transformers.pipeline(
|
| 37 |
+
"text-generation",
|
| 38 |
+
model=model,
|
| 39 |
+
torch_dtype=torch.float16,
|
| 40 |
+
device_map="auto",
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
sequences = pipeline(
|
| 44 |
+
'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.',
|
| 45 |
+
do_sample=True,
|
| 46 |
+
top_k=10,
|
| 47 |
+
num_return_sequences=1,
|
| 48 |
+
repetition_penalty=1.5,
|
| 49 |
+
eos_token_id=tokenizer.eos_token_id,
|
| 50 |
+
max_length=500,
|
| 51 |
+
)
|
| 52 |
+
for seq in sequences:
|
| 53 |
+
print(f"Result: {seq['generated_text']}")
|
| 54 |
+
```
|