{"id":114,"date":"2024-07-22T15:38:48","date_gmt":"2024-07-22T07:38:48","guid":{"rendered":"https:\/\/www.onetts.com\/ai\/?p=114"},"modified":"2024-07-24T11:55:45","modified_gmt":"2024-07-24T03:55:45","slug":"llama3-8b","status":"publish","type":"post","link":"https:\/\/www.onetts.com\/ai\/models\/llama3-8b\/","title":{"rendered":"Llama3-8B"},"content":{"rendered":"<p><strong data-spm-anchor-id=\"a2c6h.13066512.0.i3.4aa336afCGLUWa\">Llama3-8B<\/strong>\u662f Meta \u516c\u53f8\u63a8\u51fa\u7684\u4e00\u6b3e\u5927\u578b\u8bed\u8a00\u6a21\u578b\uff0c\u5c5e\u4e8e Llama \u7cfb\u5217\u7684\u6700\u65b0\u4e00\u4ee3\u3002\u8fd9\u6b3e\u6a21\u578b\u4ee5\u51768B\uff08\u5373800\u4ebf\uff09\u53c2\u6570\u7684\u89c4\u6a21\u800c\u5f97\u540d\uff0c\u65e8\u5728\u901a\u8fc7\u5148\u8fdb\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u6280\u672f\uff0c\u4e3a\u7814\u7a76\u4eba\u5458\u3001\u5f00\u53d1\u8005\u548c\u4f01\u4e1a\u7528\u6237\u63d0\u4f9b\u5f3a\u5927\u7684\u8bed\u8a00\u7406\u89e3\u548c\u751f\u6210\u80fd\u529b\u3002Llama3-8B \u6a21\u578b\u4e0d\u4ec5\u5728\u7406\u89e3\u590d\u6742\u8bed\u8a00\u7ed3\u6784\u65b9\u9762\u8868\u73b0\u51fa\u8272\uff0c\u8fd8\u80fd\u751f\u6210\u8fde\u8d2f\u3001\u81ea\u7136\u7684\u8bed\u8a00\u6587\u672c\u3002<\/p>\n<h2 id=\"-\">\u6a21\u578b\u8bc4\u6d4b<\/h2>\n<p>Llama3-8B \u6a21\u578b\u5728\u591a\u4e2a\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4efb\u52a1\u4e0a\u8fdb\u884c\u4e86\u5e7f\u6cdb\u7684\u8bc4\u6d4b\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u6587\u672c\u751f\u6210\u3001\u8bed\u8a00\u7ffb\u8bd1\u3001\u95ee\u7b54\u7cfb\u7edf\u548c\u60c5\u611f\u5206\u6790\u3002\u8bc4\u6d4b\u7ed3\u679c\u663e\u793a\uff0c\u8be5\u6a21\u578b\u5728\u7406\u89e3\u590d\u6742\u8bed\u5883\u548c\u751f\u6210\u9ad8\u8d28\u91cf\u6587\u672c\u65b9\u9762\u5177\u6709\u663e\u8457\u4f18\u52bf\u3002\u5176\u6307\u4ee4\u8c03\u6574\uff08instruction-tuned\uff09\u7248\u672c\u7279\u522b\u9002\u7528\u4e8e\u5bf9\u8bdd\u5e94\u7528\uff0c\u80fd\u591f\u6839\u636e\u7528\u6237\u7684\u6307\u4ee4\u751f\u6210\u76f8\u5173\u56de\u7b54\u3002<\/p>\n<h2 id=\"-\">\u90e8\u7f72\u4f7f\u7528<\/h2>\n<h4 id=\"-\">\u8be6\u7ec6\u6b65\u9aa4<\/h4>\n<ol>\n<li><strong>\u73af\u5883\u51c6\u5907<\/strong>\uff1a\n<ul>\n<li>\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u5b89\u88c5\u4e86 Python \u548c PyTorch\uff0c\u63a8\u8350\u4f7f\u7528 CUDA \u652f\u6301\u7684 GPU \u73af\u5883\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u514b\u9686\u5b58\u50a8\u5e93<\/strong>\uff1a\n<ul>\n<li>\u4f7f\u7528 Git \u514b\u9686 Llama3 \u5b58\u50a8\u5e93\uff1a\n<pre><code class=\"lang-bash\"><span class=\"token function\">git<\/span> clone https:\/\/github.com\/meta-llama\/llama3.git\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u4e0b\u8f7d\u6a21\u578b\u6743\u91cd<\/strong>\uff1a\n<ul>\n<li>\u8bbf\u95ee Meta Llama \u7f51\u7ad9\u5e76\u6ce8\u518c\u4ee5\u4e0b\u8f7d\u6a21\u578b\u6743\u91cd\u3002\u6ce8\u518c\u540e\uff0c\u4f60\u5c06\u901a\u8fc7\u7535\u5b50\u90ae\u4ef6\u6536\u5230\u4e00\u4e2a\u7b7e\u540d URL\u3002<\/li>\n<li>\u4f7f\u7528\u63d0\u4f9b\u7684 URL \u8fd0\u884c\u4e0b\u8f7d\u811a\u672c\uff1a\n<pre><code class=\"lang-bash\">.\/download.sh\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8fd0\u884c\u6a21\u578b<\/strong>\uff1a\n<ul>\n<li>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u6a21\u578b\u8fdb\u884c\u63a8\u7406\uff1a\n<pre><code class=\"lang-bash\">torchrun --nproc_per_node 1 example_chat_completion.py \\\r\n    --ckpt_dir Meta-Llama-3-8B-Instruct\/ \\\r\n    --tokenizer_path Meta-Llama-3-8B-Instruct\/tokenizer.model \\\r\n    --max_seq_len 512 --max_batch_size 6\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8c03\u6574\u53c2\u6570<\/strong>\uff1a\n<ul>\n<li>\u6839\u636e\u4f60\u7684\u786c\u4ef6\u914d\u7f6e\u8c03\u6574\u00a0<code>max_seq_len<\/code>\u00a0\u548c\u00a0<code>max_batch_size<\/code>\u00a0\u53c2\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h4 id=\"-mp-\">\u6a21\u578b\u5e76\u884c\uff08MP\uff09\u503c<\/h4>\n<ul>\n<li><strong>8B \u6a21\u578b<\/strong>\uff1aMP \u503c\u4e3a 1<\/li>\n<li><strong>70B \u6a21\u578b<\/strong>\uff1aMP \u503c\u4e3a 8<\/li>\n<\/ul>\n<h2 id=\"-\">\u5e38\u89c1\u95ee\u9898<\/h2>\n<p><strong>Q: \u5982\u4f55\u4e0b\u8f7d Llama3-8B \u6a21\u578b\u6743\u91cd\uff1f<\/strong><\/p>\n<ul>\n<li>A: \u9996\u5148\u8bbf\u95ee Meta Llama \u7f51\u7ad9\u5e76\u6ce8\u518c\uff0c\u6ce8\u518c\u540e\u4f60\u5c06\u901a\u8fc7\u7535\u5b50\u90ae\u4ef6\u6536\u5230\u4e00\u4e2a\u7b7e\u540d URL\u3002\u4f7f\u7528\u6b64 URL \u8fd0\u884c\u4e0b\u8f7d\u811a\u672c\u3002<\/li>\n<\/ul>\n<p><strong>Q: \u5982\u4f55\u5728\u672c\u5730\u90e8\u7f72\u8fd0\u884c Llama3-8B \u6a21\u578b\uff1f<\/strong><\/p>\n<ul>\n<li>A: \u514b\u9686 Llama3 \u5b58\u50a8\u5e93\uff0c\u4e0b\u8f7d\u6a21\u578b\u6743\u91cd\uff0c\u7136\u540e\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u63d0\u4f9b\u7684\u793a\u4f8b\u811a\u672c\u3002<\/li>\n<\/ul>\n<p><strong>Q: \u6a21\u578b\u652f\u6301\u7684\u6700\u5927\u5e8f\u5217\u957f\u5ea6\u662f\u591a\u5c11\uff1f<\/strong><\/p>\n<ul>\n<li>A: \u6240\u6709\u6a21\u578b\u652f\u6301\u7684\u6700\u5927\u5e8f\u5217\u957f\u5ea6\u4e3a 8192 \u4e2a token\u3002<\/li>\n<\/ul>\n<p><strong>Q: \u5982\u4f55\u5904\u7406\u6a21\u578b\u751f\u6210\u7684\u4e0d\u5b89\u5168\u5185\u5bb9\uff1f<\/strong><\/p>\n<ul>\n<li>A: \u53ef\u4ee5\u90e8\u7f72\u989d\u5916\u7684\u5206\u7c7b\u5668\u6765\u8fc7\u6ee4\u8f93\u5165\u548c\u8f93\u51fa\uff0c\u786e\u4fdd\u5185\u5bb9\u7684\u5b89\u5168\u6027\u3002\u53c2\u8003 Llama \u98df\u8c31\u5b58\u50a8\u5e93\u4e2d\u7684\u793a\u4f8b\u3002<\/li>\n<\/ul>\n<h2 id=\"-\">\u76f8\u5173\u8d44\u6e90<\/h2>\n<ul>\n<li><strong>GitHub \u5b58\u50a8\u5e93<\/strong>\uff1a<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/github.com\/meta-llama\/llama3\">Meta Llama 3<\/a><\/li>\n<li><strong>\u6a21\u578b\u4e0b\u8f7d\u9875\u9762<\/strong>\uff1a\u8bbf\u95ee <a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/llama.meta.com\/\">Meta Llama<\/a> \u7f51\u7ad9\u5e76\u6ce8\u518c\u4ee5\u83b7\u53d6\u4e0b\u8f7d\u94fe\u63a5\u3002<\/li>\n<li><strong>Hugging Face \u8bbf\u95ee<\/strong>\uff1a\u63d0\u4f9b\u5728 <a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/huggingface.co\/meta-Llama\">Hugging Face<\/a> \u4e0a\u7684\u6a21\u578b\u4e0b\u8f7d\uff0c\u5305\u62ec transformers \u548c\u539f\u751f\u00a0<code>llama3<\/code>\u00a0\u683c\u5f0f\u3002<\/li>\n<li><strong>\u8d23\u4efb\u4f7f\u7528\u6307\u5357<\/strong>\uff1a\u5e2e\u52a9\u5f00\u53d1\u8005<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/ai.meta.com\/static-resource\/responsible-use-guide\/\">\u8d1f\u8d23\u4efb\u5730\u4f7f\u7528<\/a>\u6a21\u578b\uff0c\u907f\u514d\u6f5c\u5728\u98ce\u9669\u3002<\/li>\n<li><strong>\u95ee\u9898\u62a5\u544a<\/strong>\uff1a\u901a\u8fc7 GitHub \u95ee\u9898\u8ddf\u8e2a\u5668\u6216\u4e13\u95e8\u7684<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/llama.meta.com\/faq\">\u53cd\u9988\u6e20\u9053<\/a>\u62a5\u544a\u6a21\u578b\u95ee\u9898\u3001\u751f\u6210\u7684\u98ce\u9669\u5185\u5bb9\u6216\u5b89\u5168\u95ee\u9898\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u8d44\u6e90\uff0c\u7528\u6237\u53ef\u4ee5\u6df1\u5165\u4e86\u89e3 Llama3-8B \u6a21\u578b\u7684\u529f\u80fd\u3001\u4e0b\u8f7d\u548c\u90e8\u7f72\u65b9\u6cd5\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u89e3\u51b3\u5e38\u89c1\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Llama3-8B\u662f Meta \u516c\u53f8\u63a8\u51fa\u7684\u4e00\u6b3e\u5927\u578b\u8bed\u8a00\u6a21\u578b\uff0c\u5c5e\u4e8e Llama \u7cfb\u5217\u7684\u6700\u65b0\u4e00\u4ee3\u3002\u8fd9\u6b3e\u6a21\u578b\u4ee5\u51768B\uff08\u5373800\u4ebf\uff09\u53c2\u6570\u7684\u89c4\u6a21\u800c\u5f97\u540d\uff0c\u65e8\u5728\u901a\u8fc7\u5148\u8fdb\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u6280\u672f\uff0c\u4e3a\u7814\u7a76\u4eba\u5458\u3001\u5f00\u53d1\u8005\u548c\u4f01\u4e1a\u7528\u6237\u63d0\u4f9b\u5f3a\u5927\u7684\u8bed\u8a00\u7406\u89e3\u548c\u751f\u6210\u80fd\u529b\u3002Llama3-8B \u6a21\u578b\u4e0d\u4ec5\u5728\u7406\u89e3\u590d\u6742\u8bed\u8a00\u7ed3\u6784\u65b9\u9762\u8868\u73b0\u51fa\u8272\uff0c\u8fd8\u80fd\u751f\u6210\u8fde\u8d2f\u3001\u81ea\u7136\u7684\u8bed\u8a00\u6587\u672c\u3002 \u6a21\u578b\u8bc4\u6d4b Llama3-8B \u6a21\u578b\u5728\u591a\u4e2a\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4efb\u52a1\u4e0a\u8fdb\u884c\u4e86\u5e7f\u6cdb\u7684\u8bc4\u6d4b\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u6587\u672c\u751f\u6210\u3001\u8bed\u8a00\u7ffb\u8bd1\u3001\u95ee\u7b54\u7cfb\u7edf\u548c\u60c5\u611f\u5206\u6790\u3002\u8bc4\u6d4b\u7ed3\u679c\u663e\u793a\uff0c\u8be5\u6a21\u578b\u5728\u7406\u89e3\u590d\u6742\u8bed\u5883\u548c\u751f\u6210\u9ad8\u8d28\u91cf\u6587\u672c\u65b9\u9762\u5177\u6709\u663e\u8457\u4f18\u52bf\u3002<\/p>\n","protected":false},"author":1,"featured_media":115,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"collection":[50],"company":[38],"rank":[],"class_list":["post-114","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-llm","collection-llama3","company-meta"],"_links":{"self":[{"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":1,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":116,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/posts\/114\/revisions\/116"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/media\/115"}],"wp:attachment":[{"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/tags?post=114"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/collection?post=114"},{"taxonomy":"company","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/company?post=114"},{"taxonomy":"rank","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/rank?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}