{"id":353305,"date":"2024-05-20T22:25:21","date_gmt":"2024-05-20T22:25:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=353305"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=353305","title":{"rendered":"<span>CodeLama \u0432 \u0432\u0430\u0448\u0435\u0439 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435 | \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 Copilot \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ee4\/30f\/cd3\/ee430fcd311ac83209fbf97e940e8cb7.png\" width=\"1000\" height=\"563\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee4\/30f\/cd3\/ee430fcd311ac83209fbf97e940e8cb7.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%BE\" id=\"\u043d\u0430\u0447\u0430\u043b\u043e\"><\/a><\/p>\n<p>\u0421\u0442\u043e\u044e \u044f \u0437\u043d\u0430\u0447\u0438\u0442 \u0443\u0442\u0440\u043e\u043c (\u043e\u043a\u043e\u043b\u043e 2 \u0447\u0430\u0441\u043e\u0432 \u0434\u043d\u044f) \u0432\u043e\u0437\u043b\u0435 \u043a\u043e\u0444\u0435\u0432\u0430\u0440\u043a\u0438 \u0438 \u043b\u0438\u0441\u0442\u0430\u044e \u043b\u0435\u043d\u0442\u0443 \u0445\u0430\u0431\u0440\u0430, \u0430 \u0442\u0430\u043c <a href=\"https:\/\/habr.com\/ru\/news\/756798\/\" rel=\"noopener noreferrer nofollow\">CodeLama<\/a> \u0432\u044b\u0448\u043b\u0430. <a href=\"https:\/\/habr.com\/ru\/articles\/674658\/\" rel=\"noopener noreferrer nofollow\">Copilot<\/a> \u0434\u043b\u044f \u0431\u0435\u0434\u043d\u044b\u0445 \u044d\u0442\u043e \u0438\u043b\u0438 \u043f\u0430\u043d\u0430\u0446\u0435\u044f \u0432 \u043c\u0438\u0440\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439? \u041f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u0432\u0435\u0434\u044c \u0432\u0430\u0448\u0438 \u0441\u043e\u0441\u0435\u0434\u0438 \u0441\u043d\u0438\u0437\u0443 \u0443\u0442\u043e\u043d\u0443\u0442 \u0432 \u0432\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043b\u044c\u0451\u0442\u0441\u044f \u0438\u0437 \u044d\u043a\u0440\u0430\u043d\u0430.<br \/>\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 &#8212; \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0445 \u0438 \u0440\u0438\u0441\u043a. \u0421\u0442\u0430\u0442\u044c\u044f \u043f\u0438\u0441\u0430\u043b\u0430\u0441\u044c \u0441\u043f\u0438\u043d\u043d\u044b\u043c \u043c\u043e\u0437\u0433\u043e\u043c \u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0439 \u043d\u043e\u0447\u044c\u044e, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043d\u0430\u0442\u044f\u043d\u0443\u0442\u0443\u044e \u043d\u0430 \u0433\u043b\u043e\u0431\u0443\u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0442\u0435\u0445\u043d\u043e\u0442\u0435\u043a\u0441\u0442, \u0447\u0442\u043e \u0431\u044b \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u0439 \u0443 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f. \u041d\u0443 \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u0432\u0435\u0440\u043d\u043e? <\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0445\u043e\u0447\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u0433\u043e &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0430\u0439\u0434 \u043f\u043e \u043f\u0430\u0440\u0435 \u0443\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0437\u0430 \u043d\u0430\u0441 \u043b\u0438\u0431 \u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 mvp \u043a\u043e\u0434 (60+60 \u0441\u0442\u0440\u043e\u043a) \u043a\u0430\u043a \u0438\u0442\u043e\u0433.<\/p>\n<p>\u041a\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0447\u0438\u0442\u0430\u0442\u044c? &#8212; \u0422\u0435\u043c, \u043a\u0442\u043e \u043f\u0438\u0441\u0430\u043b \u043c\u043d\u0435 \u0432 \u0447\u0430\u0442 \u0445\u0430\u0431\u0440\u0430 \u0438 \u0442\u0435\u043b\u0435\u0433\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432\u0440\u043e\u0434\u0435 <em>&#171;\u0410 \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c?&#187;<\/em> \u0438\u043b\u0438 <em>&#171;\u041a\u0430\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u043b\u043e\u043a\u043d\u043e\u0442 \u043a\u043e\u043b\u0430\u0431\u0430?&#187;<\/em>. \u041c\u043d\u0435 \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0436\u0430\u043b\u043a\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043d\u0430 10 \u043c\u0438\u043d\u0443\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043a\u0440\u0430\u0442\u043a\u0438\u043c \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435\u043c \u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0441\u0440\u0430\u0437\u0443 \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e:<\/p>\n<ul>\n<li>\n<p><a href=\"#%D0%B8%D0%B4%D0%B5%D1%8F\" rel=\"noopener noreferrer nofollow\">\u0418\u0434\u0435\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80\" rel=\"noopener noreferrer nofollow\">\u0421\u0435\u0440\u0432\u0435\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#%D1%82%D0%B5%D1%81%D1%82%20%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80%D0%B0\" rel=\"noopener noreferrer nofollow\">\u0422\u0435\u0441\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/a> (Fast API)<\/p>\n<\/li>\n<li>\n<p><a href=\"#%D0%BA%D0%BB%D0%B8%D0%B5%D0%BD%D1%82\" rel=\"noopener noreferrer nofollow\">\u041a\u043b\u0438\u0435\u043d\u0442<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#%D1%82%D0%B5%D1%81%D1%82%D1%8B\" rel=\"noopener noreferrer nofollow\">\u0422\u0435\u0441\u0442\u044b<\/a><\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p><a class=\"anchor\" name=\"%D0%B8%D0%B4%D0%B5%D1%8F\" id=\"\u0438\u0434\u0435\u044f\"><\/a><\/p>\n<p>\u041c\u044b \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0447\u0442\u043e \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0436\u0435 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0432 \u0443\u0437\u043a\u043e\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0432\u0430\u0448\u0438\u043c \u0432\u0432\u043e\u0434\u043e\u043c \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u0438\u0448\u0443 \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u0438 \u043c\u043e\u0433\u0443 \u043d\u0430\u0436\u0430\u0442\u044c \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0435\u0433\u043e \u0437\u0430 \u043c\u0435\u043d\u044f.<\/p>\n<p>\u0417\u0430\u0431\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430\u044f \u0438\u0434\u0435\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043a \u0442\u0451\u043c\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0448\u043b\u043e\u043c\u0443 GPT \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432\u0432\u0438\u0434\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u0432\u0432\u043e\u0434\u0430 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c, \u044f \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u043e\u043d\u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u0437\u0430\u0431\u044b\u0442\u044c)<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0434\u0435\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0443\u0441\u043f\u0435\u043b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043a\u0430 \u0434\u0443\u043c\u0430\u043b \u043d\u0430\u0434 \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u044d\u0442\u043e:<\/p>\n<ol>\n<li>\n<p>\u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u0430\u043a \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0438\u043b\u0438 <em>\u043f\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430<\/em>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u043e\u0442 wifi, \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 <strong>VScode<\/strong>, \u0430\u0434\u0440\u0435\u0441\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0438 \u0442.\u0434.<br \/>\u0418 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <em>\u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c<\/em> \u0432 \u043d\u0438\u0445 \u0442\u0435\u043a\u0441\u0442, <em>\u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c<\/em> (<strong>ctrl+x<\/strong>), <em>\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/em> (<strong>ctrl+c<\/strong>) \u0438 <em>\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c<\/em> (<strong>ctrl+v<\/strong>). \u041f\u043e\u043a\u0430 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0432\u0440\u043e\u0434\u0435 <strong>Windows CMD<\/strong>, \u0433\u0434\u0435 \u044d\u0442\u0438 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u041e \u043c\u043e\u0436\u0435\u0442 \u044d\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0432\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b. \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0441 \u043a\u043b\u0435\u0439\u043c\u043e\u043c \u043f\u0438\u0442\u043e\u043d\u0438\u0441\u0442\u0430, \u0442\u043e \u0432\u0430\u0448\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0436\u0438\u0437\u043d\u0438 \u0431\u0443\u0434\u0443\u0442: <a href=\"https:\/\/pyautogui.readthedocs.io\/en\/latest\/\" rel=\"noopener noreferrer nofollow\">PyAutoGui <\/a>\u0438 <a href=\"https:\/\/pypi.org\/project\/PyDirectInput\/\" rel=\"noopener noreferrer nofollow\">PyDirectInput<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0430\u0437\u043c\u044b\u0448\u043b\u044f\u044f \u043d\u0430 \u044d\u0442\u0438\u043c, \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0431\u043e\u0440\u043e\u0434\u0430\u0442\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043a\u0430\u043a <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Punto_Switcher\" rel=\"noopener noreferrer nofollow\">PuntoSwitcher<\/a> \u0438 <a href=\"https:\/\/caramba-switcher.com\/\" rel=\"noopener noreferrer nofollow\">Caramba<\/a>. \u0415\u0441\u043b\u0438 \u0432\u044b \u043e \u043d\u0438\u0445 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438, \u0442\u043e \u0432\u043e\u0442 \u0438\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b: <\/p>\n<ol>\n<li>\n<p>\u0427\u0438\u0442\u0430\u0435\u043c \u0432\u0435\u0441\u044c \u043f\u043e\u0442\u043e\u043a \u0432\u0432\u043e\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u0438\u043c \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c, \u0441\u0432\u0435\u0440\u044f\u044f \u0435\u0433\u043e \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438 \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0430\u0431\u0440\u0430\u043a\u0430\u0434\u0430\u0431\u0440\u0443 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u043e\u0439 (<em>\u043f\u0440\u0438\u0432\u0435\u0442<\/em>=<em>ghbdtn<\/em>), \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u0443.<\/p>\n<ol>\n<li>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0435\u0435 \u0441\u0430\u043c\u0438 \u0438 \u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043c\u0443\u0441\u043e\u0440, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u044e\u0437\u0435\u0440\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u041f\u0438\u0448\u0435\u043c, \u043d\u043e \u0443\u0436\u0435 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0434\u0432\u0430 \u043f\u0443\u043d\u043a\u0442\u0430 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0434\u043b\u044f \u043e\u0442\u0432\u043b\u0435\u0447\u0451\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0435\u0441\u043b\u0438 \u043e\u043d \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432 \u0441\u043b\u0435\u043f\u0443\u044e \u043f\u0435\u0447\u0430\u0442\u044c)<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0442\u043e \u0436\u0435 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u0443\u0436\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044f\u043c\u0438.<\/p>\n<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 \u0442\u0435\u043c\u0443 (\u0441\u043c. <a href=\"https:\/\/habr.com\/ru\/articles\/751972\/\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0430\u043b\u044c\u043d\u043e \u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 (\u043b\u0435\u0442\u043e) RuGPT3.5: \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u043e\u0432\u0435\u043b\u043b\u044b \u043d\u0430 \u0445\u043e\u0434\u0443 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c\u044e<\/a>) \u043c\u043e\u0433\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044f \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043d\u0451\u0441\u0441\u044f \u043a\u043e \u0432\u0441\u0435\u043c\u0443 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0443 \u043b\u0430\u043c, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u041f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u043e \u043f\u0438\u0448\u0435\u0442 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c primyerno tak \u043c\u043d\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b\u0430 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043a\u0435\u0439\u0441\u0435.<\/p>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/LLaMA\" rel=\"noopener noreferrer nofollow\"><strong>LLama<\/strong> <\/a>\u0432\u044b\u0434\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043f\u0440\u0435\u0442\u0440\u0435\u0439\u043d \u0432\u0441\u0435\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0441 \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 GPU \u043b\u044e\u0431\u043e\u0433\u043e \u0446\u0435\u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0418 \u0440\u0430\u0437 \u0443\u0436 \u0440\u0435\u0447\u044c \u043f\u043e\u0448\u043b\u0430 \u043f\u0440\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0441 \u043d\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n<h3>Cheat sheet \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 GPT, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 <\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p>Model<\/p>\n<\/th>\n<th>\n<p>Original size<\/p>\n<\/th>\n<th>\n<p>Quantized size<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">7B<\/p>\n<\/td>\n<td>\n<p align=\"left\">13 GB<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.9 GB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">13B<\/p>\n<\/td>\n<td>\n<p align=\"left\">24 GB<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.8 GB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">30B<\/p>\n<\/td>\n<td>\n<p align=\"left\">60 GB<\/p>\n<\/td>\n<td>\n<p>19.5 GB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">65B<\/p>\n<\/td>\n<td>\n<p align=\"left\">120 GB<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.5 GB<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u043a\u043e\u043b-\u0432\u043e \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u043e\u0432 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u043d\u0430 2, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430 \u0433\u0438\u0433\u043e\u0432<\/p>\n<\/blockquote>\n<p><em>\u0412\u044b\u0431\u043e\u0440 \u0441\u043e\u0440\u0442\u0430 \u043a\u043e\u0444\u0435 \u043b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u0435\u043d, \u043d\u043e \u0440\u0430\u0437 \u0443\u0436 \u044f \u043f\u0440\u0438\u0432\u044b\u043a \u043a 50\/50 \u0430\u0440\u0430\u0431\u0438\u043a\u0435 \u0438 \u0440\u043e\u0431\u0443\u0441\u0442\u0435<\/em>, \u0430 \u0432 \u043c\u043e\u0435\u0439 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435 \u043c\u0435\u043d\u0435\u0435 15 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442 \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0435. \u0412\u044b, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u043e\u043b\u044c\u043d\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438.<br \/>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0437 \u043c\u043e\u0435\u0439 \u0441\u0435\u0440\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0443\u0436\u0435 13B \u0432\u0435\u0440\u0441\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0430\u043c\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0440\u0430\u0441\u0441\u043b\u0430\u0431\u043b\u044f\u0435\u043c\u0441\u044f. \u0422\u0430\u043c \u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043b\u043e\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0432 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u0445.<\/p>\n<p><a class=\"anchor\" name=\"%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80\" id=\"\u0441\u0435\u0440\u0432\u0435\u0440\"><\/a><\/p>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a \u043c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<pre><code class=\"python\">from transformers import AutoTokenizer, AutoModelForCausalLM import torch  model_id = \"codellama\/CodeLlama-7b-Python-hf\"  tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(     model_id,     use_safetensors=True,     low_cpu_mem_usage=True,     device_map=\"auto\", )<\/code><\/pre>\n<p><strong>13<\/strong> \u0433\u0438\u0433\u043e\u0432 VRAM <strong>\u0438\u0437<\/strong> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 <strong>15<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b &#8212; \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0443\u043b\u043e\u0436\u0438\u043b\u0438\u0441\u044c? \u041d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c&#8230;<br \/>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0430 \u043e\u043d\u0430 \u0440\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u041d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0451 \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u043d\u043e \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e <strong>load_in_4bit <\/strong>\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0442\u043d\u043e\u0441\u0442\u044c\u044e &#8212; <em>\u0434\u043b\u044f PoC \u0441\u043e\u0439\u0434\u0451\u0442<\/em>.<\/p>\n<pre><code class=\"python\">from transformers import BitsAndBytesConfig from transformers import AutoTokenizer, AutoModelForCausalLM import torch  model_id = \"codellama\/CodeLlama-7b-Python-hf\" quantization_config = BitsAndBytesConfig(    load_in_4bit=True,    bnb_4bit_compute_dtype=torch.float16 )  tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(     model_id,     quantization_config=quantization_config,     use_safetensors=True,     low_cpu_mem_usage=True,     device_map=\"auto\", )<\/code><\/pre>\n<p>\u0411\u043b\u0430\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 Llama \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0438\u0441\u044c \u043e \u043d\u0430\u0441, \u0438 \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u0441 \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043b\u0441\u044f \u043f\u0430\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0445 \u0434\u043e \u043a\u043e\u0441\u0442\u0435\u0439 \u043c\u0443\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043e\u0442 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0432 \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a (\u0434\u0430, \u044f \u043a\u0430\u0437\u0443\u0430\u043b)<\/p>\n<pre><code class=\"python\">def txt2txt(text,**kwargs):   inputs = tokenizer(text, return_tensors=\"pt\").to(\"cuda\")   output = model.generate(       inputs[\"input_ids\"],       **kwargs   )   output = output[0].to(\"cpu\")   return tokenizer.decode(output)<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043c\u043d\u0435 \u0440\u0435\u0437\u043a\u043e \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0445\u043e\u0441\u0442 \u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e) \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430(\u043e\u0432) \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. <em>\u041f\u043e\u043a\u0430 \u043a\u043e\u0444\u0435\u0432\u0430\u0440\u043a\u0430 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043d\u0435 \u043f\u0430\u0440 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0444\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u043e\u0434\u044b (\u0432\u0435\u0434\u044c \u044f \u0437\u0430\u0431\u044b\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u043a\u0430\u043f\u0443\u0447\u0438\u043d\u0430\u0442\u043e\u0440\u0430)<\/em>, \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043d\u0430 <a href=\"https:\/\/fastapi.tiangolo.com\/\" rel=\"noopener noreferrer nofollow\">FastAPI<\/a>.<\/p>\n<pre><code class=\"python\">from fastapi import FastAPI  app = FastAPI() @app.get(\"\/\") def read_root():     return {\"I am\": \"alive\"}  from pydantic import BaseModel  class Item(BaseModel):     prompt: str     add: int     temperature: float  @app.post(\"\/\") def root(data: Item):     return {\"return\": txt2txt(data.prompt,max_new_tokens=data.add,do_sample=True,top_p=0.9,temperature=data.temperature)}<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/POST_(HTTP)\" rel=\"noopener noreferrer nofollow\">POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/a> \u0441 \u043f\u0440\u043e\u043c\u043f\u0442\u043e\u043c, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c temperature.<\/p>\n<p>\u0421\u0443\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430, <em>\u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0432\u0430\u0440\u0438\u0442\u044c \u043d\u0430\u0448\u0435 \u044d\u0441\u043f\u0440\u0435\u0441\u0441\u043e<\/em>. \u0417\u0430\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0448\u0435\u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b\u0438\u043a <strong>server.py<\/strong> \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e \u0442\u0430\u043a\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c:<\/p>\n<pre><code class=\"python\">#with open(\"server.py\",\"w\") as s: s.write(text) from pycloudflared import try_cloudflare try_cloudflare(port=8000) try_cloudflare.terminate(port=8000) try_cloudflare(port=8000) !uvicorn server:app --reload<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>Try cloud&#8230;\u0447\u0442\u043e?<\/summary>\n<div class=\"spoiler__content\">\n<p><a href=\"https:\/\/github.com\/Bing-su\/pycloudflared\" rel=\"noopener noreferrer nofollow\">PyCloudFlared<\/a> &#8212; python \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 \u043e\u0442 <strong>cloudflare<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 HTTP \u0442\u0443\u043d\u043d\u0435\u043b\u044c, \u043a\u0430\u043a <a href=\"https:\/\/ngrok.com\/\" rel=\"noopener noreferrer nofollow\"><strong>NGROK<\/strong><\/a>, \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 api.<br \/>\u041a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u0435 \u0442\u043e\u043d\u043d\u0435\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 URL \u0432\u0438\u0434\u0430:<br \/><a href=\"https:\/\/drivers-earlier-mistress-seq.trycloudflare.com\/\" rel=\"noopener noreferrer nofollow\">https:\/\/X-X-X-X.trycloudflare.com\/<\/a><br \/>\u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0436\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u0442\u043e\u043d\u043d\u0435\u043b\u044c \u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0432\u044b\u0434\u0430\u0451\u0442 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 URL, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043d\u0435\u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439.<br \/>\u0412\u0435\u0434\u044c \u0442\u043e\u043d\u043d\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0443\u0436\u0435 \u043b\u0435\u0447\u044c, \u043e\u0434\u043d\u0430\u043a\u043e URL \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f, \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u0441\u0440\u0430\u0437\u0443 \u0434\u0435\u043b\u0430\u044e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0442\u043e\u043d\u043d\u0435\u043b\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u043d\u043e\u0432\u044b\u0439, \u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 URL<\/p>\n<\/div>\n<\/details>\n<p>\u0412\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0432\u0430\u043d\u0438\u043b\u044c\u043d\u043e\u043c python, \u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044f \u0435\u0433\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0432 <a href=\"https:\/\/colab.research.google.com\/\" rel=\"noopener noreferrer nofollow\">google colab<\/a>. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0432\u0435\u0440\u044c\u043a\u0430 (\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043e\u0431\u043e\u0437\u0432\u0430\u043b \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c) \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e (\u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u0443\u0447\u0448\u0435 GPU), \u0442\u0430\u043a \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e (\u043d\u0430 \u0442\u043e\u0439 \u0436\u0435, \u0447\u0442\u043e \u0438 \u043a\u043b\u0438\u0435\u043d\u0442). \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, <strong>Tesla T4<\/strong> \u0432 \u043a\u043e\u043b\u0430\u0431\u0435 \u043b\u0443\u0447\u0448\u0435 \u043c\u043e\u0435\u0439 <strong>Rx 580<\/strong>, \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435 \u0431\u0440\u0430\u0442\u044c \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u0440\u043e\u0432\u0430\u0432\u044b\u0435 \u0440\u0438\u0442\u0443\u0430\u043b\u044b \u0436\u0435\u0440\u0442\u0432\u043e\u043f\u0440\u0438\u043d\u043e\u0448\u0435\u043d\u0438\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 ML \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 gpu \u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u0432\u0435\u043d\u0434\u043e\u0440\u0430.<br \/>\u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <strong>requirements<\/strong> \u043f\u043e\u0441\u0442 \u0444\u0430\u043a\u0442\u0443\u043c<\/p>\n<pre><code class=\"python\">!pip install transformers==4.32.1 !pip install fastapi==0.103.0 !pip install bitsandbytes==0.41.1 !pip install accelerate==0.22.0 !pip install \"uvicorn[standard]\" !pip install pycloudflared==0.2.0<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 ipython<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">!pip install transformers==4.32.1 !pip install fastapi==0.103.0 !pip install bitsandbytes==0.41.1 !pip install accelerate==0.22.0 !pip install \"uvicorn[standard]\" !pip install pycloudflared==0.2.0  api=\"\"\" from transformers import BitsAndBytesConfig from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig import torch  model_id = \"codellama\/CodeLlama-7b-Python-hf\" quantization_config = BitsAndBytesConfig(    load_in_4bit=True,    bnb_4bit_compute_dtype=torch.float16 )  tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(     model_id,     quantization_config=quantization_config,     use_safetensors=True,     low_cpu_mem_usage=True,     device_map=\"auto\", )   def txt2txt(text,**kwargs):   inputs = tokenizer(text, return_tensors=\"pt\").to(\"cuda\")   output = model.generate(       inputs[\"input_ids\"],       **kwargs   )   output = output[0].to(\"cpu\")   return tokenizer.decode(output)   from fastapi import FastAPI  app = FastAPI() @app.get(\"\/\") def read_root():     return {\"I am\": \"alive\"}  from pydantic import BaseModel  class Item(BaseModel):     prompt: str     add: int     temperature: float  @app.post(\"\/\") def root(data: Item):     return {\"return\": txt2txt(data.prompt,max_new_tokens=data.add,do_sample=True,top_p=0.9,temperature=data.temperature)} \"\"\" with open(\"server.py\",\"w\") as s: s.write(api) from pycloudflared import try_cloudflare try_cloudflare(port=8000) try_cloudflare.terminate(port=8000) try_cloudflare(port=8000) !uvicorn server:app --reload <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"%D1%82%D0%B5%D1%81%D1%82%20%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80%D0%B0\" id=\"\u0442\u0435\u0441\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\"><\/a><\/p>\n<h3>\u0422\u0435\u0441\u0442\u0438\u043c<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a71\/e8c\/d7d\/a71e8cd7d9704ef8b5e0081ced0ab169.png\" width=\"748\" height=\"154\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a71\/e8c\/d7d\/a71e8cd7d9704ef8b5e0081ced0ab169.png\"\/><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c json \u043e\u0442\u0432\u0435\u0442 <strong>{&#171;I am&#187;:&#187;alive&#187;}. <\/strong><\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/204\/f01\/ff4\/204f01ff44f73d678e9fa55b4ab44090.png\" width=\"157\" height=\"25\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/204\/f01\/ff4\/204f01ff44f73d678e9fa55b4ab44090.png\"\/><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <strong>\/docs <\/strong>\u043a url \u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 webui<\/p>\n<p>\u041c\u043e\u0436\u0435\u043c \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0431\u0435\u043a\u044d\u043d\u0434 \u0431\u0435\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/016\/352\/c4d\/016352c4d72976be9dbc345e13803d76.png\" width=\"1147\" height=\"461\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/016\/352\/c4d\/016352c4d72976be9dbc345e13803d76.png\"\/><\/figure>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f71\/1fd\/32f\/f711fd32f3060c50808d9bff58c404a3.png\" width=\"319\" height=\"231\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f71\/1fd\/32f\/f711fd32f3060c50808d9bff58c404a3.png\"\/><\/figure>\n<p>\u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u043c\u043f\u0442<br \/><strong>prompt<\/strong> = 12345<\/p>\n<p>\u041e\u0442\u0432\u0435\u0442:<br \/><strong>return<\/strong> = 123456789012345<\/p>\n<p>\u0412\u0440\u043e\u0434\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&#8230;<\/p>\n<p><a class=\"anchor\" name=\"%D0%BA%D0%BB%D0%B8%D0%B5%D0%BD%D1%82\" id=\"\u043a\u043b\u0438\u0435\u043d\u0442\"><\/a><\/p>\n<h3>\u041a\u043b\u0438\u0435\u043d\u0442<\/h3>\n<p>\u041d\u0443, \u0442\u0443\u0442 \u0432\u0441\u0451 \u043a\u0430\u043a \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0449\u0435. <em>\u041f\u043e\u0434\u043e\u0433\u0440\u0435\u0432\u0430\u0435\u043c \u043c\u043e\u043b\u043e\u043a\u043e \u043f\u0430\u0440\u043e\u043c, \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044f \u0435\u0433\u043e \u0432 \u043f\u0435\u043d\u043a\u0443<\/em>, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0442 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438\u0445, \u0431\u0443\u0434\u0442\u043e \u0431\u044b GPT \u043f\u0440\u044f\u043c\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439.<\/p>\n<pre><code class=\"python\">import urllib.parse import requests import json import pyautogui as gui import clipboard import time  server='https:\/\/donations-tunes-institutions-fed.trycloudflare.com\/' # \u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430  # \u0418\u043b\u0438 127.0.0.1 \u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0447\u0442\u043e \u0438 \u043a\u043b\u0438\u0435\u043d\u0442  def generate(text):     url = server     myobj = {'prompt': text,\"add\":10,\"temperature\":0.1}     x = requests.post(url, json = myobj)     print(x.text)     return json.loads(x.text)[\"return\"][4:] <\/code><\/pre>\n<h3>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0430\u0440\u0441\u0435\u0440<\/h3>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <strong>pyautogui<\/strong> \u0434\u043b\u044f \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0439. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <s>\u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u0438\u044f<\/s> \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043a \u043d\u0435\u043c\u0443.<\/p>\n<pre><code class=\"python\">def scan():     back = clipboard.paste()     gui.keyDown('shift')     gui.press('pgup')     gui.keyUp('shift')     gui.keyDown('ctrl')     gui.press('x')     gui.keyUp('ctrl')     gui.keyDown('ctrl')     gui.press('v')     gui.keyUp('ctrl')     pasted = clipboard.paste()     clipboard.copy(back)     return pasted<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0439 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442, \u0434\u0430. \u0412 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u043f\u043b\u0430\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p><strong>Shift<\/strong> + <strong>PageUP<\/strong> (\u0432\u044b\u0434\u0435\u043b\u0438\u0442 \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442)<\/p>\n<\/li>\n<li>\n<p><strong>Ctrl+X<\/strong>, <strong>Ctrl+V<\/strong> (\u0412\u044b\u0440\u0435\u0436\u0435\u0442 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u043a\u0430\u0440\u0435\u0442\u043a\u0430 \u0432\u0435\u0440\u043d\u0451\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u043e, \u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u0430\u0434\u0451\u0442)<\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0440\u0451\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u044b\u0439 \u0431\u0443\u0444\u0435\u0440, \u043a\u0430\u043a\u0438\u043c \u043e\u043d \u0431\u044b\u043b \u0434\u043e \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0444\u0430\u043d\u0430\u0442 \u043b\u0430\u0442\u0442\u0435. <em>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0444 \u0438\u043b\u0438 \u043a\u0430\u043f\u0443\u0447\u0438\u043d\u043e,<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0434\u0432\u0438\u0433\u0430 \u043d\u0430\u0437\u0430\u0434 \u043d\u0435 <strong>PageUP<\/strong>, \u0430 <strong>Home<\/strong> \u0438\u043b\u0438 \u0441\u043f\u0430\u043c <strong>RightArrow<\/strong>. \u042d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e \u0431\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438, \u0432\u0435\u0434\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u043f\u0440\u0430\u0432\u0443\u044e \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043a\u0443 \u0441\u0438\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0445 <strong>PageUP<\/strong>.<br \/>\u0412 \u0441\u0443\u0445\u043e\u043c \u043e\u0441\u0442\u0430\u0442\u043a\u0435: \u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u0445\u0432\u0430\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043d\u0430\u0436\u0430\u0442\u0438\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 scan \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0436\u0430\u0442\u043e \u043d\u0435\u043a\u043e\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448 (\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0441\u0442\u043e <strong>F7<\/strong>)<\/p>\n<pre><code class=\"python\">import keyboard while True:     time.sleep(0.01)     try:         if keyboard.is_pressed(\"f7\"):             pr=True         else:             pr=False     except:         pr=False     if pr:         old=scan().replace(\"\\r\",\"\")         print([old])         new=generate(old)         back = clipboard.paste()         clipboard.copy(new[len(old):])         gui.keyDown('ctrl')         gui.press('v')         gui.keyUp('ctrl')         clipboard.copy(back)         print(new[len(old):])<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 python<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\"> import urllib.parse import requests import json import pyautogui as gui import clipboard import time server='https:\/\/\u0441\u0441\u044b\u043b\u043a\u0443 \u0441\u044e\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0434\u043e, \u0434\u0430\/' # \u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430  # \u0418\u043b\u0438 127.0.0.1 \u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0447\u0442\u043e \u0438 \u043a\u043b\u0438\u0435\u043d\u0442  def generate(text):     url = server     myobj = {'prompt': text,\"add\":10,\"temperature\":0.1}     x = requests.post(url, json = myobj)     print(x.text)     return json.loads(x.text)[\"return\"][4:]  def scan():     back = clipboard.paste()     gui.keyDown('shift')     gui.press('pgup')     gui.keyUp('shift')     gui.keyDown('ctrl')     gui.press('x')     gui.keyUp('ctrl')     gui.keyDown('ctrl')     gui.press('v')     gui.keyUp('ctrl')     pasted = clipboard.paste()     clipboard.copy(back)     return pasted   import keyboard  # using module keyboard while True:  # making a loop     time.sleep(0.01)     try:  # used try so that if user pressed other than the given key error will not be shown         if keyboard.is_pressed(\"f7\"):             pr=True         else:             pr=False     except:         pr=False     if pr:  # if key 'q' is pressed          old=scan().replace(\"\\r\",\"\")         print([old])         new=generate(old)         back = clipboard.paste()         clipboard.copy(new[len(old):])         gui.keyDown('ctrl')         gui.press('v')         gui.keyUp('ctrl')         clipboard.copy(back)         print(new[len(old):])<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"%D1%82%D0%B5%D1%81%D1%82%D1%8B\" id=\"\u0442\u0435\u0441\u0442\u044b\"><\/a><\/p>\n<details class=\"spoiler\">\n<summary>\u0422\u0435\u0441\u0442\u044b \u0432 \u043f\u043e\u043b\u0435\u0432\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445<\/summary>\n<div class=\"spoiler__content\">\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0437<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/51c\/ec1\/77e\/51cec177ef78ad9d5161ff4dcc52c949.png\" width=\"658\" height=\"228\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/51c\/ec1\/77e\/51cec177ef78ad9d5161ff4dcc52c949.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/941\/40c\/ab5\/94140cab5abf0ff467b109b7ceb8d80f.png\" width=\"658\" height=\"232\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/941\/40c\/ab5\/94140cab5abf0ff467b109b7ceb8d80f.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ab6\/43c\/a7a\/ab643ca7ae8071c6369a4cd32e819456.png\" width=\"656\" height=\"235\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ab6\/43c\/a7a\/ab643ca7ae8071c6369a4cd32e819456.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0414\u0432\u0430<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/047\/529\/0ee\/0475290ee65a968341f4b75568d8d114.png\" width=\"659\" height=\"235\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/047\/529\/0ee\/0475290ee65a968341f4b75568d8d114.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a9e\/eb5\/abb\/a9eeb5abb4955716b3af2b4d7d10f5e5.png\" width=\"656\" height=\"236\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a9e\/eb5\/abb\/a9eeb5abb4955716b3af2b4d7d10f5e5.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0422\u0440\u0438<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/586\/cd3\/343\/586cd33435e4ad74f43735f5ecdcc658.png\" alt=\"\u044f \u0434\u043e\u043f\u0438\u0441\u0430\u043b in a cycle, \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e outdated \" title=\"\u044f \u0434\u043e\u043f\u0438\u0441\u0430\u043b in a cycle, \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e outdated \" width=\"654\" height=\"233\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/586\/cd3\/343\/586cd33435e4ad74f43735f5ecdcc658.png\"\/><\/p>\n<div><figcaption>\u044f \u0434\u043e\u043f\u0438\u0441\u0430\u043b in a cycle, \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e outdated <\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5c7\/aea\/d27\/5c7aead278db3171f954a018e63e6a09.png\" width=\"660\" height=\"272\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c7\/aea\/d27\/5c7aead278db3171f954a018e63e6a09.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<hr\/>\n<h2>Conclusion<\/h2>\n<p>\u041e\u0442\u043d\u044e\u0434\u044c, \u044f \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0432\u044b\u0436\u0438\u043c\u0430\u0442\u044c \u0438\u0437 \u0441\u0435\u0431\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u0438 \u043e\u0446\u0435\u043d\u043a\u0443 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0430\u043c\u043e\u0439 CodeLLama, \u043a\u0430\u043a \u044d\u0442\u043e \u0438 \u0431\u044b\u043b\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432\u043e <a href=\"#%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%BE\" rel=\"noopener noreferrer nofollow\">2 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0431\u0437\u0430\u0446\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430<\/a>.<br \/>\u0418 \u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u0442\u044c \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435. \u042f \u043d\u0435 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u044e\u0441\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0430\u043c\u043e\u0439 CodeLLama, \u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u044e\u0441\u044c, \u0447\u0442\u043e \u0443\u0432\u0438\u0436\u0443 \u0435\u0451 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 <em>\u0443\u0440\u0435\u0437\u0430\u043d\u043d\u0443\u044e Ultra lite<\/em> \u0432\u0435\u0440\u0441\u0438\u044e)<br \/>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0430\u043f\u043f\u043e\u0440\u0442, \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 TabNine \u0432 VSCode. \u0414\u0430\u0436\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0438 \u0438\u0445 \u0440\u0435\u043a\u043b\u0430\u043c\u0430 &#8212; \u044d\u0442\u043e \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0437\u043b\u043e.<br \/>\u0412\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u0434 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u0418 \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <em>\u0444\u0438\u0434\u0431\u0435\u043a \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445<\/em>.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0445\u043e\u0442\u044c \u043a\u0442\u043e-\u0442\u043e \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0434\u043e\u0448\u0451\u043b. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0431\u044b\u043b \u0442\u044b, \u0442\u043e \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0442\u0435\u0431\u0435, \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c, \u043e\u0441\u0438\u043b\u0438\u0432\u0448\u0438\u0439 \u044d\u0442\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/663\/413\/0ff\/6634130ffe854a4111bc6f62559e5483.png\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/663\/413\/0ff\/6634130ffe854a4111bc6f62559e5483.png\"\/><\/figure>\n<\/p>\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\/articles\/757224\/\"> https:\/\/habr.com\/ru\/articles\/757224\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p><a class=\"anchor\" name=\"%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%BE\" id=\"\u043d\u0430\u0447\u0430\u043b\u043e\">\u043b\u043e&#187;><\/a><\/p>\n<p>\u0421\u0442\u043e\u044e \u044f \u0437\u043d\u0430\u0447\u0438\u0442 \u0443\u0442\u0440\u043e\u043c (\u043e\u043a\u043e\u043b\u043e 2 \u0447\u0430\u0441\u043e\u0432 \u0434\u043d\u044f) \u0432\u043e\u0437\u043b\u0435 \u043a\u043e\u0444\u0435\u0432\u0430\u0440\u043a\u0438 \u0438 \u043b\u0438\u0441\u0442\u0430\u044e \u043b\u0435\u043d\u0442\u0443 \u0445\u0430\u0431\u0440\u0430, \u0430 \u0442\u0430\u043c <a href=\"https:\/\/habr.com\/ru\/news\/756798\/\" rel=\"noopener noreferrer nofollow\">CodeLama<\/a> \u0432\u044b\u0448\u043b\u0430. <a href=\"https:\/\/habr.com\/ru\/articles\/674658\/\" rel=\"noopener noreferrer nofollow\">Copilot<\/a> \u0434\u043b\u044f \u0431\u0435\u0434\u043d\u044b\u0445 \u044d\u0442\u043e \u0438\u043b\u0438 \u043f\u0430\u043d\u0430\u0446\u0435\u044f \u0432 \u043c\u0438\u0440\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439? \u041f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u0432\u0435\u0434\u044c \u0432\u0430\u0448\u0438 \u0441\u043e\u0441\u0435\u0434\u0438 \u0441\u043d\u0438\u0437\u0443 \u0443\u0442\u043e\u043d\u0443\u0442 \u0432 \u0432\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043b\u044c\u0451\u0442\u0441\u044f \u0438\u0437 \u044d\u043a\u0440\u0430\u043d\u0430.<br \/>\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 &#8212; \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0445 \u0438 \u0440\u0438\u0441\u043a. \u0421\u0442\u0430\u0442\u044c\u044f \u043f\u0438\u0441\u0430\u043b\u0430\u0441\u044c \u0441\u043f\u0438\u043d\u043d\u044b\u043c \u043c\u043e\u0437\u0433\u043e\u043c \u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0439 \u043d\u043e\u0447\u044c\u044e, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043d\u0430\u0442\u044f\u043d\u0443\u0442\u0443\u044e \u043d\u0430 \u0433\u043b\u043e\u0431\u0443\u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0442\u0435\u0445\u043d\u043e\u0442\u0435\u043a\u0441\u0442, \u0447\u0442\u043e \u0431\u044b \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u0439 \u0443 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f. \u041d\u0443 \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u0432\u0435\u0440\u043d\u043e? <\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0445\u043e\u0447\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u0433\u043e &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0430\u0439\u0434 \u043f\u043e \u043f\u0430\u0440\u0435 \u0443\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0437\u0430 \u043d\u0430\u0441 \u043b\u0438\u0431 \u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 mvp \u043a\u043e\u0434 (60+60 \u0441\u0442\u0440\u043e\u043a) \u043a\u0430\u043a \u0438\u0442\u043e\u0433.<\/p>\n<p>\u041a\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0447\u0438\u0442\u0430\u0442\u044c? &#8212; \u0422\u0435\u043c, \u043a\u0442\u043e \u043f\u0438\u0441\u0430\u043b \u043c\u043d\u0435 \u0432 \u0447\u0430\u0442 \u0445\u0430\u0431\u0440\u0430 \u0438 \u0442\u0435\u043b\u0435\u0433\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432\u0440\u043e\u0434\u0435 <em>&#171;\u0410 \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c?&#187;<\/em> \u0438\u043b\u0438 <em>&#171;\u041a\u0430\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u043b\u043e\u043a\u043d\u043e\u0442 \u043a\u043e\u043b\u0430\u0431\u0430?&#187;<\/em>. \u041c\u043d\u0435 \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0436\u0430\u043b\u043a\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043d\u0430 10 \u043c\u0438\u043d\u0443\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043a\u0440\u0430\u0442\u043a\u0438\u043c \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435\u043c \u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0441\u0440\u0430\u0437\u0443 \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e:<\/p>\n<ul>\n<li>\n<p><a href=\"#%D0%B8%D0%B4%D0%B5%D1%8F\" rel=\"noopener noreferrer nofollow\">\u0418\u0434\u0435\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80\" rel=\"noopener noreferrer nofollow\">\u0421\u0435\u0440\u0432\u0435\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#%D1%82%D0%B5%D1%81%D1%82%20%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80%D0%B0\" rel=\"noopener noreferrer nofollow\">\u0422\u0435\u0441\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/a> (Fast API)<\/p>\n<\/li>\n<li>\n<p><a href=\"#%D0%BA%D0%BB%D0%B8%D0%B5%D0%BD%D1%82\" rel=\"noopener noreferrer nofollow\">\u041a\u043b\u0438\u0435\u043d\u0442<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#%D1%82%D0%B5%D1%81%D1%82%D1%8B\" rel=\"noopener noreferrer nofollow\">\u0422\u0435\u0441\u0442\u044b<\/a><\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p><a class=\"anchor\" name=\"%D0%B8%D0%B4%D0%B5%D1%8F\" id=\"\u0438\u0434\u0435\u044f\">\u044f&#187;><\/a><\/p>\n<p>\u041c\u044b \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0447\u0442\u043e \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0436\u0435 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0432 \u0443\u0437\u043a\u043e\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0432\u0430\u0448\u0438\u043c \u0432\u0432\u043e\u0434\u043e\u043c \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u0438\u0448\u0443 \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u0438 \u043c\u043e\u0433\u0443 \u043d\u0430\u0436\u0430\u0442\u044c \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0435\u0433\u043e \u0437\u0430 \u043c\u0435\u043d\u044f.<\/p>\n<p>\u0417\u0430\u0431\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430\u044f \u0438\u0434\u0435\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043a \u0442\u0451\u043c\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0448\u043b\u043e\u043c\u0443 GPT \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432\u0432\u0438\u0434\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u0432\u0432\u043e\u0434\u0430 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c, \u044f \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u043e\u043d\u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u0437\u0430\u0431\u044b\u0442\u044c)<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0434\u0435\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0443\u0441\u043f\u0435\u043b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043a\u0430 \u0434\u0443\u043c\u0430\u043b \u043d\u0430\u0434 \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u044d\u0442\u043e:<\/p>\n<ol>\n<li>\n<p>\u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u0430\u043a \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0438\u043b\u0438 <em>\u043f\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430<\/em>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u043e\u0442 wifi, \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 <strong>VScode<\/strong>, \u0430\u0434\u0440\u0435\u0441\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0438 \u0442.\u0434.<br \/>\u0418 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <em>\u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c<\/em> \u0432 \u043d\u0438\u0445 \u0442\u0435\u043a\u0441\u0442, <em>\u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c<\/em> (<strong>ctrl+x<\/strong>), <em>\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/em> (<strong>ctrl+c<\/strong>) \u0438 <em>\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c<\/em> (<strong>ctrl+v<\/strong>). \u041f\u043e\u043a\u0430 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0432\u0440\u043e\u0434\u0435 <strong>Windows CMD<\/strong>, \u0433\u0434\u0435 \u044d\u0442\u0438 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u041e \u043c\u043e\u0436\u0435\u0442 \u044d\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0432\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b. \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0441 \u043a\u043b\u0435\u0439\u043c\u043e\u043c \u043f\u0438\u0442\u043e\u043d\u0438\u0441\u0442\u0430, \u0442\u043e \u0432\u0430\u0448\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0436\u0438\u0437\u043d\u0438 \u0431\u0443\u0434\u0443\u0442: <a href=\"https:\/\/pyautogui.readthedocs.io\/en\/latest\/\" rel=\"noopener noreferrer nofollow\">PyAutoGui <\/a>\u0438 <a href=\"https:\/\/pypi.org\/project\/PyDirectInput\/\" rel=\"noopener noreferrer nofollow\">PyDirectInput<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0430\u0437\u043c\u044b\u0448\u043b\u044f\u044f \u043d\u0430 \u044d\u0442\u0438\u043c, \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0431\u043e\u0440\u043e\u0434\u0430\u0442\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043a\u0430\u043a <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Punto_Switcher\" rel=\"noopener noreferrer nofollow\">PuntoSwitcher<\/a> \u0438 <a href=\"https:\/\/caramba-switcher.com\/\" rel=\"noopener noreferrer nofollow\">Caramba<\/a>. \u0415\u0441\u043b\u0438 \u0432\u044b \u043e \u043d\u0438\u0445 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438, \u0442\u043e \u0432\u043e\u0442 \u0438\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b: <\/p>\n<ol>\n<li>\n<p>\u0427\u0438\u0442\u0430\u0435\u043c \u0432\u0435\u0441\u044c \u043f\u043e\u0442\u043e\u043a \u0432\u0432\u043e\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u0438\u043c \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c, \u0441\u0432\u0435\u0440\u044f\u044f \u0435\u0433\u043e \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438 \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0430\u0431\u0440\u0430\u043a\u0430\u0434\u0430\u0431\u0440\u0443 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u043e\u0439 (<em>\u043f\u0440\u0438\u0432\u0435\u0442<\/em>=<em>ghbdtn<\/em>), \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u0443.<\/p>\n<ol>\n<li>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0435\u0435 \u0441\u0430\u043c\u0438 \u0438 \u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043c\u0443\u0441\u043e\u0440, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u044e\u0437\u0435\u0440\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u041f\u0438\u0448\u0435\u043c, \u043d\u043e \u0443\u0436\u0435 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0434\u0432\u0430 \u043f\u0443\u043d\u043a\u0442\u0430 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0434\u043b\u044f \u043e\u0442\u0432\u043b\u0435\u0447\u0451\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0435\u0441\u043b\u0438 \u043e\u043d \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432 \u0441\u043b\u0435\u043f\u0443\u044e \u043f\u0435\u0447\u0430\u0442\u044c)<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0442\u043e \u0436\u0435 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u0443\u0436\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044f\u043c\u0438.<\/p>\n<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 \u0442\u0435\u043c\u0443 (\u0441\u043c. <a href=\"https:\/\/habr.com\/ru\/articles\/751972\/\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0430\u043b\u044c\u043d\u043e \u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 (\u043b\u0435\u0442\u043e) RuGPT3.5: \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u043e\u0432\u0435\u043b\u043b\u044b \u043d\u0430 \u0445\u043e\u0434\u0443 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c\u044e<\/a>) \u043c\u043e\u0433\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044f \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043d\u0451\u0441\u0441\u044f \u043a\u043e \u0432\u0441\u0435\u043c\u0443 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0443 \u043b\u0430\u043c, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u041f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u043e \u043f\u0438\u0448\u0435\u0442 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c primyerno tak \u043c\u043d\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b\u0430 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043a\u0435\u0439\u0441\u0435.<\/p>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/LLaMA\" rel=\"noopener noreferrer nofollow\"><strong>LLama<\/strong> <\/a>\u0432\u044b\u0434\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043f\u0440\u0435\u0442\u0440\u0435\u0439\u043d \u0432\u0441\u0435\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0441 \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 GPU \u043b\u044e\u0431\u043e\u0433\u043e \u0446\u0435\u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0418 \u0440\u0430\u0437 \u0443\u0436 \u0440\u0435\u0447\u044c \u043f\u043e\u0448\u043b\u0430 \u043f\u0440\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0441 \u043d\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n<h3>Cheat sheet \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 GPT, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 <\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p>Model<\/p>\n<\/th>\n<th>\n<p>Original size<\/p>\n<\/th>\n<th>\n<p>Quantized size<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">7B<\/p>\n<\/td>\n<td>\n<p align=\"left\">13 GB<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.9 GB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">13B<\/p>\n<\/td>\n<td>\n<p align=\"left\">24 GB<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.8 GB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">30B<\/p>\n<\/td>\n<td>\n<p align=\"left\">60 GB<\/p>\n<\/td>\n<td>\n<p>19.5 GB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">65B<\/p>\n<\/td>\n<td>\n<p align=\"left\">120 GB<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.5 GB<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u043a\u043e\u043b-\u0432\u043e \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u043e\u0432 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u043d\u0430 2, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430 \u0433\u0438\u0433\u043e\u0432<\/p>\n<\/blockquote>\n<p><em>\u0412\u044b\u0431\u043e\u0440 \u0441\u043e\u0440\u0442\u0430 \u043a\u043e\u0444\u0435 \u043b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u0435\u043d, \u043d\u043e \u0440\u0430\u0437 \u0443\u0436 \u044f \u043f\u0440\u0438\u0432\u044b\u043a \u043a 50\/50 \u0430\u0440\u0430\u0431\u0438\u043a\u0435 \u0438 \u0440\u043e\u0431\u0443\u0441\u0442\u0435<\/em>, \u0430 \u0432 \u043c\u043e\u0435\u0439 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435 \u043c\u0435\u043d\u0435\u0435 15 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442 \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0435. \u0412\u044b, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u043e\u043b\u044c\u043d\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438.<br \/>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0437 \u043c\u043e\u0435\u0439 \u0441\u0435\u0440\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0443\u0436\u0435 13B \u0432\u0435\u0440\u0441\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0430\u043c\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0440\u0430\u0441\u0441\u043b\u0430\u0431\u043b\u044f\u0435\u043c\u0441\u044f. \u0422\u0430\u043c \u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043b\u043e\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0432 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u0445.<\/p>\n<p><a class=\"anchor\" name=\"%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80\" id=\"\u0441\u0435\u0440\u0432\u0435\u0440\">\u0435\u0440&#187;><\/a><\/p>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a \u043c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<pre><code class=\"python\">from transformers import AutoTokenizer, AutoModelForCausalLM import torch  model_id = \"codellama\/CodeLlama-7b-Python-hf\"  tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(     model_id,     use_safetensors=True,     low_cpu_mem_usage=True,     device_map=\"auto\", )<\/code><\/pre>\n<p><strong>13<\/strong> \u0433\u0438\u0433\u043e\u0432 VRAM <strong>\u0438\u0437<\/strong> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 <strong>15<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b &#8212; \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0443\u043b\u043e\u0436\u0438\u043b\u0438\u0441\u044c? \u041d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c&#8230;<br \/>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0430 \u043e\u043d\u0430 \u0440\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u041d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0451 \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u043d\u043e \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e <strong>load_in_4bit <\/strong>\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0442\u043d\u043e\u0441\u0442\u044c\u044e &#8212; <em>\u0434\u043b\u044f PoC \u0441\u043e\u0439\u0434\u0451\u0442<\/em>.<\/p>\n<pre><code class=\"python\">from transformers import BitsAndBytesConfig from transformers import AutoTokenizer, AutoModelForCausalLM import torch  model_id = \"codellama\/CodeLlama-7b-Python-hf\" quantization_config = BitsAndBytesConfig(    load_in_4bit=True,    bnb_4bit_compute_dtype=torch.float16 )  tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(     model_id,     quantization_config=quantization_config,     use_safetensors=True,     low_cpu_mem_usage=True,     device_map=\"auto\", )<\/code><\/pre>\n<p>\u0411\u043b\u0430\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 Llama \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0438\u0441\u044c \u043e \u043d\u0430\u0441, \u0438 \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u0441 \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043b\u0441\u044f \u043f\u0430\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0445 \u0434\u043e \u043a\u043e\u0441\u0442\u0435\u0439 \u043c\u0443\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043e\u0442 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0432 \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a (\u0434\u0430, \u044f \u043a\u0430\u0437\u0443\u0430\u043b)<\/p>\n<pre><code class=\"python\">def txt2txt(text,**kwargs):   inputs = tokenizer(text, return_tensors=\"pt\").to(\"cuda\")   output = model.generate(       inputs[\"input_ids\"],       **kwargs   )   output = output[0].to(\"cpu\")   return tokenizer.decode(output)<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043c\u043d\u0435 \u0440\u0435\u0437\u043a\u043e \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0445\u043e\u0441\u0442 \u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e) \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430(\u043e\u0432) \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. <em>\u041f\u043e\u043a\u0430 \u043a\u043e\u0444\u0435\u0432\u0430\u0440\u043a\u0430 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043d\u0435 \u043f\u0430\u0440 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0444\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u043e\u0434\u044b (\u0432\u0435\u0434\u044c \u044f \u0437\u0430\u0431\u044b\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u043a\u0430\u043f\u0443\u0447\u0438\u043d\u0430\u0442\u043e\u0440\u0430)<\/em>, \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043d\u0430 <a href=\"https:\/\/fastapi.tiangolo.com\/\" rel=\"noopener noreferrer nofollow\">FastAPI<\/a>.<\/p>\n<pre><code class=\"python\">from fastapi import FastAPI  app = FastAPI() @app.get(\"\/\") def read_root():     return {\"I am\": \"alive\"}  from pydantic import BaseModel  class Item(BaseModel):     prompt: str     add: int     temperature: float  @app.post(\"\/\") def root(data: Item):     return {\"return\": txt2txt(data.prompt,max_new_tokens=data.add,do_sample=True,top_p=0.9,temperature=data.temperature)}<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/POST_(HTTP)\" rel=\"noopener noreferrer nofollow\">POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/a> \u0441 \u043f\u0440\u043e\u043c\u043f\u0442\u043e\u043c, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c temperature.<\/p>\n<p>\u0421\u0443\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430, <em>\u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0432\u0430\u0440\u0438\u0442\u044c \u043d\u0430\u0448\u0435 \u044d\u0441\u043f\u0440\u0435\u0441\u0441\u043e<\/em>. \u0417\u0430\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0448\u0435\u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b\u0438\u043a <strong>server.py<\/strong> \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e \u0442\u0430\u043a\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c:<\/p>\n<pre><code class=\"python\">#with open(\"server.py\",\"w\") as s: s.write(text) from pycloudflared import try_cloudflare try_cloudflare(port=8000) try_cloudflare.terminate(port=8000) try_cloudflare(port=8000) !uvicorn server:app --reload<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>Try cloud&#8230;\u0447\u0442\u043e?<\/summary>\n<div class=\"spoiler__content\">\n<p><a href=\"https:\/\/github.com\/Bing-su\/pycloudflared\" rel=\"noopener noreferrer nofollow\">PyCloudFlared<\/a> &#8212; python \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 \u043e\u0442 <strong>cloudflare<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 HTTP \u0442\u0443\u043d\u043d\u0435\u043b\u044c, \u043a\u0430\u043a <a href=\"https:\/\/ngrok.com\/\" rel=\"noopener noreferrer nofollow\"><strong>NGROK<\/strong><\/a>, \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 api.<br \/>\u041a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u0435 \u0442\u043e\u043d\u043d\u0435\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 URL \u0432\u0438\u0434\u0430:<br \/><a href=\"https:\/\/drivers-earlier-mistress-seq.trycloudflare.com\/\" rel=\"noopener noreferrer nofollow\">https:\/\/X-X-X-X.trycloudflare.com\/<\/a><br \/>\u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0436\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u0442\u043e\u043d\u043d\u0435\u043b\u044c \u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0432\u044b\u0434\u0430\u0451\u0442 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 URL, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043d\u0435\u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439.<br \/>\u0412\u0435\u0434\u044c \u0442\u043e\u043d\u043d\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0443\u0436\u0435 \u043b\u0435\u0447\u044c, \u043e\u0434\u043d\u0430\u043a\u043e URL \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f, \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u0441\u0440\u0430\u0437\u0443 \u0434\u0435\u043b\u0430\u044e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0442\u043e\u043d\u043d\u0435\u043b\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u043d\u043e\u0432\u044b\u0439, \u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 URL<\/p>\n<\/div>\n<\/details>\n<p>\u0412\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0432\u0430\u043d\u0438\u043b\u044c\u043d\u043e\u043c python, \u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044f \u0435\u0433\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0432 <a href=\"https:\/\/colab.research.google.com\/\" rel=\"noopener noreferrer nofollow\">google colab<\/a>. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0432\u0435\u0440\u044c\u043a\u0430 (\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043e\u0431\u043e\u0437\u0432\u0430\u043b \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c) \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e (\u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u0443\u0447\u0448\u0435 GPU), \u0442\u0430\u043a \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e (\u043d\u0430 \u0442\u043e\u0439 \u0436\u0435, \u0447\u0442\u043e \u0438 \u043a\u043b\u0438\u0435\u043d\u0442). \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, <strong>Tesla T4<\/strong> \u0432 \u043a\u043e\u043b\u0430\u0431\u0435 \u043b\u0443\u0447\u0448\u0435 \u043c\u043e\u0435\u0439 <strong>Rx 580<\/strong>, \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435 \u0431\u0440\u0430\u0442\u044c \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u0440\u043e\u0432\u0430\u0432\u044b\u0435 \u0440\u0438\u0442\u0443\u0430\u043b\u044b \u0436\u0435\u0440\u0442\u0432\u043e\u043f\u0440\u0438\u043d\u043e\u0448\u0435\u043d\u0438\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 ML \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 gpu \u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u0432\u0435\u043d\u0434\u043e\u0440\u0430.<br \/>\u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <strong>requirements<\/strong> \u043f\u043e\u0441\u0442 \u0444\u0430\u043a\u0442\u0443\u043c<\/p>\n<pre><code class=\"python\">!pip install transformers==4.32.1 !pip install fastapi==0.103.0 !pip install bitsandbytes==0.41.1 !pip install accelerate==0.22.0 !pip install \"uvicorn[standard]\" !pip install pycloudflared==0.2.0<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 ipython<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">!pip install transformers==4.32.1 !pip install fastapi==0.103.0 !pip install bitsandbytes==0.41.1 !pip install accelerate==0.22.0 !pip install \"uvicorn[standard]\" !pip install pycloudflared==0.2.0  api=\"\"\" from transformers import BitsAndBytesConfig from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig import torch  model_id = \"codellama\/CodeLlama-7b-Python-hf\" quantization_config = BitsAndBytesConfig(    load_in_4bit=True,    bnb_4bit_compute_dtype=torch.float16 )  tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(     model_id,     quantization_config=quantization_config,     use_safetensors=True,     low_cpu_mem_usage=True,     device_map=\"auto\", )   def txt2txt(text,**kwargs):   inputs = tokenizer(text, return_tensors=\"pt\").to(\"cuda\")   output = model.generate(       inputs[\"input_ids\"],       **kwargs   )   output = output[0].to(\"cpu\")   return tokenizer.decode(output)   from fastapi import FastAPI  app = FastAPI() @app.get(\"\/\") def read_root():     return {\"I am\": \"alive\"}  from pydantic import BaseModel  class Item(BaseModel):     prompt: str     add: int     temperature: float  @app.post(\"\/\") def root(data: Item):     return {\"return\": txt2txt(data.prompt,max_new_tokens=data.add,do_sample=True,top_p=0.9,temperature=data.temperature)} \"\"\" with open(\"server.py\",\"w\") as s: s.write(api) from pycloudflared import try_cloudflare try_cloudflare(port=8000) try_cloudflare.terminate(port=8000) try_cloudflare(port=8000) !uvicorn server:app --reload <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"%D1%82%D0%B5%D1%81%D1%82%20%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80%D0%B0\" id=\"\u0442\u0435\u0441\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\">\u0440\u0432\u0435\u0440\u0430&#187;<\/a><\/p>\n<h3>\u0422\u0435\u0441\u0442\u0438\u043c<\/h3>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-353305","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353305","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=353305"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353305\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}