{"id":12834,"date":"2024-11-22T18:50:38","date_gmt":"2024-11-22T09:50:38","guid":{"rendered":"https:\/\/highreso.jp\/edgehub\/?p=12834"},"modified":"2024-11-22T18:50:40","modified_gmt":"2024-11-22T09:50:40","slug":"llama31swallow","status":"publish","type":"post","link":"https:\/\/highreso.jp\/edgehub\/machinelearning\/llama31swallow.html","title":{"rendered":"\u3010Llama 3.1 Swallow\u3011\u6771\u5de5\u5927\u306e\u65e5\u672c\u8a9e\u306b\u5f37\u3044LLM\uff01"},"content":{"rendered":"\n<p><span class=\"swl-format-2\">Llama 3.1 Swallow\u306f\u3001Meta\u306eLlama 3.1\u3092\u30d9\u30fc\u30b9\u306b\u3001\u6771\u5de5\u5927\u30fb\u7523\u7dcf\u7814\u304c\u65e5\u672c\u8a9e\u80fd\u529b\u3092\u5f37\u5316\u3057\u305fLLM\u3067\u3059\u3002<\/span><\/p>\n\n\n\n<p>\u30aa\u30fc\u30d7\u30f3\u306a\u65e5\u672c\u8a9eLLM\u306e\u4e2d\u3067\u3001\u65e5\u672c\u8a9e\u306e\u8a00\u8a9e\u7406\u89e3\u30fb\u751f\u6210\u30bf\u30b9\u30af\u306b\u304a\u3044\u3066\u30c8\u30c3\u30d7\u30af\u30e9\u30b9\u306e\u6027\u80fd\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Llama 3.1 Swallow\u306e\u6027\u80fd\u3001\u5546\u7528\u5229\u7528\u3001\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"is-style-balloon_box\">\u3056\u3063\u304f\u308a\u8a00\u3046\u3068<\/p>\n\n\n\n<div class=\"wp-block-group is-style-big_icon_good\"><div class=\"wp-block-group__inner-container\">\n<ul class=\"wp-block-list\">\n<li>Llama 3.1\u3092\u30d9\u30fc\u30b9\u306b\u6771\u5de5\u5927\u30fb\u7523\u7dcf\u7814\u304c\u65e5\u672c\u8a9e\u80fd\u529b\u3092\u5f37\u5316\u3057\u305fLLM<\/li>\n\n\n\n<li>\u30aa\u30fc\u30d7\u30f3\u306a\u65e5\u672c\u8a9eLLM\u306e\u4e2d\u3067\u3001\u30c8\u30c3\u30d7\u30af\u30e9\u30b9\u306e\u6027\u80fd<\/li>\n\n\n\n<li>Llama 3.1\u306e\u6027\u80fd\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u3001\u4f7f\u3044\u65b9\u307e\u3067\u89e3\u8aac<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Llama 3.1 Swallow\u3068\u306f<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/swallow12_midashi.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-9586\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/swallow12_midashi.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/swallow12_midashi-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>Llama 3.1 Swallow\u306f\u3001Meta\u306eLlama 3.1\u3092\u30d9\u30fc\u30b9\u306b\u65e5\u672c\u8a9e\u80fd\u529b\u3092\u5f37\u5316\u3057\u305fLLM\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u6771\u5de5\u5927\u30fb\u7523\u7dcf\u7814\u306e\u7814\u7a76\u30c1\u30fc\u30e0\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u3001<span class=\"swl-format-2\">\u30aa\u30fc\u30d7\u30f3\u306a\u65e5\u672c\u8a9eLLM\u306e\u4e2d\u3067\u3001\u30c8\u30c3\u30d7\u30af\u30e9\u30b9\u306e\u6027\u80fd\u304c\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<p>\u3053\u306e\u30e2\u30c7\u30eb\u306fMeta Llama 3.1\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u306b\u57fa\u3065\u304d\u3001\u7121\u6599\u3067\u5229\u7528\u3067\u304d\u5546\u7528\u5229\u7528\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"is-style-balloon_box\">Llama 3.1\u306b\u95a2\u3059\u308b\u8a18\u4e8b\u306f\u5225\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u307e\u3059\u3002<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/llama31toha-eyecatch-300x158.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/highreso.jp\/edgehub\/machinelearning\/llama31toha.html\">4050\u5104\u306e\u6700\u5f37LLM\u300cLlama 3.1\u300d\u3068\u306f\uff1f\u4f7f\u3044\u65b9\u30fb\u6027\u80fd\u30fb\u5546\u7528\u5229\u7528\u3092\u89e3\u8aac\uff01<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">Llama 3.1\u306f\u3001Meta\u793e\u304c\u958b\u767a\u3057\u305f\u6700\u65b0\u306eLLM\u3067\u30014050\u5104\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6301\u3064\u975e\u5e38\u306b\u5927\u898f\u6a21\u306a\u30e2\u30c7\u30eb\u3067\u3059\u3002 Llama 3.1\u306f\u3001GPT-4o\u3084Claude 3.5 Sonnet\u306b\u5339\u6575\u3059\u308b\u6027\u80fd\u3092\u6301\u3064\u3068\u8a00\u308f&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<div class=\"p-blogParts post_content\" data-partsID=\"4485\"><p><div class=\"p-adBox -ranking -border-on\" data-id=\"4540\" data-ad=\"ranking\"><div class=\"p-adBox__title -rank1\">50\uff05\u5b89\u3044\u696d\u754c\u6700\u5b89\u7d1aGPU\u30af\u30e9\u30a6\u30c9\u300cGPUSOROBAN\u300d<\/div><div class=\"p-adBox__body\"><div class=\"p-adBox__img\"><div class=\"centerw250\"><a href=\"https:\/\/soroban.highreso.jp\/?utm_medium=edgehub&utm_source=edgehub&utm_campaign=highend-boxtop&adid=edgehub\" rel=\"nofollow\" referrerpolicy=\"no-referrer-when-downgrade\"><img decoding=\"async\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/gpusorobanlllm_banner.jpg\" alt=\"GPUSOROBAN\"><\/a><\/div><\/div><div class=\"p-adBox__details\"><div class=\"p-adBox__star c-reviewStars\"><i class=\"icon-star-full\"><\/i><i class=\"icon-star-full\"><\/i><i class=\"icon-star-full\"><\/i><i class=\"icon-star-full\"><\/i><i class=\"icon-star-full\"><\/i><\/div><div class=\"p-adBox__price u-thin u-fz-s\">GPU\u306e\u30b3\u30b9\u30c8\u3067\u304a\u60a9\u307f\u306e\u65b9\u306b\uff01<\/div><div class=\"p-adBox__desc\">AWS\u3068\u6bd4\u3079\u306650%\u4ee5\u4e0a\u5b89\u3044\u6599\u91d1\u3067\u3001\u9ad8\u901fGPU\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u3054\u5229\u7528\u3044\u305f\u3060\u3051\u307e\u3059\u3002\r\n\u9762\u5012\u306a\u8a2d\u5b9a\u306f\u4e0d\u8981\u3001\u308f\u305a\u304b3\u5206\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u7acb\u3061\u4e0a\u3052\u304c\u53ef\u80fd\u3067\u3059\u3002\r\n\u30bf\u30b9\u30af\u306b\u5fdc\u3058\u3066\u6700\u9069\u306aGPU\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/div><\/div><\/div><div class=\"p-adBox__btns\"><a href=\"https:\/\/soroban.highreso.jp\/compute\/?utm_medium=edgehub&utm_source=edgehub&utm_campaign=boxtop&adid=edgehub\" class=\"p-adBox__btn -btn1\" target=\"_blank\" rel=\"noopener nofollow\">\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u898b\u308b<\/a><a href=\"https:\/\/soroban.highreso.jp\/download\/compute-catalog\/?utm_medium=edgehub&utm_source=edgehub&utm_campaign=boxtop&adid=edgehub\" class=\"p-adBox__btn -btn2\" target=\"_blank\" rel=\"noopener nofollow\">\u8cc7\u6599\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a><\/div><\/div><\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Llama 3.1 Swallow\u306e\u30e2\u30c7\u30eb<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/09\/1_midashi_anime0921.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-11882\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/09\/1_midashi_anime0921.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/09\/1_midashi_anime0921-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>Llama 3.1 Swallow\u306e\u30e2\u30c7\u30eb\u306b\u306f\u8907\u6570\u306e\u7a2e\u985e\u304c\u3042\u308a\u3001<span class=\"swl-format-2\">\u300c\u30d1\u30e9\u30e1\u30fc\u30bf\u30b5\u30a4\u30ba\u300d\u3068\u300c\u4e8b\u524d\u5b66\u7fd2\/\u6307\u793a\u5b66\u7fd2\u300d<\/span>\u3067\u5206\u3051\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30e2\u30c7\u30eb\u306f<a href=\"https:\/\/huggingface.co\/collections\/tokyotech-llm\/llama-31-swallow-66fd4f7da32705cadd1d5bc6\">HuggingFace<\/a>\u3067\u516c\u958b\u3055\u308c\u3066\u304a\u308a\u3001\u7121\u6599\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table min_width30_ is-style-regular\"><table><thead><tr><th>\u30e2\u30c7\u30ebID<\/th><th>\u30d1\u30e9\u30e1\u30fc\u30bf\u30b5\u30a4\u30ba<\/th><th>\u4e8b\u524d\u5b66\u7fd2\/\u6307\u793a\u5b66\u7fd2<\/th><th>\u516c\u958b<\/th><\/tr><\/thead><tbody><tr><td>tokyotech-llm\/Llama-3.1-Swallow-8B-v0.1<\/td><td>80\u5104\u30d1\u30e9\u30e1\u30fc\u30bf<\/td><td>\u4e8b\u524d\u5b66\u7fd2\u30e2\u30c7\u30eb<\/td><td>HuggingFace<\/td><\/tr><tr><td>tokyotech-llm\/Llama-3.1-Swallow-8B-Instruct-v0.1<\/td><td>80\u5104\u30d1\u30e9\u30e1\u30fc\u30bf<\/td><td>\u6307\u793a\u5b66\u7fd2\u30e2\u30c7\u30eb<\/td><td>HuggingFace<\/td><\/tr><tr><td>tokyotech-llm\/Llama-3.1-Swallow-70B-v0.1<\/td><td>700\u5104\u30d1\u30e9\u30e1\u30fc\u30bf<\/td><td>\u4e8b\u524d\u5b66\u7fd2\u30e2\u30c7\u30eb<\/td><td>HuggingFace<\/td><\/tr><tr><td>tokyotech-llm\/Llama-3.1-Swallow-70B-Instruct-v0.1<\/td><td>700\u5104\u30d1\u30e9\u30e1\u30fc\u30bf<\/td><td>\u6307\u793a\u5b66\u7fd2\u30e2\u30c7\u30eb<\/td><td>HuggingFace<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\" data-colset=\"col3\"><div class=\"cap_box_ttl\"><span>\u4e8b\u524d\u5b66\u7fd2\u30e2\u30c7\u30eb\u3068\u6307\u793a\u5b66\u7fd2\u30e2\u30c7\u30eb\u306e\u9055\u3044<\/span><\/div><div class=\"cap_box_content\">\n<p><span class=\"swl-format-2\">\u4e8b\u524d\u5b66\u7fd2\u30e2\u30c7\u30eb<\/span><\/p>\n\n\n\n<p>\u57fa\u790e\u7684\u306a\u30c7\u30fc\u30bf\u304c\u5b66\u7fd2\u3055\u308c\u305f\u30e2\u30c7\u30eb\u3067\u3059\u3002\u57fa\u790e\u7684\u306a\u77e5\u8b58\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u4eba\u9593\u306e\u6307\u793a\u306b\u5fdc\u3058\u305f\u56de\u7b54\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">\u6307\u793a\u5b66\u7fd2\u30e2\u30c7\u30eb<\/span><\/p>\n\n\n\n<p>\u4e8b\u524d\u5b66\u7fd2\u30e2\u30c7\u30eb\u3092\u7279\u5b9a\u306e\u30bf\u30b9\u30af\u3084\u6307\u793a\u306b\u3082\u3068\u3065\u3044\u3066\u8abf\u6574\u3057\u305f\u30e2\u30c7\u30eb\u3067\u3059\u3002ChatGPT\u306e\u3088\u3046\u306b\u4eba\u9593\u306e\u6307\u793a\u306b\u5fdc\u3058\u305f\u56de\u7b54\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Llama 3.1 Swallow\u306e\u6027\u80fd<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/09\/20_midashi_0921.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-11827\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/09\/20_midashi_0921.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/09\/20_midashi_0921-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Llama 3.1 Swallow 8B\u306e\u30d9\u30f3\u30c1\u30de\u30fc\u30af<\/h3>\n\n\n\n<p>\u30d1\u30e9\u30e1\u30fc\u30bf\u6570\u304c130\u5104\u4ee5\u4e0b\u306e\u30e2\u30c7\u30eb\u3092\u5bfe\u8c61\u306b\u3001\u65e5\u672c\u8a9e\u7406\u89e3\u30fb\u751f\u6210\u30bf\u30b9\u30af\u3001\u65e5\u672c\u8a9eMT-bench\u3001\u82f1\u8a9e\u7406\u89e3\u30fb\u751f\u6210\u30bf\u30b9\u30af\u306e\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u3092\u884c\u3044\u3001<span class=\"swl-format-2\">Llama 3.1 Swallow 8B\u306f\u3001\u30aa\u30fc\u30d7\u30f3\u306a8B\u4ee5\u4e0b\u306e\u30e2\u30c7\u30eb\u306e\u4e2d\u3067\u6700\u3082\u9ad8\u3044\u30b9\u30b3\u30a2<\/span>\u3092\u8a18\u9332\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"800\" height=\"552\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_1.jpg\" alt=\"\u30d9\u30f3\u30c1\u30de\u30fc\u30af\" class=\"wp-image-12878\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_1.jpg 800w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_1-300x207.jpg 300w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_1-768x530.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">(\u51fa\u5178:https:\/\/swallow-llm.github.io\/llama3.1-swallow.ja.html)<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Llama 3.1 Swallow 70B\u306e\u30d9\u30f3\u30c1\u30de\u30fc\u30af<\/h3>\n\n\n\n<p>\u30d1\u30e9\u30e1\u30fc\u30bf\u6570\u304c200\u5104\u4ee5\u4e0a\u306e\u30e2\u30c7\u30eb\u3092\u5bfe\u8c61\u306b\u3001\u65e5\u672c\u8a9e\u7406\u89e3\u30fb\u751f\u6210\u30bf\u30b9\u30af\u3001\u65e5\u672c\u8a9eMT-bench\u3001\u82f1\u8a9e\u7406\u89e3\u30fb\u751f\u6210\u30bf\u30b9\u30af\u306e\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u3092\u884c\u3063\u305f\u7d50\u679c\u3001<span class=\"swl-format-2\">Llama 3.1 Swallow 70B Instruct\u306f\u3001Meta\u306eLlama 3.1 70B Instruct\u306b\u308f\u305a\u304b\u306b\u52a3\u308b\u30b9\u30b3\u30a2\u3068\u306a\u308a\u307e\u3057\u305f\u3002<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"800\" height=\"536\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_1-2.jpg\" alt=\"\u30d9\u30f3\u30c1\u30de\u30fc\u30af\" class=\"wp-image-12879\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_1-2.jpg 800w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_1-2-300x201.jpg 300w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_1-2-768x515.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">(\u51fa\u5178:https:\/\/swallow-llm.github.io\/llama3.1-swallow.ja.html)<\/figcaption><\/figure>\n\n\n\n<p>\u5185\u8a33\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001<span class=\"swl-format-2\">Llama 3.1 Swallow 70B Instruct\u306f\u30b3\u30fc\u30c9\u751f\u6210\u30bf\u30b9\u30af(HumanEval\u3068JHumanEval)\u3067\u306f\u52a3\u5f8c\u3059\u308b\u4e00\u65b9\u3067\u3001\u65e5\u672c\u8a9e\u306e\u8cea\u554f\u5fdc\u7b54\u30bf\u30b9\u30af(NIILC)\u3067\u306f\u82e5\u5e72\u512a\u308c\u308b\u7d50\u679c<\/span>\u304c\u5f97\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"510\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_13-1-1024x510.jpg\" alt=\"\u30d9\u30f3\u30c1\u30de\u30fc\u30af\" class=\"wp-image-12883\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_13-1-1024x510.jpg 1024w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_13-1-300x149.jpg 300w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_13-1-768x383.jpg 768w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/10\/capture_swallow3_13-1.jpg 1471w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">(\u51fa\u5178:https:\/\/swallow-llm.github.io\/llama3.1-swallow.ja.html)<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Llama 3.1 Swallow\u306e\u5546\u7528\u5229\u7528\u30fb\u30e9\u30a4\u30bb\u30f3\u30b9<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/bear4_midashi.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-9762\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/bear4_midashi.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/bear4_midashi-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p><span class=\"swl-format-2\">Llama 3.1 Swallow\u306f\u3001\u300cMETA LLAMA 3.1 COMMUNITY LICENSE\u300d\u306b\u57fa\u3065\u3044\u3066\u3001\u7121\u6599\u3067\u4f7f\u7528\u3067\u304d\u5546\u7528\u5229\u7528\u3082\u53ef\u80fd\u3067\u3059\u3002<\/span><\/p>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\" data-colset=\"col3\"><div class=\"cap_box_ttl\"><span>META LLAMA 3.1 COMMUNITY LICENSE\u306e\u8981\u70b9<\/span><\/div><div class=\"cap_box_content\">\n<p>\u5546\u7528\u5229\u7528\uff1a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084\u30b3\u30fc\u30c9\u3092\u5546\u7528\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u8a31\u53ef\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6539\u5909\uff1a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084\u30b3\u30fc\u30c9\u3092\u81ea\u7531\u306b\u4fee\u6b63\u3057\u305f\u308a\u6539\u5909\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u914d\u5e03\uff1a\u4fee\u6b63\u3057\u305f\u308a\u5909\u66f4\u3057\u305f\u308a\u3057\u305f\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u81ea\u7531\u306b\u914d\u5e03\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8457\u4f5c\u6a29\u8868\u793a\uff1a\u518d\u914d\u5e03\u6642\u306b\u3001\u8457\u4f5c\u6a29\u306e\u8868\u793a\u3084\u5951\u7d04\u66f8\u30b3\u30d4\u30fc\u306e\u63d0\u4f9b\u306a\u3069\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7279\u8a31\u5229\u7528\uff1a\u7279\u8a31\u5229\u7528\u306b\u95a2\u3059\u308b\u660e\u793a\u7684\u306a\u898f\u5b9a\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<\/div><\/div>\n\n\n\n<p class=\"is-style-icon_info\">\u5546\u7528\u5229\u7528\u306f\u3001\u300c\u6708\u9593\u30a2\u30af\u30c6\u30a3\u30d6\u30e6\u30fc\u30b6\u30fc\u304c7\u5104\u4eba\u4ee5\u4e0b\u3067\u3042\u308c\u3070\u7121\u511f\u3067\u5229\u7528\u3067\u304d\u308b\u300d\u6761\u4ef6\u3064\u304d\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u8a73\u7d30\u306f<a href=\"https:\/\/www.llama.com\/llama3_1\/license\/\">\u300cMETA LLAMA 3.1 COMMUNITY LICENSE\u300d<\/a>\u306e\u30da\u30fc\u30b8\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Llama 3.1 Swallow\u306e\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/nou_midashi.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-9143\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/nou_midashi.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/08\/nou_midashi-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p><span class=\"swl-format-2\">\u3053\u3053\u304b\u3089Llama 3.1 Swallow\u306e\u4f7f\u3044\u65b9\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9f\u884c\u74b0\u5883<\/h3>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u7528\u610f\u3057\u305f\u5b9f\u884c\u74b0\u5883\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-style-big_icon_good\"><div class=\"wp-block-group__inner-container\">\n<ul class=\"wp-block-list\">\n<li>GPU\uff1aNVIDIA A100 80GB<\/li>\n\n\n\n<li>GPU\u30e1\u30e2\u30ea\uff08VRAM\uff09\uff1a80GB<\/li>\n\n\n\n<li>OS \uff1aUbuntu 22.04<\/li>\n\n\n\n<li>Docker<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Docker\u3067\u74b0\u5883\u69cb\u7bc9<\/h3>\n\n\n\n<p><span class=\"swl-format-2\">Docker\u3092\u4f7f\u7528\u3057\u3066Llama 3.1 Swallow\u306e\u74b0\u5883\u69cb\u7bc9\u3092\u3057\u307e\u3059<\/span><\/p>\n\n\n\n<p>Docker\u306e\u4f7f\u3044\u65b9\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/ubuntudocker-eyecatch-300x158.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/highreso.jp\/edgehub\/machinelearning\/ubuntudocker.html\">Ubuntu\u306bDocker\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff01GPU\u3092\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u4f7f\u3046\u65b9\u6cd5<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">GPU\u306e\u74b0\u5883\u69cb\u7bc9\u3067\u306f\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u4e0d\u4e00\u81f4\u306b\u3088\u308b\u30a8\u30e9\u30fc\u304c\u983b\u767a\u3057\u307e\u3059\u3002 Docker\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u3053\u306e\u3088\u3046\u306a\u4f9d\u5b58\u95a2\u4fc2\u306e\u30a8\u30e9\u30fc\u3092\u56de\u907f\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002 \u3053\u306e\u8a18\u4e8b\u3067&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<div class=\"swell-block-step\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Dockerfile\u306e\u4f5c\u6210<\/div><div class=\"swell-block-step__body\">\n<p>\u30b3\u30f3\u30c6\u30ca\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">CUDA\u3001PyTorch\u3001Transformers\u306f\u30d0\u30fc\u30b8\u30e7\u30f3\u4f9d\u5b58\u95a2\u4fc2\u306b\u3088\u308b\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u3084\u3059\u3044<\/span>\u306e\u3067\u3001\u52d5\u4f5c\u691c\u8a3c\u6e08\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u6307\u5b9a\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\" data-colset=\"col3\"><div class=\"cap_box_ttl\"><span>\u30d1\u30c3\u30b1\u30fc\u30b8\u4e00\u89a7<\/span><\/div><div class=\"cap_box_content\">\n<ul class=\"wp-block-list\">\n<li>CUDA\uff1a12.1<\/li>\n\n\n\n<li>Python\uff1a3.10<\/li>\n\n\n\n<li>PyTorch\uff1a2.2.2<\/li>\n\n\n\n<li>transformers\uff1a4.44.0<\/li>\n\n\n\n<li>accelerate<\/li>\n\n\n\n<li>bitsandbytes<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p>Ubuntu\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u3001Dockerfile\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>mkdir swallow3_1\ncd swallow3_1\nnano Dockerfile<\/code><\/pre>\n\n\n\n<p>Dockerfile\u306b\u4ee5\u4e0b\u306e\u8a18\u8ff0\u3092\u8cbc\u308a\u4ed8\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code># \u30d9\u30fc\u30b9\u30a4\u30e1\u30fc\u30b8(CUDA)\u306e\u6307\u5b9a\nFROM nvidia\/cuda:12.1.0-cudnn8-devel-ubuntu22.04\n\n# \u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN apt-get update &amp;&amp; apt-get install -y python3-pip python3-venv git nano\n\n# \u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u8a2d\u5b9a\nWORKDIR \/app\n\n# \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30fc\nCOPY . \/app\n\n# Python\u4eee\u60f3\u74b0\u5883\u306e\u4f5c\u6210\nRUN python3 -m venv \/app\/.venv\n\n# \u4eee\u60f3\u74b0\u5883\u3092\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092.bashrc\u306b\u8ffd\u52a0\nRUN echo \"source \/app\/.venv\/bin\/activate\" &gt;&gt; \/root\/.bashrc\n\n# JupyterLab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN \/app\/.venv\/bin\/pip install Jupyter jupyterlab\n\n# PyTorch\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN \/app\/.venv\/bin\/pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https:\/\/download.pytorch.org\/whl\/cu121\n\n# Transformer\u95a2\u9023\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN \/app\/.venv\/bin\/pip install transformers==4.44.0 accelerate bitsandbytes\n\n# \u30b3\u30f3\u30c6\u30ca\u306e\u8d77\u52d5\u6642\u306bbash\u3092\u5b9f\u884c\nCMD &#091;\"\/bin\/bash\"]<\/code><\/pre>\n\n\n\n<p class=\"is-style-icon_info\">[Ctrl + S]\u30ad\u30fc\u3067\u5909\u66f4\u5185\u5bb9\u3092\u4fdd\u5b58\u3057\u3001[Ctrl + X]\u30ad\u30fc\u3067\u7de8\u96c6\u30e2\u30fc\u30c9\u304b\u3089\u629c\u3051\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">docker-compose.yml\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210<\/div><div class=\"swell-block-step__body\">\n<p>docker-compose.yml\u3067Docker\u30b3\u30f3\u30c6\u30ca\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>docker-compose.yml\u306eYAML\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u958b\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>nano docker-compose.yml<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3001YAML\u30d5\u30a1\u30a4\u30eb\u306b\u8cbc\u308a\u4ed8\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>services:\n  swallow3_1:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    image: swallow3_1\n    runtime: nvidia\n    container_name: swallow3_1\n    ports:\n      - \"8888:8888\"\n    volumes:\n      - .:\/app\/swallow3_1\n    deploy:\n      resources:\n        reservations:\n          devices:\n            - driver: nvidia\n              count: 1\n              capabilities: &#091;gpu]\n    command: &gt;\n      bash -c '\/app\/.venv\/bin\/jupyter lab --ip=\"*\" --port=8888 --NotebookApp.token=\"\" --NotebookApp.password=\"\" --no-browser --allow-root'<\/code><\/pre>\n\n\n\n<p class=\"is-style-icon_info\">[Ctrl + S]\u30ad\u30fc\u3067\u5909\u66f4\u5185\u5bb9\u3092\u4fdd\u5b58\u3057\u3001[Ctrl + X]\u30ad\u30fc\u3067\u7de8\u96c6\u30e2\u30fc\u30c9\u304b\u3089\u629c\u3051\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Docker\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5<\/div><div class=\"swell-block-step__body\">\n<p>Dockerfile\u304b\u3089\u30d3\u30eb\u30c9\u3057\u3066\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>docker compose up<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p>Docker\u306e\u8d77\u52d5\u5f8c\u306b\u30d6\u30e9\u30a6\u30b6\u306e\u691c\u7d22\u7a93\u306b&#8221;localhost:8888&#8243;\u3092\u5165\u529b\u3059\u308b\u3068\u3001Jupyter Lab\u3092\u30d6\u30e9\u30a6\u30b6\u3067\u8868\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>localhost:8888<\/code><\/pre>\n<\/div><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Llama 3.1 Swallow\u306e\u5b9f\u88c5<\/h3>\n\n\n\n<p><span class=\"swl-format-2\">Docker\u30b3\u30f3\u30c6\u30ca\u3067\u8d77\u52d5\u3057\u305fJupyter Lab\u4e0a\u3067Llama 3.1 Swallow\u306e\u5b9f\u88c5\u3092\u3057\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<div class=\"swell-block-step\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/div><div class=\"swell-block-step__body\">\n<p>Jupyter Lab\u306e\u30b3\u30fc\u30c9\u30bb\u30eb\u306b\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>import torch\nimport transformers\nfrom transformers import AutoModelForCausalLM, AutoTokenizer,BitsAndBytesConfig<\/code><\/pre>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">\u30e2\u30c7\u30eb\u3068\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u306e\u8a2d\u5b9a<\/div><div class=\"swell-block-step__body\">\n<p>Llama 3.1 Swallow\u306e\u30e2\u30c7\u30eb\u3068\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>model_id = \"tokyotech-llm\/Llama-3.1-Swallow-8B-Instruct-v0.1\"\n\ntokenizer = AutoTokenizer.from_pretrained(model_id)\n\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_id,\n    torch_dtype=torch.bfloat16,\n    device_map=\"auto\",\n)<\/code><\/pre>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\" data-colset=\"col3\"><div class=\"cap_box_ttl\"><span>\u30b3\u30fc\u30c9\u306e\u8aac\u660e<\/span><\/div><div class=\"cap_box_content\">\n<p><span class=\"swl-format-2\">&#8220;tokyotech-llm\/Llama-3.1-Swallow-8B-Instruct-v0.1&#8221;<\/span><\/p>\n\n\n\n<p>\u30e2\u30c7\u30eb\u306e\u30bf\u30a4\u30d7\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">AutoModelForCausalLM.from_pretrained()<\/span><\/p>\n\n\n\n<p>\u30e2\u30c7\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>torch_dtype=torch.bfloat16,<\/code>\uff1aBF16\u306e\u6570\u5024\u8868\u73fe\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u91cf\u5b50\u5316\u3092\u3059\u308b\u5834\u5408\u306f<code>quantization_config=BitsAndBytesConfig(load_in_4bit=True),<\/code>\u3092\u5f15\u6570\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">AutoTokenizer.from_pretrained()<\/span><\/p>\n\n\n\n<p>\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u30e2\u30c7\u30ebID<\/th><th>\u30d1\u30e9\u30e1\u30fc\u30bf\u30b5\u30a4\u30ba<\/th><th>GPU\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf<\/th><\/tr><\/thead><tbody><tr><td>tokyotech-llm\/Llama-3.1-Swallow-8B-Instruct-v0.1<\/td><td>80\u5104\u30d1\u30e9\u30e1\u30fc\u30bf<\/td><td>17GB\uff08BF16,\u91cf\u5b50\u5316\u306a\u3057\uff09<\/td><\/tr><tr><td>tokyotech-llm\/Llama-3.1-Swallow-70B-Instruct-v0.1<\/td><td>700\u5104\u30d1\u30e9\u30e1\u30fc\u30bf<\/td><td>43GB\uff08BF16,\u91cf\u5b50\u5316\u3042\u308a\uff09<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"is-style-icon_info\">\u30e2\u30c7\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u969b\u306bGPU\u30e1\u30e2\u30ea\u3092\u6d88\u8cbb\u3057\u307e\u3059\u306e\u3067\u3001\u4f59\u88d5\u3092\u6301\u3063\u305fGPU\u30e1\u30e2\u30ea\u3092\u3054\u7528\u610f\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">\u30e2\u30c7\u30eb\u3092\u91cf\u5b50\u5316\u3092\u3059\u308b\u5834\u5408<\/div><div class=\"swell-block-step__body\">\n<p>\u30e2\u30c7\u30eb\u3092\u91cf\u5b50\u5316\u3057\u3066\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u91cf\u5b50\u5316\u306b\u3088\u308a\u30e2\u30c7\u30eb\u306e\u7cbe\u5ea6\u304c\u4f4e\u4e0b\u3057\u307e\u3059\u304c\u3001GPU\u30e1\u30e2\u30ea\u3092\u7bc0\u7d04\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"is-style-icon_info\">\u30e2\u30c7\u30eb\u3092\u91cf\u5b50\u5316\u3057\u306a\u3044\u5834\u5408\u306f\u3001\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u7701\u7565\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>model_id = \"tokyotech-llm\/Llama-3.1-Swallow-8B-Instruct-v0.1\"\n\ntokenizer = AutoTokenizer.from_pretrained(model_id)\n\nbnb_config = BitsAndBytesConfig(\n    load_in_4bit=True,\n    bnb_4bit_quant_type=\"nf4\",\n    bnb_4bit_compute_dtype=torch.bfloat16\n)\n\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_id,\n    torch_dtype=torch.bfloat16,\n    quantization_config=bnb_config,\n    device_map=\"auto\",\n)\n<\/code><\/pre>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\" data-colset=\"col3\"><div class=\"cap_box_ttl\"><span>\u30b3\u30fc\u30c9\u306e\u8aac\u660e<\/span><\/div><div class=\"cap_box_content\">\n<p><span class=\"swl-format-2\">bnb_config = BitsAndBytesConfig(&#8230;<\/span><\/p>\n\n\n\n<p><code>load_in_4bit=True<\/code>\uff1a\u30e2\u30c7\u30eb\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30924\u30d3\u30c3\u30c8\u91cf\u5b50\u5316\u3057\u3066\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>bnb_4bit_quant_type=\"nf4\"<\/code>\uff1a4\u30d3\u30c3\u30c8\u91cf\u5b50\u5316\u306e\u624b\u6cd5\u3068\u3057\u3066nf4\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>bnb_4bit_compute_dtype=torch.bfloat16<\/code>:\u8a08\u7b97\u6642\u306e\u30c7\u30fc\u30bf\u578b\u3092bfloat16\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Llama 3.1 Swallow\u306e\u3067\u30c6\u30ad\u30b9\u30c8\u751f\u6210<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/icecave_midashi.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-5728\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/icecave_midashi.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/icecave_midashi-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p><span class=\"swl-format-2\">Llama 3.1 Swallow 8B\u3092\u4f7f\u3063\u3066\u3001\u65e5\u672c\u8a9e\u3067\u306e\u8cea\u554f\u5fdc\u7b54\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u65e5\u672c\u8a9e\u3067\u306e\u8cea\u554f\u5fdc\u7b54\uff081\uff09<\/h3>\n\n\n\n<p><span class=\"swl-format-2\">\u300c\u5bae\u5d0e\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u3092\u6559\u3048\u3066\u4e0b\u3055\u3044\u3002\u300d\u3068\u3044\u3046\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u65e5\u672c\u8a9e\u3067\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>DEFAULT_SYSTEM_PROMPT = \"\u3042\u306a\u305f\u306f\u65e5\u672c\u8a9e\u3067\u56de\u7b54\u3059\u308b\u30a2\u30b7\u30b9\u30bf\u30f3\u30c8\u3067\u3059\u3002\"\ntext = \"\u5bae\u5d0e\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u3092\u6559\u3048\u3066\u4e0b\u3055\u3044\u3002\"\n\nmessages = &#091;\n    {\"role\": \"system\", \"content\": DEFAULT_SYSTEM_PROMPT},\n    {\"role\": \"user\", \"content\": text},\n]\n\nprompt = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True\n)\n\ntoken_ids = tokenizer.encode(\n    prompt, add_special_tokens=False,\n    return_tensors=\"pt\"\n)\n\nwith torch.no_grad():\n    output_ids = model.generate(\n        token_ids.to(model.device),\n        max_new_tokens=512,\n        do_sample=True,\n        temperature=0.6,\n        top_p=0.9,\n    )\n\noutput = tokenizer.decode(\n    output_ids.tolist()&#091;0]&#091;token_ids.size(1):], \n    skip_special_tokens=True\n)\nprint(output)<\/code><\/pre>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\" data-colset=\"col3\"><div class=\"cap_box_ttl\"><span>\u30b3\u30fc\u30c9\u306e\u8aac\u660e<\/span><\/div><div class=\"cap_box_content\">\n<p><span class=\"swl-format-2\">messages = [    {&#8220;role&#8221;: &#8220;system&#8221;, &#8220;content&#8221;: DEFAULT_SYSTEM_PROMPT},    {&#8220;role&#8221;: &#8220;user&#8221;, &#8220;content&#8221;: text},]<\/span><\/p>\n\n\n\n<p>\u30e2\u30c7\u30eb\u306b\u5165\u529b\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u30d7\u30ed\u30f3\u30d7\u30c8\u3068\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">prompt = tokenizer.apply_chat_template(&#8230;<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>tokenizer.apply_chat_template<\/code> : \u4e0e\u3048\u3089\u308c\u305f <code>messages<\/code> \u3092\u5143\u306b\u751f\u6210\u7528\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>add_generation_prompt=True<\/code> : \u30e2\u30c7\u30eb\u304c\u751f\u6210\u3092\u958b\u59cb\u3059\u308b\u3079\u304d\u5834\u6240\u3092\u660e\u793a\u7684\u306b\u6307\u793a\u3059\u308b\u30d5\u30e9\u30b0\u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><span class=\"swl-format-2\">token_ids = tokenizer.encode(&#8230;<\/span><\/p>\n\n\n\n<p>\u751f\u6210\u3057\u305f\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u30c8\u30fc\u30af\u30f3\u306b\u5909\u63db\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>return_tensors=\"pt\"<\/code> \u306b\u3088\u3063\u3066\u3001PyTorch\u306e\u30c6\u30f3\u30bd\u30eb\u5f62\u5f0f\u306b\u5909\u63db\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">with torch.no_grad(&#8230;<\/span><\/p>\n\n\n\n<p>\u30e2\u30c7\u30eb\u304c\u65b0\u3057\u3044\u30c8\u30fc\u30af\u30f3\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>max_new_tokens=512<\/code>: \u751f\u6210\u3055\u308c\u308b\u65b0\u3057\u3044\u30c8\u30fc\u30af\u30f3\u306e\u6700\u5927\u6570\u3092\u6307\u5b9a\u3002<\/li>\n\n\n\n<li><code>do_sample=True<\/code>: \u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u3092\u6709\u52b9\u306b\u3057\u3001\u78ba\u7387\u7684\u306b\u30c8\u30fc\u30af\u30f3\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u3067\u591a\u69d8\u306a\u51fa\u529b\u3092\u751f\u6210\u3002<\/li>\n\n\n\n<li><code>temperature=0.6<\/code>: \u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u306e\u591a\u69d8\u6027\u3092\u8abf\u6574\u3059\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3002\u4f4e\u3044\u5024\u306b\u3059\u308b\u307b\u3069\u751f\u6210\u304c\u4fdd\u5b88\u7684\u306b\u306a\u308a\u3001\u9ad8\u3044\u5024\u306b\u3059\u308b\u3068\u30e9\u30f3\u30c0\u30e0\u6027\u304c\u5897\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>top_p=0.9<\/code>: top-p\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u306e\u78ba\u7387\u30de\u30b9\u3092\u6307\u5b9a\u3057\u3001\u9078\u3070\u308c\u305f\u30c8\u30fc\u30af\u30f3\u306e\u5408\u8a08\u78ba\u7387\u304c <code>0.9<\/code> \u306b\u306a\u308b\u3088\u3046\u306b\u4e0a\u4f4d\u306e\u30c8\u30fc\u30af\u30f3\u304b\u3089\u9078\u629e\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><span class=\"swl-format-2\">output = tokenizer.decode(&#8230;<\/span><\/p>\n\n\n\n<p>\u751f\u6210\u3055\u308c\u305f\u30c8\u30fc\u30af\u30f3\u5217\u3092\u30c7\u30b3\u30fc\u30c9\u3057\u3001\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>skip_special_tokens=True<\/code> \u306b\u3088\u3063\u3066\u3001\u7279\u6b8a\u30c8\u30fc\u30af\u30f3\u304c\u9664\u5916\u3055\u308c\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-right\" data-col=\"green\"><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>\u5bae\u5d0e\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u3092\u6559\u3048\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>\u5bae\u5d0e\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u3068\u3044\u3048\u3070\u3001\u307e\u305a\u300c\u30c1\u30ad\u30f3\u5357\u86ee\u300d\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002\u5bae\u5d0e\u770c\u306f\u9d8f\u8089\u306e\u751f\u7523\u91cf\u304c\u65e5\u672c\u4e00\u3067\u3042\u308a\u3001\u305d\u306e\u9d8f\u8089\u3092\u4f7f\u7528\u3057\u305f\u6599\u7406\u3068\u3057\u3066\u6709\u540d\u3067\u3059\u3002\u63da\u3052\u305f\u9d8f\u8089\u306b\u7518\u9162\u306e\u30bd\u30fc\u30b9\u3092\u304b\u3051\u305f\u3082\u306e\u3067\u3001\u3054\u98ef\u306e\u304a\u304b\u305a\u3084\u304a\u9152\u306e\u304a\u3064\u307e\u307f\u3068\u3057\u3066\u4eba\u6c17\u3067\u3059\u3002<br>\u307e\u305f\u3001\u300c\u51b7\u3084\u6c41\u300d\u3082\u5bae\u5d0e\u770c\u306e\u4ee3\u8868\u7684\u306a\u6599\u7406\u3067\u3059\u3002\u51b7\u305f\u3044\u5473\u564c\u6c41\u306b\u3001\u3054\u98ef\u3084\u91ce\u83dc\u3092\u5165\u308c\u3066\u98df\u3079\u308b\u3082\u306e\u3067\u3001\u590f\u306e\u6691\u3044\u6642\u671f\u306b\u3074\u3063\u305f\u308a\u306e\u6599\u7406\u3067\u3059\u3002<br>\u3055\u3089\u306b\u3001\u300c\u5bae\u5d0e\u30e9\u30fc\u30e1\u30f3\u300d\u3082\u6709\u540d\u3067\u3059\u3002\u8c5a\u9aa8\u30d9\u30fc\u30b9\u306e\u30b9\u30fc\u30d7\u306b\u3001\u7d30\u9eba\u3068\u30c1\u30e3\u30fc\u30b7\u30e5\u30fc\u3001\u30cd\u30ae\u306a\u3069\u3092\u30c8\u30c3\u30d4\u30f3\u30b0\u3057\u305f\u30e9\u30fc\u30e1\u30f3\u3067\u3001\u5bae\u5d0e\u770c\u5185\u3067\u591a\u304f\u306e\u30e9\u30fc\u30e1\u30f3\u5e97\u304c\u55b6\u696d\u3057\u3066\u3044\u307e\u3059\u3002<br>\u3053\u308c\u3089\u306e\u6599\u7406\u306f\u3001\u5bae\u5d0e\u770c\u306e\u98df\u6587\u5316\u3092\u4ee3\u8868\u3059\u308b\u3082\u306e\u3067\u3042\u308a\u3001\u89b3\u5149\u5ba2\u306b\u3082\u4eba\u6c17\u3067\u3059\u3002<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<p class=\"is-style-icon_good\">\u5bae\u5d0e\u770c\u306e\u89b3\u5149\u60c5\u5831\u3092\u8a73\u3057\u304f\u63d0\u4f9b\u3067\u304d\u3066\u3044\u307e\u3059\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u65e5\u672c\u8a9e\u3067\u306e\u8cea\u554f\u5fdc\u7b54\uff082\uff09<\/h3>\n\n\n\n<p><span class=\"swl-format-2\">\u300c\u793e\u5185\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u306e\u904b\u7528\u30eb\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300d\u3068\u3044\u3046\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>DEFAULT_SYSTEM_PROMPT = \"\u3042\u306a\u305f\u306f\u65e5\u672c\u8a9e\u3067\u56de\u7b54\u3059\u308b\u30a2\u30b7\u30b9\u30bf\u30f3\u30c8\u3067\u3059\u3002\"\ntext = \"\u793e\u5185\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u306e\u904b\u7528\u30eb\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002\"\n\nmessages = &#091;\n    {\"role\": \"system\", \"content\": DEFAULT_SYSTEM_PROMPT},\n    {\"role\": \"user\", \"content\": text},\n]\n\nprompt = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True\n)\n\ntoken_ids = tokenizer.encode(\n    prompt, add_special_tokens=False,\n    return_tensors=\"pt\"\n)\n\nwith torch.no_grad():\n    output_ids = model.generate(\n        token_ids.to(model.device),\n        max_new_tokens=512,\n        do_sample=True,\n        temperature=0.6,\n        top_p=0.9,\n    )\n\noutput = tokenizer.decode(\n    output_ids.tolist()&#091;0]&#091;token_ids.size(1):], \n    skip_special_tokens=True\n)\nprint(output)<\/code><\/pre>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-right\" data-col=\"green\"><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>\u793e\u5185\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u306e\u904b\u7528\u30eb\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>\u793e\u5185\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u306e\u904b\u7528\u30eb\u30fc\u30eb<br><br>**\u76ee\u7684**<br><br>\u3053\u306e\u30eb\u30fc\u30eb\u306f\u3001\u793e\u5185\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u306e\u9069\u5207\u306a\u4f7f\u7528\u3092\u4fc3\u9032\u3057\u3001\u5186\u6ed1\u306a\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u73fe\u3059\u308b\u3053\u3068\u3092\u76ee\u7684\u3068\u3057\u3066\u3044\u307e\u3059\u3002<br><br>**\u57fa\u672c\u539f\u5247**<br><br>1. **\u656c\u610f\u3068\u793c\u5100**: \u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u306e\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u5e38\u306b\u656c\u610f\u3068\u793c\u5100\u3092\u6301\u3063\u3066\u884c\u3046\u3053\u3068\u3002<br>2. **\u660e\u78ba\u306a\u8868\u73fe**: \u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u660e\u78ba\u304b\u3064\u7c21\u6f54\u306b\u8868\u73fe\u3059\u308b\u3053\u3068\u3002<br>3. **\u30d7\u30e9\u30a4\u30d0\u30b7\u30fc\u4fdd\u8b77**: \u500b\u4eba\u60c5\u5831\u3084\u6a5f\u5bc6\u60c5\u5831\u306f\u3001\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u5171\u6709\u3057\u306a\u3044\u3053\u3068\u3002<br><br>**\u4f7f\u7528\u65b9\u6cd5**<br><br>1. **\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u306e\u9078\u629e**: \u793e\u5185\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u3068\u3057\u3066\u3001\u6307\u5b9a\u3055\u308c\u305f\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3002<br>2. **\u30a2\u30ab\u30a6\u30f3\u30c8\u7ba1\u7406**: \u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306f\u3001\u4f1a\u793e\u304c\u7ba1\u7406\u3059\u308b\u3053\u3068\u3002<br>3. **\u30ed\u30b0\u30a4\u30f3\u60c5\u5831\u306e\u7ba1\u7406**: \u30ed\u30b0\u30a4\u30f3\u60c5\u5831\u306f\u3001\u4f1a\u793e\u304c\u7ba1\u7406\u3059\u308b\u3053\u3068\u3002<br>4. **\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u9001\u4fe1**: \u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u4fe1\u306f\u3001\u696d\u52d9\u6642\u9593\u5185\u306b\u9650\u308b\u3053\u3068\u3002<br><br>**\u7981\u6b62\u4e8b\u9805**<br><br>1. **\u500b\u4eba\u653b\u6483**: \u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u306e\u500b\u4eba\u653b\u6483\u306f\u7981\u6b62\u3059\u308b\u3053\u3068\u3002<br>2. **\u8ab9\u8b17\u4e2d\u50b7**: \u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u306e\u8ab9\u8b17\u4e2d\u50b7\u306f\u7981\u6b62\u3059\u308b\u3053\u3068\u3002<br>3. **\u6a5f\u5bc6\u60c5\u5831\u306e\u5171\u6709**: \u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u306e\u6a5f\u5bc6\u60c5\u5831\u306e\u5171\u6709\u306f\u7981\u6b62\u3059\u308b\u3053\u3068\u3002<br>4. **\u30b9\u30d1\u30e0\u884c\u70ba**: \u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u306e\u30b9\u30d1\u30e0\u884c\u70ba\u306f\u7981\u6b62\u3059\u308b\u3053\u3068\u3002<br><br>**\u30c8\u30e9\u30d6\u30eb\u5bfe\u5fdc**<br><br>1. **\u30c8\u30e9\u30d6\u30eb\u767a\u751f\u6642\u306e\u5bfe\u5fdc**: \u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u306e\u30c8\u30e9\u30d6\u30eb\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u901f\u3084\u304b\u306b\u4f1a\u793e\u306b\u5831\u544a\u3059\u308b\u3053\u3068\u3002<br>2. **\u30c8\u30e9\u30d6\u30eb\u89e3\u6c7a**: \u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u306e\u30c8\u30e9\u30d6\u30eb\u89e3\u6c7a\u306f\u3001\u4f1a\u793e\u304c\u884c\u3046\u3053\u3068\u3002<br><br>**\u5909\u66f4\u3068\u66f4\u65b0**<br><br>1. **\u30eb\u30fc\u30eb\u306e\u5909\u66f4**: \u3053\u306e\u30eb\u30fc\u30eb\u306f\u3001\u4f1a\u793e\u306e\u5224\u65ad\u306b\u3088\u308a\u5909\u66f4\u307e\u305f\u306f\u66f4\u65b0\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308b\u3002<br>2. **\u5909\u66f4\u306e\u901a\u77e5**: \u30eb\u30fc\u30eb\u306e\u5909\u66f4\u307e\u305f\u306f\u66f4\u65b0\u306b\u3064\u3044\u3066\u306f\u3001\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u4e0a\u3067\u901a\u77e5\u3059\u308b\u3053\u3068\u3002<br><br>**\u6700\u7d42\u66f4\u65b0\u65e5**<br><br>\\[\u65e5\u4ed8<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<p class=\"is-style-icon_good\">\u904b\u7528\u30eb\u30fc\u30eb\u306e\u4f8b\u304c\u5f97\u3048\u3089\u308c\u307e\u3057\u305f\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b3\u30fc\u30c9\u751f\u6210<\/h3>\n\n\n\n<p><span class=\"swl-format-2\">\u300cadd_generation_prompt=True\u306e\u5f79\u5272\u3092\u6559\u3048\u3066\u4e0b\u3055\u3044\u3002\u300d\u3068\u3044\u3046\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>DEFAULT_SYSTEM_PROMPT = \"\u3042\u306a\u305f\u306f\u65e5\u672c\u8a9e\u3067\u56de\u7b54\u3059\u308b\u30a2\u30b7\u30b9\u30bf\u30f3\u30c8\u3067\u3059\u3002\"\ntext = '''\u4ee5\u4e0b\u306eadd_generation_prompt=True\u306e\u5f79\u5272\u3092\u6559\u3048\u3066\u4e0b\u3055\u3044\u3002\nprompt = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True\n)'''\n\nmessages = &#091;\n    {\"role\": \"system\", \"content\": DEFAULT_SYSTEM_PROMPT},\n    {\"role\": \"user\", \"content\": text},\n]\n\nprompt = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True\n)\n\ntoken_ids = tokenizer.encode(\n    prompt, add_special_tokens=False,\n    return_tensors=\"pt\"\n)\n\nwith torch.no_grad():\n    output_ids = model.generate(\n        token_ids.to(model.device),\n        max_new_tokens=512,\n        do_sample=True,\n        temperature=0.6,\n        top_p=0.9,\n    )\n\noutput = tokenizer.decode(\n    output_ids.tolist()&#091;0]&#091;token_ids.size(1):], \n    skip_special_tokens=True\n)\nprint(output)<\/code><\/pre>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-right\" data-col=\"green\"><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>add_generation_prompt=True\u306e\u5f79\u5272\u3092\u6559\u3048\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<p class=\"is-style-balloon_box\">\u30e2\u30c7\u30eb\u306e\u5fdc\u7b54<\/p>\n\n\n\n<pre class=\"wp-block-code has-swl-gray-background-color has-background\"><code>`add_generation_prompt=True` \u306e\u5f79\u5272\u306f\u3001\u4f1a\u8a71\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u751f\u6210\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3059\u3002\n\n\u751f\u6210\u30d7\u30ed\u30f3\u30d7\u30c8\u3068\u306f\u3001\u30e2\u30c7\u30eb\u304c\u751f\u6210\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u306e\u958b\u59cb\u90e8\u5206\u3067\u3059\u3002\u901a\u5e38\u3001\u4f1a\u8a71\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u5165\u529b\u306b\u5fdc\u3058\u3066\u30e2\u30c7\u30eb\u304c\u5fdc\u7b54\u3092\u751f\u6210\u3057\u307e\u3059\u304c\u3001\u751f\u6210\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u30e2\u30c7\u30eb\u304c\u751f\u6210\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u306e\u958b\u59cb\u90e8\u5206\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002\n\n\u305f\u3068\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u300c\u4eca\u65e5\u306e\u5929\u6c17\u306f\uff1f\u300d\u3068\u5165\u529b\u3057\u305f\u5834\u5408\u3001\u30e2\u30c7\u30eb\u306f\u300c\u4eca\u65e5\u306e\u5929\u6c17\u306f\u300d\u3068\u3044\u3046\u751f\u6210\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u57fa\u3065\u3044\u3066\u300c\u4eca\u65e5\u306e\u5929\u6c17\u306f\u6674\u308c\u3067\u3059\u300d\u3068\u3044\u3046\u5fdc\u7b54\u3092\u751f\u6210\u3057\u307e\u3059\u3002\n\n`add_generation_prompt=True` \u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u4f1a\u8a71\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u751f\u6210\u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u8ffd\u52a0\u3055\u308c\u3001\u30e2\u30c7\u30eb\u304c\u751f\u6210\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u306e\u958b\u59cb\u90e8\u5206\u304c\u6307\u5b9a\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30e2\u30c7\u30eb\u304c\u751f\u6210\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u306e\u54c1\u8cea\u3068\u4e00\u8cab\u6027\u304c\u5411\u4e0a\u3059\u308b\u3053\u3068\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002\n<\/code><\/pre>\n\n\n\n<p class=\"is-style-icon_good\">\u6b63\u3057\u3044\u5185\u5bb9\u3067\u751f\u6210\u3055\u308c\u307e\u3057\u305f\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"index_id8\">\u751f\u6210AI\u30fbLLM\u306e\u30b3\u30b9\u30c8\u3067\u304a\u56f0\u308a\u306a\u3089<\/h2>\n\n\n\n<p>GPU\u306e\u30b9\u30da\u30c3\u30af\u4e0d\u8db3\u3067\u751f\u6210AI\u306e\u958b\u767a\u304c\u601d\u3046\u3088\u3046\u306b\u9032\u307e\u306a\u3044\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<\/p>\n\n\n\n<p>\u305d\u3093\u306a\u3068\u304d\u306b\u306f\u3001<strong><span class=\"swl-format-2\">\u9ad8\u6027\u80fd\u306aGPU\u3092\u30ea\u30fc\u30ba\u30ca\u30d6\u30eb\u306a\u4fa1\u683c\u3067\u4f7f\u3048\u308bGPU\u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d3\u30b9\u304c\u304a\u3059\u3059\u3081\u3067\u3059\uff01<\/span><\/strong><\/p>\n\n\n\n<div class=\"p-blogParts post_content\" data-partsID=\"4543\">\n<div class=\"swell-block-capbox cap_box\" data-colset=\"col2\"><div class=\"cap_box_ttl\"><span>GPUSOROBAN<\/span><\/div><div class=\"cap_box_content\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1462\" height=\"508\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner.jpg\" alt=\"GPUSOROBAN\" class=\"wp-image-10134\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner.jpg 1462w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner-300x104.jpg 300w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner-1024x356.jpg 1024w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner-768x267.jpg 768w\" sizes=\"(max-width: 1462px) 100vw, 1462px\" \/><\/figure>\n\n\n\n<p>GPUSOROBAN\u306f\u3001<span class=\"swl-marker mark_yellow\"><span class=\"swl-format-1\">\u9ad8\u6027\u80fdGPU\u300cNVIDIA H200\u300d\u3092\u696d\u754c\u6700\u5b89\u7d1a\u306e\u6599\u91d1\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/span><\/p>\n\n\n\n<p>NVIDIA H200\u306f\u3001\u751f\u6210AI\u30fbLLM\u306e\u8a08\u7b97\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u5927\u5e45\u306b\u77ed\u7e2e\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30af\u30e9\u30a6\u30c9\u3067\u4f7f\u3048\u308b\u305f\u3081\u3001\u5927\u898f\u6a21\u306a\u8a2d\u5099\u6295\u8cc7\u306e\u5fc5\u8981\u304c\u306a\u304f\u3001\u7169\u96d1\u306a\u30b5\u30fc\u30d0\u30fc\u7ba1\u7406\u304b\u3089\u3082\u89e3\u653e\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"swell-block-columns\"><div class=\"swell-block-columns__inner\">\n<div class=\"swell-block-column swl-has-mb--s\">\n<div class=\"swell-block-button blue_ -size-l is-style-btn_normal\"><a href=\"https:\/\/soroban.highreso.jp\/?utm_medium=edgehub&amp;utm_source=edgehub&amp;utm_campaign=highend_boxb&amp;adid=edgehub\" class=\"swell-block-button__link\"><span>\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u307f\u308b<\/span><\/a><\/div>\n<\/div>\n\n\n\n<div class=\"swell-block-column swl-has-mb--s\">\n<div class=\"swell-block-button red_ -size-l is-style-btn_normal\"><a href=\"https:\/\/soroban.highreso.jp\/download\/compute-catalog\/?utm_medium=edgehub&amp;utm_source=edgehub&amp;utm_campaign=highend_boxb&amp;adid=edgehub\" class=\"swell-block-button__link\"><span>\u8cc7\u6599\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/span><\/a><\/div>\n<\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Llama 3.1 Swallow\u306f\u3001Meta\u306eLlama 3.1\u3092\u30d9\u30fc\u30b9\u306b\u3001\u6771\u5de5\u5927\u30fb\u7523\u7dcf\u7814\u304c\u65e5\u672c\u8a9e\u80fd\u529b\u3092\u5f37\u5316\u3057\u305fLLM\u3067\u3059\u3002 \u30aa\u30fc\u30d7\u30f3\u306a\u65e5\u672c\u8a9eLLM\u306e\u4e2d\u3067\u3001\u65e5\u672c\u8a9e\u306e\u8a00\u8a9e\u7406\u89e3\u30fb\u751f\u6210\u30bf\u30b9\u30af\u306b\u304a\u3044\u3066\u30c8\u30c3\u30d7\u30af\u30e9\u30b9\u306e\u6027\u80fd\u304c\u3042\u308a\u307e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12888,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[20],"tags":[],"class_list":["post-12834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machinelearning"],"_links":{"self":[{"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/posts\/12834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/comments?post=12834"}],"version-history":[{"count":2,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/posts\/12834\/revisions"}],"predecessor-version":[{"id":13320,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/posts\/12834\/revisions\/13320"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/media\/12888"}],"wp:attachment":[{"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/media?parent=12834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/categories?post=12834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/tags?post=12834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}