Train Your Own GPT Model in Your Language Without Starting From Scratch

From the creator

In this video, you'll learn how to fine-tune the GPT OSS model — a powerful open-source language model released by OpenAI under the Apache 2.0 license — using Hugging Face Transformers and the `trl` + `peft` libraries. https://mer.vin/2025/08/gpt-oss-finetuning/ https://github.com/openai/openai-cookbook/blob/main/articles/gpt-oss/fine-tune-transfomers.ipynb https://cookbook.openai.com/articles/gpt-oss/fine-tune-transfomers 0:00 - Fine-tuning GPT-OSS with Hugging Face 1:15 - System config and setup 2:00 - Step 2: Prepare the dataset 3:36 - Step 3: Prepare the model 4:59 - Step 4: Fine-tuning the model 6:05 - Step 5: Inference and integration 6:43 - Summary By default, GPTOSS reasons in English even when prompted in other languages. To overcome this, we demonstrate how to fine-tune it using a multilingual dataset so it can think and respond in your target language. The tutorial is broken down into 5 clear steps: 1. **Setup** – Install required libraries like `torch`, `transformers`, `trl`, and `peft`. 2. **Prepare the Dataset** – Use the `HuggingFaceH4/Multilingual-Thinking` dataset, tokenize the inputs, and structure them for training. 3. **Prepare the Model** – Load the GPTOSS 20B model with a LoRA configuration to efficiently fine-tune only a small portion of the model (~15M parameters). 4. **Fine-tuning** – Configure and train the model using `SFTTrainer`, monitor training loss, and push the model to Hugging Face Hub. 5. **Inference** – Load the fine-tuned model and run inference in your own applications using Python and the Hugging Face `pipeline`. You'll also learn: - How to log into Hugging Face from Colab or your terminal using `huggingface-cli login`. - How tokenization works before and after model prediction. - How to store and retrieve the model from the Hugging Face Hub. - How to integrate the fine-tuned model into your own apps using a few lines of Python code. GPU used: RTX A6000 (via M Compute) Discount: Use the coupon mentioned in the video for 50% off on GPU rental. All the code, configuration, and Hugging Face model links are provided in the description. Watch till the end to also see a mention of Unsloth for faster fine-tuning! Try it out, integrate it into your app, and let me know what you build! Explore how to fine-tune a GPT-OSS model using Hugging Face Transformers for specific languages. This detailed guide covers dataset preparation, model setup, and the fine-tuning process, and shows how to run the trained model. Learn about **natural language processing** and **llm** capabilities to enhance your **machine learning** projects using **ai tools** and **artificial intelligence**.

Choose to Build with AI
Matched to Hugging Face

AI Maker Residence 3

The third AI workshop taught by our legendary teacher, Nick Sarafa. This is a full-day hands-on training workshop for purposeful co-creation with AI using Claude Code. Imagine having access to hundreds of billions of dollars of computing power and knowing exactly how to make it work for you through the power of super intelligence.

◆ Fri 09 Oct 2026 ◆ KOKO Cafe, London ◆ With Nick Sarafa
AI Maker Residence 3
Live event
AI Maker Residence 3
Fri 09 Oct 2026

More like this

Running one yourself?

List your AI event,
wherever it is.

A meetup, a workshop, a hackathon, a conference. Any city, or online. Tell us about it and it lands in front of people already learning this stuff.