{"id":555,"date":"2023-04-12T21:47:25","date_gmt":"2023-04-12T12:47:25","guid":{"rendered":"http:\/\/blog.gurees.net\/?p=555"},"modified":"2023-04-13T00:51:01","modified_gmt":"2023-04-12T15:51:01","slug":"%e3%83%ad%e3%83%bc%e3%82%ab%e3%83%ab%e3%81%a7%e3%82%82gpt%e3%81%8c%e3%81%97%e3%81%9f%e3%81%84cerebras-gpt%e3%82%92%e5%8b%95%e3%81%8b%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.gurees.net\/?p=555","title":{"rendered":"\u30aa\u30f3\u30d7\u30ec\u30df\u30b9\u3067\u3082GPT\u304c\u3057\u305f\u3044(Cerebras-GPT\u3092\u52d5\u304b\u3057\u3066\u307f\u308b)"},"content":{"rendered":"\n<p>ChatGPT\u3059\u3054\u3044\u3067\u3059\u3088\u306d\u3002\u79c1\u3082ChatGPT Plus\u306b\u767b\u9332\u3057\u3066\u904a\u3093\u3067\u3044\u307e\u3059\u304c\u3001\u3084\u306f\u308a\u304a\u5bb6\u74b0\u5883\u3067\u52d5\u304b\u3057\u305f\u3044\u6b32\u6c42\u306b\u99c6\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3068\u306f\u3044\u3048\u5bb6\u3067\u3068\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3055\u305b\u308b\u306b\u306f\u5927\u5909\u306a\u306e\u3067\u3001\u5b66\u7fd2\u6e08\u307f\u306e\u30e2\u30c7\u30eb\u304c\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308bCerebras-GPT\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046\u305c\u3063\u3066\u3044\u3046\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u7269\u7406\u74b0\u5883\u3068\u3057\u3066\u306fDeskmini A300\u306bRyzen5 2400G\u306b32GB\u30e1\u30e2\u30ea\u3001480GB SSD\u306e\u74b0\u5883\u306bProxmox\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u74b0\u5883\u3067\u3001LXC\u306eCentOS Stream9\u3092\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u304b\u3089\u69cb\u7bc9\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30e1\u30e2\u30ea\u306f24GB\u3001\u30b3\u30a2\u306f4\u30b3\u30a2\u8a2d\u5b9a\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3092\u69cb\u7bc9\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30b3\u30f3\u30c6\u30ca\u3092\u7acb\u3061\u4e0a\u3052\u3066\u3059\u3050\u306fssh\u304c\u4f7f\u3048\u306a\u3044\u306e\u3067\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u304b\u3089ssh\u30b5\u30fc\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3057\u307e\u3059\u3002root\u30ed\u30b0\u30a4\u30f3\u3092\u8a31\u53ef\u3057\u3001\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># dnf install -y openssh-server\n# vi \/etc\/ssh\/sshd_config\n\u2193\u4ee5\u4e0b\u3092\u8ffd\u8a18\nPermitRootLogin yes\n\n# systemctl enable --now sshd<\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u3042\u3068\u306fssh\u7d4c\u7531\u3067\u4f5c\u696d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>Python\u3092\u5165\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># dnf install python3 python-pip -y<\/pre>\n\n\n\n<p>pip\u3067transformers\u3068PyTorch\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># pip install transformers torch torchvision torchaudio<\/pre>\n\n\n\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u30d9\u30fc\u30b9\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u7d44\u3093\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u9069\u5f53\u306a\u30de\u30a6\u30f3\u30c8\u30dd\u30a4\u30f3\u30c8\u4f5c\u3063\u3066cache_dir\u3067\u6307\u5b9a\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u7d50\u69cb\u30c7\u30fc\u30bf\u306f\u30b5\u30a4\u30ba\u304c\u3042\u308a\u307e\u3059\u3002\u4e00\u756a\u5927\u304d\u304413B\u304c30GB\u3050\u3089\u3044\u30012.7B\u306710GB\u3050\u3089\u3044\u30011.1B\u30675GB\u3050\u3089\u3044\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from transformers import AutoTokenizer, AutoModelForCausalLM\nfrom transformers import pipeline\n\n#model_name = \"cerebras\/Cerebras-GPT-2.7B\"\nmodel_name = \"cerebras\/Cerebras-GPT-1.3B\"\n#model_name = \"cerebras\/Cerebras-GPT-590M\"\ncache_dir=\"\/work\"\n\ntokenizer = AutoTokenizer.from_pretrained(   model_name, cache_dir=cache_dir)\nmodel = AutoModelForCausalLM.from_pretrained(model_name, cache_dir=cache_dir)\n\ntext = \"Japan is\"\n\npipe = pipeline(\"text-generation\", model=model, tokenizer=tokenizer)\ngenerated_text = pipe(text, max_length=50, do_sample=False, no_repeat_ngram_size=2)[0]\nprint(generated_text['generated_text'])<\/pre>\n\n\n\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u3044\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># python gpt1.3b.py\n2023-04-12 15:34:33.585236: I tensorflow\/core\/platform\/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\nTo enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n2023-04-12 15:34:34.473024: W tensorflow\/compiler\/tf2tensorrt\/utils\/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\nSetting `pad_token_id` to `eos_token_id`:50256 for open-end generation.\nJapan is a country with a population of over 1.2 billion people. It is the second largest country in the world after the United States. The country is divided into four regions: the Northern Region, the Southern Region and the Western Region.<\/pre>\n\n\n\n<p>Japan is\u3067\u6307\u5b9a\u3057\u305f\u3068\u304d\u3001\u51fa\u529b\u306f\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>Japan is a country with a population of over 1.2 billion people. It is the second largest country in the world after the United States. The country is divided into four regions: the Northern Region, the Southern Region and the Western Region.<\/p>\n\n\n\n<p>\u65e5\u672c\u8a9e\u8a33<br>\u65e5\u672c\u306f\u300112\u5104\u4eba\u4ee5\u4e0a\u306e\u4eba\u53e3\u3092\u62b1\u3048\u308b\u56fd\u3067\u3042\u308b\u3002\u7c73\u56fd\u306b\u6b21\u3044\u3067\u4e16\u754c\u30672\u756a\u76ee\u306b\u5927\u304d\u306a\u56fd\u3067\u3042\u308b\u3002\u56fd\u306f\u3001\u5317\u65b9\u9818\u571f\u3001\u5357\u65b9\u9818\u571f\u3001\u897f\u65b9\u9818\u571f\u306e4\u3064\u306e\u5730\u57df\u306b\u5206\u304b\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u306a\u3093\u3060\u304b\u3001\u5185\u5bb9\u306f\u73fe\u5b9f\u3068\u306f\u9055\u3046\u3051\u3069\u3001\u6587\u7ae0\u3068\u3057\u3066\u306f\u305d\u308c\u3089\u3057\u3044\u3082\u306e\u3092\u751f\u6210\u3057\u3066\u305d\u3046\u306b\u601d\u3048\u307e\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u65e5\u672c\u8a9e\u3092\u653e\u308a\u8fbc\u3080\u3068\u306a\u3093\u304b\u51fa\u529b\u306f\u3055\u308c\u307e\u3057\u305f\u304c\u3001\u5185\u5bb9\u306f\u3055\u3089\u306b\u5909\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u8b0e\u306e\u300c\u304a\u3058\u300d\u3067\u3059\u3002<br>\u300c\u65e5\u672c\u3068\u306f\u300d\u304b\u3089\u7d9a\u3051\u3055\u305b\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># python gpt1.3b.py\n2023-04-12 15:39:20.700306: I tensorflow\/core\/platform\/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\nTo enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n2023-04-12 15:39:21.583570: W tensorflow\/compiler\/tf2tensorrt\/utils\/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\nSetting `pad_token_id` to `eos_token_id`:50256 for open-end generation.\n\u65e5\u672c\u3068\u306f\u3001\u305d\u308c\u305e\u308c\u306e\u8cac\u4efb\u3092\u6301\u3064\u4eba\u3005\u304c\u652f\u63f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\n\n\u304a\u3058<\/pre>\n\n\n\n<p>\u3053\u306e\u611f\u3058\u3060\u3068\u65e5\u672c\u8a9e\u5165\u529b\u2192\u7ffb\u8a33\u2192GPT\u2192\u7ffb\u8a33\u2192\u51fa\u529b\u3059\u308b\u3068\u307e\u3042\u307e\u3042\u3044\u3044\u611f\u3058\u306b\u306a\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ChatGPT\u3059\u3054\u3044\u3067\u3059\u3088\u306d\u3002\u79c1\u3082ChatGPT Plus\u306b\u767b\u9332\u3057\u3066\u904a\u3093\u3067\u3044\u307e\u3059\u304c\u3001\u3084\u306f\u308a\u304a\u5bb6\u74b0\u5883\u3067\u52d5\u304b\u3057\u305f\u3044\u6b32\u6c42\u306b\u99c6\u3089\u308c\u307e\u3059\u3002 \u3068\u306f\u3044\u3048\u5bb6\u3067\u3068\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3055\u305b\u308b\u306b\u306f\u5927\u5909\u306a\u306e\u3067\u3001\u5b66\u7fd2\u6e08\u307f\u306e\u30e2\u30c7\u30eb\u304c\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u3067\u516c\u958b\u3055\u308c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,25,30],"tags":[],"class_list":["post-555","post","type-post","status-publish","format-standard","hentry","category-deskmini","category-programming","category-proxmox"],"_links":{"self":[{"href":"https:\/\/blog.gurees.net\/index.php?rest_route=\/wp\/v2\/posts\/555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.gurees.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.gurees.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.gurees.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.gurees.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=555"}],"version-history":[{"count":2,"href":"https:\/\/blog.gurees.net\/index.php?rest_route=\/wp\/v2\/posts\/555\/revisions"}],"predecessor-version":[{"id":558,"href":"https:\/\/blog.gurees.net\/index.php?rest_route=\/wp\/v2\/posts\/555\/revisions\/558"}],"wp:attachment":[{"href":"https:\/\/blog.gurees.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.gurees.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.gurees.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}