{"id":4151,"date":"2025-04-02T00:11:45","date_gmt":"2025-04-01T16:11:45","guid":{"rendered":"https:\/\/10ccc.cc\/?p=4151"},"modified":"2026-01-03T18:42:14","modified_gmt":"2026-01-03T10:42:14","slug":"%e6%a8%a1%e5%9e%8b%e5%be%ae%e8%b0%83%ef%bc%9a%e4%bd%bf%e7%94%a8-unsloth-%e5%be%ae%e8%b0%83-deepseek_r1","status":"publish","type":"post","link":"https:\/\/10ccc.cc\/?p=4151","title":{"rendered":"\u6a21\u578b\u5fae\u8c03\uff1a\u4f7f\u7528 Unsloth \u5fae\u8c03 DeepSeek_R1"},"content":{"rendered":"<h1>\u91cd\u8981\u58f0\u660e<\/h1>\n<blockquote><p>\u5f53\u65f6\u5c1d\u8bd5\u5fae\u8c03\u6a21\u578b\u662f\u4e3a\u4e86\u4e86\u89e3\u3010\u7279\u5b9a\u9886\u57df\u6a21\u578b\u5fae\u8c03\u7684\u5b9e\u9645\u5de5\u4f5c\u6d41\u7a0b\u3011\uff0c\u5728\u8fdb\u884c\u5b9e\u9645\u7684\u5fae\u8c03\u5de5\u4f5c\u65f6\uff0c\u4e3a\u4e86\u65b9\u4fbf\u548c\u7f51\u53cb\u4ea4\u6d41\uff0c\u56e0\u6b64 jupyter notebook \u4e2d\u5747\u4f7f\u7528\u82f1\u6587\u3002\u4f46\u9063\u8bcd\u9020\u53e5\u5747\u6bd4\u8f83\u57fa\u7840\uff0c\u5982\u679c\u9605\u8bfb\u5b9e\u5728\u56f0\u96be\uff0c\u53ef\u4ee5\u4f7f\u7528\u7ffb\u8bd1\u63d2\u4ef6\u3002\u5c31\u6539\u56de\u6765\u4e86\uff0c\u5b9e\u5728\u5b9e\u5728\u538c\u6076\u91cd\u590d\u5de5\u4f5c\u3002<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h1>\u51c6\u5907\u5de5\u4f5c<\/h1>\n<p>\u9996\u5148\u58f0\u660e\u4e00\u4e9b\u91cd\u8981\u4e14\u5fc5\u987b\u8981\u505a\u7684\u51c6\u5907\u57fa\u7840\u5de5\u4f5c\u5982\u4e0b\u3002\u4e14\u9700\u8981\u6ce8\u610f\uff0c\u5728\u5b89\u88c5\u8f6f\u4ef6\u65f6\uff0c\u9700\u8981\u4e25\u683c\u6ce8\u610f\u3010\u8f6f\u4ef6\u7248\u672c\u3011\uff0c\u4e4b\u524d\u8bd5\u8fc7\u7531\u4e8e\u8f6f\u4ef6\u7248\u672c\u4e0d\u540c\u5bfc\u81f4\u7684\u8ba1\u7b97\u6570\u503c\u5dee\u5f02\uff1a<\/p>\n<ol>\n<li><strong>Nvidia Driver <\/strong>and <strong>Cuda toolkit<\/strong>: choose a proper driver for your <strong>Nvidia GPU <\/strong>and install<strong><a href=\"https:\/\/developer.nvidia.com\/cuda-12-4-0-download-archive\" target=\"_blank\"  rel=\"nofollow\" >cuda 12.4 toolkit<\/a><\/strong><\/li>\n<li><strong>Anaconda<\/strong>: we need this to create <strong>virtual environment <\/strong>with <strong>python3.10<\/strong>, and install <strong>PyTorch <\/strong>and <strong>Unsloth<\/strong><\/li>\n<li><strong>git <\/strong>and <strong>cmake<\/strong>: when we save finetuned model into <strong>gguf <\/strong>format, we need to callsave_pretrained_gguf()method and the method will clonellama.cppfrom github and compile it. you can download it from the<a href=\"https:\/\/git-scm.com\/downloads\" target=\"_blank\"  rel=\"nofollow\" >git offical site<\/a>and<a href=\"https:\/\/cmake.org\/download\/\" target=\"_blank\"  rel=\"nofollow\" >cmake offical site<\/a>and append their bin folders after windows'path<\/li>\n<li><strong>ollama <\/strong>and <strong>Page Assist<\/strong>: we use <strong>ollama <\/strong>to run finetuned model and <strong>Page Assist <\/strong>for a friendly UI. You can download ollama -&gt;<a href=\"https:\/\/ollama.com\/download\" target=\"_blank\"  rel=\"nofollow\" >here<\/a>and install Page Assist from -&gt;<a href=\"https:\/\/chromewebstore.google.com\/detail\/page-assist-%E6%9C%AC%E5%9C%B0-ai-%E6%A8%A1%E5%9E%8B%E7%9A%84-web\/jfgfiigpkhlkbnfnbobbkinehhfdhndo\" target=\"_blank\"  rel=\"nofollow\" >here<\/a><\/li>\n<li><strong>Triton wheel for python 3.10<\/strong>: if you are using a <strong>windows pc<\/strong>, you will need to download the<a href=\"https:\/\/huggingface.co\/madbuda\/triton-windows-builds\/resolve\/main\/triton-3.0.0-cp310-cp310-win_amd64.whl\" target=\"_blank\"  rel=\"nofollow\" >triton-windows-builds<\/a>and install it later viapip install triton-3.0.0-cp310-cp310-win_amd64.whl<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h1>Jupyter Note \u7b14\u8bb0\u5185\u5bb9\uff1a<\/h1>\n<p>\u7b14\u8bb0\u4e0b\u8f7d\uff1a<a class=\"download\" href=\"https:\/\/10ccc.cc\/wp-content\/uploads\/jupyter-notebooks\/Unsloth_Finetuning_DeepSeek_R1_on_your_PC%20with_Nvidia_GPU.html\" rel=\"external\"\r\ntarget=\"_blank\" title=\"\u4e0b\u8f7d\u5730\u5740\">\r\n<span><i class=\"fa-solid fa-download\"><\/i>Download<\/span><\/a><\/p>\n<p>\u6211\u5728\u7b14\u8bb0\u4e2d\u5df2\u7ecf\u5199\u5f97\u975e\u5e38\u8be6\u7ec6\uff0c\u5177\u4f53\u5185\u5bb9\u8bf7\u3010\u5c55\u5f00\u3011\u540e\u8be6\u7ec6\u9605\u8bfb\uff1a<\/p>\n<div class=\"jupyter-notebook-wrapper\">\n            <button class=\"jupyter-toggle-btn\">\u5c55\u5f00<\/button>\n            <iframe id=\"Unsloth_Finetuning_DeepSeek_R1_on_your_PC with_Nvidia_GPU\" style=\"border: 1px lightgrey solid; height: 300px;\" src=\"https:\/\/10ccc.cc\/wp-content\/uploads\/jupyter-notebooks\/Unsloth_Finetuning_DeepSeek_R1_on_your_PC%20with_Nvidia_GPU.html\" width=\"100%\" frameborder=\"0\" scrolling=\"no\"><\/iframe>\n            <button class=\"jupyter-toggle-btn1\">\u5c55\u5f00<\/button>\n         <\/div><script>\n        (function(){\n            var iframe = document.getElementById(\"Unsloth_Finetuning_DeepSeek_R1_on_your_PC with_Nvidia_GPU\");\n            var wrapper = iframe.parentElement;\n            var toggleBtn = wrapper.querySelector(\".jupyter-toggle-btn\");\n            var toggleBtn1 = wrapper.querySelector(\".jupyter-toggle-btn1\");\n            var isExpanded = false;\n            var fullHeight = 0;\n            \n            function getFullHeight() {\n                return iframe.contentWindow.document.body.scrollHeight + 4;\n            }\n            \n            function toggleHeight() {\n                if (isExpanded) {\n                    iframe.style.height = \"300px\";\n                    toggleBtn.textContent = \"\u5c55\u5f00\";\n                    toggleBtn1.textContent = \"\u5c55\u5f00\";\n                } else {\n                    fullHeight = getFullHeight();\n                    iframe.style.height = fullHeight + \"px\";\n                    toggleBtn.textContent = \"\u6536\u56de\";\n                    toggleBtn1.textContent = \"\u6536\u56de\";\n                }\n                isExpanded = !isExpanded;\n            }\n            \n            toggleBtn.addEventListener(\"click\", toggleHeight);\n\n\n            function toggleHeight1() {\n                if (isExpanded) {\n                    iframe.style.height = \"300px\";\n                    toggleBtn1.textContent = \"\u5c55\u5f00\";\n                    toggleBtn.textContent = \"\u5c55\u5f00\";\n                } else {\n                    fullHeight = getFullHeight();\n                    iframe.style.height = fullHeight + \"px\";\n                    toggleBtn1.textContent = \"\u6536\u56de\";\n                    toggleBtn.textContent = \"\u6536\u56de\";\n                }\n                isExpanded = !isExpanded;\n            }\n            \n            toggleBtn1.addEventListener(\"click\", toggleHeight1);\n\n            \/\/ \u9875\u9762\u5927\u5c0f\u6539\u53d8\u65f6\u91cd\u65b0\u8ba1\u7b97\n            window.addEventListener(\"resize\", function() {\n                if (isExpanded) {\n                    fullHeight = getFullHeight();\n                    iframe.style.height = fullHeight + \"px\";\n                }\n            });\n            \n            \/\/ iframe\u52a0\u8f7d\u5b8c\u6210\u540e\u521d\u59cb\u5316\n            iframe.addEventListener(\"load\", function() {\n                fullHeight = getFullHeight();\n            });\n        })();\n        <\/script>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91cd\u8981\u58f0\u660e \u5f53\u65f6\u5c1d\u8bd5\u5fae\u8c03\u6a21\u578b\u662f\u4e3a\u4e86\u4e86\u89e3\u3010\u7279\u5b9a\u9886\u57df\u6a21\u578b\u5fae\u8c03\u7684\u5b9e\u9645\u5de5\u4f5c\u6d41\u7a0b\u3011\uff0c\u5728\u8fdb\u884c\u5b9e\u9645\u7684\u5fae\u8c03\u5de5\u4f5c\u65f6\uff0c\u4e3a\u4e86\u65b9\u4fbf\u548c\u7f51\u53cb\u4ea4\u6d41\uff0c\u56e0\u6b64 jupy &#8230;<\/p>\n","protected":false},"author":1,"featured_media":4350,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[123,82,104],"tags":[81,180,176,175,174,173],"class_list":["post-4151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-82","category-note","tag-ai","tag-deepseek","tag-deepseek_r1","tag-finetuning","tag-unsloth","tag-173"],"_links":{"self":[{"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/posts\/4151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/10ccc.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4151"}],"version-history":[{"count":7,"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/posts\/4151\/revisions"}],"predecessor-version":[{"id":4531,"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/posts\/4151\/revisions\/4531"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/media\/4350"}],"wp:attachment":[{"href":"https:\/\/10ccc.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/10ccc.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/10ccc.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}