# Fine-tuning GPT-2 for News

> Fine-tuned GPT-2 on a news dataset for conditional text generation, covering tokenization, training with Hugging Face Trainer, and evaluation.

- Role: Creator
- Period: 2025 – now
- Type: Open source
- Status: shipped
- Stack: Python, Hugging Face Transformers, PyTorch
- Source: https://github.com/kanephamphu/hoasens_llm_ai
- URL: https://phamphutai.com/projects/gpt2-news/

A hands-on project to understand how large language models are adapted to a domain.

- Tokenize a JSONL news dataset and save it to disk
- Fine-tune GPT-2 with the Hugging Face `Trainer`
- Generate and evaluate news-style text from prompts

I wrote up what I learned in [Generative AI Large Language Model: Train From Pre-trained Model](https://phamphutai.com/2025/06/14/generative-ai-large-language-model-i-fine-tunning-gpt-model/).
