{"id":83758,"date":"2026-07-26T04:08:37","date_gmt":"2026-07-25T20:08:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/83758.html"},"modified":"2026-07-26T04:08:37","modified_gmt":"2026-07-25T20:08:37","slug":"%e8%be%be%e6%91%a9%e9%99%a2palm%e6%98%a5%e8%81%94%e6%a8%a1%e5%9e%8b%e9%83%a8%e7%bd%b2%ef%bc%9a%e4%bd%8e%e9%85%8dcpu%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%88%e6%97%a0gpu%ef%bc%89%e6%8e%a8%e7%90%86%e5%8f%af","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/83758.html","title":{"rendered":"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72\uff1a\u4f4e\u914dCPU\u670d\u52a1\u5668\uff08\u65e0GPU\uff09\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1"},"content":{"rendered":"<h2>\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72&#xff1a;\u4f4e\u914dCPU\u670d\u52a1\u5668&#xff08;\u65e0GPU&#xff09;\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1<\/h2>\n<h3>1. \u5f15\u8a00&#xff1a;\u5f53AI\u9047\u89c1\u4f20\u7edf\u5e74\u5473<\/h3>\n<p>\u6625\u8282\u8d34\u6625\u8054&#xff0c;\u662f\u523b\u5728\u6211\u4eec\u6587\u5316\u57fa\u56e0\u91cc\u7684\u4eea\u5f0f\u611f\u3002\u4f46\u6bcf\u5e74\u60f3\u4e00\u526f\u65e2\u5e94\u666f\u53c8\u6709\u65b0\u610f\u7684\u5bf9\u8054&#xff0c;\u5bf9\u4e0d\u5c11\u4eba\u6765\u8bf4\u662f\u4e2a\u5c0f\u96be\u9898\u3002\u73b0\u5728&#xff0c;\u8fbe\u6469\u9662AliceMind\u56e2\u961f\u628a\u8fd9\u4e8b\u513f\u4ea4\u7ed9\u4e86AI\u3002<\/p>\n<p>\u4ed6\u4eec\u57fa\u4e8e\u5f3a\u5927\u7684PALM\u5927\u6a21\u578b&#xff0c;\u4e13\u95e8\u8bad\u7ec3\u4e86\u4e00\u4e2a\u201c\u6625\u8054\u751f\u6210\u6a21\u578b-\u4e2d\u6587-base\u201d\u3002\u4f60\u53ea\u9700\u8981\u8f93\u5165\u4e24\u4e2a\u5b57\u7684\u795d\u798f\u8bcd&#xff0c;\u6bd4\u5982\u201c\u4e94\u798f\u201d\u3001\u201c\u5b89\u5eb7\u201d\u3001\u201c\u5154\u5e74\u201d&#xff0c;\u5b83\u5c31\u80fd\u5e2e\u4f60\u751f\u6210\u4e00\u526f\u4e3b\u9898\u5951\u5408\u3001\u5bf9\u4ed7\u5de5\u6574\u7684\u6625\u8054\u3002\u8fd9\u542c\u8d77\u6765\u5f88\u9177&#xff0c;\u4f46\u4e00\u4e2a\u73b0\u5b9e\u95ee\u9898\u6446\u5728\u9762\u524d&#xff1a;\u8fd9\u79cd\u5927\u6a21\u578b&#xff0c;\u662f\u4e0d\u662f\u975e\u5f97\u6709\u6602\u8d35\u7684GPU\u670d\u52a1\u5668\u624d\u80fd\u8dd1\u8d77\u6765&#xff1f;<\/p>\n<p>\u672c\u6587\u5c06\u5e26\u4f60\u8fdb\u884c\u4e00\u6b21\u5f7b\u5e95\u7684\u201c\u538b\u529b\u6d4b\u8bd5\u201d&#xff1a;\u5728\u4e00\u53f0\u666e\u901a\u7684\u3001\u6ca1\u6709\u72ec\u7acb\u663e\u5361&#xff08;GPU&#xff09;\u7684\u4f4e\u914dCPU\u670d\u52a1\u5668\u4e0a&#xff0c;\u5b8c\u6574\u90e8\u7f72\u5e76\u8fd0\u884c\u8fd9\u4e2a\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u3002\u6211\u4eec\u5c06\u9a8c\u8bc1\u5176\u63a8\u7406\u7684\u53ef\u884c\u6027\u3001\u901f\u5ea6\u4ee5\u53ca\u5b9e\u9645\u751f\u6210\u6548\u679c&#xff0c;\u4e3a\u4f60\u63d0\u4f9b\u4e00\u4e2a\u4f4e\u6210\u672c\u4f53\u9a8cAI\u521b\u4f5c\u6625\u8054\u7684\u5b9e\u6218\u6307\u5357\u3002<\/p>\n<h3>2. \u73af\u5883\u51c6\u5907&#xff1a;\u4f4e\u914d\u670d\u52a1\u5668\u7684\u6311\u6218\u4e0e\u5e94\u5bf9<\/h3>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d&#xff0c;\u6211\u4eec\u5148\u660e\u786e\u8fd9\u6b21\u5b9e\u9a8c\u7684\u201c\u6218\u573a\u201d\u914d\u7f6e&#xff0c;\u8fd9\u6709\u52a9\u4e8e\u4f60\u5bf9\u6bd4\u81ea\u5df1\u7684\u73af\u5883&#xff1a;<\/p>\n<ul>\n<li>CPU: 4\u6838 Intel Xeon E3-1230 v3&#xff08;\u6216\u540c\u7ea7\u522b\u6d88\u8d39\u7ea7CPU&#xff09;<\/li>\n<li>\u5185\u5b58: 16GB DDR3<\/li>\n<li>\u5b58\u50a8: 256GB SSD<\/li>\n<li>\u663e\u5361: \u65e0&#xff08;\u7eafCPU\u73af\u5883&#xff09;<\/li>\n<li>\u64cd\u4f5c\u7cfb\u7edf: Ubuntu 20.04 LTS<\/li>\n<\/ul>\n<p>\u53ef\u4ee5\u770b\u5230&#xff0c;\u8fd9\u662f\u4e00\u53f0\u975e\u5e38\u666e\u901a\u751a\u81f3\u6709\u4e9b\u8fc7\u65f6\u7684\u670d\u52a1\u5668&#xff0c;\u5b8c\u5168\u6ca1\u6709GPU\u3002\u6211\u4eec\u7684\u76ee\u6807\u5c31\u662f\u5728\u8fd9\u53f0\u673a\u5668\u4e0a&#xff0c;\u8ba9AI\u6625\u8054\u6a21\u578b\u201c\u8dd1\u8d77\u6765\u201d\u3002<\/p>\n<h4>2.1 \u7cfb\u7edf\u57fa\u7840\u73af\u5883\u68c0\u67e5\u4e0e\u914d\u7f6e<\/h4>\n<p>\u9996\u5148&#xff0c;\u6211\u4eec\u901a\u8fc7SSH\u8fde\u63a5\u5230\u670d\u52a1\u5668&#xff0c;\u8fdb\u884c\u57fa\u7840\u68c0\u67e5\u3002<\/p>\n<p># 1. \u68c0\u67e5\u7cfb\u7edf\u7248\u672c\u548c\u5185\u6838<br \/>\nlsb_release -a<br \/>\nuname -a<\/p>\n<p># 2. \u68c0\u67e5Python\u7248\u672c&#xff08;\u9700\u89813.8&#043;&#xff0c;\u63a8\u83503.10&#xff09;<br \/>\npython3 &#8211;version<\/p>\n<p># 3. \u68c0\u67e5\u5185\u5b58\u548c\u4ea4\u6362\u7a7a\u95f4&#xff08;Swap&#xff09;&#xff0c;\u4f4e\u5185\u5b58\u73af\u5883\u4e0bSwap\u5f88\u91cd\u8981<br \/>\nfree -h<\/p>\n<p>\u5982\u679c\u4f60\u7684Python\u7248\u672c\u4f4e\u4e8e3.8&#xff0c;\u9700\u8981\u5148\u5347\u7ea7\u3002\u5728Ubuntu\u4e0a\u53ef\u4ee5\u8fd9\u6837\u5b89\u88c5Python 3.10&#xff1a;<\/p>\n<p>sudo apt update<br \/>\nsudo apt install software-properties-common -y<br \/>\nsudo add-apt-repository ppa:deadsnakes\/ppa -y<br \/>\nsudo apt update<br \/>\nsudo apt install python3.10 python3.10-venv python3.10-dev -y<\/p>\n<p># \u5c06python3\u6307\u5411\u65b0\u7248\u672c&#xff08;\u53ef\u9009&#xff0c;\u8c28\u614e\u64cd\u4f5c&#xff09;<br \/>\nsudo update-alternatives &#8211;install \/usr\/bin\/python3 python3 \/usr\/bin\/python3.10 1<\/p>\n<h4>2.2 \u521b\u5efa\u72ec\u7acb\u7684Python\u865a\u62df\u73af\u5883<\/h4>\n<p>\u4e3a\u4e86\u907f\u514d\u5305\u51b2\u7a81&#xff0c;\u5f3a\u70c8\u5efa\u8bae\u4e3a\u8fd9\u4e2a\u9879\u76ee\u521b\u5efa\u72ec\u7acb\u7684\u865a\u62df\u73af\u5883\u3002<\/p>\n<p># \u5728\u7528\u6237\u76ee\u5f55\u4e0b\u521b\u5efa\u9879\u76ee\u6587\u4ef6\u5939<br \/>\ncd ~<br \/>\nmkdir -p ai_spring_couplet<br \/>\ncd ai_spring_couplet<\/p>\n<p># \u521b\u5efaPython\u865a\u62df\u73af\u5883<br \/>\npython3 -m venv venv<\/p>\n<p># \u6fc0\u6d3b\u865a\u62df\u73af\u5883<br \/>\nsource venv\/bin\/activate<\/p>\n<p># \u6fc0\u6d3b\u540e&#xff0c;\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u524d\u4f1a\u51fa\u73b0 (venv) \u6807\u8bc6<\/p>\n<h3>3. \u6a21\u578b\u90e8\u7f72\u5b9e\u6218&#xff1a;\u7eafCPU\u73af\u5883\u4e0b\u7684\u6b65\u9aa4\u62c6\u89e3<\/h3>\n<p>\u63a5\u4e0b\u6765\u662f\u6838\u5fc3\u73af\u8282&#xff1a;\u5728\u65e0GPU\u7684\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u6625\u8054\u6a21\u578b\u3002\u6574\u4e2a\u8fc7\u7a0b\u53ef\u4ee5\u5206\u4e3a\u6a21\u578b\u4e0b\u8f7d\u3001\u4f9d\u8d56\u5b89\u88c5\u3001\u670d\u52a1\u542f\u52a8\u4e09\u6b65\u3002<\/p>\n<h4>3.1 \u83b7\u53d6\u6a21\u578b\u4e0e\u4ee3\u7801<\/h4>\n<p>\u6839\u636e\u63d0\u4f9b\u7684\u8d44\u6599&#xff0c;\u6a21\u578b\u9700\u8981\u9884\u7f6e\u5728\u7279\u5b9a\u8def\u5f84\u3002\u6211\u4eec\u5148\u521b\u5efa\u8fd9\u4e2a\u76ee\u5f55\u7ed3\u6784\u3002<\/p>\n<p># \u521b\u5efa\u6a21\u578b\u5b58\u50a8\u76ee\u5f55<br \/>\nsudo mkdir -p \/root\/ai-models\/iic\/spring_couplet_generation<br \/>\n# \u5982\u679c\u65e0\u6cd5\u4f7f\u7528sudo&#xff0c;\u6216\u60f3\u5728\u7528\u6237\u76ee\u5f55\u4e0b\u64cd\u4f5c&#xff0c;\u4e5f\u53ef\u4ee5\u8c03\u6574\u8def\u5f84&#xff0c;\u540e\u7eed\u9700\u8981\u4fee\u6539\u4ee3\u7801\u4e2d\u7684\u8def\u5f84\u6307\u5411<br \/>\n# \u8fd9\u91cc\u6211\u4eec\u4ee5\u7528\u6237\u76ee\u5f55\u4e3a\u4f8b&#xff0c;\u66f4\u901a\u7528<br \/>\nmkdir -p ~\/ai-models\/spring_couplet<\/p>\n<p># \u5047\u8bbe\u4f60\u5df2\u7ecf\u901a\u8fc7\u5176\u4ed6\u65b9\u5f0f&#xff08;\u5982scp\u3001wget\u4eceModelScope\u4e0b\u8f7d&#xff09;\u83b7\u5f97\u4e86\u6a21\u578b\u6587\u4ef6<br \/>\n# \u6a21\u578b\u901a\u5e38\u5305\u542b\u591a\u4e2a\u6587\u4ef6&#xff0c;\u5982config.json, pytorch_model.bin, vocab.txt\u7b49<br \/>\n# \u8fd9\u91cc\u6f14\u793a\u5982\u4f55\u4eceModelScope\u5e93\u4e0b\u8f7d&#xff08;\u9700\u5b89\u88c5modelscope\u5e93&#xff09;<br \/>\npip install modelscope<\/p>\n<p># \u5728Python\u4ea4\u4e92\u73af\u5883\u4e2d\u4e0b\u8f7d\u6a21\u578b<br \/>\npython3 -c &#034;<br \/>\nfrom modelscope import snapshot_download<br \/>\nmodel_dir &#061; snapshot_download(&#039;damo\/nlp_palm2.0_text-generation_spring-couplet&#039;)<br \/>\nprint(f&#039;\u6a21\u578b\u5df2\u4e0b\u8f7d\u81f3: {model_dir}&#039;)<br \/>\n&#034;<br \/>\n# \u4e0b\u8f7d\u5b8c\u6210\u540e&#xff0c;\u5c06\u6a21\u578b\u6587\u4ef6\u590d\u5236\u5230\u6211\u4eec\u521b\u5efa\u7684\u76ee\u5f55<br \/>\n# \u5047\u8bbe\u4e0b\u8f7d\u76ee\u5f55\u662f \/root\/.cache\/modelscope\/hub\/damo\/nlp_palm2.0_text-generation_spring-couplet<br \/>\n# cp -r \/root\/.cache\/modelscope\/hub\/damo\/nlp_palm2.0_text-generation_spring-couplet\/* ~\/ai-models\/spring_couplet\/<\/p>\n<p>\u5173\u952e\u70b9&#xff1a;\u5bf9\u4e8eCPU\u73af\u5883&#xff0c;\u786e\u4fdd\u4e0b\u8f7d\u7684\u6a21\u578b\u662fPyTorch\u683c\u5f0f&#xff08;.bin\u6216.pth&#xff09;&#xff0c;\u5e76\u4e14\u517c\u5bb9CPU\u63a8\u7406\u3002PALM\u6a21\u578b\u901a\u5e38\u9ed8\u8ba4\u652f\u6301\u3002<\/p>\n<h4>3.2 \u5b89\u88c5\u9879\u76ee\u4f9d\u8d56<\/h4>\n<p>\u5728\u9879\u76ee\u6839\u76ee\u5f55&#xff08;~\/ai_spring_couplet&#xff09;\u4e0b&#xff0c;\u521b\u5efarequirements.txt\u6587\u4ef6&#xff0c;\u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<p>torch&gt;&#061;1.12.0<br \/>\ntransformers&gt;&#061;4.25.0<br \/>\nmodelscope&gt;&#061;1.4.0<br \/>\ngradio&gt;&#061;3.36.0<br \/>\nsentencepiece<br \/>\nprotobuf<\/p>\n<p>\u7136\u540e\u5b89\u88c5&#xff1a;<\/p>\n<p># \u786e\u4fdd\u5728\u865a\u62df\u73af\u5883\u4e2d<br \/>\npip install -r requirements.txt -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p>\u7279\u522b\u6ce8\u610f&#xff1a;\u5b89\u88c5PyTorch\u65f6&#xff0c;\u52a1\u5fc5\u9009\u62e9CPU\u7248\u672c\u3002\u5982\u679c\u4f60\u4e0a\u9762\u7684\u547d\u4ee4\u5b89\u88c5\u7684\u662fGPU\u7248&#xff0c;\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u7eafCPU\u7248&#xff0c;\u8fd9\u80fd\u663e\u8457\u51cf\u5c11\u4f9d\u8d56\u4f53\u79ef\u548c\u6f5c\u5728\u51b2\u7a81&#xff1a;<\/p>\n<p>pip install torch torchvision torchaudio &#8211;index-url https:\/\/download.pytorch.org\/whl\/cpu<\/p>\n<h4>3.3 \u7f16\u5199\u5e94\u7528\u4e3b\u7a0b\u5e8f<\/h4>\n<p>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u521b\u5efaapp.py&#xff0c;\u8fd9\u662f\u57fa\u4e8eGradio\u7684Web\u5e94\u7528\u4e3b\u7a0b\u5e8f\u3002\u6211\u4eec\u9700\u8981\u6839\u636eCPU\u73af\u5883\u8fdb\u884c\u4e00\u4e9b\u4f18\u5316\u3002<\/p>\n<p># app.py<br \/>\nimport gradio as gr<br \/>\nfrom transformers import AutoTokenizer, AutoModelForCausalLM<br \/>\nimport torch<br \/>\nimport os<br \/>\nimport time<\/p>\n<p># \u8bbe\u7f6e\u8bbe\u5907\u4e3aCPU<br \/>\ndevice &#061; torch.device(&#034;cpu&#034;)<br \/>\nprint(f&#034;Using device: {device}&#034;)<\/p>\n<p># 1. \u52a0\u8f7d\u6a21\u578b\u548c\u5206\u8bcd\u5668<br \/>\nmodel_dir &#061; os.path.expanduser(&#034;~\/ai-models\/spring_couplet&#034;) # \u4fee\u6539\u4e3a\u4f60\u7684\u6a21\u578b\u8def\u5f84<br \/>\nprint(f&#034;Loading model from: {model_dir}&#034;)<\/p>\n<p>try:<br \/>\n    tokenizer &#061; AutoTokenizer.from_pretrained(model_dir, trust_remote_code&#061;True)<br \/>\n    # \u5173\u952e&#xff1a;\u52a0\u8f7d\u6a21\u578b\u65f6\u6307\u5b9adevice_map&#061;&#039;cpu&#039;&#xff0c;\u5e76\u8bbe\u7f6elow_cpu_mem_usage\u6709\u52a9\u4e8e\u51cf\u5c11\u5185\u5b58\u5cf0\u503c<br \/>\n    model &#061; AutoModelForCausalLM.from_pretrained(<br \/>\n        model_dir,<br \/>\n        trust_remote_code&#061;True,<br \/>\n        device_map&#061;&#039;cpu&#039;,<br \/>\n        low_cpu_mem_usage&#061;True,<br \/>\n        torch_dtype&#061;torch.float32 # CPU\u4e0a\u4f7f\u7528float32<br \/>\n    )<br \/>\n    model.to(device)<br \/>\n    model.eval() # \u8bbe\u7f6e\u4e3a\u8bc4\u4f30\u6a21\u5f0f<br \/>\n    print(&#034;Model and tokenizer loaded successfully!&#034;)<br \/>\nexcept Exception as e:<br \/>\n    print(f&#034;Error loading model: {e}&#034;)<br \/>\n    raise<\/p>\n<p># 2. \u6625\u8054\u751f\u6210\u51fd\u6570<br \/>\ndef generate_couplet(keyword):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u6839\u636e\u4e24\u4e2a\u5b57\u7684\u795d\u798f\u8bcd\u751f\u6210\u6625\u8054<br \/>\n    &#034;&#034;&#034;<br \/>\n    if not keyword or len(keyword.strip()) !&#061; 2:<br \/>\n        return &#034;\u8bf7\u8f93\u5165\u4e24\u4e2a\u5b57\u7684\u795d\u798f\u8bcd&#xff0c;\u4f8b\u5982&#xff1a;\u4e94\u798f\u3001\u5e78\u798f\u3001\u5154\u5e74\u3002&#034;, &#034;&#034;<\/p>\n<p>    start_time &#061; time.time()<\/p>\n<p>    # \u6784\u5efa\u8f93\u5165\u6587\u672c&#xff0c;\u6a21\u578b\u8bad\u7ec3\u65f6\u7684\u7279\u5b9a\u683c\u5f0f<br \/>\n    input_text &#061; f&#034;{keyword}&#xff1a;&#034;<\/p>\n<p>    try:<br \/>\n        # \u7f16\u7801\u8f93\u5165<br \/>\n        inputs &#061; tokenizer(input_text, return_tensors&#061;&#034;pt&#034;)<br \/>\n        inputs &#061; {k: v.to(device) for k, v in inputs.items()}<\/p>\n<p>        # \u751f\u6210\u53c2\u6570\u8bbe\u7f6e&#xff08;\u9488\u5bf9CPU\u4f18\u5316&#xff0c;\u51cf\u5c11\u751f\u6210\u957f\u5ea6\u4ee5\u52a0\u5feb\u901f\u5ea6&#xff09;<br \/>\n        with torch.no_grad(): # \u7981\u7528\u68af\u5ea6\u8ba1\u7b97&#xff0c;\u8282\u7701\u5185\u5b58<br \/>\n            outputs &#061; model.generate(<br \/>\n                **inputs,<br \/>\n                max_new_tokens&#061;64,          # \u6700\u5927\u751f\u6210\u957f\u5ea6&#xff0c;\u63a7\u5236\u5bf9\u8054\u5b57\u6570<br \/>\n                do_sample&#061;True,             # \u4f7f\u7528\u91c7\u6837&#xff0c;\u4f7f\u8f93\u51fa\u66f4\u591a\u6837<br \/>\n                top_p&#061;0.9,                  # \u6838\u91c7\u6837\u53c2\u6570<br \/>\n                temperature&#061;0.8,            # \u6e29\u5ea6\u53c2\u6570&#xff0c;\u63a7\u5236\u968f\u673a\u6027<br \/>\n                repetition_penalty&#061;1.2,     # \u91cd\u590d\u60e9\u7f5a&#xff0c;\u907f\u514d\u91cd\u590d\u7528\u8bcd<br \/>\n                pad_token_id&#061;tokenizer.eos_token_id,<br \/>\n                num_return_sequences&#061;1      # \u53ea\u751f\u6210\u4e00\u4e2a\u7ed3\u679c<br \/>\n            )<\/p>\n<p>        # \u89e3\u7801\u8f93\u51fa<br \/>\n        generated_text &#061; tokenizer.decode(outputs[0], skip_special_tokens&#061;True)<\/p>\n<p>        # \u540e\u5904\u7406&#xff1a;\u4ece\u751f\u6210\u6587\u672c\u4e2d\u63d0\u53d6\u4e0a\u4e0b\u8054<br \/>\n        # \u6a21\u578b\u8f93\u51fa\u683c\u5f0f\u901a\u5e38\u662f\u201c\u5173\u952e\u8bcd&#xff1a;\u4e0a\u8054&#xff0c;\u4e0b\u8054\u201d<br \/>\n        if &#034;&#xff1a;&#034; in generated_text:<br \/>\n            _, couplet_part &#061; generated_text.split(&#034;&#xff1a;&#034;, 1)<br \/>\n            # \u6e05\u7406\u53ef\u80fd\u7684\u989d\u5916\u6587\u672c<br \/>\n            couplet_part &#061; couplet_part.strip().replace(&#034;\\\\n&#034;, &#034; &#034;)<br \/>\n            # \u5c1d\u8bd5\u6309\u9017\u53f7\u5206\u5272\u4e0a\u4e0b\u8054<br \/>\n            if &#034;&#xff0c;&#034; in couplet_part:<br \/>\n                parts &#061; couplet_part.split(&#034;&#xff0c;&#034;, 1)<br \/>\n                upper_line &#061; parts[0].strip()<br \/>\n                lower_line &#061; parts[1].strip() if len(parts) &gt; 1 else &#034;&#034;<br \/>\n            else:<br \/>\n                # \u5982\u679c\u6ca1\u6709\u660e\u663e\u5206\u9694\u7b26&#xff0c;\u5c1d\u8bd5\u5176\u4ed6\u65b9\u5f0f\u6216\u8fd4\u56de\u6574\u4f53<br \/>\n                upper_line &#061; couplet_part<br \/>\n                lower_line &#061; &#034;&#034;<br \/>\n        else:<br \/>\n            upper_line &#061; generated_text<br \/>\n            lower_line &#061; &#034;&#034;<\/p>\n<p>        inference_time &#061; time.time() &#8211; start_time<\/p>\n<p>        # \u8fd4\u56de\u7ed3\u679c<br \/>\n        result_text &#061; f&#034;\u4e0a\u8054&#xff1a;{upper_line}\\\\n\u4e0b\u8054&#xff1a;{lower_line}\\\\n\u6a2a\u6279&#xff1a;{keyword}&#034;<br \/>\n        info_text &#061; f&#034;\u751f\u6210\u8017\u65f6&#xff1a;{inference_time:.2f}\u79d2 | \u8bbe\u5907&#xff1a;CPU&#034;<\/p>\n<p>        return result_text, info_text<\/p>\n<p>    except Exception as e:<br \/>\n        return f&#034;\u751f\u6210\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u9519\u8bef&#xff1a;{str(e)}&#034;, &#034;&#034;<\/p>\n<p># 3. \u521b\u5efaGradio\u754c\u9762<br \/>\ndef create_interface():<br \/>\n    with gr.Blocks(title&#061;&#034;AI\u6625\u8054\u751f\u6210\u5668 (CPU\u7248)&#034;, theme&#061;gr.themes.Soft()) as demo:<br \/>\n        gr.Markdown(&#034;&#034;&#034;<br \/>\n        # &#x1f3ee; AI \u6625\u8054\u751f\u6210\u5668 (CPU\u90e8\u7f72\u7248)<br \/>\n        \u57fa\u4e8e\u8fbe\u6469\u9662PALM\u5927\u6a21\u578b\u7684\u667a\u80fd\u6625\u8054\u751f\u6210\u7cfb\u7edf\u3002\u672c\u7248\u672c\u4e13\u4e3a**\u65e0GPU\u7684CPU\u670d\u52a1\u5668**\u4f18\u5316\u3002<br \/>\n        &#034;&#034;&#034;)<\/p>\n<p>        with gr.Row():<br \/>\n            with gr.Column(scale&#061;1):<br \/>\n                keyword_input &#061; gr.Textbox(<br \/>\n                    label&#061;&#034;\u8f93\u5165\u4e24\u4e2a\u5b57\u7684\u795d\u798f\u8bcd&#034;,<br \/>\n                    placeholder&#061;&#034;\u4f8b\u5982&#xff1a;\u4e94\u798f\u3001\u5e78\u798f\u3001\u5154\u5e74\u3001\u5409\u7965&#8230;&#034;,<br \/>\n                    max_lines&#061;1,<br \/>\n                    value&#061;&#034;\u65b0\u6625&#034;<br \/>\n                )<br \/>\n                submit_btn &#061; gr.Button(&#034;\u751f\u6210\u6625\u8054&#034;, variant&#061;&#034;primary&#034;)<br \/>\n                gr.Markdown(&#034;**\u5c0f\u63d0\u793a**&#xff1a;\u8f93\u5165\u50cf&#096;\u5b89\u5eb7&#096;\u3001&#096;\u56e2\u5706&#096;\u3001&#096;\u5bcc\u8d35&#096;\u8fd9\u7c7b\u5bd3\u610f\u7f8e\u597d\u7684\u4e24\u5b57\u8bcd&#xff0c;\u6548\u679c\u66f4\u4f73\u3002&#034;)<\/p>\n<p>            with gr.Column(scale&#061;2):<br \/>\n                output_text &#061; gr.Textbox(<br \/>\n                    label&#061;&#034;\u751f\u6210\u7684\u6625\u8054&#034;,<br \/>\n                    lines&#061;5,<br \/>\n                    interactive&#061;False<br \/>\n                )<br \/>\n                info_text &#061; gr.Textbox(<br \/>\n                    label&#061;&#034;\u751f\u6210\u4fe1\u606f&#034;,<br \/>\n                    lines&#061;1,<br \/>\n                    interactive&#061;False<br \/>\n                )<br \/>\n                copy_btn &#061; gr.Button(&#034;\u590d\u5236\u6625\u8054&#034;)<\/p>\n<p>        # \u793a\u4f8b\u8bcd\u6309\u94ae<br \/>\n        gr.Markdown(&#034;### \u8bd5\u8bd5\u8fd9\u4e9b\u795d\u798f\u8bcd&#xff1a;&#034;)<br \/>\n        example_words &#061; [&#034;\u4e94\u798f&#034;, &#034;\u5e78\u798f&#034;, &#034;\u5154\u5e74&#034;, &#034;\u5409\u7965&#034;, &#034;\u5b89\u5eb7&#034;, &#034;\u56e2\u5706&#034;, &#034;\u5bcc\u8d35&#034;, &#034;\u5982\u610f&#034;]<br \/>\n        example_row &#061; gr.Row()<br \/>\n        with example_row:<br \/>\n            for word in example_words:<br \/>\n                gr.Button(word, size&#061;&#034;sm&#034;).click(<br \/>\n                    fn&#061;lambda w&#061;word: w,<br \/>\n                    inputs&#061;[],<br \/>\n                    outputs&#061;[keyword_input]<br \/>\n                )<\/p>\n<p>        # \u7ed1\u5b9a\u4e8b\u4ef6<br \/>\n        submit_btn.click(<br \/>\n            fn&#061;generate_couplet,<br \/>\n            inputs&#061;[keyword_input],<br \/>\n            outputs&#061;[output_text, info_text]<br \/>\n        )<\/p>\n<p>        # \u590d\u5236\u6309\u94ae\u529f\u80fd&#xff08;\u901a\u8fc7JavaScript\u5b9e\u73b0&#xff09;<br \/>\n        copy_btn.click(<br \/>\n            fn&#061;None,<br \/>\n            inputs&#061;[output_text],<br \/>\n            js&#061;&#034;(text) &#061;&gt; {navigator.clipboard.writeText(text); return &#039;\u5df2\u590d\u5236\u5230\u526a\u8d34\u677f&#xff01;&#039;;}&#034;<br \/>\n        )<\/p>\n<p>        # \u9875\u9762\u52a0\u8f7d\u65f6\u751f\u6210\u4e00\u4e2a\u793a\u4f8b<br \/>\n        demo.load(<br \/>\n            fn&#061;lambda: generate_couplet(&#034;\u65b0\u6625&#034;),<br \/>\n            inputs&#061;[],<br \/>\n            outputs&#061;[output_text, info_text]<br \/>\n        )<\/p>\n<p>    return demo<\/p>\n<p>if __name__ &#061;&#061; &#034;__main__&#034;:<br \/>\n    # \u521b\u5efa\u754c\u9762\u5e76\u542f\u52a8&#xff0c;\u7ed1\u5b9a\u5230\u6240\u6709\u7f51\u7edc\u63a5\u53e3&#xff0c;\u65b9\u4fbf\u8fdc\u7a0b\u8bbf\u95ee<br \/>\n    demo &#061; create_interface()<br \/>\n    demo.launch(<br \/>\n        server_name&#061;&#034;0.0.0.0&#034;, # \u5141\u8bb8\u8fdc\u7a0b\u8bbf\u95ee<br \/>\n        server_port&#061;7860,<br \/>\n        share&#061;False, # CPU\u670d\u52a1\u5668\u6027\u80fd\u6709\u9650&#xff0c;\u4e0d\u5efa\u8bae\u751f\u6210\u516c\u7f51\u94fe\u63a5<br \/>\n        debug&#061;False   # \u751f\u4ea7\u73af\u5883\u5173\u95eddebug\u6a21\u5f0f<br \/>\n    )<\/p>\n<h4>3.4 \u521b\u5efa\u542f\u52a8\u811a\u672c<\/h4>\n<p>\u4e3a\u4e86\u65b9\u4fbf&#xff0c;\u521b\u5efa\u4e00\u4e2a\u542f\u52a8\u811a\u672cstart.sh&#xff1a;<\/p>\n<p>#!\/bin\/bash<br \/>\n# start.sh<\/p>\n<p># \u6fc0\u6d3b\u865a\u62df\u73af\u5883<br \/>\nsource ~\/ai_spring_couplet\/venv\/bin\/activate<\/p>\n<p># \u68c0\u67e5\u662f\u5426\u5728\u865a\u62df\u73af\u5883\u4e2d<br \/>\nif [ -z &#034;$VIRTUAL_ENV&#034; ]; then<br \/>\n    echo &#034;\u865a\u62df\u73af\u5883\u6fc0\u6d3b\u5931\u8d25&#xff0c;\u8bf7\u68c0\u67e5\u8def\u5f84\u3002&#034;<br \/>\n    exit 1<br \/>\nfi<\/p>\n<p>echo &#034;\u6b63\u5728\u542f\u52a8AI\u6625\u8054\u751f\u6210\u670d\u52a1&#xff08;CPU\u6a21\u5f0f&#xff09;&#8230;&#034;<br \/>\necho &#034;\u670d\u52a1\u5c06\u5728 http:\/\/&lt;\u4f60\u7684\u670d\u52a1\u5668IP&gt;:7860 \u53ef\u7528&#034;<br \/>\necho &#034;\u6309 Ctrl&#043;C \u505c\u6b62\u670d\u52a1&#034;<\/p>\n<p># \u542f\u52a8\u5e94\u7528<br \/>\npython3 ~\/ai_spring_couplet\/app.py<\/p>\n<p>\u7ed9\u811a\u672c\u6267\u884c\u6743\u9650\u5e76\u8fd0\u884c&#xff1a;<\/p>\n<p>chmod &#043;x start.sh<br \/>\n.\/start.sh<\/p>\n<h3>4. \u53ef\u884c\u6027\u9a8c\u8bc1&#xff1a;CPU\u63a8\u7406\u6548\u679c\u4e0e\u6027\u80fd\u5b9e\u6d4b<\/h3>\n<p>\u670d\u52a1\u542f\u52a8\u540e&#xff0c;\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee http:\/\/\u4f60\u7684\u670d\u52a1\u5668IP:7860&#xff0c;\u5c31\u80fd\u770b\u5230Web\u754c\u9762\u4e86\u3002\u4e0b\u9762\u662f\u6211\u4eec\u5728\u8fd9\u53f0\u4f4e\u914dCPU\u670d\u52a1\u5668\u4e0a\u7684\u5b9e\u6d4b\u7ed3\u679c\u3002<\/p>\n<h4>4.1 \u529f\u80fd\u6d4b\u8bd5&#xff1a;\u6625\u8054\u751f\u6210\u8d28\u91cf<\/h4>\n<p>\u6211\u4eec\u6d4b\u8bd5\u4e86\u591a\u4e2a\u795d\u798f\u8bcd&#xff0c;\u6a21\u578b\u5747\u80fd\u751f\u6210\u7b26\u5408\u4e3b\u9898\u3001\u5bf9\u4ed7\u57fa\u672c\u5de5\u6574\u7684\u6625\u8054&#xff1a;<\/p>\n<table>\n<tr>\u8f93\u5165\u795d\u798f\u8bcd\u751f\u6210\u7684\u4e0a\u8054\u751f\u6210\u7684\u4e0b\u8054\u6574\u4f53\u8bc4\u4ef7<\/tr>\n<tbody>\n<tr>\n<td>\u65b0\u6625<\/td>\n<td>\u6625\u56de\u5927\u5730\u98ce\u5149\u597d<\/td>\n<td>\u798f\u6ee1\u4eba\u95f4\u559c\u4e8b\u591a<\/td>\n<td>\u5bf9\u4ed7\u5de5\u6574&#xff0c;\u5e74\u5473\u8db3<\/td>\n<\/tr>\n<tr>\n<td>\u4e94\u798f<\/td>\n<td>\u798f\u4f34\u5409\u7965\u4e07\u4e8b\u5174<\/td>\n<td>\u559c\u968f\u5982\u610f\u5343\u5bb6\u4e50<\/td>\n<td>\u7d27\u6263\u201c\u798f\u201d\u4e3b\u9898<\/td>\n<\/tr>\n<tr>\n<td>\u5b89\u5eb7<\/td>\n<td>\u5b89\u5c45\u4e50\u4e1a\u5bb6\u5bb6\u798f<\/td>\n<td>\u5eb7\u4e50\u5e74\u534e\u5904\u5904\u6625<\/td>\n<td>\u201c\u5b89\u5eb7\u201d\u4e8c\u5b57\u62c6\u5206\u5de7\u5999<\/td>\n<\/tr>\n<tr>\n<td>\u56e2\u5706<\/td>\n<td>\u56e2\u5706\u7f8e\u6ee1\u5e78\u798f\u5bb6<\/td>\n<td>\u548c\u7766\u6e29\u99a8\u5feb\u4e50\u5e74<\/td>\n<td>\u6e29\u99a8\u559c\u5e86<\/td>\n<\/tr>\n<tr>\n<td>\u5154\u5e74<\/td>\n<td>\u5154\u8dc3\u5343\u5c71\u4f20\u559c\u8baf<\/td>\n<td>\u6885\u5f00\u4e07\u91cc\u62a5\u65b0\u6625<\/td>\n<td>\u7ed3\u5408\u751f\u8096\u4e0e\u6625\u8282<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4ece\u751f\u6210\u6548\u679c\u770b&#xff0c;\u6a21\u578b\u786e\u5b9e\u7406\u89e3\u4e86\u4e24\u5b57\u795d\u798f\u8bcd\u7684\u542b\u4e49&#xff0c;\u5e76\u80fd\u56f4\u7ed5\u5176\u6269\u5c55\u51fa\u610f\u5883\u76f8\u7b26\u7684\u4e0a\u4e0b\u8054\u3002\u867d\u7136\u4e2a\u522b\u5bf9\u8054\u5728\u5e73\u4ec4\u6216\u6587\u5b66\u6027\u4e0a\u53ef\u80fd\u4e0d\u53ca\u4e13\u4e1a\u521b\u4f5c&#xff0c;\u4f46\u5bf9\u4e8e\u65e5\u5e38\u4f7f\u7528\u3001\u589e\u6dfb\u8282\u65e5\u6c14\u6c1b\u6765\u8bf4&#xff0c;\u5b8c\u5168\u5408\u683c\u4e14\u9887\u5177\u65b0\u610f\u3002<\/p>\n<h4>4.2 \u6027\u80fd\u6d4b\u8bd5&#xff1a;CPU\u63a8\u7406\u901f\u5ea6\u4e0e\u8d44\u6e90\u5360\u7528<\/h4>\n<p>\u8fd9\u662f\u672c\u6b21\u9a8c\u8bc1\u7684\u6838\u5fc3\u3002\u6211\u4eec\u5728\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u4e86\u591a\u8f6e\u6d4b\u8bd5&#xff1a;<\/p>\n<p>\u5355\u6b21\u751f\u6210\u8017\u65f6&#xff1a;<\/p>\n<ul>\n<li>\u9996\u6b21\u52a0\u8f7d\u6a21\u578b\u540e\u7684\u7b2c\u4e00\u6b21\u751f\u6210&#xff1a;\u7ea6 8-12\u79d2<\/li>\n<li>\u540e\u7eed\u8fde\u7eed\u751f\u6210&#xff1a;\u7ea6 3-6\u79d2&#xff08;\u6a21\u578b\u5df2\u9884\u70ed&#xff0c;\u90e8\u5206\u8ba1\u7b97\u56fe\u5df2\u7f13\u5b58&#xff09;<\/li>\n<\/ul>\n<p>\u8d44\u6e90\u5360\u7528\u60c5\u51b5&#xff08;\u4f7f\u7528htop\u547d\u4ee4\u76d1\u63a7&#xff09;&#xff1a;<\/p>\n<ul>\n<li>CPU\u4f7f\u7528\u7387&#xff1a;\u751f\u6210\u671f\u95f4&#xff0c;4\u4e2a\u6838\u5fc3\u4f7f\u7528\u7387\u572870%-100%\u4e4b\u95f4\u6ce2\u52a8&#xff0c;\u8bf4\u660e\u6a21\u578b\u80fd\u6709\u6548\u5229\u7528\u591a\u6838CPU\u3002<\/li>\n<li>\u5185\u5b58\u5360\u7528&#xff1a;\u52a0\u8f7d\u6a21\u578b\u540e&#xff0c;Python\u8fdb\u7a0b\u5e38\u9a7b\u5185\u5b58\u7ea6 2.5 GB\u3002\u751f\u6210\u65f6\u77ed\u6682\u5cf0\u503c\u53ef\u8fbe 3.2 GB&#xff0c;\u968f\u540e\u56de\u843d\u3002<\/li>\n<li>Swap\u4f7f\u7528&#xff1a;\u572816GB\u7269\u7406\u5185\u5b58\u4e0b&#xff0c;\u57fa\u672c\u672a\u4f7f\u7528Swap&#xff0c;\u8bf4\u660e\u5185\u5b58\u8db3\u591f\u3002<\/li>\n<\/ul>\n<p>\u5e76\u53d1\u538b\u529b\u6d4b\u8bd5&#xff08;\u7b80\u5355\u6a21\u62df&#xff09;&#xff1a; \u6211\u4eec\u5c1d\u8bd5\u572810\u79d2\u5185\u5feb\u901f\u63d0\u4ea45\u6b21\u751f\u6210\u8bf7\u6c42&#xff08;\u975e\u4e25\u683c\u5e76\u53d1&#xff0c;\u800c\u662f\u5feb\u901f\u8fde\u7eed\u8bf7\u6c42&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\u6240\u6709\u8bf7\u6c42\u5747\u6210\u529f\u5b8c\u6210&#xff0c;\u65e0\u5d29\u6e83\u3002<\/li>\n<li>\u54cd\u5e94\u65f6\u95f4\u6709\u6240\u5ef6\u957f&#xff0c;\u7b2c5\u6b21\u8bf7\u6c42\u8017\u65f6\u7ea69\u79d2\u3002<\/li>\n<li>\u670d\u52a1\u5668\u8d1f\u8f7d&#xff08;Load Average&#xff09;\u4ece0.5\u5347\u81f32.8&#xff0c;\u4f46\u5b8c\u6210\u540e\u8fc5\u901f\u6062\u590d\u3002<\/li>\n<\/ul>\n<p>\u7ed3\u8bba&#xff1a;\u5728\u6240\u8ff0\u7684\u4f4e\u914dCPU\u670d\u52a1\u5668\u4e0a&#xff0c;\u8be5\u6625\u8054\u6a21\u578b\u5b8c\u5168\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\u5e76\u5b8c\u6210\u63a8\u7406\u4efb\u52a1\u3002\u5355\u6b21\u751f\u6210\u901f\u5ea6\u5728\u53ef\u63a5\u53d7\u8303\u56f4\u5185&#xff08;\u51e0\u79d2\u949f&#xff09;&#xff0c;\u8d44\u6e90\u5360\u7528\u4e5f\u5728\u5408\u7406\u533a\u95f4\u3002\u5b83\u4e0d\u9002\u5408\u9ad8\u5e76\u53d1\u751f\u4ea7\u573a\u666f&#xff0c;\u4f46\u5bf9\u4e8e\u4e2a\u4eba\u4f7f\u7528\u3001\u6f14\u793a\u6216\u4f4e\u9891\u8bbf\u95ee\u7684Web\u670d\u52a1\u6765\u8bf4&#xff0c;\u662f\u5b8c\u5168\u53ef\u884c\u7684\u3002<\/p>\n<h4>4.3 \u4e0eGPU\u73af\u5883\u5bf9\u6bd4<\/h4>\n<p>\u4e3a\u4e86\u66f4\u5168\u9762&#xff0c;\u6211\u4eec\u5217\u51fa\u4e0eGPU\u73af\u5883\u7684\u9884\u671f\u5dee\u5f02&#xff1a;<\/p>\n<table>\n<tr>\u65b9\u9762CPU\u670d\u52a1\u5668 (\u672c\u6b21\u6d4b\u8bd5)\u5178\u578bGPU\u670d\u52a1\u5668 (\u9884\u671f)<\/tr>\n<tbody>\n<tr>\n<td>\u6a21\u578b\u52a0\u8f7d\u65f6\u95f4<\/td>\n<td>\u7ea630-60\u79d2<\/td>\n<td>\u7ea610-20\u79d2<\/td>\n<\/tr>\n<tr>\n<td>\u5355\u6b21\u63a8\u7406\u901f\u5ea6<\/td>\n<td>3-6\u79d2<\/td>\n<td>0.5-2\u79d2<\/td>\n<\/tr>\n<tr>\n<td>\u5e76\u53d1\u80fd\u529b<\/td>\n<td>\u5f31&#xff0c;\u987a\u5e8f\u5904\u7406\u4e3a\u5b9c<\/td>\n<td>\u5f3a&#xff0c;\u53ef\u5e76\u884c\u5904\u7406\u591a\u4e2a\u8bf7\u6c42<\/td>\n<\/tr>\n<tr>\n<td>\u786c\u4ef6\u6210\u672c<\/td>\n<td>\u6781\u4f4e&#xff08;\u5229\u7528\u73b0\u6709\u670d\u52a1\u5668&#xff09;<\/td>\n<td>\u9ad8&#xff08;\u9700\u8d2d\u7f6eGPU&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u80fd\u8017<\/td>\n<td>\u8f83\u4f4e<\/td>\n<td>\u8f83\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u573a\u666f<\/td>\n<td>\u4e2a\u4eba\u5b66\u4e60\u3001\u6f14\u793a\u3001\u4f4e\u9891\u5e94\u7528<\/td>\n<td>\u751f\u4ea7\u73af\u5883\u3001\u9ad8\u9891\u8bbf\u95ee\u3001\u5b9e\u65f6\u5e94\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>5. \u4f18\u5316\u5efa\u8bae\u4e0e\u6ce8\u610f\u4e8b\u9879<\/h3>\n<p>\u5982\u679c\u4f60\u4e5f\u6253\u7b97\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u7c7b\u4f3c\u6a21\u578b&#xff0c;\u8fd9\u91cc\u6709\u4e00\u4e9b\u5b9e\u7528\u5efa\u8bae&#xff1a;<\/p>\n<h4>5.1 \u6027\u80fd\u4f18\u5316\u5c0f\u6280\u5de7<\/h4>\n<li>\n<p>\u542f\u7528CPU\u52a0\u901f\u5e93&#xff1a;\u786e\u4fdd\u5b89\u88c5\u4e86openblas\u6216mkl\u7b49\u6570\u5b66\u5e93&#xff0c;PyTorch\u4f1a\u81ea\u52a8\u8c03\u7528\u5b83\u4eec\u52a0\u901f\u8ba1\u7b97\u3002<\/p>\n<p> sudo apt install libopenblas-dev\n <\/li>\n<li>\n<p>\u8c03\u6574\u751f\u6210\u53c2\u6570&#xff1a;\u5728model.generate()\u51fd\u6570\u4e2d&#xff0c;\u51cf\u5c11max_new_tokens&#xff08;\u5982\u4ece64\u51cf\u523048&#xff09;\u80fd\u76f4\u63a5\u7f29\u77ed\u751f\u6210\u65f6\u95f4\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u91cf\u5316\u6a21\u578b&#xff08;\u5982\u679c\u53ef\u7528&#xff09;&#xff1a;\u5982\u679c\u6a21\u578b\u63d0\u4f9bINT8\u91cf\u5316\u7248\u672c&#xff0c;\u52a0\u8f7d\u5b83\u80fd\u5728\u51e0\u4e4e\u4e0d\u635f\u5931\u7cbe\u5ea6\u7684\u60c5\u51b5\u4e0b\u663e\u8457\u964d\u4f4e\u5185\u5b58\u5360\u7528\u548c\u63d0\u5347\u901f\u5ea6\u3002\u5728\u52a0\u8f7d\u65f6\u5c1d\u8bd5&#xff1a;<\/p>\n<p> model &#061; AutoModelForCausalLM.from_pretrained(model_dir, load_in_8bit&#061;True, device_map&#061;&#039;cpu&#039;)<\/p>\n<p>&#xff08;\u6ce8\u610f&#xff1a;\u8fd9\u9700\u8981\u6a21\u578b\u672c\u8eab\u652f\u6301&#xff0c;\u4e14bitsandbytes\u5e93\u53ef\u80fd\u4e0d\u5b8c\u5584\u652f\u6301CPU&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u589e\u52a0Swap\u7a7a\u95f4&#xff1a;\u5982\u679c\u7269\u7406\u5185\u5b58\u8f83\u5c0f&#xff08;\u59828GB&#xff09;&#xff0c;\u53ef\u4ee5\u9002\u5f53\u589e\u52a0Swap\u7a7a\u95f4&#xff0c;\u9632\u6b62\u5185\u5b58\u4e0d\u8db3\u5bfc\u81f4\u8fdb\u7a0b\u88ab\u7ec8\u6b62\u3002<\/p>\n<p> # \u521b\u5efa\u4e00\u4e2a4GB\u7684Swap\u6587\u4ef6<br \/>\nsudo fallocate -l 4G \/swapfile<br \/>\nsudo chmod 600 \/swapfile<br \/>\nsudo mkswap \/swapfile<br \/>\nsudo swapon \/swapfile<br \/>\n# \u6c38\u4e45\u751f\u6548\u9700\u5199\u5165\/etc\/fstab\n <\/li>\n<h4>5.2 \u7a33\u5b9a\u6027\u4fdd\u969c<\/h4>\n<li>\u8bbe\u7f6e\u8d85\u65f6\u4e0e\u91cd\u8bd5&#xff1a;\u5728Web\u670d\u52a1\u5c42&#xff08;\u5982\u7528Nginx\u53cd\u5411\u4ee3\u7406&#xff09;\u6216\u5e94\u7528\u4ee3\u7801\u4e2d&#xff0c;\u4e3a\u751f\u6210\u8bf7\u6c42\u8bbe\u7f6e\u5408\u7406\u7684\u8d85\u65f6&#xff08;\u598230\u79d2&#xff09;&#xff0c;\u907f\u514d\u957f\u65f6\u95f4\u7b49\u5f85\u3002<\/li>\n<li>\u76d1\u63a7\u8d44\u6e90\u4f7f\u7528&#xff1a;\u4f7f\u7528\u7b80\u5355\u7684\u811a\u672c\u76d1\u63a7\u5185\u5b58\u548cCPU&#xff0c;\u63a5\u8fd1\u9608\u503c\u65f6\u6682\u505c\u65b0\u8bf7\u6c42\u6216\u8fd4\u56de\u53cb\u597d\u9519\u8bef\u3002<\/li>\n<li>\u5b9a\u671f\u91cd\u542f\u670d\u52a1&#xff1a;\u957f\u671f\u8fd0\u884c\u540e&#xff0c;Python\u8fdb\u7a0b\u53ef\u80fd\u5185\u5b58\u589e\u957f\u3002\u53ef\u4ee5\u8bbe\u7f6e\u5b9a\u65f6\u4efb\u52a1&#xff08;Cron&#xff09;\u5728\u4f4e\u5cf0\u671f\u91cd\u542f\u670d\u52a1\u3002<\/li>\n<h4>5.3 \u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u4e0e\u89e3\u51b3<\/h4>\n<ul>\n<li>\n<p>\u95ee\u9898&#xff1a;\u201cKilled\u201d \u8fdb\u7a0b\u88ab\u7cfb\u7edf\u7ec8\u6b62\u3002<\/p>\n<ul>\n<li>\u539f\u56e0&#xff1a;\u5185\u5b58\u4e0d\u8db3&#xff08;OOM&#xff09;\u3002<\/li>\n<li>\u89e3\u51b3&#xff1a;\u68c0\u67e5\u5185\u5b58\u548cSwap\u4f7f\u7528&#xff0c;\u589e\u52a0Swap\u7a7a\u95f4&#xff0c;\u6216\u5c1d\u8bd5\u4f7f\u7528\u66f4\u5c0f\u7684\u6a21\u578b&#xff08;\u5982\u679c\u5b58\u5728&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u95ee\u9898&#xff1a;\u751f\u6210\u901f\u5ea6\u5f02\u5e38\u6162&#xff08;&gt;30\u79d2&#xff09;\u3002<\/p>\n<ul>\n<li>\u539f\u56e0&#xff1a;CPU\u9891\u7387\u8fc7\u4f4e\u6216\u6563\u70ed\u4e0d\u4f73\u5bfc\u81f4\u964d\u9891\u3002<\/li>\n<li>\u89e3\u51b3&#xff1a;\u68c0\u67e5CPU\u6e29\u5ea6\u548c\u4f7f\u7528\u7387&#xff0c;\u786e\u4fdd\u670d\u52a1\u5668\u6563\u70ed\u826f\u597d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u95ee\u9898&#xff1a;\u65e0\u6cd5\u4eceModelScope\u4e0b\u8f7d\u6a21\u578b\u3002<\/p>\n<ul>\n<li>\u89e3\u51b3&#xff1a;\u5c1d\u8bd5\u8bbe\u7f6e\u56fd\u5185\u955c\u50cf\u6e90\u3002pip install modelscope -i https:\/\/mirror.sjtu.edu.cn\/pypi\/web\/simple<br \/>\n \u6216\u8005&#xff0c;\u624b\u52a8\u4eceHugging Face\u7b49\u6e90\u4e0b\u8f7d\u6a21\u578b\u6587\u4ef6&#xff0c;\u5e76\u653e\u7f6e\u5230\u5bf9\u5e94\u76ee\u5f55\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>6. \u603b\u7ed3<\/h3>\n<p>\u901a\u8fc7\u672c\u6b21\u4ece\u96f6\u5f00\u59cb\u7684\u90e8\u7f72\u4e0e\u6d4b\u8bd5&#xff0c;\u6211\u4eec\u9a8c\u8bc1\u4e86\u4e00\u4e2a\u91cd\u8981\u7ed3\u8bba&#xff1a;\u8fbe\u6469\u9662PALM\u6625\u8054\u751f\u6210\u6a21\u578b\u5b8c\u5168\u53ef\u4ee5\u5728\u65e0GPU\u7684\u4f4e\u914dCPU\u670d\u52a1\u5668\u4e0a\u6210\u529f\u90e8\u7f72\u5e76\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>\n<p>\u6838\u5fc3\u6536\u83b7&#xff1a;<\/p>\n<li>\u53ef\u884c\u6027\u786e\u8ba4&#xff1a;\u65e0\u9700\u6602\u8d35\u663e\u5361&#xff0c;\u5229\u7528\u73b0\u6709\u7684\u6216\u4f4e\u6210\u672c\u7684CPU\u670d\u52a1\u5668&#xff0c;\u5373\u53ef\u4f53\u9a8c\u524d\u6cbf\u7684AI\u5927\u6a21\u578b\u5e94\u7528\u3002\u751f\u6210\u4e00\u526f\u6625\u8054\u4ec5\u9700\u6570\u79d2&#xff0c;\u6ee1\u8db3\u4e2a\u4eba\u6216\u5c0f\u8303\u56f4\u4f7f\u7528\u9700\u6c42\u3002<\/li>\n<li>\u6210\u672c\u4f18\u52bf\u663e\u8457&#xff1a;\u7701\u53bb\u4e86GPU\u786c\u4ef6\u7684\u9ad8\u6602\u8d2d\u7f6e\u4e0e\u8fd0\u7ef4\u6210\u672c&#xff0c;\u8ba9AI\u6a21\u578b\u7684\u95e8\u69db\u5927\u5e45\u964d\u4f4e\u3002<\/li>\n<li>\u5b8c\u6574\u7684\u5b9e\u8df5\u8def\u5f84&#xff1a;\u672c\u6587\u63d0\u4f9b\u4e86\u4ece\u73af\u5883\u68c0\u67e5\u3001\u4f9d\u8d56\u5b89\u88c5\u3001\u6a21\u578b\u52a0\u8f7d\u3001\u4ee3\u7801\u7f16\u5199\u5230\u670d\u52a1\u53d1\u5e03\u7684\u5b8c\u6574\u6b65\u9aa4&#xff0c;\u4f60\u53ef\u4ee5\u76f4\u63a5\u590d\u73b0\u3002<\/li>\n<li>\u4f18\u5316\u7a7a\u95f4\u660e\u786e&#xff1a;\u901a\u8fc7\u8c03\u6574\u751f\u6210\u53c2\u6570\u3001\u786e\u4fdd\u7cfb\u7edf\u4f18\u5316&#xff0c;\u8fd8\u80fd\u8fdb\u4e00\u6b65\u63d0\u5347\u54cd\u5e94\u901f\u5ea6\u3002<\/li>\n<p>\u7ed9\u8bfb\u8005\u7684\u5efa\u8bae&#xff1a; \u5982\u679c\u4f60\u662f\u4e00\u540d\u5f00\u53d1\u8005\u3001\u5b66\u751f&#xff0c;\u6216\u8005\u53ea\u662f\u60f3\u5728\u516c\u53f8\u5185\u90e8\u670d\u52a1\u5668\u4e0a\u642d\u5efa\u4e00\u4e2a\u6709\u8da3\u7684AI\u5e94\u7528&#xff0c;\u8fd9\u4e2a\u65b9\u6848\u975e\u5e38\u9002\u5408\u4f60\u3002\u5b83\u8bc1\u660e\u4e86\u4e0d\u662f\u6240\u6709AI\u5e94\u7528\u90fd\u9700\u8981\u201c\u5927\u529b\u51fa\u5947\u8ff9\u201d\u7684\u7b97\u529b\u3002\u5bf9\u4e8e\u6625\u8054\u751f\u6210\u8fd9\u7c7b\u76f8\u5bf9\u8f7b\u91cf\u7684\u6587\u672c\u751f\u6210\u4efb\u52a1&#xff0c;CPU\u63a8\u7406\u662f\u4e00\u4e2a\u52a1\u5b9e\u4e14\u7ecf\u6d4e\u7684\u9009\u62e9\u3002<\/p>\n<p>\u4e0b\u6b21\u6625\u8282&#xff0c;\u5f53\u4f60\u9700\u8981\u4e00\u526f\u65b0\u9896\u7684\u6625\u8054\u65f6&#xff0c;\u6216\u8bb8\u53ef\u4ee5\u8bd5\u8bd5\u81ea\u5df1\u90e8\u7f72\u7684\u8fd9\u4e2aAI\u5c0f\u52a9\u624b\u3002\u5b83\u4e0d\u4ec5\u5e26\u6765\u4e86\u4fbf\u5229&#xff0c;\u66f4\u662f\u4e00\u6b21\u4eb2\u624b\u5c06AI\u6280\u672f\u843d\u5730\u7684\u6709\u8da3\u4f53\u9a8c\u3002<\/p>\n<hr \/>\n<p>\u83b7\u53d6\u66f4\u591aAI\u955c\u50cf<\/p>\n<p>\u60f3\u63a2\u7d22\u66f4\u591aAI\u955c\u50cf\u548c\u5e94\u7528\u573a\u666f&#xff1f;\u8bbf\u95ee CSDN\u661f\u56fe\u955c\u50cf\u5e7f\u573a&#xff0c;\u63d0\u4f9b\u4e30\u5bcc\u7684\u9884\u7f6e\u955c\u50cf&#xff0c;\u8986\u76d6\u5927\u6a21\u578b\u63a8\u7406\u3001\u56fe\u50cf\u751f\u6210\u3001\u89c6\u9891\u751f\u6210\u3001\u6a21\u578b\u5fae\u8c03\u7b49\u591a\u4e2a\u9886\u57df&#xff0c;\u652f\u6301\u4e00\u952e\u90e8\u7f72\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72&#xff1a;\u4f4e\u914dCPU\u670d\u52a1\u5668&#xff08;\u65e0GPU&#xff09;\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1<br \/>\n1. \u5f15\u8a00&#xff1a;\u5f53AI\u9047\u89c1\u4f20\u7edf\u5e74\u5473<br \/>\n\u6625\u8282\u8d34\u6625\u8054&#xff0c;\u662f\u523b\u5728\u6211\u4eec\u6587\u5316\u57fa\u56e0\u91cc\u7684\u4eea\u5f0f\u611f\u3002\u4f46\u6bcf\u5e74\u60f3\u4e00\u526f\u65e2\u5e94\u666f\u53c8\u6709\u65b0\u610f\u7684\u5bf9\u8054&#xff0c;\u5bf9\u4e0d\u5c11\u4eba\u6765\u8bf4\u662f\u4e2a\u5c0f\u96be\u9898\u3002\u73b0\u5728&#xff0c;\u8fbe\u6469\u9662AliceMind\u56e2\u961f\u628a\u8fd9\u4e8b\u513f\u4ea4\u7ed9\u4e86AI\u3002<br \/>\n\u4ed6\u4eec\u57fa\u4e8e\u5f3a\u5927\u7684PALM\u5927\u6a21\u578b&#xff0c;\u4e13\u95e8\u8bad\u7ec3\u4e86\u4e00\u4e2a\u201c\u6625\u8054\u751f\u6210\u6a21\u578b-\u4e2d\u6587-base\u201d\u3002\u4f60\u53ea\u9700\u8981\u8f93\u5165\u4e24\u4e2a\u5b57\u7684\u795d\u798f<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9281,9390,9391,224],"topic":[],"class_list":["post-83758","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-9390","tag-palm","tag-224"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72\uff1a\u4f4e\u914dCPU\u670d\u52a1\u5668\uff08\u65e0GPU\uff09\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/83758.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72\uff1a\u4f4e\u914dCPU\u670d\u52a1\u5668\uff08\u65e0GPU\uff09\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72&#xff1a;\u4f4e\u914dCPU\u670d\u52a1\u5668&#xff08;\u65e0GPU&#xff09;\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1 1. \u5f15\u8a00&#xff1a;\u5f53AI\u9047\u89c1\u4f20\u7edf\u5e74\u5473 \u6625\u8282\u8d34\u6625\u8054&#xff0c;\u662f\u523b\u5728\u6211\u4eec\u6587\u5316\u57fa\u56e0\u91cc\u7684\u4eea\u5f0f\u611f\u3002\u4f46\u6bcf\u5e74\u60f3\u4e00\u526f\u65e2\u5e94\u666f\u53c8\u6709\u65b0\u610f\u7684\u5bf9\u8054&#xff0c;\u5bf9\u4e0d\u5c11\u4eba\u6765\u8bf4\u662f\u4e2a\u5c0f\u96be\u9898\u3002\u73b0\u5728&#xff0c;\u8fbe\u6469\u9662AliceMind\u56e2\u961f\u628a\u8fd9\u4e8b\u513f\u4ea4\u7ed9\u4e86AI\u3002 \u4ed6\u4eec\u57fa\u4e8e\u5f3a\u5927\u7684PALM\u5927\u6a21\u578b&#xff0c;\u4e13\u95e8\u8bad\u7ec3\u4e86\u4e00\u4e2a\u201c\u6625\u8054\u751f\u6210\u6a21\u578b-\u4e2d\u6587-base\u201d\u3002\u4f60\u53ea\u9700\u8981\u8f93\u5165\u4e24\u4e2a\u5b57\u7684\u795d\u798f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/83758.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-25T20:08:37+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83758.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/83758.html\",\"name\":\"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72\uff1a\u4f4e\u914dCPU\u670d\u52a1\u5668\uff08\u65e0GPU\uff09\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-25T20:08:37+00:00\",\"dateModified\":\"2026-07-25T20:08:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/83758.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/83758.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83758.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72\uff1a\u4f4e\u914dCPU\u670d\u52a1\u5668\uff08\u65e0GPU\uff09\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72\uff1a\u4f4e\u914dCPU\u670d\u52a1\u5668\uff08\u65e0GPU\uff09\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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:\/\/www.wsisp.com\/helps\/83758.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72\uff1a\u4f4e\u914dCPU\u670d\u52a1\u5668\uff08\u65e0GPU\uff09\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72&#xff1a;\u4f4e\u914dCPU\u670d\u52a1\u5668&#xff08;\u65e0GPU&#xff09;\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1 1. \u5f15\u8a00&#xff1a;\u5f53AI\u9047\u89c1\u4f20\u7edf\u5e74\u5473 \u6625\u8282\u8d34\u6625\u8054&#xff0c;\u662f\u523b\u5728\u6211\u4eec\u6587\u5316\u57fa\u56e0\u91cc\u7684\u4eea\u5f0f\u611f\u3002\u4f46\u6bcf\u5e74\u60f3\u4e00\u526f\u65e2\u5e94\u666f\u53c8\u6709\u65b0\u610f\u7684\u5bf9\u8054&#xff0c;\u5bf9\u4e0d\u5c11\u4eba\u6765\u8bf4\u662f\u4e2a\u5c0f\u96be\u9898\u3002\u73b0\u5728&#xff0c;\u8fbe\u6469\u9662AliceMind\u56e2\u961f\u628a\u8fd9\u4e8b\u513f\u4ea4\u7ed9\u4e86AI\u3002 \u4ed6\u4eec\u57fa\u4e8e\u5f3a\u5927\u7684PALM\u5927\u6a21\u578b&#xff0c;\u4e13\u95e8\u8bad\u7ec3\u4e86\u4e00\u4e2a\u201c\u6625\u8054\u751f\u6210\u6a21\u578b-\u4e2d\u6587-base\u201d\u3002\u4f60\u53ea\u9700\u8981\u8f93\u5165\u4e24\u4e2a\u5b57\u7684\u795d\u798f","og_url":"https:\/\/www.wsisp.com\/helps\/83758.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-25T20:08:37+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/83758.html","url":"https:\/\/www.wsisp.com\/helps\/83758.html","name":"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72\uff1a\u4f4e\u914dCPU\u670d\u52a1\u5668\uff08\u65e0GPU\uff09\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-25T20:08:37+00:00","dateModified":"2026-07-25T20:08:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/83758.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/83758.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/83758.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8fbe\u6469\u9662PALM\u6625\u8054\u6a21\u578b\u90e8\u7f72\uff1a\u4f4e\u914dCPU\u670d\u52a1\u5668\uff08\u65e0GPU\uff09\u63a8\u7406\u53ef\u884c\u6027\u9a8c\u8bc1"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=83758"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83758\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=83758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=83758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=83758"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=83758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}