rasbt-LLMs-from-scratch/ch06/01_main-chapter-code
2025-11-05 20:04:44 -06:00
..
ch06.ipynb Fix empty device issue (#904) 2025-11-05 20:04:44 -06:00
exercise-solutions.ipynb minor markdown fixes (#236) 2024-06-21 13:55:34 -05:00
gpt_class_finetune.py Switch from urllib to requests to improve reliability (#867) 2025-10-07 15:22:59 -05:00
gpt_download.py Specify UTF-8 encoding in the json load command explicitely (#557) 2025-03-05 11:46:21 -06:00
load-finetuned-model.ipynb remove redundant code line 2024-10-13 15:58:11 -05:00
previous_chapters.py Make quote style consistent (#891) 2025-10-21 19:42:33 -05:00
README.md Add missing bullet point 2024-09-21 12:59:12 -05:00
tests.py Add standalone finetuning and evaluation scripts for chapter 7 (#234) 2024-06-21 05:23:24 -05:00

Chapter 6: Finetuning for Classification

Main Chapter Code

  • ch06.ipynb contains all the code as it appears in the chapter
  • previous_chapters.py is a Python module that contains the GPT model we coded and trained in previous chapters, alongside many utility functions, which we reuse in this chapter
  • 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

  • load-finetuned-model.ipynb is a standalone Jupyter notebook to load the finetuned model we created in this chapter
  • gpt_class_finetune.py is a standalone Python script file with the code that we implemented in ch06.ipynb to finetune the GPT model (you can think of it as a chapter summary)