{"id":19419,"date":"2025-01-26T21:59:36","date_gmt":"2025-01-26T13:59:36","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=19419"},"modified":"2025-01-26T21:59:36","modified_gmt":"2025-01-26T13:59:36","slug":"open-r1","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/en\/open-r1\/","title":{"rendered":"Open R1\uff1aHugging Face \u590d\u73b0 DeepSeek-R1 \u7684\u8bad\u7ec3\u8fc7\u7a0b"},"content":{"rendered":"<p>Hugging Face\u7684Open R1\u9879\u76ee\u662f\u4e00\u4e2a\u5b8c\u5168\u5f00\u6e90\u7684DeepSeek-R1\u590d\u73b0\u9879\u76ee\uff0c\u65e8\u5728\u6784\u5efaR1\u7ba1\u9053\u7684\u7f3a\u5931\u90e8\u5206\uff0c\u4f7f\u6bcf\u4e2a\u4eba\u90fd\u80fd\u590d\u73b0\u5e76\u5728\u5176\u57fa\u7840\u4e0a\u8fdb\u884c\u6784\u5efa\u3002\u8be5\u9879\u76ee\u8bbe\u8ba1\u7b80\u5355\uff0c\u4e3b\u8981\u5305\u62ec\u8bad\u7ec3\u548c\u8bc4\u4f30\u6a21\u578b\u4ee5\u53ca\u751f\u6210\u5408\u6210\u6570\u636e\u7684\u811a\u672c\u3002Open R1\u9879\u76ee\u7684\u76ee\u6807\u662f\u901a\u8fc7\u591a\u9636\u6bb5\u8bad\u7ec3\uff0c\u4ece\u57fa\u7840\u6a21\u578b\u5230\u5f3a\u5316\u5b66\u4e60\u8c03\u4f18\u6a21\u578b\uff0c\u5c55\u793a\u5b8c\u6574\u7684R1\u7ba1\u9053\u590d\u73b0\u8fc7\u7a0b\u3002\u9879\u76ee\u5305\u542b\u8be6\u7ec6\u7684\u5b89\u88c5\u548c\u4f7f\u7528\u6307\u5357\uff0c\u652f\u6301\u793e\u533a\u8d21\u732e\u548c\u534f\u4f5c\u3002<\/p>\n<p>\u6211\u4eec\u5c06\u4ee5 <a href=\"https:\/\/www.kdjingpai.com\/en\/deepseek-r1nenglixiang\/\">DeepSeek-R1<\/a> \u6280\u672f\u62a5\u544a\u4e3a\u6307\u5bfc\uff0c\u8be5\u62a5\u544a\u5927\u81f4\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e09\u4e2a\u4e3b\u8981\u6b65\u9aa4\uff1a<\/p>\n<p>\u7b2c\u4e00\u6b65\uff1a\u901a\u8fc7\u4ece DeepSeek-R1 \u4e2d\u63d0\u70bc\u9ad8\u8d28\u91cf\u8bed\u6599\u5e93\u6765\u590d\u73b0 R1-Distill \u6a21\u578b\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff1a\u590d\u73b0 <a href=\"https:\/\/www.kdjingpai.com\/en\/deepseek-chatshena\/\">DeepSeek<\/a> \u7528\u4e8e\u521b\u5efa R1-Zero \u7684\u7eaf\u5f3a\u5316\u5b66\u4e60\uff08RL\uff09\u6d41\u7a0b\u3002\u8fd9\u53ef\u80fd\u9700\u8981\u4e3a\u6570\u5b66\u3001\u63a8\u7406\u548c\u4ee3\u7801\u6574\u7406\u65b0\u7684\u5927\u89c4\u6a21\u6570\u636e\u96c6\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65\uff1a\u5c55\u793a\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u591a\u9636\u6bb5\u8bad\u7ec3\u4ece\u57fa\u7840\u6a21\u578b\u8fc7\u6e21\u5230 RL \u8c03\u4f18\u6a21\u578b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-19420\" title=\"Open R1\uff1aHugging Face \u590d\u73b0 DeepSeek-R1 \u7684\u8bad\u7ec3\u8fc7\u7a0b-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/1a71fd4e6350121.jpg\" alt=\"Open R1\uff1aHugging Face \u590d\u73b0 DeepSeek-R1 \u7684\u8bad\u7ec3\u8fc7\u7a0b-1\" width=\"678\" height=\"778\" data-wp-editing=\"1\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/1a71fd4e6350121.jpg 1761w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/1a71fd4e6350121-262x300.jpg 262w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/1a71fd4e6350121-893x1024.jpg 893w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/1a71fd4e6350121-768x881.jpg 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/1a71fd4e6350121-1340x1536.jpg 1340w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/1a71fd4e6350121-10x12.jpg 10w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li><strong>\u6a21\u578b\u8bad\u7ec3<\/strong>\uff1a\u63d0\u4f9b\u8bad\u7ec3\u6a21\u578b\u7684\u811a\u672c\uff0c\u5305\u62ecGRPO\u548cSFT\u8bad\u7ec3\u65b9\u6cd5\u3002<\/li>\n<li><strong>\u6a21\u578b\u8bc4\u4f30<\/strong>\uff1a\u63d0\u4f9b\u8bc4\u4f30\u6a21\u578b\u6027\u80fd\u7684\u811a\u672c\uff0c\u652f\u6301R1\u57fa\u51c6\u6d4b\u8bd5\u3002<\/li>\n<li><strong>\u6570\u636e\u751f\u6210<\/strong>\uff1a\u4f7f\u7528Distilabel\u751f\u6210\u5408\u6210\u6570\u636e\u7684\u811a\u672c\u3002<\/li>\n<li><strong>\u591a\u9636\u6bb5\u8bad\u7ec3<\/strong>\uff1a\u5c55\u793a\u4ece\u57fa\u7840\u6a21\u578b\u5230\u5f3a\u5316\u5b66\u4e60\u8c03\u4f18\u7684\u591a\u9636\u6bb5\u8bad\u7ec3\u8fc7\u7a0b\u3002<\/li>\n<li><strong>\u793e\u533a\u8d21\u732e<\/strong>\uff1a\u652f\u6301\u793e\u533a\u6210\u5458\u8d21\u732e\u6570\u636e\u96c6\u548c\u6a21\u578b\u6539\u8fdb\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u6d41\u7a0b<\/h3>\n<ol>\n<li><strong>\u521b\u5efaPython\u865a\u62df\u73af\u5883<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   conda create -n openr1 python=3.11\r\nconda activate openr1\r\n<\/code><\/pre>\n<ol start=\"2\">\n<li><strong>\u5b89\u88c5vLLM<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   pip install vllm==0.6.6.post1\r\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u540c\u65f6\u5b89\u88c5PyTorch v2.5.1\uff0c\u786e\u4fdd\u4f7f\u7528\u6b64\u7248\u672c\u4ee5\u517c\u5bb9vLLM\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n<ol start=\"3\">\n<li><strong>\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   pip install -e \".[dev]\"\r\n<\/code><\/pre>\n<ol start=\"4\">\n<li><strong>\u767b\u5f55Hugging Face\u548cWeights and Biases\u8d26\u6237<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   huggingface-cli login\r\nwandb login\r\n<\/code><\/pre>\n<ol start=\"5\">\n<li><strong>\u5b89\u88c5Git LFS<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   sudo apt-get install git-lfs\r\n<\/code><\/pre>\n<h3>\u4f7f\u7528\u6307\u5357<\/h3>\n<ol>\n<li><strong>\u8bad\u7ec3\u6a21\u578b<\/strong>\uff1a\n<ul>\n<li>\u4f7f\u7528GRPO\u8bad\u7ec3\u6a21\u578b\uff1a<\/li>\n<\/ul>\n<pre><code> python src\/open_r1\/grpo.py --dataset &lt;dataset_path&gt;\r\n<\/code><\/pre>\n<ul>\n<li>\u4f7f\u7528SFT\u8bad\u7ec3\u6a21\u578b\uff1a<\/li>\n<\/ul>\n<pre><code> python src\/open_r1\/sft.py --dataset &lt;dataset_path&gt;\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u8bc4\u4f30\u6a21\u578b<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   python src\/open_r1\/evaluate.py --model &lt;model_path&gt; --benchmark &lt;benchmark_name&gt;\r\n<\/code><\/pre>\n<ol start=\"3\">\n<li><strong>\u751f\u6210\u5408\u6210\u6570\u636e<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   python src\/open_r1\/generate.py --model &lt;model_path&gt; --output &lt;output_path&gt;\r\n<\/code><\/pre>\n<ol start=\"4\">\n<li><strong>\u591a\u9636\u6bb5\u8bad\u7ec3<\/strong>\uff1a\n<ul>\n<li>\u7b2c\u4e00\u6b65\uff1a\u590d\u73b0R1-Distill\u6a21\u578b\uff1a <code>bash<br \/>\npython src\/open_r1\/distill.py --corpus &lt;corpus_path&gt;<br \/>\n<\/code><\/li>\n<li>\u7b2c\u4e8c\u6b65\uff1a\u590d\u73b0\u7eafRL\u7ba1\u9053\uff1a <code>bash<br \/>\npython src\/open_r1\/rl_pipeline.py --dataset &lt;dataset_path&gt;<br \/>\n<\/code><\/li>\n<li>\u7b2c\u4e09\u6b65\uff1a\u4ece\u57fa\u7840\u6a21\u578b\u5230RL\u8c03\u4f18\uff1a <code>bash<br \/>\npython src\/open_r1\/multi_stage_training.py --model &lt;model_path&gt;<br \/>\n<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u8d21\u732e\u6307\u5357<\/h3>\n<ol>\n<li><strong>Fork\u9879\u76ee<\/strong>\uff1a\u5728GitHub\u4e0afork\u8be5\u9879\u76ee\u5230\u81ea\u5df1\u7684\u8d26\u6237\u3002<\/li>\n<li><strong>\u514b\u9686\u9879\u76ee<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   git clone https:\/\/github.com\/&lt;your_username&gt;\/open-r1.git\r\n<\/code><\/pre>\n<ol start=\"3\">\n<li><strong>\u521b\u5efa\u65b0\u5206\u652f<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   git checkout -b new-feature\r\n<\/code><\/pre>\n<ol start=\"4\">\n<li><strong>\u63d0\u4ea4\u66f4\u6539<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   git add .\r\ngit commit -m \"Add new feature\"\r\ngit push origin new-feature\r\n<\/code><\/pre>\n<ol start=\"5\">\n<li><strong>\u521b\u5efaPull Request<\/strong>\uff1a\u5728GitHub\u4e0a\u63d0\u4ea4Pull Request\uff0c\u63cf\u8ff0\u6240\u505a\u7684\u66f4\u6539\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Hugging Face\u7684Open R1\u9879\u76ee\u662f\u4e00\u4e2a\u5b8c\u5168\u5f00\u6e90\u7684DeepSeek-R1\u590d\u73b0\u9879\u76ee\uff0c\u65e8\u5728\u6784\u5efaR1\u7ba1\u9053\u7684\u7f3a\u5931\u90e8\u5206\uff0c\u4f7f\u6bcf\u4e2a\u4eba\u90fd\u80fd\u590d\u73b0\u5e76\u5728\u5176\u57fa\u7840\u4e0a\u8fdb\u884c\u6784\u5efa\u3002\u8be5\u9879\u76ee\u8bbe\u8ba1\u7b80\u5355\uff0c\u4e3b\u8981\u5305\u62ec\u8bad\u7ec3\u548c\u8bc4\u4f30\u6a21\u578b\u4ee5\u53ca\u751f\u6210\u5408\u6210\u6570\u636e\u7684\u811a\u672c\u3002Open R1\u9879\u76ee\u7684&#8230;<\/p>\n","protected":false},"author":1,"featured_media":61729,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[230],"class_list":["post-19419","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-aikaiyuanxiangmu"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts\/19419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/comments?post=19419"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts\/19419\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/media\/61729"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/media?parent=19419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/categories?post=19419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/tags?post=19419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}