{"id":347103,"date":"2023-03-22T21:00:17","date_gmt":"2023-03-22T21:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=347103"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=347103","title":{"rendered":"<span>\u041a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0418\u0418 \u043d\u0430 \u0441\u043b\u0430\u0431\u043e\u043c \u0436\u0435\u043b\u0435\u0437\u0435<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h1 id=\"nachalo-raboty-s-petals\">\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Petals<\/h1>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a\u043d\u043e\u0442 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442 \u0432\u0430\u0441 \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 Petals \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u0442\u043e\u0447\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0441\u043e\u0442\u043d\u044f\u043c\u0438 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u043e\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 GPU. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Petals \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 176 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/huggingface.co\/bigscience\/bloom\">BLOOM-196B<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/huggingface.co\/bigscience\/bloomz\">BLOOMZ<\/a> \u0442\u043e\u0433\u043e \u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0447\u0442\u043e \u0438 GPT-3.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0415\u0441\u043b\u0438\u00a0\u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u00a0\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u0435 \u043d\u0430\u043c \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430 \u043a\u0430\u043d\u0430\u043b\u0435 <a href=\"https:\/\/discord.gg\/J29mCBNBvm\">#running-a-client<\/a> \u043d\u0430\u0448\u0435\u0433\u043e Discord!<\/p>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c <a href=\"https:\/\/github.com\/bigscience-workshop\/petals\">Petals<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># \u041c\u0430\u0433\u0438\u044f IPython \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 Python. # %pip install -q petals<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"shag-1-prosteyshiysposob-sgenerirovat-tekst\">\u0428\u0430\u0433 1. \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439\u00a0\u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441\u00a0\u043c\u043e\u0434\u0435\u043b\u0438 <strong><code>DistributedBloom<\/code><\/strong> \u0438 \u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043c\u0430\u0448\u0438\u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0435\u0441\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 (~ 8 \u0413\u0411 \u0438\u0437 352 \u0413\u0411) \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b \u0432 \u0441\u0435\u0442\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0441\u0435\u0439\u043c\u043e\u0434\u0435\u043b\u0438. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432\u0435\u0441\u043e\u0432 \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 ~3 \u043c\u0438\u043d\u0443\u0442\u044b.<\/p>\n<p>  <\/p>\n<blockquote><p>\u041c\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e BLOOM, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f\u00a0<a href=\"https:\/\/huggingface.co\/bigscience\/bloomz\">BLOOMZ<\/a> \u2014 \u0432\u0435\u0440\u0441\u0438\u044e BLOOM, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043f\u043e\u043f\u044b\u0442\u043e\u043a. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0438\u043c\u044f \u043c\u043e\u0434\u0435\u043b\u0438:\u00a0<code>MODEL_NAME = \"bigscience\/bloomz-petals\"<\/code>.<\/p><\/blockquote>\n<p>  <\/p>\n<pre><code class=\"python\">import torch from transformers import BloomTokenizerFast from petals import DistributedBloomForCausalLM  MODEL_NAME = \"bigscience\/bloom-petals\" tokenizer = BloomTokenizerFast.from_pretrained(MODEL_NAME) model = DistributedBloomForCausalLM.from_pretrained(MODEL_NAME) model = model.cuda()<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c\u00a0\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c\u00a0<strong><code>model.generate()<\/code><\/strong>.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0437\u043e\u0432\u00a0\u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u043a\u043e\u043b\u043e 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0440\u043e\u044e petals. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u00a0\u043c\u043e\u0436\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 1\u20131,5 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043d\u0430 \u0442\u043e\u043a\u0435\u043d. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u044d\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 10\u201320 \u0441\u0435\u043a\u0443\u043d\u0434 \u043d\u0430 \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">inputs = tokenizer('A cat in French is \"', return_tensors=\"pt\")[\"input_ids\"].cuda() outputs = model.generate(inputs, max_new_tokens=3) print(tokenizer.decode(outputs[0]))<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>model.generate()<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0436\u0430\u0434\u043d\u0443\u044e\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u00a0\u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0432\u044b\u0431\u043e\u0440\u043a\u0443 top-p\/top-k \u0438\u043b\u0438 \u043b\u0443\u0447\u0435\u0432\u043e\u0439 \u043f\u043e\u0438\u0441\u043a, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u00a0\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0438\u0436\u0435.<\/p>\n<p>  <\/p>\n<blockquote><p>\u0412\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438 \u0438\u0437 \u043e\u0431\u0449\u0435\u0433\u043e \u0440\u043e\u044f. \u041e \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u2014 <a href=\"https:\/\/github.com\/bigscience-workshop\/petals\/wiki\/Security,-privacy,-and-AI-safety\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0414\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c <a href=\"https:\/\/github.com\/bigscience-workshop\/petals\/wiki\/Launch-your-own-swarm\">\u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u0440\u043e\u0439<\/a> \u0432 \u043a\u0440\u0443\u0433\u0443 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0435.<\/p><\/blockquote>\n<p>  <\/p>\n<h2 id=\"shag-2-chat-boty-i-interaktivnaya-generaciya\">\u0428\u0430\u0433 2. \u0427\u0430\u0442-\u0431\u043e\u0442\u044b \u0438 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c\u00a0<strong>\u0441\u0435\u0430\u043d\u0441\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\u00a0\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u043d\u0430 \u043b\u0435\u0442\u0443 \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0430\u0442-\u0431\u043e\u0442\u0430, \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u0430 \u0444\u0440\u0430\u0437\u044b \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0430\u043d\u0441 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0449\u0435\u0442 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0448\u043b\u044b\u0435 \u043a\u044d\u0448\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u0422\u0430\u043a\u00a0\u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0444\u0440\u0430\u0437\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u0415\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0432\u044b\u0439\u0434\u0435\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u044f, Petals \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0439\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0443 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043a\u044d\u0448\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Petals \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0447\u0430\u0442-\u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043a\u0435\u043d\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">with model.inference_session(max_length=512) as sess: while True: prompt = input('Human: ') if prompt == \"\": break prefix = f\"Human: {prompt}\\nFriendly AI:\" prefix = tokenizer(prefix, return_tensors=\"pt\")[\"input_ids\"].cuda() print(\"Friendly AI:\", end=\"\", flush=True)   while True:  outputs = model.generate(  prefix, max_new_tokens=1, do_sample=True, top_p=0.9, temperature=0.75, session=sess  )  outputs = tokenizer.decode(outputs[0, -1:])  print(outputs, end=\"\", flush=True)  if \"\\n\" in outputs:  break  prefix = None # Prefix is passed only for the 1st token of the bot's response<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"sozdanie-prilozheniy-s-petals\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 Petals<\/h3>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043b\u044e\u0434\u0435\u0439, \u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Petals \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442\u0430\u043a\u043e\u0435 \u043a\u0430\u043a <a href=\"http:\/\/chat.petals.ml\">chat.petals.ml<\/a>. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u043d\u043e\u0439 <a href=\"https:\/\/github.com\/borzunov\/petals-chat\">\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 HTTP<\/a> \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430, \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e\u00a0\u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0440\u043e\u0439 Petals.<\/p>\n<p>  <\/p>\n<blockquote><p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u00a0BLOOM \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Petals, \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043e\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <a href=\"https:\/\/huggingface.co\/bigscience\/bloom\">\u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/a> BLOOM.<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/403\/912\/d41\/403912d41cf89081f0257c36c05633f3.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/403\/912\/d41\/403912d41cf89081f0257c36c05633f3.png\"\/> <\/p>\n<p>  <\/p>\n<h2 id=\"shag-3-kak-eto-rabotaet\">\u0428\u0430\u0433 3. \u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h2>\n<p>  <\/p>\n<p>\u0412\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u2014 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 BLOOM-176B, \u043d\u043e \u0432 GPU\u00a0\u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0435\u00a0\u0447\u0430\u0441\u0442\u044c. \u0417\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">model.transformer<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">DistributedBloomModel(   (word_embeddings): Embedding(250880, 14336)   (word_embeddings_layernorm): LayerNorm((14336,), eps=1e-05, elementwise_affine=True)   (h): RemoteSequential(modules=bigscience\/bloom-petals.0..bigscience\/bloom-petals.69)   (ln_f): LayerNorm((14336,), eps=1e-05, elementwise_affine=True) )<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043b\u043e\u0438 \u2014 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 PyTorch, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u043d\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u043b\u043e\u043a\u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0440\u043e\u0432) \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441 <strong>RemoteSequential<\/strong>. \u042d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c PyTorch, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0430\u0448\u0438\u043d.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043b\u043e\u044f\u043c \u0438 \u0438\u0445 \u0432\u044b\u0432\u043e\u0434\u0430\u043c, \u0430 \u0435\u0449\u0435 \u043f\u0440\u043e\u0431\u0435\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043d\u0438\u043c \u0432\u043f\u0435\u0440\u0435\u0434 \u0438 \u043d\u0430\u0437\u0430\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">first_five_layers = model.transformer.h[0:5] first_five_layers  dummy_inputs = torch.randn(1, 3, 14336, dtype=torch.bfloat16, requires_grad=True) outputs = first_five_layers(dummy_inputs) outputs  loss = torch.mean((outputs - torch.ones_like(outputs)) ** 2) loss.backward() # backpropagate through the internet print(\"Grad w.r.t. inputs:\", dummy_inputs.grad.flatten())<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Grad w.r.t. inputs: tensor([ 0.0265, -0.0212,  0.0121,  ...,  0.0019, -0.0002,  0.0012],        dtype=torch.bfloat16)<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/bbb\/411\/1c6\/bbb4111c661dfdb42ab2dbe3aedec1f3.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/bbb\/411\/1c6\/bbb4111c661dfdb42ab2dbe3aedec1f3.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0438, \u043a\u0430\u043a \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c PyTorch, \u0438 \u0434\u0430\u0436\u0435 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b) \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u044f\u043c\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/bbb\/411\/1c6\/bbb4111c661dfdb42ab2dbe3aedec1f3.png\" width=\"80%\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/bbb\/411\/1c6\/bbb4111c661dfdb42ab2dbe3aedec1f3.png\"\/>  <\/p>\n<p><a href=\"https:\/\/arxiv.org\/pdf\/2209.01188.pdf\">\u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"shag-4-dobavlenie-obuchaemogo-adaptera\">\u0428\u0430\u0433 4. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430<\/h2>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0440\u043e\u0432 \u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u044b, \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f\u00a0\u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0447\u0442\u043e\u0431\u044b BLOOM \u0440\u0435\u0448\u0430\u043b \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u00a0\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432 (\u043c\u0430\u043b\u044b\u0445 \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0441\u043b\u043e\u0435\u0432 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/arxiv.org\/abs\/2106.09685\">LoRA<\/a>) \u0438\u043b\u0438 \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0432\u0445\u043e\u0434\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u0434 \u0432\u0445\u043e\u0434\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 <a href=\"https:\/\/arxiv.org\/abs\/2110.07602\">P-Tuning v2<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043c\u0435\u0436\u0434\u0443 5-\u043c \u0438 6-\u043c \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0440\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u0412\u0435\u0441\u0430 \u0441\u043b\u043e\u044f \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import torch.nn as nn import torch.nn.functional as F  class BloomBasedClassifier(nn.Module): def __init__(self, model): super().__init__() self.distributed_layers = model.transformer.h self.adapter = nn.Sequential(nn.Linear(14336, 32), nn.Linear(32, 14336)) self.head = nn.Sequential(nn.LayerNorm(14336), nn.Linear(14336, 2))  def forward(self, embeddings): hidden_states = self.distributed_layers[0:6](embeddings) hidden_states = self.adapter(hidden_states) hidden_states = self.distributed_layers[6:10](hidden_states) pooled_states = torch.mean(hidden_states, dim=1) return self.head(pooled_states)  classifier = BloomBasedClassifier(model).cuda() opt = torch.optim.Adam(classifier.parameters(), 3e-5) inputs = torch.randn(3, 2, 14336, device='cuda') labels = torch.tensor([1, 0, 1], device='cuda')  for i in range(5): loss = F.cross_entropy(classifier(inputs), labels) print(f\"loss[{i}] = {loss.item():.3f}\") opt.zero_grad() loss.backward() opt.step()  print('predicted:', classifier(inputs).argmax(-1)) # l, o, l<\/code><\/pre>\n<p>  <\/p>\n<p>\u0428\u0430\u0433 5. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0431\u043e\u0440\u043a\u0438<\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 __<code>model.inference_session()<\/code>__ \u0432 Petals \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 \u0432\u044b\u0432\u043e\u0434\u043e\u0432. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043b\u044e\u0431\u044b\u0445 \u043d\u0435\u043e\u0431\u044a\u043e\u0434\u0438\u043c\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u00a0\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043b\u0443\u0447\u0435\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430,\u00a0\u0437\u0430\u043f\u0440\u0435\u0449\u0430\u044e\u0449\u0438\u0439\u00a0\u0440\u0443\u0433\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/p>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>model.generate()<\/code> \u0441 \u043f\u0440\u044f\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0430\u043c\u0438\u00a0\u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043b\u043e\u044f\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">text = \"What is a good chatbot? Answer:\" token_ids = tokenizer(text, return_tensors=\"pt\")[\"input_ids\"].cuda() max_length = 100 with torch.inference_mode(): with model.inference_session(max_length=max_length) as sess: while len(text) &lt; max_length: embs = model.transformer.word_embeddings(token_ids) embs = model.transformer.word_embeddings_layernorm(embs)   h = sess.step(embs)  h_last = model.transformer.ln_f(h[:, -1])  logits = model.lm_head(h_last)   next_token = logits.argmax(dim=-1)  text += tokenizer.decode(next_token)  token_ids = next_token.reshape(1, 1)  print(text)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">What is a good chatbot? Answer: A What is a good chatbot? Answer: A chat What is a good chatbot? Answer: A chatbot What is a good chatbot? Answer: A chatbot that What is a good chatbot? Answer: A chatbot that is What is a good chatbot? Answer: A chatbot that is able What is a good chatbot? Answer: A chatbot that is able to What is a good chatbot? Answer: A chatbot that is able to answer What is a good chatbot? Answer: A chatbot that is able to answer the What is a good chatbot? Answer: A chatbot that is able to answer the most What is a good chatbot? Answer: A chatbot that is able to answer the most common What is a good chatbot? Answer: A chatbot that is able to answer the most common questions What is a good chatbot? Answer: A chatbot that is able to answer the most common questions of What is a good chatbot? Answer: A chatbot that is able to answer the most common questions of your What is a good chatbot? Answer: A chatbot that is able to answer the most common questions of your customers<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"shag-6-delitsya---znachit-zabotitsya\">\u0428\u0430\u0433 6. \u0414\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u2014 \u0437\u043d\u0430\u0447\u0438\u0442 \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f<\/h2>\n<p>  <\/p>\n<p>\u041c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 Petals \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0443\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043b\u044e\u0434\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u0434\u043b\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 \u0440\u043e\u044f. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c\u00a0GPU, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043d\u044f\u0442\u044b, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0443\u043c\u0430\u0439\u0442\u0435 \u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Petals**. \u041f\u0440\u0438\u043e\u0441\u0442\u043e\u043d\u043e\u0432\u0438\u0442\u0435\u00a0\u0435\u0433\u043e \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c GPU \u0434\u043b\u044f \u0447\u0435\u0433\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u0422\u0435, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0431\u043e\u043d\u0443\u0441\u043e\u043c\u00a0\u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Petals, \u0432\u0435\u0434\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 GPU-\u043c\u0430\u0448\u0438\u043d\u0430 \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c IP, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u043d\u043e\u00a0\u0432 \u0441\u0440\u0435\u0434\u0435 Anaconda:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">conda install pytorch pytorch-cuda=11.7 -c pytorch -c nvidia pip install -U petals python -m petals.cli.run_server bigscience\/bloom-petals<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0448 \u043e\u0431\u0440\u0430\u0437 Docker \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 GPU:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">sudo docker run --net host --ipc host --gpus all --volume petals-cache:\/cache --rm \\  learningathome\/petals:main python -m petals.cli.run_server bigscience\/bloom-petals<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0434\u0440\u0443\u0433\u0438\u043c \u043b\u044e\u0434\u044f\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435. \u0411\u043e\u043b\u044c\u0448\u0435 \u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u2014 <a href=\"https:\/\/github.com\/bigscience-workshop\/petals\/wiki\/Security,-privacy,-and-AI-safety\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u0448 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430 NAT \u0438\u043b\u0438 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u043e\u043c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f\u00a0\u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043d\u043e \u043e\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u043f\u0438\u0448\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u043a\u0430\u043d\u0430\u043b\u0435 <a href=\"https:\/\/discord.gg\/Wuk8BnrEPH\">#running-a-server<\/a> \u043d\u0430\u0448\u0435\u0433\u043e Discord, \u043c\u044b \u0432\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u043c.<\/p>\n<p>  <\/p>\n<h2 id=\"shag-7-drugie-metody-tonkoy-i-bystroy-nastroyki\">\u0428\u0430\u0433 7. \u0414\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0442\u043e\u043d\u043a\u043e\u0439 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/h2>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u00a0\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b, Petals \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/arxiv.org\/abs\/2104.08691\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445<\/a> <a href=\"https:\/\/arxiv.org\/abs\/2101.00190\">\u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/a> \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u043e\u043d\u043a\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub \u043c\u044b \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b\u00a0\u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0441\u043e\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0447\u0430\u0442-\u0431\u043e\u0442\u0430: <a href=\"https:\/\/github.com\/bigscience-workshop\/petals\/blob\/main\/examples\/prompt-tuning-personachat.ipynb\">\u0431\u043b\u043e\u043a\u043d\u043e\u0442<\/a><\/li>\n<li>\u0422\u043e\u043d\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 BLOOM \u0434\u043b\u044f \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430: <a href=\"https:\/\/github.com\/bigscience-workshop\/petals\/blob\/main\/examples\/prompt-tuning-sst2.ipynb\">\u0431\u043b\u043e\u043a\u043d\u043e\u0442<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"chto-esche\">\u0427\u0442\u043e \u0435\u0449\u0435?<\/h2>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Petals \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438 \u043a\u0430\u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432:<\/p>\n<p>  <\/p>\n<ul>\n<li><strong>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e Petals<\/strong>. \u0424\u0430\u0439\u043b <a href=\"https:\/\/github.com\/bigscience-workshop\/petals#readme\">README<\/a> \u0432 \u043d\u0430\u0448\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 GitHub \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 Petals, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u043e\u044f (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u043a\u0440\u043e\u043c\u0435\u00a0BLOOM).<\/li>\n<li><strong>\u0421\u0435\u0440\u0432\u0435\u0440 Discord.<\/strong> \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c\u00a0\u043e\u0442\u0437\u044b\u0432\u044b, \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, <a href=\"https:\/\/discord.gg\/D9MwApKgWa\">\u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a\u00a0\u0441\u0435\u0440\u0432\u0435\u0440\u0443 Discord<\/a> \u0438 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u0435 \u043d\u0430\u043c \u043e\u0431 \u044d\u0442\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Petals,\u00a0\u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0434\u044b \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0438.<\/li>\n<li><strong>\u041d\u0430\u0443\u0447\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f.<\/strong> \u041c\u044b \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u043b\u0438 <a href=\"https:\/\/arxiv.org\/abs\/2209.01188\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u043d\u0430\u0448\u0435\u043c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 Petals \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0410 \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0442\u0435\u043e\u0440\u0438\u044f \u2014 \u043d\u0430 \u043d\u0430\u0448\u0438\u0445 \u043a\u0443\u0440\u0441\u0430\u0445: <\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_220323&amp;utm_term=conc\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rz\/4h\/ne\/rz4hnexx9lidivxbzuaheff5usq.png\" data-src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rz\/4h\/ne\/rz4hnexx9lidivxbzuaheff5usq.png\"\/><\/a><\/p>\n<p>  <\/p>\n<ul>\n<li><u><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_220323&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/u><\/li>\n<li><u><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_220323&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u00a0Python (16 \u043c\u0435\u0441\u044f\u0446\u0435\u0432)<\/a><\/u><\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043a\u0443\u0440\u0441\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p><strong>Data Science \u0438\u00a0Machine Learning<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-dlya-data-science#syllabus?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mat_220323&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-i-machine-learning-dlya-data-science?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_matml_220323&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438\u00a0Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dea_220323&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Data Engineering<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning-i-deep-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mldl_220323&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438\u00a0Deep Learning\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_ml_220323&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Machine Learning<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>Python, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u00a0Python<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_pws_220323&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_webdev_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/ios-razrabotchik-s-nulya?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_ios_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/android-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_andr_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>Java \u0438\u00a0C#<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/java-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_java_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer-testirovshik-po?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_qaja_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430\u00a0JAVA<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-sharp-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cdev_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C#-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/game-razrabotchik-na-unity-i-c-sharp?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_gamedev_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430\u00a0Unity<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u00a0\u043e\u0441\u043d\u043e\u0432\u00a0\u2014 \u0432\u00a0\u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/algoritmy-i-struktury-dannyh?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_algo_220323&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/cyber-security-etichnij-haker?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_hacker_220323&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u00ab\u0411\u0435\u043b\u044b\u0439 \u0445\u0430\u043a\u0435\u0440\u00bb<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u0410\u00a0\u0442\u0430\u043a\u0436\u0435<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/devops-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_220323&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0DevOps<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_220323&amp;utm_term=cat\">\u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b<\/a><\/li>\n<\/ul>\n<\/div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/724114\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/724114\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h1 id=\"nachalo-raboty-s-petals\">\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Petals<\/h1>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a\u043d\u043e\u0442 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442 \u0432\u0430\u0441 \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 Petals \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u0442\u043e\u0447\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0441\u043e\u0442\u043d\u044f\u043c\u0438 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u043e\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 GPU. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Petals \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 176 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/huggingface.co\/bigscience\/bloom\">BLOOM-196B<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/huggingface.co\/bigscience\/bloomz\">BLOOMZ<\/a> \u0442\u043e\u0433\u043e \u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0447\u0442\u043e \u0438 GPT-3.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-347103","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=347103"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347103\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=347103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=347103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=347103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}