{"id":273,"date":"2025-03-31T08:37:28","date_gmt":"2025-03-31T00:37:28","guid":{"rendered":"http:\/\/52.76.12.94\/?p=273"},"modified":"2026-06-04T11:27:45","modified_gmt":"2026-06-04T03:27:45","slug":"amazon-bedrock-%e5%ae%9e%e8%b7%b5-%e5%88%a9%e7%94%a8-llama-3-2-%e6%a8%a1%e5%9e%8b%e5%88%86%e6%9e%90%e5%85%a8%e7%90%83%e7%b3%96%e5%b0%bf%e7%97%85%e8%b6%8b%e5%8a%bf","status":"publish","type":"post","link":"https:\/\/flycloud.io\/en\/2025\/03\/31\/amazon-bedrock-%e5%ae%9e%e8%b7%b5-%e5%88%a9%e7%94%a8-llama-3-2-%e6%a8%a1%e5%9e%8b%e5%88%86%e6%9e%90%e5%85%a8%e7%90%83%e7%b3%96%e5%b0%bf%e7%97%85%e8%b6%8b%e5%8a%bf\/","title":{"rendered":"Amazon Bedrock \u5b9e\u8df5 &#8211; \u5229\u7528 Llama 3.2 \u6a21\u578b\u5206\u6790\u5168\u7403\u7cd6\u5c3f\u75c5\u8d8b\u52bf"},"content":{"rendered":"<h3 class=\"wp-block-heading\" id=\"item-1\">\u6982\u8ff0<\/h3>\n\n\n\n<p>\u5728\u5927\u578b\u8bed\u8a00\u6a21\u578b\u9886\u57df\uff0c\u591a\u6a21\u6001\u6a21\u578b\u7684\u5f3a\u5927\u80fd\u529b\u5df2\u7ecf\u5f00\u59cb\u4e3a\u89e3\u51b3\u590d\u6742\u95ee\u9898\u5f00\u8f9f\u4e86\u65b0\u7684\u53ef\u80fd\u6027\u3002\u672c\u6587\u63a2\u8ba8\u7684\u95ee\u9898\u662f\u5206\u6790\u5168\u7403\u7cd6\u5c3f\u75c5\u60a3\u75c5\u7387\u8d8b\u52bf\uff0c\u8fd9\u662f\u4e00\u4e2a\u5173\u7cfb\u5230\u5168\u7403\u6570\u4ebf\u4eba\u7684\u91cd\u5927\u5065\u5eb7\u95ee\u9898\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5c06\u63a2\u8ba8\u5982\u4f55\u5728 Amazon Bedrock \u4e0a\uff0c\u4f7f\u7528 Meta Llama 3.2 90B Instruct \u6a21\u578b\u6765\u5206\u6790\u5168\u7403\u4e0d\u540c\u56fd\u5bb6\u6216\u5730\u533a\u7684\u7cd6\u5c3f\u75c5\u60a3\u8005\u7684\u60a3\u75c5\u7387\u5206\u5e03\u6570\u636e\u3002<\/p>\n\n\n\n<p>Meta \u5f00\u53d1\u7684 Llama 3.2 90B Instruct \u6a21\u578b\uff0c\u662f\u4e00\u79cd\u5148\u8fdb\u7684\u5177\u6709\u591a\u6a21\u6001\u80fd\u529b\u7684\u5927\u6a21\u578b\uff0c\u5b83\u80fd\u591f\u5904\u7406\u548c\u5206\u6790\u6587\u672c\u548c\u56fe\u50cf\uff0c\u8fd9\u4f7f\u5b83\u6210\u4e3a\u6211\u4eec\u5206\u6790\u5168\u7403\u7cd6\u5c3f\u75c5\u60a3\u8005\u7684\u60a3\u75c5\u7387\u6570\u636e\u7684\u7406\u60f3\u9009\u62e9\u4e4b\u4e00\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u5c06\u91c7\u7528\u8fd0\u884c\u5728 Amazon Bedrock \u7684 Llama 3.2 90B Instruct \u6a21\u578b\u6765\u8fdb\u884c\u5206\u6790\uff0cAmazon Bedrock \u4e0e\u6d41\u884c\u7684\u5148\u8fdb\u5927\u578b\u8bed\u8a00\u6a21\u578b\u65e0\u7f1d\u96c6\u6210\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u9ad8\u6548\u4e13\u4e1a\u5730\u521b\u5efa\u81ea\u5df1\u7684\u751f\u6210\u5f0f AI \u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"item-2\">\u591a\u6a21\u6001\u80fd\u529b\u548c\u57fa\u51c6<\/h3>\n\n\n\n<p>Meta \u5728\u5176\u5bf9\u5916\u53d1\u5e03\u7684\u8bba\u6587 \u201cThe Llama 3 Herd of Models\u201d \u4e4b\u4e2d\uff0c\u8be6\u7ec6\u9610\u91ca\u4e86\u5c06\u591a\u6a21\u6001\u80fd\u529b\u6dfb\u52a0\u5230 Llama 3 \u7cfb\u5217\u6a21\u578b\u7684\u7814\u7a76\u7ec4\u5408\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u4f1a\u7ecf\u8fc7\u4e94\u4e2a\u9636\u6bb5\u6765\u8bad\u7ec3\u591a\u6a21\u6001\u6a21\u578b\uff0c\u5206\u522b\u662f\uff1a<\/p>\n\n\n\n<p>(1) \u8bed\u8a00\u6a21\u578b\u9884\u8bad\u7ec3<\/p>\n\n\n\n<p>(2) \u591a\u6a21\u6001\u7f16\u7801\u5668\u9884\u8bad\u7ec3<\/p>\n\n\n\n<p>(3) \u89c6\u89c9\u9002\u914d\u5668\u8bad\u7ec3<\/p>\n\n\n\n<p>(4) \u6a21\u578b\u5fae\u8c03<\/p>\n\n\n\n<p>(5) \u8bed\u97f3\u9002\u914d\u5668\u8bad\u7ec3<\/p>\n\n\n\n<p>\u8be5\u8bba\u6587\u4e2d\u7684\u56fe\u793a\u8bf4\u660e\u4e86\u8fd9\u4e00\u8fc7\u7a0b\u3002<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"530\" src=\"http:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-1024x530.png\" alt=\"\" class=\"wp-image-341\" srcset=\"https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-1024x530.png 1024w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-300x155.png 300w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-768x398.png 768w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-18x9.png 18w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247.png 1080w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Source:<\/p>\n\n\n\n<p><a href=\"https:\/\/ai.meta.com\/research\/publications\/the-llama-3-herd-of...\">https:\/\/ai.meta.com\/research\/publications\/the-llama-3-herd-of&#8230;<\/a><\/p>\n\n\n\n<p>\u6765\u81ea llama.com \u7f51\u7ad9\u516c\u5f00\u7684\u6d4b\u8bd5\u6570\u636e\uff0c\u6bd4\u8f83\u4e86\u4e0d\u540c AI \u6a21\u578b\u5728\u5404\u79cd\u57fa\u51c6\u6d4b\u8bd5\u548c\u4efb\u52a1\u4e0a\u7684\u8868\u73b0\u3002\u4e0b\u8868\u5206\u4e3a\u201c\u5927\u5b66\u6c34\u5e73\u95ee\u9898\u548c\u6570\u5b66\u63a8\u7406\u201d\u548c\u201c\u56fe\u8868\u548c\u56fe\u89e3\u7406\u89e3\u201d\u4e24\u5927\u90e8\u5206\uff0c\u6bcf\u4e2a\u90e8\u5206\u4e0b\u53c8\u6709\u51e0\u4e2a\u5b50\u7c7b\u522b\u3002<\/p>\n\n\n\n<p>\u5728\u5927\u591a\u6570\u57fa\u51c6\u6d4b\u8bd5\u4e2d\uff0cLlama 3.2 90B \u6a21\u578b\u7684\u8868\u73b0\u666e\u904d\u4f18\u4e8e\u5176\u4ed6\u6a21\u578b\uff0c\u5728\u201cAI2 Diagram\u201d\u57fa\u51c6\u6d4b\u8bd5\u4e2d\uff0cLlama 3.2 90B \u6a21\u578b\u83b7\u5f97\u4e86 92.3% \u7684\u6700\u9ad8\u5206\uff01<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"484\" src=\"http:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-1-1024x484.png\" alt=\"\" class=\"wp-image-342\" srcset=\"https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-1-1024x484.png 1024w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-1-300x142.png 300w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-1-768x363.png 768w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-1-18x9.png 18w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-1.png 1080w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Source:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.llama.com\/?trk=cndc-detail\">https:\/\/www.llama.com\/?trk=cndc-detail<\/a><\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u4e2a\u5177\u4f53\u7684\u6848\u4f8b\u7814\u7a76\uff0c\u6f14\u793a\u5982\u4f55\u5728 Amazon Bedrock \u4e0a\u65b9\u4fbf\u9ad8\u6548\u5730\u5229\u7528 Llama 3.2 90B Instruct \u6a21\u578b\u7684\u591a\u6a21\u6001\u80fd\u529b\u3002\u6211\u4eec\u5c06\u4f7f\u7528\u8fd9\u4e2a\u6a21\u578b\u5206\u6790\u5168\u7403\u4e0d\u540c\u56fd\u5bb6\u548c\u5730\u533a\u7684\u7cd6\u5c3f\u75c5\u60a3\u75c5\u7387\u8d8b\u52bf\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"item-3\">\u524d\u671f\u51c6\u5907<\/h3>\n\n\n\n<p>\u6211\u4eec\u7684\u5206\u6790\u6570\u636e\u96c6\u662f\u4e00\u4e2a\u5305\u542b\u7cd6\u5c3f\u75c5\u6d41\u884c\u7387\u4fe1\u606f\u7684\u6570\u636e\u96c6\uff0c\u5176\u5305\u62ec\u76f8\u5173\u7684\u56fe\u50cf\u7b49\u3002\u5728\u6211\u4eec\u53ef\u4ee5\u5229\u7528 Meta Llama 3.2 90B Instruct \u6a21\u578b\u8fdb\u884c\u63a8\u7406\u4e4b\u524d\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u786e\u4fdd\u6211\u4eec\u7684\u56fe\u50cf\u6570\u636e\u4e0e\u5176\u8981\u6c42\u517c\u5bb9\u3002<\/p>\n\n\n\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u6211\u5f00\u53d1\u4e86\u4e00\u4e2a\u5b9e\u7528\u7684 Python \u7a0b\u5e8f\u51fd\u6570\uff08\u53ef\u5728 <a href=\"https:\/\/link.segmentfault.com\/?enc=WpoPxnMrfDtItpTW7u9hew%3D%3D.VvxqupvHn7pw3CscroJSm4gG%2BRn1Jza9WD5PWQ0hRvnQmeXXBeY4Xpczt3YT8VnvrQrJ5Klcc3KSq7eh6b8CZ5f5okaiXFOBHEYOqegyXTJlg9urI53v1iy4Fn3A%2FgxN\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/github.com\/hanyun2019\/bedrock-in-practice\/blob\/main\/utils.py?trk=cndc-detail<\/a> \u83b7\u5f97\uff09\uff0c\u7528\u4e8e\u8c03\u6574\u56fe\u50cf\u5927\u5c0f\u5e76\u786e\u4fdd\u7b26\u5408 Meta Llama 3.2 90B Instruct \u6a21\u578b\u89c4\u8303\u3002<\/p>\n\n\n\n<p>\u5206\u6790\u4e2d\u91c7\u7528\u7684\u4e24\u5f20\u5173\u4e8e\u7cd6\u5c3f\u75c5\u75c5\u60a3\u6570\u636e\u53ca\u8d8b\u52bf\u7684\u56fe\u50cf\u6765\u7f51\u7ad9\u5982\u4e0b\u6240\u793a\u3002\u8be5\u7f51\u7ad9\u6c47\u7f16\u4e86\u4e16\u754c\u94f6\u884c\uff082024 \u5e74\uff09\u4ece\u591a\u4e2a\u6765\u6e90\u6536\u96c6\u7684\u76f8\u5173\u6570\u636e\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/ourworldindata.org\/grapher\/diabetes-prevalence?trk=cn...\">https:\/\/ourworldindata.org\/grapher\/diabetes-prevalence?trk=cn&#8230;<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"item-4\">\u8bbe\u7f6e<\/h3>\n\n\n\n<p>\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u5bfc\u5165\u5fc5\u8981\u7684\u5e93\u5e76\u6253\u5370 boto3 \u7248\u672c\u3002\u4ee5\u4e0b\u4ee3\u7801\u5c06\u5bfc\u5165\u4e86 <code>boto3<\/code> \u5e93\uff0c\u8fd9\u662f\u4e9a\u9a6c\u900a\u4e91\u79d1\u6280\u670d\u52a1\u7684 Python SDK\uff0c\u7136\u540e\u6253\u5370 <code>boto3<\/code> \u7684\u7248\u672c\u4ee5\u786e\u4fdd\u5b83\u662f\u6700\u65b0\u7684:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import boto3\nprint('boto3 version')\nprint(boto3.__version__)\n\n!pip install --upgrade boto3<\/code><\/pre>\n\n\n\n<p>\u63a5\u4e0b\u6765,\u6211\u4eec\u5b9a\u4e49\u6a21\u578b ID \u5e76\u52a0\u8f7d\u9700\u8981\u5206\u6790\u7684\u56fe\u50cf\uff1a<\/p>\n\n\n\n<p>(1) <code>MODEL_ID<\/code>\u88ab\u8bbe\u7f6e\u4e3a\u5728 Amazon Bedrock \u4e0a Llama 3.2 90B Instruct \u6a21\u578b\u7684\u7279\u5b9a\u6a21\u578b ID<\/p>\n\n\n\n<p>(2) <code>ORIGIN_IMAGE<\/code>\u88ab\u8bbe\u7f6e\u4e3a\u539f\u59cb\u56fe\u50cf\u6587\u4ef6\u7684\u8def\u5f84<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MODEL_ID = \"us.meta.llama3-2-90b-instruct-v1:0\"\nORIGIN_IMAGE = \"images\/diabetes-prevalence.png\"<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u4ee3\u7801\u4ece\u6211\u7f16\u5199\u7684\u81ea\u5b9a\u4e49 <code>utils<\/code> \u6a21\u5757\u5bfc\u5165\u4e24\u4e2a\u51fd\u6570\uff1a<code>disp_image<\/code> \u548c <code>resize_image<\/code>\u3002\u9700\u8981\u8c03\u6574\u56fe\u50cf\u5927\u5c0f\u662f\u56e0\u4e3a\uff1aMeta Llama 90B Instruct \u6a21\u578b\u5bf9\u8f93\u5165\u56fe\u50cf\u7684\u5927\u5c0f\u6709\u4e00\u5b9a\u9650\u5236\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from utils import disp_image\nfrom utils import resize_image\n\ndisp_image(ORIGIN_IMAGE)\n\n# Image processing\nfrom PIL import Image\nimg1 = Image.open(ORIGIN_IMAGE)\nimg1.size\nRESIZED_IMG = resize_image(img1)\n\n# Open the JPG image\njpg_image = Image.open(\"images\/resized_image.jpg\")\n\n# Convert the image to PNG format\npng_image = jpg_image.convert(\"RGB\")\n\n# Save the converted PNG image\npng_image.save(\"images\/resized_image.png\")\nRESIZED_IMAGE = \"images\/resized_image.png\"\ndisp_image(RESIZED_IMAGE)<\/code><\/pre>\n\n\n\n<p>\u56fe\u50cf\u5904\u7406\u5b8c\u6210\u540e\uff0c\u6211\u4f7f\u7528\u81ea\u5df1\u5b9a\u4e49\u7684\u56fe\u50cf\u663e\u793a\u51fd\u6570 <code>disp_image()<\/code> \uff0c\u6765\u663e\u793a\u5c06\u8f93\u5165\u5230 Llama \u6a21\u578b\u7684\u7b2c\u4e00\u5f20\u56fe\u50cf\u3002\u8fd9\u662f\u4e00\u5f20\u5168\u7403\u7cd6\u5c3f\u75c5\u75c5\u60a3\u5206\u5e03\u8d8b\u52bf\u7684\u56fe\u50cf\u3002\u989c\u8272\u7684\u6df1\u6d45\u8868\u793a\u6240\u5728\u4e16\u754c\u56fd\u5bb6\u6216\u5730\u533a\u7684\u7cd6\u5c3f\u75c5\u60a3\u8005\u5728\u8be5\u533a\u57df\u5360\u6bd4\u7684\u7a0b\u5ea6\u3002\u989c\u8272\u8d8a\u6df1\uff0c\u75c5\u60a3\u60c5\u51b5\u5c31\u8d8a\u4e25\u91cd\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1009\" height=\"1024\" src=\"http:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-2-1009x1024.png\" alt=\"\" class=\"wp-image-343\" srcset=\"https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-2-1009x1024.png 1009w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-2-296x300.png 296w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-2-768x779.png 768w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-2-12x12.png 12w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-2.png 1080w\" sizes=\"auto, (max-width: 1009px) 100vw, 1009px\" \/><\/figure>\n\n\n\n<p>Source:<\/p>\n\n\n\n<p><a href=\"https:\/\/ourworldindata.org\/grapher\/diabetes-prevalence?trk=cn...\">https:\/\/ourworldindata.org\/grapher\/diabetes-prevalence?trk=cn&#8230;<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"item-5\">\u4e0e\u6a21\u578b\u4e92\u52a8<\/h3>\n\n\n\n<p>\u4e00\u5207\u51c6\u5907\u5c31\u7eea\uff0c\u73b0\u5728\u53ef\u4ee5\u4f7f\u7528\u8c03\u6574\u540e\u7684\u56fe\u50cf\u4f5c\u4e3a\u8f93\u5165\uff0c\u63d0\u4f9b\u7ed9 Llama 3.2 90B Instruct \u6a21\u578b\u4e86\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u5148\u4f7f\u7528 <code>boto3<\/code> \u4e3a Amazon Bedrock Runtime \u670d\u52a1\u521b\u5efa\u4e00\u4e2a\u5ba2\u6237\u7aef\u5bf9\u8c61\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bedrock_runtime = boto3.client(\"bedrock-runtime\")<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\uff0c\u4ee5\u4e8c\u8fdb\u5236\u8bfb\u53d6\u6a21\u5f0f (<code>\"rb\"<\/code>) \u6253\u5f00\u8c03\u6574\u540e\u7684\u56fe\u50cf\u6587\u4ef6\uff0c\u6587\u4ef6\u5185\u5bb9\u88ab\u8bfb\u5165 <code>image<\/code> \u53d8\u91cf\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>with open(RESIZED_IMAGE, \"rb\") as f:   \n    image = f.read()<\/code><\/pre>\n\n\n\n<p>\u63a5\u7740\u5b9a\u4e49\u4e00\u4e2a\u7528\u6237\u6d88\u606f\uff0c\u8981\u6c42\u6a21\u578b\u8bc6\u522b\u51fa\u5168\u7403\u7cd6\u5c3f\u75c5\u60a3\u75c5\u7387\u6700\u9ad8\u7684 10 \u4e2a\u56fd\u5bb6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>user_message = \"According to this chart, which are the top 10 countries with the highest prevalence of diabetes?\"<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa\u4e00\u4e2a\u6d88\u606f\u5217\u8868\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u6761\u6d88\u606f\u3002\u6d88\u606f\u4e2d\u5305\u62ec\u7528\u6237\u7684\u89d2\u8272\u3001\u56fe\u50cf\u548c\u7528\u6237\u7684\u6d88\u606f\u5185\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>messages = &#91;   \n    {      \n        \"role\": \"user\",       \n        \"content\": &#91;         \n            {\"image\": {\"format\": \"png\", \"source\": {\"bytes\": image}}},        \n            {\"text\": user_message},     \n        ],  \n    }\n]<\/code><\/pre>\n\n\n\n<p>\u8c03\u7528 Amazon Bedrock Runtime \u5ba2\u6237\u7aef\u7684 <code>converse<\/code> \u51fd\u6570\uff0c\u4f20\u5165 <code>MODEL_ID<\/code> \u548c\u4ee5\u4e0a\u6d88\u606f\u5217\u8868\u3002\u6a21\u578b\u7684\u54cd\u5e94\u6d88\u606f\u5c06\u5b58\u50a8\u5728 <code>response<\/code> \u53d8\u91cf\u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>response = bedrock_runtime.converse( \n    modelId=MODEL_ID,   \n    messages=messages,\n)<\/code><\/pre>\n\n\n\n<p>\u4ece\u54cd\u5e94\u5bf9\u8c61\u4e2d\u63d0\u53d6\u54cd\u5e94\u6587\u672c\uff0c\u5e76\u5c06\u5176\u5b58\u50a8\u5728 <code>response_text<\/code> \u53d8\u91cf\u4e2d\u3002\u4e4b\u540e\uff0c\u5c06\u54cd\u5e94\u6587\u672c\u6253\u5370\u663e\u793a\u51fa\u6765\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>response_text = response&#91;\"output\"]&#91;\"message\"]&#91;\"content\"]&#91;0]&#91;\"text\"]\nprint(response_text)<\/code><\/pre>\n\n\n\n<p>\u6211\u81ea\u5df1\u83b7\u5f97\u7684\u6a21\u578b\u6d4b\u8bd5\u54cd\u5e94\u6587\u672c\u5982\u4e0b\uff0c\u4f9b\u5927\u5bb6\u53c2\u8003\uff1a<\/p>\n\n\n\n<p>According to the chart, the top 10 countries with the highest prevalence of diabetes are:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Saudi Arabia<\/strong>: 17.5%<\/li>\n\n\n\n<li><strong>Egypt<\/strong>: 17.5%<\/li>\n\n\n\n<li><strong>United Arab Emirates<\/strong>: 17.5%<\/li>\n\n\n\n<li><strong>Bahrain<\/strong>: 17.5%<\/li>\n\n\n\n<li><strong>Kuwait<\/strong>: 17.5%<\/li>\n\n\n\n<li><strong>Qatar<\/strong>: 17.5%<\/li>\n\n\n\n<li><strong>Oman<\/strong>: 17.5%<\/li>\n\n\n\n<li><strong>Yemen<\/strong>: 17.5%<\/li>\n\n\n\n<li><strong>Libya<\/strong>: 17.5%<\/li>\n\n\n\n<li><strong>Papua New Guinea<\/strong>: 17.5%<\/li>\n<\/ol>\n\n\n\n<p>These countries have the highest percentage of their population aged 20-79 with diabetes, according to the chart.<\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u4ece\u4ee5\u4e0a\u793a\u4f8b\u4e2d\u5f97\u5230\u542f\u53d1\uff0c\u5e76\u5e0c\u671b\u8fdb\u4e00\u6b65\u63a2\u7d22\uff0c\u53ef\u53c2\u8003\u4ee5\u4e0b GitHub \u4ee3\u7801\u5e93\u67e5\u770b\u6211\u7684\u5b8c\u6574\u4ee3\u7801\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/hanyun2019\/bedrock-in-practice\/blob\/main\/llama32-multimodal-diabetes-1.ipynb?trk=cndc-detail\">https:\/\/github.com\/hanyun2019\/bedrock-in-practice\/blob\/main\/llama32-multimodal-diabetes-1.ipynb?trk=cndc-detail<\/a><\/p>\n\n\n\n<p>\u5728\u4ee5\u4e0a\u5b8c\u6574\u4ee3\u7801\u4e2d\uff0c\u6211\u8fd8\u4e0a\u4f20\u6d4b\u8bd5\u4e86\u7b2c\u4e8c\u5f20\u8f93\u5165\u7684\u56fe\u50cf\uff1a\u4e9a\u6d32\u7cd6\u5c3f\u75c5\u60a3\u75c5\u7387\u5206\u5e03\u60c5\u51b5\u56fe\uff0c\u4f9b Meta Llama 3.2 90B Instruct \u6a21\u578b\u8fdb\u884c\u8fdb\u4e00\u6b65\u5206\u6790\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1009\" height=\"1024\" src=\"http:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-3-1009x1024.png\" alt=\"\" class=\"wp-image-344\" srcset=\"https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-3-1009x1024.png 1009w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-3-296x300.png 296w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-3-768x779.png 768w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-3-12x12.png 12w, https:\/\/flycloud.io\/wp-content\/uploads\/2025\/03\/\u56fe\u7247-3.png 1080w\" sizes=\"auto, (max-width: 1009px) 100vw, 1009px\" \/><\/figure>\n\n\n\n<p>Source:<\/p>\n\n\n\n<p><a href=\"https:\/\/ourworldindata.org\/grapher\/diabetes-prevalence?trk=cn...\">https:\/\/ourworldindata.org\/grapher\/diabetes-prevalence?trk=cn&#8230;<\/a><\/p>\n\n\n\n<p>\u7ec6\u5fc3\u7684\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u627e\u5230\u4f60\u5750\u5728\u7684\u6d32\u9645\u6570\u636e\u56fe\u8868\uff0c\u4ee5\u8fdb\u4e00\u6b65\u63a2\u7d22\u8fd9\u4e2a\u8bdd\u9898\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"item-6\">\u603b\u7ed3<\/h3>\n\n\n\n<p>\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u6f14\u793a\u4e86\u5982\u4f55\u5229\u7528 Amazon Bedrock \u4e0a Meta Llama 3.2 90B Instruct \u6a21\u578b\u7684\u591a\u6a21\u6001\u80fd\u529b,\u6765\u6d1e\u5bdf\u5168\u7403\u7cd6\u5c3f\u75c5\u60a3\u75c5\u7387\u3002\u901a\u8fc7\u5229\u7528\u8fd9\u79cd\u5148\u8fdb\u7684\u5927\u578b\u591a\u6a21\u6001\u6a21\u578b\uff0c\u6211\u4eec\u80fd\u591f\u540c\u65f6\u5206\u6790\u6587\u672c\u6570\u636e\u548c\u53ef\u89c6\u5316\u6570\u636e\uff0c\u6839\u636e\u63d0\u4f9b\u7684\u56fe\u8868\u6765\u786e\u5b9a\u5168\u7403\u7cd6\u5c3f\u75c5\u60a3\u75c5\u7387\u6700\u9ad8\u7684\u524d 10 \u4e2a\u56fd\u5bb6\u6216\u5730\u533a\u3002<\/p>\n\n\n\n<p>Meta Llama 3.2 90B Instruct \u6a21\u578b\u5728\u5404\u79cd\u57fa\u51c6\u6d4b\u8bd5\u4e2d\u8868\u73b0\u5353\u8d8a\uff0c\u5c24\u5176\u5728\u56fe\u8868\u7406\u89e3\u7b49\u9886\u57df\uff0c\u975e\u5e38\u9002\u5408\u8fd9\u79cd\u591a\u6a21\u6001\u5206\u6790\u4efb\u52a1\u3002\u5728 Amazon Bedrock \u4e0a\u8fd0\u884c\u8be5\u6a21\u578b\uff0c\u8fd8\u80fd\u591f\u66f4\u9ad8\u6548\u5730\u5904\u7406\u6570\u636e\u5e76\u751f\u6210\u51c6\u786e\u7684\u6d1e\u89c1\u3002<\/p>\n\n\n\n<p>\u901a\u8fc7\u8fd9\u4e2a\u5b9e\u9645\u6848\u4f8b\uff0c\u6211\u4eec\u5c55\u793a\u4e86\u5c06\u5148\u8fdb\u7684\u5927\u6a21\u578b\u4e0e\u591a\u6a21\u6001\u6570\u636e\u76f8\u7ed3\u5408\uff0c\u6765\u89e3\u51b3\u533b\u7597\u5206\u6790\u7b49\u9886\u57df\u590d\u6742\u73b0\u5b9e\u95ee\u9898\u7684\u6f5c\u529b\u3002\u968f\u7740\u5927\u6a21\u578b\u591a\u6a21\u6001\u80fd\u529b\u7684\u4e0d\u65ad\u53d1\u5c55\uff0c\u4ece\u5404\u79cd\u6570\u636e\u6e90\u4e2d\u83b7\u53d6\u66f4\u6df1\u5165\u7684\u6d1e\u89c1\uff0c\u4e3a\u5404\u884c\u4e1a\u5e26\u6765\u5f71\u54cd\u6df1\u8fdc\u7684\u5168\u65b0\u89e3\u51b3\u65b9\u6848\uff0c\u5c06\u5b55\u80b2\u51fa\u66f4\u591a\u65b0\u7684\u5e02\u573a\u673a\u9047\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0 \u5728\u5927\u578b\u8bed\u8a00\u6a21\u578b\u9886\u57df\uff0c\u591a\u6a21\u6001\u6a21\u578b\u7684\u5f3a\u5927\u80fd\u529b\u5df2\u7ecf\u5f00\u59cb\u4e3a\u89e3\u51b3\u590d\u6742\u95ee\u9898\u5f00\u8f9f\u4e86\u65b0\u7684\u53ef\u80fd\u6027\u3002\u672c\u6587\u63a2\u8ba8\u7684\u95ee\u9898\u662f\u5206\u6790\u5168\u7403\u7cd6\u5c3f\u75c5\u60a3\u75c5\u7387\u8d8b\u52bf\uff0c\u8fd9\u662f\u4e00\u4e2a\u5173\u7cfb\u5230\u5168\u7403\u6570\u4ebf\u4eba\u7684\u91cd\u5927\u5065\u5eb7\u95ee\u9898\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5c06\u63a2\u8ba8\u5982\u4f55\u5728 Amazon Bedrock \u4e0a\uff0c\u4f7f\u7528 Meta Llama 3.2 90B Instruct \u6a21\u578b\u6765\u5206\u6790\u5168\u7403\u4e0d\u540c\u56fd\u5bb6\u6216\u5730\u533a\u7684\u7cd6\u5c3f\u75c5\u60a3\u8005\u7684\u60a3\u75c5\u7387\u5206\u5e03\u6570\u636e\u3002 Meta \u5f00\u53d1\u7684 Llama 3.2 90B In&hellip;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[],"class_list":["post-273","post","type-post","status-publish","format-standard","hentry","category-ai","category-aws"],"_links":{"self":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts\/273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/comments?post=273"}],"version-history":[{"count":4,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts\/273\/revisions"}],"predecessor-version":[{"id":345,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts\/273\/revisions\/345"}],"wp:attachment":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/media?parent=273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/categories?post=273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/tags?post=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}