This tutorial expands Nelimarkka's (2026) work on finetuning language models to make social science perspectives more prominent.
Install packages
pip install transformers[torch] datasets torch ipywidgets pandas
After that in the project folder
hf download openai-community/gpt2
Notebook shows how to load a foundation model using the transformers framework.
Notebook to finetune a model to be used yourself.