rasbt-LLMs-from-scratch/ch05/01_main-chapter-code
Sebastian Raschka be5e2a3331
Readability and code quality improvements (#959)
* Consistent dataset naming

* consistent section headers
2026-02-17 18:44:56 -06:00
..
ch05.ipynb Readability and code quality improvements (#959) 2026-02-17 18:44:56 -06:00
exercise-solutions.ipynb Readability and code quality improvements (#959) 2026-02-17 18:44:56 -06:00
gpt_download.py Switch from urllib to requests to improve reliability (#867) 2025-10-07 15:22:59 -05:00
gpt_generate.py Switch from urllib to requests to improve reliability (#867) 2025-10-07 15:22:59 -05:00
gpt_train.py Switch from urllib to requests to improve reliability (#867) 2025-10-07 15:22:59 -05:00
previous_chapters.py Make quote style consistent (#891) 2025-10-21 19:42:33 -05:00
README.md add main and optional sections 2024-06-19 17:48:25 -05:00
tests.py Switch from urllib to requests to improve reliability (#867) 2025-10-07 15:22:59 -05:00

Chapter 5: Pretraining on Unlabeled Data

Main Chapter Code

  • ch05.ipynb contains all the code as it appears in the chapter
  • previous_chapters.py is a Python module that contains the MultiHeadAttention module and GPTModel class from the previous chapters, which we import in ch05.ipynb to pretrain the GPT model
  • gpt_download.py contains the utility functions for downloading the pretrained GPT model weights
  • exercise-solutions.ipynb contains the exercise solutions for this chapter

Optional Code

  • gpt_train.py is a standalone Python script file with the code that we implemented in ch05.ipynb to train the GPT model (you can think of it as a code file summarizing this chapter)
  • gpt_generate.py is a standalone Python script file with the code that we implemented in ch05.ipynb to load and use the pretrained model weights from OpenAI