File size: 1,322 Bytes
71e3f07
 
5dadbeb
 
71e3f07
5dadbeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
library_name: transformers
datasets:
- roneneldan/TinyStories
---
Model trained on the TinyStories Dataset, replicating https://arxiv.org/abs/2305.07759

Based on GPT-Neo architecture.


hyperparams used to train this model:

        "batch_size": 32,
        "block_size": 256,
        "lr": 5e-4,
        "n_layer": 6,
        "n_head": 6,
        "n_embd": 288,
        "dropout": 0.1,
        "weight_decay": 0.01,
        "epochs": 1,
        "eval_interval": 200,
        "eval_steps": 50,
        "vocab_size": 50257, 
        "warmup_tokens": 10000,
        "gradient_accumulation_steps": 8

------ EXAMPLE USAGE ---

  !pip install --quiet transformers 
  from transformers import AutoModelForCausalLM, AutoTokenizer
  model20 = AutoModelForCausalLM.from_pretrained('AnirudhRajagopalan1201/tinystories-custom-20M')
  
  tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-125M")
  prompt = "Lily likes cats and dogs. She asked her mom for a dog and her mom said no, so instead she asked"
  input_ids = tokenizer.encode(prompt, return_tensors="pt")
  print("--------------20M parameter--------------------------------")
  output = model20.generate(input_ids, temperature=0.2, max_length = 100, do_sample=True)
  output_text = tokenizer.decode(output[0], skip_special_tokens=True)
  print(output_text)