Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

finetune_shakespeare.py 645 B

You have to be logged in to leave a comment. Sign In
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
  1. import time
  2. out_dir = 'out-shakespeare'
  3. eval_interval = 5
  4. eval_iters = 40
  5. wandb_log = False # feel free to turn on
  6. wandb_project = 'shakespeare'
  7. wandb_run_name = 'ft-' + str(time.time())
  8. dataset = 'shakespeare'
  9. init_from = 'gpt2-xl' # this is the largest GPT-2 model
  10. # only save checkpoints if the validation loss improves
  11. always_save_checkpoint = False
  12. # the number of examples per iter:
  13. # 1 batch_size * 32 grad_accum * 1024 tokens = 32,768 tokens/iter
  14. # shakespeare has 301,966 tokens, so 1 epoch ~= 9.2 iters
  15. batch_size = 1
  16. gradient_accumulation_steps = 32
  17. max_iters = 20
  18. # finetune at constant LR
  19. learning_rate = 3e-5
  20. decay_lr = False
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...