{"id":360,"date":"2024-10-08T17:21:37","date_gmt":"2024-10-08T09:21:37","guid":{"rendered":"https:\/\/ai.oaido.com\/?p=360"},"modified":"2024-10-08T17:21:38","modified_gmt":"2024-10-08T09:21:38","slug":"llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/","title":{"rendered":"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>1. <\/strong>\u5b89\u88c5\u4e0e\u51c6\u5907<\/h2>\n\n\n\n<p>\u73af\u5883\u914d\u7f6e\uff1a<\/p>\n\n\n\n<p>\u786e\u4fdd\u4f60\u7684\u5f00\u53d1\u73af\u5883\u4e2d\u5b89\u88c5\u4e86Python 3.9\u6216\u66f4\u9ad8\u7248\u672c\u3002\u5efa\u8bae\u4f7f\u7528\u81f3\u5c11\u5177\u670924GB\u663e\u5b58\u7684GPU\u5b9e\u4f8b\uff0c\u5982NVIDIA A100\uff0c\u4ee5\u6ee1\u8db3\u8ba1\u7b97\u9700\u6c42\u3002<br>\u5b89\u88c5PyTorch\u7b49\u5fc5\u8981\u7684\u4f9d\u8d56\u5e93\u3002PyTorch\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\u7248\u672c\u63a8\u8350\u4e3a2.1.2\u6216\u66f4\u9ad8\u7248\u672c\u3002<br>\u5b89\u88c5CUDA\u548ccuDNN\uff0c\u786e\u4fdd\u4e0e\u4f60\u7684GPU\u786c\u4ef6\u517c\u5bb9\u3002<\/p>\n\n\n\n<p>\u5b89\u88c5LLaMa-Factory\uff1a<\/p>\n\n\n\n<p>\u901a\u8fc7Git\u514b\u9686LLaMa-Factory\u7684\u6e90\u4ee3\u7801\u5230\u672c\u5730\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<br>git clone https:\/\/github.com\/hiyouga\/LLaMA-Factory.git<br>\u8fdb\u5165\u9879\u76ee\u76ee\u5f55\uff0c\u5b89\u88c5\u5fc5\u8981\u7684Python\u4f9d\u8d56\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<br>cd LLaMA-Factory<br>pip install -e &#8220;.[torch,metrics]&#8221;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br><strong>2. \u542f\u52a8\u670d\u52a1\uff1a<\/strong><\/h2>\n\n\n\n<p>\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u8fd0\u884cpython src\/webui.py\u4ee5\u542f\u52a8\u670d\u52a1\uff0c\u7136\u540e\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u76f8\u5e94\u7684\u7aef\u53e3\uff08\u9ed8\u8ba4\u53ef\u80fd\u662f7860\uff09\u4ee5\u8bbf\u95ee\u8bad\u7ec3\u754c\u9762\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><br>llamafactory-cli train -h<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><br>3. \u6a21\u578b\u4e0b\u8f7d\u4e0e\u53ef\u7528\u6027\u6821\u9a8c<\/h2>\n\n\n\n<p>\u9879\u76ee\u652f\u6301\u901a\u8fc7\u6a21\u578b\u540d\u79f0\u76f4\u63a5\u4ecehuggingface \u548cmodelscope\u4e0b\u8f7d\u6a21\u578b\uff0c\u4f46\u8fd9\u6837\u4e0d\u5bb9\u6613\u5bf9\u6a21\u578b\u6587\u4ef6\u8fdb\u884c\u7edf\u4e00\u7ba1\u7406\uff0c\u6240\u4ee5\u8fd9\u91cc\u7b14\u8005\u5efa\u8bae\u4f7f\u7528\u624b\u52a8\u4e0b\u8f7d\uff0c\u7136\u540e\u540e\u7eed\u4f7f\u7528\u65f6\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\u6765\u63a7\u5236\u4f7f\u7528\u54ea\u4e2a\u6a21\u578b\u3002<br>\u4ee5Meta-Llama-3-8B-Instruct\u4e3a\u4f8b\uff0c\u901a\u8fc7huggingface \u4e0b\u8f7d\uff08\u53ef\u80fd\u9700\u8981\u5148\u63d0\u4ea4\u7533\u8bf7\u901a\u8fc7\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/huggingface.co\/meta-llama\/Meta-Llama-3-8B-Instruct<\/code><\/pre>\n\n\n\n<p>modelscope \u4e0b\u8f7d\uff08\u9002\u5408\u4e2d\u56fd\u5927\u9646\u7f51\u7edc\u73af\u5883\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/www.modelscope.cn\/LLM-Research\/Meta-Llama-3-8B-Instruct.git<\/code><\/pre>\n\n\n\n<p>\u6216\u8005<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#\u6a21\u578b\u4e0b\u8f7d<\/em>\nfrom modelscope import snapshot_download\nmodel_dir = snapshot_download('LLM-Research\/Meta-Llama-3-8B-Instruct')<\/code><\/pre>\n\n\n\n<p>\u6309\u7f51\u53cb\u53cd\u9988\uff0c\u7531\u4e8e\u7f51\u7edc\u73af\u5883\u7b49\u539f\u56e0\uff0c\u6587\u4ef6\u4e0b\u8f7d\u540e\u5f80\u5f80\u4f1a\u5b58\u5728\u6587\u4ef6\u4e0d\u5b8c\u6574\u7684\u5f88\u591a\u60c5\u51b5\uff0c\u4e0b\u8f7d\u540e\u9700\u8981\u5148\u505a\u4e00\u4e0b\u6821\u9a8c\uff0c\u6821\u9a8c\u5206\u4e3a\u4e24\u90e8\u5206\uff0c\u7b2c\u4e00\u5148\u68c0\u67e5\u4e00\u4e0b\u6587\u4ef6\u5927\u5c0f\u548c\u6587\u4ef6\u6570\u91cf\u662f\u5426\u6b63\u786e\uff0c\u548c\u539f\u59cb\u7684huggingface\u663e\u793a\u7684\u505a\u4e00\u4e0b\u8089\u773c\u5bf9\u6bd4\u3002\u7b2c\u4e8c\u6b65\u662f\u8dd1\u4e00\u4e0b\u5b98\u65b9raedme\u91cc\u63d0\u4f9b\u7684\u539f\u59cb\u63a8\u7406demo\uff0c\u9a8c\u8bc1\u6a21\u578b\u6587\u4ef6\u7684\u6b63\u786e\u6027\u548ctransformers\u5e93\u7b49\u8f6f\u4ef6\u7684\u53ef\u7528<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import transformers\nimport torch\n\n<em># \u5207\u6362\u4e3a\u4f60\u4e0b\u8f7d\u7684\u6a21\u578b\u6587\u4ef6\u76ee\u5f55, \u8fd9\u91cc\u7684demo\u662fLlama-3-8B-Instruct<\/em>\n<em># \u5982\u679c\u662f\u5176\u4ed6\u6a21\u578b\uff0c\u6bd4\u5982qwen\uff0cchatglm\uff0c\u8bf7\u4f7f\u7528\u5176\u5bf9\u5e94\u7684\u5b98\u65b9demo<\/em>\nmodel_id = \"\/media\/codingma\/LLM\/llama3\/Meta-Llama-3-8B-Instruct\"\n\npipeline = transformers.pipeline(\n    \"text-generation\",\n    model=model_id,\n    model_kwargs={\"torch_dtype\": torch.bfloat16},\n    device_map=\"auto\",\n)\n\nmessages = &#91;\n    {\"role\": \"system\", \"content\": \"You are a pirate chatbot who always responds in pirate speak!\"},\n    {\"role\": \"user\", \"content\": \"Who are you?\"},\n]\n\nprompt = pipeline.tokenizer.apply_chat_template(\n        messages,\n        tokenize=False,\n        add_generation_prompt=True\n)\n\nterminators = &#91;\n    pipeline.tokenizer.eos_token_id,\n    pipeline.tokenizer.convert_tokens_to_ids(\"&lt;|eot_id|&gt;\")\n]\n\noutputs = pipeline(\n    prompt,\n    max_new_tokens=256,\n    eos_token_id=terminators,\n    do_sample=True,\n    temperature=0.6,\n    top_p=0.9,\n)\nprint(outputs&#91;0]&#91;\"generated_text\"]&#91;len(prompt):])<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4.\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\u6784\u5efa<\/h2>\n\n\n\n<p>\u6570\u636e\u96c6\u7684\u683c\u5f0f\u8981\u6c42\u5728\u4e0d\u540c\u7684\u9636\u6bb5\u662f\u4e0d\u540c\u7684\uff0c\u672c\u6559\u7a0b\u4ee5sft\u9636\u6bb5\u7684\u6570\u636e\u96c6\u9700\u6c42\uff0c\u5c06\u4ee5\u7cfb\u7edf\u81ea\u5e26\u7684identity\u6570\u636e\u96c6\u548c\u5c06\u81ea\u5b9a\u4e49\u7684\u4e00\u4e2a\u5546\u54c1\u6587\u6848\u751f\u6210\u6570\u636e\u96c6\u4e3a\u4f8b\uff0c\u4ecb\u7ecd\u6570\u636e\u96c6\u7684\u4f7f\u7528\u3002\u66f4\u591a\u8be6\u60c5\u53ef\u4ee5\u5728&nbsp;<a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/github.com\/hiyouga\/LLaMA-Factory\/blob\/main\/data\/README_zh.md\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/hiyouga\/LLaMA-Factory\/blob\/main\/data\/README_zh.md<\/a>&nbsp;\u4e2d\u627e\u5230\u76f8\u5173\u89e3\u91ca\u3002<\/p>\n\n\n\n<p>\u7cfb\u7edf\u76ee\u524d\u652f\u6301&nbsp;<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=242638741&amp;content_type=Article&amp;match_order=1&amp;q=alpaca&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">alpaca<\/a>&nbsp;\u548csharegpt\u4e24\u79cd\u6570\u636e\u683c\u5f0f\uff0c\u4ee5alpaca\u4e3a\u4f8b\uff0c\u6574\u4e2a\u6570\u636e\u96c6\u662f\u4e00\u4e2ajson\u5bf9\u8c61\u7684list\uff0c\u5177\u4f53\u6570\u636e\u683c\u5f0f\u4e3a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;\n  {\n    \"instruction\": \"\u7528\u6237\u6307\u4ee4\uff08\u5fc5\u586b\uff09\",\n    \"input\": \"\u7528\u6237\u8f93\u5165\uff08\u9009\u586b\uff09\",\n    \"output\": \"\u6a21\u578b\u56de\u7b54\uff08\u5fc5\u586b\uff09\",\n    \"system\": \"\u7cfb\u7edf\u63d0\u793a\u8bcd\uff08\u9009\u586b\uff09\",\n    \"history\": &#91;\n      &#91;\"\u7b2c\u4e00\u8f6e\u6307\u4ee4\uff08\u9009\u586b\uff09\", \"\u7b2c\u4e00\u8f6e\u56de\u7b54\uff08\u9009\u586b\uff09\"],\n      &#91;\"\u7b2c\u4e8c\u8f6e\u6307\u4ee4\uff08\u9009\u586b\uff09\", \"\u7b2c\u4e8c\u8f6e\u56de\u7b54\uff08\u9009\u586b\uff09\"]\n    ]\n  }\n]<\/code><\/pre>\n\n\n\n<p>\u4f8b\u5b50\u6bd4\u5982\u5355\u8f6e\uff08alpaca_data_zh_51k.json \u4e2d\u7684\u4f8b\u5b50, \u6570\u636e\u96c6\u5728data\/dataset_info.json\u4e2d\u6ce8\u518c\u4e3aalpaca_zh\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"instruction\": \"\u5199\u4e00\u4e2a\u6709\u6548\u7684\u6bd4\u8f83\u8bed\u53e5\",\n  \"input\": \"\u7bee\u7403\u548c\u8db3\u7403\",\n  \"output\": \"\u7bee\u7403\u548c\u8db3\u7403\u90fd\u662f\u53d7\u6b22\u8fce\u7684\u8fd0\u52a8\u3002\"\n}<\/code><\/pre>\n\n\n\n<p>\u548c\u591a\u8f6e \uff08oaast_sft_zh.json \u4e2d\u7684\u4f8b\u5b50, \u6570\u636e\u96c6\u5728data\/dataset_info.json\u4e2d\u6ce8\u518c\u4e3aoaast_sft_zh\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"instruction\": \"\u8c22\u8c22\",\n  \"input\": \"\",\n  \"output\": \"\u4e0d\u7528\u8c22! \u5f88\u9ad8\u5174\u6211\u63d0\u4f9b\u7684\u4fe1\u606f\u80fd\u591f\u5e2e\u52a9\u5230\u4f60! \u5982\u679c\u8fd8\u6709\u4ec0\u4e48\u5176\u4ed6\u95ee\u9898\u4e5f\u53ef\u4ee5\u5411\u6211\u63d0\u95ee\u3002\",\n  \"history\": &#91;\n    &#91;\n      \"\u8bf7\u4f60\u7ed9\u6211\u5199\u4e00\u4e2a\u9762\u8bd5\u51c6\u5907\u8ba1\u5212\uff0c\u6211\u60f3\u8981\u53bb\u9762\u8bd5\u5fae\u8f6f\u7684\u7a0b\u5e8f\u5458\u5c97\u4f4d\",\n      \"\u9996\u5148\uff0c\u4f60\u53ef\u4ee5\u53bb\u5fae\u8f6f\u5b98\u7f51\u5bfb\u627e\u62db\u8058\u4fe1\u606f\u5e76\u7533\u8bf7\u9762\u8bd5\u3002\\n\u5176\u6b21\uff0c\u60a8\u53ef\u4ee5\u5728\u793e\u4ea4\u5a92\u4f53\u5e73\u53f0\u5bfb\u627e\u5fae\u8f6f\u516c\u53f8\u5bf9\u7a0b\u5e8f\u5458\u7684\u9762\u8bd5\u95ee\u9898\uff0c\u5e76\u505a\u597d\u51c6\u5907\u3002\\n\u6700\u540e\uff0c\u60a8\u53ef\u4ee5\u81ea\u5df1\u5bf9\u9762\u8bd5\u8fc7\u7a0b\u8fdb\u884c\u6a21\u62df\uff0c\u719f\u6089\u8bdd\u9898\u5e76\u51cf\u5c11\u7d27\u5f20\u611f\u3002\\n\u6211\u5e0c\u671b\u4f60\u80fd\u9762\u8bd5\u6210\u529f\u3002\"\n    ]\n  ]\n}<\/code><\/pre>\n\n\n\n<p>\u6240\u4ee5\u6211\u4eec\u8bad\u7ec3\u7684\u6570\u636e\u6700\u597d\u4e5f\u8f6c\u6362\u6210\u8fd9\u79cd\u683c\u5f0f\uff0c\u7136\u540e\u5728 data\/dataset_info.json\u4e2d\u8fdb\u884c\u6ce8\u518c\uff08\u5982\u679c\u4e0d\u505a\u5b57\u6bb5\u540d\u79f0\u8f6c\u6362\uff0c\u5219\u9700\u8981\u5728\u6ce8\u518c\u7684\u65f6\u5019\u5728 columns\u5b57\u6bb5\u4e2d\u505a\u4e24\u4e2a\u6570\u636e\u7684\u6620\u5c04\u914d\u7f6e\uff09<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f7f\u7528\u4e24\u4e2a\u5177\u4f53\u7684\u4f8b\u5b50\u6765\u8bf4\u660e\u6570\u636e\u96c6\u7684\u4f7f\u7528<\/p>\n\n\n\n<p>\u7b2c\u4e00\u4e2a\u662f\u7cfb\u7edf\u81ea\u5e26\u7684identity.json\u6570\u636e\u96c6(\u5df2\u9ed8\u8ba4\u5728data\/dataset_info.json \u6ce8\u518c\u4e3aidentity)\uff0c\u5bf9\u5e94\u6587\u4ef6\u5df2\u7ecf\u5728data\u76ee\u5f55\u4e0b\uff0c\u6211\u4eec\u901a\u8fc7\u64cd\u4f5c\u7cfb\u7edf\u7684\u6587\u672c\u7f16\u8f91\u5668\u7684\u66ff\u6362\u529f\u80fd\uff0c\u53ef\u4ee5\u66ff\u6362\u5176\u4e2d\u7684NAME \u548c AUTHOR \uff0c\u6362\u6210\u6211\u4eec\u9700\u8981\u7684\u5185\u5bb9\u3002\u5982\u679c\u662flinux\u7cfb\u7edf\uff0c\u53ef\u4ee5\u4f7f\u7528<strong>sed&nbsp;<\/strong>\u5b8c\u6210\u5feb\u901f\u66ff\u6362\u3002\u6bd4\u5982\u52a9\u624b\u7684\u540d\u79f0\u4fee\u6539\u4e3aPonyBot\uff0c \u7531 LLaMA Factory \u5f00\u53d1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sed -i 's\/{{name}}\/PonyBot\/g'  data\/identity.json \nsed -i 's\/{{author}}\/LLaMA Factory\/g'  data\/identity.json <\/code><\/pre>\n\n\n\n<p>\u66ff\u6362\u524d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"instruction\": \"Who are you?\",\n  \"input\": \"\",\n  \"output\": \"Hello! I am {{name}}, an AI assistant <a href=\"https:\/\/zhida.zhihu.com\/search?content_id=242638741&amp;content_type=Article&amp;match_order=1&amp;q=developed&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">developed<\/a> by {{author}}. How can I assist you today?\"\n}<\/code><\/pre>\n\n\n\n<p>\u66ff\u6362\u540e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"instruction\": \"Who are you?\",\n  \"input\": \"\",\n  \"output\": \"I am PonyBot, an AI assistant developed by LLaMA Factory. How can I assist you today?\"\n}<\/code><\/pre>\n\n\n\n<p>\u7b2c\u4e8c\u4e2a\u662f\u4e00\u4e2a\u5546\u54c1\u6587\u6848\u751f\u6210\u6570\u636e\u96c6\uff0c\u539f\u59cb\u94fe\u63a5\u4e3a&nbsp;<a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/cloud.tsinghua.edu.cn\/f\/b3f119a008264b1cabd1\/%3Fdl%3D1\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/cloud.tsinghua.edu.cn\/f\/b3f119a008264b1cabd1\/?dl=1<\/a><\/p>\n\n\n\n<p>\u539f\u59cb\u683c\u5f0f\u5982\u4e0b\uff0c\u5f88\u660e\u663e\uff0c\u8bad\u7ec3\u76ee\u6807\u662f\u8f93\u5165content \uff08\u4e5f\u5c31\u662fprompt\uff09, \u8f93\u51fa summary \uff08\u5bf9\u5e94response\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"content\": \"\u7c7b\u578b#\u88e4*\u7248\u578b#\u5bbd\u677e*\u98ce\u683c#\u6027\u611f*\u56fe\u6848#\u7ebf\u6761*\u88e4\u578b#\u9614\u817f\u88e4\", \n    \"summary\": \"\u5bbd\u677e\u7684\u9614\u817f\u88e4\u8fd9\u4e24\u5e74\u771f\u7684\u5438\u7c89\u4e0d\u5c11\uff0c\u660e\u661f\u65f6\u5c1a\u8fbe\u4eba\u7684\u5fc3\u5934\u7231\u3002\u6bd5\u7adf\u597d\u7a7f\u65f6\u5c1a\uff0c\u8c01\u90fd\u80fd\u7a7f\u51fa\u817f\u957f2\u7c73\u7684\u6548\u679c\u5bbd\u677e\u7684\u88e4\u817f\uff0c\u5f53\u7136\u662f\u906e\u8089\u5c0f\u80fd\u624b\u554a\u3002\u4e0a\u8eab\u968f\u6027\u81ea\u7136\u4e0d\u62d8\u675f\uff0c\u9762\u6599\u4eb2\u80a4\u8212\u9002\u8d34\u8eab\u4f53\u9a8c\u611f\u68d2\u68d2\u54d2\u3002\u7cfb\u5e26\u90e8\u5206\u589e\u52a0\u8bbe\u8ba1\u770b\u70b9\uff0c\u8fd8\u8ba9\u5355\u54c1\u7684\u8bbe\u8ba1\u611f\u66f4\u5f3a\u3002\u817f\u90e8\u7ebf\u6761\u82e5\u9690\u82e5\u73b0\u7684\uff0c\u6027\u611f\u64a9\u4eba\u3002\u989c\u8272\u6572\u6e29\u67d4\u7684\uff0c\u4e0e\u88e4\u5b50\u672c\u8eab\u6240\u5448\u73b0\u7684\u98ce\u683c\u6709\u70b9\u53cd\u5dee\u840c\u3002\"\n}<\/code><\/pre>\n\n\n\n<p>\u60f3\u5c06\u8be5\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\u653e\u5230\u6211\u4eec\u7684\u7cfb\u7edf\u4e2d\u4f7f\u7528\uff0c\u5219\u9700\u8981\u8fdb\u884c\u5982\u4e0b\u4e24\u6b65\u64cd\u4f5c<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u590d\u5236\u8be5\u6570\u636e\u96c6\u5230 data\u76ee\u5f55\u4e0b<\/li>\n\n\n\n<li>\u4fee\u6539 data\/<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=242638741&amp;content_type=Article&amp;match_order=5&amp;q=dataset_info.json&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">dataset_info.json<\/a>\u00a0\u65b0\u52a0\u5185\u5bb9\u5b8c\u6210\u6ce8\u518c, \u8be5\u6ce8\u518c\u540c\u65f6\u5b8c\u6210\u4e863\u4ef6\u4e8b<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\u7684\u540d\u79f0\u4e3aadgen_local\uff0c\u540e\u7eed\u8bad\u7ec3\u7684\u65f6\u5019\u5c31\u4f7f\u7528\u8fd9\u4e2a\u540d\u79f0\u6765\u627e\u5230\u8be5\u6570\u636e\u96c6<\/li>\n\n\n\n<li>\u6307\u5b9a\u4e86\u6570\u636e\u96c6\u5177\u4f53\u6587\u4ef6\u4f4d\u7f6e<\/li>\n\n\n\n<li>\u5b9a\u4e49\u4e86\u539f\u6570\u636e\u96c6\u7684\u8f93\u5165\u8f93\u51fa\u548c\u6211\u4eec\u6240\u9700\u8981\u7684\u683c\u5f0f\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/picx.zhimg.com\/80\/v2-954ff6f815c251ef0277293f7519edef_720w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u57fa\u4e8eLoRA\u7684<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=242638741&amp;content_type=Article&amp;match_order=2&amp;q=sft%E6%8C%87%E4%BB%A4&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">sft\u6307\u4ee4<\/a>\u5fae\u8c03<\/h2>\n\n\n\n<p>\u5728\u51c6\u5907\u597d\u6570\u636e\u96c6\u4e4b\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f00\u59cb\u51c6\u5907\u8bad\u7ec3\u4e86\uff0c\u6211\u4eec\u7684\u76ee\u6807\u5c31\u662f\u8ba9\u539f\u6765\u7684LLaMA3\u6a21\u578b\u80fd\u591f\u5b66\u4f1a\u6211\u4eec\u5b9a\u4e49\u7684\u201c\u4f60\u662f\u8c01\u201d\uff0c\u540c\u65f6\u5b66\u4f1a\u6211\u4eec\u5e0c\u671b\u7684\u5546\u54c1\u6587\u6848\u7684\u4e00\u4e9b\u751f\u6210\u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u6211\u4eec\u5148\u4f7f\u7528\u547d\u4ee4\u884c\u7248\u672c\u6765\u505a\u8bad\u7ec3\uff0c\u4ece\u547d\u4ee4\u884c\u66f4\u5bb9\u6613\u5b66\u4e60\u76f8\u5173\u7684\u539f\u7406\u3002<\/p>\n\n\n\n<p>\u672c\u811a\u672c\u53c2\u6570\u6539\u7f16\u81ea&nbsp;<a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/github.com\/hiyouga\/LLaMA-Factory\/blob\/main\/examples\/train_lora\/llama3_lora_sft.yaml\" target=\"_blank\" rel=\"noreferrer noopener\">LLaMA-Factory\/examples\/train_lora\/llama3_lora_sft.yaml at main \u00b7 hiyouga\/LLaMA-Factory<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CUDA_VISIBLE_DEVICES=0 llamafactory-cli train \\\n    --stage sft \\\n    --do_train \\\n    --model_name_or_path \/media\/codingma\/LLM\/llama3\/Meta-Llama-3-8B-Instruct \\\n    --dataset alpaca_gpt4_zh,identity,adgen_local \\\n    --dataset_dir .\/data \\\n    --template llama3 \\\n    --finetuning_type lora \\\n    --output_dir .\/saves\/LLaMA3-8B\/lora\/sft \\\n    --overwrite_cache \\\n    --overwrite_output_dir \\\n    --cutoff_len 1024 \\\n    --preprocessing_num_workers 16 \\\n    --per_device_train_batch_size 2 \\\n    --per_device_eval_batch_size 1 \\\n    --gradient_accumulation_steps 8 \\\n    --lr_scheduler_type cosine \\\n    --logging_steps 50 \\\n    --warmup_steps 20 \\\n    --save_steps 100 \\\n    --eval_steps 50 \\\n    --evaluation_strategy steps \\\n    --load_best_model_at_end \\\n    --learning_rate 5e-5 \\\n    --num_train_epochs 5.0 \\\n    --max_samples 1000 \\\n    --val_size 0.1 \\\n    --plot_loss \\\n    --fp16<\/code><\/pre>\n\n\n\n<p>\u5173\u4e8e\u53c2\u6570\u7684\u5b8c\u6574\u5217\u8868\u548c\u89e3\u91ca\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u6765\u83b7\u53d6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>llamafactory-cli train -h<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u6211\u5bf9\u90e8\u5206\u5173\u952e\u7684\u53c2\u6570\u505a\u4e00\u4e0b\u89e3\u91ca\uff0cmodel_name_or_path \u548ctemplate \u4e0a\u6587\u5df2\u89e3\u91ca<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>\u53c2\u6570\u540d\u79f0<\/th><th>\u53c2\u6570\u8bf4\u660e<\/th><\/tr><tr><td>stage<\/td><td>\u5f53\u524d\u8bad\u7ec3\u7684\u9636\u6bb5\uff0c\u679a\u4e3e\u503c\uff0c\u6709\u201csft\u201d,&#8221;pt&#8221;,&#8221;rm&#8221;,&#8221;ppo&#8221;\u7b49\uff0c\u4ee3\u8868\u4e86\u8bad\u7ec3\u7684\u4e0d\u540c\u9636\u6bb5\uff0c\u8fd9\u91cc\u6211\u4eec\u662f\u6709\u76d1\u7763\u6307\u4ee4\u5fae\u8c03\uff0c\u6240\u4ee5\u662fsft<\/td><\/tr><tr><td>do_train<\/td><td>\u662f\u5426\u662f\u8bad\u7ec3\u6a21\u5f0f<\/td><\/tr><tr><td>dataset<\/td><td>\u4f7f\u7528\u7684\u6570\u636e\u96c6\u5217\u8868\uff0c\u6240\u6709\u5b57\u6bb5\u90fd\u9700\u8981\u6309\u4e0a\u6587\u5728data_info.json\u91cc\u6ce8\u518c\uff0c\u591a\u4e2a\u6570\u636e\u96c6\u7528&#8221;,&#8221;\u5206\u9694<\/td><\/tr><tr><td>dataset_dir<\/td><td>\u6570\u636e\u96c6\u6240\u5728\u76ee\u5f55\uff0c\u8fd9\u91cc\u662f data\uff0c\u4e5f\u5c31\u662f\u9879\u76ee\u81ea\u5e26\u7684data\u76ee\u5f55<\/td><\/tr><tr><td>finetuning_type<\/td><td>\u5fae\u8c03\u8bad\u7ec3\u7684\u7c7b\u578b\uff0c\u679a\u4e3e\u503c\uff0c\u6709&#8221;lora&#8221;,&#8221;full&#8221;,&#8221;freeze&#8221;\u7b49\uff0c\u8fd9\u91cc\u4f7f\u7528lora<\/td><\/tr><tr><td>output_dir<\/td><td>\u8bad\u7ec3\u7ed3\u679c\u4fdd\u5b58\u7684\u4f4d\u7f6e<\/td><\/tr><tr><td>cutoff_len<\/td><td>\u8bad\u7ec3\u6570\u636e\u96c6\u7684\u957f\u5ea6\u622a\u65ad<\/td><\/tr><tr><td>per_device_train_batch_size<\/td><td>\u6bcf\u4e2a\u8bbe\u5907\u4e0a\u7684batch size\uff0c\u6700\u5c0f\u662f1\uff0c\u5982\u679cGPU \u663e\u5b58\u591f\u5927\uff0c\u53ef\u4ee5\u9002\u5f53\u589e\u52a0<\/td><\/tr><tr><td>fp16<\/td><td>\u4f7f\u7528\u534a\u7cbe\u5ea6<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=242638741&amp;content_type=Article&amp;match_order=1&amp;q=%E6%B7%B7%E5%90%88%E7%B2%BE%E5%BA%A6%E8%AE%AD%E7%BB%83&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3<\/a><\/td><\/tr><tr><td>max_samples<\/td><td>\u6bcf\u4e2a\u6570\u636e\u96c6\u91c7\u6837\u591a\u5c11\u6570\u636e<\/td><\/tr><tr><td>val_size<\/td><td>\u968f\u673a\u4ece\u6570\u636e\u96c6\u4e2d\u62bd\u53d6\u591a\u5c11\u6bd4\u4f8b\u7684\u6570\u636e\u4f5c\u4e3a\u9a8c\u8bc1\u96c6<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>\u6ce8\u610f\uff1a\u7cbe\u5ea6\u76f8\u5173\u7684\u53c2\u6570\u8fd8\u6709bf16 \u548cpure_bf16\uff0c\u4f46\u662f\u8981\u6ce8\u610f\u6709\u7684\u8001\u663e\u5361\uff0c\u6bd4\u5982V100\u5c31\u65e0\u6cd5\u652f\u6301bf16\uff0c\u4f1a\u5bfc\u81f4\u7a0b\u5e8f\u62a5\u9519\u6216\u8005\u5176\u4ed6\u9519\u8bef<\/th><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u7cfb\u7edf\u4f1a\u6309\u7167logging_steps\u7684\u53c2\u6570\u8bbe\u7f6e\uff0c\u5b9a\u65f6\u8f93\u51fa\u8bad\u7ec3\u65e5\u5fd7\uff0c\u5305\u542b\u5f53\u524dloss\uff0c\u8bad\u7ec3\u8fdb\u5ea6\u7b49<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pica.zhimg.com\/80\/v2-529c1be1d139adf354396be2997e83c6_720w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u8bad\u7ec3\u5b8c\u540e\u5c31\u53ef\u4ee5\u5728\u8bbe\u7f6e\u7684output_dir\u4e0b\u770b\u5230\u5982\u4e0b\u5185\u5bb9\uff0c\u4e3b\u8981\u5305\u542b3\u90e8\u5206<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>adapter\u5f00\u5934\u7684\u5c31\u662f LoRA\u4fdd\u5b58\u7684\u7ed3\u679c\u4e86\uff0c\u540e\u7eed\u7528\u4e8e\u6a21\u578b\u63a8\u7406\u878d\u5408<\/li>\n\n\n\n<li>training_loss \u548ctrainer_log\u7b49\u8bb0\u5f55\u4e86\u8bad\u7ec3\u7684\u8fc7\u7a0b\u6307\u6807<\/li>\n\n\n\n<li>\u5176\u4ed6\u662f\u8bad\u7ec3\u5f53\u65f6\u5404\u79cd\u53c2\u6570\u7684\u5907\u4efd<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pica.zhimg.com\/80\/v2-c28f3d74144619426c06d6cf8fd1ff42_720w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u5173\u4e8eloss\u662f\u4ec0\u4e48\u7b49\uff0c\u8fd9\u5757\u4e0d\u5728\u672c\u6559\u7a0b\u8ba8\u8bba\u5185\u5bb9\u8303\u56f4\u4e4b\u5185\uff0c\u53ea\u9700\u8981\u8bb0\u4f4floss\u5728 \u6b63\u5e38\u60c5\u51b5\u4e0b\u4f1a\u968f\u7740\u8bad\u7ec3\u7684\u65f6\u95f4\u6162\u6162\u53d8\u5c0f\uff0c\u6700\u540e\u9700\u8981\u4e0b\u964d\u52301\u4ee5\u4e0b\u7684\u4f4d\u7f6e\u624d\u4f1a\u6709\u4e00\u4e2a\u6bd4\u8f83\u597d\u7684\u6548\u679c\uff0c\u53ef\u4ee5\u4f5c\u4e3a\u8bad\u7ec3\u6548\u679c\u7684\u4e00\u4e2a\u4e2d\u95f4\u6307\u6807\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. \u52a8\u6001\u5408\u5e76LoRA\u7684\u63a8\u7406<\/h2>\n\n\n\n<p>\u672c\u811a\u672c\u53c2\u6570\u6539\u7f16\u81ea&nbsp;<a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/github.com\/hiyouga\/LLaMA-Factory\/blob\/main\/examples\/inference\/llama3_lora_sft.yaml\" target=\"_blank\" rel=\"noreferrer noopener\">LLaMA-Factory\/examples\/inference\/llama3_lora_sft.yaml at main \u00b7 hiyouga\/LLaMA-Factory<\/a><\/p>\n\n\n\n<p>\u5f53\u57fa\u4e8eLoRA\u7684\u8bad\u7ec3\u8fdb\u7a0b\u7ed3\u675f\u540e\uff0c\u6211\u4eec\u5982\u679c\u60f3\u505a\u4e00\u4e0b\u52a8\u6001\u9a8c\u8bc1\uff0c\u5728\u7f51\u9875\u7aef\u91cc\u4e0e\u65b0\u6a21\u578b\u5bf9\u8bdd\uff0c\u4e0e\u6b65\u9aa44\u7684\u539f\u59cb\u6a21\u578b\u76f4\u63a5\u63a8\u7406\u76f8\u6bd4\uff0c\u552f\u4e00\u7684\u533a\u522b\u662f\u9700\u8981\u901a\u8fc7finetuning_type\u53c2\u6570\u544a\u8bc9\u7cfb\u7edf\uff0c\u6211\u4eec\u4f7f\u7528\u4e86LoRA\u8bad\u7ec3\uff0c\u7136\u540e\u5c06LoRA\u7684\u6a21\u578b\u4f4d\u7f6e\u901a\u8fc7 adapter_name_or_path\u53c2\u6570\u5373\u53ef\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CUDA_VISIBLE_DEVICES=0 llamafactory-cli webchat \\\n    --model_name_or_path \/media\/codingma\/LLM\/llama3\/Meta-Llama-3-8B-Instruct \\\n    --adapter_name_or_path .\/saves\/LLaMA3-8B\/lora\/sft  \\\n    --template llama3 \\\n    --finetuning_type lora<\/code><\/pre>\n\n\n\n<p>\u6548\u679c\u5982\u4e0b\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u6a21\u578b\u6574\u4e2a\u5df2\u7ecf\u5728\u5b66\u4e60\u4e86\u65b0\u7684\u6570\u636e\u77e5\u8bc6\uff0c\u5b66\u4e60\u4e86\u65b0\u7684\u8eab\u4efd\u8ba4\u77e5\u548c\u5546\u54c1\u6587\u6848\u751f\u6210\u7684\u683c\u5f0f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic3.zhimg.com\/80\/v2-7915e7da0852f557c9003c81ad7cf944_720w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u4f5c\u4e3a\u5bf9\u6bd4\uff0c\u5982\u679c\u5220\u9664LoRA\u76f8\u5173\u53c2\u6570\uff0c\u53ea\u4f7f\u7528\u539f\u59cb\u6a21\u578b\u91cd\u65b0\u542f\u52a8\u6d4b\u8bd5\uff0c\u53ef\u4ee5\u770b\u5230\u6a21\u578b\u8fd8\u662f\u6309\u7167\u901a\u7528\u7684\u4e00\u79cd\u56de\u7b54\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic1.zhimg.com\/80\/v2-0819971b198a0534ddb566783787aaf0_720w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u5982\u679c\u4e0d\u65b9\u4fbf\u4f7f\u7528webui\u6765\u505a\u4ea4\u4e92\uff0c\u4f7f\u7528\u547d\u4ee4\u884c\u6765\u505a\u4ea4\u4e92\uff0c\u540c\u6837\u4e5f\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n\n\n\n<p>\u672c\u811a\u672c\u6539\u7f16\u81ea&nbsp;<a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/github.com\/hiyouga\/LLaMA-Factory\/blob\/main\/examples\/inference\/llama3_lora_sft.yaml\" target=\"_blank\" rel=\"noreferrer noopener\">LLaMA-Factory\/examples\/inference\/llama3_lora_sft.yaml at main \u00b7 hiyouga\/LLaMA-Factory<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CUDA_VISIBLE_DEVICES=0 llamafactory-cli chat \\\n    --model_name_or_path \/media\/codingma\/LLM\/llama3\/Meta-Llama-3-8B-Instruct \\\n    --adapter_name_or_path .\/saves\/LLaMA3-8B\/lora\/sft  \\\n    --template llama3 \\\n    --finetuning_type lora<\/code><\/pre>\n\n\n\n<p>\u6548\u679c\u5982\u4e0b<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/80\/v2-e1b8b026ab1a36d86cb23269decda877_720w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">7. \u6279\u91cf\u9884\u6d4b\u548c\u8bad\u7ec3\u6548\u679c\u8bc4\u4f30<\/h2>\n\n\n\n<p>\u5f53\u7136\u4e0a\u6587\u4e2d\u7684\u4eba\u5de5\u4ea4\u4e92\u6d4b\u8bd5\uff0c\u4f1a\u504f\u611f\u6027\uff0c\u90a3\u6709\u6ca1\u6709\u529e\u6cd5\u6279\u91cf\u5730\u9884\u6d4b\u4e00\u6279\u6570\u636e\uff0c\u7136\u540e\u4f7f\u7528\u81ea\u52a8\u5316\u7684bleu\u548c rouge\u7b49\u5e38\u7528\u7684\u6587\u672c\u751f\u6210\u6307\u6807\u6765\u505a\u8bc4\u4f30\u3002\u6307\u6807\u8ba1\u7b97\u4f1a\u4f7f\u7528\u5982\u4e0b3\u4e2a\u5e93\uff0c\u8bf7\u5148\u505a\u4e00\u4e0bpip\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install jieba\npip install rouge-chinese\npip install nltk<\/code><\/pre>\n\n\n\n<p>\u672c\u811a\u672c\u53c2\u6570\u6539\u7f16\u81ea&nbsp;<a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/github.com\/hiyouga\/LLaMA-Factory\/blob\/main\/examples\/train_lora\/llama3_lora_predict.yaml\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/hiyouga\/LLaMA-Factory\/blob\/main\/examples\/train_lora\/llama3_lora_predict.yaml<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CUDA_VISIBLE_DEVICES=0 llamafactory-cli train \\\n    --stage sft \\\n    --do_predict \\\n    --model_name_or_path \/media\/codingma\/LLM\/llama3\/Meta-Llama-3-8B-Instruct \\\n    --adapter_name_or_path .\/saves\/LLaMA3-8B\/lora\/sft  \\\n    --eval_dataset alpaca_gpt4_zh,identity,adgen_local \\\n    --dataset_dir .\/data \\\n    --template llama3 \\\n    --finetuning_type lora \\\n    --output_dir .\/saves\/LLaMA3-8B\/lora\/predict \\\n    --overwrite_cache \\\n    --overwrite_output_dir \\\n    --cutoff_len 1024 \\\n    --preprocessing_num_workers 16 \\\n    --per_device_eval_batch_size 1 \\\n    --max_samples 20 \\\n    --predict_with_generate<\/code><\/pre>\n\n\n\n<p>\u4e0e\u8bad\u7ec3\u811a\u672c\u4e3b\u8981\u7684\u53c2\u6570\u533a\u522b\u5982\u4e0b\u4e24\u4e2a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>\u53c2\u6570\u540d\u79f0<\/th><th>\u53c2\u6570\u8bf4\u660e<\/th><\/tr><tr><td>do_predict<\/td><td>\u73b0\u5728\u662f\u9884\u6d4b\u6a21\u5f0f<\/td><\/tr><tr><td>predict_with_generate<\/td><td>\u73b0\u5728\u7528\u4e8e\u751f\u6210\u6587\u672c<\/td><\/tr><tr><td>max_samples<\/td><td>\u6bcf\u4e2a\u6570\u636e\u96c6\u91c7\u6837\u591a\u5c11\u7528\u4e8e\u9884\u6d4b\u5bf9\u6bd4<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u6700\u540e\u4f1a\u5728output_dir\u4e0b\u770b\u5230\u5982\u4e0b\u5185\u5bb9<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic2.zhimg.com\/80\/v2-4cff2d9c98be6d5ee5d914279c7f37c9_720w.webp\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u5176\u4e2d generated_predictions.jsonl \u6587\u4ef6 \u8f93\u51fa\u4e86\u8981\u9884\u6d4b\u7684\u6570\u636e\u96c6\u7684\u539f\u59cblabel\u548c\u6a21\u578bpredict\u7684\u7ed3\u679c<\/p>\n\n\n\n<p>predict_results.json\u7ed9\u51fa\u4e86\u539f\u59cblabel\u548c\u6a21\u578bpredict\u7684\u7ed3\u679c\uff0c\u7528\u81ea\u52a8\u8ba1\u7b97\u7684\u6307\u6807\u6570\u636e<\/p>\n\n\n\n<p>\u8fd9\u91cc\u7ed9\u76f8\u5173\u7684\u6307\u6807\u505a\u4e00\u4e0b\u8fdb\u4e00\u6b65\u7684\u89e3\u91ca<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>\u6307\u6807<\/th><th>\u542b\u4e49<\/th><\/tr><tr><td>BLEU-4<\/td><td>BLEU\uff08Bilingual Evaluation Understudy\uff09\u662f\u4e00\u79cd\u5e38\u7528\u7684\u7528\u4e8e\u8bc4\u4f30\u673a\u5668\u7ffb\u8bd1\u8d28\u91cf\u7684\u6307\u6807\u3002BLEU-4 \u8868\u793a\u56db\u5143\u8bed\u6cd5 BLEU \u5206\u6570\uff0c\u5b83\u8861\u91cf\u6a21\u578b\u751f\u6210\u6587\u672c\u4e0e\u53c2\u8003\u6587\u672c\u4e4b\u95f4\u7684 n-gram \u5339\u914d\u7a0b\u5ea6\uff0c\u5176\u4e2d n=4\u3002\u503c\u8d8a\u9ad8\u8868\u793a\u751f\u6210\u7684\u6587\u672c\u4e0e\u53c2\u8003\u6587\u672c\u8d8a\u76f8\u4f3c\uff0c\u6700\u5927\u503c\u4e3a 100\u3002<\/td><\/tr><tr><td>predict_rouge-1 \u548c predict_rouge-2<\/td><td>ROUGE\uff08Recall-Oriented Understudy for Gisting Evaluation\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u8bc4\u4f30\u81ea\u52a8\u6458\u8981\u548c\u6587\u672c\u751f\u6210\u6a21\u578b\u6027\u80fd\u7684\u6307\u6807\u3002ROUGE-1 \u8868\u793a\u4e00\u5143 ROUGE \u5206\u6570\uff0cROUGE-2 \u8868\u793a\u4e8c\u5143 ROUGE \u5206\u6570\uff0c\u5206\u522b\u8861\u91cf\u6a21\u578b\u751f\u6210\u6587\u672c\u4e0e\u53c2\u8003\u6587\u672c\u4e4b\u95f4\u7684\u5355\u4e2a\u8bcd\u548c\u53cc\u8bcd\u5e8f\u5217\u7684\u5339\u914d\u7a0b\u5ea6\u3002\u503c\u8d8a\u9ad8\u8868\u793a\u751f\u6210\u7684\u6587\u672c\u4e0e\u53c2\u8003\u6587\u672c\u8d8a\u76f8\u4f3c\uff0c\u6700\u5927\u503c\u4e3a 100\u3002<\/td><\/tr><tr><td>predict_rouge-l<\/td><td>ROUGE-L \u8861\u91cf\u6a21\u578b\u751f\u6210\u6587\u672c\u4e0e\u53c2\u8003\u6587\u672c\u4e4b\u95f4<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=242638741&amp;content_type=Article&amp;match_order=1&amp;q=%E6%9C%80%E9%95%BF%E5%85%AC%E5%85%B1%E5%AD%90%E5%BA%8F%E5%88%97&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">\u6700\u957f\u516c\u5171\u5b50\u5e8f\u5217<\/a>\uff08Longest Common Subsequence\uff09\u7684\u5339\u914d\u7a0b\u5ea6\u3002\u503c\u8d8a\u9ad8\u8868\u793a\u751f\u6210\u7684\u6587\u672c\u4e0e\u53c2\u8003\u6587\u672c\u8d8a\u76f8\u4f3c\uff0c\u6700\u5927\u503c\u4e3a 100\u3002<\/td><\/tr><tr><td>predict_runtime<\/td><td>\u9884\u6d4b\u8fd0\u884c\u65f6\u95f4\uff0c\u8868\u793a\u6a21\u578b\u751f\u6210\u4e00\u6279\u6837\u672c\u6240\u82b1\u8d39\u7684\u603b\u65f6\u95f4\u3002\u5355\u4f4d\u901a\u5e38\u4e3a\u79d2\u3002<\/td><\/tr><tr><td>predict_samples_per_second<\/td><td>\u6bcf\u79d2\u751f\u6210\u7684\u6837\u672c\u6570\u91cf\uff0c\u8868\u793a\u6a21\u578b\u6bcf\u79d2\u949f\u80fd\u591f\u751f\u6210\u7684\u6837\u672c\u6570\u91cf\u3002\u901a\u5e38\u7528\u4e8e\u8bc4\u4f30\u6a21\u578b\u7684\u63a8\u7406\u901f\u5ea6\u3002<\/td><\/tr><tr><td>predict_steps_per_second<\/td><td>\u6bcf\u79d2\u6267\u884c\u7684\u6b65\u9aa4\u6570\u91cf\uff0c\u8868\u793a\u6a21\u578b\u6bcf\u79d2\u949f\u80fd\u591f\u6267\u884c\u7684\u6b65\u9aa4\u6570\u91cf\u3002\u5bf9\u4e8e\u751f\u6210\u6a21\u578b\uff0c\u4e00\u822c\u6307\u7684\u662f\u6bcf\u79d2\u949f\u6267\u884c\u751f\u6210\u64cd\u4f5c\u7684\u6b21\u6570\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">8.\u00a0<strong>LoRA\u6a21\u578b\u5408\u5e76\u5bfc\u51fa<\/strong><\/h2>\n\n\n\n<p>\u5982\u679c\u60f3\u628a\u8bad\u7ec3\u7684LoRA\u548c\u539f\u59cb\u7684\u5927\u6a21\u578b\u8fdb\u884c\u878d\u5408\uff0c\u8f93\u51fa\u4e00\u4e2a\u5b8c\u6574\u7684\u6a21\u578b\u6587\u4ef6\u7684\u8bdd\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u3002\u5408\u5e76\u540e\u7684\u6a21\u578b\u53ef\u4ee5\u81ea\u7531\u5730\u50cf\u4f7f\u7528\u539f\u59cb\u7684\u6a21\u578b\u4e00\u6837\u5e94\u7528\u5230\u5176\u4ed6\u4e0b\u6e38\u73af\u8282\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u9012\u5f52\u5730\u7ee7\u7eed\u7528\u4e8e\u8bad\u7ec3\u3002<\/p>\n\n\n\n<p>\u672c\u811a\u672c\u53c2\u6570\u6539\u7f16\u81ea&nbsp;<a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/github.com\/hiyouga\/LLaMA-Factory\/blob\/main\/examples\/merge_lora\/llama3_lora_sft.yaml\" target=\"_blank\" rel=\"noreferrer noopener\">LLaMA-Factory\/examples\/merge_lora\/llama3_lora_sft.yaml at main \u00b7 hiyouga\/LLaMA-Factory<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CUDA_VISIBLE_DEVICES=0 llamafactory-cli export \\\n    --model_name_or_path \/media\/codingma\/LLM\/llama3\/Meta-Llama-3-8B-Instruct \\\n    --adapter_name_or_path .\/saves\/LLaMA3-8B\/lora\/sft  \\\n    --template llama3 \\\n    --finetuning_type lora \\\n    --export_dir megred-model-path \\\n    --export_size 2 \\\n    --export_device cpu \\\n    --export_legacy_format False<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>\u53c2\u8003\uff1ahttps:\/\/zhuanlan.zhihu.com\/p\/695287607<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6e90\u5927\u6a21\u578b\u5982LLaMA\uff0cQwen\uff0cBaichuan\u7b49\u4e3b\u8981\u90fd\u662f\u4f7f\u7528\u901a\u7528\u6570\u636e\u8fdb\u884c\u8bad\u7ec3\u800c\u6765\uff0c\u5176\u5bf9\u4e8e\u4e0d\u540c\u4e0b\u6e38\u7684\u4f7f\u7528\u573a\u666f\u548c\u5782\u76f4\u9886\u57df\u7684\u6548\u679c\u6709\u5f85\u8fdb\u4e00\u6b65\u63d0\u5347\uff0c\u884d\u751f\u51fa\u4e86\u5fae\u8c03\u8bad\u7ec3\u76f8\u5173\u7684\u9700\u6c42\uff0c\u5305\u542b\u9884\u8bad\u7ec3\uff08pt\uff09\uff0c\u6307\u4ee4\u5fae\u8c03\uff08sft\uff09\uff0c\u57fa\u4e8e\u4eba\u5de5\u53cd\u9988\u7684\u5bf9\u9f50\uff08rlhf\uff09\u7b49\u5168\u94fe\u8def\u3002\u4f46\u5927\u6a21\u578b\u8bad\u7ec3\u5bf9\u4e8e\u663e\u5b58\u548c\u7b97\u529b\u7684\u8981\u6c42\u8f83\u9ad8\uff0c\u540c\u65f6\u4e5f\u9700\u8981\u4e0b\u6e38\u5f00\u53d1\u8005\u5bf9\u5927\u6a21\u578b\u672c\u8eab\u7684\u6280\u672f\u6709\u4e00\u5b9a\u4e86\u89e3\uff0c\u5177\u6709\u4e00\u5b9a\u7684\u95e8\u69db\u3002<\/p>\n<p>LLaMA-Factory\u9879\u76ee\u7684\u76ee\u6807\u662f\u6574\u5408\u4e3b\u6d41\u7684\u5404\u79cd\u9ad8\u6548\u8bad\u7ec3\u5fae\u8c03\u6280\u672f\uff0c\u9002\u914d\u5e02\u573a\u4e3b\u6d41\u5f00\u6e90\u6a21\u578b\uff0c\u5f62\u6210\u4e00\u4e2a\u529f\u80fd\u4e30\u5bcc\uff0c\u9002\u914d\u6027\u597d\u7684\u8bad\u7ec3\u6846\u67b6\u3002\u9879\u76ee\u63d0\u4f9b\u4e86\u591a\u4e2a\u9ad8\u5c42\u6b21\u62bd\u8c61\u7684\u8c03\u7528\u63a5\u53e3\uff0c\u5305\u542b\u591a\u9636\u6bb5\u8bad\u7ec3\uff0c\u63a8\u7406\u6d4b\u8bd5\uff0cbenchmark\u8bc4\u6d4b\uff0cAPI Server\u7b49\uff0c\u4f7f\u5f00\u53d1\u8005\u5f00\u7bb1\u5373\u7528\u3002\u540c\u65f6\u501f\u9274 Stable Diffsion WebUI\u76f8\u5173\uff0c\u672c\u9879\u76ee\u63d0\u4f9b\u4e86\u57fa\u4e8egradio\u7684\u7f51\u9875\u7248\u5de5\u4f5c\u53f0\uff0c\u65b9\u4fbf\u521d\u5b66\u8005\u53ef\u4ee5\u8fc5\u901f\u4e0a\u624b\u64cd\u4f5c\uff0c\u5f00\u53d1\u51fa\u81ea\u5df1\u7684\u7b2c\u4e00\u4e2a\u6a21\u578b\u3002<\/p>\n","protected":false},"author":1,"featured_media":362,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>LLaMa-Factory\u4f7f\u7528\u6559\u7a0b - OAIDO AI<\/title>\n<meta name=\"description\" content=\"OAIDO AI LLaMa-Factory\u4f7f\u7528\u6559\u7a0b \u5b66\u4e60\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory\u4f7f\u7528\u6559\u7a0b\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b - OAIDO AI\" \/>\n<meta property=\"og:description\" content=\"OAIDO AI LLaMa-Factory\u4f7f\u7528\u6559\u7a0b \u5b66\u4e60\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory\u4f7f\u7528\u6559\u7a0b\/\" \/>\n<meta property=\"og:site_name\" content=\"OAIDO AI\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-08T09:21:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-08T09:21:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1208\" \/>\n\t<meta property=\"og:image:height\" content=\"1193\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"oaido_ai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"oaido_ai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/\"},\"author\":{\"name\":\"oaido_ai\",\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac\"},\"headline\":\"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b\",\"datePublished\":\"2024-10-08T09:21:37+00:00\",\"dateModified\":\"2024-10-08T09:21:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/\"},\"wordCount\":343,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac\"},\"image\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png\",\"articleSection\":[\"\u5b66\u4e60\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/\",\"url\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/\",\"name\":\"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b - OAIDO AI\",\"isPartOf\":{\"@id\":\"https:\/\/ai.oaido.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png\",\"datePublished\":\"2024-10-08T09:21:37+00:00\",\"dateModified\":\"2024-10-08T09:21:38+00:00\",\"description\":\"OAIDO AI LLaMa-Factory\u4f7f\u7528\u6559\u7a0b \u5b66\u4e60\",\"breadcrumb\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#primaryimage\",\"url\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png\",\"contentUrl\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png\",\"width\":1208,\"height\":1193},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ai.oaido.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ai.oaido.com\/#website\",\"url\":\"https:\/\/ai.oaido.com\/\",\"name\":\"OAIDO AI\",\"description\":\"AI\u6700\u65b0\u8d44\u8baf\u3001\u6280\u672f\u6587\u7ae0\u3001\u5de5\u5177\u63a8\u8350\u3001\u5b66\u4e60\u8d44\u6599\",\"publisher\":{\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ai.oaido.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac\",\"name\":\"oaido_ai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/\u5fae\u4fe1\u622a\u56fe_20240918174247.jpg\",\"contentUrl\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/\u5fae\u4fe1\u622a\u56fe_20240918174247.jpg\",\"width\":512,\"height\":512,\"caption\":\"oaido_ai\"},\"logo\":{\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/ai.oaido.com\"],\"url\":\"https:\/\/ai.oaido.com\/index.php\/author\/adminai_oaido\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b - OAIDO AI","description":"OAIDO AI LLaMa-Factory\u4f7f\u7528\u6559\u7a0b \u5b66\u4e60","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory\u4f7f\u7528\u6559\u7a0b\/","og_locale":"zh_CN","og_type":"article","og_title":"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b - OAIDO AI","og_description":"OAIDO AI LLaMa-Factory\u4f7f\u7528\u6559\u7a0b \u5b66\u4e60","og_url":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory\u4f7f\u7528\u6559\u7a0b\/","og_site_name":"OAIDO AI","article_published_time":"2024-10-08T09:21:37+00:00","article_modified_time":"2024-10-08T09:21:38+00:00","og_image":[{"width":1208,"height":1193,"url":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png","type":"image\/png"}],"author":"oaido_ai","twitter_card":"summary_large_image","twitter_misc":{"Written by":"oaido_ai","Est. reading time":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#article","isPartOf":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/"},"author":{"name":"oaido_ai","@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac"},"headline":"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b","datePublished":"2024-10-08T09:21:37+00:00","dateModified":"2024-10-08T09:21:38+00:00","mainEntityOfPage":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/"},"wordCount":343,"commentCount":0,"publisher":{"@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac"},"image":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#primaryimage"},"thumbnailUrl":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png","articleSection":["\u5b66\u4e60"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/","url":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/","name":"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b - OAIDO AI","isPartOf":{"@id":"https:\/\/ai.oaido.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#primaryimage"},"image":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#primaryimage"},"thumbnailUrl":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png","datePublished":"2024-10-08T09:21:37+00:00","dateModified":"2024-10-08T09:21:38+00:00","description":"OAIDO AI LLaMa-Factory\u4f7f\u7528\u6559\u7a0b \u5b66\u4e60","breadcrumb":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#primaryimage","url":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png","contentUrl":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/10\/WX20241008-172113.png","width":1208,"height":1193},{"@type":"BreadcrumbList","@id":"https:\/\/ai.oaido.com\/index.php\/2024\/10\/08\/llama-factory%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ai.oaido.com\/"},{"@type":"ListItem","position":2,"name":"LLaMa-Factory\u4f7f\u7528\u6559\u7a0b"}]},{"@type":"WebSite","@id":"https:\/\/ai.oaido.com\/#website","url":"https:\/\/ai.oaido.com\/","name":"OAIDO AI","description":"AI\u6700\u65b0\u8d44\u8baf\u3001\u6280\u672f\u6587\u7ae0\u3001\u5de5\u5177\u63a8\u8350\u3001\u5b66\u4e60\u8d44\u6599","publisher":{"@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ai.oaido.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac","name":"oaido_ai","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/image\/","url":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/\u5fae\u4fe1\u622a\u56fe_20240918174247.jpg","contentUrl":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/\u5fae\u4fe1\u622a\u56fe_20240918174247.jpg","width":512,"height":512,"caption":"oaido_ai"},"logo":{"@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/ai.oaido.com"],"url":"https:\/\/ai.oaido.com\/index.php\/author\/adminai_oaido\/"}]}},"_links":{"self":[{"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/posts\/360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/comments?post=360"}],"version-history":[{"count":2,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/posts\/360\/revisions"}],"predecessor-version":[{"id":363,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/posts\/360\/revisions\/363"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/media\/362"}],"wp:attachment":[{"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/media?parent=360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/categories?post=360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/tags?post=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}