{"id":32937,"date":"2025-04-26T08:15:32","date_gmt":"2025-04-26T00:15:32","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/32937.html"},"modified":"2025-04-26T08:15:32","modified_gmt":"2025-04-26T00:15:32","slug":"%e4%bb%8e%e9%9b%b6%e5%bc%80%e5%a7%8b%e4%b9%8b4-1%ef%bc%8c%e5%9f%ba%e4%ba%8eautodl%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%88%e5%8d%95%e5%8d%a1%ef%bc%89%ef%bc%8c%e9%80%9a%e8%bf%87vllm%e5%8f%91%e5%b8%83qwen2-5","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/32937.html","title":{"rendered":"\u4ece\u96f6\u5f00\u59cb\u4e4b4.1\uff0c\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528"},"content":{"rendered":"<p>\u8bf4\u5728\u524d\u9762<\/p>\n<ul>\n<li>\n<p>\u7eaf\u5c0f\u767d\u4e00\u4e2a&#xff0c;\u8fb9\u5b66\u8fb9\u505a&#xff0c;\u8bb0\u5f55\u5b66\u4e60\u8fc7\u7a0b&#xff0c;\u4e0d\u4e13\u4e1a\u4e4b\u5904\u8bf7\u89c1\u8c05\u6216\u80fd\u6307\u51fa\u611f\u6fc0\u4e0d\u5c3d\u3002<\/p>\n<\/li>\n<li>\n<p>\u53c2\u8003\u6559\u7a0b&#xff1a; 1.vllm\u90e8\u7f72qwen2.5vl\u5e76\u4e14\u4f9b\u5916\u90e8\u8fde\u63a5_\u54d4\u54e9\u54d4\u54e9_bilibili<\/p>\n<\/li>\n<\/ul>\n<p>\u672c\u7ae0\u4e0e\u53c2\u8003\u6559\u7a0b\u5dee\u5f02&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4e3b\u8981\u662f\u7cbe\u7b80\u6b65\u9aa4\u548c\u8865\u5145\u4ee3\u7801&#xff0c;\u770b\u4e86\u53c2\u8003\u89c6\u9891\u597d\u51e0\u904d\u624d\u64cd\u4f5c\u5b8c\u6210\u3002<\/p>\n<\/li>\n<li>\n<p>\u672c\u7ae0\u53ea\u5bf9\u7eaf\u6587\u672c\u8fdb\u884c\u4e86\u8c03\u7528&#xff0c;\u89c6\u9891\u4e2d\u8fd8\u8bb2\u89e3\u4e86\u7f51\u7edc\u56fe\u7247\u63a8\u7406&#xff0c;\u672c\u5730\u56fe\u7247\u63a8\u7406\u7b49\u7b49\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u5982\u679c\u5177\u5907\u4ee5\u4e0b\u6761\u4ef6&#xff0c;\u5c31\u53ef\u4ee5\u8fbe\u6210\u6807\u9898\u7684\u76ee\u6807\u4e86&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u9700\u5177\u5907\u7684\u73af\u5883&#xff0c;\u4e0d\u786e\u5b9a\u7684\u53ef\u4ee5\u5148\u901a\u5173&#xff1a;\u4ece\u96f6\u5f00\u59cb&#xff0c;\u57fa\u4e8eAutodl\u4e91\u670d\u52a1\u5668&#xff0c;\u901a\u8fc7\u7f51\u9875\u4e0eQwen2.5-vl-7b-instruct\u5bf9\u8bdd-CSDN\u535a\u5ba2<\/p>\n<ul>\n<li>\n<p>\u57fa\u7840\u955c\u50cf&#xff1a;PyTorch\/2.3.0\/3.12&#xff08;ubuntu22.04&#xff09;\/12.1 \u00a0 \u00a0#\u5728\u521b\u5efa\u670d\u52a1\u5668\u65f6\u9009\u62e9<\/p>\n<\/li>\n<li>\n<p>\u57fa\u7840\u6a21\u578b&#xff1a;Qwen2.5-VL-7B-Instruct \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 # \u901a\u8fc7 \u9b54\u642d\u793e\u533a \u4e0b\u8f7d\u540e\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u6307\u5b9a\u76ee\u5f55<\/p>\n<\/li>\n<li>\n<p>\u57fa\u7840\u9879\u76ee&#xff1a;Qwen2-VL \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 # \u901a\u8fc7https:\/\/github.com\/QwenLM\/Qwen2-VL \u00a0\u4e0b\u8f7d\u540e\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u6307\u5b9a\u76ee\u5f55&#xff08;\u9700\u8981\u79d1\u5b66\u4e0a\u7f51&#xff0c;\u670d\u52a1\u5668\u4e0d\u53ef\u4ee5&#xff0c;\u5efa\u8bae\u5148\u4e0b\u8f7d\u5230\u672c\u5730\u518d\u4e0a\u4f20&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5176\u4ed6Python \u5305<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>pip install transformers \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#Hugging Face Transformers \u5e93&#xff0c;\u7528\u4e8e\u52a0\u8f7d\u548c\u4f7f\u7528\u5404\u79cd\u9884\u8bad\u7ec3\u7684 Transformer \u6a21\u578b \u00a0 \u00a0 \u00a0 \u00a0\u00a0<br \/>\npip install &#039;accelerate&gt;&#061;0.26.0&#039; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#Hugging Face \u63d0\u4f9b\u7684accelerate\u5de5\u5177,\u7528\u4e8e\u5728\u591a GPU \u6216\u5206\u5e03\u5f0f\u8bbe\u7f6e\u4e0b\u66f4\u9ad8\u6548\u5730\u8bad\u7ec3\u4f60\u7684\u6a21\u578b&#xff0c;\u5e76\u63d0\u4f9b\u5f88\u591a\u5f00\u7bb1\u5373\u7528\u7684\u4f18\u5316\u548c\u52a0\u901f\u529f\u80fd\u3002\u00a0\u00a0<br \/>\npip install qwen-vl-utils[decord] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #\u7528\u4e8e\u89c6\u89c9-\u8bed\u8a00\u4efb\u52a1\u7684\u5de5\u5177\u5e93&#xff0c;\u652f\u6301\u89c6\u9891\u6570\u636e\u7684\u5904\u7406\u548c\u8f6c\u6362\u540c\u65f6\u5b89\u88c5\u4e86 Decord \u6269\u5c55&#xff0c;ecord \u662f\u4e00\u4e2a\u9ad8\u6548\u7684\u89c6\u9891\u89e3\u7801\u5e93\u3002 <\/p>\n<ul>\n<li>\n<p>AutoDL\u7684\u670d\u52a1\u5668\u8d39\u7528&#xff1a;5\u5143\u4ee5\u5185\u3002<\/p>\n<\/li>\n<li>\n<p>\u534a\u5929\u65f6\u95f4<\/p>\n<\/li>\n<\/ul>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E5%AE%89%E8%A3%85%E5%8C%85%E4%B8%8E%E9%85%8D%E7%BD%AE%E7%8E%AF%E5%A2%83-toc\" style=\"margin-left:0px\">\u5b89\u88c5\u5305\u4e0e\u914d\u7f6e\u73af\u5883<\/p>\n<p id=\"%E5%90%AF%E5%8A%A8vllm%EF%BC%88%E5%8D%95%E5%8D%A1%EF%BC%89-toc\" style=\"margin-left:0px\">\u542f\u52a8vllm&#xff08;\u5355\u5361&#xff09;<\/p>\n<p id=\"%E5%BB%BA%E7%AB%8B%E9%9A%A7%E9%81%93%E8%BF%9E%E6%8E%A5-toc\" style=\"margin-left:0px\">\u5efa\u7acb\u96a7\u9053\u8fde\u63a5<\/p>\n<p id=\"%E6%9C%AC%E5%9C%B0%E8%B0%83%E7%94%A8-toc\" style=\"margin-left:0px\">\u672c\u5730\u8c03\u7528<\/p>\n<p id=\"%E7%BA%AF%E6%96%87%E6%9C%AC%E8%B0%83%E7%94%A8-toc\" style=\"margin-left:40px\">\u7eaf\u6587\u672c\u8c03\u7528<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E5%AE%89%E8%A3%85%E5%8C%85%E4%B8%8E%E9%85%8D%E7%BD%AE%E7%8E%AF%E5%A2%83\">\u5b89\u88c5\u5305\u4e0e\u914d\u7f6e\u73af\u5883<\/h2>\n<p>\u901a\u8fc7\u65e0\u5361\u6a21\u5f0f\u767b\u5f55AutoDL\u670d\u52a1\u5668&#xff0c;\u5728\u7ec8\u7aef\u6267\u884c\u5982\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p>pip install transformers&#061;&#061;4.49.0\u00a0\u00a0\u00a0\u00a0\u00a0     # \u4e0d\u5e26\u7248\u672c\u7f16\u53f7\u5b89\u88c5\u7684\u5e94\u8be5\u662f4.51.3&#xff08;\u53ef\u4ee5\u4f7f\u7528 pip show transformers \u547d\u4ee4\u67e5\u770b&#xff09;&#xff0c;\u9700\u8981\u5347\u7ea7\u5230 4.49.0<br \/>\npip install requests \u00a0\u00a0                   # \u7528\u4e8e\u7b80\u5316 HTTP \u8bf7\u6c42\u7684\u53d1\u9001\u548c\u63a5\u6536<br \/>\npip install vllm                          #\u4e00\u4e2a\u5f00\u6e90\u7684\u5927\u8bed\u8a00\u6a21\u578b&#xff08;LLM&#xff09;\u63a8\u7406\u4e0e\u90e8\u7f72\u6846\u67b6&#xff0c;\u65e8\u5728\u901a\u8fc7\u4f18\u5316\u5185\u5b58\u7ba1\u7406\u548c\u8ba1\u7b97\u6548\u7387&#xff0c;\u663e\u8457\u63d0\u5347\u6a21\u578b\u63a8\u7406\u7684\u541e\u5410\u91cf\u548c\u8d44\u6e90\u5229\u7528\u7387\u3002\u200c<br \/>\npip install &#8211;upgrade numpy mkl-service\u00a0\u00a0\u00a0#numpy&#xff1a;\u8fd9\u662f\u4e00\u4e2a\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u7684 Python \u5e93&#xff0c;\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u7ec4\u8fd0\u7b97\u529f\u80fd&#xff0c;\u662f\u8bb8\u591a\u673a\u5668\u5b66\u4e60\u548c\u6570\u636e\u79d1\u5b66\u5de5\u5177\u7684\u57fa\u7840\u3002mkl-service&#xff1a;\u8fd9\u662f\u4e00\u4e2a\u4e0e Intel Math Kernel Library (MKL)\u00a0\u76f8\u5173\u7684\u5de5\u5177\u5305&#xff0c;\u5b83\u63d0\u4f9b\u4e86\u4e0e MKL \u7684\u63a5\u53e3&#xff0c;MKL \u662f\u4e00\u4e2a\u9ad8\u5ea6\u4f18\u5316\u7684\u6570\u5b66\u5e93&#xff0c;\u7528\u4e8e\u52a0\u901f\u6570\u503c\u8ba1\u7b97&#xff08;\u4f8b\u5982\u7ebf\u6027\u4ee3\u6570\u3001\u5085\u91cc\u53f6\u53d8\u6362\u7b49&#xff09;\u3002mkl-service\u00a0\u4e3b\u8981\u7528\u4e8e\u5e2e\u52a9 numpy\u00a0\u5728\u8ba1\u7b97\u65f6\u4f7f\u7528 Intel MKL\u00a0\u6765\u63d0\u9ad8\u6027\u80fd\u3002<br \/>\nexport MKL_SERVICE_FORCE_INTEL&#061;1\u00a0\u00a0        #\u8bbe\u7f6e\u4e00\u4e2a\u73af\u5883\u53d8\u91cf&#xff0c;\u5f3a\u5236\u8ba9 mkl-service\u00a0\u4f7f\u7528 Intel MKL&#xff08;Math Kernel Library&#xff09;\u4f5c\u4e3a\u8ba1\u7b97\u52a0\u901f\u5e93&#xff0c;\u4f5c\u7528&#xff1a;\u4e00\u5f3a\u5236\u4f7f\u7528 Intel MKL&#xff0c;\u4e8c\u7ed5\u8fc7\u53ef\u80fd\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002 <\/p>\n<h2 id=\"%E5%90%AF%E5%8A%A8vllm%EF%BC%88%E5%8D%95%E5%8D%A1%EF%BC%89\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">\u542f\u52a8vllm&#xff08;\u5355\u5361&#xff09;<\/h2>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u901a\u8fc7\u65e0\u5361\u6a21\u5f0f\u767b\u5f55AutoDL\u670d\u52a1\u5668&#xff0c;\u5728\u7ec8\u7aef\u6267\u884c\u5982\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p>cd \/root\/autodl-tmp\/Qwen                        #\u8fdb\u5165\u6a21\u578b\u6587\u4ef6\u5939\u6240\u5728\u4f4d\u7f6e<br \/>\nvllm serve Qwen2.5-VL-7B-Instruct &#8211;dtype auto &#8211;port 6006 &#8211;limit_mm_per_prompt image&#061;4 &#8211;max_model_len 8784 &#8211;gpu_memory_utilization 0.8<\/p>\n<p>#Qwen2.5-VL-7B-Instruct&#xff1a;\u6a21\u578b\u6587\u4ef6\u5939\u540d\u79f0<br \/>\n#dtype&#xff1a;\u6570\u636e\u7c7b\u578b&#xff0c;\u4e00\u822c\u76f4\u63a5auto\u5c31\u53ef\u4ee5\u4e86&#xff0c;\u4f4e\u7248\u672c\u7684\u663e\u5361\u53ef\u80fd\u9700\u8981\u81ea\u5df1\u8bbe\u7f6e&#xff0c;\u59822080\u8981\u8bbe\u7f6e\u4e3ahalf<br \/>\n#port&#xff1a;\u7aef\u53e3\u53f7<br \/>\n#limit_mm_per_prompt image&#061;4&#xff0c;\u9ed8\u8ba4\u662f1&#xff0c;\u8fd9\u6837\u6bcf\u6b21\u8bf7\u6c42\u53ef\u4ee5\u8f93\u5165\u591a\u5f20\u56fe\u7247<br \/>\n#max_model_len&#xff1a;\u6bcf\u6b21\u5168\u7403\u6700\u5927\u7684token\u957f\u5ea6&#xff0c;\u7206\u663e\u5b58\u4e86\u5c31\u6539\u5c0f<br \/>\n#gpu_memory_utilization&#xff1a;GPU\u6700\u5927\u5229\u7528\u7387&#xff0c;\u7206\u663e\u5b58\u4e86\u5c31\u6539\u5c0f&#xff0c;\u6211\u73b0\u5728\u4e00\u822c\u8bbe\u7f6e\u4e3a0.7-0.8 <\/p>\n<h2 id=\"%E5%BB%BA%E7%AB%8B%E9%9A%A7%E9%81%93%E8%BF%9E%E6%8E%A5\" style=\"text-align:justify\">\u5efa\u7acb\u96a7\u9053\u8fde\u63a5<\/h2>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5982\u4e0b\u56fe\u6240\u793a&#xff0c;\u83b7\u53d6\u5b9e\u9645\u7684 \u8fdc\u7a0b\u4e3b\u673a\u7684\u7528\u6237\u540d\u548c\u5730\u5740\u548c \u6307\u5b9a\u7aef\u53e3\u53f7 \u5e76\u5c06\u5176\u66ff\u6362\u4e0b\u9762\u7684\u547d\u4ee4<\/p>\n<p>ssh -CNg -L 8000:127.0.0.1:6006 #\u8fdc\u7a0b\u4e3b\u673a\u7684\u7528\u6237\u540d\u548c\u5730\u5740#\u00a0-p #\u6307\u5b9a\u7aef\u53e3\u53f7#\u00a0\u00a0#\u8be5\u547d\u4ee4\u901a\u8fc7 SSH \u5efa\u7acb\u4e00\u4e2a\u96a7\u9053\u8fde\u63a5&#xff0c;\u5c06\u672c\u5730 8000 \u7aef\u53e3\u7684\u8bf7\u6c42\u8f6c\u53d1\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u7684 6006 \u7aef\u53e3&#xff0c;\u4f8b&#xff1a;ssh -CNg -L 8000:127.0.0.1:6006 root&#064;connect.westx.seetacloud.com -p 53340\u3002 <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"152\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250426001530-680c25a29f1bc.png\" width=\"553\" \/>\u200b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5982\u4e0b\u56fe\u6240\u793a&#xff0c;\u5728\u81ea\u5df1\u7535\u8111\u7684\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u6267\u884cssh\u547d\u4ee4<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"229\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250426001530-680c25a2c5ff6.png\" width=\"554\" \/>\u200b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5982\u4e0b\u56fe\u6240\u793a&#xff0c;\u590d\u5236\u5bc6\u7801<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"129\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250426001530-680c25a2f01a0.png\" width=\"554\" \/>\u200b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5982\u4e0b\u56fe\u6240\u793a&#xff0c;\u586b\u5165\u5bc6\u7801&#xff0c;\u65e0\u4efb\u4f55\u53cd\u5e94\u5219\u4e3a\u6210\u529f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"294\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250426001531-680c25a32382e.png\" width=\"554\" \/>\u200b<\/p>\n<h2 id=\"%E6%9C%AC%E5%9C%B0%E8%B0%83%E7%94%A8\" style=\"text-align:justify\">\u672c\u5730\u8c03\u7528<\/h2>\n<h3 id=\"%E7%BA%AF%E6%96%87%E6%9C%AC%E8%B0%83%E7%94%A8\" style=\"text-align:justify\">\u7eaf\u6587\u672c\u8c03\u7528<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u53c2\u8003\u7684python\u4ee3\u7801\u5982\u4e0b<\/p>\n<p>import\u00a0requests<\/p>\n<p>import\u00a0json<\/p>\n<p>from\u00a0PIL\u00a0import\u00a0Image<\/p>\n<p>import\u00a0base64<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p># 1.url<\/p>\n<p>url\u00a0&#061;\u00a0&#039;http:\/\/127.0.0.1:8000\/v1\/chat\/completions&#039;\u00a0\u00a0 \u00a0# \u4f60\u7684IP<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p># 2.data<\/p>\n<p>data\u00a0&#061;\u00a0{&#034;model&#034;: &#034;Qwen2.5-VL-7B-Instruct&#034;,<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 &#034;messages&#034;: [{&#034;role&#034;: &#034;system&#034;, &#034;content&#034;: &#034;You are Qwen, created by Alibaba Cloud. You are a helpful assistant.&#034;}, \u00a0 \u00a0 # \u7cfb\u7edf\u547d\u4ee4&#xff0c;\u4e00\u822c\u4e0d\u8981\u6539<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0{&#034;role&#034;: &#034;user&#034;,<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;content&#034;: &#034;\u4ec0\u4e48\u662f\u5927\u8bed\u8a00\u6a21\u578b&#034;}], \u00a0 \u00a0# \u7528\u6237\u547d\u4ee4&#xff0c;\u4e00\u822c\u6539\u8fd9\u91cc<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 &#034;temperature&#034;: 0.7,&#034;top_p&#034;: 0.8,&#034;repetition_penalty&#034;: 1.05,&#034;max_tokens&#034;: 1024}<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p># 3.\u5c06\u5b57\u5178\u8f6c\u6362\u4e3a JSON \u5b57\u7b26\u4e32<\/p>\n<p>json_payload\u00a0&#061;\u00a0json.dumps(data)<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p># 4.\u53d1\u9001 POST \u8bf7\u6c42<\/p>\n<p>headers\u00a0&#061;\u00a0{&#039;Content-Type&#039;: &#039;application\/json&#039;}<\/p>\n<p>response\u00a0&#061;\u00a0requests.post(url, data&#061;json_payload, headers&#061;headers)<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p># 5.\u6253\u5370\u54cd\u5e94\u5185\u5bb9<\/p>\n<p>print(response.json().get(&#034;choices&#034;, [])[0].get(&#034;message&#034;, []).get(&#034;content&#034;, [])) \u00a0 \u00a0 \u00a0# \u547d\u4ee4\u884c\u542f\u52a8&#xff0c;\u7528\u8fd9\u4e2a\u6253\u5370<\/p>\n<p># print(response.json()) <\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8c03\u7528\u7ed3\u679c\u5982\u4e0b\u56fe\u6240\u793a&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"309\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250426001531-680c25a34fd1f.png\" width=\"554\" \/>\u200b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb730\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf4\u6b21\u3002\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528<\/p>\n","protected":false},"author":2,"featured_media":32932,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[607,2680,2681],"topic":[],"class_list":["post-32937","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-autodl","tag-qwen2-5-vl","tag-vllm"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4ece\u96f6\u5f00\u59cb\u4e4b4.1\uff0c\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528 - \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\/32937.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece\u96f6\u5f00\u59cb\u4e4b4.1\uff0c\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb730\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf4\u6b21\u3002\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/32937.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-26T00:15:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250426001530-680c25a29f1bc.png\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/32937.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/32937.html\",\"name\":\"\u4ece\u96f6\u5f00\u59cb\u4e4b4.1\uff0c\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-26T00:15:32+00:00\",\"dateModified\":\"2025-04-26T00:15:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/32937.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/32937.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/32937.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ece\u96f6\u5f00\u59cb\u4e4b4.1\uff0c\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528\"}]},{\"@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":"\u4ece\u96f6\u5f00\u59cb\u4e4b4.1\uff0c\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528 - \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\/32937.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece\u96f6\u5f00\u59cb\u4e4b4.1\uff0c\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb730\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf4\u6b21\u3002\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528","og_url":"https:\/\/www.wsisp.com\/helps\/32937.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-26T00:15:32+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250426001530-680c25a29f1bc.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/32937.html","url":"https:\/\/www.wsisp.com\/helps\/32937.html","name":"\u4ece\u96f6\u5f00\u59cb\u4e4b4.1\uff0c\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-26T00:15:32+00:00","dateModified":"2025-04-26T00:15:32+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/32937.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/32937.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/32937.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4ece\u96f6\u5f00\u59cb\u4e4b4.1\uff0c\u57fa\u4e8eAutoDL\u670d\u52a1\u5668\uff08\u5355\u5361\uff09\uff0c\u901a\u8fc7vllm\u53d1\u5e03Qwen2.5-vl-7b-Instruct\u6a21\u578b\u7684API\u670d\u52a1\uff0c\u5728\u672c\u5730\u8fdb\u884c\u8c03\u7528"}]},{"@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\/32937","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=32937"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/32937\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/32932"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=32937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=32937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=32937"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=32937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}