
{"id":7283,"date":"2026-01-10T17:45:49","date_gmt":"2026-01-10T09:45:49","guid":{"rendered":"https:\/\/infernews.com\/?p=7283"},"modified":"2026-01-10T17:45:51","modified_gmt":"2026-01-10T09:45:51","slug":"%e7%ab%af%e5%88%b0%e7%ab%af%e5%b0%8f%e5%9e%8b-llm-%e5%be%ae%e8%aa%bf%e6%95%99%e5%ad%b8","status":"publish","type":"post","link":"https:\/\/infernews.com\/blog\/%e7%ab%af%e5%88%b0%e7%ab%af%e5%b0%8f%e5%9e%8b-llm-%e5%be%ae%e8%aa%bf%e6%95%99%e5%ad%b8\/","title":{"rendered":"\u7aef\u5230\u7aef\u5c0f\u578b LLM \u5fae\u8abf\u6559\u5b78"},"content":{"rendered":"\n<p>\u793a\u7bc4\u5982\u4f55\u5728\u672c\u5730\u4f7f\u7528 NVIDIA DGX Spark \u6216 Google Colab \u5fae\u8abf Google \u7684 Gemma 3 270M \u6a21\u578b\uff0c\u5f9e\u8cc7\u6599\u6e96\u5099\u5230\u6a21\u578b\u90e8\u7f72\u8207 Gradio \u793a\u7bc4\u3002<\/p>\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"lyte-wrapper\" title=\"End-to-End (small) LLM Fine-tuning Tutorial (from data to model to live demo) | On DGX Spark\" style=\"width:853px;max-width:100%;margin:5px auto;\"><div class=\"lyMe\" id=\"WYL_2hoNAr-id-E\" itemprop=\"video\" itemscope itemtype=\"https:\/\/schema.org\/VideoObject\"><div><meta itemprop=\"thumbnailUrl\" content=\"https:\/\/infernews.com\/blog\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2hoNAr-id-E%2Fhqdefault.jpg\" \/><meta itemprop=\"embedURL\" content=\"https:\/\/www.youtube.com\/embed\/2hoNAr-id-E\" \/><meta itemprop=\"duration\" content=\"PT59M49S\" \/><meta itemprop=\"uploadDate\" content=\"2026-01-09T10:12:46Z\" \/><\/div><div id=\"lyte_2hoNAr-id-E\" data-src=\"https:\/\/infernews.com\/blog\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2hoNAr-id-E%2Fhqdefault.jpg\" class=\"pL\"><div class=\"tC\"><div class=\"tT\" itemprop=\"name\">End-to-End (small) LLM Fine-tuning Tutorial (from data to model to live demo) | On DGX Spark<\/div><\/div><div class=\"play\"><\/div><div class=\"ctrl\"><div class=\"Lctrl\"><\/div><div class=\"Rctrl\"><\/div><\/div><\/div><noscript><a href=\"https:\/\/youtu.be\/2hoNAr-id-E\" rel=\"nofollow\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/infernews.com\/blog\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2hoNAr-id-E%2F0.jpg\" alt=\"End-to-End (small) LLM Fine-tuning Tutorial (from data to model to live demo) | On DGX Spark\" width=\"853\" height=\"460\" \/><br \/>Watch this video on YouTube<\/a><\/noscript><meta itemprop=\"description\" content=\"In this video we fully fine-tune Google&#039;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&#039;re able to do all of the training locally on a NVIDIA DGX Spark (see here for more: https:\/\/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 - https:\/\/colab.research.google.com\/drive\/1hV6Gcz8vBRS9t0bYkBp6W1ne_yqG6mJx?usp=sharing Learn Hugging Face Book Version - https:\/\/www.learnhuggingface.com\/notebooks\/hugging_face_llm_full_fine_tune_tutorial Dataset - https:\/\/huggingface.co\/datasets\/mrdbourke\/FoodExtract-1k Base model (Gemma 3 270M) - https:\/\/huggingface.co\/google\/gemma-3-270m-it Demo - https:\/\/huggingface.co\/spaces\/mrdbourke\/FoodExtract-v1 Past livestreams (where we coded the notebook from scratch): Part 1 (loading the model and fine-tuning it) - https:\/\/youtube.com\/live\/M32fJdG3D_A?feature=share Part 2 (sharing our model and creating a demo) - https:\/\/youtube.com\/live\/zt8t-xT26rA?feature=share Courses I teach: Learn AI\/ML (beginner-friendly course) - https:\/\/dbourke.link\/ZTMMLcourse Learn Hugging Face - https:\/\/dbourke.link\/ZTMHuggingFace Learn TensorFlow - https:\/\/dbourke.link\/ZTMTFcourse Learn PyTorch - https:\/\/dbourke.link\/ZTMPyTorch Connect elsewhere: Download Nutrify (my startup) - https:\/\/apple.co\/4ahM7Wc My website - https:\/\/www.mrdbourke.com X\/Twitter - https:\/\/www.twitter.com\/mrdbourke LinkedIn - www.linkedin.com\/in\/mrdbourke Get email updates on my work - https:\/\/dbourke.link\/newsletter Read my novel Charlie Walks - https:\/\/www.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\"><\/div><\/div><div class=\"lL\" style=\"max-width:100%;width:853px;margin:5px auto;\"><\/div><figcaption><\/figcaption><\/figure>","protected":false},"excerpt":{"rendered":"<p>\u793a\u7bc4\u5982\u4f55\u5728\u672c\u5730\u4f7f\u7528 NVIDIA DGX Spark \u6216 Google Colab \u5fae\u8abf Google \u7684 Gemma 3 270M \u6a21\u578b\uff0c\u5f9e\u8cc7\u6599\u6e96\u5099\u5230\u6a21\u578b\u90e8\u7f72\u8207 Gradio \u793a\u7bc4\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowvqSiDA:productID":"","footnotes":""},"categories":[27,127,133],"tags":[],"class_list":["post-7283","post","type-post","status-publish","format-standard","hentry","category-paper","category-127","category-133"],"_links":{"self":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/posts\/7283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/comments?post=7283"}],"version-history":[{"count":0,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/posts\/7283\/revisions"}],"wp:attachment":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/media?parent=7283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/categories?post=7283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/tags?post=7283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}