{"id":67351,"date":"2026-01-28T16:45:40","date_gmt":"2026-01-28T08:45:40","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/67351.html"},"modified":"2026-01-28T16:45:40","modified_gmt":"2026-01-28T08:45:40","slug":"%e3%80%90open-autoglm-macos%e9%83%a8%e7%bd%b2%e5%85%a8%e6%94%bb%e7%95%a5%e3%80%91%ef%bc%9a%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e6%9c%ac%e5%9c%b0%e8%bf%90%e8%a1%8c%e5%a4%a7%e6%a8%a1%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/67351.html","title":{"rendered":"\u3010Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u3011\uff1a\u624b\u628a\u624b\u6559\u4f60\u672c\u5730\u8fd0\u884c\u5927\u6a21\u578b\uff08\u5c0f\u767d\u4e5f\u80fd\u61c2\uff09"},"content":{"rendered":"<h3>\u7b2c\u4e00\u7ae0&#xff1a;Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u6982\u8ff0<\/h3>\n<p>Open-AutoGLM \u662f\u4e00\u6b3e\u57fa\u4e8e\u5f00\u6e90\u5927\u8bed\u8a00\u6a21\u578b\u7684\u81ea\u52a8\u5316\u4ee3\u7801\u751f\u6210\u5de5\u5177&#xff0c;\u4e13\u4e3a\u63d0\u5347\u5f00\u53d1\u6548\u7387\u800c\u8bbe\u8ba1\u3002\u5176\u5728 macOS \u5e73\u53f0\u4e0a\u7684\u672c\u5730\u5316\u90e8\u7f72\u6d89\u53ca\u73af\u5883\u914d\u7f6e\u3001\u4f9d\u8d56\u5b89\u88c5\u4e0e\u670d\u52a1\u542f\u52a8\u7b49\u591a\u4e2a\u5173\u952e\u73af\u8282\u3002\u672c\u7ae0\u5c06\u7cfb\u7edf\u6027\u5730\u4ecb\u7ecd\u90e8\u7f72\u524d\u7684\u51c6\u5907\u5de5\u4f5c\u4e0e\u6838\u5fc3\u6d41\u7a0b&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u642d\u5efa\u53ef\u8fd0\u884c\u73af\u5883\u3002<\/p>\n<h4>\u73af\u5883\u51c6\u5907<\/h4>\n<p>\u5728\u5f00\u59cb\u90e8\u7f72\u4e4b\u524d&#xff0c;\u9700\u786e\u4fdd\u7cfb\u7edf\u6ee1\u8db3\u4ee5\u4e0b\u57fa\u672c\u8981\u6c42&#xff1a;<\/p>\n<ul>\n<li>macOS 12.0 \u6216\u66f4\u9ad8\u7248\u672c<\/li>\n<li>Python 3.10&#043; \u53ca pip \u5305\u7ba1\u7406\u5668<\/li>\n<li>Git \u5de5\u5177\u7528\u4e8e\u514b\u9686\u9879\u76ee\u4ed3\u5e93<\/li>\n<li>\u81f3\u5c11 8GB \u53ef\u7528\u5185\u5b58&#xff08;\u63a8\u8350 16GB \u4ee5\u4e0a&#xff09;<\/li>\n<\/ul>\n<h4>\u4f9d\u8d56\u5b89\u88c5<\/h4>\n<p>\u901a\u8fc7\u7ec8\u7aef\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u5fc5\u8981\u4f9d\u8d56&#xff1a;<br \/>\n# \u514b\u9686 Open-AutoGLM \u9879\u76ee\u4ed3\u5e93<br \/>\ngit clone https:\/\/github.com\/example\/Open-AutoGLM.git<br \/>\ncd Open-AutoGLM<\/p>\n<p># \u521b\u5efa\u865a\u62df\u73af\u5883\u5e76\u6fc0\u6d3b<br \/>\npython -m venv venv<br \/>\nsource venv\/bin\/activate<\/p>\n<p># \u5b89\u88c5 Python \u4f9d\u8d56\u5305<br \/>\npip install -r requirements.txt<\/p>\n<p>\u4e0a\u8ff0\u811a\u672c\u9996\u5148\u62c9\u53d6\u6e90\u7801&#xff0c;\u968f\u540e\u5efa\u7acb\u9694\u79bb\u7684 Python \u73af\u5883\u4ee5\u907f\u514d\u4f9d\u8d56\u51b2\u7a81&#xff0c;\u6700\u540e\u6279\u91cf\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u5e93\u6587\u4ef6\u3002<\/p>\n<h4>\u914d\u7f6e\u53c2\u6570\u8bf4\u660e<\/h4>\n<p>\u90e8\u5206\u5173\u952e\u914d\u7f6e\u9879\u53ef\u901a\u8fc7 config.yaml \u6587\u4ef6\u8c03\u6574&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u53c2\u6570\u540d\u9ed8\u8ba4\u503c\u8bf4\u660e<\/tr>\n<tr>\n<td>host<\/td>\n<td>127.0.0.1<\/td>\n<td>\u670d\u52a1\u76d1\u542c\u5730\u5740<\/td>\n<\/tr>\n<tr>\n<td>port<\/td>\n<td>8080<\/td>\n<td>HTTP \u670d\u52a1\u7aef\u53e3<\/td>\n<\/tr>\n<tr>\n<td>model_path<\/td>\n<td>.\/models\/glm-small<\/td>\n<td>\u672c\u5730\u6a21\u578b\u5b58\u50a8\u8def\u5f84<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u542f\u52a8\u670d\u52a1<\/h4>\n<p>\u5b8c\u6210\u914d\u7f6e\u540e&#xff0c;\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u670d\u52a1&#xff1a;<br \/>\n# \u542f\u52a8\u4e3b\u670d\u52a1\u7a0b\u5e8f<br \/>\npython app.py &#8211;config config.yaml<\/p>\n<p>\u6267\u884c\u540e&#xff0c;\u82e5\u7ec8\u7aef\u8f93\u51fa &#034;Server running on http:\/\/127.0.0.1:8080&#034;&#xff0c;\u5219\u8868\u793a\u90e8\u7f72\u6210\u529f&#xff0c;\u53ef\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee Web \u754c\u9762\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n<h3>\u7b2c\u4e8c\u7ae0&#xff1a;\u73af\u5883\u51c6\u5907\u4e0e\u57fa\u7840\u914d\u7f6e<\/h3>\n<h4>2.1 \u7406\u89e3Open-AutoGLM\u67b6\u6784\u4e0emacOS\u517c\u5bb9\u6027<\/h4>\n<p>Open-AutoGLM \u662f\u4e00\u4e2a\u9762\u5411\u81ea\u52a8\u5316\u81ea\u7136\u8bed\u8a00\u751f\u6210\u7684\u5f00\u6e90\u6846\u67b6&#xff0c;\u5176\u6838\u5fc3\u91c7\u7528\u6a21\u5757\u5316\u8bbe\u8ba1&#xff0c;\u652f\u6301\u8de8\u5e73\u53f0\u90e8\u7f72\u3002\u5728 macOS \u7cfb\u7edf\u4e2d&#xff0c;\u5f97\u76ca\u4e8e Unix \u57fa\u7840\u4e0e Homebrew \u5305\u7ba1\u7406\u5668\u7684\u652f\u6301&#xff0c;\u80fd\u591f\u9ad8\u6548\u8fd0\u884c\u8be5\u67b6\u6784\u3002<\/p>\n<h5>\u67b6\u6784\u6838\u5fc3\u7ec4\u4ef6<\/h5>\n<ul>\n<li>Tokenizer Engine&#xff1a;\u8d1f\u8d23\u6587\u672c\u5206\u8bcd\u4e0e\u7f16\u7801<\/li>\n<li>Model Dispatcher&#xff1a;\u52a8\u6001\u52a0\u8f7d GLM \u53d8\u4f53\u6a21\u578b<\/li>\n<li>System Adapter&#xff1a;\u9002\u914d\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf API \u8c03\u7528<\/li>\n<\/ul>\n<h5>macOS \u517c\u5bb9\u6027\u914d\u7f6e<\/h5>\n<p># \u5b89\u88c5\u4f9d\u8d56\u5e76\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<br \/>\nexport OPEN_AUTOGGLM_BACKEND&#061;metal  # \u542f\u7528 Apple Metal \u52a0\u901f<br \/>\nexport PYTORCH_ENABLE_MPS_FALLBACK&#061;1<\/p>\n<p>\u4e0a\u8ff0\u914d\u7f6e\u542f\u7528 macOS \u7684 MPS&#xff08;Metal Performance Shaders&#xff09;\u540e\u7aef&#xff0c;\u4f7f\u6a21\u578b\u63a8\u7406\u5728 M \u7cfb\u5217\u82af\u7247\u4e0a\u83b7\u5f97\u786c\u4ef6\u52a0\u901f\u652f\u6301&#xff0c;\u663e\u8457\u63d0\u5347\u54cd\u5e94\u901f\u5ea6\u5e76\u964d\u4f4e CPU \u8d1f\u8f7d\u3002<\/p>\n<h4>2.2 \u5b89\u88c5Homebrew\u4e0eXcode\u547d\u4ee4\u884c\u5de5\u5177<\/h4>\n<p>\u5728macOS\u7cfb\u7edf\u4e2d&#xff0c;Homebrew\u662f\u7ba1\u7406\u5f00\u53d1\u4f9d\u8d56\u7684\u6838\u5fc3\u5305\u7ba1\u7406\u5668&#xff0c;\u800cXcode\u547d\u4ee4\u884c\u5de5\u5177\u5219\u662f\u7f16\u8bd1\u672c\u5730\u6269\u5c55\u7684\u57fa\u7840\u7ec4\u4ef6\u3002<\/p>\n<h5>\u5b89\u88c5Xcode\u547d\u4ee4\u884c\u5de5\u5177<\/h5>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ec5\u5b89\u88c5\u5fc5\u8981\u5de5\u5177&#xff0c;\u65e0\u9700\u4e0b\u8f7d\u5b8c\u6574Xcode&#xff1a;<br \/>\nxcode-select &#8211;install<br \/>\n\u8be5\u6307\u4ee4\u4f1a\u89e6\u53d1\u7cfb\u7edf\u5f39\u7a97&#xff0c;\u5f15\u5bfc\u5b8c\u6210\u7f16\u8bd1\u5668&#xff08;\u5982clang&#xff09;\u3001make\u548cgit\u7b49\u6838\u5fc3\u5de5\u5177\u7684\u5b89\u88c5&#xff0c;\u4e3a\u540e\u7eed\u6784\u5efa\u63d0\u4f9b\u652f\u6301\u3002<\/p>\n<h5>\u5b89\u88c5Homebrew<\/h5>\n<p>\u901a\u8fc7\u5b98\u65b9\u811a\u672c\u4e00\u952e\u5b89\u88c5&#xff1a;<br \/>\n\/bin\/bash -c &#034;$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)&#034;<br \/>\n\u811a\u672c\u81ea\u52a8\u68c0\u6d4b\u73af\u5883&#xff0c;\u4e0b\u8f7dbrew\u6838\u5fc3\u6587\u4ef6&#xff0c;\u5e76\u914d\u7f6ePATH\u8def\u5f84\u3002\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u53ef\u901a\u8fc7brew &#8211;version\u9a8c\u8bc1\u3002<\/p>\n<ul>\n<li>Homebrew\u5c06\u8f6f\u4ef6\u5305\u5b89\u88c5\u81f3\/opt\/homebrew&#xff08;Apple Silicon&#xff09;\u6216\/usr\/local&#xff08;Intel&#xff09;<\/li>\n<li>\u652f\u6301Formula&#xff08;\u547d\u4ee4\u884c\u5de5\u5177&#xff09;\u4e0eCask&#xff08;\u56fe\u5f62\u5e94\u7528&#xff09;\u4e24\u7c7b\u7ba1\u7406\u65b9\u5f0f<\/li>\n<\/ul>\n<h4>2.3 \u914d\u7f6ePython\u865a\u62df\u73af\u5883\u4e0e\u4f9d\u8d56\u7ba1\u7406<\/h4>\n<p>\u5728\u9879\u76ee\u5f00\u53d1\u4e2d&#xff0c;\u9694\u79bb\u4e0d\u540c\u9879\u76ee\u7684\u4f9d\u8d56\u81f3\u5173\u91cd\u8981\u3002Python \u63d0\u4f9b\u4e86\u591a\u79cd\u5de5\u5177\u6765\u521b\u5efa\u865a\u62df\u73af\u5883\u5e76\u7ba1\u7406\u4f9d\u8d56&#xff0c;\u907f\u514d\u5305\u7248\u672c\u51b2\u7a81\u3002<\/p>\n<h5>\u4f7f\u7528 venv \u521b\u5efa\u865a\u62df\u73af\u5883<\/h5>\n<p>python -m venv myproject_env<br \/>\nsource myproject_env\/bin\/activate  # Linux\/macOS<br \/>\nmyproject_env\\\\Scripts\\\\activate     # Windows<\/p>\n<p>\u8be5\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u72ec\u7acb\u7684 Python \u8fd0\u884c\u73af\u5883&#xff0c;venv \u6a21\u5757\u751f\u6210\u5305\u542b Python \u89e3\u91ca\u5668\u526f\u672c\u548c\u72ec\u7acb\u5305\u76ee\u5f55\u7684\u6587\u4ef6\u5939&#xff0c;\u6fc0\u6d3b\u540e\u6240\u6709\u5b89\u88c5\u7684\u5305\u4ec5\u4f5c\u7528\u4e8e\u5f53\u524d\u73af\u5883\u3002<\/p>\n<h5>\u4f9d\u8d56\u7ba1\u7406\u4e0e requirements.txt<\/h5>\n<ul>\n<li>pip freeze &gt; requirements.txt&#xff1a;\u5bfc\u51fa\u5f53\u524d\u73af\u5883\u4f9d\u8d56\u5217\u8868<\/li>\n<li>pip install -r requirements.txt&#xff1a;\u6279\u91cf\u5b89\u88c5\u4f9d\u8d56<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u6587\u672c\u6587\u4ef6\u8bb0\u5f55\u7cbe\u786e\u7248\u672c\u53f7&#xff0c;\u786e\u4fdd\u56e2\u961f\u6210\u5458\u548c\u751f\u4ea7\u73af\u5883\u7684\u4e00\u81f4\u6027&#xff0c;\u63d0\u5347\u9879\u76ee\u53ef\u590d\u73b0\u6027\u3002<\/p>\n<h4>2.4 \u4e0b\u8f7d\u6a21\u578b\u6743\u91cd\u4e0e\u672c\u5730\u5b58\u50a8\u89c4\u5212<\/h4>\n<p>\u5728\u90e8\u7f72\u5927\u8bed\u8a00\u6a21\u578b\u524d&#xff0c;\u9700\u9884\u5148\u4e0b\u8f7d\u9884\u8bad\u7ec3\u6743\u91cd\u5e76\u5408\u7406\u89c4\u5212\u672c\u5730\u5b58\u50a8\u8def\u5f84\u3002\u63a8\u8350\u4f7f\u7528\u6a21\u578b\u5e93\u63d0\u4f9b\u7684\u547d\u4ee4\u884c\u5de5\u5177\u8fdb\u884c\u6743\u91cd\u83b7\u53d6\u3002<\/p>\n<p>huggingface-cli download Qwen\/Qwen-7B &#8211;local-dir .\/models\/qwen-7b<\/p>\n<p>\u4e0a\u8ff0\u547d\u4ee4\u901a\u8fc7 Hugging Face CLI \u5c06 Qwen-7B \u6a21\u578b\u6743\u91cd\u4e0b\u8f7d\u81f3\u672c\u5730 &#096;models\/qwen-7b&#096; \u76ee\u5f55\u3002&#096;&#8211;local-dir&#096; \u53c2\u6570\u6307\u5b9a\u672c\u5730\u5b58\u50a8\u8def\u5f84&#xff0c;\u4fbf\u4e8e\u540e\u7eed\u7edf\u4e00\u7ba1\u7406\u3002<\/p>\n<h5>\u5b58\u50a8\u76ee\u5f55\u7ed3\u6784\u5efa\u8bae<\/h5>\n<p>\u4e3a\u63d0\u5347\u53ef\u7ef4\u62a4\u6027&#xff0c;\u5efa\u8bae\u91c7\u7528\u5206\u5c42\u76ee\u5f55\u7ed3\u6784&#xff1a;<\/p>\n<ul>\n<li>models\/&#xff1a;\u6839\u76ee\u5f55<\/li>\n<li>models\/base\/&#xff1a;\u5b58\u653e\u57fa\u7840\u6a21\u578b\u6743\u91cd<\/li>\n<li>models\/fine-tuned\/&#xff1a;\u5b58\u653e\u5fae\u8c03\u540e\u6a21\u578b<\/li>\n<li>models\/cache\/&#xff1a;\u4e34\u65f6\u7f13\u5b58\u6587\u4ef6<\/li>\n<\/ul>\n<h5>\u78c1\u76d8\u7a7a\u95f4\u9884\u4f30<\/h5>\n<table border=\"1\" cellpadding=\"8\">\n<tbody>\n<tr>\u6a21\u578b\u89c4\u6a21FP16 \u5360\u7528\u7a7a\u95f4\u63a8\u8350\u53ef\u7528\u7a7a\u95f4<\/tr>\n<tr>\n<td>7B<\/td>\n<td>14 GB<\/td>\n<td>20 GB<\/td>\n<\/tr>\n<tr>\n<td>70B<\/td>\n<td>140 GB<\/td>\n<td>180 GB<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>2.5 \u542f\u7528Apple Silicon GPU\u52a0\u901f\u652f\u6301<\/h4>\n<p>Apple Silicon\u82af\u7247&#xff08;\u5982M1\u3001M1 Pro\u3001M1 Max&#xff09;\u96c6\u6210\u4e86\u9ad8\u6027\u80fdGPU&#xff0c;\u4e3amacOS\u548ciOS\u5e94\u7528\u63d0\u4f9b\u5f3a\u5927\u7684\u56fe\u5f62\u4e0e\u8ba1\u7b97\u52a0\u901f\u80fd\u529b\u3002\u901a\u8fc7Metal\u6846\u67b6&#xff0c;\u5f00\u53d1\u8005\u53ef\u76f4\u63a5\u8c03\u7528GPU\u8d44\u6e90&#xff0c;\u5b9e\u73b0\u9ad8\u6548\u7684\u5e76\u884c\u8ba1\u7b97\u3002<\/p>\n<h5>\u914d\u7f6eMetal\u8bbe\u5907\u73af\u5883<\/h5>\n<p>\u5728Swift\u4e2d\u521d\u59cb\u5316Metal\u8bbe\u5907\u7684\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>import Metal<\/p>\n<p>guard let device &#061; MTLCreateSystemDefaultDevice() else {<br \/>\n    print(&#034;Metal is not supported on this device&#034;)<br \/>\n    exit(1)<br \/>\n}<br \/>\nprint(&#034;Using Metal device: \\\\(device.name)&#034;)<\/p>\n<p>\u8be5\u4ee3\u7801\u5c1d\u8bd5\u83b7\u53d6\u7cfb\u7edf\u9ed8\u8ba4\u7684Metal\u8bbe\u5907\u3002\u82e5\u8fd4\u56denil&#xff0c;\u5219\u8868\u793a\u5f53\u524d\u8bbe\u5907\u4e0d\u652f\u6301Metal&#xff0c;\u5e38\u89c1\u4e8e\u865a\u62df\u673a\u6216\u8001\u65e7\u786c\u4ef6\u3002<\/p>\n<h5>\u542f\u7528GPU\u52a0\u901f\u7684\u5148\u51b3\u6761\u4ef6<\/h5>\n<ul>\n<li>\u8fd0\u884cmacOS 11.0\u6216\u66f4\u9ad8\u7248\u672c<\/li>\n<li>\u4f7f\u7528\u652f\u6301Metal Feature Set Level 2\u7684Apple Silicon\u82af\u7247<\/li>\n<li>Xcode 12\u53ca\u4ee5\u4e0a\u7248\u672c\u8fdb\u884c\u7f16\u8bd1\u90e8\u7f72<\/li>\n<\/ul>\n<p>\u53ea\u6709\u6ee1\u8db3\u4e0a\u8ff0\u6761\u4ef6&#xff0c;\u624d\u80fd\u5145\u5206\u53d1\u6325GPU\u5728\u673a\u5668\u5b66\u4e60\u3001\u56fe\u50cf\u5904\u7406\u7b49\u573a\u666f\u4e0b\u7684\u5e76\u884c\u8ba1\u7b97\u4f18\u52bf\u3002<\/p>\n<h3>\u7b2c\u4e09\u7ae0&#xff1a;\u6838\u5fc3\u7ec4\u4ef6\u5b89\u88c5\u4e0e\u9a8c\u8bc1<\/h3>\n<h4>3.1 \u5b89\u88c5AutoGPTQ\u4e0eTransformers\u5e93<\/h4>\n<p>\u5728\u91cf\u5316\u5927\u8bed\u8a00\u6a21\u578b\u65f6&#xff0c;AutoGPTQ \u662f\u4e00\u4e2a\u9ad8\u6548\u7684\u5de5\u5177\u5e93&#xff0c;\u4e13\u7528\u4e8e\u5bf9\u57fa\u4e8e Transformers \u67b6\u6784\u7684\u6a21\u578b\u8fdb\u884c GPTQ \u91cf\u5316\u3002\u9996\u5148\u9700\u5b89\u88c5\u6838\u5fc3\u4f9d\u8d56\u3002<\/p>\n<h5>\u73af\u5883\u51c6\u5907\u4e0e\u5b89\u88c5\u547d\u4ee4<\/h5>\n<p>\u4f7f\u7528 pip \u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684 transformers \u548c auto-gptq&#xff1a;<\/p>\n<p>pip install transformers<br \/>\npip install auto-gptq<\/p>\n<p>\u4e0a\u8ff0\u547d\u4ee4\u5c06\u5b89\u88c5 Hugging Face \u63d0\u4f9b\u7684 Transformers \u5e93&#xff0c;\u4ee5\u53ca\u652f\u6301\u6a21\u578b\u91cf\u5316\u63a8\u7406\u7684 AutoGPTQ\u3002\u6ce8\u610f&#xff0c;AutoGPTQ \u8981\u6c42 CUDA \u73af\u5883\u4ee5\u542f\u7528 GPU \u52a0\u901f&#xff0c;\u63a8\u8350\u4f7f\u7528 NVIDIA \u663e\u5361\u5e76\u914d\u7f6e\u597d cuDNN\u3002<\/p>\n<h5>\u9a8c\u8bc1\u5b89\u88c5\u7ed3\u679c<\/h5>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u53ef\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u7247\u6bb5\u9a8c\u8bc1\u73af\u5883\u662f\u5426\u5c31\u7eea&#xff1a;<\/p>\n<p>from auto_gptq import AutoGPTQForCausalLM<br \/>\nimport transformers<\/p>\n<p>print(&#034;AutoGPTQ and Transformers imported successfully.&#034;)<\/p>\n<p>\u82e5\u65e0\u62a5\u9519&#xff0c;\u5219\u8868\u660e\u5e93\u5df2\u6b63\u786e\u5b89\u88c5&#xff0c;\u53ef\u8fdb\u5165\u540e\u7eed\u6a21\u578b\u52a0\u8f7d\u4e0e\u91cf\u5316\u6d41\u7a0b\u3002<\/p>\n<h4>3.2 \u90e8\u7f72Open-AutoGLM\u8fd0\u884c\u65f6\u73af\u5883<\/h4>\n<p>\u90e8\u7f72Open-AutoGLM\u8fd0\u884c\u65f6\u73af\u5883\u9700\u9996\u5148\u786e\u4fdd\u7cfb\u7edf\u5177\u5907Python 3.9&#043;\u53caCUDA 11.8\u4ee5\u4e0a\u7248\u672c\u652f\u6301\u3002\u63a8\u8350\u4f7f\u7528\u865a\u62df\u73af\u5883\u9694\u79bb\u4f9d\u8d56&#xff0c;\u907f\u514d\u7248\u672c\u51b2\u7a81\u3002<\/p>\n<h5>\u73af\u5883\u51c6\u5907\u4e0e\u4f9d\u8d56\u5b89\u88c5<\/h5>\n<ul>\n<li>\u5b89\u88c5Miniconda\u4ee5\u7ba1\u7406Python\u73af\u5883<\/li>\n<li>\u521b\u5efa\u72ec\u7acb\u73af\u5883&#xff1a;conda create -n autoglm python&#061;3.9<\/li>\n<li>\u6fc0\u6d3b\u73af\u5883\u5e76\u5b89\u88c5\u6838\u5fc3\u4f9d\u8d56<\/li>\n<\/ul>\n<p>pip install torch&#061;&#061;1.13.1&#043;cu118 -f https:\/\/download.pytorch.org\/whl\/torch_stable.html<br \/>\npip install open-autoglm transformers accelerate<\/p>\n<p>\u4e0a\u8ff0\u547d\u4ee4\u5b89\u88c5\u4e86\u652f\u6301CUDA\u52a0\u901f\u7684PyTorch\u7248\u672c&#xff0c;\u5e76\u5f15\u5165\u81ea\u52a8\u5e76\u884c\u63a8\u7406\u6846\u67b6Accelerate&#xff0c;\u63d0\u5347\u5927\u89c4\u6a21\u6a21\u578b\u8fd0\u884c\u6548\u7387\u3002<\/p>\n<h5>\u786c\u4ef6\u517c\u5bb9\u6027\u8981\u6c42<\/h5>\n<table>\n<tbody>\n<tr>\u7ec4\u4ef6\u6700\u4f4e\u8981\u6c42\u63a8\u8350\u914d\u7f6e<\/tr>\n<tr>\n<td>GPU<\/td>\n<td>RTX 3060 12GB<\/td>\n<td>A100 40GB<\/td>\n<\/tr>\n<tr>\n<td>\u5185\u5b58<\/td>\n<td>16GB<\/td>\n<td>32GB&#043;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>3.3 \u9a8c\u8bc1\u6a21\u578b\u52a0\u8f7d\u4e0e\u63a8\u7406\u529f\u80fd<\/h4>\n<h5>\u6a21\u578b\u52a0\u8f7d\u6d41\u7a0b\u9a8c\u8bc1<\/h5>\n<p>\u5728\u5b8c\u6210\u6a21\u578b\u6301\u4e45\u5316\u540e&#xff0c;\u9700\u786e\u4fdd\u5176\u53ef\u88ab\u6b63\u786e\u52a0\u8f7d\u5e76\u6062\u590d\u8ba1\u7b97\u56fe\u7ed3\u6784\u3002\u4f7f\u7528 PyTorch \u63d0\u4f9b\u7684 torch.load() \u65b9\u6cd5\u4ece\u78c1\u76d8\u8bfb\u53d6\u6a21\u578b\u6743\u91cd\u6587\u4ef6&#xff0c;\u5e76\u901a\u8fc7 model.load_state_dict() \u6062\u590d\u53c2\u6570\u3002<\/p>\n<p># \u52a0\u8f7d\u9884\u8bad\u7ec3\u6a21\u578b<br \/>\nmodel &#061; MyModel()<br \/>\nmodel.load_state_dict(torch.load(&#039;model.pth&#039;))<br \/>\nmodel.eval()  # \u5207\u6362\u4e3a\u8bc4\u4f30\u6a21\u5f0f<\/p>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u4e2d&#xff0c;eval() \u65b9\u6cd5\u5173\u95ed\u4e86\u5982 Dropout \u7b49\u8bad\u7ec3\u4e13\u7528\u64cd\u4f5c&#xff0c;\u786e\u4fdd\u63a8\u7406\u4e00\u81f4\u6027\u3002<\/p>\n<h5>\u6267\u884c\u524d\u5411\u63a8\u7406\u6d4b\u8bd5<\/h5>\n<p>\u6784\u9020\u7b26\u5408\u8f93\u5165\u7ef4\u5ea6\u7684\u5f20\u91cf\u8fdb\u884c\u63a8\u7406\u9a8c\u8bc1&#xff1a;<\/p>\n<p>with torch.no_grad():<br \/>\n    output &#061; model(torch.randn(1, 784))<br \/>\nprint(output.shape)  # \u5e94\u8f93\u51fa [1, 10]<\/p>\n<p>\u8be5\u8fc7\u7a0b\u9a8c\u8bc1\u4e86\u6a21\u578b\u7ed3\u6784\u5b8c\u6574\u6027\u4e0e\u63a8\u7406\u8f93\u51fa\u7684\u5408\u6cd5\u6027&#xff0c;\u662f\u90e8\u7f72\u524d\u7684\u5173\u952e\u68c0\u67e5\u70b9\u3002<\/p>\n<h3>\u7b2c\u56db\u7ae0&#xff1a;\u6a21\u578b\u8c03\u4f18\u4e0e\u4ea4\u4e92\u5e94\u7528<\/h3>\n<h4>4.1 \u8c03\u6574\u4e0a\u4e0b\u6587\u957f\u5ea6\u4e0e\u91cf\u5316\u53c2\u6570<\/h4>\n<p>\u5728\u5927\u8bed\u8a00\u6a21\u578b\u90e8\u7f72\u4e2d&#xff0c;\u8c03\u6574\u4e0a\u4e0b\u6587\u957f\u5ea6\u4e0e\u91cf\u5316\u53c2\u6570\u662f\u4f18\u5316\u63a8\u7406\u6027\u80fd\u7684\u5173\u952e\u6b65\u9aa4\u3002\u589e\u5927\u4e0a\u4e0b\u6587\u957f\u5ea6\u53ef\u63d0\u5347\u6a21\u578b\u5bf9\u957f\u6587\u672c\u7684\u7406\u89e3\u80fd\u529b&#xff0c;\u4f46\u4f1a\u663e\u8457\u589e\u52a0\u663e\u5b58\u5360\u7528\u548c\u8ba1\u7b97\u5ef6\u8fdf\u3002<\/p>\n<h5>\u4e0a\u4e0b\u6587\u957f\u5ea6\u914d\u7f6e\u793a\u4f8b<\/h5>\n<p># \u8bbe\u7f6e\u6700\u5927\u4e0a\u4e0b\u6587\u957f\u5ea6\u4e3a8192<br \/>\nmodel.config.max_position_embeddings &#061; 8192<\/p>\n<p># \u63a8\u7406\u65f6\u6307\u5b9a\u5e8f\u5217\u957f\u5ea6<br \/>\ntokenizer.model_max_length &#061; 8192<\/p>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u901a\u8fc7\u4fee\u6539\u6a21\u578b\u914d\u7f6e\u548c\u5206\u8bcd\u5668\u53c2\u6570&#xff0c;\u6269\u5c55\u652f\u6301\u66f4\u957f\u8f93\u5165\u3002\u9700\u6ce8\u610f\u786c\u4ef6\u8d44\u6e90\u662f\u5426\u8db3\u4ee5\u652f\u6491\u957f\u5e8f\u5217\u7684\u6ce8\u610f\u529b\u8ba1\u7b97\u3002<\/p>\n<h5>\u91cf\u5316\u7b56\u7565\u5bf9\u6bd4<\/h5>\n<table>\n<tbody>\n<tr>\u91cf\u5316\u7c7b\u578b\u7cbe\u5ea6\u663e\u5b58\u8282\u7701<\/tr>\n<tr>\n<td>F16<\/td>\n<td>\u534a\u7cbe\u5ea6<\/td>\n<td>~50%<\/td>\n<\/tr>\n<tr>\n<td>Q8<\/td>\n<td>8\u4f4d\u6574\u6570<\/td>\n<td>~75%<\/td>\n<\/tr>\n<tr>\n<td>Q4<\/td>\n<td>4\u4f4d\u6574\u6570<\/td>\n<td>~87.5%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7ed3\u5408\u4f7f\u7528\u957f\u4e0a\u4e0b\u6587\u4e0e\u4f4e\u6bd4\u7279\u91cf\u5316&#xff0c;\u53ef\u5728\u4fdd\u6301\u751f\u6210\u8d28\u91cf\u7684\u540c\u65f6\u5b9e\u73b0\u9ad8\u6548\u90e8\u7f72\u3002<\/p>\n<h4>4.2 \u6784\u5efa\u672c\u5730API\u63a5\u53e3\u5b9e\u73b0\u5bf9\u8bdd\u4ea4\u4e92<\/h4>\n<p>\u4e3a\u4e86\u5728\u672c\u5730\u73af\u5883\u4e2d\u5b9e\u73b0\u7a33\u5b9a\u7684\u5bf9\u8bdd\u4ea4\u4e92&#xff0c;\u9996\u5148\u9700\u8981\u6784\u5efa\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684API\u670d\u52a1\u3002\u4f7f\u7528Python\u7684Flask\u6846\u67b6\u53ef\u5feb\u901f\u642d\u5efaHTTP\u63a5\u53e3&#xff0c;\u63a5\u6536\u524d\u7aef\u6216\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u7528\u6237\u8f93\u5165&#xff0c;\u5e76\u8fd4\u56de\u6a21\u578b\u751f\u6210\u7684\u54cd\u5e94\u3002<\/p>\n<h5>\u57fa\u7840API\u8def\u7531\u8bbe\u8ba1<\/h5>\n<p>from flask import Flask, request, jsonify<\/p>\n<p>app &#061; Flask(__name__)<\/p>\n<p>&#064;app.route(&#034;\/chat&#034;, methods&#061;[&#034;POST&#034;])<br \/>\ndef chat():<br \/>\n    data &#061; request.json<br \/>\n    user_input &#061; data.get(&#034;message&#034;, &#034;&#034;)<br \/>\n    # \u6a21\u62df\u6a21\u578b\u54cd\u5e94<br \/>\n    response &#061; {&#034;reply&#034;: f&#034;\u4f60\u8bf4\u4e86&#xff1a;{user_input}&#034;}<br \/>\n    return jsonify(response)<\/p>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u5b9a\u4e49\u4e86\u4e00\u4e2aPOST\u63a5\u53e3\/chat&#xff0c;\u63a5\u6536JSON\u683c\u5f0f\u7684\u6d88\u606f\u5b57\u6bb5&#xff0c;\u6a21\u62df\u751f\u6210\u56de\u590d\u3002\u53c2\u6570user_input\u901a\u8fc7request.json\u63d0\u53d6&#xff0c;\u786e\u4fdd\u6570\u636e\u5b89\u5168\u89e3\u6790\u3002<\/p>\n<h5>\u8bf7\u6c42\u4e0e\u54cd\u5e94\u7ed3\u6784<\/h5>\n<table>\n<tbody>\n<tr>\u5b57\u6bb5\u7c7b\u578b\u8bf4\u660e<\/tr>\n<tr>\n<td>message<\/td>\n<td>string<\/td>\n<td>\u7528\u6237\u8f93\u5165\u6587\u672c<\/td>\n<\/tr>\n<tr>\n<td>reply<\/td>\n<td>string<\/td>\n<td>\u7cfb\u7edf\u8fd4\u56de\u7684\u5bf9\u8bdd\u5185\u5bb9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>4.3 \u4f7f\u7528Llama.cpp\u4f18\u5316\u63a8\u7406\u6027\u80fd<\/h4>\n<h5>\u8f7b\u91cf\u7ea7\u63a8\u7406\u6846\u67b6\u7684\u4f18\u52bf<\/h5>\n<p>Llama.cpp \u662f\u57fa\u4e8e C&#043;&#043; \u5b9e\u73b0\u7684\u9ad8\u6548\u5927\u6a21\u578b\u63a8\u7406\u5f15\u64ce&#xff0c;\u4e13\u4e3a CPU \u73af\u5883\u4f18\u5316\u3002\u5176\u6838\u5fc3\u4f18\u52bf\u5728\u4e8e\u65e0\u9700\u4f9d\u8d56 GPU&#xff0c;\u5373\u53ef\u5b9e\u73b0\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u541e\u5410\u7684\u672c\u5730\u63a8\u7406&#xff0c;\u9002\u7528\u4e8e\u8fb9\u7f18\u8bbe\u5907\u548c\u8d44\u6e90\u53d7\u9650\u573a\u666f\u3002<\/p>\n<h5>\u91cf\u5316\u6a21\u578b\u63d0\u5347\u6027\u80fd<\/h5>\n<p>\u901a\u8fc7\u91cf\u5316\u6280\u672f\u964d\u4f4e\u6a21\u578b\u7cbe\u5ea6&#xff08;\u5982 4-bit \u6216 8-bit&#xff09;&#xff0c;\u663e\u8457\u51cf\u5c11\u5185\u5b58\u5360\u7528\u5e76\u52a0\u901f\u8ba1\u7b97\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u53ef\u52a0\u8f7d\u91cf\u5316\u6a21\u578b\u8fdb\u884c\u63a8\u7406&#xff1a;<\/p>\n<p>.\/main -m models\/llama-2-7b.Q4_K_M.gguf -p &#034;Hello, world!&#034; -n 128<\/p>\n<p>\u53c2\u6570\u8bf4\u660e&#xff1a;&#096;-m&#096; \u6307\u5b9a\u6a21\u578b\u8def\u5f84&#xff0c;&#096;-p&#096; \u8f93\u5165\u63d0\u793a\u6587\u672c&#xff0c;&#096;-n&#096; \u63a7\u5236\u751f\u6210\u957f\u5ea6\u3002Q4_K_M \u8868\u793a\u91c7\u7528\u4e2d\u7b49\u8d28\u91cf\u7684 4-bit \u91cf\u5316\u7b56\u7565&#xff0c;\u5728\u7cbe\u5ea6\u4e0e\u6027\u80fd\u95f4\u53d6\u5f97\u5e73\u8861\u3002<\/p>\n<h5>\u591a\u7ebf\u7a0b\u5e76\u53d1\u5904\u7406<\/h5>\n<p>Llama.cpp \u652f\u6301\u591a\u7ebf\u7a0b\u5e76\u884c\u89e3\u7801&#xff0c;\u5229\u7528\u73b0\u4ee3 CPU \u591a\u6838\u80fd\u529b\u63d0\u5347\u54cd\u5e94\u901f\u5ea6\u3002\u53ef\u901a\u8fc7 &#096;-t&#096; \u53c2\u6570\u8bbe\u7f6e\u7ebf\u7a0b\u6570&#xff1a;<\/p>\n<p>.\/main -m models\/llama-2-7b.Q4_K_M.gguf -p &#034;Explain AI.&#034; -t 8<\/p>\n<p>\u8be5\u914d\u7f6e\u542f\u7528 8 \u4e2a\u7ebf\u7a0b&#xff0c;\u6709\u6548\u7f29\u77ed\u751f\u6210\u5ef6\u8fdf&#xff0c;\u5c24\u5176\u5728\u6279\u91cf\u8bf7\u6c42\u573a\u666f\u4e0b\u8868\u73b0\u66f4\u4f18\u3002<\/p>\n<h4>4.4 \u96c6\u6210\u81ea\u7136\u8bed\u8a00\u4efb\u52a1\u5b9e\u6218\u793a\u4f8b<\/h4>\n<h5>\u6587\u672c\u5206\u7c7b\u4efb\u52a1\u5b9e\u73b0<\/h5>\n<p>\u4f7f\u7528Hugging Face Transformers\u5e93\u5feb\u901f\u6784\u5efa\u6587\u672c\u5206\u7c7b\u6a21\u578b&#xff1a;<\/p>\n<p>from transformers import AutoTokenizer, AutoModelForSequenceClassification<br \/>\nimport torch<\/p>\n<p># \u52a0\u8f7d\u9884\u8bad\u7ec3\u6a21\u578b\u548c\u5206\u8bcd\u5668<br \/>\nmodel_name &#061; &#034;bert-base-uncased&#034;<br \/>\ntokenizer &#061; AutoTokenizer.from_pretrained(model_name)<br \/>\nmodel &#061; AutoModelForSequenceClassification.from_pretrained(model_name, num_labels&#061;2)<\/p>\n<p># \u8f93\u5165\u7f16\u7801<br \/>\ntext &#061; &#034;This movie is great!&#034;<br \/>\ninputs &#061; tokenizer(text, return_tensors&#061;&#034;pt&#034;, padding&#061;True, truncation&#061;True)<\/p>\n<p># \u63a8\u7406\u9884\u6d4b<br \/>\nwith torch.no_grad():<br \/>\n    outputs &#061; model(**inputs)<br \/>\n    predictions &#061; torch.nn.functional.softmax(outputs.logits, dim&#061;-1)<\/p>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u52a0\u8f7dBERT\u6a21\u578b\u8fdb\u884c\u4e8c\u5206\u7c7b\u4efb\u52a1\u3002tokenizer\u8d1f\u8d23\u5c06\u539f\u59cb\u6587\u672c\u8f6c\u6362\u4e3a\u6a21\u578b\u53ef\u63a5\u53d7\u7684\u8f93\u5165\u683c\u5f0f&#xff0c;padding\u4e0etruncation\u786e\u4fdd\u5e8f\u5217\u957f\u5ea6\u7edf\u4e00\u3002\u6a21\u578b\u8f93\u51fa\u7ecfSoftmax\u5f52\u4e00\u5316\u4e3a\u6982\u7387\u5206\u5e03\u3002<\/p>\n<h5>\u63a8\u7406\u7ed3\u679c\u89e3\u6790<\/h5>\n<ul>\n<li>inputs&#xff1a;\u5305\u542binput_ids\u548cattention_mask&#xff0c;\u7528\u4e8e\u6807\u8bc6\u6709\u6548\u8bcd\u5143<\/li>\n<li>logits&#xff1a;\u6a21\u578b\u539f\u59cb\u8f93\u51fa&#xff0c;\u5bf9\u5e94\u6bcf\u4e2a\u7c7b\u522b\u7684\u5f97\u5206<\/li>\n<li>softmax&#xff1a;\u5c06\u5f97\u5206\u8f6c\u6362\u4e3a\u53ef\u89e3\u91ca\u7684\u6982\u7387\u503c<\/li>\n<\/ul>\n<h3>\u7b2c\u4e94\u7ae0&#xff1a;\u603b\u7ed3\u4e0e\u540e\u7eed\u4f18\u5316\u65b9\u5411<\/h3>\n<h5>\u6027\u80fd\u76d1\u63a7\u7684\u81ea\u52a8\u5316\u6269\u5c55<\/h5>\n<p>\u5728\u5b9e\u9645\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u624b\u52a8\u89e6\u53d1\u6027\u80fd\u5206\u6790\u6210\u672c\u8f83\u9ad8\u3002\u53ef\u901a\u8fc7\u96c6\u6210 Prometheus \u4e0e Grafana \u5b9e\u73b0 pprof \u6570\u636e\u7684\u81ea\u52a8\u91c7\u96c6\u4e0e\u53ef\u89c6\u5316\u3002\u4f8b\u5982&#xff0c;\u5728 Go \u670d\u52a1\u4e2d\u5d4c\u5165\u5982\u4e0b\u4ee3\u7801\u6bb5&#xff0c;\u5b9a\u671f\u5c06\u5185\u5b58\u6307\u6807\u63a8\u9001\u5230 Pushgateway&#xff1a;<\/p>\n<p>import &#034;github.com\/prometheus\/client_golang\/prometheus\/push&#034;<\/p>\n<p>func pushMetrics() {<br \/>\n    pusher :&#061; push.New(&#034;http:\/\/pushgateway:9091&#034;, &#034;my_app&#034;)<br \/>\n    pusher.Collector(runtimeMemStats).Grouping(&#034;instance&#034;, &#034;service-01&#034;).Push()<br \/>\n}<\/p>\n<h5>\u914d\u7f6e\u70ed\u66f4\u65b0\u673a\u5236<\/h5>\n<p>\u4e3a\u907f\u514d\u91cd\u542f\u670d\u52a1\u5bfc\u81f4\u7684\u4e2d\u65ad&#xff0c;\u5efa\u8bae\u5f15\u5165 Viper \u6216 etcd \u5b9e\u73b0\u914d\u7f6e\u52a8\u6001\u52a0\u8f7d\u3002\u5178\u578b\u6d41\u7a0b\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u76d1\u542c\u914d\u7f6e\u4e2d\u5fc3\u7684\u53d8\u66f4\u4e8b\u4ef6<\/li>\n<li>\u89e3\u6790\u65b0\u914d\u7f6e\u5e76\u8fdb\u884c\u5408\u6cd5\u6027\u6821\u9a8c<\/li>\n<li>\u5e73\u6ed1\u5207\u6362\u8fd0\u884c\u65f6\u53c2\u6570&#xff08;\u5982\u65e5\u5fd7\u7ea7\u522b\u3001\u9650\u6d41\u9608\u503c&#xff09;<\/li>\n<li>\u8bb0\u5f55\u53d8\u66f4\u65e5\u5fd7\u5e76\u89e6\u53d1\u544a\u8b66\u901a\u77e5<\/li>\n<\/ul>\n<h5>\u5206\u5e03\u5f0f\u8ffd\u8e2a\u7684\u6df1\u5ea6\u96c6\u6210<\/h5>\n<p>\u9488\u5bf9\u5fae\u670d\u52a1\u67b6\u6784&#xff0c;\u53ef\u7ed3\u5408 OpenTelemetry \u5b9e\u73b0\u8de8\u670d\u52a1\u8c03\u7528\u94fe\u5206\u6790\u3002\u4e0b\u8868\u5c55\u793a\u4e86\u5173\u952e\u57cb\u70b9\u4f4d\u7f6e\u53ca\u5176\u91c7\u6837\u7b56\u7565&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u670d\u52a1\u8282\u70b9\u57cb\u70b9\u7c7b\u578b\u91c7\u6837\u7387\u9644\u52a0\u6807\u7b7e<\/tr>\n<tr>\n<td>API Gateway<\/td>\n<td>HTTP \u8bf7\u6c42\u5165\u53e3<\/td>\n<td>100%<\/td>\n<td>user_id, region<\/td>\n<\/tr>\n<tr>\n<td>User Service<\/td>\n<td>DB \u67e5\u8be2<\/td>\n<td>30%<\/td>\n<td>query_type, latency<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>[Client] \u2192 API Gateway \u2192 Auth Service \u2192 User Service \u2192 DB<br \/>\n          \u2198 Logging Agent \u2192 Kafka \u2192 ELK Stack<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e00\u7ae0&#xff1a;Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u6982\u8ff0Open-AutoGLM \u662f\u4e00\u6b3e\u57fa\u4e8e\u5f00\u6e90\u5927\u8bed\u8a00\u6a21\u578b\u7684\u81ea\u52a8\u5316\u4ee3\u7801\u751f\u6210\u5de5\u5177&#xff0c;\u4e13\u4e3a\u63d0\u5347\u5f00\u53d1\u6548\u7387\u800c\u8bbe\u8ba1\u3002\u5176\u5728 macOS \u5e73\u53f0\u4e0a\u7684\u672c\u5730\u5316\u90e8\u7f72\u6d89\u53ca\u73af\u5883\u914d\u7f6e\u3001\u4f9d\u8d56\u5b89\u88c5\u4e0e\u670d\u52a1\u542f\u52a8\u7b49\u591a\u4e2a\u5173\u952e\u73af\u8282\u3002\u672c\u7ae0\u5c06\u7cfb\u7edf\u6027\u5730\u4ecb\u7ecd\u90e8\u7f72\u524d\u7684\u51c6\u5907\u5de5\u4f5c\u4e0e\u6838\u5fc3\u6d41\u7a0b&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u642d\u5efa\u53ef\u8fd0\u884c\u73af\u5883\u3002\u73af\u5883\u51c6\u5907<br \/>\n\u5728\u5f00\u59cb\u90e8\u7f72\u4e4b\u524d&#xff0c;\u9700\u786e\u4fdd\u7cfb\u7edf\u6ee1\u8db3\u4ee5\u4e0b\u57fa\u672c\u8981\u6c42&#xff1a;<br \/>\nmacOS 12.0 \u6216\u66f4\u9ad8\u7248\u672cPyth<\/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":[],"topic":[],"class_list":["post-67351","post","type-post","status-publish","format-standard","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u3011\uff1a\u624b\u628a\u624b\u6559\u4f60\u672c\u5730\u8fd0\u884c\u5927\u6a21\u578b\uff08\u5c0f\u767d\u4e5f\u80fd\u61c2\uff09 - \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\/67351.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u3011\uff1a\u624b\u628a\u624b\u6559\u4f60\u672c\u5730\u8fd0\u884c\u5927\u6a21\u578b\uff08\u5c0f\u767d\u4e5f\u80fd\u61c2\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7b2c\u4e00\u7ae0&#xff1a;Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u6982\u8ff0Open-AutoGLM \u662f\u4e00\u6b3e\u57fa\u4e8e\u5f00\u6e90\u5927\u8bed\u8a00\u6a21\u578b\u7684\u81ea\u52a8\u5316\u4ee3\u7801\u751f\u6210\u5de5\u5177&#xff0c;\u4e13\u4e3a\u63d0\u5347\u5f00\u53d1\u6548\u7387\u800c\u8bbe\u8ba1\u3002\u5176\u5728 macOS \u5e73\u53f0\u4e0a\u7684\u672c\u5730\u5316\u90e8\u7f72\u6d89\u53ca\u73af\u5883\u914d\u7f6e\u3001\u4f9d\u8d56\u5b89\u88c5\u4e0e\u670d\u52a1\u542f\u52a8\u7b49\u591a\u4e2a\u5173\u952e\u73af\u8282\u3002\u672c\u7ae0\u5c06\u7cfb\u7edf\u6027\u5730\u4ecb\u7ecd\u90e8\u7f72\u524d\u7684\u51c6\u5907\u5de5\u4f5c\u4e0e\u6838\u5fc3\u6d41\u7a0b&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u642d\u5efa\u53ef\u8fd0\u884c\u73af\u5883\u3002\u73af\u5883\u51c6\u5907 \u5728\u5f00\u59cb\u90e8\u7f72\u4e4b\u524d&#xff0c;\u9700\u786e\u4fdd\u7cfb\u7edf\u6ee1\u8db3\u4ee5\u4e0b\u57fa\u672c\u8981\u6c42&#xff1a; macOS 12.0 \u6216\u66f4\u9ad8\u7248\u672cPyth\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/67351.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-28T08:45:40+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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/67351.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/67351.html\",\"name\":\"\u3010Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u3011\uff1a\u624b\u628a\u624b\u6559\u4f60\u672c\u5730\u8fd0\u884c\u5927\u6a21\u578b\uff08\u5c0f\u767d\u4e5f\u80fd\u61c2\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-28T08:45:40+00:00\",\"dateModified\":\"2026-01-28T08:45:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/67351.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/67351.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/67351.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u3011\uff1a\u624b\u628a\u624b\u6559\u4f60\u672c\u5730\u8fd0\u884c\u5927\u6a21\u578b\uff08\u5c0f\u767d\u4e5f\u80fd\u61c2\uff09\"}]},{\"@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":"\u3010Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u3011\uff1a\u624b\u628a\u624b\u6559\u4f60\u672c\u5730\u8fd0\u884c\u5927\u6a21\u578b\uff08\u5c0f\u767d\u4e5f\u80fd\u61c2\uff09 - \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\/67351.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u3011\uff1a\u624b\u628a\u624b\u6559\u4f60\u672c\u5730\u8fd0\u884c\u5927\u6a21\u578b\uff08\u5c0f\u767d\u4e5f\u80fd\u61c2\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7b2c\u4e00\u7ae0&#xff1a;Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u6982\u8ff0Open-AutoGLM \u662f\u4e00\u6b3e\u57fa\u4e8e\u5f00\u6e90\u5927\u8bed\u8a00\u6a21\u578b\u7684\u81ea\u52a8\u5316\u4ee3\u7801\u751f\u6210\u5de5\u5177&#xff0c;\u4e13\u4e3a\u63d0\u5347\u5f00\u53d1\u6548\u7387\u800c\u8bbe\u8ba1\u3002\u5176\u5728 macOS \u5e73\u53f0\u4e0a\u7684\u672c\u5730\u5316\u90e8\u7f72\u6d89\u53ca\u73af\u5883\u914d\u7f6e\u3001\u4f9d\u8d56\u5b89\u88c5\u4e0e\u670d\u52a1\u542f\u52a8\u7b49\u591a\u4e2a\u5173\u952e\u73af\u8282\u3002\u672c\u7ae0\u5c06\u7cfb\u7edf\u6027\u5730\u4ecb\u7ecd\u90e8\u7f72\u524d\u7684\u51c6\u5907\u5de5\u4f5c\u4e0e\u6838\u5fc3\u6d41\u7a0b&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u642d\u5efa\u53ef\u8fd0\u884c\u73af\u5883\u3002\u73af\u5883\u51c6\u5907 \u5728\u5f00\u59cb\u90e8\u7f72\u4e4b\u524d&#xff0c;\u9700\u786e\u4fdd\u7cfb\u7edf\u6ee1\u8db3\u4ee5\u4e0b\u57fa\u672c\u8981\u6c42&#xff1a; macOS 12.0 \u6216\u66f4\u9ad8\u7248\u672cPyth","og_url":"https:\/\/www.wsisp.com\/helps\/67351.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-28T08:45:40+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/67351.html","url":"https:\/\/www.wsisp.com\/helps\/67351.html","name":"\u3010Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u3011\uff1a\u624b\u628a\u624b\u6559\u4f60\u672c\u5730\u8fd0\u884c\u5927\u6a21\u578b\uff08\u5c0f\u767d\u4e5f\u80fd\u61c2\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-28T08:45:40+00:00","dateModified":"2026-01-28T08:45:40+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/67351.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/67351.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/67351.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Open-AutoGLM macOS\u90e8\u7f72\u5168\u653b\u7565\u3011\uff1a\u624b\u628a\u624b\u6559\u4f60\u672c\u5730\u8fd0\u884c\u5927\u6a21\u578b\uff08\u5c0f\u767d\u4e5f\u80fd\u61c2\uff09"}]},{"@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\/67351","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=67351"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/67351\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=67351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=67351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=67351"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=67351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}