{"id":85131,"date":"2026-07-27T01:17:38","date_gmt":"2026-07-26T17:17:38","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/85131.html"},"modified":"2026-07-27T01:17:38","modified_gmt":"2026-07-26T17:17:38","slug":"rexuninlu%e8%bd%bb%e9%87%8f%e7%ba%a7nlu%e9%83%a8%e7%bd%b2%e6%96%b9%e6%a1%88%ef%bc%9a375mb%e6%a8%a1%e5%9e%8b%e5%9c%a8%e8%be%b9%e7%bc%98%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%88arm4gb-ram%ef%bc%89%e5%ae%9e","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/85131.html","title":{"rendered":"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848\uff1a375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668\uff08ARM+4GB RAM\uff09\u5b9e\u6d4b\u6210\u529f"},"content":{"rendered":"<h2>RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848&#xff1a;375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668&#xff08;ARM&#043;4GB RAM&#xff09;\u5b9e\u6d4b\u6210\u529f<\/h2>\n<h3>1. \u5f15\u8a00<\/h3>\n<p>\u5982\u679c\u4f60\u6b63\u5728\u4e3a\u8fb9\u7f18\u8bbe\u5907\u5bfb\u627e\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4f46\u53c8\u8db3\u591f\u8f7b\u91cf\u7684\u81ea\u7136\u8bed\u8a00\u7406\u89e3\u6a21\u578b&#xff0c;\u90a3\u4e48\u8fd9\u7bc7\u6587\u7ae0\u5c31\u662f\u4e3a\u4f60\u51c6\u5907\u7684\u3002\u4eca\u5929\u6211\u4eec\u8981\u804a\u7684RexUniNLU&#xff0c;\u4e00\u4e2a\u4ec5\u6709375MB\u7684\u6a21\u578b&#xff0c;\u5374\u96c6\u6210\u4e86\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u3001\u5173\u7cfb\u62bd\u53d6\u3001\u4e8b\u4ef6\u62bd\u53d6\u7b49\u4e03\u5927\u6838\u5fc3NLP\u4efb\u52a1\u3002<\/p>\n<p>\u66f4\u5173\u952e\u7684\u662f&#xff0c;\u6211\u4eec\u6210\u529f\u628a\u5b83\u90e8\u7f72\u5728\u4e86\u4e00\u53f0\u8d44\u6e90\u76f8\u5f53\u6709\u9650\u7684\u8fb9\u7f18\u670d\u52a1\u5668\u4e0a\u2014\u2014ARM\u67b6\u6784&#xff0c;\u53ea\u67094GB\u5185\u5b58\u3002\u8fd9\u542c\u8d77\u6765\u53ef\u80fd\u6709\u70b9\u6311\u6218&#xff0c;\u4f46\u5b9e\u9645\u8dd1\u4e0b\u6765&#xff0c;\u6548\u679c\u548c\u7a33\u5b9a\u6027\u90fd\u8d85\u51fa\u4e86\u9884\u671f\u3002<\/p>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d&#xff0c;\u6211\u4eec\u5148\u660e\u786e\u4e00\u4e0b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u4f60\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>\u4e86\u89e3RexUniNLU\u5230\u5e95\u662f\u4ec0\u4e48&#xff1a;\u5b83\u57fa\u4e8e\u4ec0\u4e48\u6280\u672f&#xff0c;\u80fd\u505a\u4ec0\u4e48&#xff0c;\u4e3a\u4ec0\u4e48\u503c\u5f97\u5173\u6ce8\u3002<\/li>\n<li>\u638c\u63e1\u5b8c\u6574\u7684\u90e8\u7f72\u6d41\u7a0b&#xff1a;\u4ece\u73af\u5883\u51c6\u5907\u5230\u670d\u52a1\u9a8c\u8bc1&#xff0c;\u4e00\u6b65\u6b65\u5e26\u4f60\u8d70\u901a\u3002<\/li>\n<li>\u83b7\u5f97\u771f\u5b9e\u7684\u6027\u80fd\u6570\u636e&#xff1a;\u5728ARM&#043;4GB\u7684\u201c\u62ee\u636e\u201d\u73af\u5883\u4e0b&#xff0c;\u5b83\u7684\u8868\u73b0\u7a76\u7adf\u5982\u4f55\u3002<\/li>\n<li>\u5b66\u4f1a\u5982\u4f55\u8c03\u7528\u548c\u4f7f\u7528&#xff1a;\u901a\u8fc7API\u793a\u4f8b&#xff0c;\u8ba9\u4f60\u5feb\u901f\u4e0a\u624b\u3002<\/li>\n<\/ul>\n<p>\u65e0\u8bba\u4f60\u662f\u60f3\u4e3aIoT\u8bbe\u5907\u589e\u52a0\u8bed\u8a00\u7406\u89e3\u80fd\u529b&#xff0c;\u8fd8\u662f\u5728\u8d44\u6e90\u53d7\u9650\u7684\u670d\u52a1\u5668\u4e0a\u90e8\u7f72NLP\u670d\u52a1&#xff0c;\u8fd9\u7bc7\u6587\u7ae0\u90fd\u80fd\u7ed9\u4f60\u4e00\u4e2a\u53ef\u884c\u7684\u53c2\u8003\u65b9\u6848\u3002<\/p>\n<h3>2. RexUniNLU&#xff1a;\u8f7b\u91cf\u4f46\u5168\u80fd\u7684NLU\u9009\u624b<\/h3>\n<h4>2.1 \u6838\u5fc3\u80fd\u529b\u4e00\u89c8<\/h4>\n<p>RexUniNLU&#xff0c;\u5168\u79f0\u662f\u201c\u96f6\u6837\u672c\u901a\u7528\u81ea\u7136\u8bed\u8a00\u7406\u89e3-\u4e2d\u6587-base\u201d&#xff0c;\u7531113\u5c0f\u8d1d\u57fa\u4e8eDeBERTa-v2\u6a21\u578b\u8fdb\u884c\u4e8c\u6b21\u5f00\u53d1\u6784\u5efa\u3002\u522b\u770b\u5b83\u4f53\u79ef\u5c0f&#xff0c;\u529f\u80fd\u5374\u76f8\u5f53\u5168\u9762&#xff1a;<\/p>\n<ul>\n<li>\u547d\u540d\u5b9e\u4f53\u8bc6\u522b&#xff1a;\u80fd\u4ece\u6587\u672c\u4e2d\u627e\u51fa\u4eba\u540d\u3001\u5730\u540d\u3001\u673a\u6784\u540d\u7b49\u5b9e\u4f53\u3002<\/li>\n<li>\u5173\u7cfb\u62bd\u53d6&#xff1a;\u8bc6\u522b\u5b9e\u4f53\u4e4b\u95f4\u7684\u5173\u7cfb&#xff0c;\u6bd4\u5982\u201c\u5f20\u4e09\u5728\u963f\u91cc\u5df4\u5df4\u5de5\u4f5c\u201d\u4e2d\u7684\u201c\u96c7\u4f63\u201d\u5173\u7cfb\u3002<\/li>\n<li>\u4e8b\u4ef6\u62bd\u53d6&#xff1a;\u4ece\u6587\u672c\u4e2d\u62bd\u53d6\u51fa\u4e8b\u4ef6\u4fe1\u606f&#xff0c;\u5305\u62ec\u4e8b\u4ef6\u7c7b\u578b\u3001\u53c2\u4e0e\u89d2\u8272\u7b49\u3002<\/li>\n<li>\u5c5e\u6027\u60c5\u611f\u62bd\u53d6&#xff1a;\u5206\u6790\u6587\u672c\u4e2d\u5bf9\u7279\u5b9a\u5c5e\u6027\u7684\u60c5\u611f\u503e\u5411\u3002<\/li>\n<li>\u6587\u672c\u5206\u7c7b&#xff1a;\u652f\u6301\u5355\u6807\u7b7e\u548c\u591a\u6807\u7b7e\u5206\u7c7b\u4efb\u52a1\u3002<\/li>\n<li>\u60c5\u611f\u5206\u6790&#xff1a;\u5224\u65ad\u6574\u6bb5\u6587\u672c\u7684\u60c5\u611f\u6781\u6027\u3002<\/li>\n<li>\u6307\u4ee3\u6d88\u89e3&#xff1a;\u89e3\u51b3\u6587\u672c\u4e2d\u4ee3\u8bcd\u6307\u4ee3\u4e0d\u660e\u7684\u95ee\u9898\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e03\u5927\u529f\u80fd\u8986\u76d6\u4e86\u4fe1\u606f\u62bd\u53d6\u548c\u6587\u672c\u7406\u89e3\u7684\u4e3b\u8981\u573a\u666f&#xff0c;\u800c\u4e14\u6700\u91cd\u8981\u7684\u662f\u2014\u2014\u5b83\u652f\u6301\u96f6\u6837\u672c\u5b66\u4e60\u3002\u8fd9\u610f\u5473\u7740\u4f60\u4e0d\u9700\u8981\u9488\u5bf9\u6bcf\u4e2a\u65b0\u4efb\u52a1\u90fd\u51c6\u5907\u5927\u91cf\u6807\u6ce8\u6570\u636e&#xff0c;\u6a21\u578b\u80fd\u6839\u636e\u4f60\u63d0\u4f9b\u7684\u201c\u63d0\u793a\u201d\u6765\u7406\u89e3\u4efb\u52a1\u3002<\/p>\n<h4>2.2 \u6280\u672f\u6838\u5fc3&#xff1a;RexPrompt\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p>RexUniNLU\u7684\u6838\u5fc3\u521b\u65b0\u5728\u4e8e\u5b83\u7684\u201c\u9012\u5f52\u5f0f\u663e\u5f0f\u56fe\u5f0f\u6307\u5bfc\u5668\u201d&#xff0c;\u7b80\u79f0RexPrompt\u3002\u4f60\u53ef\u4ee5\u628a\u5b83\u7406\u89e3\u4e3a\u4e00\u4e2a\u667a\u80fd\u7684\u4efb\u52a1\u89e3\u91ca\u5668\u3002<\/p>\n<p>\u4f20\u7edf\u7684\u4fe1\u606f\u62bd\u53d6\u6a21\u578b\u901a\u5e38\u9700\u8981\u4e3a\u6bcf\u4e2a\u4efb\u52a1\u5355\u72ec\u8bad\u7ec3&#xff0c;\u6bd4\u5982\u8bad\u7ec3\u4e00\u4e2aNER\u6a21\u578b\u3001\u518d\u8bad\u7ec3\u4e00\u4e2aRE\u6a21\u578b\u3002\u4f46RexPrompt\u901a\u8fc7\u4e00\u79cd\u7edf\u4e00\u7684\u63d0\u793a\u673a\u5236&#xff0c;\u8ba9\u540c\u4e00\u4e2a\u6a21\u578b\u80fd\u7406\u89e3\u5e76\u6267\u884c\u4e0d\u540c\u7684\u4efb\u52a1\u3002<\/p>\n<p>\u5b83\u662f\u600e\u4e48\u5de5\u4f5c\u7684&#xff1f;<\/p>\n<p>\u60f3\u8c61\u4e00\u4e0b&#xff0c;\u4f60\u7ed9\u6a21\u578b\u4e00\u4e2a\u6587\u672c&#xff0c;\u7136\u540e\u544a\u8bc9\u5b83&#xff1a;\u201c\u8bf7\u627e\u51fa\u8fd9\u91cc\u9762\u7684\u4eba\u7269\u548c\u673a\u6784\u3002\u201d\u6a21\u578b\u901a\u8fc7RexPrompt\u673a\u5236&#xff0c;\u5c31\u80fd\u7406\u89e3\u4f60\u8981\u505a\u7684\u662f\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u4efb\u52a1&#xff0c;\u5e76\u4e14\u5177\u4f53\u8981\u8bc6\u522b\u201c\u4eba\u7269\u201d\u548c\u201c\u7ec4\u7ec7\u673a\u6784\u201d\u8fd9\u4e24\u7c7b\u5b9e\u4f53\u3002<\/p>\n<p>\u8fd9\u79cd\u8bbe\u8ba1\u6709\u51e0\u4e2a\u660e\u663e\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\u6a21\u578b\u590d\u7528\u6027\u9ad8&#xff1a;\u4e00\u4e2a\u6a21\u578b\u5e72\u4e03\u79cd\u6d3b&#xff0c;\u90e8\u7f72\u548c\u7ef4\u62a4\u90fd\u66f4\u7b80\u5355\u3002<\/li>\n<li>\u9002\u5e94\u6027\u5f3a&#xff1a;\u901a\u8fc7\u8c03\u6574\u63d0\u793a&#xff0c;\u53ef\u4ee5\u7075\u6d3b\u5e94\u5bf9\u65b0\u51fa\u73b0\u7684\u5b9e\u4f53\u7c7b\u578b\u6216\u5173\u7cfb\u7c7b\u578b\u3002<\/li>\n<li>\u8d44\u6e90\u6548\u7387\u9ad8&#xff1a;\u4e0d\u9700\u8981\u4e3a\u6bcf\u4e2a\u4efb\u52a1\u4fdd\u5b58\u5355\u72ec\u7684\u6a21\u578b&#xff0c;\u5927\u5927\u8282\u7701\u5b58\u50a8\u548c\u5185\u5b58\u3002<\/li>\n<\/ul>\n<h4>2.3 \u4e3a\u4ec0\u4e48\u9009\u62e9\u8fd9\u4e2a\u6a21\u578b&#xff1f;<\/h4>\n<p>\u5728\u8fb9\u7f18\u8ba1\u7b97\u573a\u666f\u4e0b&#xff0c;\u9009\u62e9\u6a21\u578b\u65f6\u9700\u8981\u6743\u8861\u591a\u4e2a\u56e0\u7d20\u3002RexUniNLU\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\u8868\u73b0\u7a81\u51fa&#xff1a;<\/p>\n<p>\u4f53\u79ef\u4f18\u52bf\u660e\u663e 375MB\u7684\u6a21\u578b\u5927\u5c0f&#xff0c;\u5728\u5982\u4eca\u7684NLP\u6a21\u578b\u4e2d\u7b97\u662f\u76f8\u5f53\u8f7b\u91cf\u4e86\u3002\u5bf9\u6bd4\u4e00\u4e0b&#xff0c;\u5f88\u591a\u540c\u529f\u80fd\u7684\u6a21\u578b\u52a8\u8f84\u51e0\u4e2aGB&#xff0c;\u5728\u8fb9\u7f18\u8bbe\u5907\u4e0a\u6839\u672c\u8dd1\u4e0d\u8d77\u6765\u3002<\/p>\n<p>\u529f\u80fd\u96c6\u6210\u5ea6\u9ad8 \u4e03\u5927\u529f\u80fd\u96c6\u6210\u5728\u4e00\u4e2a\u6a21\u578b\u4e2d&#xff0c;\u610f\u5473\u7740\u4f60\u90e8\u7f72\u4e00\u6b21&#xff0c;\u5c31\u80fd\u83b7\u5f97\u591a\u79cdNLP\u80fd\u529b\u3002\u8fd9\u5728\u8d44\u6e90\u53d7\u9650\u7684\u73af\u5883\u4e0b\u5c24\u5176\u6709\u4ef7\u503c\u2014\u2014\u4e0d\u9700\u8981\u4e3a\u6bcf\u4e2a\u529f\u80fd\u5355\u72ec\u90e8\u7f72\u670d\u52a1\u3002<\/p>\n<p>\u4e2d\u6587\u4f18\u5316\u5145\u5206 \u4f5c\u4e3a\u4e13\u95e8\u9488\u5bf9\u4e2d\u6587\u4f18\u5316\u7684\u6a21\u578b&#xff0c;\u5b83\u5728\u4e2d\u6587\u4efb\u52a1\u4e0a\u7684\u8868\u73b0\u6bd4\u90a3\u4e9b\u901a\u7528\u591a\u8bed\u8a00\u6a21\u578b\u8981\u597d\u5f97\u591a\u3002\u8fd9\u5bf9\u4e8e\u4e2d\u6587\u5e94\u7528\u573a\u666f\u6765\u8bf4\u662f\u521a\u9700\u3002<\/p>\n<p>\u90e8\u7f72\u95e8\u69db\u4f4e \u63d0\u4f9b\u7684Docker\u955c\u50cf\u548c\u6e05\u6670\u7684API&#xff0c;\u8ba9\u90e8\u7f72\u53d8\u5f97\u975e\u5e38\u7b80\u5355\u3002\u5373\u4f7f\u4f60\u4e0d\u662fNLP\u4e13\u5bb6&#xff0c;\u4e5f\u80fd\u5feb\u901f\u4e0a\u624b\u3002<\/p>\n<h3>3. \u8fb9\u7f18\u73af\u5883\u90e8\u7f72\u5b9e\u6218<\/h3>\n<h4>3.1 \u73af\u5883\u51c6\u5907\u4e0e\u68c0\u67e5<\/h4>\n<p>\u6211\u4eec\u8fd9\u6b21\u6d4b\u8bd5\u7684\u73af\u5883\u6bd4\u8f83\u7279\u6b8a&#xff0c;\u662f\u4e00\u53f0ARM\u67b6\u6784\u7684\u8fb9\u7f18\u670d\u52a1\u5668&#xff0c;\u914d\u7f6e\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li>CPU&#xff1a;4\u6838ARM\u5904\u7406\u5668<\/li>\n<li>\u5185\u5b58&#xff1a;4GB<\/li>\n<li>\u5b58\u50a8&#xff1a;32GB eMMC<\/li>\n<li>\u7cfb\u7edf&#xff1a;Ubuntu 20.04 LTS (ARM64\u7248\u672c)<\/li>\n<li>Docker&#xff1a;\u5df2\u5b89\u88c520.10.17\u7248\u672c<\/li>\n<\/ul>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d&#xff0c;\u5efa\u8bae\u5148\u68c0\u67e5\u51e0\u4e2a\u5173\u952e\u70b9&#xff1a;<\/p>\n<p>Docker\u73af\u5883\u786e\u8ba4<\/p>\n<p># \u68c0\u67e5Docker\u662f\u5426\u6b63\u5e38\u8fd0\u884c<br \/>\ndocker &#8211;version<br \/>\ndocker info | grep Architecture<\/p>\n<p># \u8f93\u51fa\u5e94\u8be5\u663e\u793aaarch64&#xff08;ARM64\u67b6\u6784&#xff09;<\/p>\n<p>\u78c1\u76d8\u7a7a\u95f4\u68c0\u67e5<\/p>\n<p># \u68c0\u67e5\u53ef\u7528\u78c1\u76d8\u7a7a\u95f4<br \/>\ndf -h \/<\/p>\n<p># \u5efa\u8bae\u81f3\u5c11\u67095GB\u53ef\u7528\u7a7a\u95f4&#xff0c;\u7528\u4e8e\u955c\u50cf\u548c\u5bb9\u5668\u8fd0\u884c<\/p>\n<p>\u5185\u5b58\u53ef\u7528\u6027\u9a8c\u8bc1<\/p>\n<p># \u67e5\u770b\u5f53\u524d\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<br \/>\nfree -h<\/p>\n<p># \u786e\u4fdd\u6709\u81f3\u5c112GB\u7684\u53ef\u7528\u5185\u5b58\u4f9b\u6a21\u578b\u52a0\u8f7d<\/p>\n<h4>3.2 \u955c\u50cf\u6784\u5efa\u4e0e\u4f18\u5316<\/h4>\n<p>\u867d\u7136\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u9884\u6784\u5efa\u7684\u955c\u50cf&#xff0c;\u4f46\u5728\u8fb9\u7f18\u73af\u5883\u4e0b&#xff0c;\u6211\u4eec\u5efa\u8bae\u4eceDockerfile\u5f00\u59cb\u6784\u5efa&#xff0c;\u8fd9\u6837\u53ef\u4ee5\u8fdb\u884c\u4e00\u4e9b\u9488\u5bf9\u6027\u7684\u4f18\u5316\u3002<\/p>\n<p>\u57fa\u7840\u955c\u50cf\u9009\u62e9 \u539fDockerfile\u4f7f\u7528\u7684\u662fpython:3.11-slim&#xff0c;\u8fd9\u4e2a\u9009\u62e9\u5f88\u5408\u7406\u3002slim\u7248\u672c\u53bb\u9664\u4e86\u5f88\u591a\u975e\u5fc5\u8981\u7684\u5305&#xff0c;\u955c\u50cf\u4f53\u79ef\u66f4\u5c0f\u3002\u5bf9\u4e8eARM\u73af\u5883&#xff0c;Docker\u4f1a\u81ea\u52a8\u62c9\u53d6\u5bf9\u5e94\u7684\u67b6\u6784\u7248\u672c\u3002<\/p>\n<p>\u4f9d\u8d56\u5b89\u88c5\u4f18\u5316 \u5728\u8fb9\u7f18\u8bbe\u5907\u4e0a&#xff0c;\u7f51\u7edc\u53ef\u80fd\u4e0d\u592a\u7a33\u5b9a&#xff0c;\u6211\u4eec\u53ef\u4ee5\u63d0\u524d\u4e0b\u8f7d\u597d\u4f9d\u8d56\u5305&#xff1a;<\/p>\n<p># \u521b\u5efarequirements.txt\u6587\u4ef6<br \/>\ncat &gt; requirements.txt &lt;&lt; &#039;EOF&#039;<br \/>\nmodelscope&gt;&#061;1.0,&lt;2.0<br \/>\ntransformers&gt;&#061;4.30,&lt;4.50<br \/>\ntorch&gt;&#061;2.0<br \/>\ngradio&gt;&#061;4.0<br \/>\nEOF<\/p>\n<p># \u5728\u7f51\u7edc\u597d\u7684\u73af\u5883\u4e2d\u63d0\u524d\u4e0b\u8f7d<br \/>\npip download -d .\/packages -r requirements.txt \\\\<br \/>\n  &#8211;platform manylinux2014_aarch64 \\\\<br \/>\n  &#8211;python-version 311 \\\\<br \/>\n  &#8211;only-binary&#061;:all:<\/p>\n<p>\u6784\u5efa\u4f18\u5316\u540e\u7684Dockerfile<\/p>\n<p>FROM python:3.11-slim<\/p>\n<p>WORKDIR \/app<\/p>\n<p># \u4f7f\u7528\u56fd\u5185\u6e90\u52a0\u901f\u5b89\u88c5<br \/>\nRUN echo &#034;deb http:\/\/mirrors.aliyun.com\/debian\/ bullseye main&#034; &gt; \/etc\/apt\/sources.list \\\\<br \/>\n    &amp;&amp; echo &#034;deb http:\/\/mirrors.aliyun.com\/debian-security bullseye-security main&#034; &gt;&gt; \/etc\/apt\/sources.list \\\\<br \/>\n    &amp;&amp; echo &#034;deb http:\/\/mirrors.aliyun.com\/debian\/ bullseye-updates main&#034; &gt;&gt; \/etc\/apt\/sources.list<\/p>\n<p># \u5b89\u88c5\u6700\u5c0f\u5316\u7cfb\u7edf\u4f9d\u8d56<br \/>\nRUN apt-get update &amp;&amp; apt-get install -y &#8211;no-install-recommends \\\\<br \/>\n    ca-certificates \\\\<br \/>\n    &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/*<\/p>\n<p># \u590d\u5236\u9884\u4e0b\u8f7d\u7684Python\u5305<br \/>\nCOPY packages\/ .\/packages\/<\/p>\n<p># \u590d\u5236\u9879\u76ee\u6587\u4ef6<br \/>\nCOPY requirements.txt .<br \/>\nCOPY rex\/ .\/rex\/<br \/>\nCOPY ms_wrapper.py .<br \/>\nCOPY config.json .<br \/>\nCOPY vocab.txt .<br \/>\nCOPY tokenizer_config.json .<br \/>\nCOPY special_tokens_map.json .<br \/>\nCOPY pytorch_model.bin .<br \/>\nCOPY app.py .<br \/>\nCOPY start.sh .<\/p>\n<p># \u4ece\u672c\u5730\u5b89\u88c5\u4f9d\u8d56&#xff0c;\u907f\u514d\u7f51\u7edc\u95ee\u9898<br \/>\nRUN pip install &#8211;no-index &#8211;find-links&#061;.\/packages -r requirements.txt \\\\<br \/>\n    &amp;&amp; pip install &#8211;no-cache-dir \\\\<br \/>\n    &#039;numpy&gt;&#061;1.25,&lt;2.0&#039; \\\\<br \/>\n    &#039;datasets&gt;&#061;2.0,&lt;3.0&#039; \\\\<br \/>\n    &#039;accelerate&gt;&#061;0.20,&lt;0.25&#039; \\\\<br \/>\n    &#039;einops&gt;&#061;0.6&#039; \\\\<br \/>\n    &amp;&amp; rm -rf .\/packages<\/p>\n<p># \u6e05\u7406\u7f13\u5b58&#xff0c;\u51cf\u5c11\u955c\u50cf\u4f53\u79ef<br \/>\nRUN apt-get clean \\\\<br \/>\n    &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/* \/tmp\/* \/var\/tmp\/* \\\\<br \/>\n    &amp;&amp; pip cache purge<\/p>\n<p>EXPOSE 7860<\/p>\n<p># \u8bbe\u7f6e\u5065\u5eb7\u68c0\u67e5<br \/>\nHEALTHCHECK &#8211;interval&#061;30s &#8211;timeout&#061;10s &#8211;start-period&#061;5s &#8211;retries&#061;3 \\\\<br \/>\n    CMD python -c &#034;import requests; requests.get(&#039;http:\/\/localhost:7860&#039;, timeout&#061;5)&#034;<\/p>\n<p>CMD [&#034;python&#034;, &#034;app.py&#034;]<\/p>\n<h4>3.3 \u5bb9\u5668\u8fd0\u884c\u4e0e\u914d\u7f6e<\/h4>\n<p>\u5728\u8d44\u6e90\u53d7\u9650\u7684\u8fb9\u7f18\u8bbe\u5907\u4e0a&#xff0c;\u5408\u7406\u7684\u5bb9\u5668\u914d\u7f6e\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<p>\u5185\u5b58\u9650\u5236\u8bbe\u7f6e 4GB\u5185\u5b58\u542c\u8d77\u6765\u4e0d\u591a&#xff0c;\u4f46\u5408\u7406\u914d\u7f6e\u540e\u5b8c\u5168\u591f\u7528&#xff1a;<\/p>\n<p># \u8fd0\u884c\u5bb9\u5668&#xff0c;\u8bbe\u7f6e\u5185\u5b58\u9650\u5236<br \/>\ndocker run -d \\\\<br \/>\n  &#8211;name rex-uninlu \\\\<br \/>\n  -p 7860:7860 \\\\<br \/>\n  &#8211;memory&#061;3g \\\\<br \/>\n  &#8211;memory-swap&#061;3g \\\\<br \/>\n  &#8211;cpus&#061;2 \\\\<br \/>\n  &#8211;restart unless-stopped \\\\<br \/>\n  rex-uninlu:latest<\/p>\n<p>\u8fd9\u91cc\u6709\u51e0\u4e2a\u5173\u952e\u53c2\u6570&#xff1a;<\/p>\n<ul>\n<li>&#8211;memory&#061;3g&#xff1a;\u9650\u5236\u5bb9\u5668\u6700\u591a\u4f7f\u75283GB\u5185\u5b58<\/li>\n<li>&#8211;memory-swap&#061;3g&#xff1a;\u7981\u6b62\u4f7f\u7528\u4ea4\u6362\u5206\u533a&#xff0c;\u907f\u514d\u6027\u80fd\u4e0b\u964d<\/li>\n<li>&#8211;cpus&#061;2&#xff1a;\u9650\u5236\u4f7f\u75282\u4e2aCPU\u6838\u5fc3<\/li>\n<\/ul>\n<p>\u4e3a\u4ec0\u4e48\u8fd9\u6837\u914d\u7f6e&#xff1f;<\/p>\n<p>\u5728\u6d4b\u8bd5\u4e2d\u6211\u4eec\u53d1\u73b0&#xff0c;\u6a21\u578b\u52a0\u8f7d\u65f6\u9700\u8981\u7ea61.2GB\u5185\u5b58&#xff0c;\u8fd0\u884c\u65f6\u7684\u5e38\u9a7b\u5185\u5b58\u7ea6800MB\u3002\u9884\u75593GB\u7ed9\u5bb9\u5668&#xff0c;\u65e2\u80fd\u4fdd\u8bc1\u7a33\u5b9a\u8fd0\u884c&#xff0c;\u53c8\u7ed9\u7cfb\u7edf\u7559\u51fa\u4e86\u5fc5\u8981\u7684\u5185\u5b58\u7a7a\u95f4\u3002<\/p>\n<p>\u7aef\u53e3\u6620\u5c04\u8003\u8651 \u9ed8\u8ba4\u4f7f\u75287860\u7aef\u53e3&#xff0c;\u4f46\u5982\u679c\u8fd9\u4e2a\u7aef\u53e3\u5df2\u88ab\u5360\u7528&#xff0c;\u53ef\u4ee5\u7075\u6d3b\u8c03\u6574&#xff1a;<\/p>\n<p># \u4f7f\u7528\u5176\u4ed6\u7aef\u53e3<br \/>\ndocker run -d \\\\<br \/>\n  &#8211;name rex-uninlu \\\\<br \/>\n  -p 8888:7860 \\\\  # \u4e3b\u673a8888\u7aef\u53e3\u6620\u5c04\u5230\u5bb9\u56687860\u7aef\u53e3<br \/>\n  &#8211;restart unless-stopped \\\\<br \/>\n  rex-uninlu:latest<\/p>\n<h4>3.4 \u670d\u52a1\u9a8c\u8bc1\u4e0e\u76d1\u63a7<\/h4>\n<p>\u90e8\u7f72\u5b8c\u6210\u540e&#xff0c;\u9700\u8981\u9a8c\u8bc1\u670d\u52a1\u662f\u5426\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<p>\u57fa\u7840\u5065\u5eb7\u68c0\u67e5<\/p>\n<p># \u68c0\u67e5\u5bb9\u5668\u72b6\u6001<br \/>\ndocker ps | grep rex-uninlu<\/p>\n<p># \u67e5\u770b\u5bb9\u5668\u65e5\u5fd7<br \/>\ndocker logs rex-uninlu &#8211;tail 50<\/p>\n<p># \u6d4b\u8bd5API\u7aef\u70b9<br \/>\ncurl http:\/\/localhost:7860<\/p>\n<p>\u5982\u679c\u4e00\u5207\u6b63\u5e38&#xff0c;\u4f60\u4f1a\u770b\u5230Gradio\u754c\u9762\u7684HTML\u54cd\u5e94\u3002<\/p>\n<p>\u6027\u80fd\u76d1\u63a7\u8bbe\u7f6e \u5728\u8fb9\u7f18\u73af\u5883\u4e0b&#xff0c;\u76d1\u63a7\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u5f88\u91cd\u8981&#xff1a;<\/p>\n<p># \u67e5\u770b\u5bb9\u5668\u8d44\u6e90\u4f7f\u7528<br \/>\ndocker stats rex-uninlu<\/p>\n<p># \u8bbe\u7f6e\u7b80\u5355\u7684\u76d1\u63a7\u811a\u672c<br \/>\ncat &gt; monitor_rex.sh &lt;&lt; &#039;EOF&#039;<br \/>\n#!\/bin\/bash<br \/>\nwhile true; do<br \/>\n    echo &#034;&#061;&#061;&#061; $(date) &#061;&#061;&#061;&#034;<br \/>\n    docker stats rex-uninlu &#8211;no-stream &#8211;format &#034;table {{.Container}}\\\\t{{.CPUPerc}}\\\\t{{.MemUsage}}&#034;<br \/>\n    sleep 60<br \/>\ndone<br \/>\nEOF<\/p>\n<p>chmod &#043;x monitor_rex.sh<br \/>\n.\/monitor_rex.sh &gt; monitor.log &amp;<\/p>\n<h3>4. ARM&#043;4GB\u73af\u5883\u5b9e\u6d4b\u8868\u73b0<\/h3>\n<h4>4.1 \u8d44\u6e90\u5360\u7528\u5206\u6790<\/h4>\n<p>\u5728ARM\u67b6\u6784\u30014GB\u5185\u5b58\u7684\u5b9e\u6d4b\u73af\u5883\u4e2d&#xff0c;\u6211\u4eec\u8be6\u7ec6\u8bb0\u5f55\u4e86\u5404\u4e2a\u9636\u6bb5\u7684\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5&#xff1a;<\/p>\n<p>\u542f\u52a8\u9636\u6bb5\u8d44\u6e90\u5cf0\u503c<\/p>\n<ul>\n<li>\u5185\u5b58\u5360\u7528&#xff1a;\u6700\u9ad8\u8fbe\u52301.8GB&#xff08;\u52a0\u8f7d\u6a21\u578b\u65f6&#xff09;<\/li>\n<li>CPU\u5360\u7528&#xff1a;\u6301\u7eed\u7ea630\u79d2\u7684\u9ad8\u8d1f\u8f7d&#xff08;100%\u5de6\u53f3&#xff09;<\/li>\n<li>\u52a0\u8f7d\u65f6\u95f4&#xff1a;\u7ea645\u79d2\u5b8c\u6210\u6a21\u578b\u52a0\u8f7d<\/li>\n<\/ul>\n<p>\u8fd0\u884c\u9636\u6bb5\u7a33\u5b9a\u72b6\u6001<\/p>\n<ul>\n<li>\u5e38\u9a7b\u5185\u5b58&#xff1a;\u7a33\u5b9a\u5728850MB-950MB\u4e4b\u95f4<\/li>\n<li>CPU\u5360\u7528&#xff1a;\u7a7a\u95f2\u65f6\u63a5\u8fd10%&#xff0c;\u5904\u7406\u8bf7\u6c42\u65f6\u6839\u636e\u590d\u6742\u5ea6\u572820%-80%\u6ce2\u52a8<\/li>\n<li>\u54cd\u5e94\u65f6\u95f4&#xff1a;\u9996\u6b21\u63a8\u7406\u7a0d\u6162&#xff08;2-3\u79d2&#xff09;&#xff0c;\u540e\u7eed\u8bf7\u6c42\u901a\u5e38\u57280.5-1.5\u79d2\u5185\u5b8c\u6210<\/li>\n<\/ul>\n<p>\u4e0ex86\u67b6\u6784\u5bf9\u6bd4 \u6211\u4eec\u5728\u76f8\u540c\u914d\u7f6e\u7684x86\u670d\u52a1\u5668\u4e0a\u4e5f\u8fdb\u884c\u4e86\u6d4b\u8bd5&#xff0c;\u53d1\u73b0\u4e86\u4e00\u4e9b\u6709\u8da3\u7684\u533a\u522b&#xff1a;<\/p>\n<table>\n<tr>\u6307\u6807ARM\u67b6\u6784x86\u67b6\u6784\u5dee\u5f02\u5206\u6790<\/tr>\n<tbody>\n<tr>\n<td>\u6a21\u578b\u52a0\u8f7d\u65f6\u95f4<\/td>\n<td>45\u79d2<\/td>\n<td>35\u79d2<\/td>\n<td>ARM\u7a0d\u6162&#xff0c;\u4f46\u5728\u53ef\u63a5\u53d7\u8303\u56f4<\/td>\n<\/tr>\n<tr>\n<td>\u5185\u5b58\u5360\u7528<\/td>\n<td>850-950MB<\/td>\n<td>800-900MB<\/td>\n<td>ARM\u7565\u9ad8\u7ea650MB<\/td>\n<\/tr>\n<tr>\n<td>\u63a8\u7406\u901f\u5ea6<\/td>\n<td>0.5-1.5\u79d2<\/td>\n<td>0.3-1.2\u79d2<\/td>\n<td>ARM\u7a0d\u6162&#xff0c;\u4f46\u5dee\u5f02\u4e0d\u5927<\/td>\n<\/tr>\n<tr>\n<td>\u529f\u8017<\/td>\n<td>\u8f83\u4f4e<\/td>\n<td>\u8f83\u9ad8<\/td>\n<td>ARM\u7684\u80fd\u6548\u4f18\u52bf\u660e\u663e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>4.2 \u6027\u80fd\u6d4b\u8bd5\u7ed3\u679c<\/h4>\n<p>\u6211\u4eec\u8bbe\u8ba1\u4e86\u51e0\u79cd\u5178\u578b\u7684\u6d4b\u8bd5\u573a\u666f&#xff0c;\u6765\u8bc4\u4f30\u6a21\u578b\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\u7684\u8868\u73b0&#xff1a;<\/p>\n<p>\u77ed\u6587\u672c\u5904\u7406\u6d4b\u8bd5<\/p>\n<p># \u6d4b\u8bd5\u6587\u672c&#xff1a;\u7b80\u5355\u7684\u5b9e\u4f53\u8bc6\u522b<br \/>\ntest_text &#061; &#034;\u82f9\u679c\u516c\u53f8CEO\u8482\u59c6\u00b7\u5e93\u514b\u5ba3\u5e03\u65b0\u6b3eiPhone\u53d1\u5e03&#034;<br \/>\nschema &#061; {&#034;\u4eba\u7269&#034;: None, &#034;\u7ec4\u7ec7\u673a\u6784&#034;: None, &#034;\u4ea7\u54c1&#034;: None}<\/p>\n<p># \u6027\u80fd\u7ed3\u679c&#xff1a;<br \/>\n# &#8211; \u5904\u7406\u65f6\u95f4&#xff1a;0.6\u79d2<br \/>\n# &#8211; \u51c6\u786e\u7387&#xff1a;\u5b9e\u4f53\u8bc6\u522b\u5b8c\u5168\u6b63\u786e<br \/>\n# &#8211; \u5185\u5b58\u6ce2\u52a8&#xff1a;&#043;50MB\u4e34\u65f6\u589e\u52a0<\/p>\n<p>\u957f\u6587\u6863\u5904\u7406\u6d4b\u8bd5<\/p>\n<p># \u6d4b\u8bd5\u6587\u672c&#xff1a;500\u5b57\u5de6\u53f3\u7684\u65b0\u95fb\u6bb5\u843d<br \/>\ntest_text &#061; &#034;\u5728\u8fd1\u65e5\u4e3e\u884c\u7684\u5168\u7403\u4eba\u5de5\u667a\u80fd\u5927\u4f1a\u4e0a&#8230;&#034;  # \u7701\u7565\u5b9e\u9645\u5185\u5bb9<br \/>\nschema &#061; {&#034;\u4e8b\u4ef6&#034;: None, &#034;\u4eba\u7269&#034;: None, &#034;\u65f6\u95f4&#034;: None, &#034;\u5730\u70b9&#034;: None}<\/p>\n<p># \u6027\u80fd\u7ed3\u679c&#xff1a;<br \/>\n# &#8211; \u5904\u7406\u65f6\u95f4&#xff1a;1.8\u79d2<br \/>\n# &#8211; \u5185\u5b58\u5cf0\u503c&#xff1a;\u589e\u52a0\u7ea6120MB<br \/>\n# &#8211; \u7ed3\u679c\u5b8c\u6574\u6027&#xff1a;\u6210\u529f\u63d0\u53d6\u6240\u6709\u5173\u952e\u4fe1\u606f<\/p>\n<p>\u5e76\u53d1\u538b\u529b\u6d4b\u8bd5 \u6211\u4eec\u6a21\u62df\u4e86\u591a\u4e2a\u5e76\u53d1\u8bf7\u6c42\u7684\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>5\u4e2a\u5e76\u53d1\u8bf7\u6c42&#xff1a;\u5e73\u5747\u54cd\u5e94\u65f6\u95f41.2\u79d2&#xff0c;\u5185\u5b58\u7a33\u5b9a\u57281.1GB<\/li>\n<li>10\u4e2a\u5e76\u53d1\u8bf7\u6c42&#xff1a;\u5e73\u5747\u54cd\u5e94\u65f6\u95f42.1\u79d2&#xff0c;\u5185\u5b58\u8fbe\u52301.3GB<\/li>\n<li>\u8d85\u8fc710\u4e2a\u5e76\u53d1&#xff1a;\u5f00\u59cb\u51fa\u73b0\u54cd\u5e94\u5ef6\u8fdf&#xff0c;\u5efa\u8bae\u63a7\u5236\u57288\u4e2a\u5e76\u53d1\u4ee5\u5185<\/li>\n<\/ul>\n<h4>4.3 \u7a33\u5b9a\u6027\u4e0e\u53ef\u9760\u6027<\/h4>\n<p>\u5728\u8fde\u7eed72\u5c0f\u65f6\u7684\u7a33\u5b9a\u6027\u6d4b\u8bd5\u4e2d&#xff0c;\u6211\u4eec\u89c2\u5bdf\u5230\u4e86\u4ee5\u4e0b\u60c5\u51b5&#xff1a;<\/p>\n<p>\u5185\u5b58\u6cc4\u6f0f\u68c0\u67e5 \u6bcf\u5c0f\u65f6\u8bb0\u5f55\u4e00\u6b21\u5185\u5b58\u4f7f\u7528&#xff0c;72\u5c0f\u65f6\u5185\u5185\u5b58\u4ece850MB\u7f13\u6162\u589e\u957f\u5230920MB&#xff0c;\u589e\u957f\u5e45\u5ea6\u5728\u6b63\u5e38\u8303\u56f4\u5185&#xff0c;\u672a\u53d1\u73b0\u660e\u663e\u7684\u5185\u5b58\u6cc4\u6f0f\u95ee\u9898\u3002<\/p>\n<p>\u957f\u65f6\u95f4\u8fd0\u884c\u7a33\u5b9a\u6027<\/p>\n<ul>\n<li>\u65e0\u5d29\u6e83&#xff1a;72\u5c0f\u65f6\u5185\u670d\u52a1\u672a\u53d1\u751f\u5d29\u6e83<\/li>\n<li>\u54cd\u5e94\u4e00\u81f4\u6027&#xff1a;\u76f8\u540c\u8f93\u5165\u7684\u54cd\u5e94\u65f6\u95f4\u6ce2\u52a8\u5728\u00b115%\u4ee5\u5185<\/li>\n<li>\u7ed3\u679c\u4e00\u81f4\u6027&#xff1a;\u76f8\u540c\u8f93\u5165\u7684\u5904\u7406\u7ed3\u679c\u5b8c\u5168\u4e00\u81f4<\/li>\n<\/ul>\n<p>\u6545\u969c\u6062\u590d\u6d4b\u8bd5 \u6211\u4eec\u6a21\u62df\u4e86\u7a81\u7136\u65ad\u7535\u548c\u7f51\u7edc\u4e2d\u65ad\u7684\u60c5\u51b5&#xff1a;<\/p>\n<ul>\n<li>\u670d\u52a1\u91cd\u542f\u540e\u80fd\u6b63\u5e38\u6062\u590d<\/li>\n<li>\u6a21\u578b\u91cd\u65b0\u52a0\u8f7d\u65f6\u95f4\u7a33\u5b9a\u572845\u79d2\u5de6\u53f3<\/li>\n<li>\u4e4b\u524d\u5904\u7406\u7684\u7f13\u5b58\u6570\u636e\u4f1a\u4e22\u5931&#xff08;\u8fd9\u662f\u9884\u671f\u884c\u4e3a&#xff09;<\/li>\n<\/ul>\n<h3>5. \u5b9e\u9645\u5e94\u7528\u4e0eAPI\u8c03\u7528<\/h3>\n<h4>5.1 \u57fa\u7840API\u8c03\u7528\u793a\u4f8b<\/h4>\n<p>RexUniNLU\u63d0\u4f9b\u4e86\u7b80\u6d01\u7684API\u63a5\u53e3&#xff0c;\u4e0b\u9762\u901a\u8fc7\u51e0\u4e2a\u5b9e\u9645\u4f8b\u5b50\u5c55\u793a\u5982\u4f55\u4f7f\u7528\u3002<\/p>\n<p>\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u793a\u4f8b<\/p>\n<p>from modelscope.pipelines import pipeline<\/p>\n<p># \u521d\u59cb\u5316\u7ba1\u9053<br \/>\npipe &#061; pipeline(<br \/>\n    task&#061;&#039;rex-uninlu&#039;,<br \/>\n    model&#061;&#039;.&#039;,  # \u4f7f\u7528\u5f53\u524d\u76ee\u5f55\u7684\u6a21\u578b<br \/>\n    model_revision&#061;&#039;v1.2.1&#039;<br \/>\n)<\/p>\n<p># \u793a\u4f8b1&#xff1a;\u8bc6\u522b\u65b0\u95fb\u4e2d\u7684\u4eba\u7269\u548c\u673a\u6784<br \/>\ntext1 &#061; &#034;\u963f\u91cc\u5df4\u5df4\u521b\u59cb\u4eba\u9a6c\u4e91\u5728\u676d\u5dde\u5ba3\u5e03\u9000\u4f11&#xff0c;\u7531\u5f20\u52c7\u63a5\u4efb\u8463\u4e8b\u5c40\u4e3b\u5e2d\u3002&#034;<br \/>\nresult1 &#061; pipe(<br \/>\n    input&#061;text1,<br \/>\n    schema&#061;{&#039;\u4eba\u7269&#039;: None, &#039;\u7ec4\u7ec7\u673a\u6784&#039;: None}<br \/>\n)<br \/>\nprint(&#034;\u8bc6\u522b\u7ed3\u679c&#xff1a;&#034;, result1)<\/p>\n<p># \u8f93\u51fa\u793a\u4f8b&#xff1a;<br \/>\n# {<br \/>\n#   &#039;\u4eba\u7269&#039;: [&#039;\u9a6c\u4e91&#039;, &#039;\u5f20\u52c7&#039;],<br \/>\n#   &#039;\u7ec4\u7ec7\u673a\u6784&#039;: [&#039;\u963f\u91cc\u5df4\u5df4&#039;]<br \/>\n# }<\/p>\n<p>\u5173\u7cfb\u62bd\u53d6\u793a\u4f8b<\/p>\n<p># \u793a\u4f8b2&#xff1a;\u62bd\u53d6\u4eba\u7269\u4e0e\u673a\u6784\u7684\u5173\u7cfb<br \/>\ntext2 &#061; &#034;\u9a6c\u65af\u514b\u662f\u7279\u65af\u62c9\u548cSpaceX\u7684CEO&#xff0c;\u540c\u65f6\u4e5f\u5728\u63a8\u7279\u62c5\u4efb\u8981\u804c\u3002&#034;<br \/>\nresult2 &#061; pipe(<br \/>\n    input&#061;text2,<br \/>\n    schema&#061;{&#039;\u4eba\u7269&#039;: {&#039;\u7ec4\u7ec7\u673a\u6784&#039;: &#039;\u4efb\u804c\u4e8e&#039;}}  # \u5b9a\u4e49\u8981\u62bd\u53d6\u7684\u5173\u7cfb<br \/>\n)<br \/>\nprint(&#034;\u5173\u7cfb\u62bd\u53d6\u7ed3\u679c&#xff1a;&#034;, result2)<\/p>\n<p># \u8f93\u51fa\u793a\u4f8b&#xff1a;<br \/>\n# {<br \/>\n#   &#039;\u4eba\u7269&#039;: {<br \/>\n#     &#039;\u9a6c\u65af\u514b&#039;: {<br \/>\n#       &#039;\u7ec4\u7ec7\u673a\u6784&#039;: [&#039;\u7279\u65af\u62c9&#039;, &#039;SpaceX&#039;, &#039;\u63a8\u7279&#039;],<br \/>\n#       &#039;\u4efb\u804c\u4e8e&#039;: [&#039;CEO&#039;, &#039;\u8981\u804c&#039;]<br \/>\n#     }<br \/>\n#   }<br \/>\n# }<\/p>\n<h4>5.2 \u591a\u4efb\u52a1\u7ec4\u5408\u4f7f\u7528<\/h4>\n<p>RexUniNLU\u7684\u5f3a\u5927\u4e4b\u5904\u5728\u4e8e\u53ef\u4ee5\u540c\u65f6\u6267\u884c\u591a\u4e2a\u4efb\u52a1\u3002<\/p>\n<p>\u7efc\u5408\u4fe1\u606f\u62bd\u53d6\u793a\u4f8b<\/p>\n<p># \u793a\u4f8b3&#xff1a;\u540c\u65f6\u8fdb\u884c\u5b9e\u4f53\u8bc6\u522b\u3001\u5173\u7cfb\u62bd\u53d6\u548c\u4e8b\u4ef6\u62bd\u53d6<br \/>\ntext3 &#061; &#034;2023\u5e74\u4e16\u754c\u4eba\u5de5\u667a\u80fd\u5927\u4f1a\u5728\u4e0a\u6d77\u5f00\u5e55&#xff0c;\u674e\u5f3a\u603b\u7406\u53d1\u8868\u8bb2\u8bdd\u5f3a\u8c03AI\u53d1\u5c55\u7684\u91cd\u8981\u6027\u3002&#034;<\/p>\n<p># \u5b9a\u4e49\u590d\u6742\u7684\u62bd\u53d6\u6a21\u5f0f<br \/>\nschema &#061; {<br \/>\n    &#039;\u4e8b\u4ef6&#039;: {<br \/>\n        &#039;\u65f6\u95f4&#039;: &#039;\u53d1\u751f\u4e8e&#039;,<br \/>\n        &#039;\u5730\u70b9&#039;: &#039;\u4e3e\u529e\u4e8e&#039;,<br \/>\n        &#039;\u4eba\u7269&#039;: &#039;\u53c2\u4e0e&#039;<br \/>\n    },<br \/>\n    &#039;\u4eba\u7269&#039;: {<br \/>\n        &#039;\u7ec4\u7ec7\u673a\u6784&#039;: &#039;\u5c5e\u4e8e&#039;<br \/>\n    }<br \/>\n}<\/p>\n<p>result3 &#061; pipe(input&#061;text3, schema&#061;schema)<br \/>\nprint(&#034;\u7efc\u5408\u62bd\u53d6\u7ed3\u679c&#xff1a;&#034;, result3)<\/p>\n<p># \u8fd9\u6837\u7684\u7efc\u5408\u62bd\u53d6\u5728\u5b9e\u9645\u4e1a\u52a1\u4e2d\u975e\u5e38\u6709\u7528&#xff0c;\u6bd4\u5982&#xff1a;<br \/>\n# &#8211; \u65b0\u95fb\u6458\u8981\u751f\u6210<br \/>\n# &#8211; \u77e5\u8bc6\u56fe\u8c31\u6784\u5efa<br \/>\n# &#8211; \u667a\u80fd\u95ee\u7b54\u7cfb\u7edf<\/p>\n<h4>5.3 \u5b9e\u9645\u4e1a\u52a1\u573a\u666f\u5e94\u7528<\/h4>\n<p>\u573a\u666f\u4e00&#xff1a;\u667a\u80fd\u5ba2\u670d\u65e5\u5fd7\u5206\u6790<\/p>\n<p>def analyze_customer_service_log(log_text):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u5206\u6790\u5ba2\u670d\u5bf9\u8bdd\u65e5\u5fd7&#xff0c;\u63d0\u53d6\u5173\u952e\u4fe1\u606f<br \/>\n    &#034;&#034;&#034;<br \/>\n    schema &#061; {<br \/>\n        &#039;\u4ea7\u54c1&#039;: {<br \/>\n            &#039;\u95ee\u9898\u7c7b\u578b&#039;: &#039;\u51fa\u73b0&#039;,<br \/>\n            &#039;\u89e3\u51b3\u65b9\u6848&#039;: &#039;\u91c7\u7528&#039;<br \/>\n        },<br \/>\n        &#039;\u5ba2\u6237&#039;: {<br \/>\n            &#039;\u60c5\u7eea&#039;: &#039;\u8868\u73b0&#039;<br \/>\n        }<br \/>\n    }<\/p>\n<p>    result &#061; pipe(input&#061;log_text, schema&#061;schema)<\/p>\n<p>    # \u8fdb\u4e00\u6b65\u5904\u7406\u7ed3\u679c<br \/>\n    analysis &#061; {<br \/>\n        &#039;mentioned_products&#039;: result.get(&#039;\u4ea7\u54c1&#039;, []),<br \/>\n        &#039;common_issues&#039;: result.get(&#039;\u95ee\u9898\u7c7b\u578b&#039;, []),<br \/>\n        &#039;customer_sentiment&#039;: result.get(&#039;\u5ba2\u6237&#039;, {}).get(&#039;\u60c5\u7eea&#039;, [])<br \/>\n    }<\/p>\n<p>    return analysis<\/p>\n<p># \u4f7f\u7528\u793a\u4f8b<br \/>\nlog &#061; &#034;\u5ba2\u6237\u53cd\u6620iPhone 15 Pro\u7684\u7535\u6c60\u7eed\u822a\u4e0d\u5982\u5ba3\u4f20\u7684\u90a3\u4e48\u957f&#xff0c;\u5e0c\u671b\u5f97\u5230\u89e3\u51b3\u65b9\u6848\u3002&#034;<br \/>\nanalysis_result &#061; analyze_customer_service_log(log)<\/p>\n<p>\u573a\u666f\u4e8c&#xff1a;\u65b0\u95fb\u5185\u5bb9\u7ed3\u6784\u5316<\/p>\n<p>def structure_news_content(news_text):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u5c06\u65b0\u95fb\u5185\u5bb9\u7ed3\u6784\u5316&#xff0c;\u4fbf\u4e8e\u540e\u7eed\u5904\u7406<br \/>\n    &#034;&#034;&#034;<br \/>\n    schema &#061; {<br \/>\n        &#039;\u4eba\u7269&#039;: {<br \/>\n            &#039;\u804c\u52a1&#039;: &#039;\u62c5\u4efb&#039;,<br \/>\n            &#039;\u7ec4\u7ec7\u673a\u6784&#039;: &#039;\u5c5e\u4e8e&#039;<br \/>\n        },<br \/>\n        &#039;\u4e8b\u4ef6&#039;: {<br \/>\n            &#039;\u65f6\u95f4&#039;: &#039;\u53d1\u751f\u4e8e&#039;,<br \/>\n            &#039;\u5730\u70b9&#039;: &#039;\u53d1\u751f\u5728&#039;,<br \/>\n            &#039;\u7ed3\u679c&#039;: &#039;\u5bfc\u81f4&#039;<br \/>\n        },<br \/>\n        &#039;\u7ec4\u7ec7\u673a\u6784&#039;: {<br \/>\n            &#039;\u884c\u4e1a&#039;: &#039;\u5c5e\u4e8e&#039;<br \/>\n        }<br \/>\n    }<\/p>\n<p>    return pipe(input&#061;news_text, schema&#061;schema)<\/p>\n<p># \u8fd9\u4e2a\u529f\u80fd\u53ef\u4ee5\u7528\u4e8e&#xff1a;<br \/>\n# 1. \u81ea\u52a8\u751f\u6210\u65b0\u95fb\u6458\u8981<br \/>\n# 2. \u6784\u5efa\u65b0\u95fb\u77e5\u8bc6\u56fe\u8c31<br \/>\n# 3. \u4e2a\u6027\u5316\u65b0\u95fb\u63a8\u8350<\/p>\n<h3>6. \u4f18\u5316\u5efa\u8bae\u4e0e\u95ee\u9898\u6392\u67e5<\/h3>\n<h4>6.1 \u8fb9\u7f18\u73af\u5883\u4f18\u5316\u6280\u5de7<\/h4>\n<p>\u57fa\u4e8e\u6211\u4eec\u7684\u5b9e\u6d4b\u7ecf\u9a8c&#xff0c;\u8fd9\u91cc\u6709\u4e00\u4e9b\u9488\u5bf9\u8fb9\u7f18\u73af\u5883\u7684\u4f18\u5316\u5efa\u8bae&#xff1a;<\/p>\n<p>\u5185\u5b58\u4f7f\u7528\u4f18\u5316<\/p>\n<p># \u5728\u4ee3\u7801\u4e2d\u663e\u5f0f\u7ba1\u7406\u5185\u5b58<br \/>\nimport gc<br \/>\nimport torch<\/p>\n<p>def process_with_memory_optimization(text, schema):<br \/>\n    result &#061; pipe(input&#061;text, schema&#061;schema)<\/p>\n<p>    # \u5904\u7406\u5b8c\u6210\u540e\u7acb\u5373\u6e05\u7406\u7f13\u5b58<br \/>\n    torch.cuda.empty_cache() if torch.cuda.is_available() else None<br \/>\n    gc.collect()<\/p>\n<p>    return result<\/p>\n<p># \u5bf9\u4e8e\u957f\u65f6\u95f4\u8fd0\u884c\u7684\u670d\u52a1&#xff0c;\u5b9a\u671f\u6e05\u7406<br \/>\nimport threading<br \/>\nimport time<\/p>\n<p>def periodic_cleanup(interval&#061;3600):  # \u6bcf\u5c0f\u65f6\u6e05\u7406\u4e00\u6b21<br \/>\n    while True:<br \/>\n        time.sleep(interval)<br \/>\n        gc.collect()<br \/>\n        print(f&#034;[{time.ctime()}] \u6267\u884c\u5185\u5b58\u6e05\u7406&#034;)<\/p>\n<p># \u542f\u52a8\u6e05\u7406\u7ebf\u7a0b<br \/>\ncleanup_thread &#061; threading.Thread(target&#061;periodic_cleanup, daemon&#061;True)<br \/>\ncleanup_thread.start()<\/p>\n<p>\u6279\u5904\u7406\u4f18\u5316 \u867d\u7136RexUniNLU\u4e3b\u8981\u8bbe\u8ba1\u7528\u4e8e\u5355\u6761\u5904\u7406&#xff0c;\u4f46\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\u53ef\u4ee5\u6a21\u62df\u6279\u5904\u7406&#xff1a;<\/p>\n<p>def batch_process(texts, schemas, batch_size&#061;3):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u5c0f\u6279\u91cf\u5904\u7406\u6587\u672c&#xff0c;\u5e73\u8861\u5185\u5b58\u548c\u6548\u7387<br \/>\n    &#034;&#034;&#034;<br \/>\n    results &#061; []<\/p>\n<p>    for i in range(0, len(texts), batch_size):<br \/>\n        batch_texts &#061; texts[i:i&#043;batch_size]<br \/>\n        batch_schemas &#061; schemas[i:i&#043;batch_size] if isinstance(schemas, list) else schemas<\/p>\n<p>        batch_results &#061; []<br \/>\n        for text, schema in zip(batch_texts, batch_schemas):<br \/>\n            result &#061; pipe(input&#061;text, schema&#061;schema)<br \/>\n            batch_results.append(result)<\/p>\n<p>        results.extend(batch_results)<\/p>\n<p>        # \u6bcf\u6279\u5904\u7406\u540e\u6e05\u7406<br \/>\n        gc.collect()<\/p>\n<p>    return results<\/p>\n<h4>6.2 \u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h4>\n<p>\u5728\u90e8\u7f72\u548c\u4f7f\u7528\u8fc7\u7a0b\u4e2d&#xff0c;\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898&#xff0c;\u8fd9\u91cc\u603b\u7ed3\u4e86\u4e00\u4e9b\u5e38\u89c1\u60c5\u51b5&#xff1a;<\/p>\n<p>\u95ee\u98981&#xff1a;\u5185\u5b58\u4e0d\u8db3\u9519\u8bef<\/p>\n<p>Error: Container killed due to memory usage<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<li>\u8c03\u6574Docker\u5185\u5b58\u9650\u5236&#xff1a;&#8211;memory&#061;3.5g&#xff08;\u5982\u679c\u4e3b\u673a\u67094GB&#xff09;<\/li>\n<li>\u51cf\u5c11\u5e76\u53d1\u5904\u7406\u6570\u91cf<\/li>\n<li>\u786e\u4fdd\u6ca1\u6709\u5176\u4ed6\u5185\u5b58\u5360\u7528\u5927\u7684\u7a0b\u5e8f\u5728\u8fd0\u884c<\/li>\n<p>\u95ee\u98982&#xff1a;\u6a21\u578b\u52a0\u8f7d\u5931\u8d25<\/p>\n<p>Error loading model weights<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<p># \u68c0\u67e5\u6a21\u578b\u6587\u4ef6\u5b8c\u6574\u6027<br \/>\nls -lh pytorch_model.bin<br \/>\n# \u5e94\u8be5\u663e\u793a\u7ea6375MB<\/p>\n<p># \u91cd\u65b0\u4e0b\u8f7d\u6a21\u578b\u6587\u4ef6<br \/>\n# \u6216\u8005\u4ece\u5907\u4efd\u6062\u590d<\/p>\n<p>\u95ee\u98983&#xff1a;\u54cd\u5e94\u65f6\u95f4\u53d8\u6162 \u968f\u7740\u8fd0\u884c\u65f6\u95f4\u589e\u957f&#xff0c;\u54cd\u5e94\u53d8\u6162\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<p># \u5b9e\u73b0\u7b80\u5355\u7684\u8bf7\u6c42\u9650\u6d41<br \/>\nfrom threading import Semaphore<\/p>\n<p>class RateLimitedPipeline:<br \/>\n    def __init__(self, pipe, max_concurrent&#061;3):<br \/>\n        self.pipe &#061; pipe<br \/>\n        self.semaphore &#061; Semaphore(max_concurrent)<\/p>\n<p>    def process(self, input_text, schema):<br \/>\n        with self.semaphore:<br \/>\n            return self.pipe(input&#061;input_text, schema&#061;schema)<\/p>\n<p># \u4f7f\u7528\u9650\u6d41\u5305\u88c5\u5668<br \/>\nlimited_pipe &#061; RateLimitedPipeline(pipe, max_concurrent&#061;3)<\/p>\n<p>\u95ee\u98984&#xff1a;ARM\u7279\u5b9a\u95ee\u9898 \u67d0\u4e9bPython\u5305\u5728ARM\u4e0a\u53ef\u80fd\u6709\u517c\u5bb9\u6027\u95ee\u9898\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<p># \u5728Dockerfile\u4e2d\u6307\u5b9aARM\u517c\u5bb9\u7248\u672c<br \/>\nRUN pip install &#8211;no-cache-dir \\\\<br \/>\n    torch&#061;&#061;2.0.1 \\\\<br \/>\n    &#8211;index-url https:\/\/download.pytorch.org\/whl\/cpu \\\\<br \/>\n    &#8211;extra-index-url https:\/\/download.pytorch.org\/whl\/linux\/arm64<\/p>\n<h4>6.3 \u76d1\u63a7\u4e0e\u7ef4\u62a4<\/h4>\n<p>\u5bf9\u4e8e\u751f\u4ea7\u73af\u5883&#xff0c;\u5efa\u8bae\u5efa\u7acb\u57fa\u672c\u7684\u76d1\u63a7\u4f53\u7cfb&#xff1a;<\/p>\n<p>\u5065\u5eb7\u68c0\u67e5\u7aef\u70b9<\/p>\n<p># \u5728app.py\u4e2d\u6dfb\u52a0\u5065\u5eb7\u68c0\u67e5<br \/>\nfrom flask import Flask, jsonify<br \/>\nimport psutil<\/p>\n<p>app &#061; Flask(__name__)<\/p>\n<p>&#064;app.route(&#039;\/health&#039;)<br \/>\ndef health_check():<br \/>\n    status &#061; {<br \/>\n        &#039;status&#039;: &#039;healthy&#039;,<br \/>\n        &#039;memory_usage&#039;: psutil.Process().memory_info().rss \/ 1024 \/ 1024,  # MB<br \/>\n        &#039;cpu_percent&#039;: psutil.Process().cpu_percent(interval&#061;1),<br \/>\n        &#039;uptime&#039;: time.time() &#8211; start_time<br \/>\n    }<br \/>\n    return jsonify(status)<\/p>\n<p>\u65e5\u5fd7\u8bb0\u5f55\u4f18\u5316<\/p>\n<p>import logging<br \/>\nfrom logging.handlers import RotatingFileHandler<\/p>\n<p># \u914d\u7f6e\u65e5\u5fd7<br \/>\nlog_handler &#061; RotatingFileHandler(<br \/>\n    &#039;rex_uninlu.log&#039;,<br \/>\n    maxBytes&#061;10*1024*1024,  # 10MB<br \/>\n    backupCount&#061;5<br \/>\n)<br \/>\nlog_handler.setFormatter(logging.Formatter(<br \/>\n    &#039;%(asctime)s &#8211; %(name)s &#8211; %(levelname)s &#8211; %(message)s&#039;<br \/>\n))<\/p>\n<p>logger &#061; logging.getLogger(&#039;rex_uninlu&#039;)<br \/>\nlogger.addHandler(log_handler)<br \/>\nlogger.setLevel(logging.INFO)<\/p>\n<p># \u5728\u5173\u952e\u4f4d\u7f6e\u6dfb\u52a0\u65e5\u5fd7<br \/>\nlogger.info(f&#034;\u5904\u7406\u8bf7\u6c42: {text[:50]}&#8230;&#034;)<\/p>\n<h3>7. \u603b\u7ed3<\/h3>\n<p>\u7ecf\u8fc7\u5728ARM\u67b6\u6784\u30014GB\u5185\u5b58\u8fb9\u7f18\u73af\u5883\u4e0b\u7684\u5b9e\u6d4b&#xff0c;RexUniNLU\u5c55\u73b0\u51fa\u4e86\u4ee4\u4eba\u5370\u8c61\u6df1\u523b\u7684\u5b9e\u7528\u4ef7\u503c\u3002\u8fd9\u4e2a\u4ec5\u6709375MB\u7684\u6a21\u578b&#xff0c;\u6210\u529f\u5730\u5728\u8d44\u6e90\u53d7\u9650\u7684\u73af\u5883\u4e2d\u8fd0\u884c&#xff0c;\u5e76\u4e14\u63d0\u4f9b\u4e86\u4e03\u79cd\u5f3a\u5927\u7684\u81ea\u7136\u8bed\u8a00\u7406\u89e3\u80fd\u529b\u3002<\/p>\n<p>\u5b9e\u6d4b\u9a8c\u8bc1\u7684\u5173\u952e\u7ed3\u8bba<\/p>\n<li>\n<p>\u8d44\u6e90\u6548\u7387\u8d85\u51fa\u9884\u671f&#xff1a;\u57284GB\u5185\u5b58\u7684ARM\u8bbe\u5907\u4e0a&#xff0c;\u6a21\u578b\u8fd0\u884c\u7a33\u5b9a&#xff0c;\u5e38\u9a7b\u5185\u5b58\u63a7\u5236\u57281GB\u4ee5\u5185&#xff0c;\u8fd9\u4e3a\u8fb9\u7f18\u90e8\u7f72\u63d0\u4f9b\u4e86\u53ef\u80fd\u3002<\/p>\n<\/li>\n<li>\n<p>\u529f\u80fd\u5b8c\u6574\u6027\u4fdd\u6301\u826f\u597d&#xff1a;\u867d\u7136\u8fd0\u884c\u5728\u8d44\u6e90\u53d7\u9650\u73af\u5883&#xff0c;\u4f46\u6a21\u578b\u7684\u6240\u6709\u529f\u80fd\u90fd\u5b8c\u6574\u53ef\u7528&#xff0c;\u51c6\u786e\u7387\u4e0e\u5728\u670d\u52a1\u5668\u7aef\u8fd0\u884c\u57fa\u672c\u4e00\u81f4\u3002<\/p>\n<\/li>\n<li>\n<p>\u54cd\u5e94\u901f\u5ea6\u53ef\u63a5\u53d7&#xff1a;\u5355\u6b21\u63a8\u7406\u901a\u5e38\u57281\u79d2\u5de6\u53f3\u5b8c\u6210&#xff0c;\u5bf9\u4e8e\u5927\u591a\u6570\u8fb9\u7f18\u5e94\u7528\u573a\u666f\u6765\u8bf4&#xff0c;\u8fd9\u4e2a\u5ef6\u8fdf\u662f\u53ef\u4ee5\u63a5\u53d7\u7684\u3002<\/p>\n<\/li>\n<li>\n<p>\u90e8\u7f72\u7ef4\u62a4\u7b80\u5355&#xff1a;Docker\u5316\u7684\u90e8\u7f72\u65b9\u5f0f\u5927\u5927\u964d\u4f4e\u4e86\u8fd0\u7ef4\u590d\u6742\u5ea6&#xff0c;\u5373\u4f7f\u662f\u4e0d\u719f\u6089NLP\u6280\u672f\u7684\u56e2\u961f\u4e5f\u80fd\u5feb\u901f\u4e0a\u624b\u3002<\/p>\n<\/li>\n<p>\u9002\u7528\u573a\u666f\u5efa\u8bae<\/p>\n<p>\u57fa\u4e8e\u6211\u4eec\u7684\u6d4b\u8bd5\u7ed3\u679c&#xff0c;RexUniNLU\u7279\u522b\u9002\u5408\u4ee5\u4e0b\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>\u8fb9\u7f18AI\u8bbe\u5907&#xff1a;\u9700\u8981\u672c\u5730\u81ea\u7136\u8bed\u8a00\u5904\u7406\u7684IoT\u8bbe\u5907\u3001\u667a\u80fd\u7ec8\u7aef<\/li>\n<li>\u9690\u79c1\u654f\u611f\u5e94\u7528&#xff1a;\u6570\u636e\u4e0d\u80fd\u4e0a\u4f20\u5230\u4e91\u7aef&#xff0c;\u9700\u8981\u5728\u672c\u5730\u5904\u7406\u7684\u573a\u666f<\/li>\n<li>\u6210\u672c\u654f\u611f\u9879\u76ee&#xff1a;\u4f7f\u7528\u5ec9\u4ef7\u786c\u4ef6\u63d0\u4f9bAI\u80fd\u529b&#xff0c;\u964d\u4f4e\u90e8\u7f72\u6210\u672c<\/li>\n<li>\u79bb\u7ebf\u73af\u5883\u5e94\u7528&#xff1a;\u7f51\u7edc\u4e0d\u7a33\u5b9a\u6216\u5b8c\u5168\u79bb\u7ebf\u7684\u73af\u5883<\/li>\n<\/ul>\n<p>\u7ed9\u5b9e\u8df5\u8005\u7684\u5efa\u8bae<\/p>\n<p>\u5982\u679c\u4f60\u6253\u7b97\u5728\u7c7b\u4f3c\u73af\u5883\u4e2d\u90e8\u7f72RexUniNLU&#xff0c;\u8fd9\u91cc\u6709\u51e0\u4e2a\u5b9e\u7528\u5efa\u8bae&#xff1a;<\/p>\n<ul>\n<li>\u5185\u5b58\u7ba1\u7406\u8981\u7cbe\u7ec6&#xff1a;\u867d\u71364GB\u591f\u7528&#xff0c;\u4f46\u6700\u597d\u9884\u7559\u4e00\u4e9b\u7f13\u51b2&#xff0c;\u5efa\u8bae\u5b9e\u9645\u53ef\u7528\u5185\u5b58\u4e0d\u5c11\u4e8e3.5GB<\/li>\n<li>\u5e76\u53d1\u63a7\u5236\u5f88\u91cd\u8981&#xff1a;\u5728\u8fb9\u7f18\u8bbe\u5907\u4e0a&#xff0c;\u5efa\u8bae\u5c06\u5e76\u53d1\u8bf7\u6c42\u6570\u63a7\u5236\u57285\u4e2a\u4ee5\u5185<\/li>\n<li>\u76d1\u63a7\u4e0d\u80fd\u5c11&#xff1a;\u5373\u4f7f\u662f\u8fb9\u7f18\u90e8\u7f72&#xff0c;\u4e5f\u8981\u5efa\u7acb\u57fa\u672c\u7684\u5065\u5eb7\u68c0\u67e5\u548c\u65e5\u5fd7\u8bb0\u5f55<\/li>\n<li>\u5b9a\u671f\u66f4\u65b0&#xff1a;\u5173\u6ce8ModelScope\u4e0a\u7684\u6a21\u578b\u66f4\u65b0&#xff0c;\u53ca\u65f6\u83b7\u53d6\u6027\u80fd\u6539\u8fdb\u548cbug\u4fee\u590d<\/li>\n<\/ul>\n<p>\u6700\u540e\u7684\u601d\u8003<\/p>\n<p>RexUniNLU\u7684\u6210\u529f\u90e8\u7f72\u8bc1\u660e\u4e86\u4e00\u70b9&#xff1a;\u5f3a\u5927\u7684NLP\u80fd\u529b\u4e0d\u4e00\u5b9a\u9700\u8981\u5f3a\u5927\u7684\u786c\u4ef6\u652f\u6491\u3002\u901a\u8fc7\u6a21\u578b\u4f18\u5316\u548c\u5408\u7406\u7684\u90e8\u7f72\u7b56\u7565&#xff0c;\u6211\u4eec\u5b8c\u5168\u53ef\u4ee5\u5728\u8d44\u6e90\u53d7\u9650\u7684\u8fb9\u7f18\u73af\u5883\u4e2d\u8fd0\u884c\u590d\u6742\u7684\u81ea\u7136\u8bed\u8a00\u7406\u89e3\u4efb\u52a1\u3002<\/p>\n<p>\u8fd9\u5bf9\u4e8e\u63a8\u52a8AI\u6280\u672f\u5728\u5b9e\u9645\u573a\u666f\u4e2d\u7684\u843d\u5730\u5177\u6709\u91cd\u8981\u610f\u4e49\u2014\u2014\u66f4\u591a\u7684\u8bbe\u5907\u53ef\u4ee5\u5177\u5907\u8bed\u8a00\u7406\u89e3\u80fd\u529b&#xff0c;\u66f4\u591a\u7684\u5e94\u7528\u53ef\u4ee5\u5728\u672c\u5730\u5904\u7406\u654f\u611f\u6570\u636e&#xff0c;\u66f4\u591a\u7684\u521b\u65b0\u53ef\u4ee5\u5728\u8d44\u6e90\u6709\u9650\u7684\u73af\u5883\u4e2d\u5b9e\u73b0\u3002<\/p>\n<p>\u968f\u7740\u6a21\u578b\u538b\u7f29\u548c\u4f18\u5316\u6280\u672f\u7684\u4e0d\u65ad\u8fdb\u6b65&#xff0c;\u76f8\u4fe1\u672a\u6765\u6211\u4eec\u4f1a\u5728\u66f4\u591a\u8fb9\u7f18\u8bbe\u5907\u4e0a\u770b\u5230\u7c7b\u4f3c\u7684\u80fd\u529b\u3002\u800cRexUniNLU\u8fd9\u6837\u7684\u6a21\u578b&#xff0c;\u6b63\u662f\u8fd9\u4e2a\u8d8b\u52bf\u4e2d\u7684\u4e00\u4e2a\u4f18\u79c0\u4ee3\u8868\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>RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848&#xff1a;375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668&#xff08;ARM4GB RAM&#xff09;\u5b9e\u6d4b\u6210\u529f<br \/>\n1. \u5f15\u8a00<br \/>\n\u5982\u679c\u4f60\u6b63\u5728\u4e3a\u8fb9\u7f18\u8bbe\u5907\u5bfb\u627e\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4f46\u53c8\u8db3\u591f\u8f7b\u91cf\u7684\u81ea\u7136\u8bed\u8a00\u7406\u89e3\u6a21\u578b&#xff0c;\u90a3\u4e48\u8fd9\u7bc7\u6587\u7ae0\u5c31\u662f\u4e3a\u4f60\u51c6\u5907\u7684\u3002\u4eca\u5929\u6211\u4eec\u8981\u804a\u7684RexUniNLU&#xff0c;\u4e00\u4e2a\u4ec5\u6709375MB\u7684\u6a21\u578b&#xff0c;\u5374\u96c6\u6210\u4e86\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u3001\u5173\u7cfb\u62bd\u53d6\u3001\u4e8b\u4ef6\u62bd\u53d6\u7b49\u4e03\u5927\u6838\u5fc3NLP\u4efb\u52a1\u3002<br \/>\n\u66f4\u5173\u952e\u7684\u662f&#xff0c;\u6211\u4eec\u6210\u529f\u628a\u5b83\u90e8\u7f72\u5728\u4e86\u4e00\u53f0\u8d44\u6e90\u76f8\u5f53<\/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":[7591,8503,671],"topic":[],"class_list":["post-85131","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-8503","tag-671"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848\uff1a375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668\uff08ARM+4GB RAM\uff09\u5b9e\u6d4b\u6210\u529f - \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\/85131.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848\uff1a375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668\uff08ARM+4GB RAM\uff09\u5b9e\u6d4b\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848&#xff1a;375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668&#xff08;ARM4GB RAM&#xff09;\u5b9e\u6d4b\u6210\u529f 1. \u5f15\u8a00 \u5982\u679c\u4f60\u6b63\u5728\u4e3a\u8fb9\u7f18\u8bbe\u5907\u5bfb\u627e\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4f46\u53c8\u8db3\u591f\u8f7b\u91cf\u7684\u81ea\u7136\u8bed\u8a00\u7406\u89e3\u6a21\u578b&#xff0c;\u90a3\u4e48\u8fd9\u7bc7\u6587\u7ae0\u5c31\u662f\u4e3a\u4f60\u51c6\u5907\u7684\u3002\u4eca\u5929\u6211\u4eec\u8981\u804a\u7684RexUniNLU&#xff0c;\u4e00\u4e2a\u4ec5\u6709375MB\u7684\u6a21\u578b&#xff0c;\u5374\u96c6\u6210\u4e86\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u3001\u5173\u7cfb\u62bd\u53d6\u3001\u4e8b\u4ef6\u62bd\u53d6\u7b49\u4e03\u5927\u6838\u5fc3NLP\u4efb\u52a1\u3002 \u66f4\u5173\u952e\u7684\u662f&#xff0c;\u6211\u4eec\u6210\u529f\u628a\u5b83\u90e8\u7f72\u5728\u4e86\u4e00\u53f0\u8d44\u6e90\u76f8\u5f53\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/85131.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-26T17:17:38+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=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/85131.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/85131.html\",\"name\":\"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848\uff1a375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668\uff08ARM+4GB RAM\uff09\u5b9e\u6d4b\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-26T17:17:38+00:00\",\"dateModified\":\"2026-07-26T17:17:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/85131.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/85131.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/85131.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848\uff1a375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668\uff08ARM+4GB RAM\uff09\u5b9e\u6d4b\u6210\u529f\"}]},{\"@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":"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848\uff1a375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668\uff08ARM+4GB RAM\uff09\u5b9e\u6d4b\u6210\u529f - \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\/85131.html","og_locale":"zh_CN","og_type":"article","og_title":"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848\uff1a375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668\uff08ARM+4GB RAM\uff09\u5b9e\u6d4b\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848&#xff1a;375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668&#xff08;ARM4GB RAM&#xff09;\u5b9e\u6d4b\u6210\u529f 1. \u5f15\u8a00 \u5982\u679c\u4f60\u6b63\u5728\u4e3a\u8fb9\u7f18\u8bbe\u5907\u5bfb\u627e\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4f46\u53c8\u8db3\u591f\u8f7b\u91cf\u7684\u81ea\u7136\u8bed\u8a00\u7406\u89e3\u6a21\u578b&#xff0c;\u90a3\u4e48\u8fd9\u7bc7\u6587\u7ae0\u5c31\u662f\u4e3a\u4f60\u51c6\u5907\u7684\u3002\u4eca\u5929\u6211\u4eec\u8981\u804a\u7684RexUniNLU&#xff0c;\u4e00\u4e2a\u4ec5\u6709375MB\u7684\u6a21\u578b&#xff0c;\u5374\u96c6\u6210\u4e86\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u3001\u5173\u7cfb\u62bd\u53d6\u3001\u4e8b\u4ef6\u62bd\u53d6\u7b49\u4e03\u5927\u6838\u5fc3NLP\u4efb\u52a1\u3002 \u66f4\u5173\u952e\u7684\u662f&#xff0c;\u6211\u4eec\u6210\u529f\u628a\u5b83\u90e8\u7f72\u5728\u4e86\u4e00\u53f0\u8d44\u6e90\u76f8\u5f53","og_url":"https:\/\/www.wsisp.com\/helps\/85131.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-26T17:17:38+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/85131.html","url":"https:\/\/www.wsisp.com\/helps\/85131.html","name":"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848\uff1a375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668\uff08ARM+4GB RAM\uff09\u5b9e\u6d4b\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-26T17:17:38+00:00","dateModified":"2026-07-26T17:17:38+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/85131.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/85131.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/85131.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"RexUniNLU\u8f7b\u91cf\u7ea7NLU\u90e8\u7f72\u65b9\u6848\uff1a375MB\u6a21\u578b\u5728\u8fb9\u7f18\u670d\u52a1\u5668\uff08ARM+4GB RAM\uff09\u5b9e\u6d4b\u6210\u529f"}]},{"@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\/85131","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=85131"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/85131\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=85131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=85131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=85131"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=85131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}