Uploaded January 2026 | Updated November 2026, 3 hours ago
In this video we fully fine-tune Google's Gemma 3 270M Small Language Model to do structured data extraction.
Because the Gemma 3 270M is quite small in world of LLMs, we're able to do all of the training locally on a NVIDIA DGX Spark (see here for more: nvda.ws/4iQXZU4).
The code should also run in Google Colab.
If you have any issues, please let me know in a comment.
Links:
Google Colab Notebook - colab.research.google.com/drive/1hV6Gcz8vBRS9t0bYkBp6W1ne_yqG6mJx?usp=sharing
Learn Hugging Face Book Version - learnhuggingface.com/notebooks/hugging_face_llm_full_fine_tune_tutorial
Dataset - huggingface.co/datasets/mrdbourke/FoodExtract-1k
Base model (Gemma 3 270M) - huggingface.co/google/gemma-3-270m-it
Demo - huggingface.co/spaces/mrdbourke/FoodExtract-v1
Past livestreams (where we coded the notebook from scratch):
Part 1 (loading the model and fine-tuning it) - youtube.com/live/M32fJdG3D_A?feature=share
Part 2 (sharing our model and creating a demo) - youtube.com/live/zt8t-xT26rA?feature=share
Courses I teach:
Learn AI/ML (beginner-friendly course) - dbourke.link/ZTMMLcourse
Learn Hugging Face - dbourke.link/ZTMHuggingFace
Learn TensorFlow - dbourke.link/ZTMTFcourse
Learn PyTorch - dbourke.link/ZTMPyTorch
Connect elsewhere:
Download Nutrify (my startup) - apple.co/4ahM7Wc
My website - mrdbourke.com
X/Twitter - twitter.com/mrdbourke
LinkedIn - linkedin.com/in/mrdbourke
Get email updates on my work - dbourke.link/newsletter
Read my novel Charlie Walks - charliewalks.com
Timestamps:
00:00 Welcome to the Machine Learning Cooking Show
00:57 Why Fine-Tune Your Own Model?
02:47 Ingredients and Preparation
05:45 Understanding the Task and Data
18:27 Formatting Data for the Model
20:41 Testing the Base Model
30:29 Model Fine-Tuning
31:08 Testing the Model with Sample Data
32:26 Setting Up Supervised Fine-Tuning
34:42 Training the Model Locally
36:38 Evaluating Model Performance
42:55 Uploading the Model to Hugging Face Hub
47:02 Creating a Demo with Gradio
56:08 Speeding Up Inference with Batch Processing
58:11 Next Steps and Conclusion
In this video we fully fine-tune Google's Gemma 3 270M Small Language Model to do structured data extraction.
Because the Gemma 3 270M is quite small in world of LLMs, we're able to do all of the training locally on a NVIDIA DGX Spark (see here for more: nvda.ws/4iQXZU4).
The code should also run in Google Colab.
If you have any issues, please let me know in a comment.
Links:
Google Colab Notebook - colab.research.google.com/drive/1hV6Gcz8vBRS9t0bYkBp6W1ne_yqG6mJx?usp=sharing
Learn Hugging Face Book Version - learnhuggingface.com/notebooks/hugging_face_llm_full_fine_tune_tutorial
Dataset - huggingface.co/datasets/mrdbourke/FoodExtract-1k
Base model (Gemma 3 270M) - huggingface.co/google/gemma-3-270m-it
Demo - huggingface.co/spaces/mrdbourke/FoodExtract-v1
Past livestreams (where we coded the notebook from scratch):
Part 1 (loading the model and fine-tuning it) - youtube.com/live/M32fJdG3D_A?feature=share
Part 2 (sharing our model and creating a demo) - youtube.com/live/zt8t-xT26rA?feature=share
Courses I teach:
Learn AI/ML (beginner-friendly course) - dbourke.link/ZTMMLcourse
Learn Hugging Face - dbourke.link/ZTMHuggingFace
Learn TensorFlow - dbourke.link/ZTMTFcourse
Learn PyTorch - dbourke.link/ZTMPyTorch
Connect elsewhere:
Download Nutrify (my startup) - apple.co/4ahM7Wc
My website - mrdbourke.com
X/Twitter - twitter.com/mrdbourke
LinkedIn - linkedin.com/in/mrdbourke
Get email updates on my work - dbourke.link/newsletter
Read my novel Charlie Walks - charliewalks.com
Timestamps:
00:00 Welcome to the Machine Learning Cooking Show
00:57 Why Fine-Tune Your Own Model?
02:47 Ingredients and Preparation
05:45 Understanding the Task and Data
18:27 Formatting Data for the Model
20:41 Testing the Base Model
30:29 Model Fine-Tuning
31:08 Testing the Model with Sample Data
32:26 Setting Up Supervised Fine-Tuning
34:42 Training the Model Locally
36:38 Evaluating Model Performance
42:55 Uploading the Model to Hugging Face Hub
47:02 Creating a Demo with Gradio
56:08 Speeding Up Inference with Batch Processing
58:11 Next Steps and Conclusion










