AnirudhRajagopalan1201
commited on
Commit
•
dd35297
1
Parent(s):
6119bd6
Update README.md
Browse files
README.md
CHANGED
@@ -1,46 +0,0 @@
|
|
1 |
-
---
|
2 |
-
datasets:
|
3 |
-
- roneneldan/TinyStories
|
4 |
-
---
|
5 |
-
---
|
6 |
-
Model trained on the TinyStories Dataset, replicating https://arxiv.org/abs/2305.07759, based on LLaMA architecture.
|
7 |
-
|
8 |
-
---
|
9 |
-
Hyperparams used to train this model:
|
10 |
-
```
|
11 |
-
"batch_size": 64,
|
12 |
-
"block_size": 128,
|
13 |
-
"lr": 6e-4,
|
14 |
-
"num_hidden_layers": 8,
|
15 |
-
"num_attention_heads": 8,
|
16 |
-
"hidden_size": 160,
|
17 |
-
"dropout": 0.1,
|
18 |
-
"weight_decay": 0.01,
|
19 |
-
"epochs": 5,
|
20 |
-
"eval_interval": 200,
|
21 |
-
"eval_steps": 50,
|
22 |
-
"vocab_size": 50257,
|
23 |
-
"warmup_tokens": 10000,
|
24 |
-
"gradient_accumulation_steps": 16,
|
25 |
-
```
|
26 |
-
---
|
27 |
-
EXAMPLE USAGE
|
28 |
-
```py
|
29 |
-
!pip install --quiet transformers
|
30 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
31 |
-
from huggingface_hub import notebook_login, login
|
32 |
-
import os
|
33 |
-
|
34 |
-
#login to hf to check for llama access
|
35 |
-
hf_token = os.getenv('HF_TOKEN')
|
36 |
-
login(token=hf_token)
|
37 |
-
|
38 |
-
model = AutoModelForCausalLM.from_pretrained('AnirudhRajagopalan1201/tinyllama-20M')
|
39 |
-
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf")
|
40 |
-
prompt = "Lily likes cats and dogs. She asked her mom for a dog and her mom said no, so instead she asked"
|
41 |
-
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
42 |
-
output = model.generate(input_ids, temperature=0.1, max_length = 100, do_sample=True)
|
43 |
-
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
44 |
-
print(output_text)
|
45 |
-
|
46 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|