{"id":33781,"date":"2025-04-28T15:49:30","date_gmt":"2025-04-28T07:49:30","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/33781.html"},"modified":"2025-04-28T15:49:30","modified_gmt":"2025-04-28T07:49:30","slug":"%e8%b7%a8%e8%b6%8a%e8%be%b9%e7%95%8c%e7%9a%84-ai-%e5%8f%98%e9%9d%a9%ef%bc%9a%e6%8f%ad%e7%a7%98-gemini-2-5-pro-%e5%a6%82%e4%bd%95%e9%a2%a0%e8%a6%86%e4%bc%a0%e7%bb%9f%e6%99%ba%e8%83%bd%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/33781.html","title":{"rendered":"\u8de8\u8d8a\u8fb9\u754c\u7684 AI \u53d8\u9769\uff1a\u63ed\u79d8 Gemini 2.5 Pro \u5982\u4f55\u98a0\u8986\u4f20\u7edf\u667a\u80fd\u5e94\u7528"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"1.%20%E5%BC%95%E8%A8%80%EF%BC%9A%E8%B0%B7%E6%AD%8C%E7%9A%84%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD%E5%8F%91%E5%B1%95%E5%8E%86%E7%A8%8B%E4%B8%8E%E8%83%8C%E6%99%AF-toc\" style=\"margin-left:0px\">1. \u5f15\u8a00&#xff1a;\u8c37\u6b4c\u7684\u4eba\u5de5\u667a\u80fd\u53d1\u5c55\u5386\u7a0b\u4e0e\u80cc\u666f<\/p>\n<p id=\"2.%20Gemini%202.5%20Pro%20%E4%BB%8B%E7%BB%8D%EF%BC%9A%E6%A8%A1%E5%9E%8B%E6%9E%B6%E6%9E%84%E4%B8%8E%E7%89%B9%E7%82%B9-toc\" style=\"margin-left:0px\">2. Gemini 2.5 Pro \u4ecb\u7ecd&#xff1a;\u6a21\u578b\u67b6\u6784\u4e0e\u7279\u70b9<\/p>\n<p id=\"3.%20Gemini%202.5%20Pro%20%E7%9A%84%E6%8A%80%E6%9C%AF%E4%BC%98%E5%8A%BF%EF%BC%9A%E6%8E%A8%E7%90%86%E8%83%BD%E5%8A%9B%E3%80%81%E5%A4%9A%E4%BB%BB%E5%8A%A1%E5%A4%84%E7%90%86-toc\" style=\"margin-left:0px\">3. Gemini 2.5 Pro \u7684\u6280\u672f\u4f18\u52bf&#xff1a;\u63a8\u7406\u80fd\u529b\u3001\u591a\u4efb\u52a1\u5904\u7406<\/p>\n<p id=\"4.%20%E6%96%B0%E5%A2%9E%E5%8A%9F%E8%83%BD%E4%B8%8E%E5%BA%94%E7%94%A8%EF%BC%9A%E5%A4%9A%E6%A8%A1%E6%80%81%E8%BE%93%E5%85%A5%E5%A4%84%E7%90%86%E4%B8%8E%E8%B7%A8%E6%A8%A1%E6%80%81%E4%BB%BB%E5%8A%A1-toc\" style=\"margin-left:0px\">4. \u65b0\u589e\u529f\u80fd\u4e0e\u5e94\u7528&#xff1a;\u591a\u6a21\u6001\u8f93\u5165\u5904\u7406\u4e0e\u8de8\u6a21\u6001\u4efb\u52a1<\/p>\n<p id=\"4.1%20%E5%9B%BE%E5%83%8F%E5%92%8C%E6%96%87%E6%9C%AC%E7%9A%84%E8%81%94%E5%90%88%E6%8E%A8%E7%90%86%EF%BC%9A-toc\" style=\"margin-left:40px\">4.1 \u56fe\u50cf\u548c\u6587\u672c\u7684\u8054\u5408\u63a8\u7406&#xff1a;<\/p>\n<p id=\"4.2%20%E9%9F%B3%E9%A2%91%E4%B8%8E%E6%96%87%E6%9C%AC%E7%9A%84%E8%81%94%E5%90%88%E6%8E%A8%E7%90%86%EF%BC%9A-toc\" style=\"margin-left:40px\">4.2 \u97f3\u9891\u4e0e\u6587\u672c\u7684\u8054\u5408\u63a8\u7406&#xff1a;<\/p>\n<p id=\"5.%20%E8%AF%84%E6%B5%8B%E7%BB%93%E6%9E%9C%E4%B8%8E%E5%AF%B9%E6%AF%94%E5%88%86%E6%9E%90%EF%BC%9A%E4%B8%8E%E5%85%B6%E4%BB%96%E5%A4%A7%E6%A8%A1%E5%9E%8B%E7%9A%84%E6%A8%AA%E5%90%91%E6%AF%94%E8%BE%83-toc\" style=\"margin-left:0px\">5. \u8bc4\u6d4b\u7ed3\u679c\u4e0e\u5bf9\u6bd4\u5206\u6790&#xff1a;\u4e0e\u5176\u4ed6\u5927\u6a21\u578b\u7684\u6a2a\u5411\u6bd4\u8f83<\/p>\n<p id=\"6.%20%E4%BB%A3%E7%A0%81%E4%BC%98%E5%8C%96%E4%B8%8E%E6%80%A7%E8%83%BD%E6%8F%90%E5%8D%87%EF%BC%9A-toc\" style=\"margin-left:0px\">6. \u4ee3\u7801\u4f18\u5316\u4e0e\u6027\u80fd\u63d0\u5347&#xff1a;<\/p>\n<p id=\"6.1%20%E6%A8%A1%E5%9E%8B%E8%92%B8%E9%A6%8F%EF%BC%88Model%20Distillation%EF%BC%89-toc\" style=\"margin-left:40px\">6.1 \u6a21\u578b\u84b8\u998f&#xff08;Model Distillation&#xff09;<\/p>\n<p id=\"6.1.1%20%E6%A8%A1%E5%9E%8B%E8%92%B8%E9%A6%8F%E4%BB%A3%E7%A0%81%E7%A4%BA%E4%BE%8B%EF%BC%9A-toc\" style=\"margin-left:80px\">6.1.1 \u6a21\u578b\u84b8\u998f\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p id=\"6.2%20%E6%A8%A1%E5%9E%8B%E9%87%8F%E5%8C%96%EF%BC%88Model%20Quantization%EF%BC%89-toc\" style=\"margin-left:40px\">6.2 \u6a21\u578b\u91cf\u5316&#xff08;Model Quantization&#xff09;<\/p>\n<p id=\"7.%20%E7%9B%B8%E5%85%B3%E4%BB%A3%E7%A0%81%E5%AE%9E%E7%8E%B0%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20Gemini%202.5%20Pro%20%E6%A8%A1%E5%9E%8B-toc\" style=\"margin-left:0px\">7. \u76f8\u5173\u4ee3\u7801\u5b9e\u73b0&#xff1a;\u5982\u4f55\u4f7f\u7528 Gemini 2.5 Pro \u6a21\u578b<\/p>\n<p id=\"7.1%20%E6%96%87%E6%9C%AC%E7%94%9F%E6%88%90%EF%BC%9A-toc\" style=\"margin-left:40px\">7.1 \u6587\u672c\u751f\u6210&#xff1a;<\/p>\n<p id=\"7.2%20%E5%A4%9A%E4%BB%BB%E5%8A%A1%E5%A4%84%E7%90%86%EF%BC%9A%E6%83%85%E6%84%9F%E5%88%86%E6%9E%90%E4%B8%8E%E6%96%87%E6%9C%AC%E7%94%9F%E6%88%90-toc\" style=\"margin-left:40px\">7.2 \u591a\u4efb\u52a1\u5904\u7406&#xff1a;\u60c5\u611f\u5206\u6790\u4e0e\u6587\u672c\u751f\u6210<\/p>\n<hr \/>\n<p style=\"background-color:transparent\">\u6b63\u6587\u5f00\u59cb\u2014\u2014<\/p>\n<h2 id=\"\" style=\"background-color:transparent\"><\/h2>\n<h2 id=\"1.%20%E5%BC%95%E8%A8%80%EF%BC%9A%E8%B0%B7%E6%AD%8C%E7%9A%84%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD%E5%8F%91%E5%B1%95%E5%8E%86%E7%A8%8B%E4%B8%8E%E8%83%8C%E6%99%AF\" style=\"background-color:transparent\">1. \u5f15\u8a00&#xff1a;\u8c37\u6b4c\u7684\u4eba\u5de5\u667a\u80fd\u53d1\u5c55\u5386\u7a0b\u4e0e\u80cc\u666f<\/h2>\n<p>\u8c37\u6b4c&#xff0c;\u4e00\u5bb6\u4ee5\u641c\u7d22\u5f15\u64ce\u8d77\u5bb6\u7684\u79d1\u6280\u5de8\u5934&#xff0c;\u65e9\u57282000\u5e74\u4ee3\u5c31\u5f00\u59cb\u6295\u8eab\u4e8e\u4eba\u5de5\u667a\u80fd\u9886\u57df\u3002\u4ece\u6700\u521d\u7684\u81ea\u52a8\u7ffb\u8bd1\u670d\u52a1\u5230\u5982\u4eca\u7684\u5c16\u7aef\u4eba\u5de5\u667a\u80fd\u6280\u672f&#xff0c;\u8c37\u6b4c\u5728AI\u53d1\u5c55\u53f2\u4e0a\u5360\u636e\u4e86\u4e3e\u8db3\u8f7b\u91cd\u7684\u5730\u4f4d\u3002\u5176\u7814\u7a76\u6210\u679c\u4e0d\u4ec5\u4e3a\u516c\u53f8\u5e26\u6765\u4e86\u5de8\u5927\u7684\u5546\u4e1a\u56de\u62a5&#xff0c;\u4e5f\u63a8\u52a8\u4e86\u5168\u7403\u4eba\u5de5\u667a\u80fd\u6280\u672f\u7684\u5feb\u901f\u8fdb\u6b65\u3002<\/p>\n<p>\u8c37\u6b4c\u7684\u4eba\u5de5\u667a\u80fd\u4e4b\u8def\u59cb\u4e8e\u5bf9\u5927\u6570\u636e\u7684\u5229\u7528&#xff0c;\u57fa\u4e8e\u5e9e\u5927\u7684\u6570\u636e\u96c6\u8fdb\u884c\u6df1\u5ea6\u5b66\u4e60\u7684\u601d\u60f3\u6210\u4e3a\u8c37\u6b4c AI \u53d1\u5c55\u7684\u57fa\u7840\u3002\u968f\u7740\u6df1\u5ea6\u5b66\u4e60\u6280\u672f\u7684\u6210\u719f&#xff0c;\u8c37\u6b4c\u63a8\u51fa\u4e86\u4e00\u7cfb\u5217\u4ee4\u4eba\u77a9\u76ee\u7684\u521b\u65b0\u6a21\u578b&#xff0c;\u5982 BERT&#xff08;Bidirectional Encoder Representations from Transformers&#xff09;\u3001Transformer \u4ee5\u53ca T5&#xff08;Text-to-Text Transfer Transformer&#xff09;\u3002\u8fd9\u4e9b\u6280\u672f\u6210\u4e3a\u4e86\u81ea\u7136\u8bed\u8a00\u5904\u7406&#xff08;NLP&#xff09;\u9886\u57df\u7684\u6807\u6746&#xff0c;\u5e76\u5bf9\u5168\u7403 AI \u6280\u672f\u7684\u53d1\u5c55\u8d77\u5230\u4e86\u63a8\u52a8\u4f5c\u7528\u3002<\/p>\n<p>\u800c\u5982\u4eca&#xff0c;\u968f\u7740\u5927\u6a21\u578b\u7684\u51fa\u73b0&#xff0c;\u8c37\u6b4c\u7684 AI \u7814\u7a76\u8fdb\u5165\u4e86\u4e00\u4e2a\u65b0\u7684\u9636\u6bb5\u3002\u6700\u65b0\u53d1\u5e03\u7684 Gemini 2.5 Pro \u6b63\u662f\u8fd9\u4e00\u9636\u6bb5\u7684\u91cd\u8981\u4ea7\u7269\u3002Gemini 2.5 Pro \u662f\u8c37\u6b4c AI \u5728\u63a8\u7406\u80fd\u529b\u3001\u591a\u4efb\u52a1\u5904\u7406\u7b49\u65b9\u9762\u7684\u91cd\u5927\u7a81\u7834&#xff0c;\u6807\u5fd7\u7740\u8c37\u6b4c\u5728\u4eba\u5de5\u667a\u80fd\u6280\u672f\u9886\u57df\u7684\u6301\u7eed\u9886\u5148\u5730\u4f4d\u3002<\/p>\n<hr \/>\n<h2 id=\"2.%20Gemini%202.5%20Pro%20%E4%BB%8B%E7%BB%8D%EF%BC%9A%E6%A8%A1%E5%9E%8B%E6%9E%B6%E6%9E%84%E4%B8%8E%E7%89%B9%E7%82%B9\">2. Gemini 2.5 Pro \u4ecb\u7ecd&#xff1a;\u6a21\u578b\u67b6\u6784\u4e0e\u7279\u70b9<\/h2>\n<p>Gemini 2.5 Pro \u4f5c\u4e3a\u8c37\u6b4c\u65b0\u4e00\u4ee3\u5927\u89c4\u6a21\u8bed\u8a00\u6a21\u578b&#xff0c;\u91c7\u7528\u4e86\u6df1\u5ea6\u4f18\u5316\u7684 Transformer \u67b6\u6784\u3002\u901a\u8fc7\u5927\u89c4\u6a21\u7684\u591a\u6a21\u6001\u8bad\u7ec3\u6570\u636e&#xff08;\u5305\u62ec\u6587\u672c\u3001\u56fe\u50cf\u548c\u8bed\u97f3&#xff09;&#xff0c;\u6a21\u578b\u5728\u591a\u4e2a\u4efb\u52a1\u4e0a\u5c55\u73b0\u4e86\u8d85\u4e4e\u5bfb\u5e38\u7684\u80fd\u529b\u3002<\/p>\n<ul>\n<li>\n<p>\u6a21\u578b\u67b6\u6784&#xff1a; Gemini 2.5 Pro \u57fa\u4e8e Transformer \u67b6\u6784&#xff0c;\u91c7\u7528\u4e86\u591a\u5c42\u7684\u81ea\u6ce8\u610f\u529b\u673a\u5236&#xff08;Self-Attention&#xff09;&#xff0c;\u4f7f\u5f97\u6a21\u578b\u80fd\u591f\u9ad8\u6548\u5730\u6355\u6349\u957f\u8ddd\u79bb\u4f9d\u8d56&#xff0c;\u7406\u89e3\u590d\u6742\u7684\u8bed\u8a00\u7ed3\u6784\u3002\u540c\u65f6&#xff0c;\u6a21\u578b\u7684\u6df1\u5ea6\u548c\u89c4\u6a21&#xff08;\u5305\u542b\u6570\u767e\u4ebf\u53c2\u6570&#xff09;\u4f7f\u5f97\u5176\u5728\u591a\u4efb\u52a1\u5904\u7406\u3001\u63a8\u7406\u901f\u5ea6\u7b49\u65b9\u9762\u8868\u73b0\u4f18\u5f02\u3002<\/p>\n<\/li>\n<li>\n<p>\u8bad\u7ec3\u6570\u636e\u4e0e\u591a\u6a21\u6001\u80fd\u529b&#xff1a; \u4e0e\u4f20\u7edf\u6a21\u578b\u4e0d\u540c&#xff0c;Gemini 2.5 Pro \u91c7\u7528\u4e86\u5927\u89c4\u6a21\u7684 \u591a\u6a21\u6001\u6570\u636e\u96c6&#xff0c;\u5305\u62ec\u6587\u672c\u3001\u56fe\u50cf\u548c\u8bed\u97f3\u3002\u8fd9\u4f7f\u5f97\u6a21\u578b\u80fd\u591f\u5728\u4e0d\u540c\u7c7b\u578b\u7684\u8f93\u5165\u6570\u636e\u4e4b\u95f4\u5b9e\u73b0\u66f4\u9ad8\u6548\u7684\u4fe1\u606f\u878d\u5408\u3002\u4f8b\u5982&#xff0c;\u5b83\u53ef\u4ee5\u540c\u65f6\u5904\u7406\u6765\u81ea\u4e0d\u540c\u4f20\u611f\u5668&#xff08;\u5982\u56fe\u50cf\u548c\u97f3\u9891&#xff09;\u7684\u8f93\u5165&#xff0c;\u5728\u89c6\u89c9\u548c\u8bed\u8a00\u7684\u4efb\u52a1\u4e2d\u90fd\u80fd\u5b9e\u73b0\u4f18\u79c0\u7684\u8868\u73b0\u3002<\/p>\n<\/li>\n<li>\n<p>\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3&#xff1a; \u4e3a\u4e86\u63d0\u9ad8\u8bad\u7ec3\u6548\u7387\u548c\u51cf\u5c0f\u8ba1\u7b97\u5f00\u9500&#xff0c;Gemini 2.5 Pro \u5728\u8bad\u7ec3\u65f6\u91c7\u7528\u4e86 \u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u3002\u901a\u8fc7\u4f7f\u7528\u4f4e\u7cbe\u5ea6\u8fd0\u7b97\u6765\u52a0\u901f\u8ba1\u7b97\u8fc7\u7a0b&#xff0c;\u540c\u65f6\u4fdd\u8bc1\u7ed3\u679c\u7684\u51c6\u786e\u6027\u548c\u6a21\u578b\u7684\u7a33\u5b9a\u6027&#xff0c;\u8fd9\u79cd\u65b9\u6cd5\u663e\u8457\u51cf\u5c11\u4e86\u8ba1\u7b97\u8d44\u6e90\u7684\u9700\u6c42\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2 id=\"3.%20Gemini%202.5%20Pro%20%E7%9A%84%E6%8A%80%E6%9C%AF%E4%BC%98%E5%8A%BF%EF%BC%9A%E6%8E%A8%E7%90%86%E8%83%BD%E5%8A%9B%E3%80%81%E5%A4%9A%E4%BB%BB%E5%8A%A1%E5%A4%84%E7%90%86\" style=\"background-color:transparent\">3. Gemini 2.5 Pro \u7684\u6280\u672f\u4f18\u52bf&#xff1a;\u63a8\u7406\u80fd\u529b\u3001\u591a\u4efb\u52a1\u5904\u7406<\/h2>\n<p>\u63a8\u7406\u80fd\u529b&#xff1a;<\/p>\n<p>\u63a8\u7406\u80fd\u529b\u5bf9\u4e8e\u5927\u6a21\u578b\u7684\u5b9e\u7528\u6027\u81f3\u5173\u91cd\u8981\u3002Gemini 2.5 Pro \u5728\u63a8\u7406\u901f\u5ea6\u548c\u751f\u6210\u8d28\u91cf\u4e0a\u8868\u73b0\u51fa\u8272&#xff0c;\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4f4e\u5ef6\u8fdf\u54cd\u5e94&#xff1a; \u5728\u786c\u4ef6\u52a0\u901f\u7684\u652f\u6301\u4e0b&#xff0c;Gemini 2.5 Pro \u80fd\u591f\u63d0\u4f9b\u6781\u4f4e\u7684\u63a8\u7406\u5ef6\u8fdf\u3002\u5728\u4e00\u4e9b\u5b9e\u65f6\u4efb\u52a1\u4e2d&#xff08;\u4f8b\u5982\u5b9e\u65f6\u7ffb\u8bd1\u548c\u667a\u80fd\u5ba2\u670d&#xff09;&#xff0c;\u5b83\u80fd\u591f\u4ee5\u975e\u5e38\u5feb\u901f\u7684\u901f\u5ea6\u751f\u6210\u9ad8\u8d28\u91cf\u7684\u6587\u672c\u8f93\u51fa\u3002<\/p>\n<\/li>\n<li>\n<p>\u9ad8\u751f\u6210\u8d28\u91cf&#xff1a; Gemini 2.5 Pro \u5728\u6587\u672c\u751f\u6210\u65b9\u9762\u8868\u73b0\u975e\u5e38\u51fa\u8272\u3002\u65e0\u8bba\u662f\u65b0\u95fb\u6458\u8981\u3001\u5bf9\u8bdd\u751f\u6210&#xff0c;\u8fd8\u662f\u590d\u6742\u7684\u63a8\u7406\u4efb\u52a1&#xff0c;\u751f\u6210\u7684\u6587\u672c\u90fd\u5177\u5907\u9ad8\u5ea6\u7684\u8fde\u8d2f\u6027\u548c\u521b\u9020\u6027\u3002\u5728\u751f\u6210\u81ea\u7136\u8bed\u8a00\u65f6&#xff0c;\u6a21\u578b\u80fd\u591f\u7406\u89e3\u4e0a\u4e0b\u6587&#xff0c;\u751f\u6210\u8d34\u5408\u9700\u6c42\u7684\u7b54\u6848\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u591a\u4efb\u52a1\u5904\u7406\u80fd\u529b&#xff1a;<\/p>\n<p>\u968f\u7740\u4efb\u52a1\u590d\u6742\u5ea6\u7684\u63d0\u5347&#xff0c;\u4f20\u7edf\u7684\u8bed\u8a00\u6a21\u578b\u901a\u5e38\u4f1a\u9762\u4e34\u65e0\u6cd5\u9ad8\u6548\u5e94\u5bf9\u591a\u4efb\u52a1\u7684\u5c40\u9650\u3002Gemini 2.5 Pro \u5728\u591a\u4efb\u52a1\u5b66\u4e60\u65b9\u9762\u505a\u51fa\u4e86\u91cd\u8981\u4f18\u5316&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u591a\u4efb\u52a1\u5b66\u4e60&#xff08;MTL&#xff09;&#xff1a; Gemini 2.5 Pro \u80fd\u591f\u540c\u65f6\u6267\u884c\u591a\u4e2a\u4e0d\u540c\u7684\u4efb\u52a1&#xff0c;\u800c\u4e0d\u4f1a\u663e\u8457\u964d\u4f4e\u6bcf\u4e2a\u4efb\u52a1\u7684\u6027\u80fd\u3002\u901a\u8fc7\u5171\u4eab\u6a21\u578b\u7684\u53c2\u6570&#xff0c;\u5728\u540c\u4e00\u6a21\u578b\u4e2d\u5904\u7406\u60c5\u611f\u5206\u6790\u3001\u673a\u5668\u7ffb\u8bd1\u3001\u6587\u672c\u751f\u6210\u7b49\u591a\u4e2a\u4efb\u52a1&#xff0c;\u6a21\u578b\u80fd\u591f\u9ad8\u6548\u5730\u5728\u4e0d\u540c\u4efb\u52a1\u4e4b\u95f4\u5207\u6362&#xff0c;\u5e76\u751f\u6210\u4f18\u8d28\u7684\u8f93\u51fa\u3002<\/p>\n<\/li>\n<li>\n<p>\u8de8\u4efb\u52a1\u8fc1\u79fb\u80fd\u529b&#xff1a; Gemini 2.5 Pro \u5728\u8de8\u9886\u57df\u5e94\u7528\u65f6\u5c55\u73b0\u51fa\u4e86\u826f\u597d\u7684\u8fc1\u79fb\u80fd\u529b\u3002\u65e0\u8bba\u662f\u4ece\u65b0\u95fb\u62a5\u9053\u8f6c\u5411\u6280\u672f\u6587\u732e&#xff0c;\u8fd8\u662f\u4ece\u793e\u4ea4\u5a92\u4f53\u6587\u672c\u8fc1\u79fb\u5230\u6cd5\u5f8b\u6587\u4e66&#xff0c;\u6a21\u578b\u90fd\u80fd\u5feb\u901f\u9002\u5e94\u65b0\u4efb\u52a1&#xff0c;\u5e76\u4fdd\u6301\u9ad8\u6548\u7684\u8868\u73b0\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2 id=\"4.%20%E6%96%B0%E5%A2%9E%E5%8A%9F%E8%83%BD%E4%B8%8E%E5%BA%94%E7%94%A8%EF%BC%9A%E5%A4%9A%E6%A8%A1%E6%80%81%E8%BE%93%E5%85%A5%E5%A4%84%E7%90%86%E4%B8%8E%E8%B7%A8%E6%A8%A1%E6%80%81%E4%BB%BB%E5%8A%A1\" style=\"background-color:transparent\">4. \u65b0\u589e\u529f\u80fd\u4e0e\u5e94\u7528&#xff1a;\u591a\u6a21\u6001\u8f93\u5165\u5904\u7406\u4e0e\u8de8\u6a21\u6001\u4efb\u52a1<\/h2>\n<p>Gemini 2.5 Pro \u7684\u53e6\u4e00\u5927\u4eae\u70b9\u662f\u5176\u5bf9\u591a\u6a21\u6001\u8f93\u5165\u7684\u652f\u6301\u3002\u4f20\u7edf\u7684 NLP \u6a21\u578b\u53ea\u80fd\u5904\u7406\u6587\u672c\u8f93\u5165&#xff0c;\u4f46\u968f\u7740\u5e94\u7528\u573a\u666f\u7684\u591a\u6837\u5316&#xff0c;\u8d8a\u6765\u8d8a\u591a\u7684\u5e94\u7528\u5f00\u59cb\u4f9d\u8d56\u4e8e\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u8f93\u5165&#xff0c;\u5982\u56fe\u50cf\u3001\u97f3\u9891\u548c\u89c6\u9891\u3002Gemini 2.5 Pro \u901a\u8fc7\u5f15\u5165 \u591a\u6a21\u6001\u8f93\u5165&#xff0c;\u80fd\u591f\u540c\u65f6\u5904\u7406\u591a\u79cd\u8f93\u5165\u7c7b\u578b&#xff0c;\u6781\u5927\u62d3\u5c55\u4e86\u5176\u5e94\u7528\u8303\u56f4\u3002<\/p>\n<h3 id=\"4.1%20%E5%9B%BE%E5%83%8F%E5%92%8C%E6%96%87%E6%9C%AC%E7%9A%84%E8%81%94%E5%90%88%E6%8E%A8%E7%90%86%EF%BC%9A\" style=\"background-color:transparent\">4.1 \u56fe\u50cf\u548c\u6587\u672c\u7684\u8054\u5408\u63a8\u7406&#xff1a;<\/h3>\n<p>\u4e00\u79cd\u5178\u578b\u7684\u5e94\u7528\u573a\u666f\u662f \u56fe\u50cf\u63cf\u8ff0\u751f\u6210&#xff08;Image Captioning&#xff09;\u3002\u4f20\u7edf\u7684\u56fe\u50cf\u63cf\u8ff0\u751f\u6210\u4efb\u52a1\u901a\u5e38\u4f9d\u8d56\u4e8e\u8ba1\u7b97\u673a\u89c6\u89c9\u6a21\u578b\u8fdb\u884c\u56fe\u50cf\u5206\u6790&#xff0c;\u7136\u540e\u518d\u4f7f\u7528\u8bed\u8a00\u6a21\u578b\u751f\u6210\u63cf\u8ff0\u6587\u672c\u3002Gemini 2.5 Pro \u5219\u80fd\u591f\u76f4\u63a5\u5728\u4e00\u4e2a\u7edf\u4e00\u7684\u6a21\u578b\u67b6\u6784\u4e2d\u5904\u7406\u56fe\u50cf\u548c\u6587\u672c&#xff0c;\u901a\u8fc7\u591a\u6a21\u6001\u5b66\u4e60\u6765\u751f\u6210\u66f4\u52a0\u51c6\u786e\u7684\u56fe\u50cf\u63cf\u8ff0\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5904\u7406\u56fe\u50cf\u548c\u6587\u672c\u8054\u5408\u63a8\u7406\u7684\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p>from transformers import GeminiModel, GeminiTokenizer<br \/>\nfrom PIL import Image<\/p>\n<p># \u52a0\u8f7d\u9884\u8bad\u7ec3\u6a21\u578b\u548c\u5206\u8bcd\u5668<br \/>\nmodel &#061; GeminiModel.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<br \/>\ntokenizer &#061; GeminiTokenizer.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<\/p>\n<p># \u52a0\u8f7d\u56fe\u50cf<br \/>\nimage_path &#061; &#034;example_image.jpg&#034;<br \/>\nimage &#061; Image.open(image_path)<\/p>\n<p># \u8f93\u5165\u6587\u672c&#xff0c;\u8981\u6c42\u6a21\u578b\u63cf\u8ff0\u56fe\u50cf\u5185\u5bb9<br \/>\ninput_text &#061; &#034;Describe the content of this image.&#034;<\/p>\n<p># \u5904\u7406\u6587\u672c\u8f93\u5165<br \/>\ninputs_text &#061; tokenizer(input_text, return_tensors&#061;&#034;pt&#034;)<\/p>\n<p># \u5904\u7406\u56fe\u50cf\u8f93\u5165&#xff08;\u5047\u8bbe\u6a21\u578b\u652f\u6301\u6b64\u5904\u7406\u529f\u80fd&#xff09;<br \/>\ninputs_image &#061; model.preprocess_image(image)  # \u5047\u8bbe\u6b64\u65b9\u6cd5\u4f1a\u5904\u7406\u56fe\u50cf<\/p>\n<p># \u83b7\u53d6\u6a21\u578b\u8f93\u51fa<br \/>\noutputs &#061; model(input_text&#061;inputs_text, input_image&#061;inputs_image)<\/p>\n<p># \u89e3\u7801\u751f\u6210\u7684\u6587\u672c<br \/>\ngenerated_text &#061; tokenizer.decode(outputs.logits.argmax(dim&#061;-1), skip_special_tokens&#061;True)<\/p>\n<p>print(f&#034;Generated Image Description: {generated_text}&#034;) <\/p>\n<p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d&#xff0c;\u6a21\u578b\u63a5\u6536\u56fe\u50cf\u548c\u6587\u672c\u8f93\u5165&#xff0c;\u751f\u6210\u5bf9\u56fe\u50cf\u5185\u5bb9\u7684\u63cf\u8ff0\u3002\u8fd9\u79cd\u591a\u6a21\u6001\u8f93\u5165\u5904\u7406\u7684\u80fd\u529b&#xff0c;\u4f7f\u5f97 Gemini 2.5 Pro \u5728\u56fe\u50cf\u751f\u6210\u3001\u89c6\u89c9\u95ee\u7b54\u7b49\u5e94\u7528\u4e2d\u8868\u73b0\u4f18\u5f02\u3002<\/p>\n<h3 id=\"4.2%20%E9%9F%B3%E9%A2%91%E4%B8%8E%E6%96%87%E6%9C%AC%E7%9A%84%E8%81%94%E5%90%88%E6%8E%A8%E7%90%86%EF%BC%9A\">4.2 \u97f3\u9891\u4e0e\u6587\u672c\u7684\u8054\u5408\u63a8\u7406&#xff1a;<\/h3>\n<p>\u9664\u4e86\u56fe\u50cf\u548c\u6587\u672c&#xff0c;Gemini 2.5 Pro \u8fd8\u652f\u6301 \u97f3\u9891\u8f93\u5165&#xff0c;\u8fd9\u4e00\u529f\u80fd\u4f7f\u5176\u80fd\u591f\u5904\u7406\u66f4\u5e7f\u6cdb\u7684\u591a\u6a21\u6001\u4efb\u52a1\u3002\u4f8b\u5982&#xff0c;\u8bed\u97f3\u8bc6\u522b\u548c\u8bed\u97f3\u751f\u6210\u662f\u8bed\u97f3\u6280\u672f\u4e2d\u975e\u5e38\u91cd\u8981\u7684\u4efb\u52a1\u3002\u5229\u7528 Gemini 2.5 Pro&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5c06\u97f3\u9891\u6570\u636e\u4e0e\u6587\u672c\u7ed3\u5408&#xff0c;\u901a\u8fc7\u6a21\u578b\u751f\u6210\u5bf9\u5e94\u7684\u6587\u5b57\u5185\u5bb9\u6216\u8fdb\u884c\u8bed\u97f3\u7ffb\u8bd1\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u5982\u4f55\u5c06\u97f3\u9891\u4e0e\u6587\u672c\u7ed3\u5408\u7684\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p>from transformers import GeminiModel, GeminiTokenizer<br \/>\nimport librosa<\/p>\n<p># \u52a0\u8f7d\u9884\u8bad\u7ec3\u6a21\u578b\u548c\u5206\u8bcd\u5668<br \/>\nmodel &#061; GeminiModel.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<br \/>\ntokenizer &#061; GeminiTokenizer.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<\/p>\n<p># \u52a0\u8f7d\u97f3\u9891\u6587\u4ef6<br \/>\naudio_path &#061; &#034;example_audio.wav&#034;<br \/>\naudio_data, _ &#061; librosa.load(audio_path, sr&#061;16000)<\/p>\n<p># \u8f93\u5165\u6587\u672c<br \/>\ninput_text &#061; &#034;Transcribe the audio to text.&#034;<\/p>\n<p># \u5904\u7406\u97f3\u9891\u8f93\u5165&#xff08;\u5047\u8bbe\u6a21\u578b\u652f\u6301\u6b64\u5904\u7406\u529f\u80fd&#xff09;<br \/>\ninputs_audio &#061; model.preprocess_audio(audio_data)  # \u5047\u8bbe\u6b64\u65b9\u6cd5\u4f1a\u5904\u7406\u97f3\u9891<\/p>\n<p># \u5904\u7406\u6587\u672c\u8f93\u5165<br \/>\ninputs_text &#061; tokenizer(input_text, return_tensors&#061;&#034;pt&#034;)<\/p>\n<p># \u83b7\u53d6\u6a21\u578b\u8f93\u51fa<br \/>\noutputs &#061; model(input_text&#061;inputs_text, input_audio&#061;inputs_audio)<\/p>\n<p># \u89e3\u7801\u751f\u6210\u7684\u6587\u672c<br \/>\ngenerated_text &#061; tokenizer.decode(outputs.logits.argmax(dim&#061;-1), skip_special_tokens&#061;True)<\/p>\n<p>print(f&#034;Transcribed Text: {generated_text}&#034;) <\/p>\n<p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d&#xff0c;\u97f3\u9891\u8f93\u5165\u88ab\u5904\u7406\u5e76\u4e0e\u6587\u672c\u8f93\u5165\u7ed3\u5408&#xff0c;\u6a21\u578b\u80fd\u591f\u6839\u636e\u8f93\u5165\u7684\u97f3\u9891\u6587\u4ef6\u751f\u6210\u5bf9\u5e94\u7684\u6587\u672c\u3002\u8fd9\u79cd\u80fd\u529b\u5728\u8bed\u97f3\u8bc6\u522b\u548c\u8bed\u97f3\u5230\u6587\u672c\u751f\u6210\u7684\u5e94\u7528\u4e2d&#xff0c;\u5177\u6709\u91cd\u8981\u7684\u610f\u4e49\u3002<\/p>\n<hr \/>\n<h2 id=\"5.%20%E8%AF%84%E6%B5%8B%E7%BB%93%E6%9E%9C%E4%B8%8E%E5%AF%B9%E6%AF%94%E5%88%86%E6%9E%90%EF%BC%9A%E4%B8%8E%E5%85%B6%E4%BB%96%E5%A4%A7%E6%A8%A1%E5%9E%8B%E7%9A%84%E6%A8%AA%E5%90%91%E6%AF%94%E8%BE%83\" style=\"background-color:transparent\">5. \u8bc4\u6d4b\u7ed3\u679c\u4e0e\u5bf9\u6bd4\u5206\u6790&#xff1a;\u4e0e\u5176\u4ed6\u5927\u6a21\u578b\u7684\u6a2a\u5411\u6bd4\u8f83<\/h2>\n<p>\u5728\u5168\u7403\u6743\u5a01\u7684 AI \u8bc4\u6d4b\u699c\u5355\u4e2d&#xff0c;Gemini 2.5 Pro \u83b7\u5f97\u4e86\u6781\u9ad8\u7684\u8bc4\u4ef7&#xff0c;\u5c24\u5176\u662f\u5728 \u63a8\u7406\u901f\u5ea6\u3001\u751f\u6210\u8d28\u91cf \u548c \u591a\u4efb\u52a1\u5904\u7406\u80fd\u529b \u4e0a\u8868\u73b0\u5c24\u4e3a\u7a81\u51fa\u3002<\/p>\n<ul>\n<li>\n<p>\u4e0e GPT-4 \u7684\u5bf9\u6bd4&#xff1a; \u5728\u63a8\u7406\u901f\u5ea6\u548c\u751f\u6210\u8d28\u91cf\u65b9\u9762&#xff0c;Gemini 2.5 Pro \u8868\u73b0\u66f4\u4e3a\u51fa\u8272\u3002\u5c3d\u7ba1 GPT-4 \u5728\u751f\u6210\u7684\u521b\u9020\u6027\u548c\u591a\u6837\u6027\u4e0a\u6709\u4e00\u5b9a\u4f18\u52bf&#xff0c;\u4f46\u5728\u63a8\u7406\u901f\u5ea6\u4e0a&#xff0c;Gemini 2.5 Pro \u63d0\u4f9b\u4e86\u66f4\u4f4e\u7684\u5ef6\u8fdf&#xff0c;\u4f7f\u5176\u66f4\u9002\u5408\u5b9e\u65f6\u6027\u8981\u6c42\u9ad8\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e0e PaLM 2 \u7684\u5bf9\u6bd4&#xff1a; \u5728\u591a\u4efb\u52a1\u5904\u7406\u548c\u8de8\u9886\u57df\u8fc1\u79fb\u80fd\u529b\u4e0a&#xff0c;Gemini 2.5 Pro \u76f8\u6bd4 PaLM 2 \u66f4\u5177\u4f18\u52bf\u3002\u7279\u522b\u662f\u5728\u5904\u7406\u591a\u6a21\u6001\u8f93\u5165\u65f6&#xff0c;Gemini 2.5 Pro \u5c55\u73b0\u4e86\u66f4\u5f3a\u7684\u80fd\u529b&#xff0c;\u80fd\u591f\u5728\u6587\u672c\u3001\u56fe\u50cf\u3001\u97f3\u9891\u7b49\u591a\u79cd\u8f93\u5165\u6570\u636e\u4e4b\u95f4\u8fdb\u884c\u9ad8\u6548\u7684\u878d\u5408\u548c\u5904\u7406\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2 id=\"6.%20%E4%BB%A3%E7%A0%81%E4%BC%98%E5%8C%96%E4%B8%8E%E6%80%A7%E8%83%BD%E6%8F%90%E5%8D%87%EF%BC%9A\" style=\"background-color:transparent\">6. \u4ee3\u7801\u4f18\u5316\u4e0e\u6027\u80fd\u63d0\u5347&#xff1a;<\/h2>\n<p>\u968f\u7740 Gemini 2.5 Pro \u6a21\u578b\u80fd\u529b\u7684\u4e0d\u65ad\u63d0\u5347&#xff0c;\u5982\u4f55\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u4f18\u5316\u6a21\u578b\u7684\u6027\u80fd&#xff0c;\u4f7f\u5176\u5728\u4fdd\u8bc1\u9ad8\u7cbe\u5ea6\u7684\u540c\u65f6&#xff0c;\u53c8\u80fd\u591f\u9002\u5e94\u4f4e\u8d44\u6e90\u73af\u5883&#xff08;\u4f8b\u5982\u79fb\u52a8\u7aef\u6216\u8fb9\u7f18\u8bbe\u5907&#xff09;\u662f\u4e00\u4e2a\u91cd\u8981\u8bfe\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u4f18\u5316\u65b9\u6cd5&#xff1a;<\/p>\n<h3 id=\"6.1%20%E6%A8%A1%E5%9E%8B%E8%92%B8%E9%A6%8F%EF%BC%88Model%20Distillation%EF%BC%89\">6.1 \u6a21\u578b\u84b8\u998f&#xff08;Model Distillation&#xff09;<\/h3>\n<p>\u6a21\u578b\u84b8\u998f\u662f\u4e00\u79cd\u901a\u8fc7\u8bad\u7ec3\u5c0f\u578b\u6a21\u578b\u6a21\u4eff\u5927\u578b\u6a21\u578b\u7684\u884c\u4e3a\u7684\u6280\u672f\u3002\u901a\u8fc7\u84b8\u998f&#xff0c;\u80fd\u591f\u663e\u8457\u51cf\u5c0f\u6a21\u578b\u7684\u4f53\u79ef&#xff0c;\u540c\u65f6\u4fdd\u6301\u539f\u6709\u7684\u63a8\u7406\u6027\u80fd\u3002<\/p>\n<h4 id=\"6.1.1%20%E6%A8%A1%E5%9E%8B%E8%92%B8%E9%A6%8F%E4%BB%A3%E7%A0%81%E7%A4%BA%E4%BE%8B%EF%BC%9A\">6.1.1 \u6a21\u578b\u84b8\u998f\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/h4>\n<p>from transformers import GeminiModel, GeminiTokenizer<br \/>\nfrom torch import nn, optim<\/p>\n<p># \u52a0\u8f7d\u5927\u578b\u6a21\u578b&#xff08;\u6559\u5e08\u6a21\u578b&#xff09;<br \/>\nteacher_model &#061; GeminiModel.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<br \/>\nteacher_tokenizer &#061; GeminiTokenizer.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<\/p>\n<p># \u521b\u5efa\u5c0f\u578b\u5b66\u751f\u6a21\u578b&#xff08;\u5b66\u751f\u6a21\u578b&#xff09;<br \/>\nstudent_model &#061; GeminiModel.from_pretrained(&#034;google\/gemini-2.5-pro-small&#034;)<\/p>\n<p># \u5b9a\u4e49\u84b8\u998f\u635f\u5931\u51fd\u6570<br \/>\ndef distillation_loss(student_outputs, teacher_outputs, temperature&#061;2.0):<br \/>\n    soft_teacher_probs &#061; nn.functional.softmax(teacher_outputs.logits \/ temperature, dim&#061;-1)<br \/>\n    soft_student_probs &#061; nn.functional.softmax(student_outputs.logits \/ temperature, dim&#061;-1)<br \/>\n    loss &#061; nn.KLDivLoss()(soft_student_probs.log(), soft_teacher_probs)<br \/>\n    return loss<\/p>\n<p># \u8bad\u7ec3\u5c0f\u578b\u6a21\u578b<br \/>\noptimizer &#061; optim.Adam(student_model.parameters(), lr&#061;1e-4)<\/p>\n<p>for epoch in range(10):<br \/>\n    student_model.train()<br \/>\n    for batch in data_loader:<br \/>\n        # \u83b7\u53d6\u5b66\u751f\u548c\u6559\u5e08\u6a21\u578b\u7684\u8f93\u51fa<br \/>\n        student_outputs &#061; student_model(input_ids&#061;batch[&#039;input_ids&#039;])<br \/>\n        teacher_outputs &#061; teacher_model(input_ids&#061;batch[&#039;input_ids&#039;])<\/p>\n<p>        # \u8ba1\u7b97\u84b8\u998f\u635f\u5931<br \/>\n        loss &#061; distillation_loss(student_outputs, teacher_outputs)<\/p>\n<p>        optimizer.zero_grad()<br \/>\n        loss.backward()<br \/>\n        optimizer.step()<\/p>\n<p>    print(f&#034;Epoch {epoch&#043;1}, Loss: {loss.item()}&#034;) <\/p>\n<p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d&#xff0c;\u6211\u4eec\u901a\u8fc7 \u84b8\u998f\u635f\u5931 \u6765\u8bad\u7ec3\u5b66\u751f\u6a21\u578b&#xff0c;\u4ece\u800c\u4f7f\u5c0f\u578b\u6a21\u578b\u80fd\u591f\u6a21\u4eff\u5927\u578b\u6a21\u578b\u7684\u63a8\u7406\u884c\u4e3a\u3002\u84b8\u998f\u6280\u672f\u5728\u4fdd\u8bc1\u6a21\u578b\u6027\u80fd\u7684\u540c\u65f6&#xff0c;\u80fd\u591f\u6709\u6548\u51cf\u5c11\u8ba1\u7b97\u5f00\u9500&#xff0c;\u4f7f\u5f97\u6a21\u578b\u80fd\u591f\u90e8\u7f72\u5728\u8ba1\u7b97\u8d44\u6e90\u6709\u9650\u7684\u8bbe\u5907\u4e0a\u3002<\/p>\n<h3 id=\"6.2%20%E6%A8%A1%E5%9E%8B%E9%87%8F%E5%8C%96%EF%BC%88Model%20Quantization%EF%BC%89\">6.2 \u6a21\u578b\u91cf\u5316&#xff08;Model Quantization&#xff09;<\/h3>\n<p>\u6a21\u578b\u91cf\u5316\u662f\u53e6\u4e00\u79cd\u5e38\u89c1\u7684\u4f18\u5316\u65b9\u6cd5&#xff0c;\u901a\u8fc7\u51cf\u5c11\u6a21\u578b\u53c2\u6570\u7684\u7cbe\u5ea6&#xff08;\u4f8b\u5982\u4ece\u6d6e\u52a8\u7cbe\u5ea6\u964d\u4f4e\u5230\u6574\u6570\u7cbe\u5ea6&#xff09;\u6765\u964d\u4f4e\u6a21\u578b\u7684\u8ba1\u7b97\u548c\u5b58\u50a8\u9700\u6c42\u3002<\/p>\n<p>\u91cf\u5316\u7684\u57fa\u672c\u4ee3\u7801\u793a\u4f8b\u5982\u4e0b&#xff1a;<\/p>\n<p>from torch.quantization import quantize_dynamic<br \/>\nfrom transformers import GeminiModel<\/p>\n<p># \u52a0\u8f7d\u9884\u8bad\u7ec3\u6a21\u578b<br \/>\nmodel &#061; GeminiModel.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<\/p>\n<p># \u52a8\u6001\u91cf\u5316\u6a21\u578b<br \/>\nquantized_model &#061; quantize_dynamic(model, {nn.Linear}, dtype&#061;torch.qint8)<\/p>\n<p># \u4fdd\u5b58\u91cf\u5316\u540e\u7684\u6a21\u578b<br \/>\nquantized_model.save_pretrained(&#034;quantized_gemini_model&#034;) <\/p>\n<p>\u901a\u8fc7\u91cf\u5316&#xff0c;\u6211\u4eec\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u6a21\u578b\u7684\u5b58\u50a8\u7a7a\u95f4\u548c\u8ba1\u7b97\u8d1f\u8f7d&#xff0c;\u7279\u522b\u662f\u5728\u8fb9\u7f18\u8bbe\u5907\u6216\u79fb\u52a8\u7aef\u90e8\u7f72\u65f6&#xff0c;\u91cf\u5316\u80fd\u591f\u6709\u6548\u63d0\u5347\u6a21\u578b\u7684\u63a8\u7406\u901f\u5ea6\u3002<\/p>\n<hr \/>\n<h2 id=\"7.%20%E7%9B%B8%E5%85%B3%E4%BB%A3%E7%A0%81%E5%AE%9E%E7%8E%B0%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20Gemini%202.5%20Pro%20%E6%A8%A1%E5%9E%8B\" style=\"background-color:transparent\">7. \u76f8\u5173\u4ee3\u7801\u5b9e\u73b0&#xff1a;\u5982\u4f55\u4f7f\u7528 Gemini 2.5 Pro \u6a21\u578b<\/h2>\n<p>\u5728\u8fd9\u4e00\u90e8\u5206&#xff0c;\u6211\u4eec\u5c06\u63d0\u4f9b\u51e0\u4e2a\u4ee3\u7801\u793a\u4f8b&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u4e0a\u624b Gemini 2.5 Pro\u3002<\/p>\n<h3 id=\"7.1%20%E6%96%87%E6%9C%AC%E7%94%9F%E6%88%90%EF%BC%9A\">7.1 \u6587\u672c\u751f\u6210&#xff1a;<\/h3>\n<p>from transformers import GeminiModel, GeminiTokenizer<\/p>\n<p># \u52a0\u8f7d\u9884\u8bad\u7ec3\u6a21\u578b\u548c\u5206\u8bcd\u5668<br \/>\nmodel &#061; GeminiModel.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<br \/>\ntokenizer &#061; GeminiTokenizer.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<\/p>\n<p># \u8f93\u5165\u6587\u672c<br \/>\ninput_text &#061; &#034;What are the latest trends in artificial intelligence?&#034;<\/p>\n<p># \u5c06\u8f93\u5165\u6587\u672c\u8f6c\u5316\u4e3a\u6a21\u578b\u8f93\u5165<br \/>\ninputs &#061; tokenizer(input_text, return_tensors&#061;&#034;pt&#034;)<\/p>\n<p># \u83b7\u53d6\u6a21\u578b\u8f93\u51fa<br \/>\noutputs &#061; model(**inputs)<\/p>\n<p># \u89e3\u7801\u751f\u6210\u7684\u6587\u672c<br \/>\ngenerated_text &#061; tokenizer.decode(outputs.logits.argmax(dim&#061;-1), skip_special_tokens&#061;True)<\/p>\n<p>print(generated_text) <\/p>\n<h3 id=\"7.2%20%E5%A4%9A%E4%BB%BB%E5%8A%A1%E5%A4%84%E7%90%86%EF%BC%9A%E6%83%85%E6%84%9F%E5%88%86%E6%9E%90%E4%B8%8E%E6%96%87%E6%9C%AC%E7%94%9F%E6%88%90\" style=\"background-color:transparent\">7.2 \u591a\u4efb\u52a1\u5904\u7406&#xff1a;\u60c5\u611f\u5206\u6790\u4e0e\u6587\u672c\u751f\u6210<\/h3>\n<p>from transformers import GeminiModel, GeminiTokenizer<\/p>\n<p># \u52a0\u8f7d\u6a21\u578b\u548c\u5206\u8bcd\u5668<br \/>\nmodel &#061; GeminiModel.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<br \/>\ntokenizer &#061; GeminiTokenizer.from_pretrained(&#034;google\/gemini-2.5-pro&#034;)<\/p>\n<p># \u60c5\u611f\u5206\u6790\u4efb\u52a1<br \/>\ninput_text_sentiment &#061; &#034;I love this new phone!&#034;<br \/>\ninputs_sentiment &#061; tokenizer(input_text_sentiment, return_tensors&#061;&#034;pt&#034;)<br \/>\noutputs_sentiment &#061; model(**inputs_sentiment)<br \/>\nsentiment &#061; outputs_sentiment.logits.argmax(dim&#061;-1).item()  # \u5047\u8bbe0\u4e3a\u8d1f\u9762&#xff0c;1\u4e3a\u6b63\u9762<\/p>\n<p># \u6587\u672c\u751f\u6210\u4efb\u52a1<br \/>\ninput_text_generate &#061; &#034;The future of AI in healthcare is&#034;<br \/>\ninputs_generate &#061; tokenizer(input_text_generate, return_tensors&#061;&#034;pt&#034;)<br \/>\noutputs_generate &#061; model(**inputs_generate)<br \/>\ngenerated_text &#061; tokenizer.decode(outputs_generate.logits.argmax(dim&#061;-1), skip_special_tokens&#061;True)<\/p>\n<p>print(f&#034;Sentiment: {&#039;Positive&#039; if sentiment &#061;&#061; 1 else &#039;Negative&#039;}&#034;)<br \/>\nprint(f&#034;Generated Text: {generated_text}&#034;) <\/p>\n<p>\u7ed3\u8bed<\/p>\n<p>Gemini 2.5 Pro \u7684\u591a\u6a21\u6001\u80fd\u529b\u4e0e\u5f3a\u5927\u7684\u591a\u4efb\u52a1\u5904\u7406\u80fd\u529b&#xff0c;\u4f7f\u5176\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u3001\u8ba1\u7b97\u673a\u89c6\u89c9\u3001\u8de8\u6a21\u6001\u63a8\u7406\u7b49\u9886\u57df\u4e2d\u5c55\u73b0\u51fa\u5de8\u5927\u7684\u6f5c\u529b\u3002\u65e0\u8bba\u662f\u56fe\u50cf\u63cf\u8ff0\u751f\u6210\u3001\u8de8\u6a21\u6001\u60c5\u611f\u5206\u6790&#xff0c;\u8fd8\u662f\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a\u7684\u9ad8\u6548\u63a8\u7406&#xff0c;Gemini 2.5 Pro \u90fd\u80fd\u591f\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u6781\u4e3a\u4e30\u5bcc\u548c\u7075\u6d3b\u7684\u5de5\u5177\u3002<\/p>\n<p>\u901a\u8fc7\u5b9e\u9645\u7684\u4ee3\u7801\u793a\u4f8b&#xff0c;\u6211\u4eec\u5c55\u793a\u4e86\u5982\u4f55\u5728\u4e0d\u540c\u573a\u666f\u4e2d\u5e94\u7528 Gemini 2.5 Pro&#xff0c;\u5e76\u63d0\u4f9b\u4e86\u4e00\u4e9b\u6a21\u578b\u4f18\u5316\u7684\u6280\u5de7&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u63d0\u5347\u5b9e\u9645\u5e94\u7528\u7684\u6027\u80fd\u3002\u672a\u6765&#xff0c;\u968f\u7740\u6280\u672f\u7684\u8fdb\u6b65\u548c\u4f18\u5316&#xff0c;Gemini 2.5 Pro \u7684\u5e94\u7528\u573a\u666f\u5c06\u66f4\u52a0\u5e7f\u6cdb&#xff0c;\u6211\u4eec\u671f\u5f85\u5b83\u5728\u5404\u884c\u5404\u4e1a\u4e2d\u53d1\u6325\u66f4\u5927\u7684\u4f5c\u7528\u3002<\/p>\n<\/p>\n<p>\u5b8c\u2014\u2014<\/p>\n<hr \/>\n<p>\u81f3\u6b64\u7ed3\u675f&#xff01;<\/p>\n<p>\u6211\u662f<span style=\"color:#4da8ee\">\u4e91\u8fb9\u6709\u4e2a\u7a3b\u8349\u4eba<\/span><\/p>\n<p>\u671f\u5f85\u4e0e\u4f60\u7684\u4e0b\u4e00\u6b21\u76f8\u9047&#xff01;<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e115\u6b21\uff0c\u6536\u85cf108\u6b21\u3002\u4f5c\u4e3a\u8c37\u6b4c\u65b0\u4e00\u4ee3\u5927\u89c4\u6a21\u8bed\u8a00\u6a21\u578b\uff0c\u91c7\u7528\u4e86\u6df1\u5ea6\u4f18\u5316\u7684\u3002<\/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":[2817,50,2818,2815,2819,2816,2507,2814],"topic":[],"class_list":["post-33781","post","type-post","status-publish","format-standard","hentry","category-server","tag-gemini-2-5-pro","tag-50","tag-2818","tag-2815","tag-2819","tag-2816","tag-2507","tag-2814"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8de8\u8d8a\u8fb9\u754c\u7684 AI \u53d8\u9769\uff1a\u63ed\u79d8 Gemini 2.5 Pro \u5982\u4f55\u98a0\u8986\u4f20\u7edf\u667a\u80fd\u5e94\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\/33781.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8de8\u8d8a\u8fb9\u754c\u7684 AI \u53d8\u9769\uff1a\u63ed\u79d8 Gemini 2.5 Pro \u5982\u4f55\u98a0\u8986\u4f20\u7edf\u667a\u80fd\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e115\u6b21\uff0c\u6536\u85cf108\u6b21\u3002\u4f5c\u4e3a\u8c37\u6b4c\u65b0\u4e00\u4ee3\u5927\u89c4\u6a21\u8bed\u8a00\u6a21\u578b\uff0c\u91c7\u7528\u4e86\u6df1\u5ea6\u4f18\u5316\u7684\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/33781.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-28T07:49:30+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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/33781.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/33781.html\",\"name\":\"\u8de8\u8d8a\u8fb9\u754c\u7684 AI \u53d8\u9769\uff1a\u63ed\u79d8 Gemini 2.5 Pro \u5982\u4f55\u98a0\u8986\u4f20\u7edf\u667a\u80fd\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-28T07:49:30+00:00\",\"dateModified\":\"2025-04-28T07:49:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/33781.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/33781.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/33781.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8de8\u8d8a\u8fb9\u754c\u7684 AI \u53d8\u9769\uff1a\u63ed\u79d8 Gemini 2.5 Pro \u5982\u4f55\u98a0\u8986\u4f20\u7edf\u667a\u80fd\u5e94\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":"\u8de8\u8d8a\u8fb9\u754c\u7684 AI \u53d8\u9769\uff1a\u63ed\u79d8 Gemini 2.5 Pro \u5982\u4f55\u98a0\u8986\u4f20\u7edf\u667a\u80fd\u5e94\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\/33781.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8de8\u8d8a\u8fb9\u754c\u7684 AI \u53d8\u9769\uff1a\u63ed\u79d8 Gemini 2.5 Pro \u5982\u4f55\u98a0\u8986\u4f20\u7edf\u667a\u80fd\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e115\u6b21\uff0c\u6536\u85cf108\u6b21\u3002\u4f5c\u4e3a\u8c37\u6b4c\u65b0\u4e00\u4ee3\u5927\u89c4\u6a21\u8bed\u8a00\u6a21\u578b\uff0c\u91c7\u7528\u4e86\u6df1\u5ea6\u4f18\u5316\u7684\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/33781.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-28T07:49:30+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/33781.html","url":"https:\/\/www.wsisp.com\/helps\/33781.html","name":"\u8de8\u8d8a\u8fb9\u754c\u7684 AI \u53d8\u9769\uff1a\u63ed\u79d8 Gemini 2.5 Pro \u5982\u4f55\u98a0\u8986\u4f20\u7edf\u667a\u80fd\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-28T07:49:30+00:00","dateModified":"2025-04-28T07:49:30+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/33781.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/33781.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/33781.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8de8\u8d8a\u8fb9\u754c\u7684 AI \u53d8\u9769\uff1a\u63ed\u79d8 Gemini 2.5 Pro \u5982\u4f55\u98a0\u8986\u4f20\u7edf\u667a\u80fd\u5e94\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\/33781","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=33781"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/33781\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=33781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=33781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=33781"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=33781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}