import{S as jp,i as gp,s as wp,e as _,t as l,k as m,w as y,c,a as f,h as n,d as e,m as u,x as v,g as p,G as t,y as q,q as b,o as j,B as E,b as S,l as On,M as yp,N as or,p as ia,v as vp,n as _a}from"../../chunks/vendor-hf-doc-builder.js";import{T as ca}from"../../chunks/Tip-hf-doc-builder.js";import{Y as ir}from"../../chunks/Youtube-hf-doc-builder.js";import{I as qp}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as D}from"../../chunks/CodeBlock-hf-doc-builder.js";import{C as kp}from"../../chunks/CourseFloatingBanner-hf-doc-builder.js";import{F as Ep}from"../../chunks/FrameworkSwitchCourse-hf-doc-builder.js";function xp(M){let r,d;return r=new kp({props:{chapter:7,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/ja/chapter7/section6_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/ja/chapter7/section6_tf.ipynb"}]}}),{c(){y(r.$$.fragment)},l(o){v(r.$$.fragment,o)},m(o,h){q(r,o,h),d=!0},i(o){d||(b(r.$$.fragment,o),d=!0)},o(o){j(r.$$.fragment,o),d=!1},d(o){E(r,o)}}}function zp(M){let r,d;return r=new kp({props:{chapter:7,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/ja/chapter7/section6_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/ja/chapter7/section6_pt.ipynb"}]}}),{c(){y(r.$$.fragment)},l(o){v(r.$$.fragment,o)},m(o,h){q(r,o,h),d=!0},i(o){d||(b(r.$$.fragment,o),d=!0)},o(o){j(r.$$.fragment,o),d=!1},d(o){E(r,o)}}}function Pp(M){let r,d;return{c(){r=_("p"),d=l("\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u30D7\u30EA\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u306B\u306F\u3057\u3070\u3089\u304F\u6642\u9593\u304C\u304B\u304B\u308A\u307E\u3059\u3002\u307E\u305A\u3001\u4E0A\u8A18\u306E2\u3064\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u95A2\u3059\u308B\u90E8\u5206\u3092\u4E00\u65E6\u30B3\u30E1\u30F3\u30C8\u5316\u3057\u3001\u30B5\u30F3\u30D7\u30EB\u30C7\u30FC\u30BF\u306B\u5BFE\u3057\u3066\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u5B9F\u884C\u3057\u3001\u5B66\u7FD2\u304C\u4E00\u901A\u308A\u6B63\u5E38\u306B\u7D42\u4E86\u3057\u3066\u30E2\u30C7\u30EB\u304C\u4FDD\u5B58\u3055\u308C\u305F\u3053\u3068\u3092\u78BA\u8A8D\u3059\u308B\u3053\u3068\u3092\u304A\u52E7\u3081\u3057\u307E\u3059\u3002\u30D5\u30A9\u30EB\u30C0\u3092\u4F5C\u308A\u5FD8\u308C\u305F\u308A\u3001\u5B66\u7FD2\u30EB\u30FC\u30D7\u306E\u6700\u5F8C\u306B\u30BF\u30A4\u30D7\u30DF\u30B9\u304C\u3042\u3063\u305F\u308A\u3057\u3066\u3001\u6700\u5F8C\u306E\u30B9\u30C6\u30C3\u30D7\u3067\u5B66\u7FD2\u304C\u5931\u6557\u3057\u3066\u3057\u307E\u3046\u3053\u3068\u307B\u3069\u6094\u3057\u3044\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093\uFF01")},l(o){r=c(o,"P",{});var h=f(r);d=n(h,"\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u30D7\u30EA\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u306B\u306F\u3057\u3070\u3089\u304F\u6642\u9593\u304C\u304B\u304B\u308A\u307E\u3059\u3002\u307E\u305A\u3001\u4E0A\u8A18\u306E2\u3064\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u95A2\u3059\u308B\u90E8\u5206\u3092\u4E00\u65E6\u30B3\u30E1\u30F3\u30C8\u5316\u3057\u3001\u30B5\u30F3\u30D7\u30EB\u30C7\u30FC\u30BF\u306B\u5BFE\u3057\u3066\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u5B9F\u884C\u3057\u3001\u5B66\u7FD2\u304C\u4E00\u901A\u308A\u6B63\u5E38\u306B\u7D42\u4E86\u3057\u3066\u30E2\u30C7\u30EB\u304C\u4FDD\u5B58\u3055\u308C\u305F\u3053\u3068\u3092\u78BA\u8A8D\u3059\u308B\u3053\u3068\u3092\u304A\u52E7\u3081\u3057\u307E\u3059\u3002\u30D5\u30A9\u30EB\u30C0\u3092\u4F5C\u308A\u5FD8\u308C\u305F\u308A\u3001\u5B66\u7FD2\u30EB\u30FC\u30D7\u306E\u6700\u5F8C\u306B\u30BF\u30A4\u30D7\u30DF\u30B9\u304C\u3042\u3063\u305F\u308A\u3057\u3066\u3001\u6700\u5F8C\u306E\u30B9\u30C6\u30C3\u30D7\u3067\u5B66\u7FD2\u304C\u5931\u6557\u3057\u3066\u3057\u307E\u3046\u3053\u3068\u307B\u3069\u6094\u3057\u3044\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093\uFF01"),h.forEach(e)},m(o,h){p(o,r,h),t(r,d)},d(o){o&&e(r)}}}function Tp(M){let r,d,o,h,x,g,P,T,w,C,A,L,$,G,I,W;return{c(){r=_("p"),d=l("\u270F\uFE0F "),o=_("strong"),h=l("\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),x=m(),g=_("p"),P=l("\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u3088\u308A\u5C0F\u3055\u3044\u65AD\u7247\u3092\u5168\u3066\u53D6\u308A\u9664\u304F\u3053\u3068\u306F\u3001\u4ECA\u56DE\u306F\u5C0F\u3055\u306A\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u4F7F\u3063\u3066\u3044\u308B\u306E\u3067\u5927\u304D\u306A\u554F\u984C\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u3092\u5927\u304D\u304F\u3059\u308B\u3068\uFF08\u3042\u308B\u3044\u306F\u77ED\u3044\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B3\u30FC\u30D1\u30B9\u304C\u3042\u308B\u5834\u5408\uFF09\u3001\u6368\u3066\u3089\u308C\u308B\u65AD\u7247\u306E\u5272\u5408\u3082\u5927\u304D\u304F\u306A\u308A\u307E\u3059\u3002\u3088\u308A\u52B9\u7387\u7684\u306A\u30C7\u30FC\u30BF\u306E\u6E96\u5099\u65B9\u6CD5\u3068\u3057\u3066\u306F\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3055\u308C\u305F\u30B5\u30F3\u30D7\u30EB\u3092 "),T=_("code"),w=l("eos_token_id"),C=l(" \u30C8\u30FC\u30AF\u30F3\u3092\u631F\u3093\u3067\u4E00\u62EC\u3067\u9023\u7D50\u3057\u3001\u9023\u7D50\u3057\u305F\u30C7\u30FC\u30BF\u306B\u5BFE\u3057\u3066\u65AD\u7247\u5206\u5272\u3092\u5B9F\u884C\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u7DF4\u7FD2\u3068\u3057\u3066\u3001\u305D\u306E\u65B9\u6CD5\u3092\u5229\u7528\u3059\u308B\u305F\u3081\u306B "),A=_("code"),L=l("tokenize()"),$=l(" \u95A2\u6570\u3092\u4FEE\u6B63\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C8\u30FC\u30AF\u30F3 ID \u306E\u5B8C\u5168\u306A\u30B7\u30FC\u30B1\u30F3\u30B9\u3092\u53D6\u5F97\u3059\u308B\u305F\u3081\u306B\u3001 "),G=_("code"),I=l("truncation=False"),W=l(" \u3092\u8A2D\u5B9A\u3057\u3001\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u306E\u4ED6\u306E\u5F15\u6570\u3092\u524A\u9664\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002")},l(F){r=c(F,"P",{});var R=f(r);d=n(R,"\u270F\uFE0F "),o=c(R,"STRONG",{});var X=f(o);h=n(X,"\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),X.forEach(e),R.forEach(e),x=u(F),g=c(F,"P",{});var z=f(g);P=n(z,"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u3088\u308A\u5C0F\u3055\u3044\u65AD\u7247\u3092\u5168\u3066\u53D6\u308A\u9664\u304F\u3053\u3068\u306F\u3001\u4ECA\u56DE\u306F\u5C0F\u3055\u306A\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u4F7F\u3063\u3066\u3044\u308B\u306E\u3067\u5927\u304D\u306A\u554F\u984C\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u3092\u5927\u304D\u304F\u3059\u308B\u3068\uFF08\u3042\u308B\u3044\u306F\u77ED\u3044\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B3\u30FC\u30D1\u30B9\u304C\u3042\u308B\u5834\u5408\uFF09\u3001\u6368\u3066\u3089\u308C\u308B\u65AD\u7247\u306E\u5272\u5408\u3082\u5927\u304D\u304F\u306A\u308A\u307E\u3059\u3002\u3088\u308A\u52B9\u7387\u7684\u306A\u30C7\u30FC\u30BF\u306E\u6E96\u5099\u65B9\u6CD5\u3068\u3057\u3066\u306F\u3001\u30C8\u30FC\u30AF\u30F3\u5316\u3055\u308C\u305F\u30B5\u30F3\u30D7\u30EB\u3092 "),T=c(z,"CODE",{});var N=f(T);w=n(N,"eos_token_id"),N.forEach(e),C=n(z," \u30C8\u30FC\u30AF\u30F3\u3092\u631F\u3093\u3067\u4E00\u62EC\u3067\u9023\u7D50\u3057\u3001\u9023\u7D50\u3057\u305F\u30C7\u30FC\u30BF\u306B\u5BFE\u3057\u3066\u65AD\u7247\u5206\u5272\u3092\u5B9F\u884C\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u7DF4\u7FD2\u3068\u3057\u3066\u3001\u305D\u306E\u65B9\u6CD5\u3092\u5229\u7528\u3059\u308B\u305F\u3081\u306B "),A=c(z,"CODE",{});var H=f(A);L=n(H,"tokenize()"),H.forEach(e),$=n(z," \u95A2\u6570\u3092\u4FEE\u6B63\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C8\u30FC\u30AF\u30F3 ID \u306E\u5B8C\u5168\u306A\u30B7\u30FC\u30B1\u30F3\u30B9\u3092\u53D6\u5F97\u3059\u308B\u305F\u3081\u306B\u3001 "),G=c(z,"CODE",{});var K=f(G);I=n(K,"truncation=False"),K.forEach(e),W=n(z," \u3092\u8A2D\u5B9A\u3057\u3001\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u306E\u4ED6\u306E\u5F15\u6570\u3092\u524A\u9664\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),z.forEach(e)},m(F,R){p(F,r,R),t(r,d),t(r,o),t(o,h),p(F,x,R),p(F,g,R),t(g,P),t(g,T),t(T,w),t(g,C),t(g,A),t(A,L),t(g,$),t(g,G),t(G,I),t(g,W)},d(F){F&&e(r),F&&e(x),F&&e(g)}}}function Dp(M){let r,d,o,h,x,g,P,T,w,C,A,L;return r=new D({props:{code:`from transformers import AutoTokenizer, TFGPT2LMHeadModel, AutoConfig

config = AutoConfig.from_pretrained(
    "gpt2",
    vocab_size=len(tokenizer),
    n_ctx=context_length,
    bos_token_id=tokenizer.bos_token_id,
    eos_token_id=tokenizer.eos_token_id,
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFGPT2LMHeadModel, AutoConfig

config = AutoConfig.from_pretrained(
    <span class="hljs-string">&quot;gpt2&quot;</span>,
    vocab_size=<span class="hljs-built_in">len</span>(tokenizer),
    n_ctx=context_length,
    bos_token_id=tokenizer.bos_token_id,
    eos_token_id=tokenizer.eos_token_id,
)`}}),w=new D({props:{code:`model = TFGPT2LMHeadModel(config)
model(model.dummy_inputs)  # Builds the model
model.summary()`,highlighted:`model = TFGPT2LMHeadModel(config)
model(model.dummy_inputs)  <span class="hljs-comment"># Builds the model</span>
model.summary()`}}),A=new D({props:{code:`_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
transformer (TFGPT2MainLayer multiple                  124242432 
=================================================================
Total params: 124,242,432
Trainable params: 124,242,432
Non-trainable params: 0
_________________________________________________________________`,highlighted:`_________________________________________________________________
Layer (<span class="hljs-built_in">type</span>)                 Output Shape              Param <span class="hljs-comment">#   </span>
=================================================================
transformer (TFGPT2MainLayer multiple                  <span class="hljs-number">124242432</span> 
=================================================================
Total params: <span class="hljs-number">124</span>,<span class="hljs-number">242</span>,<span class="hljs-number">432</span>
Trainable params: <span class="hljs-number">124</span>,<span class="hljs-number">242</span>,<span class="hljs-number">432</span>
Non-trainable params: <span class="hljs-number">0</span>
_________________________________________________________________`}}),{c(){y(r.$$.fragment),d=m(),o=_("p"),h=l("\u3053\u306E\u69CB\u6210\u3067\u3001\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306F "),x=_("code"),g=l("from_pretrained()"),P=l(" \u95A2\u6570\u3092\u4F7F\u308F\u306A\u3044\u6700\u521D\u306E\u4F8B\u3067\u3042\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u306A\u305C\u306A\u3089\u3001\u5B9F\u969B\u306B\u306F\u81EA\u5206\u81EA\u8EAB\u3067\u30E2\u30C7\u30EB\u3092\u521D\u671F\u5316\u3057\u3066\u3044\u308B\u304B\u3089\u3067\u3059\u3002"),T=m(),y(w.$$.fragment),C=m(),y(A.$$.fragment)},l($){v(r.$$.fragment,$),d=u($),o=c($,"P",{});var G=f(o);h=n(G,"\u3053\u306E\u69CB\u6210\u3067\u3001\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306F "),x=c(G,"CODE",{});var I=f(x);g=n(I,"from_pretrained()"),I.forEach(e),P=n(G," \u95A2\u6570\u3092\u4F7F\u308F\u306A\u3044\u6700\u521D\u306E\u4F8B\u3067\u3042\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u306A\u305C\u306A\u3089\u3001\u5B9F\u969B\u306B\u306F\u81EA\u5206\u81EA\u8EAB\u3067\u30E2\u30C7\u30EB\u3092\u521D\u671F\u5316\u3057\u3066\u3044\u308B\u304B\u3089\u3067\u3059\u3002"),G.forEach(e),T=u($),v(w.$$.fragment,$),C=u($),v(A.$$.fragment,$)},m($,G){q(r,$,G),p($,d,G),p($,o,G),t(o,h),t(o,x),t(x,g),t(o,P),p($,T,G),q(w,$,G),p($,C,G),q(A,$,G),L=!0},i($){L||(b(r.$$.fragment,$),b(w.$$.fragment,$),b(A.$$.fragment,$),L=!0)},o($){j(r.$$.fragment,$),j(w.$$.fragment,$),j(A.$$.fragment,$),L=!1},d($){E(r,$),$&&e(d),$&&e(o),$&&e(T),E(w,$),$&&e(C),E(A,$)}}}function Cp(M){let r,d,o,h,x,g,P,T,w,C,A,L;return r=new D({props:{code:`from transformers import AutoTokenizer, GPT2LMHeadModel, AutoConfig

config = AutoConfig.from_pretrained(
    "gpt2",
    vocab_size=len(tokenizer),
    n_ctx=context_length,
    bos_token_id=tokenizer.bos_token_id,
    eos_token_id=tokenizer.eos_token_id,
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPT2LMHeadModel, AutoConfig

config = AutoConfig.from_pretrained(
    <span class="hljs-string">&quot;gpt2&quot;</span>,
    vocab_size=<span class="hljs-built_in">len</span>(tokenizer),
    n_ctx=context_length,
    bos_token_id=tokenizer.bos_token_id,
    eos_token_id=tokenizer.eos_token_id,
)`}}),w=new D({props:{code:`model = GPT2LMHeadModel(config)
model_size = sum(t.numel() for t in model.parameters())
print(f"GPT-2 size: {model_size/1000**2:.1f}M parameters")`,highlighted:`model = GPT2LMHeadModel(config)
model_size = <span class="hljs-built_in">sum</span>(t.numel() <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> model.parameters())
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;GPT-2 size: <span class="hljs-subst">{model_size/<span class="hljs-number">1000</span>**<span class="hljs-number">2</span>:<span class="hljs-number">.1</span>f}</span>M parameters&quot;</span>)`}}),A=new D({props:{code:"GPT-2 size: 124.2M parameters",highlighted:'GPT-<span class="hljs-number">2</span> size: <span class="hljs-number">124.2</span>M parameters'}}),{c(){y(r.$$.fragment),d=m(),o=_("p"),h=l("\u3053\u306E\u69CB\u6210\u3067\u3001\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306F "),x=_("code"),g=l("from_pretrained()"),P=l(" \u95A2\u6570\u3092\u4F7F\u308F\u306A\u3044\u6700\u521D\u306E\u4F8B\u3067\u3042\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u306A\u305C\u306A\u3089\u3001\u5B9F\u969B\u306B\u306F\u81EA\u5206\u81EA\u8EAB\u3067\u30E2\u30C7\u30EB\u3092\u521D\u671F\u5316\u3057\u3066\u3044\u308B\u304B\u3089\u3067\u3059\u3002"),T=m(),y(w.$$.fragment),C=m(),y(A.$$.fragment)},l($){v(r.$$.fragment,$),d=u($),o=c($,"P",{});var G=f(o);h=n(G,"\u3053\u306E\u69CB\u6210\u3067\u3001\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306F "),x=c(G,"CODE",{});var I=f(x);g=n(I,"from_pretrained()"),I.forEach(e),P=n(G," \u95A2\u6570\u3092\u4F7F\u308F\u306A\u3044\u6700\u521D\u306E\u4F8B\u3067\u3042\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u306A\u305C\u306A\u3089\u3001\u5B9F\u969B\u306B\u306F\u81EA\u5206\u81EA\u8EAB\u3067\u30E2\u30C7\u30EB\u3092\u521D\u671F\u5316\u3057\u3066\u3044\u308B\u304B\u3089\u3067\u3059\u3002"),G.forEach(e),T=u($),v(w.$$.fragment,$),C=u($),v(A.$$.fragment,$)},m($,G){q(r,$,G),p($,d,G),p($,o,G),t(o,h),t(o,x),t(x,g),t(o,P),p($,T,G),q(w,$,G),p($,C,G),q(A,$,G),L=!0},i($){L||(b(r.$$.fragment,$),b(w.$$.fragment,$),b(A.$$.fragment,$),L=!0)},o($){j(r.$$.fragment,$),j(w.$$.fragment,$),j(A.$$.fragment,$),L=!1},d($){E(r,$),$&&e(d),$&&e(o),$&&e(T),E(w,$),$&&e(C),E(A,$)}}}function Op(M){let r,d;return r=new D({props:{code:`from transformers import DataCollatorForLanguageModeling

tokenizer.pad_token = tokenizer.eos_token
data_collator = DataCollatorForLanguageModeling(tokenizer, mlm=False, return_tensors="tf")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForLanguageModeling

tokenizer.pad_token = tokenizer.eos_token
data_collator = DataCollatorForLanguageModeling(tokenizer, mlm=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`}}),{c(){y(r.$$.fragment)},l(o){v(r.$$.fragment,o)},m(o,h){q(r,o,h),d=!0},i(o){d||(b(r.$$.fragment,o),d=!0)},o(o){j(r.$$.fragment,o),d=!1},d(o){E(r,o)}}}function Ap(M){let r,d;return r=new D({props:{code:`from transformers import DataCollatorForLanguageModeling

tokenizer.pad_token = tokenizer.eos_token
data_collator = DataCollatorForLanguageModeling(tokenizer, mlm=False)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForLanguageModeling

tokenizer.pad_token = tokenizer.eos_token
data_collator = DataCollatorForLanguageModeling(tokenizer, mlm=<span class="hljs-literal">False</span>)`}}),{c(){y(r.$$.fragment)},l(o){v(r.$$.fragment,o)},m(o,h){q(r,o,h),d=!0},i(o){d||(b(r.$$.fragment,o),d=!0)},o(o){j(r.$$.fragment,o),d=!1},d(o){E(r,o)}}}function Mp(M){let r,d;return r=new D({props:{code:`input_ids shape: (5, 128)
attention_mask shape: (5, 128)
labels shape: (5, 128)`,highlighted:`input_ids shape: (<span class="hljs-number">5</span>, <span class="hljs-number">128</span>)
attention_mask shape: (<span class="hljs-number">5</span>, <span class="hljs-number">128</span>)
labels shape: (<span class="hljs-number">5</span>, <span class="hljs-number">128</span>)`}}),{c(){y(r.$$.fragment)},l(o){v(r.$$.fragment,o)},m(o,h){q(r,o,h),d=!0},i(o){d||(b(r.$$.fragment,o),d=!0)},o(o){j(r.$$.fragment,o),d=!1},d(o){E(r,o)}}}function Gp(M){let r,d;return r=new D({props:{code:`input_ids shape: torch.Size([5, 128])
attention_mask shape: torch.Size([5, 128])
labels shape: torch.Size([5, 128])`,highlighted:`input_ids shape: torch.Size([<span class="hljs-number">5</span>, <span class="hljs-number">128</span>])
attention_mask shape: torch.Size([<span class="hljs-number">5</span>, <span class="hljs-number">128</span>])
labels shape: torch.Size([<span class="hljs-number">5</span>, <span class="hljs-number">128</span>])`}}),{c(){y(r.$$.fragment)},l(o){v(r.$$.fragment,o)},m(o,h){q(r,o,h),d=!0},i(o){d||(b(r.$$.fragment,o),d=!0)},o(o){j(r.$$.fragment,o),d=!1},d(o){E(r,o)}}}function $p(M){let r,d,o,h,x,g,P,T;return P=new D({props:{code:`tf_train_dataset = tokenized_dataset["train"].to_tf_dataset(
    columns=["input_ids", "attention_mask", "labels"],
    collate_fn=data_collator,
    shuffle=True,
    batch_size=32,
)
tf_eval_dataset = tokenized_dataset["valid"].to_tf_dataset(
    columns=["input_ids", "attention_mask", "labels"],
    collate_fn=data_collator,
    shuffle=False,
    batch_size=32,
)`,highlighted:`tf_train_dataset = tokenized_dataset[<span class="hljs-string">&quot;train&quot;</span>].to_tf_dataset(
    columns=[<span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>],
    collate_fn=data_collator,
    shuffle=<span class="hljs-literal">True</span>,
    batch_size=<span class="hljs-number">32</span>,
)
tf_eval_dataset = tokenized_dataset[<span class="hljs-string">&quot;valid&quot;</span>].to_tf_dataset(
    columns=[<span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>],
    collate_fn=data_collator,
    shuffle=<span class="hljs-literal">False</span>,
    batch_size=<span class="hljs-number">32</span>,
)`}}),{c(){r=_("p"),d=l("\u3042\u3068\u306F "),o=_("code"),h=l("to_tf_dataset()"),x=l(" \u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u3063\u3066\u3001\u4E0A\u3067\u4F5C\u6210\u3057\u305F\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3067\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092TensorFlow\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u5909\u63DB\u3059\u308C\u3070\u3088\u3044\u3067\u3057\u3087\u3046\u3002"),g=m(),y(P.$$.fragment)},l(w){r=c(w,"P",{});var C=f(r);d=n(C,"\u3042\u3068\u306F "),o=c(C,"CODE",{});var A=f(o);h=n(A,"to_tf_dataset()"),A.forEach(e),x=n(C," \u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u3063\u3066\u3001\u4E0A\u3067\u4F5C\u6210\u3057\u305F\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3067\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092TensorFlow\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u5909\u63DB\u3059\u308C\u3070\u3088\u3044\u3067\u3057\u3087\u3046\u3002"),C.forEach(e),g=u(w),v(P.$$.fragment,w)},m(w,C){p(w,r,C),t(r,d),t(r,o),t(o,h),t(r,x),p(w,g,C),q(P,w,C),T=!0},i(w){T||(b(P.$$.fragment,w),T=!0)},o(w){j(P.$$.fragment,w),T=!1},d(w){w&&e(r),w&&e(g),E(P,w)}}}function Fp(M){let r,d;return{c(){r=_("p"),d=l("\u26A0\uFE0F \u5165\u529B\u3068\u30E9\u30D9\u30EB\u306E\u4F4D\u7F6E\u3092\u305A\u3089\u3059\u306E\u306F\u30E2\u30C7\u30EB\u5185\u90E8\u3067\u884C\u308F\u308C\u308B\u306E\u3067\u3001\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u306F\u5165\u529B\u3092\u30B3\u30D4\u30FC\u3057\u3066\u30E9\u30D9\u30EB\u3092\u4F5C\u6210\u3059\u308B\u3060\u3051\u3067\u3059\u3002")},l(o){r=c(o,"P",{});var h=f(r);d=n(h,"\u26A0\uFE0F \u5165\u529B\u3068\u30E9\u30D9\u30EB\u306E\u4F4D\u7F6E\u3092\u305A\u3089\u3059\u306E\u306F\u30E2\u30C7\u30EB\u5185\u90E8\u3067\u884C\u308F\u308C\u308B\u306E\u3067\u3001\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u306F\u5165\u529B\u3092\u30B3\u30D4\u30FC\u3057\u3066\u30E9\u30D9\u30EB\u3092\u4F5C\u6210\u3059\u308B\u3060\u3051\u3067\u3059\u3002"),h.forEach(e)},m(o,h){p(o,r,h),t(r,d)},d(o){o&&e(r)}}}function Lp(M){let r,d,o,h,x,g,P,T,w,C,A,L,$,G,I,W,F,R,X;return C=new D({props:{code:`from transformers import create_optimizer
import tensorflow as tf

num_train_steps = len(tf_train_dataset)
optimizer, schedule = create_optimizer(
    init_lr=5e-5,
    num_warmup_steps=1_000,
    num_train_steps=num_train_steps,
    weight_decay_rate=0.01,
)
model.compile(optimizer=optimizer)

# Train in mixed-precision float16
tf.keras.mixed_precision.set_global_policy("mixed_float16")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer
<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

num_train_steps = <span class="hljs-built_in">len</span>(tf_train_dataset)
optimizer, schedule = create_optimizer(
    init_lr=<span class="hljs-number">5e-5</span>,
    num_warmup_steps=<span class="hljs-number">1_000</span>,
    num_train_steps=num_train_steps,
    weight_decay_rate=<span class="hljs-number">0.01</span>,
)
model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)

<span class="hljs-comment"># Train in mixed-precision float16</span>
tf.keras.mixed_precision.set_global_policy(<span class="hljs-string">&quot;mixed_float16&quot;</span>)`}}),R=new D({props:{code:`from transformers.keras_callbacks import PushToHubCallback

callback = PushToHubCallback(output_dir="codeparrot-ds", tokenizer=tokenizer)

model.fit(tf_train_dataset, validation_data=tf_eval_dataset, callbacks=[callback])`,highlighted:`<span class="hljs-keyword">from</span> transformers.keras_callbacks <span class="hljs-keyword">import</span> PushToHubCallback

callback = PushToHubCallback(output_dir=<span class="hljs-string">&quot;codeparrot-ds&quot;</span>, tokenizer=tokenizer)

model.fit(tf_train_dataset, validation_data=tf_eval_dataset, callbacks=[callback])`}}),{c(){r=_("p"),d=l("\u3042\u3068\u306F\u5B66\u7FD2\u7528\u30CF\u30A4\u30D1\u30FC\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u8A2D\u5B9A\u3057\u3001"),o=_("code"),h=l("compile()"),x=l("\u3068"),g=_("code"),P=l("fit()"),T=l("\u3092\u547C\u3073\u51FA\u3059\u3060\u3051\u3067\u3059\u3002\u3053\u3053\u3067\u306F\u3001\u5B66\u7FD2\u306E\u5B89\u5B9A\u6027\u3092\u5411\u4E0A\u3055\u305B\u308B\u305F\u3081\u306B\u3001\u30A6\u30A9\u30FC\u30E0\u30A2\u30C3\u30D7\u3092\u4F34\u3046\u5B66\u7FD2\u7387\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002"),w=m(),y(C.$$.fragment),A=m(),L=_("p"),$=l("\u3042\u3068\u306F "),G=_("code"),I=l("model.fit()"),W=l(" \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u5B66\u7FD2\u304C\u7D42\u4E86\u3059\u308B\u306E\u3092\u5F85\u3064\u3060\u3051\u3067\u3059\u3002\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u5168\u4F53\u304B\u305D\u306E\u4E00\u90E8\u5206\u3060\u3051\u304B\u306B\u3082\u3088\u308A\u307E\u3059\u304C\u3001\u305D\u308C\u305E\u308C20\u6642\u9593\u30012\u6642\u9593\u304B\u304B\u308A\u307E\u3059\u306E\u3067\u3001\u30B3\u30FC\u30D2\u30FC\u3067\u3082\u98F2\u307F\u306A\u304C\u3089\u304A\u597D\u304D\u306A\u672C\u3092\u8AAD\u3093\u3067\u3086\u3063\u304F\u308A\u5F85\u3061\u307E\u3057\u3087\u3046\u3002\u5B66\u7FD2\u304C\u5B8C\u4E86\u3057\u305F\u3089\u3001\u30E2\u30C7\u30EB\u3068\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u3092\u30CF\u30D6\u306B\u30D7\u30C3\u30B7\u30E5\u3057\u307E\u3059\u3002"),F=m(),y(R.$$.fragment)},l(z){r=c(z,"P",{});var N=f(r);d=n(N,"\u3042\u3068\u306F\u5B66\u7FD2\u7528\u30CF\u30A4\u30D1\u30FC\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u8A2D\u5B9A\u3057\u3001"),o=c(N,"CODE",{});var H=f(o);h=n(H,"compile()"),H.forEach(e),x=n(N,"\u3068"),g=c(N,"CODE",{});var K=f(g);P=n(K,"fit()"),K.forEach(e),T=n(N,"\u3092\u547C\u3073\u51FA\u3059\u3060\u3051\u3067\u3059\u3002\u3053\u3053\u3067\u306F\u3001\u5B66\u7FD2\u306E\u5B89\u5B9A\u6027\u3092\u5411\u4E0A\u3055\u305B\u308B\u305F\u3081\u306B\u3001\u30A6\u30A9\u30FC\u30E0\u30A2\u30C3\u30D7\u3092\u4F34\u3046\u5B66\u7FD2\u7387\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002"),N.forEach(e),w=u(z),v(C.$$.fragment,z),A=u(z),L=c(z,"P",{});var J=f(L);$=n(J,"\u3042\u3068\u306F "),G=c(J,"CODE",{});var V=f(G);I=n(V,"model.fit()"),V.forEach(e),W=n(J," \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u5B66\u7FD2\u304C\u7D42\u4E86\u3059\u308B\u306E\u3092\u5F85\u3064\u3060\u3051\u3067\u3059\u3002\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u5168\u4F53\u304B\u305D\u306E\u4E00\u90E8\u5206\u3060\u3051\u304B\u306B\u3082\u3088\u308A\u307E\u3059\u304C\u3001\u305D\u308C\u305E\u308C20\u6642\u9593\u30012\u6642\u9593\u304B\u304B\u308A\u307E\u3059\u306E\u3067\u3001\u30B3\u30FC\u30D2\u30FC\u3067\u3082\u98F2\u307F\u306A\u304C\u3089\u304A\u597D\u304D\u306A\u672C\u3092\u8AAD\u3093\u3067\u3086\u3063\u304F\u308A\u5F85\u3061\u307E\u3057\u3087\u3046\u3002\u5B66\u7FD2\u304C\u5B8C\u4E86\u3057\u305F\u3089\u3001\u30E2\u30C7\u30EB\u3068\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u3092\u30CF\u30D6\u306B\u30D7\u30C3\u30B7\u30E5\u3057\u307E\u3059\u3002"),J.forEach(e),F=u(z),v(R.$$.fragment,z)},m(z,N){p(z,r,N),t(r,d),t(r,o),t(o,h),t(r,x),t(r,g),t(g,P),t(r,T),p(z,w,N),q(C,z,N),p(z,A,N),p(z,L,N),t(L,$),t(L,G),t(G,I),t(L,W),p(z,F,N),q(R,z,N),X=!0},i(z){X||(b(C.$$.fragment,z),b(R.$$.fragment,z),X=!0)},o(z){j(C.$$.fragment,z),j(R.$$.fragment,z),X=!1},d(z){z&&e(r),z&&e(w),E(C,z),z&&e(A),z&&e(L),z&&e(F),E(R,z)}}}function Ip(M){let r,d,o,h,x,g,P,T,w,C,A,L,$,G,I,W,F,R,X,z,N,H,K,J,V,ts,_s;return $=new D({props:{code:`from transformers import Trainer, TrainingArguments

args = TrainingArguments(
    output_dir="codeparrot-ds",
    per_device_train_batch_size=32,
    per_device_eval_batch_size=32,
    evaluation_strategy="steps",
    eval_steps=5_000,
    logging_steps=5_000,
    gradient_accumulation_steps=8,
    num_train_epochs=1,
    weight_decay=0.1,
    warmup_steps=1_000,
    lr_scheduler_type="cosine",
    learning_rate=5e-4,
    save_steps=5_000,
    fp16=True,
    push_to_hub=True,
)

trainer = Trainer(
    model=model,
    tokenizer=tokenizer,
    args=args,
    data_collator=data_collator,
    train_dataset=tokenized_datasets["train"],
    eval_dataset=tokenized_datasets["valid"],
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Trainer, TrainingArguments

args = TrainingArguments(
    output_dir=<span class="hljs-string">&quot;codeparrot-ds&quot;</span>,
    per_device_train_batch_size=<span class="hljs-number">32</span>,
    per_device_eval_batch_size=<span class="hljs-number">32</span>,
    evaluation_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
    eval_steps=<span class="hljs-number">5_000</span>,
    logging_steps=<span class="hljs-number">5_000</span>,
    gradient_accumulation_steps=<span class="hljs-number">8</span>,
    num_train_epochs=<span class="hljs-number">1</span>,
    weight_decay=<span class="hljs-number">0.1</span>,
    warmup_steps=<span class="hljs-number">1_000</span>,
    lr_scheduler_type=<span class="hljs-string">&quot;cosine&quot;</span>,
    learning_rate=<span class="hljs-number">5e-4</span>,
    save_steps=<span class="hljs-number">5_000</span>,
    fp16=<span class="hljs-literal">True</span>,
    push_to_hub=<span class="hljs-literal">True</span>,
)

trainer = Trainer(
    model=model,
    tokenizer=tokenizer,
    args=args,
    data_collator=data_collator,
    train_dataset=tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>],
    eval_dataset=tokenized_datasets[<span class="hljs-string">&quot;valid&quot;</span>],
)`}}),N=new D({props:{code:"trainer.train()",highlighted:"trainer.train()"}}),ts=new D({props:{code:"trainer.push_to_hub()",highlighted:"trainer.push_to_hub()"}}),{c(){r=_("p"),d=l("\u3042\u3068\u306F\u5B66\u7FD2\u7528\u306E\u5F15\u6570\u3092\u8A2D\u5B9A\u3057\u3001"),o=_("code"),h=l("Trainer"),x=l(" \u3092\u8D77\u52D5\u3059\u308B\u3060\u3051\u3067\u3059\u3002\u3053\u3053\u3067\u306F\u3001\u3044\u304F\u3064\u304B\u306E\u30A6\u30A9\u30FC\u30E0\u30A2\u30C3\u30D7\u3092\u4F34\u3046 cosine \u5B66\u7FD2\u7387\u306E\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u3068\u3001256 \u306E\u6709\u52B9\u30D0\u30C3\u30C1\u30B5\u30A4\u30BA ("),g=_("code"),P=l("per_device_train_batch_size"),T=l(" * "),w=_("code"),C=l("gradient_accumulation_steps"),A=l(") \u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002\u52FE\u914D\u7D2F\u7A4D\u306F\u3001\u5358\u4E00\u306E\u30D0\u30C3\u30C1\u304C\u30E1\u30E2\u30EA\u306B\u53CE\u307E\u3089\u306A\u3044\u5834\u5408\u306B\u4F7F\u7528\u3055\u308C\u3001\u3044\u304F\u3064\u304B\u306E\u524D\u9032/\u5F8C\u9000\u30D1\u30B9\u3092\u901A\u3057\u3066\u52FE\u914D\u3092\u5897\u5206\u7684\u306B\u69CB\u7BC9\u3057\u307E\u3059\u3002\u3053\u308C\u306F\u3001\u{1F917} Accelerate\u3067\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u4F5C\u6210\u3059\u308B\u3068\u304D\u306B\u5B9F\u969B\u306B\u898B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),L=m(),y($.$$.fragment),G=m(),I=_("p"),W=l("\u3042\u3068\u306F "),F=_("code"),R=l("Trainer"),X=l(" \u3092\u8D77\u52D5\u3057\u3001\u5B66\u7FD2\u304C\u7D42\u4E86\u3059\u308B\u306E\u3092\u5F85\u3064\u3060\u3051\u3067\u3059\u3002\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u5168\u4F53\u304B\u305D\u306E\u4E00\u90E8\u5206\u3060\u3051\u304B\u306B\u3082\u3088\u308A\u307E\u3059\u304C\u3001\u305D\u308C\u305E\u308C20\u6642\u9593\u30012\u6642\u9593\u304B\u304B\u308A\u307E\u3059\u306E\u3067\u3001\u30B3\u30FC\u30D2\u30FC\u3067\u3082\u98F2\u3093\u3067\u304A\u597D\u304D\u306A\u672C\u3092\u3086\u3063\u304F\u308A\u8AAD\u3093\u3067\u304F\u3060\u3055\u3044\u3002"),z=m(),y(N.$$.fragment),H=m(),K=_("p"),J=l("\u5B66\u7FD2\u304C\u5B8C\u4E86\u3057\u305F\u3089\u3001\u30E2\u30C7\u30EB\u3068\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u3092Hub\u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),V=m(),y(ts.$$.fragment)},l(O){r=c(O,"P",{});var B=f(r);d=n(B,"\u3042\u3068\u306F\u5B66\u7FD2\u7528\u306E\u5F15\u6570\u3092\u8A2D\u5B9A\u3057\u3001"),o=c(B,"CODE",{});var Ce=f(o);h=n(Ce,"Trainer"),Ce.forEach(e),x=n(B," \u3092\u8D77\u52D5\u3059\u308B\u3060\u3051\u3067\u3059\u3002\u3053\u3053\u3067\u306F\u3001\u3044\u304F\u3064\u304B\u306E\u30A6\u30A9\u30FC\u30E0\u30A2\u30C3\u30D7\u3092\u4F34\u3046 cosine \u5B66\u7FD2\u7387\u306E\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u3068\u3001256 \u306E\u6709\u52B9\u30D0\u30C3\u30C1\u30B5\u30A4\u30BA ("),g=c(B,"CODE",{});var ds=f(g);P=n(ds,"per_device_train_batch_size"),ds.forEach(e),T=n(B," * "),w=c(B,"CODE",{});var Oe=f(w);C=n(Oe,"gradient_accumulation_steps"),Oe.forEach(e),A=n(B,") \u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002\u52FE\u914D\u7D2F\u7A4D\u306F\u3001\u5358\u4E00\u306E\u30D0\u30C3\u30C1\u304C\u30E1\u30E2\u30EA\u306B\u53CE\u307E\u3089\u306A\u3044\u5834\u5408\u306B\u4F7F\u7528\u3055\u308C\u3001\u3044\u304F\u3064\u304B\u306E\u524D\u9032/\u5F8C\u9000\u30D1\u30B9\u3092\u901A\u3057\u3066\u52FE\u914D\u3092\u5897\u5206\u7684\u306B\u69CB\u7BC9\u3057\u307E\u3059\u3002\u3053\u308C\u306F\u3001\u{1F917} Accelerate\u3067\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u4F5C\u6210\u3059\u308B\u3068\u304D\u306B\u5B9F\u969B\u306B\u898B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),B.forEach(e),L=u(O),v($.$$.fragment,O),G=u(O),I=c(O,"P",{});var Ts=f(I);W=n(Ts,"\u3042\u3068\u306F "),F=c(Ts,"CODE",{});var vs=f(F);R=n(vs,"Trainer"),vs.forEach(e),X=n(Ts," \u3092\u8D77\u52D5\u3057\u3001\u5B66\u7FD2\u304C\u7D42\u4E86\u3059\u308B\u306E\u3092\u5F85\u3064\u3060\u3051\u3067\u3059\u3002\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30BB\u30C3\u30C8\u5168\u4F53\u304B\u305D\u306E\u4E00\u90E8\u5206\u3060\u3051\u304B\u306B\u3082\u3088\u308A\u307E\u3059\u304C\u3001\u305D\u308C\u305E\u308C20\u6642\u9593\u30012\u6642\u9593\u304B\u304B\u308A\u307E\u3059\u306E\u3067\u3001\u30B3\u30FC\u30D2\u30FC\u3067\u3082\u98F2\u3093\u3067\u304A\u597D\u304D\u306A\u672C\u3092\u3086\u3063\u304F\u308A\u8AAD\u3093\u3067\u304F\u3060\u3055\u3044\u3002"),Ts.forEach(e),z=u(O),v(N.$$.fragment,O),H=u(O),K=c(O,"P",{});var hs=f(K);J=n(hs,"\u5B66\u7FD2\u304C\u5B8C\u4E86\u3057\u305F\u3089\u3001\u30E2\u30C7\u30EB\u3068\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u3092Hub\u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),hs.forEach(e),V=u(O),v(ts.$$.fragment,O)},m(O,B){p(O,r,B),t(r,d),t(r,o),t(o,h),t(r,x),t(r,g),t(g,P),t(r,T),t(r,w),t(w,C),t(r,A),p(O,L,B),q($,O,B),p(O,G,B),p(O,I,B),t(I,W),t(I,F),t(F,R),t(I,X),p(O,z,B),q(N,O,B),p(O,H,B),p(O,K,B),t(K,J),p(O,V,B),q(ts,O,B),_s=!0},i(O){_s||(b($.$$.fragment,O),b(N.$$.fragment,O),b(ts.$$.fragment,O),_s=!0)},o(O){j($.$$.fragment,O),j(N.$$.fragment,O),j(ts.$$.fragment,O),_s=!1},d(O){O&&e(r),O&&e(L),E($,O),O&&e(G),O&&e(I),O&&e(z),E(N,O),O&&e(H),O&&e(K),O&&e(V),E(ts,O)}}}function Np(M){let r,d,o,h,x,g,P,T;return{c(){r=_("p"),d=l("\u270F\uFE0F "),o=_("strong"),h=l("\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),x=l(" \u751F\u306E\u30C6\u30AD\u30B9\u30C8\u304B\u3089GPT-2\u306E\u5B66\u7FD2\u307E\u3067\u3001"),g=_("code"),P=l("TrainingArguments"),T=l("\u306B\u52A0\u3048\u3066\u3001\u7D0430\u884C\u306E\u30B3\u30FC\u30C9\u3092\u4F5C\u6210\u3059\u308B\u3060\u3051\u3067\u6E08\u307F\u307E\u3057\u305F\u3002\u3042\u306A\u305F\u81EA\u8EAB\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3067\u8A66\u3057\u3066\u307F\u3066\u3001\u826F\u3044\u7D50\u679C\u304C\u5F97\u3089\u308C\u308B\u304B\u3069\u3046\u304B\u78BA\u8A8D\u3057\u3066\u307F\u3066\u304F\u3060\u3055\u3044!")},l(w){r=c(w,"P",{});var C=f(r);d=n(C,"\u270F\uFE0F "),o=c(C,"STRONG",{});var A=f(o);h=n(A,"\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),A.forEach(e),x=n(C," \u751F\u306E\u30C6\u30AD\u30B9\u30C8\u304B\u3089GPT-2\u306E\u5B66\u7FD2\u307E\u3067\u3001"),g=c(C,"CODE",{});var L=f(g);P=n(L,"TrainingArguments"),L.forEach(e),T=n(C,"\u306B\u52A0\u3048\u3066\u3001\u7D0430\u884C\u306E\u30B3\u30FC\u30C9\u3092\u4F5C\u6210\u3059\u308B\u3060\u3051\u3067\u6E08\u307F\u307E\u3057\u305F\u3002\u3042\u306A\u305F\u81EA\u8EAB\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3067\u8A66\u3057\u3066\u307F\u3066\u3001\u826F\u3044\u7D50\u679C\u304C\u5F97\u3089\u308C\u308B\u304B\u3069\u3046\u304B\u78BA\u8A8D\u3057\u3066\u307F\u3066\u304F\u3060\u3055\u3044!"),C.forEach(e)},m(w,C){p(w,r,C),t(r,d),t(r,o),t(o,h),t(r,x),t(r,g),t(g,P),t(r,T)},d(w){w&&e(r)}}}function Hp(M){let r,d,o,h,x,g,P,T,w,C,A,L,$,G,I,W,F,R,X,z;return{c(){r=_("p"),d=l("\u{1F4A1} \u3082\u3057\u3001\u8907\u6570\u306EGPU\u3092\u642D\u8F09\u3057\u305F\u30DE\u30B7\u30F3\u3092\u5229\u7528\u3067\u304D\u308B\u306E\u3067\u3042\u308C\u3070\u3001"),o=_("code"),h=l("MirroredStrategy"),x=l("\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u4F7F\u3063\u3066\u3001\u5B66\u7FD2\u3092\u5927\u5E45\u306B\u30B9\u30D4\u30FC\u30C9\u30A2\u30C3\u30D7\u3055\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u305D\u306E\u305F\u3081\u306B\u306F "),g=_("code"),P=l("tf.distribute.MirroredStrategy"),T=l(" \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u4F5C\u6210\u3057\u3001 "),w=_("code"),C=l("to_tf_dataset"),A=l(" \u30B3\u30DE\u30F3\u30C9\u3001\u30E2\u30C7\u30EB\u306E\u4F5C\u6210\u3001 "),L=_("code"),$=l("fit()"),G=l(" \u306E\u547C\u3073\u51FA\u3057\u304C\u3059\u3079\u3066 "),I=_("code"),W=l("scope()"),F=l(" \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u5B9F\u884C\u3055\u308C\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u308C\u306B\u95A2\u3059\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306F"),R=_("a"),X=l("\u3053\u3061\u3089"),z=l("\u3067\u898B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),this.h()},l(N){r=c(N,"P",{});var H=f(r);d=n(H,"\u{1F4A1} \u3082\u3057\u3001\u8907\u6570\u306EGPU\u3092\u642D\u8F09\u3057\u305F\u30DE\u30B7\u30F3\u3092\u5229\u7528\u3067\u304D\u308B\u306E\u3067\u3042\u308C\u3070\u3001"),o=c(H,"CODE",{});var K=f(o);h=n(K,"MirroredStrategy"),K.forEach(e),x=n(H,"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u4F7F\u3063\u3066\u3001\u5B66\u7FD2\u3092\u5927\u5E45\u306B\u30B9\u30D4\u30FC\u30C9\u30A2\u30C3\u30D7\u3055\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u305D\u306E\u305F\u3081\u306B\u306F "),g=c(H,"CODE",{});var J=f(g);P=n(J,"tf.distribute.MirroredStrategy"),J.forEach(e),T=n(H," \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u4F5C\u6210\u3057\u3001 "),w=c(H,"CODE",{});var V=f(w);C=n(V,"to_tf_dataset"),V.forEach(e),A=n(H," \u30B3\u30DE\u30F3\u30C9\u3001\u30E2\u30C7\u30EB\u306E\u4F5C\u6210\u3001 "),L=c(H,"CODE",{});var ts=f(L);$=n(ts,"fit()"),ts.forEach(e),G=n(H," \u306E\u547C\u3073\u51FA\u3057\u304C\u3059\u3079\u3066 "),I=c(H,"CODE",{});var _s=f(I);W=n(_s,"scope()"),_s.forEach(e),F=n(H," \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u5B9F\u884C\u3055\u308C\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u308C\u306B\u95A2\u3059\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306F"),R=c(H,"A",{href:!0,rel:!0});var O=f(R);X=n(O,"\u3053\u3061\u3089"),O.forEach(e),z=n(H,"\u3067\u898B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),H.forEach(e),this.h()},h(){S(R,"href","https://www.tensorflow.org/guide/distributed_training#use_tfdistributestrategy_with_keras_modelfit"),S(R,"rel","nofollow")},m(N,H){p(N,r,H),t(r,d),t(r,o),t(o,h),t(r,x),t(r,g),t(g,P),t(r,T),t(r,w),t(w,C),t(r,A),t(r,L),t(L,$),t(r,G),t(r,I),t(I,W),t(r,F),t(r,R),t(R,X),t(r,z)},d(N){N&&e(r)}}}function Sp(M){let r,d;return{c(){r=_("p"),d=l("\u{1F4A1} \u3082\u3057\u3001\u8907\u6570\u306EGPU\u3092\u642D\u8F09\u3057\u305F\u30DE\u30B7\u30F3\u3092\u5229\u7528\u3067\u304D\u308B\u306E\u3067\u3042\u308C\u3070\u3001\u305D\u3053\u3067\u30B3\u30FC\u30C9\u3092\u5B9F\u884C\u3057\u3066\u307F\u3066\u304F\u3060\u3055\u3044\u3002\u30C8\u30EC\u30FC\u30CA\u30FC`\u306F\u81EA\u52D5\u7684\u306B\u8907\u6570\u306E\u30DE\u30B7\u30F3\u3092\u7BA1\u7406\u3059\u308B\u305F\u3081\u3001\u5B66\u7FD2\u901F\u5EA6\u304C\u98DB\u8E8D\u7684\u306B\u5411\u4E0A\u3057\u307E\u3059\u3002")},l(o){r=c(o,"P",{});var h=f(r);d=n(h,"\u{1F4A1} \u3082\u3057\u3001\u8907\u6570\u306EGPU\u3092\u642D\u8F09\u3057\u305F\u30DE\u30B7\u30F3\u3092\u5229\u7528\u3067\u304D\u308B\u306E\u3067\u3042\u308C\u3070\u3001\u305D\u3053\u3067\u30B3\u30FC\u30C9\u3092\u5B9F\u884C\u3057\u3066\u307F\u3066\u304F\u3060\u3055\u3044\u3002\u30C8\u30EC\u30FC\u30CA\u30FC`\u306F\u81EA\u52D5\u7684\u306B\u8907\u6570\u306E\u30DE\u30B7\u30F3\u3092\u7BA1\u7406\u3059\u308B\u305F\u3081\u3001\u5B66\u7FD2\u901F\u5EA6\u304C\u98DB\u8E8D\u7684\u306B\u5411\u4E0A\u3057\u307E\u3059\u3002"),h.forEach(e)},m(o,h){p(o,r,h),t(r,d)},d(o){o&&e(r)}}}function Rp(M){let r;function d(x,g){return x[0]==="pt"?Sp:Hp}let o=d(M),h=o(M);return{c(){h.c(),r=On()},l(x){h.l(x),r=On()},m(x,g){h.m(x,g),p(x,r,g)},p(x,g){o!==(o=d(x))&&(h.d(1),h=o(x),h&&(h.c(),h.m(r.parentNode,r)))},d(x){h.d(x),x&&e(r)}}}function Bp(M){let r,d;return r=new D({props:{code:`from transformers import pipeline

course_model = TFGPT2LMHeadModel.from_pretrained("huggingface-course/codeparrot-ds")
course_tokenizer = AutoTokenizer.from_pretrained("huggingface-course/codeparrot-ds")
pipe = pipeline(
    "text-generation", model=course_model, tokenizer=course_tokenizer, device=0
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

course_model = TFGPT2LMHeadModel.from_pretrained(<span class="hljs-string">&quot;huggingface-course/codeparrot-ds&quot;</span>)
course_tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;huggingface-course/codeparrot-ds&quot;</span>)
pipe = pipeline(
    <span class="hljs-string">&quot;text-generation&quot;</span>, model=course_model, tokenizer=course_tokenizer, device=<span class="hljs-number">0</span>
)`}}),{c(){y(r.$$.fragment)},l(o){v(r.$$.fragment,o)},m(o,h){q(r,o,h),d=!0},i(o){d||(b(r.$$.fragment,o),d=!0)},o(o){j(r.$$.fragment,o),d=!1},d(o){E(r,o)}}}function Up(M){let r,d;return r=new D({props:{code:`import torch
from transformers import pipeline

device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
pipe = pipeline(
    "text-generation", model="huggingface-course/codeparrot-ds", device=device
)`,highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span>) <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> torch.device(<span class="hljs-string">&quot;cpu&quot;</span>)
pipe = pipeline(
    <span class="hljs-string">&quot;text-generation&quot;</span>, model=<span class="hljs-string">&quot;huggingface-course/codeparrot-ds&quot;</span>, device=device
)`}}),{c(){y(r.$$.fragment)},l(o){v(r.$$.fragment,o)},m(o,h){q(r,o,h),d=!0},i(o){d||(b(r.$$.fragment,o),d=!0)},o(o){j(r.$$.fragment,o),d=!1},d(o){E(r,o)}}}function Wp(M){let r,d,o,h,x;return{c(){r=_("p"),d=l("\u3053\u308C\u3089\u306E\u3044\u304F\u3064\u304B\u306E\u4F8B\u3092\u898B\u308B\u3068\u3001\u30E2\u30C7\u30EB\u306FPython\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u95A2\u9023\u306E\u69CB\u6587\u306E\u4E00\u90E8\u3092\u5B66\u7FD2\u3057\u305F\u3088\u3046\u3067\u3059\uFF08\u3082\u3061\u308D\u3093\u3001\u5B9F\u4E16\u754C\u306B\u30E2\u30C7\u30EB\u3092\u5C55\u958B\u3059\u308B\u524D\u306B\u3082\u3063\u3068\u5FB9\u5E95\u7684\u306B\u8A55\u4FA1\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u3067\u3057\u3087\u3046\uFF09\u3002\u3057\u304B\u3057\u3001\u3042\u308B\u30E6\u30FC\u30B9\u30B1\u30FC\u30B9\u306B\u5FC5\u8981\u306A\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u3092\u9054\u6210\u3059\u308B\u305F\u3081\u306B\u3001\u30E2\u30C7\u30EB\u306E\u5B66\u7FD2\u3092\u3088\u308A\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u5834\u5408\u3082\u3042\u308A\u307E\u3059\u3002\u4F8B\u3048\u3070\u3001\u30D0\u30C3\u30C1\u30B5\u30A4\u30BA\u3092\u52D5\u7684\u306B\u66F4\u65B0\u3057\u305F\u3044\u5834\u5408\u3084\u3001\u9069\u5207\u3067\u306A\u3044\u30B5\u30F3\u30D7\u30EB\u3092\u305D\u306E\u5834\u3067\u30B9\u30AD\u30C3\u30D7\u3059\u308B\u6761\u4EF6\u4ED8\u304D\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u6301\u3061\u305F\u3044\u5834\u5408\u306F\u3069\u3046\u3059\u308C\u3070\u3088\u3044\u3067\u3057\u3087\u3046\u304B\u3002\u4E00\u3064\u306E\u9078\u629E\u80A2\u306F "),o=_("code"),h=l("Trainer"),x=l(" \u3092\u30B5\u30D6\u30AF\u30E9\u30B9\u5316\u3057\u3066\u5FC5\u8981\u306A\u5909\u66F4\u3092\u52A0\u3048\u308B\u3053\u3068\u3067\u3059\u304C\u3001\u6642\u306B\u306F\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u4E00\u304B\u3089\u66F8\u3044\u305F\u65B9\u304C\u30B7\u30F3\u30D7\u30EB\u306A\u5834\u5408\u3082\u3042\u308A\u307E\u3059\u3002\u305D\u3053\u3067\u{1F917} Accelerate\u306E\u51FA\u756A\u3067\u3059\u3002")},l(g){r=c(g,"P",{});var P=f(r);d=n(P,"\u3053\u308C\u3089\u306E\u3044\u304F\u3064\u304B\u306E\u4F8B\u3092\u898B\u308B\u3068\u3001\u30E2\u30C7\u30EB\u306FPython\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u95A2\u9023\u306E\u69CB\u6587\u306E\u4E00\u90E8\u3092\u5B66\u7FD2\u3057\u305F\u3088\u3046\u3067\u3059\uFF08\u3082\u3061\u308D\u3093\u3001\u5B9F\u4E16\u754C\u306B\u30E2\u30C7\u30EB\u3092\u5C55\u958B\u3059\u308B\u524D\u306B\u3082\u3063\u3068\u5FB9\u5E95\u7684\u306B\u8A55\u4FA1\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u3067\u3057\u3087\u3046\uFF09\u3002\u3057\u304B\u3057\u3001\u3042\u308B\u30E6\u30FC\u30B9\u30B1\u30FC\u30B9\u306B\u5FC5\u8981\u306A\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u3092\u9054\u6210\u3059\u308B\u305F\u3081\u306B\u3001\u30E2\u30C7\u30EB\u306E\u5B66\u7FD2\u3092\u3088\u308A\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u5834\u5408\u3082\u3042\u308A\u307E\u3059\u3002\u4F8B\u3048\u3070\u3001\u30D0\u30C3\u30C1\u30B5\u30A4\u30BA\u3092\u52D5\u7684\u306B\u66F4\u65B0\u3057\u305F\u3044\u5834\u5408\u3084\u3001\u9069\u5207\u3067\u306A\u3044\u30B5\u30F3\u30D7\u30EB\u3092\u305D\u306E\u5834\u3067\u30B9\u30AD\u30C3\u30D7\u3059\u308B\u6761\u4EF6\u4ED8\u304D\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u6301\u3061\u305F\u3044\u5834\u5408\u306F\u3069\u3046\u3059\u308C\u3070\u3088\u3044\u3067\u3057\u3087\u3046\u304B\u3002\u4E00\u3064\u306E\u9078\u629E\u80A2\u306F "),o=c(P,"CODE",{});var T=f(o);h=n(T,"Trainer"),T.forEach(e),x=n(P," \u3092\u30B5\u30D6\u30AF\u30E9\u30B9\u5316\u3057\u3066\u5FC5\u8981\u306A\u5909\u66F4\u3092\u52A0\u3048\u308B\u3053\u3068\u3067\u3059\u304C\u3001\u6642\u306B\u306F\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u4E00\u304B\u3089\u66F8\u3044\u305F\u65B9\u304C\u30B7\u30F3\u30D7\u30EB\u306A\u5834\u5408\u3082\u3042\u308A\u307E\u3059\u3002\u305D\u3053\u3067\u{1F917} Accelerate\u306E\u51FA\u756A\u3067\u3059\u3002"),P.forEach(e)},m(g,P){p(g,r,P),t(r,d),t(r,o),t(o,h),t(r,x)},d(g){g&&e(r)}}}function Xp(M){let r,d;return{c(){r=_("p"),d=l("\u3053\u308C\u3089\u306E\u3044\u304F\u3064\u304B\u306E\u4F8B\u3092\u898B\u308B\u3068\u3001\u3053\u306E\u30E2\u30C7\u30EB\u306FPython\u3092\u4F7F\u3063\u305F\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u95A2\u9023\u306E\u69CB\u6587\u306E\u4E00\u90E8\u3092\u5B66\u7FD2\u3057\u305F\u3088\u3046\u3067\u3059\u3002\u3082\u3061\u308D\u3093\u3001\u3053\u306E\u30E2\u30C7\u30EB\u3092\u5B9F\u4E16\u754C\u306B\u5C55\u958B\u3059\u308B\u524D\u306B\u3001\u3082\u3063\u3068\u5FB9\u5E95\u7684\u306B\u8A55\u4FA1\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u305D\u308C\u3067\u3082\u3053\u308C\u306F\u5370\u8C61\u7684\u306A\u30D7\u30ED\u30C8\u30BF\u30A4\u30D7\u3067\u3059\u3002")},l(o){r=c(o,"P",{});var h=f(r);d=n(h,"\u3053\u308C\u3089\u306E\u3044\u304F\u3064\u304B\u306E\u4F8B\u3092\u898B\u308B\u3068\u3001\u3053\u306E\u30E2\u30C7\u30EB\u306FPython\u3092\u4F7F\u3063\u305F\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u95A2\u9023\u306E\u69CB\u6587\u306E\u4E00\u90E8\u3092\u5B66\u7FD2\u3057\u305F\u3088\u3046\u3067\u3059\u3002\u3082\u3061\u308D\u3093\u3001\u3053\u306E\u30E2\u30C7\u30EB\u3092\u5B9F\u4E16\u754C\u306B\u5C55\u958B\u3059\u308B\u524D\u306B\u3001\u3082\u3063\u3068\u5FB9\u5E95\u7684\u306B\u8A55\u4FA1\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u305D\u308C\u3067\u3082\u3053\u308C\u306F\u5370\u8C61\u7684\u306A\u30D7\u30ED\u30C8\u30BF\u30A4\u30D7\u3067\u3059\u3002"),h.forEach(e)},m(o,h){p(o,r,h),t(r,d)},d(o){o&&e(r)}}}function bp(M){let r,d,o,h,x,g,P,T,w,C,A,L,$,G,I,W,F,R,X,z,N,H,K,J,V,ts,_s,O,B,Ce,ds,Oe,Ts,vs,hs,yt,cs,Ae,fa,et,tt,ma,vt,Ds,as,Me,at,fs,ua,Cs,Ge,da,lt,ms,qt,ee,os,Et,ls,nt,ha,rt,pt,$a,te,ot,ba,it,Q,ka,ae,ja,ga,Fe,le,xt,ne,re,_t,$s,zt,Os,As,pe,Le,Pt,Ms,Gs,oe,qs,Ie,ie,Tt,bs,Dt,Ne,Ct,Fs,_e,He,Ot,Ls,Is,Ns,ce,Hs,ct,ks,At,Ss,Rs,us,fe,Se,me,ft,mt,wa,Mt,Bs,ue,ut,Z,Gt,Us,ya,Ft,ns,va,Re,dt,qa,ht,Lt,de,Be,he,It,$e,Es,Ws,Ue,Nt,rs,al,We,Xe,Ea,Ke,be,Ht,Xs,ke,Ks,St,xs,Rt,je,$t,Y,xa,ge,za,Pa,we,ye,Bt,Vs,Ta,Ut,Ys,Zs,Js,Qs;return h=new qp({}),I=new ir({props:{id:"Hm8_PgVTFuc"}}),Ds=new D({props:{code:`keytoken_ids = []
for keyword in [
    "plt",
    "pd",
    "sk",
    "fit",
    "predict",
    " plt",
    " pd",
    " sk",
    " fit",
    " predict",
    "testtest",
]:
    ids = tokenizer([keyword]).input_ids[0]
    if len(ids) == 1:
        keytoken_ids.append(ids[0])
    else:
        print(f"Keyword has not single token: {keyword}")`,highlighted:`keytoken_ids = []
<span class="hljs-keyword">for</span> keyword <span class="hljs-keyword">in</span> [
    <span class="hljs-string">&quot;plt&quot;</span>,
    <span class="hljs-string">&quot;pd&quot;</span>,
    <span class="hljs-string">&quot;sk&quot;</span>,
    <span class="hljs-string">&quot;fit&quot;</span>,
    <span class="hljs-string">&quot;predict&quot;</span>,
    <span class="hljs-string">&quot; plt&quot;</span>,
    <span class="hljs-string">&quot; pd&quot;</span>,
    <span class="hljs-string">&quot; sk&quot;</span>,
    <span class="hljs-string">&quot; fit&quot;</span>,
    <span class="hljs-string">&quot; predict&quot;</span>,
    <span class="hljs-string">&quot;testtest&quot;</span>,
]:
    ids = tokenizer([keyword]).input_ids[<span class="hljs-number">0</span>]
    <span class="hljs-keyword">if</span> <span class="hljs-built_in">len</span>(ids) == <span class="hljs-number">1</span>:
        keytoken_ids.append(ids[<span class="hljs-number">0</span>])
    <span class="hljs-keyword">else</span>:
        <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Keyword has not single token: <span class="hljs-subst">{keyword}</span>&quot;</span>)`}}),Me=new D({props:{code:"'Keyword has not single token: testtest'",highlighted:'<span class="hljs-string">&#x27;Keyword has not single token: testtest&#x27;</span>'}}),ms=new D({props:{code:`from torch.nn import CrossEntropyLoss
import torch


def keytoken_weighted_loss(inputs, logits, keytoken_ids, alpha=1.0):
    # Shift so that tokens < n predict n
    shift_labels = inputs[..., 1:].contiguous()
    shift_logits = logits[..., :-1, :].contiguous()
    # Calculate per-token loss
    loss_fct = CrossEntropyLoss(reduce=False)
    loss = loss_fct(shift_logits.view(-1, shift_logits.size(-1)), shift_labels.view(-1))
    # Resize and average loss per sample
    loss_per_sample = loss.view(shift_logits.size(0), shift_logits.size(1)).mean(axis=1)
    # Calculate and scale weighting
    weights = torch.stack([(inputs == kt).float() for kt in keytoken_ids]).sum(
        axis=[0, 2]
    )
    weights = alpha * (1.0 + weights)
    # Calculate weighted average
    weighted_loss = (loss_per_sample * weights).mean()
    return weighted_loss`,highlighted:`<span class="hljs-keyword">from</span> torch.nn <span class="hljs-keyword">import</span> CrossEntropyLoss
<span class="hljs-keyword">import</span> torch


<span class="hljs-keyword">def</span> <span class="hljs-title function_">keytoken_weighted_loss</span>(<span class="hljs-params">inputs, logits, keytoken_ids, alpha=<span class="hljs-number">1.0</span></span>):
    <span class="hljs-comment"># Shift so that tokens &lt; n predict n</span>
    shift_labels = inputs[..., <span class="hljs-number">1</span>:].contiguous()
    shift_logits = logits[..., :-<span class="hljs-number">1</span>, :].contiguous()
    <span class="hljs-comment"># Calculate per-token loss</span>
    loss_fct = CrossEntropyLoss(reduce=<span class="hljs-literal">False</span>)
    loss = loss_fct(shift_logits.view(-<span class="hljs-number">1</span>, shift_logits.size(-<span class="hljs-number">1</span>)), shift_labels.view(-<span class="hljs-number">1</span>))
    <span class="hljs-comment"># Resize and average loss per sample</span>
    loss_per_sample = loss.view(shift_logits.size(<span class="hljs-number">0</span>), shift_logits.size(<span class="hljs-number">1</span>)).mean(axis=<span class="hljs-number">1</span>)
    <span class="hljs-comment"># Calculate and scale weighting</span>
    weights = torch.stack([(inputs == kt).<span class="hljs-built_in">float</span>() <span class="hljs-keyword">for</span> kt <span class="hljs-keyword">in</span> keytoken_ids]).<span class="hljs-built_in">sum</span>(
        axis=[<span class="hljs-number">0</span>, <span class="hljs-number">2</span>]
    )
    weights = alpha * (<span class="hljs-number">1.0</span> + weights)
    <span class="hljs-comment"># Calculate weighted average</span>
    weighted_loss = (loss_per_sample * weights).mean()
    <span class="hljs-keyword">return</span> weighted_loss`}}),re=new D({props:{code:`from torch.utils.data.dataloader import DataLoader

tokenized_dataset.set_format("torch")
train_dataloader = DataLoader(tokenized_dataset["train"], batch_size=32, shuffle=True)
eval_dataloader = DataLoader(tokenized_dataset["valid"], batch_size=32)`,highlighted:`<span class="hljs-keyword">from</span> torch.utils.data.dataloader <span class="hljs-keyword">import</span> DataLoader

tokenized_dataset.set_format(<span class="hljs-string">&quot;torch&quot;</span>)
train_dataloader = DataLoader(tokenized_dataset[<span class="hljs-string">&quot;train&quot;</span>], batch_size=<span class="hljs-number">32</span>, shuffle=<span class="hljs-literal">True</span>)
eval_dataloader = DataLoader(tokenized_dataset[<span class="hljs-string">&quot;valid&quot;</span>], batch_size=<span class="hljs-number">32</span>)`}}),As=new D({props:{code:`weight_decay = 0.1


def get_grouped_params(model, no_decay=["bias", "LayerNorm.weight"]):
    params_with_wd, params_without_wd = [], []
    for n, p in model.named_parameters():
        if any(nd in n for nd in no_decay):
            params_without_wd.append(p)
        else:
            params_with_wd.append(p)
    return [
        {"params": params_with_wd, "weight_decay": weight_decay},
        {"params": params_without_wd, "weight_decay": 0.0},
    ]`,highlighted:`weight_decay = <span class="hljs-number">0.1</span>


<span class="hljs-keyword">def</span> <span class="hljs-title function_">get_grouped_params</span>(<span class="hljs-params">model, no_decay=[<span class="hljs-string">&quot;bias&quot;</span>, <span class="hljs-string">&quot;LayerNorm.weight&quot;</span>]</span>):
    params_with_wd, params_without_wd = [], []
    <span class="hljs-keyword">for</span> n, p <span class="hljs-keyword">in</span> model.named_parameters():
        <span class="hljs-keyword">if</span> <span class="hljs-built_in">any</span>(nd <span class="hljs-keyword">in</span> n <span class="hljs-keyword">for</span> nd <span class="hljs-keyword">in</span> no_decay):
            params_without_wd.append(p)
        <span class="hljs-keyword">else</span>:
            params_with_wd.append(p)
    <span class="hljs-keyword">return</span> [
        {<span class="hljs-string">&quot;params&quot;</span>: params_with_wd, <span class="hljs-string">&quot;weight_decay&quot;</span>: weight_decay},
        {<span class="hljs-string">&quot;params&quot;</span>: params_without_wd, <span class="hljs-string">&quot;weight_decay&quot;</span>: <span class="hljs-number">0.0</span>},
    ]`}}),Gs=new D({props:{code:`def evaluate():
    model.eval()
    losses = []
    for step, batch in enumerate(eval_dataloader):
        with torch.no_grad():
            outputs = model(batch["input_ids"], labels=batch["input_ids"])

        losses.append(accelerator.gather(outputs.loss))
    loss = torch.mean(torch.cat(losses))
    try:
        perplexity = torch.exp(loss)
    except OverflowError:
        perplexity = float("inf")
    return loss.item(), perplexity.item()`,highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">evaluate</span>():
    model.<span class="hljs-built_in">eval</span>()
    losses = []
    <span class="hljs-keyword">for</span> step, batch <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(eval_dataloader):
        <span class="hljs-keyword">with</span> torch.no_grad():
            outputs = model(batch[<span class="hljs-string">&quot;input_ids&quot;</span>], labels=batch[<span class="hljs-string">&quot;input_ids&quot;</span>])

        losses.append(accelerator.gather(outputs.loss))
    loss = torch.mean(torch.cat(losses))
    <span class="hljs-keyword">try</span>:
        perplexity = torch.exp(loss)
    <span class="hljs-keyword">except</span> OverflowError:
        perplexity = <span class="hljs-built_in">float</span>(<span class="hljs-string">&quot;inf&quot;</span>)
    <span class="hljs-keyword">return</span> loss.item(), perplexity.item()`}}),Fs=new D({props:{code:"model = GPT2LMHeadModel(config)",highlighted:"model = GPT2LMHeadModel(config)"}}),Is=new D({props:{code:`from torch.optim import AdamW

optimizer = AdamW(get_grouped_params(model), lr=5e-4)`,highlighted:`<span class="hljs-keyword">from</span> torch.optim <span class="hljs-keyword">import</span> AdamW

optimizer = AdamW(get_grouped_params(model), lr=<span class="hljs-number">5e-4</span>)`}}),ks=new D({props:{code:`from accelerate import Accelerator

accelerator = Accelerator(fp16=True)

model, optimizer, train_dataloader, eval_dataloader = accelerator.prepare(
    model, optimizer, train_dataloader, eval_dataloader
)`,highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator

accelerator = Accelerator(fp16=<span class="hljs-literal">True</span>)

model, optimizer, train_dataloader, eval_dataloader = accelerator.prepare(
    model, optimizer, train_dataloader, eval_dataloader
)`}}),Ss=new ca({props:{$$slots:{default:[Kp]},$$scope:{ctx:M}}}),ue=new D({props:{code:`from transformers import get_scheduler

num_train_epochs = 1
num_update_steps_per_epoch = len(train_dataloader)
num_training_steps = num_train_epochs * num_update_steps_per_epoch

lr_scheduler = get_scheduler(
    name="linear",
    optimizer=optimizer,
    num_warmup_steps=1_000,
    num_training_steps=num_training_steps,
)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> get_scheduler

num_train_epochs = <span class="hljs-number">1</span>
num_update_steps_per_epoch = <span class="hljs-built_in">len</span>(train_dataloader)
num_training_steps = num_train_epochs * num_update_steps_per_epoch

lr_scheduler = get_scheduler(
    name=<span class="hljs-string">&quot;linear&quot;</span>,
    optimizer=optimizer,
    num_warmup_steps=<span class="hljs-number">1_000</span>,
    num_training_steps=num_training_steps,
)`}}),de=new D({props:{code:`from huggingface_hub import Repository, get_full_repo_name

model_name = "codeparrot-ds-accelerate"
repo_name = get_full_repo_name(model_name)
repo_name`,highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> Repository, get_full_repo_name

model_name = <span class="hljs-string">&quot;codeparrot-ds-accelerate&quot;</span>
repo_name = get_full_repo_name(model_name)
repo_name`}}),he=new D({props:{code:"'sgugger/codeparrot-ds-accelerate'",highlighted:'<span class="hljs-string">&#x27;sgugger/codeparrot-ds-accelerate&#x27;</span>'}}),Ue=new D({props:{code:`output_dir = "codeparrot-ds-accelerate"
repo = Repository(output_dir, clone_from=repo_name)`,highlighted:`output_dir = <span class="hljs-string">&quot;codeparrot-ds-accelerate&quot;</span>
repo = Repository(output_dir, clone_from=repo_name)`}}),xs=new D({props:{code:"evaluate()",highlighted:"evaluate()"}}),je=new D({props:{code:"(10.934126853942871, 56057.14453125)",highlighted:'(<span class="hljs-number">10.934126853942871</span>, <span class="hljs-number">56057.14453125</span>)'}}),ye=new D({props:{code:`from tqdm.notebook import tqdm

gradient_accumulation_steps = 8
eval_steps = 5_000

model.train()
completed_steps = 0
for epoch in range(num_train_epochs):
    for step, batch in tqdm(
        enumerate(train_dataloader, start=1), total=num_training_steps
    ):
        logits = model(batch["input_ids"]).logits
        loss = keytoken_weighted_loss(batch["input_ids"], logits, keytoken_ids)
        if step % 100 == 0:
            accelerator.print(
                {
                    "lr": get_lr(),
                    "samples": step * samples_per_step,
                    "steps": completed_steps,
                    "loss/train": loss.item() * gradient_accumulation_steps,
                }
            )
        loss = loss / gradient_accumulation_steps
        accelerator.backward(loss)
        if step % gradient_accumulation_steps == 0:
            accelerator.clip_grad_norm_(model.parameters(), 1.0)
            optimizer.step()
            lr_scheduler.step()
            optimizer.zero_grad()
            completed_steps += 1
        if (step % (eval_steps * gradient_accumulation_steps)) == 0:
            eval_loss, perplexity = evaluate()
            accelerator.print({"loss/eval": eval_loss, "perplexity": perplexity})
            model.train()
            accelerator.wait_for_everyone()
            unwrapped_model = accelerator.unwrap_model(model)
            unwrapped_model.save_pretrained(output_dir, save_function=accelerator.save)
            if accelerator.is_main_process:
                tokenizer.save_pretrained(output_dir)
                repo.push_to_hub(
                    commit_message=f"Training in progress step {step}", blocking=False
                )`,highlighted:`<span class="hljs-keyword">from</span> tqdm.notebook <span class="hljs-keyword">import</span> tqdm

gradient_accumulation_steps = <span class="hljs-number">8</span>
eval_steps = <span class="hljs-number">5_000</span>

model.train()
completed_steps = <span class="hljs-number">0</span>
<span class="hljs-keyword">for</span> epoch <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_train_epochs):
    <span class="hljs-keyword">for</span> step, batch <span class="hljs-keyword">in</span> tqdm(
        <span class="hljs-built_in">enumerate</span>(train_dataloader, start=<span class="hljs-number">1</span>), total=num_training_steps
    ):
        logits = model(batch[<span class="hljs-string">&quot;input_ids&quot;</span>]).logits
        loss = keytoken_weighted_loss(batch[<span class="hljs-string">&quot;input_ids&quot;</span>], logits, keytoken_ids)
        <span class="hljs-keyword">if</span> step % <span class="hljs-number">100</span> == <span class="hljs-number">0</span>:
            accelerator.<span class="hljs-built_in">print</span>(
                {
                    <span class="hljs-string">&quot;lr&quot;</span>: get_lr(),
                    <span class="hljs-string">&quot;samples&quot;</span>: step * samples_per_step,
                    <span class="hljs-string">&quot;steps&quot;</span>: completed_steps,
                    <span class="hljs-string">&quot;loss/train&quot;</span>: loss.item() * gradient_accumulation_steps,
                }
            )
        loss = loss / gradient_accumulation_steps
        accelerator.backward(loss)
        <span class="hljs-keyword">if</span> step % gradient_accumulation_steps == <span class="hljs-number">0</span>:
            accelerator.clip_grad_norm_(model.parameters(), <span class="hljs-number">1.0</span>)
            optimizer.step()
            lr_scheduler.step()
            optimizer.zero_grad()
            completed_steps += <span class="hljs-number">1</span>
        <span class="hljs-keyword">if</span> (step % (eval_steps * gradient_accumulation_steps)) == <span class="hljs-number">0</span>:
            eval_loss, perplexity = evaluate()
            accelerator.<span class="hljs-built_in">print</span>({<span class="hljs-string">&quot;loss/eval&quot;</span>: eval_loss, <span class="hljs-string">&quot;perplexity&quot;</span>: perplexity})
            model.train()
            accelerator.wait_for_everyone()
            unwrapped_model = accelerator.unwrap_model(model)
            unwrapped_model.save_pretrained(output_dir, save_function=accelerator.save)
            <span class="hljs-keyword">if</span> accelerator.is_main_process:
                tokenizer.save_pretrained(output_dir)
                repo.push_to_hub(
                    commit_message=<span class="hljs-string">f&quot;Training in progress step <span class="hljs-subst">{step}</span>&quot;</span>, blocking=<span class="hljs-literal">False</span>
                )`}}),Ys=new ca({props:{$$slots:{default:[Vp]},$$scope:{ctx:M}}}),Js=new ca({props:{$$slots:{default:[Yp]},$$scope:{ctx:M}}}),{c(){r=_("h2"),d=_("a"),o=_("span"),y(h.$$.fragment),x=m(),g=_("span"),P=l("\u{1F917} Accelerate \u3092\u4F7F\u3063\u305F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0"),T=m(),w=_("p"),C=l("\u3053\u308C\u307E\u3067 "),A=_("code"),L=l("Trainer"),$=l(" \u3092\u4F7F\u3063\u3066\u30E2\u30C7\u30EB\u3092\u5B66\u7FD2\u3059\u308B\u65B9\u6CD5\u3092\u898B\u3066\u304D\u307E\u3057\u305F\u3002\u3053\u308C\u306F\u3042\u308B\u7A0B\u5EA6\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u304C\u3001\u6642\u306B\u306F\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u5B8C\u5168\u306B\u5236\u5FA1\u3057\u305F\u3044\u5834\u5408\u3084\u3001\u6D3E\u624B\u306A\u5909\u66F4\u3092\u52A0\u3048\u305F\u3044\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u5834\u5408\u3001\u{1F917} Accelerate\u306F\u7D20\u6674\u3089\u3057\u3044\u9078\u629E\u80A2\u3067\u3059\u3002\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3067\u306F\u3001\u305D\u308C\u3092\u4F7F\u3063\u3066\u30E2\u30C7\u30EB\u3092\u8A13\u7DF4\u3059\u308B\u624B\u9806\u3092\u8AAC\u660E\u3057\u307E\u3059\u3002\u3055\u3089\u306B\u9762\u767D\u304F\u3059\u308B\u305F\u3081\u306B\u3001\u5B66\u7FD2\u30EB\u30FC\u30D7\u306B\u4E00\u5DE5\u592B\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),G=m(),y(I.$$.fragment),W=m(),F=_("p"),R=l("\u79C1\u9054\u306F\u4E3B\u306B\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u30E9\u30A4\u30D6\u30E9\u30EA\u306E\u81EA\u52D5\u88DC\u5B8C\u306B\u8208\u5473\u304C\u3042\u308B\u306E\u3067\u3001\u3053\u308C\u3089\u306E\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u3088\u308A\u591A\u304F\u4F7F\u7528\u3059\u308B\u5B66\u7FD2\u30B5\u30F3\u30D7\u30EB\u306B\u91CD\u304D\u3092\u7F6E\u304F\u3053\u3068\u306F\u7406\u306B\u304B\u306A\u3063\u3066\u3044\u307E\u3059\u3002\u3053\u308C\u3089\u306E\u30B5\u30F3\u30D7\u30EB\u306F "),X=_("code"),z=l("plt"),N=l(", "),H=_("code"),K=l("pd"),J=l(", "),V=_("code"),ts=l("sk"),_s=l(", "),O=_("code"),B=l("fit"),Ce=l(", "),ds=_("code"),Oe=l("predict"),Ts=l(" \u3068\u3044\u3063\u305F\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u7C21\u5358\u306B\u8B58\u5225\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u3089\u306F "),vs=_("code"),hs=l("matplotlib.pyplot"),yt=l(", "),cs=_("code"),Ae=l("pandas"),fa=l(", "),et=_("code"),tt=l("sklearn"),ma=l(" \u3067\u6700\u3082\u983B\u7E41\u306B\u4F7F\u7528\u3055\u308C\u308B import \u540D\u3067\u3001\u5F8C\u8005\u306E fit/predict \u306E\u30D1\u30BF\u30FC\u30F3\u3082\u540C\u69D8\u3067\u3059\u3002\u3053\u308C\u3089\u3092\u305D\u308C\u305E\u308C1\u3064\u306E\u30C8\u30FC\u30AF\u30F3\u3068\u3057\u3066\u8868\u73FE\u3059\u308C\u3070\u3001\u5165\u529B\u5217\u306E\u4E2D\u306B\u305D\u308C\u3089\u304C\u3042\u308B\u304B\u3069\u3046\u304B\u3092\u7C21\u5358\u306B\u30C1\u30A7\u30C3\u30AF\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u30C8\u30FC\u30AF\u30F3\u306F\u534A\u89D2\u30B9\u30DA\u30FC\u30B9\u3092\u524D\u306B\u6301\u3064\u3053\u3068\u304C\u3067\u304D\u308B\u306E\u3067\u3001\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u306E\u8A9E\u5F59\u306E\u4E2D\u306B\u305D\u308C\u3089\u306E\u304C\u3042\u308B\u304B\u3069\u3046\u304B\u3082\u30C1\u30A7\u30C3\u30AF\u3059\u308B\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002\u52D5\u4F5C\u78BA\u8A8D\u306E\u305F\u3081\u3001\u8907\u6570\u306E\u30C8\u30FC\u30AF\u30F3\u306B\u5206\u5272\u3055\u308C\u308B\u306F\u305A\u306E\u30C6\u30B9\u30C8\u30C8\u30FC\u30AF\u30F3\u30921\u3064\u8FFD\u52A0\u3057\u3066\u307F\u307E\u3059\u3002"),vt=m(),y(Ds.$$.fragment),as=m(),y(Me.$$.fragment),at=m(),fs=_("p"),ua=l("\u7D20\u6674\u3089\u3057\u3044\uFF01\u3046\u307E\u304F\u3044\u3063\u305F\u3088\u3046\u3067\u3059\u306D\u3002"),Cs=m(),Ge=_("p"),da=l("\u5165\u529B\u30B7\u30FC\u30B1\u30F3\u30B9\u3001\u30ED\u30B8\u30C3\u30C8\u3001\u305D\u3057\u3066\u5148\u307B\u3069\u9078\u629E\u3057\u305F\u30AD\u30FC\u30C8\u30FC\u30AF\u30F3\u3092\u5165\u529B\u3068\u3059\u308B\u30AB\u30B9\u30BF\u30E0\u640D\u5931\u95A2\u6570\u3092\u66F8\u304F\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u307E\u305A\u3001\u30ED\u30B8\u30C3\u30C8\u3068\u5165\u529B\u306E\u4F4D\u7F6E\u3092\u5408\u308F\u305B\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u5165\u529B\u5217\u3092\u53F3\u306B1\u3064\u30B7\u30D5\u30C8\u3057\u305F\u3082\u306E\u304C\u30E9\u30D9\u30EB\u3068\u306A\u308A\u3001\u6B21\u306E\u30C8\u30FC\u30AF\u30F3\u304C\u73FE\u5728\u306E\u30C8\u30FC\u30AF\u30F3\u306E\u30E9\u30D9\u30EB\u3068\u306A\u308A\u307E\u3059\u3002\u3053\u308C\u306F\u5165\u529B\u30B7\u30FC\u30B1\u30F3\u30B9\u306E2\u756A\u76EE\u306E\u30C8\u30FC\u30AF\u30F3\u304B\u3089\u30E9\u30D9\u30EB\u3092\u958B\u59CB\u3059\u308B\u3053\u3068\u3067\u5B9F\u73FE\u3067\u304D\u307E\u3059\u3002\u306A\u305C\u306A\u3089\u3001\u30E2\u30C7\u30EB\u306F\u6700\u521D\u306E\u30C8\u30FC\u30AF\u30F3\u306B\u5BFE\u3057\u3066\u3044\u305A\u308C\u306B\u3057\u3066\u3082\u4E88\u6E2C\u3092\u884C\u308F\u306A\u3044\u304B\u3089\u3067\u3059\u3002\u305D\u3057\u3066\u3001\u6700\u5F8C\u306E\u30ED\u30B8\u30C3\u30C8\u3092\u5207\u308A\u6368\u3066\u307E\u3059\u3002\u306A\u305C\u306A\u3089\u3001\u5168\u5165\u529B\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u5F8C\u306B\u306F\u5BFE\u5FDC\u3059\u308B\u30E9\u30D9\u30EB\u304C\u306A\u3044\u304B\u3089\u3067\u3059\u3002\u3053\u308C\u3067\u30B5\u30F3\u30D7\u30EB\u3054\u3068\u306E\u640D\u5931\u3092\u8A08\u7B97\u3057\u3001\u5404\u30B5\u30F3\u30D7\u30EB\u306B\u304A\u3051\u308B\u5168\u3066\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u306E\u51FA\u73FE\u3092\u30AB\u30A6\u30F3\u30C8\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u6700\u5F8C\u306B\u3001\u51FA\u73FE\u56DE\u6570\u3092\u91CD\u307F\u3068\u3057\u3066\u3001\u5168\u30B5\u30F3\u30D7\u30EB\u306E\u52A0\u91CD\u5E73\u5747\u3092\u8A08\u7B97\u3057\u307E\u3059\u3002\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u6301\u305F\u306A\u3044\u30B5\u30F3\u30D7\u30EB\u3092\u5168\u3066\u6368\u3066\u305F\u304F\u306A\u3044\u306E\u3067\u3001\u91CD\u307F\u306B1\u3092\u52A0\u3048\u307E\u3059\u3002"),lt=m(),y(ms.$$.fragment),qt=m(),ee=_("p"),os=l("\u3053\u306E\u7D20\u6674\u3089\u3057\u3044\u65B0\u3057\u3044\u640D\u5931\u95A2\u6570\u3092\u4F7F\u3063\u305F\u5B66\u7FD2\u3092\u59CB\u3081\u308B\u524D\u306B\u3001\u3044\u304F\u3064\u304B\u306E\u3053\u3068\u3092\u6E96\u5099\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),Et=m(),ls=_("ul"),nt=_("li"),ha=l("\u30C7\u30FC\u30BF\u3092\u30ED\u30FC\u30C9\u3057\u3066\u30D0\u30C3\u30C1\u306B\u3059\u308B\u305F\u3081\u306E\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u304C\u5FC5\u8981\u3067\u3059\u3002"),rt=m(),pt=_("li"),$a=l("\u91CD\u307F\u6E1B\u8870\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u8A2D\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),te=m(),ot=_("li"),ba=l("\u6642\u6298\u3001\u8A55\u4FA1\u3092\u884C\u3044\u305F\u3044\u306E\u3067\u3001\u8A55\u4FA1\u30B3\u30FC\u30C9\u3092\u95A2\u6570\u3067\u30E9\u30C3\u30D7\u3059\u308B\u306E\u306F\u7406\u306B\u304B\u306A\u3063\u3066\u3044\u307E\u3059\u3002"),it=m(),Q=_("p"),ka=l(`\u307E\u305A\u306F\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u304B\u3089\u59CB\u3081\u307E\u3057\u3087\u3046\u3002
\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3092 `),ae=_("code"),ja=l('"torch"'),ga=l(" \u306B\u8A2D\u5B9A\u3059\u308B\u3060\u3051\u3067\u3001\u3042\u3068\u306F\u9069\u5207\u306A\u30D0\u30C3\u30C1\u30B5\u30A4\u30BA\u3067 PyTorch \u306E "),Fe=_("code"),le=l("DataLoader"),xt=l(" \u306B\u6E21\u305B\u3070\u3044\u3044\u306E\u3067\u3059\u3002"),ne=m(),y(re.$$.fragment),_t=m(),$s=_("p"),zt=l(`\u6B21\u306B\u3001\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u30B0\u30EB\u30FC\u30D7\u5316\u3057\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u304C\u3069\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u8FFD\u52A0\u306E\u91CD\u307F\u6E1B\u8870\u3092\u5F97\u308B\u304B\u3092\u77E5\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u901A\u5E38\u3001\u3059\u3079\u3066\u306E\u30D0\u30A4\u30A2\u30B9\u3068LayerNorm\u306E\u91CD\u307F\u9805\u306F\u3001\u3053\u306E\u5BFE\u8C61\u304B\u3089\u9664\u5916\u3055\u308C\u307E\u3059\u3002
\u4EE5\u4E0B\u306E\u3088\u3046\u306B\u306A\u308A\u307E\u3059\u3002`),Os=m(),y(As.$$.fragment),pe=m(),Le=_("p"),Pt=l("\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u4E2D\u306B\u5B9A\u671F\u7684\u306B\u691C\u8A3C\u30BB\u30C3\u30C8\u3067\u30E2\u30C7\u30EB\u3092\u8A55\u4FA1\u3057\u305F\u3044\u306E\u3067\u3001\u305D\u306E\u305F\u3081\u306E\u95A2\u6570\u3082\u66F8\u3044\u3066\u304A\u304D\u307E\u3057\u3087\u3046\u3002\u3053\u306E\u95A2\u6570\u306F\u3001\u8A55\u4FA1\u7528\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u3092\u5B9F\u884C\u3057\u3001\u30D7\u30ED\u30BB\u30B9\u9593\u306E\u640D\u5931\u3092\u3059\u3079\u3066\u53CE\u96C6\u3059\u308B\u3060\u3051\u3067\u3059\u3002"),Ms=m(),y(Gs.$$.fragment),oe=m(),qs=_("p"),Ie=_("code"),ie=l("evaluate()"),Tt=l("\u95A2\u6570\u306B\u3088\u308A\u3001\u640D\u5931\u3068"),bs=_("a"),Dt=l("\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3"),Ne=l("\u3092\u4E00\u5B9A\u6642\u9593\u3054\u3068\u306B\u5831\u544A\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u6B21\u306B\u3001\u3082\u3046\u4E00\u5EA6\u30BC\u30ED\u304B\u3089\u5B66\u7FD2\u3059\u308B\u305F\u3081\u306B\u3001\u30E2\u30C7\u30EB\u3092\u518D\u5B9A\u7FA9\u3057\u307E\u3059\u3002"),Ct=m(),y(Fs.$$.fragment),_e=m(),He=_("p"),Ot=l("\u6B21\u306B\u3001\u5148\u307B\u3069\u306E\u95A2\u6570\u3092\u4F7F\u3063\u3066\u3001\u91CD\u307F\u6E1B\u8870\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u5206\u5272\u3057\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002"),Ls=m(),y(Is.$$.fragment),Ns=m(),ce=_("p"),Hs=l("\u305D\u308C\u3067\u306F\u3001\u30E2\u30C7\u30EB\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u3001\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u3092\u6E96\u5099\u3057\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u958B\u59CB\u3057\u307E\u3057\u3087\u3046\u3002"),ct=m(),y(ks.$$.fragment),At=m(),y(Ss.$$.fragment),Rs=m(),us=_("p"),fe=l("\u3053\u308C\u3067 "),Se=_("code"),me=l("train_dataloader"),ft=l(" \u3092 "),mt=_("code"),wa=l("accelerator.prepare()"),Mt=l(" \u306B\u9001\u3063\u305F\u306E\u3067\u3001\u305D\u306E\u9577\u3055\u3092\u7528\u3044\u3066\u5B66\u7FD2\u30B9\u30C6\u30C3\u30D7\u6570\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u306E\u9577\u3055\u3092\u5909\u66F4\u3059\u308B\u306E\u3067\u3001\u5E38\u306B\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u3092\u6E96\u5099\u3057\u305F\u5F8C\u306B\u884C\u3046\u5FC5\u8981\u304C\u3042\u308B\u3053\u3068\u3092\u5FD8\u308C\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\u3053\u3053\u3067\u306F\u3001\u5B66\u7FD2\u7387\u304B\u30890\u307E\u3067\u306E\u53E4\u5178\u7684\u306A\u7DDA\u5F62\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002"),Bs=m(),y(ue.$$.fragment),ut=m(),Z=_("p"),Gt=l("\u6700\u5F8C\u306B\u3001\u79C1\u305F\u3061\u306E\u30E2\u30C7\u30EB\u3092\u30CF\u30D6\u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u305F\u3081\u306B\u3001\u4F5C\u696D\u30D5\u30A9\u30EB\u30C0\u306B "),Us=_("code"),ya=l("Repository"),Ft=l(" \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u4F5C\u6210\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u307E\u305A\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6 \u306B\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u307E\u3060\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u306A\u3044\u5834\u5408\uFF09\u3002\u30E2\u30C7\u30EB\u306B\u4ED8\u4E0E\u3057\u305F\u3044\u30E2\u30C7\u30EB ID \u304B\u3089\u30EA\u30DD\u30B8\u30C8\u30EA\u540D\u3092\u6C7A\u5B9A\u3057\u307E\u3059\uFF08"),ns=_("code"),va=l("repo_name"),Re=l(" \u3092\u81EA\u7531\u306B\u7F6E\u304D\u63DB\u3048\u3066\u304F\u3060\u3055\u3044\u3002\u3053\u308C\u306F\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u3001\u95A2\u6570 "),dt=_("code"),qa=l("get_full_repo_name()"),ht=l(" \u304C\u884C\u3063\u3066\u3044\u308B\u4E8B\u3067\u3059)\u3002"),Lt=m(),y(de.$$.fragment),Be=m(),y(he.$$.fragment),It=m(),$e=_("p"),Es=l("\u305D\u3057\u3066\u3001\u305D\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u30ED\u30FC\u30AB\u30EB\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u30AF\u30ED\u30FC\u30F3\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u306E\u3067\u3042\u308C\u3070\u3001\u3053\u306E\u30ED\u30FC\u30AB\u30EB\u30D5\u30A9\u30EB\u30C0\u30FC\u306F\u4F5C\u696D\u4E2D\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u65E2\u5B58\u306E\u30AF\u30ED\u30FC\u30F3\u3067\u3042\u308B\u3079\u304D\u3067\u3059\u3002"),Ws=m(),y(Ue.$$.fragment),Nt=m(),rs=_("p"),al=l("\u3053\u308C\u3067 "),We=_("code"),Xe=l("repo.push_to_hub()"),Ea=l(" \u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u3067\u3001"),Ke=_("code"),be=l("output_dir"),Ht=l(" \u306B\u4FDD\u5B58\u3057\u305F\u3082\u306E\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3067\u304D\u308B\u3088\u3046\u306B\u306A\u308A\u307E\u3057\u305F\u3002\u3053\u308C\u306B\u3088\u308A\u3001\u5404\u30A8\u30DD\u30C3\u30AF\u7D42\u4E86\u6642\u306B\u4E2D\u9593\u30E2\u30C7\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Xs=m(),ke=_("p"),Ks=l("\u5B66\u7FD2\u3059\u308B\u524D\u306B\u3001\u8A55\u4FA1\u95A2\u6570\u304C\u6B63\u3057\u304F\u52D5\u4F5C\u3059\u308B\u304B\u3069\u3046\u304B\u3001\u7C21\u5358\u306A\u30C6\u30B9\u30C8\u3092\u5B9F\u884C\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),St=m(),y(xs.$$.fragment),Rt=m(),y(je.$$.fragment),$t=m(),Y=_("p"),xa=l("\u640D\u5931\u3068\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u306F\u975E\u5E38\u306B\u9AD8\u3044\u5024\u3067\u3059\u304C\u3001\u307E\u3060\u30E2\u30C7\u30EB\u3092\u8A13\u7DF4\u3057\u3066\u3044\u306A\u3044\u306E\u3067\u9A5A\u304F\u3053\u3068\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u3053\u308C\u3067\u3001\u5B66\u7FD2\u30B9\u30AF\u30EA\u30D7\u30C8\u306E\u6838\u3068\u306A\u308B\u90E8\u5206\u3001\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u66F8\u304F\u6E96\u5099\u304C\u6574\u3044\u307E\u3057\u305F\u3002\u5B66\u7FD2\u30EB\u30FC\u30D7\u3067\u306F\u3001\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u3092\u7E70\u308A\u8FD4\u3057\u51E6\u7406\u3057\u3001\u305D\u306E\u30D0\u30C3\u30C1\u3092\u30E2\u30C7\u30EB\u306B\u6E21\u3057\u307E\u3059\u3002\u30ED\u30B8\u30C3\u30C8\u3092\u53D6\u5F97\u3059\u308B\u3053\u3068\u3067\u3001\u72EC\u81EA\u306E\u640D\u5931\u95A2\u6570\u3092\u8A55\u4FA1\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u640D\u5931\u306F\u52FE\u914D\u7D2F\u7A4D\u306E\u30B9\u30C6\u30C3\u30D7\u6570\u3067\u30B9\u30B1\u30FC\u30EA\u30F3\u30B0\u3057\u3001\u3088\u308A\u591A\u304F\u306E\u30B9\u30C6\u30C3\u30D7\u3092\u96C6\u7D04\u3059\u308B\u969B\u306B\u5927\u304D\u306A\u640D\u5931\u304C\u751F\u3058\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u307E\u305F\u3001\u6700\u9069\u5316\u3059\u308B\u524D\u306B\u3001\u53CE\u675F\u3092\u826F\u304F\u3059\u308B\u305F\u3081\u306B\u52FE\u914D\u3092\u5207\u308A\u53D6\u308A\u307E\u3059\u3002\u6700\u5F8C\u306B\u3001\u6570\u30B9\u30C6\u30C3\u30D7\u3054\u3068\u306B\u3001\u65B0\u3057\u3044 "),ge=_("code"),za=l("evaluate()"),Pa=l(" \u95A2\u6570\u3092\u7528\u3044\u3066\u3001\u8A55\u4FA1\u30BB\u30C3\u30C8\u3067\u30E2\u30C7\u30EB\u3092\u8A55\u4FA1\u3057\u307E\u3059\u3002"),we=m(),y(ye.$$.fragment),Bt=m(),Vs=_("p"),Ta=l(`\u3053\u308C\u3067\u5B8C\u4E86\u3067\u3059\u3002
\u8CB4\u65B9\u306FGPT-2\u306E\u3088\u3046\u306A\u56E0\u679C\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u305F\u3081\u306E\u30AB\u30B9\u30BF\u30E0\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u4F5C\u6210\u3067\u304D\u308B\u3088\u3046\u306B\u306A\u308A\u3001\u66F4\u306B\u30CB\u30FC\u30BA\u306B\u5408\u308F\u305B\u3066\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002`),Ut=m(),y(Ys.$$.fragment),Zs=m(),y(Js.$$.fragment),this.h()},l(a){r=c(a,"H2",{class:!0});var k=f(r);d=c(k,"A",{id:!0,class:!0,href:!0});var ll=f(d);o=c(ll,"SPAN",{});var Da=f(o);v(h.$$.fragment,Da),Da.forEach(e),ll.forEach(e),x=u(k),g=c(k,"SPAN",{});var bt=f(g);P=n(bt,"\u{1F917} Accelerate \u3092\u4F7F\u3063\u305F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0"),bt.forEach(e),k.forEach(e),T=u(a),w=c(a,"P",{});var Wt=f(w);C=n(Wt,"\u3053\u308C\u307E\u3067 "),A=c(Wt,"CODE",{});var Ca=f(A);L=n(Ca,"Trainer"),Ca.forEach(e),$=n(Wt," \u3092\u4F7F\u3063\u3066\u30E2\u30C7\u30EB\u3092\u5B66\u7FD2\u3059\u308B\u65B9\u6CD5\u3092\u898B\u3066\u304D\u307E\u3057\u305F\u3002\u3053\u308C\u306F\u3042\u308B\u7A0B\u5EA6\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u304C\u3001\u6642\u306B\u306F\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u5B8C\u5168\u306B\u5236\u5FA1\u3057\u305F\u3044\u5834\u5408\u3084\u3001\u6D3E\u624B\u306A\u5909\u66F4\u3092\u52A0\u3048\u305F\u3044\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u5834\u5408\u3001\u{1F917} Accelerate\u306F\u7D20\u6674\u3089\u3057\u3044\u9078\u629E\u80A2\u3067\u3059\u3002\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3067\u306F\u3001\u305D\u308C\u3092\u4F7F\u3063\u3066\u30E2\u30C7\u30EB\u3092\u8A13\u7DF4\u3059\u308B\u624B\u9806\u3092\u8AAC\u660E\u3057\u307E\u3059\u3002\u3055\u3089\u306B\u9762\u767D\u304F\u3059\u308B\u305F\u3081\u306B\u3001\u5B66\u7FD2\u30EB\u30FC\u30D7\u306B\u4E00\u5DE5\u592B\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Wt.forEach(e),G=u(a),v(I.$$.fragment,a),W=u(a),F=c(a,"P",{});var U=f(F);R=n(U,"\u79C1\u9054\u306F\u4E3B\u306B\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u30E9\u30A4\u30D6\u30E9\u30EA\u306E\u81EA\u52D5\u88DC\u5B8C\u306B\u8208\u5473\u304C\u3042\u308B\u306E\u3067\u3001\u3053\u308C\u3089\u306E\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u3088\u308A\u591A\u304F\u4F7F\u7528\u3059\u308B\u5B66\u7FD2\u30B5\u30F3\u30D7\u30EB\u306B\u91CD\u304D\u3092\u7F6E\u304F\u3053\u3068\u306F\u7406\u306B\u304B\u306A\u3063\u3066\u3044\u307E\u3059\u3002\u3053\u308C\u3089\u306E\u30B5\u30F3\u30D7\u30EB\u306F "),X=c(U,"CODE",{});var Oa=f(X);z=n(Oa,"plt"),Oa.forEach(e),N=n(U,", "),H=c(U,"CODE",{});var Ve=f(H);K=n(Ve,"pd"),Ve.forEach(e),J=n(U,", "),V=c(U,"CODE",{});var nl=f(V);ts=n(nl,"sk"),nl.forEach(e),_s=n(U,", "),O=c(U,"CODE",{});var Aa=f(O);B=n(Aa,"fit"),Aa.forEach(e),Ce=n(U,", "),ds=c(U,"CODE",{});var zs=f(ds);Oe=n(zs,"predict"),zs.forEach(e),Ts=n(U," \u3068\u3044\u3063\u305F\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u7C21\u5358\u306B\u8B58\u5225\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u3089\u306F "),vs=c(U,"CODE",{});var rl=f(vs);hs=n(rl,"matplotlib.pyplot"),rl.forEach(e),yt=n(U,", "),cs=c(U,"CODE",{});var Xt=f(cs);Ae=n(Xt,"pandas"),Xt.forEach(e),fa=n(U,", "),et=c(U,"CODE",{});var pl=f(et);tt=n(pl,"sklearn"),pl.forEach(e),ma=n(U," \u3067\u6700\u3082\u983B\u7E41\u306B\u4F7F\u7528\u3055\u308C\u308B import \u540D\u3067\u3001\u5F8C\u8005\u306E fit/predict \u306E\u30D1\u30BF\u30FC\u30F3\u3082\u540C\u69D8\u3067\u3059\u3002\u3053\u308C\u3089\u3092\u305D\u308C\u305E\u308C1\u3064\u306E\u30C8\u30FC\u30AF\u30F3\u3068\u3057\u3066\u8868\u73FE\u3059\u308C\u3070\u3001\u5165\u529B\u5217\u306E\u4E2D\u306B\u305D\u308C\u3089\u304C\u3042\u308B\u304B\u3069\u3046\u304B\u3092\u7C21\u5358\u306B\u30C1\u30A7\u30C3\u30AF\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u30C8\u30FC\u30AF\u30F3\u306F\u534A\u89D2\u30B9\u30DA\u30FC\u30B9\u3092\u524D\u306B\u6301\u3064\u3053\u3068\u304C\u3067\u304D\u308B\u306E\u3067\u3001\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u306E\u8A9E\u5F59\u306E\u4E2D\u306B\u305D\u308C\u3089\u306E\u304C\u3042\u308B\u304B\u3069\u3046\u304B\u3082\u30C1\u30A7\u30C3\u30AF\u3059\u308B\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002\u52D5\u4F5C\u78BA\u8A8D\u306E\u305F\u3081\u3001\u8907\u6570\u306E\u30C8\u30FC\u30AF\u30F3\u306B\u5206\u5272\u3055\u308C\u308B\u306F\u305A\u306E\u30C6\u30B9\u30C8\u30C8\u30FC\u30AF\u30F3\u30921\u3064\u8FFD\u52A0\u3057\u3066\u307F\u307E\u3059\u3002"),U.forEach(e),vt=u(a),v(Ds.$$.fragment,a),as=u(a),v(Me.$$.fragment,a),at=u(a),fs=c(a,"P",{});var ol=f(fs);ua=n(ol,"\u7D20\u6674\u3089\u3057\u3044\uFF01\u3046\u307E\u304F\u3044\u3063\u305F\u3088\u3046\u3067\u3059\u306D\u3002"),ol.forEach(e),Cs=u(a),Ge=c(a,"P",{});var Kt=f(Ge);da=n(Kt,"\u5165\u529B\u30B7\u30FC\u30B1\u30F3\u30B9\u3001\u30ED\u30B8\u30C3\u30C8\u3001\u305D\u3057\u3066\u5148\u307B\u3069\u9078\u629E\u3057\u305F\u30AD\u30FC\u30C8\u30FC\u30AF\u30F3\u3092\u5165\u529B\u3068\u3059\u308B\u30AB\u30B9\u30BF\u30E0\u640D\u5931\u95A2\u6570\u3092\u66F8\u304F\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u307E\u305A\u3001\u30ED\u30B8\u30C3\u30C8\u3068\u5165\u529B\u306E\u4F4D\u7F6E\u3092\u5408\u308F\u305B\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u5165\u529B\u5217\u3092\u53F3\u306B1\u3064\u30B7\u30D5\u30C8\u3057\u305F\u3082\u306E\u304C\u30E9\u30D9\u30EB\u3068\u306A\u308A\u3001\u6B21\u306E\u30C8\u30FC\u30AF\u30F3\u304C\u73FE\u5728\u306E\u30C8\u30FC\u30AF\u30F3\u306E\u30E9\u30D9\u30EB\u3068\u306A\u308A\u307E\u3059\u3002\u3053\u308C\u306F\u5165\u529B\u30B7\u30FC\u30B1\u30F3\u30B9\u306E2\u756A\u76EE\u306E\u30C8\u30FC\u30AF\u30F3\u304B\u3089\u30E9\u30D9\u30EB\u3092\u958B\u59CB\u3059\u308B\u3053\u3068\u3067\u5B9F\u73FE\u3067\u304D\u307E\u3059\u3002\u306A\u305C\u306A\u3089\u3001\u30E2\u30C7\u30EB\u306F\u6700\u521D\u306E\u30C8\u30FC\u30AF\u30F3\u306B\u5BFE\u3057\u3066\u3044\u305A\u308C\u306B\u3057\u3066\u3082\u4E88\u6E2C\u3092\u884C\u308F\u306A\u3044\u304B\u3089\u3067\u3059\u3002\u305D\u3057\u3066\u3001\u6700\u5F8C\u306E\u30ED\u30B8\u30C3\u30C8\u3092\u5207\u308A\u6368\u3066\u307E\u3059\u3002\u306A\u305C\u306A\u3089\u3001\u5168\u5165\u529B\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u5F8C\u306B\u306F\u5BFE\u5FDC\u3059\u308B\u30E9\u30D9\u30EB\u304C\u306A\u3044\u304B\u3089\u3067\u3059\u3002\u3053\u308C\u3067\u30B5\u30F3\u30D7\u30EB\u3054\u3068\u306E\u640D\u5931\u3092\u8A08\u7B97\u3057\u3001\u5404\u30B5\u30F3\u30D7\u30EB\u306B\u304A\u3051\u308B\u5168\u3066\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u306E\u51FA\u73FE\u3092\u30AB\u30A6\u30F3\u30C8\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u6700\u5F8C\u306B\u3001\u51FA\u73FE\u56DE\u6570\u3092\u91CD\u307F\u3068\u3057\u3066\u3001\u5168\u30B5\u30F3\u30D7\u30EB\u306E\u52A0\u91CD\u5E73\u5747\u3092\u8A08\u7B97\u3057\u307E\u3059\u3002\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u6301\u305F\u306A\u3044\u30B5\u30F3\u30D7\u30EB\u3092\u5168\u3066\u6368\u3066\u305F\u304F\u306A\u3044\u306E\u3067\u3001\u91CD\u307F\u306B1\u3092\u52A0\u3048\u307E\u3059\u3002"),Kt.forEach(e),lt=u(a),v(ms.$$.fragment,a),qt=u(a),ee=c(a,"P",{});var il=f(ee);os=n(il,"\u3053\u306E\u7D20\u6674\u3089\u3057\u3044\u65B0\u3057\u3044\u640D\u5931\u95A2\u6570\u3092\u4F7F\u3063\u305F\u5B66\u7FD2\u3092\u59CB\u3081\u308B\u524D\u306B\u3001\u3044\u304F\u3064\u304B\u306E\u3053\u3068\u3092\u6E96\u5099\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),il.forEach(e),Et=u(a),ls=c(a,"UL",{});var Ye=f(ls);nt=c(Ye,"LI",{});var Ma=f(nt);ha=n(Ma,"\u30C7\u30FC\u30BF\u3092\u30ED\u30FC\u30C9\u3057\u3066\u30D0\u30C3\u30C1\u306B\u3059\u308B\u305F\u3081\u306E\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u304C\u5FC5\u8981\u3067\u3059\u3002"),Ma.forEach(e),rt=u(Ye),pt=c(Ye,"LI",{});var js=f(pt);$a=n(js,"\u91CD\u307F\u6E1B\u8870\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u8A2D\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),js.forEach(e),te=u(Ye),ot=c(Ye,"LI",{});var gs=f(ot);ba=n(gs,"\u6642\u6298\u3001\u8A55\u4FA1\u3092\u884C\u3044\u305F\u3044\u306E\u3067\u3001\u8A55\u4FA1\u30B3\u30FC\u30C9\u3092\u95A2\u6570\u3067\u30E9\u30C3\u30D7\u3059\u308B\u306E\u306F\u7406\u306B\u304B\u306A\u3063\u3066\u3044\u307E\u3059\u3002"),gs.forEach(e),Ye.forEach(e),it=u(a),Q=c(a,"P",{});var Ps=f(Q);ka=n(Ps,`\u307E\u305A\u306F\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u304B\u3089\u59CB\u3081\u307E\u3057\u3087\u3046\u3002
\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3092 `),ae=c(Ps,"CODE",{});var ve=f(ae);ja=n(ve,'"torch"'),ve.forEach(e),ga=n(Ps," \u306B\u8A2D\u5B9A\u3059\u308B\u3060\u3051\u3067\u3001\u3042\u3068\u306F\u9069\u5207\u306A\u30D0\u30C3\u30C1\u30B5\u30A4\u30BA\u3067 PyTorch \u306E "),Fe=c(Ps,"CODE",{});var _l=f(Fe);le=n(_l,"DataLoader"),_l.forEach(e),xt=n(Ps," \u306B\u6E21\u305B\u3070\u3044\u3044\u306E\u3067\u3059\u3002"),Ps.forEach(e),ne=u(a),v(re.$$.fragment,a),_t=u(a),$s=c(a,"P",{});var Vt=f($s);zt=n(Vt,`\u6B21\u306B\u3001\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u30B0\u30EB\u30FC\u30D7\u5316\u3057\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u304C\u3069\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u8FFD\u52A0\u306E\u91CD\u307F\u6E1B\u8870\u3092\u5F97\u308B\u304B\u3092\u77E5\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u901A\u5E38\u3001\u3059\u3079\u3066\u306E\u30D0\u30A4\u30A2\u30B9\u3068LayerNorm\u306E\u91CD\u307F\u9805\u306F\u3001\u3053\u306E\u5BFE\u8C61\u304B\u3089\u9664\u5916\u3055\u308C\u307E\u3059\u3002
\u4EE5\u4E0B\u306E\u3088\u3046\u306B\u306A\u308A\u307E\u3059\u3002`),Vt.forEach(e),Os=u(a),v(As.$$.fragment,a),pe=u(a),Le=c(a,"P",{});var cl=f(Le);Pt=n(cl,"\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u4E2D\u306B\u5B9A\u671F\u7684\u306B\u691C\u8A3C\u30BB\u30C3\u30C8\u3067\u30E2\u30C7\u30EB\u3092\u8A55\u4FA1\u3057\u305F\u3044\u306E\u3067\u3001\u305D\u306E\u305F\u3081\u306E\u95A2\u6570\u3082\u66F8\u3044\u3066\u304A\u304D\u307E\u3057\u3087\u3046\u3002\u3053\u306E\u95A2\u6570\u306F\u3001\u8A55\u4FA1\u7528\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u3092\u5B9F\u884C\u3057\u3001\u30D7\u30ED\u30BB\u30B9\u9593\u306E\u640D\u5931\u3092\u3059\u3079\u3066\u53CE\u96C6\u3059\u308B\u3060\u3051\u3067\u3059\u3002"),cl.forEach(e),Ms=u(a),v(Gs.$$.fragment,a),oe=u(a),qs=c(a,"P",{});var kt=f(qs);Ie=c(kt,"CODE",{});var Ga=f(Ie);ie=n(Ga,"evaluate()"),Ga.forEach(e),Tt=n(kt,"\u95A2\u6570\u306B\u3088\u308A\u3001\u640D\u5931\u3068"),bs=c(kt,"A",{href:!0});var qe=f(bs);Dt=n(qe,"\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3"),qe.forEach(e),Ne=n(kt,"\u3092\u4E00\u5B9A\u6642\u9593\u3054\u3068\u306B\u5831\u544A\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u6B21\u306B\u3001\u3082\u3046\u4E00\u5EA6\u30BC\u30ED\u304B\u3089\u5B66\u7FD2\u3059\u308B\u305F\u3081\u306B\u3001\u30E2\u30C7\u30EB\u3092\u518D\u5B9A\u7FA9\u3057\u307E\u3059\u3002"),kt.forEach(e),Ct=u(a),v(Fs.$$.fragment,a),_e=u(a),He=c(a,"P",{});var fl=f(He);Ot=n(fl,"\u6B21\u306B\u3001\u5148\u307B\u3069\u306E\u95A2\u6570\u3092\u4F7F\u3063\u3066\u3001\u91CD\u307F\u6E1B\u8870\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u5206\u5272\u3057\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002"),fl.forEach(e),Ls=u(a),v(Is.$$.fragment,a),Ns=u(a),ce=c(a,"P",{});var Yt=f(ce);Hs=n(Yt,"\u305D\u308C\u3067\u306F\u3001\u30E2\u30C7\u30EB\u3001\u30AA\u30D7\u30C6\u30A3\u30DE\u30A4\u30B6\u3001\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u3092\u6E96\u5099\u3057\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u958B\u59CB\u3057\u307E\u3057\u3087\u3046\u3002"),Yt.forEach(e),ct=u(a),v(ks.$$.fragment,a),At=u(a),v(Ss.$$.fragment,a),Rs=u(a),us=c(a,"P",{});var Ze=f(us);fe=n(Ze,"\u3053\u308C\u3067 "),Se=c(Ze,"CODE",{});var ml=f(Se);me=n(ml,"train_dataloader"),ml.forEach(e),ft=n(Ze," \u3092 "),mt=c(Ze,"CODE",{});var Fa=f(mt);wa=n(Fa,"accelerator.prepare()"),Fa.forEach(e),Mt=n(Ze," \u306B\u9001\u3063\u305F\u306E\u3067\u3001\u305D\u306E\u9577\u3055\u3092\u7528\u3044\u3066\u5B66\u7FD2\u30B9\u30C6\u30C3\u30D7\u6570\u3092\u8A08\u7B97\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u306E\u9577\u3055\u3092\u5909\u66F4\u3059\u308B\u306E\u3067\u3001\u5E38\u306B\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u3092\u6E96\u5099\u3057\u305F\u5F8C\u306B\u884C\u3046\u5FC5\u8981\u304C\u3042\u308B\u3053\u3068\u3092\u5FD8\u308C\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\u3053\u3053\u3067\u306F\u3001\u5B66\u7FD2\u7387\u304B\u30890\u307E\u3067\u306E\u53E4\u5178\u7684\u306A\u7DDA\u5F62\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002"),Ze.forEach(e),Bs=u(a),v(ue.$$.fragment,a),ut=u(a),Z=c(a,"P",{});var ps=f(Z);Gt=n(ps,"\u6700\u5F8C\u306B\u3001\u79C1\u305F\u3061\u306E\u30E2\u30C7\u30EB\u3092\u30CF\u30D6\u306B\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u305F\u3081\u306B\u3001\u4F5C\u696D\u30D5\u30A9\u30EB\u30C0\u306B "),Us=c(ps,"CODE",{});var Zt=f(Us);ya=n(Zt,"Repository"),Zt.forEach(e),Ft=n(ps," \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u4F5C\u6210\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u307E\u305A\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6 \u306B\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u307E\u3060\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u306A\u3044\u5834\u5408\uFF09\u3002\u30E2\u30C7\u30EB\u306B\u4ED8\u4E0E\u3057\u305F\u3044\u30E2\u30C7\u30EB ID \u304B\u3089\u30EA\u30DD\u30B8\u30C8\u30EA\u540D\u3092\u6C7A\u5B9A\u3057\u307E\u3059\uFF08"),ns=c(ps,"CODE",{});var ul=f(ns);va=n(ul,"repo_name"),ul.forEach(e),Re=n(ps," \u3092\u81EA\u7531\u306B\u7F6E\u304D\u63DB\u3048\u3066\u304F\u3060\u3055\u3044\u3002\u3053\u308C\u306F\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u3001\u95A2\u6570 "),dt=c(ps,"CODE",{});var dl=f(dt);qa=n(dl,"get_full_repo_name()"),dl.forEach(e),ht=n(ps," \u304C\u884C\u3063\u3066\u3044\u308B\u4E8B\u3067\u3059)\u3002"),ps.forEach(e),Lt=u(a),v(de.$$.fragment,a),Be=u(a),v(he.$$.fragment,a),It=u(a),$e=c(a,"P",{});var Jt=f($e);Es=n(Jt,"\u305D\u3057\u3066\u3001\u305D\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u30ED\u30FC\u30AB\u30EB\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u30AF\u30ED\u30FC\u30F3\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u306E\u3067\u3042\u308C\u3070\u3001\u3053\u306E\u30ED\u30FC\u30AB\u30EB\u30D5\u30A9\u30EB\u30C0\u30FC\u306F\u4F5C\u696D\u4E2D\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u65E2\u5B58\u306E\u30AF\u30ED\u30FC\u30F3\u3067\u3042\u308B\u3079\u304D\u3067\u3059\u3002"),Jt.forEach(e),Ws=u(a),v(Ue.$$.fragment,a),Nt=u(a),rs=c(a,"P",{});var Je=f(rs);al=n(Je,"\u3053\u308C\u3067 "),We=c(Je,"CODE",{});var hl=f(We);Xe=n(hl,"repo.push_to_hub()"),hl.forEach(e),Ea=n(Je," \u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u3067\u3001"),Ke=c(Je,"CODE",{});var La=f(Ke);be=n(La,"output_dir"),La.forEach(e),Ht=n(Je," \u306B\u4FDD\u5B58\u3057\u305F\u3082\u306E\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3067\u304D\u308B\u3088\u3046\u306B\u306A\u308A\u307E\u3057\u305F\u3002\u3053\u308C\u306B\u3088\u308A\u3001\u5404\u30A8\u30DD\u30C3\u30AF\u7D42\u4E86\u6642\u306B\u4E2D\u9593\u30E2\u30C7\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Je.forEach(e),Xs=u(a),ke=c(a,"P",{});var ws=f(ke);Ks=n(ws,"\u5B66\u7FD2\u3059\u308B\u524D\u306B\u3001\u8A55\u4FA1\u95A2\u6570\u304C\u6B63\u3057\u304F\u52D5\u4F5C\u3059\u308B\u304B\u3069\u3046\u304B\u3001\u7C21\u5358\u306A\u30C6\u30B9\u30C8\u3092\u5B9F\u884C\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),ws.forEach(e),St=u(a),v(xs.$$.fragment,a),Rt=u(a),v(je.$$.fragment,a),$t=u(a),Y=c(a,"P",{});var is=f(Y);xa=n(is,"\u640D\u5931\u3068\u30D1\u30FC\u30D7\u30EC\u30AD\u30B7\u30C6\u30A3\u306F\u975E\u5E38\u306B\u9AD8\u3044\u5024\u3067\u3059\u304C\u3001\u307E\u3060\u30E2\u30C7\u30EB\u3092\u8A13\u7DF4\u3057\u3066\u3044\u306A\u3044\u306E\u3067\u9A5A\u304F\u3053\u3068\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u3053\u308C\u3067\u3001\u5B66\u7FD2\u30B9\u30AF\u30EA\u30D7\u30C8\u306E\u6838\u3068\u306A\u308B\u90E8\u5206\u3001\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u66F8\u304F\u6E96\u5099\u304C\u6574\u3044\u307E\u3057\u305F\u3002\u5B66\u7FD2\u30EB\u30FC\u30D7\u3067\u306F\u3001\u30C7\u30FC\u30BF\u30ED\u30FC\u30C0\u30FC\u3092\u7E70\u308A\u8FD4\u3057\u51E6\u7406\u3057\u3001\u305D\u306E\u30D0\u30C3\u30C1\u3092\u30E2\u30C7\u30EB\u306B\u6E21\u3057\u307E\u3059\u3002\u30ED\u30B8\u30C3\u30C8\u3092\u53D6\u5F97\u3059\u308B\u3053\u3068\u3067\u3001\u72EC\u81EA\u306E\u640D\u5931\u95A2\u6570\u3092\u8A55\u4FA1\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u640D\u5931\u306F\u52FE\u914D\u7D2F\u7A4D\u306E\u30B9\u30C6\u30C3\u30D7\u6570\u3067\u30B9\u30B1\u30FC\u30EA\u30F3\u30B0\u3057\u3001\u3088\u308A\u591A\u304F\u306E\u30B9\u30C6\u30C3\u30D7\u3092\u96C6\u7D04\u3059\u308B\u969B\u306B\u5927\u304D\u306A\u640D\u5931\u304C\u751F\u3058\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u307E\u305F\u3001\u6700\u9069\u5316\u3059\u308B\u524D\u306B\u3001\u53CE\u675F\u3092\u826F\u304F\u3059\u308B\u305F\u3081\u306B\u52FE\u914D\u3092\u5207\u308A\u53D6\u308A\u307E\u3059\u3002\u6700\u5F8C\u306B\u3001\u6570\u30B9\u30C6\u30C3\u30D7\u3054\u3068\u306B\u3001\u65B0\u3057\u3044 "),ge=c(is,"CODE",{});var jt=f(ge);za=n(jt,"evaluate()"),jt.forEach(e),Pa=n(is," \u95A2\u6570\u3092\u7528\u3044\u3066\u3001\u8A55\u4FA1\u30BB\u30C3\u30C8\u3067\u30E2\u30C7\u30EB\u3092\u8A55\u4FA1\u3057\u307E\u3059\u3002"),is.forEach(e),we=u(a),v(ye.$$.fragment,a),Bt=u(a),Vs=c(a,"P",{});var gt=f(Vs);Ta=n(gt,`\u3053\u308C\u3067\u5B8C\u4E86\u3067\u3059\u3002
\u8CB4\u65B9\u306FGPT-2\u306E\u3088\u3046\u306A\u56E0\u679C\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u305F\u3081\u306E\u30AB\u30B9\u30BF\u30E0\u5B66\u7FD2\u30EB\u30FC\u30D7\u3092\u4F5C\u6210\u3067\u304D\u308B\u3088\u3046\u306B\u306A\u308A\u3001\u66F4\u306B\u30CB\u30FC\u30BA\u306B\u5408\u308F\u305B\u3066\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002`),gt.forEach(e),Ut=u(a),v(Ys.$$.fragment,a),Zs=u(a),v(Js.$$.fragment,a),this.h()},h(){S(d,"id","accelerate"),S(d,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),S(d,"href","#accelerate"),S(r,"class","relative group"),S(bs,"href","/course/ja/chapter7/3")},m(a,k){p(a,r,k),t(r,d),t(d,o),q(h,o,null),t(r,x),t(r,g),t(g,P),p(a,T,k),p(a,w,k),t(w,C),t(w,A),t(A,L),t(w,$),p(a,G,k),q(I,a,k),p(a,W,k),p(a,F,k),t(F,R),t(F,X),t(X,z),t(F,N),t(F,H),t(H,K),t(F,J),t(F,V),t(V,ts),t(F,_s),t(F,O),t(O,B),t(F,Ce),t(F,ds),t(ds,Oe),t(F,Ts),t(F,vs),t(vs,hs),t(F,yt),t(F,cs),t(cs,Ae),t(F,fa),t(F,et),t(et,tt),t(F,ma),p(a,vt,k),q(Ds,a,k),p(a,as,k),q(Me,a,k),p(a,at,k),p(a,fs,k),t(fs,ua),p(a,Cs,k),p(a,Ge,k),t(Ge,da),p(a,lt,k),q(ms,a,k),p(a,qt,k),p(a,ee,k),t(ee,os),p(a,Et,k),p(a,ls,k),t(ls,nt),t(nt,ha),t(ls,rt),t(ls,pt),t(pt,$a),t(ls,te),t(ls,ot),t(ot,ba),p(a,it,k),p(a,Q,k),t(Q,ka),t(Q,ae),t(ae,ja),t(Q,ga),t(Q,Fe),t(Fe,le),t(Q,xt),p(a,ne,k),q(re,a,k),p(a,_t,k),p(a,$s,k),t($s,zt),p(a,Os,k),q(As,a,k),p(a,pe,k),p(a,Le,k),t(Le,Pt),p(a,Ms,k),q(Gs,a,k),p(a,oe,k),p(a,qs,k),t(qs,Ie),t(Ie,ie),t(qs,Tt),t(qs,bs),t(bs,Dt),t(qs,Ne),p(a,Ct,k),q(Fs,a,k),p(a,_e,k),p(a,He,k),t(He,Ot),p(a,Ls,k),q(Is,a,k),p(a,Ns,k),p(a,ce,k),t(ce,Hs),p(a,ct,k),q(ks,a,k),p(a,At,k),q(Ss,a,k),p(a,Rs,k),p(a,us,k),t(us,fe),t(us,Se),t(Se,me),t(us,ft),t(us,mt),t(mt,wa),t(us,Mt),p(a,Bs,k),q(ue,a,k),p(a,ut,k),p(a,Z,k),t(Z,Gt),t(Z,Us),t(Us,ya),t(Z,Ft),t(Z,ns),t(ns,va),t(Z,Re),t(Z,dt),t(dt,qa),t(Z,ht),p(a,Lt,k),q(de,a,k),p(a,Be,k),q(he,a,k),p(a,It,k),p(a,$e,k),t($e,Es),p(a,Ws,k),q(Ue,a,k),p(a,Nt,k),p(a,rs,k),t(rs,al),t(rs,We),t(We,Xe),t(rs,Ea),t(rs,Ke),t(Ke,be),t(rs,Ht),p(a,Xs,k),p(a,ke,k),t(ke,Ks),p(a,St,k),q(xs,a,k),p(a,Rt,k),q(je,a,k),p(a,$t,k),p(a,Y,k),t(Y,xa),t(Y,ge),t(ge,za),t(Y,Pa),p(a,we,k),q(ye,a,k),p(a,Bt,k),p(a,Vs,k),t(Vs,Ta),p(a,Ut,k),q(Ys,a,k),p(a,Zs,k),q(Js,a,k),Qs=!0},i(a){Qs||(b(h.$$.fragment,a),b(I.$$.fragment,a),b(Ds.$$.fragment,a),b(Me.$$.fragment,a),b(ms.$$.fragment,a),b(re.$$.fragment,a),b(As.$$.fragment,a),b(Gs.$$.fragment,a),b(Fs.$$.fragment,a),b(Is.$$.fragment,a),b(ks.$$.fragment,a),b(Ss.$$.fragment,a),b(ue.$$.fragment,a),b(de.$$.fragment,a),b(he.$$.fragment,a),b(Ue.$$.fragment,a),b(xs.$$.fragment,a),b(je.$$.fragment,a),b(ye.$$.fragment,a),b(Ys.$$.fragment,a),b(Js.$$.fragment,a),Qs=!0)},o(a){j(h.$$.fragment,a),j(I.$$.fragment,a),j(Ds.$$.fragment,a),j(Me.$$.fragment,a),j(ms.$$.fragment,a),j(re.$$.fragment,a),j(As.$$.fragment,a),j(Gs.$$.fragment,a),j(Fs.$$.fragment,a),j(Is.$$.fragment,a),j(ks.$$.fragment,a),j(Ss.$$.fragment,a),j(ue.$$.fragment,a),j(de.$$.fragment,a),j(he.$$.fragment,a),j(Ue.$$.fragment,a),j(xs.$$.fragment,a),j(je.$$.fragment,a),j(ye.$$.fragment,a),j(Ys.$$.fragment,a),j(Js.$$.fragment,a),Qs=!1},d(a){a&&e(r),E(h),a&&e(T),a&&e(w),a&&e(G),E(I,a),a&&e(W),a&&e(F),a&&e(vt),E(Ds,a),a&&e(as),E(Me,a),a&&e(at),a&&e(fs),a&&e(Cs),a&&e(Ge),a&&e(lt),E(ms,a),a&&e(qt),a&&e(ee),a&&e(Et),a&&e(ls),a&&e(it),a&&e(Q),a&&e(ne),E(re,a),a&&e(_t),a&&e($s),a&&e(Os),E(As,a),a&&e(pe),a&&e(Le),a&&e(Ms),E(Gs,a),a&&e(oe),a&&e(qs),a&&e(Ct),E(Fs,a),a&&e(_e),a&&e(He),a&&e(Ls),E(Is,a),a&&e(Ns),a&&e(ce),a&&e(ct),E(ks,a),a&&e(At),E(Ss,a),a&&e(Rs),a&&e(us),a&&e(Bs),E(ue,a),a&&e(ut),a&&e(Z),a&&e(Lt),E(de,a),a&&e(Be),E(he,a),a&&e(It),a&&e($e),a&&e(Ws),E(Ue,a),a&&e(Nt),a&&e(rs),a&&e(Xs),a&&e(ke),a&&e(St),E(xs,a),a&&e(Rt),E(je,a),a&&e($t),a&&e(Y),a&&e(we),E(ye,a),a&&e(Bt),a&&e(Vs),a&&e(Ut),E(Ys,a),a&&e(Zs),E(Js,a)}}}function Kp(M){let r,d,o,h,x;return{c(){r=_("p"),d=l("\u{1F6A8} TPU\u3067\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u8A18\u306E\u30BB\u30EB\u304B\u3089\u59CB\u307E\u308B\u30B3\u30FC\u30C9\u3092\u5168\u3066\u5C02\u7528\u306E\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u95A2\u6570\u306B\u79FB\u52D5\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u8A73\u3057\u304F\u306F"),o=_("a"),h=l("\u7B2C3\u7AE0"),x=l("\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),this.h()},l(g){r=c(g,"P",{});var P=f(r);d=n(P,"\u{1F6A8} TPU\u3067\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u8A18\u306E\u30BB\u30EB\u304B\u3089\u59CB\u307E\u308B\u30B3\u30FC\u30C9\u3092\u5168\u3066\u5C02\u7528\u306E\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u95A2\u6570\u306B\u79FB\u52D5\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u8A73\u3057\u304F\u306F"),o=c(P,"A",{href:!0});var T=f(o);h=n(T,"\u7B2C3\u7AE0"),T.forEach(e),x=n(P,"\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),P.forEach(e),this.h()},h(){S(o,"href","/course/ja/chapter3")},m(g,P){p(g,r,P),t(r,d),t(r,o),t(o,h),t(r,x)},d(g){g&&e(r)}}}function Vp(M){let r;return{c(){r=l("\u270F\uFE0F **\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01** \u7528\u9014\u306B\u5408\u308F\u305B\u305F\u72EC\u81EA\u306E\u640D\u5931\u95A2\u6570\u3092\u4F5C\u6210\u3059\u308B\u304B\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30EB\u30FC\u30D7\u306B\u5225\u306E\u30AB\u30B9\u30BF\u30E0\u30B9\u30C6\u30C3\u30D7\u3092\u8FFD\u52A0\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002")},l(d){r=n(d,"\u270F\uFE0F **\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01** \u7528\u9014\u306B\u5408\u308F\u305B\u305F\u72EC\u81EA\u306E\u640D\u5931\u95A2\u6570\u3092\u4F5C\u6210\u3059\u308B\u304B\u3001\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u30EB\u30FC\u30D7\u306B\u5225\u306E\u30AB\u30B9\u30BF\u30E0\u30B9\u30C6\u30C3\u30D7\u3092\u8FFD\u52A0\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002")},m(d,o){p(d,r,o)},d(d){d&&e(r)}}}function Yp(M){let r,d,o,h,x;return{c(){r=_("p"),d=l("\u270F\uFE0F "),o=_("strong"),h=l("\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),x=l(" \u9577\u6642\u9593\u306B\u53CA\u3076\u5B66\u7FD2\u5B9F\u9A13\u3092\u884C\u3046\u5834\u5408\u3001TensorBoard\u3084Weights & Biases\u306A\u3069\u306E\u30C4\u30FC\u30EB\u3092\u4F7F\u3063\u3066\u91CD\u8981\u306A\u6307\u6A19\u3092\u8A18\u9332\u3057\u3066\u304A\u304F\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002\u5B66\u7FD2\u30EB\u30FC\u30D7\u306B\u9069\u5207\u306A\u30ED\u30B0\u3092\u8FFD\u52A0\u3059\u308B\u3053\u3068\u3067\u3001\u5B66\u7FD2\u304C\u3069\u306E\u3088\u3046\u306B\u9032\u3093\u3067\u3044\u308B\u304B\u3092\u5E38\u306B\u78BA\u8A8D\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002")},l(g){r=c(g,"P",{});var P=f(r);d=n(P,"\u270F\uFE0F "),o=c(P,"STRONG",{});var T=f(o);h=n(T,"\u3042\u306A\u305F\u306E\u756A\u3067\u3059\uFF01"),T.forEach(e),x=n(P," \u9577\u6642\u9593\u306B\u53CA\u3076\u5B66\u7FD2\u5B9F\u9A13\u3092\u884C\u3046\u5834\u5408\u3001TensorBoard\u3084Weights & Biases\u306A\u3069\u306E\u30C4\u30FC\u30EB\u3092\u4F7F\u3063\u3066\u91CD\u8981\u306A\u6307\u6A19\u3092\u8A18\u9332\u3057\u3066\u304A\u304F\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002\u5B66\u7FD2\u30EB\u30FC\u30D7\u306B\u9069\u5207\u306A\u30ED\u30B0\u3092\u8FFD\u52A0\u3059\u308B\u3053\u3068\u3067\u3001\u5B66\u7FD2\u304C\u3069\u306E\u3088\u3046\u306B\u9032\u3093\u3067\u3044\u308B\u304B\u3092\u5E38\u306B\u78BA\u8A8D\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),P.forEach(e)},m(g,P){p(g,r,P),t(r,d),t(r,o),t(o,h),t(r,x)},d(g){g&&e(r)}}}function Zp(M){let r,d,o,h,x,g,P,T,w,C,A,L,$,G,I,W,F,R,X,z,N,H,K,J,V,ts,_s,O,B,Ce,ds,Oe,Ts,vs,hs,yt,cs,Ae,fa,et,tt,ma,vt,Ds,as,Me,at,fs,ua,Cs,Ge,da,lt,ms,qt,ee,os,Et,ls,nt,ha,rt,pt,$a,te,ot,ba,it,Q,ka,ae,ja,ga,Fe,le,xt,ne,re,_t,$s,zt,Os,As,pe,Le,Pt,Ms,Gs,oe,qs,Ie,ie,Tt,bs,Dt,Ne,Ct,Fs,_e,He,Ot,Ls,Is,Ns,ce,Hs,ct,ks,At,Ss,Rs,us,fe,Se,me,ft,mt,wa,Mt,Bs,ue,ut,Z,Gt,Us,ya,Ft,ns,va,Re,dt,qa,ht,Lt,de,Be,he,It,$e,Es,Ws,Ue,Nt,rs,al,We,Xe,Ea,Ke,be,Ht,Xs,ke,Ks,St,xs,Rt,je,$t,Y,xa,ge,za,Pa,we,ye,Bt,Vs,Ta,Ut,Ys,Zs,Js,Qs,a,k,ll,Da,bt,Wt,Ca,U,Oa,Ve,nl,Aa,zs,rl,Xt,pl,ol,Kt,il,Ye,Ma,js,gs,Ps,ve,_l,Vt,cl,kt,Ga,qe,fl,Yt,Ze,ml,Fa,ps,Zt,ul,dl,Jt,Je,hl,La,ws,is,jt,gt,An,Vl,Ia,Yl,Ee,xe,$l,bl,Mn,Zl,kl,Qt,Jl,jl,Gn,Ql,gl,Fn,sn,Na,en,wl,Ln,tn,yl,In,an,Ha,ln,ze,Pe,vl,sa,nn,ea,rn,Sa,Nn,pn,ta,Hn,Gl,Sn,Rn,on,Te,De,ql,El,Bn,_n,Ra,cn,Ba,fn,Qe,Un,Fl,Wn,Xn,Ll,Kn,Vn,mn,Ua,un,Wa,dn,xl,Yn,hn,se,Zn,Il,Jn,Qn,Nl,sr,er,Hl,tr,ar,$n,Xa,bn,Ka,kn,aa,lr,Sl,nr,rr,jn,Va,gn,Ya,wn,zl,Pl,yn;o=new Ep({props:{fw:M[0]}});const _r=[zp,xp],Za=[];function cr(s,i){return s[0]==="pt"?0:1}T=cr(M),w=Za[T]=_r[T](M),hs=new ir({props:{id:"Vpjb1lu0MDk"}}),le=new D({props:{code:`def any_keyword_in_string(string, keywords):
    for keyword in keywords:
        if keyword in string:
            return True
    return False`,highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">any_keyword_in_string</span>(<span class="hljs-params">string, keywords</span>):
    <span class="hljs-keyword">for</span> keyword <span class="hljs-keyword">in</span> keywords:
        <span class="hljs-keyword">if</span> keyword <span class="hljs-keyword">in</span> string:
            <span class="hljs-keyword">return</span> <span class="hljs-literal">True</span>
    <span class="hljs-keyword">return</span> <span class="hljs-literal">False</span>`}}),$s=new D({props:{code:`filters = ["pandas", "sklearn", "matplotlib", "seaborn"]
example_1 = "import numpy as np"
example_2 = "import pandas as pd"

print(
    any_keyword_in_string(example_1, filters), any_keyword_in_string(example_2, filters)
)`,highlighted:`filters = [<span class="hljs-string">&quot;pandas&quot;</span>, <span class="hljs-string">&quot;sklearn&quot;</span>, <span class="hljs-string">&quot;matplotlib&quot;</span>, <span class="hljs-string">&quot;seaborn&quot;</span>]
example_1 = <span class="hljs-string">&quot;import numpy as np&quot;</span>
example_2 = <span class="hljs-string">&quot;import pandas as pd&quot;</span>

<span class="hljs-built_in">print</span>(
    any_keyword_in_string(example_1, filters), any_keyword_in_string(example_2, filters)
)`}}),Os=new D({props:{code:"False True",highlighted:'<span class="hljs-literal">False</span> <span class="hljs-literal">True</span>'}}),Ms=new D({props:{code:`from collections import defaultdict
from tqdm import tqdm
from datasets import Dataset


def filter_streaming_dataset(dataset, filters):
    filtered_dict = defaultdict(list)
    total = 0
    for sample in tqdm(iter(dataset)):
        total += 1
        if any_keyword_in_string(sample["content"], filters):
            for k, v in sample.items():
                filtered_dict[k].append(v)
    print(f"{len(filtered_dict['content'])/total:.2%} of data after filtering.")
    return Dataset.from_dict(filtered_dict)`,highlighted:`<span class="hljs-keyword">from</span> collections <span class="hljs-keyword">import</span> defaultdict
<span class="hljs-keyword">from</span> tqdm <span class="hljs-keyword">import</span> tqdm
<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> Dataset


<span class="hljs-keyword">def</span> <span class="hljs-title function_">filter_streaming_dataset</span>(<span class="hljs-params">dataset, filters</span>):
    filtered_dict = defaultdict(<span class="hljs-built_in">list</span>)
    total = <span class="hljs-number">0</span>
    <span class="hljs-keyword">for</span> sample <span class="hljs-keyword">in</span> tqdm(<span class="hljs-built_in">iter</span>(dataset)):
        total += <span class="hljs-number">1</span>
        <span class="hljs-keyword">if</span> any_keyword_in_string(sample[<span class="hljs-string">&quot;content&quot;</span>], filters):
            <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> sample.items():
                filtered_dict[k].append(v)
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;<span class="hljs-subst">{<span class="hljs-built_in">len</span>(filtered_dict[<span class="hljs-string">&#x27;content&#x27;</span>])/total:<span class="hljs-number">.2</span>%}</span> of data after filtering.&quot;</span>)
    <span class="hljs-keyword">return</span> Dataset.from_dict(filtered_dict)`}}),ie=new D({props:{code:`# This cell will take a very long time to execute, so you should skip it and go to
# the next one!
from datasets import load_dataset

split = "train"  # "valid"
filters = ["pandas", "sklearn", "matplotlib", "seaborn"]

data = load_dataset(f"transformersbook/codeparrot-{split}", split=split, streaming=True)
filtered_data = filter_streaming_dataset(data, filters)`,highlighted:`<span class="hljs-comment"># This cell will take a very long time to execute, so you should skip it and go to</span>
<span class="hljs-comment"># the next one!</span>
<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

split = <span class="hljs-string">&quot;train&quot;</span>  <span class="hljs-comment"># &quot;valid&quot;</span>
filters = [<span class="hljs-string">&quot;pandas&quot;</span>, <span class="hljs-string">&quot;sklearn&quot;</span>, <span class="hljs-string">&quot;matplotlib&quot;</span>, <span class="hljs-string">&quot;seaborn&quot;</span>]

data = load_dataset(<span class="hljs-string">f&quot;transformersbook/codeparrot-<span class="hljs-subst">{split}</span>&quot;</span>, split=split, streaming=<span class="hljs-literal">True</span>)
filtered_data = filter_streaming_dataset(data, filters)`}}),bs=new D({props:{code:"3.26% of data after filtering.",highlighted:'<span class="hljs-number">3.26</span>% of data after filtering.'}}),Ls=new D({props:{code:`from datasets import load_dataset, DatasetDict

ds_train = load_dataset("huggingface-course/codeparrot-ds-train", split="train")
ds_valid = load_dataset("huggingface-course/codeparrot-ds-valid", split="validation")

raw_datasets = DatasetDict(
    {
        "train": ds_train,  # .shuffle().select(range(50000)),
        "valid": ds_valid,  # .shuffle().select(range(500))
    }
)

raw_datasets`,highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, DatasetDict

ds_train = load_dataset(<span class="hljs-string">&quot;huggingface-course/codeparrot-ds-train&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
ds_valid = load_dataset(<span class="hljs-string">&quot;huggingface-course/codeparrot-ds-valid&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)

raw_datasets = DatasetDict(
    {
        <span class="hljs-string">&quot;train&quot;</span>: ds_train,  <span class="hljs-comment"># .shuffle().select(range(50000)),</span>
        <span class="hljs-string">&quot;valid&quot;</span>: ds_valid,  <span class="hljs-comment"># .shuffle().select(range(500))</span>
    }
)

raw_datasets`}}),Ns=new D({props:{code:`DatasetDict({
    train: Dataset({
        features: ['repo_name', 'path', 'copies', 'size', 'content', 'license'],
        num_rows: 606720
    })
    valid: Dataset({
        features: ['repo_name', 'path', 'copies', 'size', 'content', 'license'],
        num_rows: 3322
    })
})`,highlighted:`DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;repo_name&#x27;</span>, <span class="hljs-string">&#x27;path&#x27;</span>, <span class="hljs-string">&#x27;copies&#x27;</span>, <span class="hljs-string">&#x27;size&#x27;</span>, <span class="hljs-string">&#x27;content&#x27;</span>, <span class="hljs-string">&#x27;license&#x27;</span>],
        num_rows: <span class="hljs-number">606720</span>
    })
    valid: Dataset({
        features: [<span class="hljs-string">&#x27;repo_name&#x27;</span>, <span class="hljs-string">&#x27;path&#x27;</span>, <span class="hljs-string">&#x27;copies&#x27;</span>, <span class="hljs-string">&#x27;size&#x27;</span>, <span class="hljs-string">&#x27;content&#x27;</span>, <span class="hljs-string">&#x27;license&#x27;</span>],
        num_rows: <span class="hljs-number">3322</span>
    })
})`}}),Hs=new ca({props:{$$slots:{default:[Pp]},$$scope:{ctx:M}}}),Rs=new D({props:{code:`for key in raw_datasets["train"][0]:
    print(f"{key.upper()}: {raw_datasets['train'][0][key][:200]}")`,highlighted:`<span class="hljs-keyword">for</span> key <span class="hljs-keyword">in</span> raw_datasets[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;<span class="hljs-subst">{key.upper()}</span>: <span class="hljs-subst">{raw_datasets[<span class="hljs-string">&#x27;train&#x27;</span>][<span class="hljs-number">0</span>][key][:<span class="hljs-number">200</span>]}</span>&quot;</span>)`}}),fe=new D({props:{code:`'REPO_NAME: kmike/scikit-learn'
'PATH: sklearn/utils/__init__.py'
'COPIES: 3'
'SIZE: 10094'
'''CONTENT: """
The :mod:\`sklearn.utils\` module includes various utilites.
"""

from collections import Sequence

import numpy as np
from scipy.sparse import issparse
import warnings

from .murmurhash import murm
LICENSE: bsd-3-clause'''`,highlighted:`<span class="hljs-string">&#x27;REPO_NAME: kmike/scikit-learn&#x27;</span>
<span class="hljs-string">&#x27;PATH: sklearn/utils/__init__.py&#x27;</span>
<span class="hljs-string">&#x27;COPIES: 3&#x27;</span>
<span class="hljs-string">&#x27;SIZE: 10094&#x27;</span>
<span class="hljs-string">&#x27;&#x27;&#x27;CONTENT: &quot;&quot;&quot;
The :mod:\`sklearn.utils\` module includes various utilites.
&quot;&quot;&quot;

from collections import Sequence

import numpy as np
from scipy.sparse import issparse
import warnings

from .murmurhash import murm
LICENSE: bsd-3-clause&#x27;&#x27;&#x27;</span>`}}),Z=new ir({props:{id:"ma1TrR7gE7I"}}),be=new D({props:{code:`from transformers import AutoTokenizer

context_length = 128
tokenizer = AutoTokenizer.from_pretrained("huggingface-course/code-search-net-tokenizer")

outputs = tokenizer(
    raw_datasets["train"][:2]["content"],
    truncation=True,
    max_length=context_length,
    return_overflowing_tokens=True,
    return_length=True,
)

print(f"Input IDs length: {len(outputs['input_ids'])}")
print(f"Input chunk lengths: {(outputs['length'])}")
print(f"Chunk mapping: {outputs['overflow_to_sample_mapping']}")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

context_length = <span class="hljs-number">128</span>
tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;huggingface-course/code-search-net-tokenizer&quot;</span>)

outputs = tokenizer(
    raw_datasets[<span class="hljs-string">&quot;train&quot;</span>][:<span class="hljs-number">2</span>][<span class="hljs-string">&quot;content&quot;</span>],
    truncation=<span class="hljs-literal">True</span>,
    max_length=context_length,
    return_overflowing_tokens=<span class="hljs-literal">True</span>,
    return_length=<span class="hljs-literal">True</span>,
)

<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Input IDs length: <span class="hljs-subst">{<span class="hljs-built_in">len</span>(outputs[<span class="hljs-string">&#x27;input_ids&#x27;</span>])}</span>&quot;</span>)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Input chunk lengths: <span class="hljs-subst">{(outputs[<span class="hljs-string">&#x27;length&#x27;</span>])}</span>&quot;</span>)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Chunk mapping: <span class="hljs-subst">{outputs[<span class="hljs-string">&#x27;overflow_to_sample_mapping&#x27;</span>]}</span>&quot;</span>)`}}),Xs=new D({props:{code:`Input IDs length: 34
Input chunk lengths: [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 117, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 41]
Chunk mapping: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]`,highlighted:`Input IDs length: <span class="hljs-number">34</span>
Input chunk lengths: [<span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">117</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">128</span>, <span class="hljs-number">41</span>]
Chunk mapping: [<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>]`}}),Zs=new D({props:{code:`def tokenize(element):
    outputs = tokenizer(
        element["content"],
        truncation=True,
        max_length=context_length,
        return_overflowing_tokens=True,
        return_length=True,
    )
    input_batch = []
    for length, input_ids in zip(outputs["length"], outputs["input_ids"]):
        if length == context_length:
            input_batch.append(input_ids)
    return {"input_ids": input_batch}


tokenized_datasets = raw_datasets.map(
    tokenize, batched=True, remove_columns=raw_datasets["train"].column_names
)
tokenized_datasets`,highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">tokenize</span>(<span class="hljs-params">element</span>):
    outputs = tokenizer(
        element[<span class="hljs-string">&quot;content&quot;</span>],
        truncation=<span class="hljs-literal">True</span>,
        max_length=context_length,
        return_overflowing_tokens=<span class="hljs-literal">True</span>,
        return_length=<span class="hljs-literal">True</span>,
    )
    input_batch = []
    <span class="hljs-keyword">for</span> length, input_ids <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(outputs[<span class="hljs-string">&quot;length&quot;</span>], outputs[<span class="hljs-string">&quot;input_ids&quot;</span>]):
        <span class="hljs-keyword">if</span> length == context_length:
            input_batch.append(input_ids)
    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;input_ids&quot;</span>: input_batch}


tokenized_datasets = raw_datasets.<span class="hljs-built_in">map</span>(
    tokenize, batched=<span class="hljs-literal">True</span>, remove_columns=raw_datasets[<span class="hljs-string">&quot;train&quot;</span>].column_names
)
tokenized_datasets`}}),Qs=new D({props:{code:`DatasetDict({
    train: Dataset({
        features: ['input_ids'],
        num_rows: 16702061
    })
    valid: Dataset({
        features: ['input_ids'],
        num_rows: 93164
    })
})`,highlighted:`DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;input_ids&#x27;</span>],
        num_rows: <span class="hljs-number">16702061</span>
    })
    valid: Dataset({
        features: [<span class="hljs-string">&#x27;input_ids&#x27;</span>],
        num_rows: <span class="hljs-number">93164</span>
    })
})`}}),U=new ca({props:{$$slots:{default:[Tp]},$$scope:{ctx:M}}});const fr=[Cp,Dp],Ja=[];function mr(s,i){return s[0]==="pt"?0:1}js=mr(M),gs=Ja[js]=fr[js](M);const ur=[Ap,Op],Qa=[];function dr(s,i){return s[0]==="pt"?0:1}ws=dr(M),is=Qa[ws]=ur[ws](M),Ia=new D({props:{code:`out = data_collator([tokenized_datasets["train"][i] for i in range(5)])
for key in out:
    print(f"{key} shape: {out[key].shape}")`,highlighted:`out = data_collator([tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>][i] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">5</span>)])
<span class="hljs-keyword">for</span> key <span class="hljs-keyword">in</span> out:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;<span class="hljs-subst">{key}</span> shape: <span class="hljs-subst">{out[key].shape}</span>&quot;</span>)`}});const hr=[Gp,Mp],sl=[];function $r(s,i){return s[0]==="pt"?0:1}Ee=$r(M),xe=sl[Ee]=hr[Ee](M);let ss=M[0]==="tf"&&$p();Qt=new ca({props:{warning:!0,$$slots:{default:[Fp]},$$scope:{ctx:M}}}),Na=new D({props:{code:`from huggingface_hub import notebook_login

notebook_login()`,highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`}}),Ha=new D({props:{code:"huggingface-cli login",highlighted:"huggingface-cli login"}});const br=[Ip,Lp],el=[];function kr(s,i){return s[0]==="pt"?0:1}ze=kr(M),Pe=el[ze]=br[ze](M),sa=new ca({props:{$$slots:{default:[Np]},$$scope:{ctx:M}}}),ea=new ca({props:{$$slots:{default:[Rp]},$$scope:{ctx:M}}});const jr=[Up,Bp],tl=[];function gr(s,i){return s[0]==="pt"?0:1}Te=gr(M),De=tl[Te]=jr[Te](M),Ra=new D({props:{code:`txt = """\\
# create some data
x = np.random.randn(100)
y = np.random.randn(100)

# create scatter plot with x, y
"""
print(pipe(txt, num_return_sequences=1)[0]["generated_text"])`,highlighted:`txt = <span class="hljs-string">&quot;&quot;&quot;\\
# create some data
x = np.random.randn(100)
y = np.random.randn(100)

# create scatter plot with x, y
&quot;&quot;&quot;</span>
<span class="hljs-built_in">print</span>(pipe(txt, num_return_sequences=<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;generated_text&quot;</span>])`}}),Ba=new D({props:{code:`# create some data
x = np.random.randn(100)
y = np.random.randn(100)

# create scatter plot with x, y
plt.scatter(x, y)

# create scatter`,highlighted:`<span class="hljs-comment"># create some data</span>
x = np.random.randn(<span class="hljs-number">100</span>)
y = np.random.randn(<span class="hljs-number">100</span>)

<span class="hljs-comment"># create scatter plot with x, y</span>
plt.scatter(x, y)

<span class="hljs-comment"># create scatter</span>`}}),Ua=new D({props:{code:`txt = """\\
# create some data
x = np.random.randn(100)
y = np.random.randn(100)

# create dataframe from x and y
"""
print(pipe(txt, num_return_sequences=1)[0]["generated_text"])`,highlighted:`txt = <span class="hljs-string">&quot;&quot;&quot;\\
# create some data
x = np.random.randn(100)
y = np.random.randn(100)

# create dataframe from x and y
&quot;&quot;&quot;</span>
<span class="hljs-built_in">print</span>(pipe(txt, num_return_sequences=<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;generated_text&quot;</span>])`}}),Wa=new D({props:{code:`# create some data
x = np.random.randn(100)
y = np.random.randn(100)

# create dataframe from x and y
df = pd.DataFrame({'x': x, 'y': y})
df.insert(0,'x', x)
for`,highlighted:`<span class="hljs-comment"># create some data</span>
x = np.random.randn(<span class="hljs-number">100</span>)
y = np.random.randn(<span class="hljs-number">100</span>)

<span class="hljs-comment"># create dataframe from x and y</span>
df = pd.DataFrame({<span class="hljs-string">&#x27;x&#x27;</span>: x, <span class="hljs-string">&#x27;y&#x27;</span>: y})
df.insert(<span class="hljs-number">0</span>,<span class="hljs-string">&#x27;x&#x27;</span>, x)
<span class="hljs-keyword">for</span>`}}),Xa=new D({props:{code:`txt = """\\
# dataframe with profession, income and name
df = pd.DataFrame({'profession': x, 'income':y, 'name': z})

# calculate the mean income per profession
"""
print(pipe(txt, num_return_sequences=1)[0]["generated_text"])`,highlighted:`txt = <span class="hljs-string">&quot;&quot;&quot;\\
# dataframe with profession, income and name
df = pd.DataFrame({&#x27;profession&#x27;: x, &#x27;income&#x27;:y, &#x27;name&#x27;: z})

# calculate the mean income per profession
&quot;&quot;&quot;</span>
<span class="hljs-built_in">print</span>(pipe(txt, num_return_sequences=<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;generated_text&quot;</span>])`}}),Ka=new D({props:{code:`# dataframe with profession, income and name
df = pd.DataFrame({'profession': x, 'income':y, 'name': z})

# calculate the mean income per profession
profession = df.groupby(['profession']).mean()

# compute the`,highlighted:`<span class="hljs-comment"># dataframe with profession, income and name</span>
df = pd.DataFrame({<span class="hljs-string">&#x27;profession&#x27;</span>: x, <span class="hljs-string">&#x27;income&#x27;</span>:y, <span class="hljs-string">&#x27;name&#x27;</span>: z})

<span class="hljs-comment"># calculate the mean income per profession</span>
profession = df.groupby([<span class="hljs-string">&#x27;profession&#x27;</span>]).mean()

<span class="hljs-comment"># compute the</span>`}}),Va=new D({props:{code:`txt = """
# import random forest regressor from scikit-learn
from sklearn.ensemble import RandomForestRegressor

# fit random forest model with 300 estimators on X, y:
"""
print(pipe(txt, num_return_sequences=1)[0]["generated_text"])`,highlighted:`txt = <span class="hljs-string">&quot;&quot;&quot;
# import random forest regressor from scikit-learn
from sklearn.ensemble import RandomForestRegressor

# fit random forest model with 300 estimators on X, y:
&quot;&quot;&quot;</span>
<span class="hljs-built_in">print</span>(pipe(txt, num_return_sequences=<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;generated_text&quot;</span>])`}}),Ya=new D({props:{code:`# import random forest regressor from scikit-learn
from sklearn.ensemble import RandomForestRegressor

# fit random forest model with 300 estimators on X, y:
rf = RandomForestRegressor(n_estimators=300, random_state=random_state, max_depth=3)
rf.fit(X, y)
rf`,highlighted:`<span class="hljs-comment"># import random forest regressor from scikit-learn</span>
<span class="hljs-keyword">from</span> sklearn.ensemble <span class="hljs-keyword">import</span> RandomForestRegressor

<span class="hljs-comment"># fit random forest model with 300 estimators on X, y:</span>
rf = RandomForestRegressor(n_estimators=<span class="hljs-number">300</span>, random_state=random_state, max_depth=<span class="hljs-number">3</span>)
rf.fit(X, y)
rf`}});function wr(s,i){return s[0]==="tf"?Xp:Wp}let vn=wr(M),wt=vn(M),es=M[0]==="pt"&&bp(M);return{c(){r=_("meta"),d=m(),y(o.$$.fragment),h=m(),x=_("h1"),g=l("\u56E0\u679C\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u4E00\u304B\u3089\u5B66\u7FD2"),P=m(),w.c(),C=m(),A=_("p"),L=l("\u4ECA\u307E\u3067\u306F\u3001\u4E8B\u524D\u5B66\u7FD2\u3057\u305F\u30E2\u30C7\u30EB\u3092\u4F7F\u3044\u3001\u4E8B\u524D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u3092\u518D\u5229\u7528\u3057\u3066\u65B0\u3057\u3044\u7528\u9014\u5411\u3051\u306B\u5FAE\u8ABF\u6574\u3092\u884C\u3046\u3053\u3068\u304C\u307B\u3068\u3093\u3069\u3067\u3057\u305F\u3002"),$=_("a"),G=l("\u7B2C1\u7AE0"),I=l("\u3067\u898B\u305F\u3088\u3046\u306B\u3001\u3053\u308C\u306F\u4E00\u822C\u7684\u306B "),W=_("em"),F=l("\u8EE2\u79FB\u5B66\u7FD2"),R=l(" \u3068\u547C\u3070\u308C\u3001\u30E9\u30D9\u30EB\u4ED8\u304D\u30C7\u30FC\u30BF\u304C\u3042\u307E\u308A\u306A\u3044\u5B9F\u4E16\u754C\u306E\u307B\u3068\u3093\u3069\u306E\u7528\u9014\u3067Transformer\u30E2\u30C7\u30EB\u3092\u9069\u7528\u3059\u308B\u305F\u3081\u306E\u975E\u5E38\u306B\u6210\u529F\u3057\u305F\u6226\u7565\u3067\u3059\u3002\u3053\u306E\u7AE0\u3067\u306F\u3001\u5225\u306E\u30A2\u30D7\u30ED\u30FC\u30C1\u3067\u3001\u5168\u304F\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u30BC\u30ED\u304B\u3089\u5B66\u7FD2\u3057\u307E\u3059\u3002\u3053\u308C\u306F\u591A\u304F\u306E\u30C7\u30FC\u30BF\u3092\u6301\u3063\u3066\u3044\u308B\u5834\u5408\u306B\u53D6\u308B\u3079\u304D\u826F\u3044\u30A2\u30D7\u30ED\u30FC\u30C1\u3067\u3001\u5229\u7528\u53EF\u80FD\u306A\u30E2\u30C7\u30EB\u306B\u4F7F\u308F\u308C\u308B\u4E8B\u524D\u5B66\u7FD2\u30C7\u30FC\u30BF\u3068\u306F\u5168\u304F\u7570\u306A\u308A\u307E\u3059\u3002\u3057\u304B\u3057\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u4E8B\u524D\u5B66\u7FD2\u306B\u306F\u3001\u65E2\u5B58\u306E\u30E2\u30C7\u30EB\u3092\u5FAE\u8ABF\u6574\u3059\u308B\u3088\u308A\u3082\u3001\u304B\u306A\u308A\u591A\u304F\u306E\u8A08\u7B97\u30EA\u30BD\u30FC\u30B9\u304C\u5FC5\u8981\u306B\u306A\u308A\u307E\u3059\u3002\u4F8B\u3048\u3070\u3001\u97F3\u7B26\u3084DNA\u306A\u3069\u306E\u5206\u5B50\u914D\u5217\u3001\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u306A\u3069\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u5B66\u7FD2\u3055\u305B\u308B\u3053\u3068\u304C\u6709\u52B9\u306A\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u5F8C\u8005\u306B\u3064\u3044\u3066\u306F\u3001OpenAI\u306ECodex\u30E2\u30C7\u30EB\u3092\u642D\u8F09\u3057\u305FTabNine\u3084GitHub\u306ECopilot\u306E\u3088\u3046\u306A\u3001\u9577\u3044\u30B3\u30FC\u30C9\u5217\u3092\u751F\u6210\u3067\u304D\u308B\u30C4\u30FC\u30EB\u304C\u6700\u8FD1\u4EBA\u6C17\u3092\u96C6\u3081\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u30C6\u30AD\u30B9\u30C8\u751F\u6210\u306E\u30BF\u30B9\u30AF\u306F\u3001GPT-2\u306E\u3088\u3046\u306A\u81EA\u5DF1\u56DE\u5E30\u578B\u8A00\u8A9E\u30E2\u30C7\u30EB\u3084\u56E0\u679C\u95A2\u4FC2\u8A00\u8A9E\u30E2\u30C7\u30EB\u3067\u5BFE\u5FDC\u3059\u308B\u306E\u304C\u6700\u9069\u3067\u3059\u3002"),X=m(),z=_("p"),N=l("\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3067\u306F\u3001\u30B3\u30FC\u30C9\u751F\u6210\u30E2\u30C7\u30EB\u306E\u7E2E\u5C0F\u7248\u3092\u69CB\u7BC9\u3057\u307E\u3059\u3002Python\u30B3\u30FC\u30C9\u306E\u30B5\u30D6\u30BB\u30C3\u30C8\u3092\u4F7F\u7528\u3057\u3066\u3001\u5B8C\u5168\u306A\u95A2\u6570\u3084\u30AF\u30E9\u30B9\u3067\u306F\u306A\u304F\u30011\u884C\u306E\u88DC\u5B8C\u306B\u7126\u70B9\u3092\u5F53\u3066\u307E\u3059\u3002Python\u3067\u30C7\u30FC\u30BF\u3092\u6271\u3046\u3068\u304D\u3001"),H=_("code"),K=l("matplotlib"),J=l(", "),V=_("code"),ts=l("seaborn"),_s=l(", "),O=_("code"),B=l("pandas"),Ce=l(", "),ds=_("code"),Oe=l("scikit-learn"),Ts=l(" \u30E9\u30A4\u30D6\u30E9\u30EA\u304B\u3089\u306A\u308BPython\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u30B9\u30BF\u30C3\u30AF\u3068\u983B\u7E41\u306B\u63A5\u89E6\u3059\u308B\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002\u3053\u308C\u3089\u306E\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\u3092\u4F7F\u3046\u3068\u304D\u3001\u7279\u5B9A\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u8ABF\u3079\u308B\u5FC5\u8981\u304C\u3042\u308B\u306E\u306F\u3088\u304F\u3042\u308B\u3053\u3068\u3067\u3059\u3002\u305D\u3053\u3067\u3001\u3053\u308C\u3089\u306E\u547C\u3073\u51FA\u3057\u3092\u88DC\u5B8C\u3059\u308B\u305F\u3081\u306B\u30E2\u30C7\u30EB\u3092\u4F7F\u3046\u3053\u3068\u304C\u3067\u304D\u308C\u3070\u7D20\u6575\u3067\u3059\u3002"),vs=m(),y(hs.$$.fragment),yt=m(),cs=_("p"),Ae=_("a"),fa=l("\u7B2C6\u7AE0"),et=l("\u3067\u306F\u3001Python\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9\u3092\u51E6\u7406\u3059\u308B\u305F\u3081\u306E\u52B9\u7387\u7684\u306A\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F\u304C\u3001\u30E2\u30C7\u30EB\u3092\u4E8B\u524D\u5B66\u7FD2\u3059\u308B\u305F\u3081\u306B\u306F\u3001\u3084\u306F\u308A\u5927\u898F\u6A21\u306A\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C\u5FC5\u8981\u3067\u3059\u3002\u3053\u3053\u3067\u306F\u3001GitHub \u30EA\u30DD\u30B8\u30C8\u30EA\u304B\u3089\u5F97\u305F Python \u30B3\u30FC\u30C9\u306E\u30B3\u30FC\u30D1\u30B9\u306B\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u3092\u9069\u7528\u3057\u307E\u3059\u3002\u305D\u3057\u3066\u3001"),tt=_("code"),ma=l("Trainer"),vt=l(" API \u3068 \u{1F917} Accelerate \u3092\u4F7F\u3063\u3066\u30E2\u30C7\u30EB\u3092\u5B66\u7FD2\u3057\u307E\u3059\u3002\u3055\u3042\u3001\u59CB\u3081\u307E\u3057\u3087\u3046"),Ds=m(),as=_("iframe"),at=m(),fs=_("p"),ua=l("\u3053\u308C\u306F\u5B9F\u969B\u306B\u3001\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3067\u793A\u3057\u305F\u30B3\u30FC\u30C9\u3092\u4F7F\u3063\u3066\u5B66\u7FD2\u3057\u3001\u30CF\u30D6\u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u305F\u30E2\u30C7\u30EB\u3092\u7D39\u4ECB\u3057\u3066\u3044\u308B\u3082\u306E\u3067\u3059\u3002"),Cs=_("a"),Ge=l("\u3053\u3061\u3089"),da=l("\u3092\u3054\u89A7\u304F\u3060\u3055\u3044\u3002\u306A\u304A\u3001\u30C6\u30AD\u30B9\u30C8\u751F\u6210\u306E\u969B\u306B\u30E9\u30F3\u30C0\u30E0\u5316\u304C\u884C\u308F\u308C\u3066\u3044\u308B\u306E\u3067\u3001\u304A\u305D\u3089\u304F\u5C11\u3057\u7570\u306A\u308B\u7D50\u679C\u304C\u5F97\u3089\u308C\u308B\u3068\u601D\u3044\u307E\u3059\u3002"),lt=m(),ms=_("h2"),qt=l("\u30C7\u30FC\u30BF\u3092\u53CE\u96C6\u3059\u308B"),ee=m(),os=_("p"),Et=l("Python\u306E\u30B3\u30FC\u30C9\u306FGitHub\u306A\u3069\u306E\u30B3\u30FC\u30C9\u30EA\u30DD\u30B8\u30C8\u30EA\u304B\u3089\u8C4A\u5BCC\u306B\u63D0\u4F9B\u3055\u308C\u3066\u304A\u308A\u3001\u3053\u308C\u3092\u5229\u7528\u3057\u3066Python\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u3054\u3068\u306B\u30B9\u30AF\u30EC\u30A4\u30D4\u30F3\u30B0\u3059\u308B\u3053\u3068\u3067\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306F"),ls=_("a"),nt=l("\u30C8\u30E9\u30F3\u30B9\u30D5\u30A9\u30FC\u30DE\u30FC\u306E\u6559\u79D1\u66F8"),ha=l("\u3067\u5927\u898F\u6A21\u306AGPT-2\u30E2\u30C7\u30EB\u3092\u4E8B\u524D\u5B66\u7FD2\u3055\u305B\u308B\u305F\u3081\u306B\u53D6\u3089\u308C\u305F\u30A2\u30D7\u30ED\u30FC\u30C1\u3067\u3059\u3002\u8457\u8005\u3089\u306F"),rt=_("code"),pt=l("codeparrot"),$a=l("\u3068\u547C\u3070\u308C\u308B\u7D042000\u4E07\u306EPython\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3080\u7D04180GB\u306EGitHub\u30C0\u30F3\u30D7\u3092\u4F7F\u3063\u3066\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u4F5C\u308A\u3001\u305D\u308C\u3092"),te=_("a"),ot=l("\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6"),ba=l("\u3067\u5171\u6709\u3057\u307E\u3057\u305F\u3002"),it=m(),Q=_("p"),ka=l("\u3057\u304B\u3057\u3001\u30B3\u30FC\u30D1\u30B9\u5168\u4F53\u306B\u5BFE\u3059\u308B\u5B66\u7FD2\u306F\u6642\u9593\u3068\u8A08\u7B97\u304C\u304B\u304B\u308B\u306E\u3067\u3001Python\u3092\u4F7F\u7528\u3057\u305F\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u306B\u95A2\u9023\u3059\u308B\u30C7\u30FC\u30BF\u3060\u3051\u304C\u5FC5\u8981\u3067\u3059\u3002\u305D\u3053\u3067\u3001\u307E\u305A"),ae=_("code"),ja=l("codeparrot"),ga=l("\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304B\u3089\u3001\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u306B\u4F7F\u308F\u308C\u308B\u30E9\u30A4\u30D6\u30E9\u30EA\u306E\u3044\u305A\u308C\u304B\u3092\u542B\u3080\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u30B5\u30A4\u30BA\u304C\u5927\u304D\u3044\u306E\u3067\u3001\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306F\u907F\u3051\u305F\u3044\u3067\u3059\u3002\u305D\u306E\u4EE3\u308F\u308A\u306B\u3001\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u6A5F\u80FD\u3092\u4F7F\u3063\u3066\u3001\u305D\u306E\u5834\u3067\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3057\u3087\u3046\u3002\u5148\u307B\u3069\u7D39\u4ECB\u3057\u305F\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u4F7F\u3063\u305F\u30B3\u30FC\u30C9\u30B5\u30F3\u30D7\u30EB\u3092\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3059\u308B\u305F\u3081\u306B\u3001\u6B21\u306E\u95A2\u6570\u3092\u4F7F\u3044\u307E\u3059\u3002"),Fe=m(),y(le.$$.fragment),xt=m(),ne=_("p"),re=l("2\u3064\u306E\u4F8B\u3067\u30C6\u30B9\u30C8\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),_t=m(),y($s.$$.fragment),zt=m(),y(Os.$$.fragment),As=m(),pe=_("p"),Le=l("\u3053\u308C\u3092\u5229\u7528\u3057\u3066\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3057\u3001\u5FC5\u8981\u306A\u8981\u7D20\u3092\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3059\u308B\u95A2\u6570\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Pt=m(),y(Ms.$$.fragment),Gs=m(),oe=_("p"),qs=l("\u305D\u3057\u3066\u3001\u3053\u306E\u95A2\u6570\u3092\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u9069\u7528\u3059\u308B\u3060\u3051\u3067\u3059\u3002"),Ie=m(),y(ie.$$.fragment),Tt=m(),y(bs.$$.fragment),Dt=m(),Ne=_("p"),Ct=l("\u3053\u306E\u7D50\u679C\u3001\u5143\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u7D043%\u304C\u6B8B\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u305D\u308C\u3067\u3082\u304B\u306A\u308A\u5927\u304D\u306A\u30B5\u30A4\u30BA\u3067\u3059\u3002\u3053\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F6GB\u3067\u300160\u4E07\u306EPython\u30B9\u30AF\u30EA\u30D7\u30C8\u304B\u3089\u69CB\u6210\u3055\u308C\u3066\u3044\u307E\u3059\uFF01"),Fs=m(),_e=_("p"),He=l("\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u5168\u4F53\u306E\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u306B\u306F\u3001\u30DE\u30B7\u30F3\u3084\u5E2F\u57DF\u5E45\u306B\u3082\u3088\u308A\u307E\u3059\u304C\u30012\u301C3\u6642\u9593\u304B\u304B\u308B\u3068\u601D\u308F\u308C\u307E\u3059\u3002\u3082\u3057\u3001\u3053\u306E\u9577\u3044\u30D7\u30ED\u30BB\u30B9\u3092\u81EA\u5206\u3067\u3084\u308A\u305F\u304F\u306A\u3044\u5834\u5408\u3001\u79C1\u9054\u306F\u65E2\u306B\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u30CF\u30D6\u3067\u63D0\u4F9B\u3057\u3001\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3067\u304D\u308B\u3088\u3046\u306B\u3057\u3066\u3044\u307E\u3059\u3002"),Ot=m(),y(Ls.$$.fragment),Is=m(),y(Ns.$$.fragment),ce=m(),y(Hs.$$.fragment),ct=m(),ks=_("p"),At=l("\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u5185\u306E\u4F8B\u3092\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u3053\u3053\u3067\u306F\u3001\u5404\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u6700\u521D\u306E200\u6587\u5B57\u3060\u3051\u3092\u8868\u793A\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002"),Ss=m(),y(Rs.$$.fragment),us=m(),y(fe.$$.fragment),Se=m(),me=_("p"),ft=_("code"),mt=l("content"),wa=l(" \u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u3001\u30E2\u30C7\u30EB\u306B\u5B66\u7FD2\u3055\u305B\u305F\u3044\u30B3\u30FC\u30C9\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C\u3067\u304D\u305F\u306E\u3067\u3001\u30C6\u30AD\u30B9\u30C8\u3092\u6E96\u5099\u3057\u3001\u4E8B\u524D\u5B66\u7FD2\u306B\u9069\u3057\u305F\u5F62\u5F0F\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),Mt=m(),Bs=_("h2"),ue=l("\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u6E96\u5099"),ut=m(),y(Z.$$.fragment),Gt=m(),Us=_("p"),ya=l("\u307E\u305A\u6700\u521D\u306B\u3001\u30C7\u30FC\u30BF\u3092\u30C8\u30FC\u30AF\u30F3\u5316\u3057\u3001\u5B66\u7FD2\u306B\u5229\u7528\u3067\u304D\u308B\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u79C1\u9054\u306E\u76EE\u6A19\u306F\u4E3B\u306B\u77ED\u3044\u95A2\u6570\u547C\u3073\u51FA\u3057\u3092\u81EA\u52D5\u88DC\u5B8C\u3059\u308B\u3053\u3068\u306A\u306E\u3067\u3001\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u30B5\u30A4\u30BA\u3092\u6BD4\u8F03\u7684\u5C0F\u3055\u304F\u4FDD\u3064\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306B\u3088\u308A\u3001\u30E2\u30C7\u30EB\u3092\u3088\u308A\u901F\u304F\u5B66\u7FD2\u3055\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u3001\u5FC5\u8981\u306A\u30E1\u30E2\u30EA\u91CF\u3082\u5927\u5E45\u306B\u5C11\u306A\u304F\u306A\u308B\u3068\u3044\u3046\u5229\u70B9\u304C\u3042\u308A\u307E\u3059\u3002\u3082\u3057\u3042\u306A\u305F\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306B\u3068\u3063\u3066\u3088\u308A\u591A\u304F\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u6301\u3064\u3053\u3068\u304C\u91CD\u8981\u3067\u3042\u308C\u3070(\u4F8B\u3048\u3070\u3001\u95A2\u6570\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306B\u57FA\u3065\u3044\u3066\u30E6\u30CB\u30C3\u30C8\u30C6\u30B9\u30C8\u3092\u66F8\u304F\u3088\u3046\u306B\u30E2\u30C7\u30EB\u3092\u3057\u305F\u3044\u5834\u5408)\u3001\u3053\u306E\u6570\u3092\u5897\u3084\u3057\u305F\u4E8B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002GPT-2 \u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u306F 1,024\u3001GPT-3 \u3067\u306F 2,048 \u3067\u3059\u304C\u3001\u73FE\u5728\u306E\u3068\u3053\u308D\u3001\u79C1\u9054\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u306F 128 \u30C8\u30FC\u30AF\u30F3\u306B\u56FA\u5B9A\u3057\u307E\u3057\u3087\u3046\u3002"),Ft=m(),ns=_("p"),va=l("\u307B\u3068\u3093\u3069\u306E\u6587\u66F8\u306F128\u30C8\u30FC\u30AF\u30F3\u3088\u308A\u591A\u3044\u306E\u3067\u3001\u5358\u7D14\u306B\u5165\u529B\u3092\u6700\u5927\u9577\u306B\u5207\u308A\u8A70\u3081\u308B\u3068\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u5927\u90E8\u5206\u3092\u9664\u53BB\u3057\u3066\u3057\u307E\u3046\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002\u305D\u306E\u4EE3\u308F\u308A\u306B\u3001"),Re=_("a"),dt=l("\u7B2C6\u7AE0"),qa=l(" \u3067\u884C\u3063\u305F\u3088\u3046\u306B\u3001 "),ht=_("code"),Lt=l("return_overflowing_tokens"),de=l(" \u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u3063\u3066\u5165\u529B\u5168\u4F53\u3092\u30C8\u30FC\u30AF\u30F3\u5316\u3057\u3001\u3044\u304F\u3064\u304B\u306E\u65AD\u7247\u306B\u5206\u5272\u3057\u3066\u307F\u307E\u3059\u3002\u307E\u305F\u3001"),Be=_("code"),he=l("return_length"),It=l("\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u3001\u4F5C\u6210\u3055\u308C\u305F\u5404\u65AD\u7247\u306E\u9577\u3055\u3092\u81EA\u52D5\u7684\u306B\u8FD4\u3057\u307E\u3059\u3002\u591A\u304F\u306E\u5834\u5408\u3001\u6700\u5F8C\u306E\u65AD\u7247\u306F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u30B5\u30A4\u30BA\u3088\u308A\u3082\u5C0F\u3055\u304F\u306A\u308B\u306E\u3067\u3001\u30D1\u30C7\u30A3\u30F3\u30B0\u306E\u554F\u984C\u3092\u907F\u3051\u308B\u305F\u3081\u306B\u3053\u308C\u3089\u306E\u65AD\u7247\u3092\u53D6\u308A\u9664\u304D\u307E\u3059\u3002"),$e=m(),Es=_("div"),Ws=_("img"),Nt=m(),rs=_("img"),We=m(),Xe=_("p"),Ea=l("\u6700\u521D\u306E2\u3064\u306E\u4F8B\u3067\u3001\u3053\u306E\u4ED5\u7D44\u307F\u3092\u5177\u4F53\u7684\u306B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Ke=m(),y(be.$$.fragment),Ht=m(),y(Xs.$$.fragment),ke=m(),Ks=_("p"),St=l("\u3053\u308C\u3089\u306E 2 \u3064\u306E\u30B5\u30F3\u30D7\u30EB\u304B\u3089\u3001\u5408\u8A08\u3067 34 \u306E\u65AD\u7247\u304C\u5F97\u3089\u308C\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u65AD\u7247\u306E\u9577\u3055\u3092\u898B\u308B\u3068\u3001\u4E21\u65B9\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u672B\u5C3E\u306B\u3042\u308B\u65AD\u7247\u306F 128 \u30C8\u30FC\u30AF\u30F3\u3088\u308A\u77ED\u3044\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002(\u305D\u308C\u305E\u308C 117 \u3068 41)\u3053\u308C\u3089\u306F\u5168\u65AD\u7247\u306E\u307B\u3093\u306E\u4E00\u90E8\u306A\u306E\u3067\u3001\u5B89\u5168\u306B\u6368\u3066\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),xs=_("code"),Rt=l("overflow_to_sample_mapping"),je=l(" \u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u4F7F\u3046\u3068\u3001\u3069\u306E\u65AD\u7247\u304C\u3069\u306E\u5165\u529B\u30B5\u30F3\u30D7\u30EB\u306B\u5C5E\u3057\u3066\u3044\u305F\u304B\u3092\u518D\u69CB\u7BC9\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002"),$t=m(),Y=_("p"),xa=l("\u3053\u306E\u64CD\u4F5C\u3067\u306F\u3001\u{1F917} Datasets\u306E "),ge=_("code"),za=l("Dataset.map()"),Pa=l(" \u95A2\u6570\u306E\u4FBF\u5229\u306A\u6A5F\u80FD\u3092\u4F7F\u3063\u3066\u3044\u307E\u3059\u3002\u305D\u308C\u306F\u3001\u4E00\u5BFE\u4E00\u306E\u5BFE\u5FDC\u3092\u5FC5\u8981\u3068\u3057\u306A\u3044\u3053\u3068\u3067\u3059\u3002"),we=_("a"),ye=l("\u30BB\u30AF\u30B7\u30E7\u30F3 3"),Bt=l(" \u3067\u898B\u305F\u3088\u3046\u306B\u3001\u5165\u529B\u30D0\u30C3\u30C1\u3088\u308A\u3082\u8981\u7D20\u304C\u591A\u3044\u30D0\u30C3\u30C1\u3084\u5C11\u306A\u3044\u30D0\u30C3\u30C1\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u304C\u53EF\u80FD\u3067\u3059\u3002\u3053\u308C\u306F\u3001\u30C7\u30FC\u30BF\u62E1\u5F35\u3084\u30C7\u30FC\u30BF\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u306A\u3069\u3001\u8981\u7D20\u6570\u3092\u5909\u66F4\u3059\u308B\u3088\u3046\u306A\u64CD\u4F5C\u3092\u884C\u3046\u5834\u5408\u306B\u6709\u7528\u3067\u3059\u3002\u79C1\u9054\u306E\u5834\u5408\u3001\u5404\u8981\u7D20\u3092\u6307\u5B9A\u3055\u308C\u305F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u306E\u65AD\u7247\u306B\u30C8\u30FC\u30AF\u30F3\u5316\u3059\u308B\u969B\u306B\u3001\u5404\u6587\u66F8\u304B\u3089\u591A\u304F\u306E\u30B5\u30F3\u30D7\u30EB\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002\u305F\u3060\u3001\u65E2\u5B58\u306E\u5217\u306F\u30B5\u30A4\u30BA\u304C\u7AF6\u5408\u3057\u3066\u3044\u308B\u306E\u3067\u3001\u5FC5\u305A\u524A\u9664\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u3082\u3057\u305D\u308C\u3089\u3092\u6B8B\u3057\u3066\u304A\u304D\u305F\u3044\u5834\u5408\u306F\u3001 "),Vs=_("code"),Ta=l("Dataset.map()"),Ut=l(" \u547C\u3073\u51FA\u3057\u3092\u9069\u5207\u306B\u7E70\u308A\u8FD4\u3057\u3066\u8FD4\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Ys=m(),y(Zs.$$.fragment),Js=m(),y(Qs.$$.fragment),a=m(),k=_("p"),ll=l("\u73FE\u5728\u3001\u5404\u30C8\u30FC\u30AF\u30F3\u304C128\u500B\u306E1670\u4E07\u30B5\u30F3\u30D7\u30EB\u304C\u3042\u308A\u3001\u3053\u308C\u306F\u5408\u8A08\u3067\u7D0421\u5104\u30C8\u30FC\u30AF\u30F3\u306B\u76F8\u5F53\u3057\u307E\u3059\u3002\u53C2\u8003\u307E\u3067\u306B\u3001OpenAI\u306EGPT-3\u3068Codex\u30E2\u30C7\u30EB\u306F\u305D\u308C\u305E\u308C3000\u5104\u30011000\u5104\u306E\u30C8\u30FC\u30AF\u30F3\u3067\u5B66\u7FD2\u3055\u308C\u3066\u304A\u308A\u3001Codex\u30E2\u30C7\u30EB\u306FGPT-3\u306E\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u304B\u3089\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u76EE\u7684\u306F\u3001\u9577\u304F\u3066\u4E00\u8CAB\u6027\u306E\u3042\u308B\u30C6\u30AD\u30B9\u30C8\u3092\u751F\u6210\u3067\u304D\u308B\u3053\u308C\u3089\u306E\u30E2\u30C7\u30EB\u3068\u7AF6\u5408\u3059\u308B\u3053\u3068\u3067\u306F\u306A\u304F\u3001\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30C6\u30A3\u30B9\u30C8\u306E\u305F\u3081\u306E\u8FC5\u901F\u306A\u81EA\u52D5\u88DC\u5B8C\u6A5F\u80FD\u3092\u63D0\u4F9B\u3059\u308B\u7E2E\u5C0F\u7248\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u3067\u3059\u3002"),Da=m(),bt=_("p"),Wt=l("\u3055\u3066\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u6E96\u5099\u304C\u3067\u304D\u305F\u306E\u3067\u3001\u30E2\u30C7\u30EB\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u3066\u307F\u307E\u3057\u3087\u3046!"),Ca=m(),y(U.$$.fragment),Oa=m(),Ve=_("h2"),nl=l("\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u521D\u671F\u5316\u3059\u308B"),Aa=m(),zs=_("p"),rl=l("\u6700\u521D\u306E\u30B9\u30C6\u30C3\u30D7\u306F GPT-2 \u30E2\u30C7\u30EB\u3092\u65B0\u3057\u304F\u521D\u671F\u5316\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u3053\u306E\u30E2\u30C7\u30EB\u306B\u306F\u5C0F\u578B\u306EGPT-2\u30E2\u30C7\u30EB\u3068\u540C\u3058\u8A2D\u5B9A\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u305D\u306E\u305F\u3081\u3001\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u306E\u8A2D\u5B9A\u3092\u30ED\u30FC\u30C9\u3057\u3001\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u306E\u30B5\u30A4\u30BA\u304C\u30E2\u30C7\u30EB\u306E\u8A9E\u5F59\u30B5\u30A4\u30BA\u3068\u4E00\u81F4\u3059\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3001"),Xt=_("code"),pl=l("bos"),ol=l("\u3068"),Kt=_("code"),il=l("eos"),Ye=l("\uFF08\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u958B\u59CB\u3068\u7D42\u4E86\u3092\u610F\u5473\u3057\u307E\u3059\uFF09\u306E\u30C8\u30FC\u30AF\u30F3ID\u3092\u6E21\u3057\u307E\u3059\u3002"),Ma=m(),gs.c(),Ps=m(),ve=_("p"),_l=l("\u3053\u306E\u30E2\u30C7\u30EB\u306B\u306F1\u51042400\u4E07\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u3042\u308A\u3001\u3053\u308C\u3092\u8ABF\u6574\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u958B\u59CB\u3059\u308B\u524D\u306B\u3001\u30D0\u30C3\u30C1\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u79C1\u9054\u306F"),Vt=_("code"),cl=l("DataCollatorForLanguageModeling"),kt=l("\u3092\u4F7F\u3046\u4E8B\u304C\u3067\u304D\u307E\u3059\u3002"),Ga=m(),qe=_("p"),fl=l("\u3053\u308C\u306F\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u7528\u306B\u7279\u5225\u306B\u8A2D\u8A08\u3055\u308C\u305F\u3082\u306E\u3067\u3059\uFF08\u305D\u306E\u540D\u524D\u304C\u793A\u3059\u3068\u304A\u308A\uFF09\u3002\u30D0\u30C3\u30C1\u306E\u30B9\u30BF\u30C3\u30AF\u3068\u30D1\u30C7\u30A3\u30F3\u30B0\u306E\u4ED6\u306B\u307E\u305F\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u30E9\u30D9\u30EB\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002\u56E0\u679C\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u306F\u3001\u5165\u529B\u3082\u30E9\u30D9\u30EB\u306E\u5F79\u5272\u3092\u679C\u305F\u3057\u307E\u3059\u304C\uFF08\u8981\u7D20\u30921\u3064\u305A\u3089\u3059\u3060\u3051\u3067\u3059\uFF09\u3001\u3053\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u306F\u5B66\u7FD2\u4E2D\u306B\u30E9\u30D9\u30EB\u3092\u4F5C\u6210\u3059\u308B\u306E\u3067\u3001 "),Yt=_("code"),Ze=l("input_ids"),ml=l(" \u3092\u91CD\u8907\u3055\u305B\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u305B\u3093\u3002"),Fa=m(),ps=_("p"),Zt=_("code"),ul=l("DataCollatorForLanguageModeling"),dl=l(" \u306F\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0 (MLM) \u3068\u56E0\u679C\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0 (CLM) \u306E\u4E21\u65B9\u3092\u30B5\u30DD\u30FC\u30C8\u3059\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F MLM \u7528\u306E\u30C7\u30FC\u30BF\u304C\u7528\u610F\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u5F15\u6570 "),Jt=_("code"),Je=l("mlm=False"),hl=l(" \u3092\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u3067CLM\u306B\u5207\u308A\u66FF\u3048\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),La=m(),is.c(),jt=m(),gt=_("p"),An=l("\u4F8B\u3092\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Vl=m(),y(Ia.$$.fragment),Yl=m(),xe.c(),$l=m(),bl=_("p"),Mn=l("\u30B5\u30F3\u30D7\u30EB\u3092\u91CD\u306D\u3066\u307F\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u30C6\u30F3\u30BD\u30EB\u304C\u540C\u3058\u5F62\u3092\u3057\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002"),Zl=m(),ss&&ss.c(),kl=m(),y(Qt.$$.fragment),Jl=m(),jl=_("p"),Gn=l("\u3053\u308C\u3067\u3001\u5B9F\u969B\u306B\u30E2\u30C7\u30EB\u3092\u8A13\u7DF4\u3059\u308B\u305F\u3081\u306E\u6E96\u5099\u304C\u6574\u3044\u307E\u3057\u305F\u3002"),Ql=m(),gl=_("p"),Fn=l("\u7D50\u5C40\u306E\u3068\u3053\u308D\u3001\u305D\u308C\u307B\u3069\u5927\u5909\u306A\u4F5C\u696D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u306D\u3002\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u59CB\u3081\u308B\u524D\u306B\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9\u306B\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u3082\u3057\u30CE\u30FC\u30C8\u30D6\u30C3\u30AF\u3067\u4F5C\u696D\u3057\u3066\u3044\u308B\u306A\u3089\u3001\u6B21\u306E\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u95A2\u6570\u3067\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u307E\u3059\u3002"),sn=m(),y(Na.$$.fragment),en=m(),wl=_("p"),Ln=l("\u3053\u308C\u306B\u3088\u308A\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u5165\u529B\u3059\u308B\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002"),tn=m(),yl=_("p"),In=l("\u30CE\u30FC\u30C8\u30D6\u30C3\u30AF\u3067\u4F5C\u696D\u3057\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u3001\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u6B21\u306E\u884C\u3092\u5165\u529B\u3059\u308B\u3060\u3051\u3067\u3059\u3002"),an=m(),y(Ha.$$.fragment),ln=m(),Pe.c(),vl=m(),y(sa.$$.fragment),nn=m(),y(ea.$$.fragment),rn=m(),Sa=_("h2"),Nn=l("\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u306B\u3088\u308B\u30B3\u30FC\u30C9\u751F\u6210"),pn=m(),ta=_("p"),Hn=l("\u3055\u3066\u3001\u3044\u3088\u3044\u3088\u672C\u756A\u3067\u3059\uFF01\u5B66\u7FD2\u3057\u305F\u30E2\u30C7\u30EB\u304C\u5B9F\u969B\u306B\u3069\u306E\u7A0B\u5EA6\u6A5F\u80FD\u3059\u308B\u306E\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u30ED\u30B0\u3092\u898B\u308B\u3068\u640D\u5931\u304C\u7740\u5B9F\u306B\u6E1B\u3063\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u304C\u3001\u30E2\u30C7\u30EB\u3092\u30C6\u30B9\u30C8\u3059\u308B\u305F\u3081\u306B\u3001\u3044\u304F\u3064\u304B\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u306B\u5BFE\u3057\u3066\u3069\u306E\u7A0B\u5EA6\u52B9\u679C\u304C\u3042\u308B\u306E\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u305D\u306E\u305F\u3081\u306B\u3001\u30C6\u30AD\u30B9\u30C8\u751F\u6210\u306E "),Gl=_("code"),Sn=l("pipeline"),Rn=l(" \u3067\u30E2\u30C7\u30EB\u3092\u30E9\u30C3\u30D7\u3057\u3001\u5229\u7528\u53EF\u80FD\u3067\u3042\u308C\u3070\u9AD8\u901F\u306B\u751F\u6210\u3059\u308B\u305F\u3081\u306B GPU \u306B\u4E57\u305B\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002"),on=m(),De.c(),ql=m(),El=_("p"),Bn=l("\u307E\u305A\u306F\u6563\u5E03\u56F3\u3092\u4F5C\u308B\u3068\u3044\u3046\u7C21\u5358\u306A\u4F5C\u696D\u304B\u3089\u59CB\u3081\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),_n=m(),y(Ra.$$.fragment),cn=m(),y(Ba.$$.fragment),fn=m(),Qe=_("p"),Un=l(`\u7D50\u679C\u306F\u6B63\u3057\u3044\u3088\u3046\u3067\u3059\u3002
\u3053\u308C\u306F `),Fl=_("code"),Wn=l("pandas"),Xn=l(" \u30AA\u30DA\u30EC\u30FC\u30B7\u30E7\u30F3\u3067\u3082\u52D5\u4F5C\u3059\u308B\u306E\u3067\u3057\u3087\u3046\u304B\uFF1F2\u3064\u306E\u914D\u5217\u304B\u3089 "),Ll=_("code"),Kn=l("DataFrame"),Vn=l(" \u3092\u4F5C\u6210\u3067\u304D\u308B\u304B\u3069\u3046\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),mn=m(),y(Ua.$$.fragment),un=m(),y(Wa.$$.fragment),dn=m(),xl=_("p"),Yn=l("\u3044\u3044\u306D\u3067\u3059\u306D\uFF01\u305D\u308C\u304C\u6B63\u89E3\u3067\u3059\u3002"),hn=m(),se=_("p"),Zn=l("\u3057\u304B\u3057\u3001\u305D\u306E\u5F8C\u3001\u5217 "),Il=_("code"),Jn=l("x"),Qn=l(" \u3092\u518D\u3073\u633F\u5165\u3057\u3066\u3044\u307E\u3059\u3002\u751F\u6210\u3055\u308C\u308B\u30C8\u30FC\u30AF\u30F3\u306E\u6570\u306B\u306F\u9650\u308A\u304C\u3042\u308B\u306E\u3067\u3001\u6B21\u306E "),Nl=_("code"),sr=l("for"),er=l(` \u30EB\u30FC\u30D7\u306F\u5207\u308A\u6368\u3066\u3089\u308C\u3044\u307E\u3059\u3002
\u3082\u3046\u5C11\u3057\u8907\u96D1\u306A\u3053\u3068\u3092\u3057\u3066\u3001\u30E2\u30C7\u30EB\u306B `),Hl=_("code"),tr=l("groupby"),ar=l(" \u64CD\u4F5C\u3092\u4F7F\u308F\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),$n=m(),y(Xa.$$.fragment),bn=m(),y(Ka.$$.fragment),kn=m(),aa=_("p"),lr=l(`\u60AA\u304F\u306A\u3044\u3067\u3059\u306D\u3002\u3053\u308C\u306F\u6B63\u3057\u3044\u3084\u308A\u65B9\u3067\u3059\u3002
\u6700\u5F8C\u306B\u3001`),Sl=_("code"),nr=l("scikit-learn"),rr=l("\u306B\u3082\u4F7F\u3048\u308B\u304B\u3069\u3046\u304B\u3001Random Forest\u30E2\u30C7\u30EB\u3092\u8A2D\u5B9A\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),jn=m(),y(Va.$$.fragment),gn=m(),y(Ya.$$.fragment),wn=m(),wt.c(),zl=m(),es&&es.c(),Pl=On(),this.h()},l(s){const i=yp('[data-svelte="svelte-1phssyn"]',document.head);r=c(i,"META",{name:!0,content:!0}),i.forEach(e),d=u(s),v(o.$$.fragment,s),h=u(s),x=c(s,"H1",{id:!0});var Rl=f(x);g=n(Rl,"\u56E0\u679C\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u4E00\u304B\u3089\u5B66\u7FD2"),Rl.forEach(e),P=u(s),w.l(s),C=u(s),A=c(s,"P",{});var st=f(A);L=n(st,"\u4ECA\u307E\u3067\u306F\u3001\u4E8B\u524D\u5B66\u7FD2\u3057\u305F\u30E2\u30C7\u30EB\u3092\u4F7F\u3044\u3001\u4E8B\u524D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u3092\u518D\u5229\u7528\u3057\u3066\u65B0\u3057\u3044\u7528\u9014\u5411\u3051\u306B\u5FAE\u8ABF\u6574\u3092\u884C\u3046\u3053\u3068\u304C\u307B\u3068\u3093\u3069\u3067\u3057\u305F\u3002"),$=c(st,"A",{href:!0});var Bl=f($);G=n(Bl,"\u7B2C1\u7AE0"),Bl.forEach(e),I=n(st,"\u3067\u898B\u305F\u3088\u3046\u306B\u3001\u3053\u308C\u306F\u4E00\u822C\u7684\u306B "),W=c(st,"EM",{});var Ul=f(W);F=n(Ul,"\u8EE2\u79FB\u5B66\u7FD2"),Ul.forEach(e),R=n(st," \u3068\u547C\u3070\u308C\u3001\u30E9\u30D9\u30EB\u4ED8\u304D\u30C7\u30FC\u30BF\u304C\u3042\u307E\u308A\u306A\u3044\u5B9F\u4E16\u754C\u306E\u307B\u3068\u3093\u3069\u306E\u7528\u9014\u3067Transformer\u30E2\u30C7\u30EB\u3092\u9069\u7528\u3059\u308B\u305F\u3081\u306E\u975E\u5E38\u306B\u6210\u529F\u3057\u305F\u6226\u7565\u3067\u3059\u3002\u3053\u306E\u7AE0\u3067\u306F\u3001\u5225\u306E\u30A2\u30D7\u30ED\u30FC\u30C1\u3067\u3001\u5168\u304F\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u30BC\u30ED\u304B\u3089\u5B66\u7FD2\u3057\u307E\u3059\u3002\u3053\u308C\u306F\u591A\u304F\u306E\u30C7\u30FC\u30BF\u3092\u6301\u3063\u3066\u3044\u308B\u5834\u5408\u306B\u53D6\u308B\u3079\u304D\u826F\u3044\u30A2\u30D7\u30ED\u30FC\u30C1\u3067\u3001\u5229\u7528\u53EF\u80FD\u306A\u30E2\u30C7\u30EB\u306B\u4F7F\u308F\u308C\u308B\u4E8B\u524D\u5B66\u7FD2\u30C7\u30FC\u30BF\u3068\u306F\u5168\u304F\u7570\u306A\u308A\u307E\u3059\u3002\u3057\u304B\u3057\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u4E8B\u524D\u5B66\u7FD2\u306B\u306F\u3001\u65E2\u5B58\u306E\u30E2\u30C7\u30EB\u3092\u5FAE\u8ABF\u6574\u3059\u308B\u3088\u308A\u3082\u3001\u304B\u306A\u308A\u591A\u304F\u306E\u8A08\u7B97\u30EA\u30BD\u30FC\u30B9\u304C\u5FC5\u8981\u306B\u306A\u308A\u307E\u3059\u3002\u4F8B\u3048\u3070\u3001\u97F3\u7B26\u3084DNA\u306A\u3069\u306E\u5206\u5B50\u914D\u5217\u3001\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u306A\u3069\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u5B66\u7FD2\u3055\u305B\u308B\u3053\u3068\u304C\u6709\u52B9\u306A\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u5F8C\u8005\u306B\u3064\u3044\u3066\u306F\u3001OpenAI\u306ECodex\u30E2\u30C7\u30EB\u3092\u642D\u8F09\u3057\u305FTabNine\u3084GitHub\u306ECopilot\u306E\u3088\u3046\u306A\u3001\u9577\u3044\u30B3\u30FC\u30C9\u5217\u3092\u751F\u6210\u3067\u304D\u308B\u30C4\u30FC\u30EB\u304C\u6700\u8FD1\u4EBA\u6C17\u3092\u96C6\u3081\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u30C6\u30AD\u30B9\u30C8\u751F\u6210\u306E\u30BF\u30B9\u30AF\u306F\u3001GPT-2\u306E\u3088\u3046\u306A\u81EA\u5DF1\u56DE\u5E30\u578B\u8A00\u8A9E\u30E2\u30C7\u30EB\u3084\u56E0\u679C\u95A2\u4FC2\u8A00\u8A9E\u30E2\u30C7\u30EB\u3067\u5BFE\u5FDC\u3059\u308B\u306E\u304C\u6700\u9069\u3067\u3059\u3002"),st.forEach(e),X=u(s),z=c(s,"P",{});var ys=f(z);N=n(ys,"\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3067\u306F\u3001\u30B3\u30FC\u30C9\u751F\u6210\u30E2\u30C7\u30EB\u306E\u7E2E\u5C0F\u7248\u3092\u69CB\u7BC9\u3057\u307E\u3059\u3002Python\u30B3\u30FC\u30C9\u306E\u30B5\u30D6\u30BB\u30C3\u30C8\u3092\u4F7F\u7528\u3057\u3066\u3001\u5B8C\u5168\u306A\u95A2\u6570\u3084\u30AF\u30E9\u30B9\u3067\u306F\u306A\u304F\u30011\u884C\u306E\u88DC\u5B8C\u306B\u7126\u70B9\u3092\u5F53\u3066\u307E\u3059\u3002Python\u3067\u30C7\u30FC\u30BF\u3092\u6271\u3046\u3068\u304D\u3001"),H=c(ys,"CODE",{});var Tl=f(H);K=n(Tl,"matplotlib"),Tl.forEach(e),J=n(ys,", "),V=c(ys,"CODE",{});var Dl=f(V);ts=n(Dl,"seaborn"),Dl.forEach(e),_s=n(ys,", "),O=c(ys,"CODE",{});var Wl=f(O);B=n(Wl,"pandas"),Wl.forEach(e),Ce=n(ys,", "),ds=c(ys,"CODE",{});var Cl=f(ds);Oe=n(Cl,"scikit-learn"),Cl.forEach(e),Ts=n(ys," \u30E9\u30A4\u30D6\u30E9\u30EA\u304B\u3089\u306A\u308BPython\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u30B9\u30BF\u30C3\u30AF\u3068\u983B\u7E41\u306B\u63A5\u89E6\u3059\u308B\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002\u3053\u308C\u3089\u306E\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\u3092\u4F7F\u3046\u3068\u304D\u3001\u7279\u5B9A\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u8ABF\u3079\u308B\u5FC5\u8981\u304C\u3042\u308B\u306E\u306F\u3088\u304F\u3042\u308B\u3053\u3068\u3067\u3059\u3002\u305D\u3053\u3067\u3001\u3053\u308C\u3089\u306E\u547C\u3073\u51FA\u3057\u3092\u88DC\u5B8C\u3059\u308B\u305F\u3081\u306B\u30E2\u30C7\u30EB\u3092\u4F7F\u3046\u3053\u3068\u304C\u3067\u304D\u308C\u3070\u7D20\u6575\u3067\u3059\u3002"),ys.forEach(e),vs=u(s),v(hs.$$.fragment,s),yt=u(s),cs=c(s,"P",{});var la=f(cs);Ae=c(la,"A",{href:!0});var Xl=f(Ae);fa=n(Xl,"\u7B2C6\u7AE0"),Xl.forEach(e),et=n(la,"\u3067\u306F\u3001Python\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9\u3092\u51E6\u7406\u3059\u308B\u305F\u3081\u306E\u52B9\u7387\u7684\u306A\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F\u304C\u3001\u30E2\u30C7\u30EB\u3092\u4E8B\u524D\u5B66\u7FD2\u3059\u308B\u305F\u3081\u306B\u306F\u3001\u3084\u306F\u308A\u5927\u898F\u6A21\u306A\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C\u5FC5\u8981\u3067\u3059\u3002\u3053\u3053\u3067\u306F\u3001GitHub \u30EA\u30DD\u30B8\u30C8\u30EA\u304B\u3089\u5F97\u305F Python \u30B3\u30FC\u30C9\u306E\u30B3\u30FC\u30D1\u30B9\u306B\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u3092\u9069\u7528\u3057\u307E\u3059\u3002\u305D\u3057\u3066\u3001"),tt=c(la,"CODE",{});var Ol=f(tt);ma=n(Ol,"Trainer"),Ol.forEach(e),vt=n(la," API \u3068 \u{1F917} Accelerate \u3092\u4F7F\u3063\u3066\u30E2\u30C7\u30EB\u3092\u5B66\u7FD2\u3057\u307E\u3059\u3002\u3055\u3042\u3001\u59CB\u3081\u307E\u3057\u3087\u3046"),la.forEach(e),Ds=u(s),as=c(s,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),f(as).forEach(e),at=u(s),fs=c(s,"P",{});var qn=f(fs);ua=n(qn,"\u3053\u308C\u306F\u5B9F\u969B\u306B\u3001\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3067\u793A\u3057\u305F\u30B3\u30FC\u30C9\u3092\u4F7F\u3063\u3066\u5B66\u7FD2\u3057\u3001\u30CF\u30D6\u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u305F\u30E2\u30C7\u30EB\u3092\u7D39\u4ECB\u3057\u3066\u3044\u308B\u3082\u306E\u3067\u3059\u3002"),Cs=c(qn,"A",{href:!0,rel:!0});var yr=f(Cs);Ge=n(yr,"\u3053\u3061\u3089"),yr.forEach(e),da=n(qn,"\u3092\u3054\u89A7\u304F\u3060\u3055\u3044\u3002\u306A\u304A\u3001\u30C6\u30AD\u30B9\u30C8\u751F\u6210\u306E\u969B\u306B\u30E9\u30F3\u30C0\u30E0\u5316\u304C\u884C\u308F\u308C\u3066\u3044\u308B\u306E\u3067\u3001\u304A\u305D\u3089\u304F\u5C11\u3057\u7570\u306A\u308B\u7D50\u679C\u304C\u5F97\u3089\u308C\u308B\u3068\u601D\u3044\u307E\u3059\u3002"),qn.forEach(e),lt=u(s),ms=c(s,"H2",{id:!0});var vr=f(ms);qt=n(vr,"\u30C7\u30FC\u30BF\u3092\u53CE\u96C6\u3059\u308B"),vr.forEach(e),ee=u(s),os=c(s,"P",{});var na=f(os);Et=n(na,"Python\u306E\u30B3\u30FC\u30C9\u306FGitHub\u306A\u3069\u306E\u30B3\u30FC\u30C9\u30EA\u30DD\u30B8\u30C8\u30EA\u304B\u3089\u8C4A\u5BCC\u306B\u63D0\u4F9B\u3055\u308C\u3066\u304A\u308A\u3001\u3053\u308C\u3092\u5229\u7528\u3057\u3066Python\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u3054\u3068\u306B\u30B9\u30AF\u30EC\u30A4\u30D4\u30F3\u30B0\u3059\u308B\u3053\u3068\u3067\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306F"),ls=c(na,"A",{href:!0,rel:!0});var qr=f(ls);nt=n(qr,"\u30C8\u30E9\u30F3\u30B9\u30D5\u30A9\u30FC\u30DE\u30FC\u306E\u6559\u79D1\u66F8"),qr.forEach(e),ha=n(na,"\u3067\u5927\u898F\u6A21\u306AGPT-2\u30E2\u30C7\u30EB\u3092\u4E8B\u524D\u5B66\u7FD2\u3055\u305B\u308B\u305F\u3081\u306B\u53D6\u3089\u308C\u305F\u30A2\u30D7\u30ED\u30FC\u30C1\u3067\u3059\u3002\u8457\u8005\u3089\u306F"),rt=c(na,"CODE",{});var Er=f(rt);pt=n(Er,"codeparrot"),Er.forEach(e),$a=n(na,"\u3068\u547C\u3070\u308C\u308B\u7D042000\u4E07\u306EPython\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3080\u7D04180GB\u306EGitHub\u30C0\u30F3\u30D7\u3092\u4F7F\u3063\u3066\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u4F5C\u308A\u3001\u305D\u308C\u3092"),te=c(na,"A",{href:!0,rel:!0});var xr=f(te);ot=n(xr,"\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9 \u30CF\u30D6"),xr.forEach(e),ba=n(na,"\u3067\u5171\u6709\u3057\u307E\u3057\u305F\u3002"),na.forEach(e),it=u(s),Q=c(s,"P",{});var En=f(Q);ka=n(En,"\u3057\u304B\u3057\u3001\u30B3\u30FC\u30D1\u30B9\u5168\u4F53\u306B\u5BFE\u3059\u308B\u5B66\u7FD2\u306F\u6642\u9593\u3068\u8A08\u7B97\u304C\u304B\u304B\u308B\u306E\u3067\u3001Python\u3092\u4F7F\u7528\u3057\u305F\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u306B\u95A2\u9023\u3059\u308B\u30C7\u30FC\u30BF\u3060\u3051\u304C\u5FC5\u8981\u3067\u3059\u3002\u305D\u3053\u3067\u3001\u307E\u305A"),ae=c(En,"CODE",{});var zr=f(ae);ja=n(zr,"codeparrot"),zr.forEach(e),ga=n(En,"\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304B\u3089\u3001\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30B9\u306B\u4F7F\u308F\u308C\u308B\u30E9\u30A4\u30D6\u30E9\u30EA\u306E\u3044\u305A\u308C\u304B\u3092\u542B\u3080\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u30B5\u30A4\u30BA\u304C\u5927\u304D\u3044\u306E\u3067\u3001\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306F\u907F\u3051\u305F\u3044\u3067\u3059\u3002\u305D\u306E\u4EE3\u308F\u308A\u306B\u3001\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u6A5F\u80FD\u3092\u4F7F\u3063\u3066\u3001\u305D\u306E\u5834\u3067\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3057\u3087\u3046\u3002\u5148\u307B\u3069\u7D39\u4ECB\u3057\u305F\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u4F7F\u3063\u305F\u30B3\u30FC\u30C9\u30B5\u30F3\u30D7\u30EB\u3092\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3059\u308B\u305F\u3081\u306B\u3001\u6B21\u306E\u95A2\u6570\u3092\u4F7F\u3044\u307E\u3059\u3002"),En.forEach(e),Fe=u(s),v(le.$$.fragment,s),xt=u(s),ne=c(s,"P",{});var Pr=f(ne);re=n(Pr,"2\u3064\u306E\u4F8B\u3067\u30C6\u30B9\u30C8\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Pr.forEach(e),_t=u(s),v($s.$$.fragment,s),zt=u(s),v(Os.$$.fragment,s),As=u(s),pe=c(s,"P",{});var Tr=f(pe);Le=n(Tr,"\u3053\u308C\u3092\u5229\u7528\u3057\u3066\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3057\u3001\u5FC5\u8981\u306A\u8981\u7D20\u3092\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3059\u308B\u95A2\u6570\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Tr.forEach(e),Pt=u(s),v(Ms.$$.fragment,s),Gs=u(s),oe=c(s,"P",{});var Dr=f(oe);qs=n(Dr,"\u305D\u3057\u3066\u3001\u3053\u306E\u95A2\u6570\u3092\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u9069\u7528\u3059\u308B\u3060\u3051\u3067\u3059\u3002"),Dr.forEach(e),Ie=u(s),v(ie.$$.fragment,s),Tt=u(s),v(bs.$$.fragment,s),Dt=u(s),Ne=c(s,"P",{});var Cr=f(Ne);Ct=n(Cr,"\u3053\u306E\u7D50\u679C\u3001\u5143\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u7D043%\u304C\u6B8B\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u305D\u308C\u3067\u3082\u304B\u306A\u308A\u5927\u304D\u306A\u30B5\u30A4\u30BA\u3067\u3059\u3002\u3053\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F6GB\u3067\u300160\u4E07\u306EPython\u30B9\u30AF\u30EA\u30D7\u30C8\u304B\u3089\u69CB\u6210\u3055\u308C\u3066\u3044\u307E\u3059\uFF01"),Cr.forEach(e),Fs=u(s),_e=c(s,"P",{});var Or=f(_e);He=n(Or,"\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u5168\u4F53\u306E\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u306B\u306F\u3001\u30DE\u30B7\u30F3\u3084\u5E2F\u57DF\u5E45\u306B\u3082\u3088\u308A\u307E\u3059\u304C\u30012\u301C3\u6642\u9593\u304B\u304B\u308B\u3068\u601D\u308F\u308C\u307E\u3059\u3002\u3082\u3057\u3001\u3053\u306E\u9577\u3044\u30D7\u30ED\u30BB\u30B9\u3092\u81EA\u5206\u3067\u3084\u308A\u305F\u304F\u306A\u3044\u5834\u5408\u3001\u79C1\u9054\u306F\u65E2\u306B\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u30CF\u30D6\u3067\u63D0\u4F9B\u3057\u3001\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3067\u304D\u308B\u3088\u3046\u306B\u3057\u3066\u3044\u307E\u3059\u3002"),Or.forEach(e),Ot=u(s),v(Ls.$$.fragment,s),Is=u(s),v(Ns.$$.fragment,s),ce=u(s),v(Hs.$$.fragment,s),ct=u(s),ks=c(s,"P",{});var Ar=f(ks);At=n(Ar,"\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u5185\u306E\u4F8B\u3092\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u3053\u3053\u3067\u306F\u3001\u5404\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u6700\u521D\u306E200\u6587\u5B57\u3060\u3051\u3092\u8868\u793A\u3059\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002"),Ar.forEach(e),Ss=u(s),v(Rs.$$.fragment,s),us=u(s),v(fe.$$.fragment,s),Se=u(s),me=c(s,"P",{});var pr=f(me);ft=c(pr,"CODE",{});var Mr=f(ft);mt=n(Mr,"content"),Mr.forEach(e),wa=n(pr," \u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u3001\u30E2\u30C7\u30EB\u306B\u5B66\u7FD2\u3055\u305B\u305F\u3044\u30B3\u30FC\u30C9\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C\u3067\u304D\u305F\u306E\u3067\u3001\u30C6\u30AD\u30B9\u30C8\u3092\u6E96\u5099\u3057\u3001\u4E8B\u524D\u5B66\u7FD2\u306B\u9069\u3057\u305F\u5F62\u5F0F\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"),pr.forEach(e),Mt=u(s),Bs=c(s,"H2",{id:!0});var Gr=f(Bs);ue=n(Gr,"\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u6E96\u5099"),Gr.forEach(e),ut=u(s),v(Z.$$.fragment,s),Gt=u(s),Us=c(s,"P",{});var Fr=f(Us);ya=n(Fr,"\u307E\u305A\u6700\u521D\u306B\u3001\u30C7\u30FC\u30BF\u3092\u30C8\u30FC\u30AF\u30F3\u5316\u3057\u3001\u5B66\u7FD2\u306B\u5229\u7528\u3067\u304D\u308B\u3088\u3046\u306B\u3057\u307E\u3059\u3002\u79C1\u9054\u306E\u76EE\u6A19\u306F\u4E3B\u306B\u77ED\u3044\u95A2\u6570\u547C\u3073\u51FA\u3057\u3092\u81EA\u52D5\u88DC\u5B8C\u3059\u308B\u3053\u3068\u306A\u306E\u3067\u3001\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u30B5\u30A4\u30BA\u3092\u6BD4\u8F03\u7684\u5C0F\u3055\u304F\u4FDD\u3064\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u308C\u306B\u3088\u308A\u3001\u30E2\u30C7\u30EB\u3092\u3088\u308A\u901F\u304F\u5B66\u7FD2\u3055\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u3001\u5FC5\u8981\u306A\u30E1\u30E2\u30EA\u91CF\u3082\u5927\u5E45\u306B\u5C11\u306A\u304F\u306A\u308B\u3068\u3044\u3046\u5229\u70B9\u304C\u3042\u308A\u307E\u3059\u3002\u3082\u3057\u3042\u306A\u305F\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306B\u3068\u3063\u3066\u3088\u308A\u591A\u304F\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u6301\u3064\u3053\u3068\u304C\u91CD\u8981\u3067\u3042\u308C\u3070(\u4F8B\u3048\u3070\u3001\u95A2\u6570\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306B\u57FA\u3065\u3044\u3066\u30E6\u30CB\u30C3\u30C8\u30C6\u30B9\u30C8\u3092\u66F8\u304F\u3088\u3046\u306B\u30E2\u30C7\u30EB\u3092\u3057\u305F\u3044\u5834\u5408)\u3001\u3053\u306E\u6570\u3092\u5897\u3084\u3057\u305F\u4E8B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002GPT-2 \u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u306F 1,024\u3001GPT-3 \u3067\u306F 2,048 \u3067\u3059\u304C\u3001\u73FE\u5728\u306E\u3068\u3053\u308D\u3001\u79C1\u9054\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u306F 128 \u30C8\u30FC\u30AF\u30F3\u306B\u56FA\u5B9A\u3057\u307E\u3057\u3087\u3046\u3002"),Fr.forEach(e),Ft=u(s),ns=c(s,"P",{});var ra=f(ns);va=n(ra,"\u307B\u3068\u3093\u3069\u306E\u6587\u66F8\u306F128\u30C8\u30FC\u30AF\u30F3\u3088\u308A\u591A\u3044\u306E\u3067\u3001\u5358\u7D14\u306B\u5165\u529B\u3092\u6700\u5927\u9577\u306B\u5207\u308A\u8A70\u3081\u308B\u3068\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u5927\u90E8\u5206\u3092\u9664\u53BB\u3057\u3066\u3057\u307E\u3046\u3053\u3068\u306B\u306A\u308A\u307E\u3059\u3002\u305D\u306E\u4EE3\u308F\u308A\u306B\u3001"),Re=c(ra,"A",{href:!0});var Lr=f(Re);dt=n(Lr,"\u7B2C6\u7AE0"),Lr.forEach(e),qa=n(ra," \u3067\u884C\u3063\u305F\u3088\u3046\u306B\u3001 "),ht=c(ra,"CODE",{});var Ir=f(ht);Lt=n(Ir,"return_overflowing_tokens"),Ir.forEach(e),de=n(ra," \u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u3063\u3066\u5165\u529B\u5168\u4F53\u3092\u30C8\u30FC\u30AF\u30F3\u5316\u3057\u3001\u3044\u304F\u3064\u304B\u306E\u65AD\u7247\u306B\u5206\u5272\u3057\u3066\u307F\u307E\u3059\u3002\u307E\u305F\u3001"),Be=c(ra,"CODE",{});var Nr=f(Be);he=n(Nr,"return_length"),Nr.forEach(e),It=n(ra,"\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u3001\u4F5C\u6210\u3055\u308C\u305F\u5404\u65AD\u7247\u306E\u9577\u3055\u3092\u81EA\u52D5\u7684\u306B\u8FD4\u3057\u307E\u3059\u3002\u591A\u304F\u306E\u5834\u5408\u3001\u6700\u5F8C\u306E\u65AD\u7247\u306F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u30B5\u30A4\u30BA\u3088\u308A\u3082\u5C0F\u3055\u304F\u306A\u308B\u306E\u3067\u3001\u30D1\u30C7\u30A3\u30F3\u30B0\u306E\u554F\u984C\u3092\u907F\u3051\u308B\u305F\u3081\u306B\u3053\u308C\u3089\u306E\u65AD\u7247\u3092\u53D6\u308A\u9664\u304D\u307E\u3059\u3002"),ra.forEach(e),$e=u(s),Es=c(s,"DIV",{class:!0});var xn=f(Es);Ws=c(xn,"IMG",{class:!0,src:!0,alt:!0}),Nt=u(xn),rs=c(xn,"IMG",{class:!0,src:!0,alt:!0}),xn.forEach(e),We=u(s),Xe=c(s,"P",{});var Hr=f(Xe);Ea=n(Hr,"\u6700\u521D\u306E2\u3064\u306E\u4F8B\u3067\u3001\u3053\u306E\u4ED5\u7D44\u307F\u3092\u5177\u4F53\u7684\u306B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Hr.forEach(e),Ke=u(s),v(be.$$.fragment,s),Ht=u(s),v(Xs.$$.fragment,s),ke=u(s),Ks=c(s,"P",{});var zn=f(Ks);St=n(zn,"\u3053\u308C\u3089\u306E 2 \u3064\u306E\u30B5\u30F3\u30D7\u30EB\u304B\u3089\u3001\u5408\u8A08\u3067 34 \u306E\u65AD\u7247\u304C\u5F97\u3089\u308C\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002\u65AD\u7247\u306E\u9577\u3055\u3092\u898B\u308B\u3068\u3001\u4E21\u65B9\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u672B\u5C3E\u306B\u3042\u308B\u65AD\u7247\u306F 128 \u30C8\u30FC\u30AF\u30F3\u3088\u308A\u77ED\u3044\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002(\u305D\u308C\u305E\u308C 117 \u3068 41)\u3053\u308C\u3089\u306F\u5168\u65AD\u7247\u306E\u307B\u3093\u306E\u4E00\u90E8\u306A\u306E\u3067\u3001\u5B89\u5168\u306B\u6368\u3066\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),xs=c(zn,"CODE",{});var Sr=f(xs);Rt=n(Sr,"overflow_to_sample_mapping"),Sr.forEach(e),je=n(zn," \u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u4F7F\u3046\u3068\u3001\u3069\u306E\u65AD\u7247\u304C\u3069\u306E\u5165\u529B\u30B5\u30F3\u30D7\u30EB\u306B\u5C5E\u3057\u3066\u3044\u305F\u304B\u3092\u518D\u69CB\u7BC9\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002"),zn.forEach(e),$t=u(s),Y=c(s,"P",{});var pa=f(Y);xa=n(pa,"\u3053\u306E\u64CD\u4F5C\u3067\u306F\u3001\u{1F917} Datasets\u306E "),ge=c(pa,"CODE",{});var Rr=f(ge);za=n(Rr,"Dataset.map()"),Rr.forEach(e),Pa=n(pa," \u95A2\u6570\u306E\u4FBF\u5229\u306A\u6A5F\u80FD\u3092\u4F7F\u3063\u3066\u3044\u307E\u3059\u3002\u305D\u308C\u306F\u3001\u4E00\u5BFE\u4E00\u306E\u5BFE\u5FDC\u3092\u5FC5\u8981\u3068\u3057\u306A\u3044\u3053\u3068\u3067\u3059\u3002"),we=c(pa,"A",{href:!0});var Br=f(we);ye=n(Br,"\u30BB\u30AF\u30B7\u30E7\u30F3 3"),Br.forEach(e),Bt=n(pa," \u3067\u898B\u305F\u3088\u3046\u306B\u3001\u5165\u529B\u30D0\u30C3\u30C1\u3088\u308A\u3082\u8981\u7D20\u304C\u591A\u3044\u30D0\u30C3\u30C1\u3084\u5C11\u306A\u3044\u30D0\u30C3\u30C1\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u304C\u53EF\u80FD\u3067\u3059\u3002\u3053\u308C\u306F\u3001\u30C7\u30FC\u30BF\u62E1\u5F35\u3084\u30C7\u30FC\u30BF\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u306A\u3069\u3001\u8981\u7D20\u6570\u3092\u5909\u66F4\u3059\u308B\u3088\u3046\u306A\u64CD\u4F5C\u3092\u884C\u3046\u5834\u5408\u306B\u6709\u7528\u3067\u3059\u3002\u79C1\u9054\u306E\u5834\u5408\u3001\u5404\u8981\u7D20\u3092\u6307\u5B9A\u3055\u308C\u305F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B5\u30A4\u30BA\u306E\u65AD\u7247\u306B\u30C8\u30FC\u30AF\u30F3\u5316\u3059\u308B\u969B\u306B\u3001\u5404\u6587\u66F8\u304B\u3089\u591A\u304F\u306E\u30B5\u30F3\u30D7\u30EB\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002\u305F\u3060\u3001\u65E2\u5B58\u306E\u5217\u306F\u30B5\u30A4\u30BA\u304C\u7AF6\u5408\u3057\u3066\u3044\u308B\u306E\u3067\u3001\u5FC5\u305A\u524A\u9664\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u3082\u3057\u305D\u308C\u3089\u3092\u6B8B\u3057\u3066\u304A\u304D\u305F\u3044\u5834\u5408\u306F\u3001 "),Vs=c(pa,"CODE",{});var Ur=f(Vs);Ta=n(Ur,"Dataset.map()"),Ur.forEach(e),Ut=n(pa," \u547C\u3073\u51FA\u3057\u3092\u9069\u5207\u306B\u7E70\u308A\u8FD4\u3057\u3066\u8FD4\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),pa.forEach(e),Ys=u(s),v(Zs.$$.fragment,s),Js=u(s),v(Qs.$$.fragment,s),a=u(s),k=c(s,"P",{});var Wr=f(k);ll=n(Wr,"\u73FE\u5728\u3001\u5404\u30C8\u30FC\u30AF\u30F3\u304C128\u500B\u306E1670\u4E07\u30B5\u30F3\u30D7\u30EB\u304C\u3042\u308A\u3001\u3053\u308C\u306F\u5408\u8A08\u3067\u7D0421\u5104\u30C8\u30FC\u30AF\u30F3\u306B\u76F8\u5F53\u3057\u307E\u3059\u3002\u53C2\u8003\u307E\u3067\u306B\u3001OpenAI\u306EGPT-3\u3068Codex\u30E2\u30C7\u30EB\u306F\u305D\u308C\u305E\u308C3000\u5104\u30011000\u5104\u306E\u30C8\u30FC\u30AF\u30F3\u3067\u5B66\u7FD2\u3055\u308C\u3066\u304A\u308A\u3001Codex\u30E2\u30C7\u30EB\u306FGPT-3\u306E\u30C1\u30A7\u30C3\u30AF\u30DD\u30A4\u30F3\u30C8\u304B\u3089\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u76EE\u7684\u306F\u3001\u9577\u304F\u3066\u4E00\u8CAB\u6027\u306E\u3042\u308B\u30C6\u30AD\u30B9\u30C8\u3092\u751F\u6210\u3067\u304D\u308B\u3053\u308C\u3089\u306E\u30E2\u30C7\u30EB\u3068\u7AF6\u5408\u3059\u308B\u3053\u3068\u3067\u306F\u306A\u304F\u3001\u30C7\u30FC\u30BF\u30B5\u30A4\u30A8\u30F3\u30C6\u30A3\u30B9\u30C8\u306E\u305F\u3081\u306E\u8FC5\u901F\u306A\u81EA\u52D5\u88DC\u5B8C\u6A5F\u80FD\u3092\u63D0\u4F9B\u3059\u308B\u7E2E\u5C0F\u7248\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u3067\u3059\u3002"),Wr.forEach(e),Da=u(s),bt=c(s,"P",{});var Xr=f(bt);Wt=n(Xr,"\u3055\u3066\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u6E96\u5099\u304C\u3067\u304D\u305F\u306E\u3067\u3001\u30E2\u30C7\u30EB\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u3066\u307F\u307E\u3057\u3087\u3046!"),Xr.forEach(e),Ca=u(s),v(U.$$.fragment,s),Oa=u(s),Ve=c(s,"H2",{id:!0});var Kr=f(Ve);nl=n(Kr,"\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u521D\u671F\u5316\u3059\u308B"),Kr.forEach(e),Aa=u(s),zs=c(s,"P",{});var Al=f(zs);rl=n(Al,"\u6700\u521D\u306E\u30B9\u30C6\u30C3\u30D7\u306F GPT-2 \u30E2\u30C7\u30EB\u3092\u65B0\u3057\u304F\u521D\u671F\u5316\u3059\u308B\u3053\u3068\u3067\u3059\u3002\u3053\u306E\u30E2\u30C7\u30EB\u306B\u306F\u5C0F\u578B\u306EGPT-2\u30E2\u30C7\u30EB\u3068\u540C\u3058\u8A2D\u5B9A\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u305D\u306E\u305F\u3081\u3001\u4E8B\u524D\u5B66\u7FD2\u6E08\u307F\u306E\u8A2D\u5B9A\u3092\u30ED\u30FC\u30C9\u3057\u3001\u30C8\u30FC\u30AF\u30CA\u30A4\u30B6\u30FC\u306E\u30B5\u30A4\u30BA\u304C\u30E2\u30C7\u30EB\u306E\u8A9E\u5F59\u30B5\u30A4\u30BA\u3068\u4E00\u81F4\u3059\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3001"),Xt=c(Al,"CODE",{});var Vr=f(Xt);pl=n(Vr,"bos"),Vr.forEach(e),ol=n(Al,"\u3068"),Kt=c(Al,"CODE",{});var Yr=f(Kt);il=n(Yr,"eos"),Yr.forEach(e),Ye=n(Al,"\uFF08\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u958B\u59CB\u3068\u7D42\u4E86\u3092\u610F\u5473\u3057\u307E\u3059\uFF09\u306E\u30C8\u30FC\u30AF\u30F3ID\u3092\u6E21\u3057\u307E\u3059\u3002"),Al.forEach(e),Ma=u(s),gs.l(s),Ps=u(s),ve=c(s,"P",{});var Pn=f(ve);_l=n(Pn,"\u3053\u306E\u30E2\u30C7\u30EB\u306B\u306F1\u51042400\u4E07\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u3042\u308A\u3001\u3053\u308C\u3092\u8ABF\u6574\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u958B\u59CB\u3059\u308B\u524D\u306B\u3001\u30D0\u30C3\u30C1\u3092\u4F5C\u6210\u3059\u308B\u305F\u3081\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u79C1\u9054\u306F"),Vt=c(Pn,"CODE",{});var Zr=f(Vt);cl=n(Zr,"DataCollatorForLanguageModeling"),Zr.forEach(e),kt=n(Pn,"\u3092\u4F7F\u3046\u4E8B\u304C\u3067\u304D\u307E\u3059\u3002"),Pn.forEach(e),Ga=u(s),qe=c(s,"P",{});var Tn=f(qe);fl=n(Tn,"\u3053\u308C\u306F\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u7528\u306B\u7279\u5225\u306B\u8A2D\u8A08\u3055\u308C\u305F\u3082\u306E\u3067\u3059\uFF08\u305D\u306E\u540D\u524D\u304C\u793A\u3059\u3068\u304A\u308A\uFF09\u3002\u30D0\u30C3\u30C1\u306E\u30B9\u30BF\u30C3\u30AF\u3068\u30D1\u30C7\u30A3\u30F3\u30B0\u306E\u4ED6\u306B\u307E\u305F\u3001\u8A00\u8A9E\u30E2\u30C7\u30EB\u306E\u30E9\u30D9\u30EB\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002\u56E0\u679C\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0\u3067\u306F\u3001\u5165\u529B\u3082\u30E9\u30D9\u30EB\u306E\u5F79\u5272\u3092\u679C\u305F\u3057\u307E\u3059\u304C\uFF08\u8981\u7D20\u30921\u3064\u305A\u3089\u3059\u3060\u3051\u3067\u3059\uFF09\u3001\u3053\u306E\u30C7\u30FC\u30BF\u30B3\u30EC\u30FC\u30BF\u30FC\u306F\u5B66\u7FD2\u4E2D\u306B\u30E9\u30D9\u30EB\u3092\u4F5C\u6210\u3059\u308B\u306E\u3067\u3001 "),Yt=c(Tn,"CODE",{});var Jr=f(Yt);Ze=n(Jr,"input_ids"),Jr.forEach(e),ml=n(Tn," \u3092\u91CD\u8907\u3055\u305B\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u305B\u3093\u3002"),Tn.forEach(e),Fa=u(s),ps=c(s,"P",{});var Kl=f(ps);Zt=c(Kl,"CODE",{});var Qr=f(Zt);ul=n(Qr,"DataCollatorForLanguageModeling"),Qr.forEach(e),dl=n(Kl," \u306F\u30DE\u30B9\u30AF\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0 (MLM) \u3068\u56E0\u679C\u8A00\u8A9E\u30E2\u30C7\u30EA\u30F3\u30B0 (CLM) \u306E\u4E21\u65B9\u3092\u30B5\u30DD\u30FC\u30C8\u3059\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F MLM \u7528\u306E\u30C7\u30FC\u30BF\u304C\u7528\u610F\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u5F15\u6570 "),Jt=c(Kl,"CODE",{});var sp=f(Jt);Je=n(sp,"mlm=False"),sp.forEach(e),hl=n(Kl," \u3092\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u3067CLM\u306B\u5207\u308A\u66FF\u3048\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002"),Kl.forEach(e),La=u(s),is.l(s),jt=u(s),gt=c(s,"P",{});var ep=f(gt);An=n(ep,"\u4F8B\u3092\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),ep.forEach(e),Vl=u(s),v(Ia.$$.fragment,s),Yl=u(s),xe.l(s),$l=u(s),bl=c(s,"P",{});var tp=f(bl);Mn=n(tp,"\u30B5\u30F3\u30D7\u30EB\u3092\u91CD\u306D\u3066\u307F\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u30C6\u30F3\u30BD\u30EB\u304C\u540C\u3058\u5F62\u3092\u3057\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u3002"),tp.forEach(e),Zl=u(s),ss&&ss.l(s),kl=u(s),v(Qt.$$.fragment,s),Jl=u(s),jl=c(s,"P",{});var ap=f(jl);Gn=n(ap,"\u3053\u308C\u3067\u3001\u5B9F\u969B\u306B\u30E2\u30C7\u30EB\u3092\u8A13\u7DF4\u3059\u308B\u305F\u3081\u306E\u6E96\u5099\u304C\u6574\u3044\u307E\u3057\u305F\u3002"),ap.forEach(e),Ql=u(s),gl=c(s,"P",{});var lp=f(gl);Fn=n(lp,"\u7D50\u5C40\u306E\u3068\u3053\u308D\u3001\u305D\u308C\u307B\u3069\u5927\u5909\u306A\u4F5C\u696D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u306D\u3002\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3092\u59CB\u3081\u308B\u524D\u306B\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9\u306B\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u3082\u3057\u30CE\u30FC\u30C8\u30D6\u30C3\u30AF\u3067\u4F5C\u696D\u3057\u3066\u3044\u308B\u306A\u3089\u3001\u6B21\u306E\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u95A2\u6570\u3067\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u307E\u3059\u3002"),lp.forEach(e),sn=u(s),v(Na.$$.fragment,s),en=u(s),wl=c(s,"P",{});var np=f(wl);Ln=n(np,"\u3053\u308C\u306B\u3088\u308A\u3001\u30CF\u30AE\u30F3\u30B0 \u30D5\u30A7\u30A4\u30B9\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u5165\u529B\u3059\u308B\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002"),np.forEach(e),tn=u(s),yl=c(s,"P",{});var rp=f(yl);In=n(rp,"\u30CE\u30FC\u30C8\u30D6\u30C3\u30AF\u3067\u4F5C\u696D\u3057\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u3001\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u6B21\u306E\u884C\u3092\u5165\u529B\u3059\u308B\u3060\u3051\u3067\u3059\u3002"),rp.forEach(e),an=u(s),v(Ha.$$.fragment,s),ln=u(s),Pe.l(s),vl=u(s),v(sa.$$.fragment,s),nn=u(s),v(ea.$$.fragment,s),rn=u(s),Sa=c(s,"H2",{id:!0});var pp=f(Sa);Nn=n(pp,"\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u306B\u3088\u308B\u30B3\u30FC\u30C9\u751F\u6210"),pp.forEach(e),pn=u(s),ta=c(s,"P",{});var Dn=f(ta);Hn=n(Dn,"\u3055\u3066\u3001\u3044\u3088\u3044\u3088\u672C\u756A\u3067\u3059\uFF01\u5B66\u7FD2\u3057\u305F\u30E2\u30C7\u30EB\u304C\u5B9F\u969B\u306B\u3069\u306E\u7A0B\u5EA6\u6A5F\u80FD\u3059\u308B\u306E\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u30ED\u30B0\u3092\u898B\u308B\u3068\u640D\u5931\u304C\u7740\u5B9F\u306B\u6E1B\u3063\u3066\u3044\u308B\u3053\u3068\u304C\u308F\u304B\u308A\u307E\u3059\u304C\u3001\u30E2\u30C7\u30EB\u3092\u30C6\u30B9\u30C8\u3059\u308B\u305F\u3081\u306B\u3001\u3044\u304F\u3064\u304B\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u306B\u5BFE\u3057\u3066\u3069\u306E\u7A0B\u5EA6\u52B9\u679C\u304C\u3042\u308B\u306E\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002\u305D\u306E\u305F\u3081\u306B\u3001\u30C6\u30AD\u30B9\u30C8\u751F\u6210\u306E "),Gl=c(Dn,"CODE",{});var op=f(Gl);Sn=n(op,"pipeline"),op.forEach(e),Rn=n(Dn," \u3067\u30E2\u30C7\u30EB\u3092\u30E9\u30C3\u30D7\u3057\u3001\u5229\u7528\u53EF\u80FD\u3067\u3042\u308C\u3070\u9AD8\u901F\u306B\u751F\u6210\u3059\u308B\u305F\u3081\u306B GPU \u306B\u4E57\u305B\u308B\u3053\u3068\u306B\u3057\u307E\u3059\u3002"),Dn.forEach(e),on=u(s),De.l(s),ql=u(s),El=c(s,"P",{});var ip=f(El);Bn=n(ip,"\u307E\u305A\u306F\u6563\u5E03\u56F3\u3092\u4F5C\u308B\u3068\u3044\u3046\u7C21\u5358\u306A\u4F5C\u696D\u304B\u3089\u59CB\u3081\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),ip.forEach(e),_n=u(s),v(Ra.$$.fragment,s),cn=u(s),v(Ba.$$.fragment,s),fn=u(s),Qe=c(s,"P",{});var Ml=f(Qe);Un=n(Ml,`\u7D50\u679C\u306F\u6B63\u3057\u3044\u3088\u3046\u3067\u3059\u3002
\u3053\u308C\u306F `),Fl=c(Ml,"CODE",{});var _p=f(Fl);Wn=n(_p,"pandas"),_p.forEach(e),Xn=n(Ml," \u30AA\u30DA\u30EC\u30FC\u30B7\u30E7\u30F3\u3067\u3082\u52D5\u4F5C\u3059\u308B\u306E\u3067\u3057\u3087\u3046\u304B\uFF1F2\u3064\u306E\u914D\u5217\u304B\u3089 "),Ll=c(Ml,"CODE",{});var cp=f(Ll);Kn=n(cp,"DataFrame"),cp.forEach(e),Vn=n(Ml," \u3092\u4F5C\u6210\u3067\u304D\u308B\u304B\u3069\u3046\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Ml.forEach(e),mn=u(s),v(Ua.$$.fragment,s),un=u(s),v(Wa.$$.fragment,s),dn=u(s),xl=c(s,"P",{});var fp=f(xl);Yn=n(fp,"\u3044\u3044\u306D\u3067\u3059\u306D\uFF01\u305D\u308C\u304C\u6B63\u89E3\u3067\u3059\u3002"),fp.forEach(e),hn=u(s),se=c(s,"P",{});var oa=f(se);Zn=n(oa,"\u3057\u304B\u3057\u3001\u305D\u306E\u5F8C\u3001\u5217 "),Il=c(oa,"CODE",{});var mp=f(Il);Jn=n(mp,"x"),mp.forEach(e),Qn=n(oa," \u3092\u518D\u3073\u633F\u5165\u3057\u3066\u3044\u307E\u3059\u3002\u751F\u6210\u3055\u308C\u308B\u30C8\u30FC\u30AF\u30F3\u306E\u6570\u306B\u306F\u9650\u308A\u304C\u3042\u308B\u306E\u3067\u3001\u6B21\u306E "),Nl=c(oa,"CODE",{});var up=f(Nl);sr=n(up,"for"),up.forEach(e),er=n(oa,` \u30EB\u30FC\u30D7\u306F\u5207\u308A\u6368\u3066\u3089\u308C\u3044\u307E\u3059\u3002
\u3082\u3046\u5C11\u3057\u8907\u96D1\u306A\u3053\u3068\u3092\u3057\u3066\u3001\u30E2\u30C7\u30EB\u306B `),Hl=c(oa,"CODE",{});var dp=f(Hl);tr=n(dp,"groupby"),dp.forEach(e),ar=n(oa," \u64CD\u4F5C\u3092\u4F7F\u308F\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u304B\u898B\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),oa.forEach(e),$n=u(s),v(Xa.$$.fragment,s),bn=u(s),v(Ka.$$.fragment,s),kn=u(s),aa=c(s,"P",{});var Cn=f(aa);lr=n(Cn,`\u60AA\u304F\u306A\u3044\u3067\u3059\u306D\u3002\u3053\u308C\u306F\u6B63\u3057\u3044\u3084\u308A\u65B9\u3067\u3059\u3002
\u6700\u5F8C\u306B\u3001`),Sl=c(Cn,"CODE",{});var hp=f(Sl);nr=n(hp,"scikit-learn"),hp.forEach(e),rr=n(Cn,"\u306B\u3082\u4F7F\u3048\u308B\u304B\u3069\u3046\u304B\u3001Random Forest\u30E2\u30C7\u30EB\u3092\u8A2D\u5B9A\u3057\u3066\u307F\u307E\u3057\u3087\u3046\u3002"),Cn.forEach(e),jn=u(s),v(Va.$$.fragment,s),gn=u(s),v(Ya.$$.fragment,s),wn=u(s),wt.l(s),zl=u(s),es&&es.l(s),Pl=On(),this.h()},h(){S(r,"name","hf:doc:metadata"),S(r,"content",JSON.stringify(Jp)),S(x,"id",""),S($,"href","/course/ja/chapter1"),S(Ae,"href","/course/ja/chapter6"),or(as.src,Me="https://hf.space/gradioiframe/course-demos/codeparrot-ds/+")||S(as,"src",Me),S(as,"frameborder","0"),S(as,"height","300"),S(as,"title","Gradio app"),S(as,"class","block dark:hidden container p-0 flex-grow space-iframe"),S(as,"allow","accelerometer; ambient-light-sensor; autoplay; battery; camera; document-domain; encrypted-media; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; vr ; wake-lock; xr-spatial-tracking"),S(as,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"),S(Cs,"href","https://huggingface.co/huggingface-course/codeparrot-ds?text=plt.imshow%28"),S(Cs,"rel","nofollow"),S(ms,"id",""),S(ls,"href","https://learning.oreilly.com/library/view/natural-language-processing/9781098103231/"),S(ls,"rel","nofollow"),S(te,"href","https://huggingface.co/datasets/transformersbook/codeparrot"),S(te,"rel","nofollow"),S(Bs,"id",""),S(Re,"href","/course/ja/chapter6/4"),S(Ws,"class","block dark:hidden"),or(Ws.src,Ue="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter7/chunking_texts.svg")||S(Ws,"src",Ue),S(Ws,"alt","Chunking a large texts in several pieces."),S(rs,"class","hidden dark:block"),or(rs.src,al="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter7/chunking_texts-dark.svg")||S(rs,"src",al),S(rs,"alt","Chunking a large texts in several pieces."),S(Es,"class","flex justify-center"),S(we,"href","/course/ja/chapter7/3"),S(Ve,"id",""),S(Sa,"id","")},m(s,i){t(document.head,r),p(s,d,i),q(o,s,i),p(s,h,i),p(s,x,i),t(x,g),p(s,P,i),Za[T].m(s,i),p(s,C,i),p(s,A,i),t(A,L),t(A,$),t($,G),t(A,I),t(A,W),t(W,F),t(A,R),p(s,X,i),p(s,z,i),t(z,N),t(z,H),t(H,K),t(z,J),t(z,V),t(V,ts),t(z,_s),t(z,O),t(O,B),t(z,Ce),t(z,ds),t(ds,Oe),t(z,Ts),p(s,vs,i),q(hs,s,i),p(s,yt,i),p(s,cs,i),t(cs,Ae),t(Ae,fa),t(cs,et),t(cs,tt),t(tt,ma),t(cs,vt),p(s,Ds,i),p(s,as,i),p(s,at,i),p(s,fs,i),t(fs,ua),t(fs,Cs),t(Cs,Ge),t(fs,da),p(s,lt,i),p(s,ms,i),t(ms,qt),p(s,ee,i),p(s,os,i),t(os,Et),t(os,ls),t(ls,nt),t(os,ha),t(os,rt),t(rt,pt),t(os,$a),t(os,te),t(te,ot),t(os,ba),p(s,it,i),p(s,Q,i),t(Q,ka),t(Q,ae),t(ae,ja),t(Q,ga),p(s,Fe,i),q(le,s,i),p(s,xt,i),p(s,ne,i),t(ne,re),p(s,_t,i),q($s,s,i),p(s,zt,i),q(Os,s,i),p(s,As,i),p(s,pe,i),t(pe,Le),p(s,Pt,i),q(Ms,s,i),p(s,Gs,i),p(s,oe,i),t(oe,qs),p(s,Ie,i),q(ie,s,i),p(s,Tt,i),q(bs,s,i),p(s,Dt,i),p(s,Ne,i),t(Ne,Ct),p(s,Fs,i),p(s,_e,i),t(_e,He),p(s,Ot,i),q(Ls,s,i),p(s,Is,i),q(Ns,s,i),p(s,ce,i),q(Hs,s,i),p(s,ct,i),p(s,ks,i),t(ks,At),p(s,Ss,i),q(Rs,s,i),p(s,us,i),q(fe,s,i),p(s,Se,i),p(s,me,i),t(me,ft),t(ft,mt),t(me,wa),p(s,Mt,i),p(s,Bs,i),t(Bs,ue),p(s,ut,i),q(Z,s,i),p(s,Gt,i),p(s,Us,i),t(Us,ya),p(s,Ft,i),p(s,ns,i),t(ns,va),t(ns,Re),t(Re,dt),t(ns,qa),t(ns,ht),t(ht,Lt),t(ns,de),t(ns,Be),t(Be,he),t(ns,It),p(s,$e,i),p(s,Es,i),t(Es,Ws),t(Es,Nt),t(Es,rs),p(s,We,i),p(s,Xe,i),t(Xe,Ea),p(s,Ke,i),q(be,s,i),p(s,Ht,i),q(Xs,s,i),p(s,ke,i),p(s,Ks,i),t(Ks,St),t(Ks,xs),t(xs,Rt),t(Ks,je),p(s,$t,i),p(s,Y,i),t(Y,xa),t(Y,ge),t(ge,za),t(Y,Pa),t(Y,we),t(we,ye),t(Y,Bt),t(Y,Vs),t(Vs,Ta),t(Y,Ut),p(s,Ys,i),q(Zs,s,i),p(s,Js,i),q(Qs,s,i),p(s,a,i),p(s,k,i),t(k,ll),p(s,Da,i),p(s,bt,i),t(bt,Wt),p(s,Ca,i),q(U,s,i),p(s,Oa,i),p(s,Ve,i),t(Ve,nl),p(s,Aa,i),p(s,zs,i),t(zs,rl),t(zs,Xt),t(Xt,pl),t(zs,ol),t(zs,Kt),t(Kt,il),t(zs,Ye),p(s,Ma,i),Ja[js].m(s,i),p(s,Ps,i),p(s,ve,i),t(ve,_l),t(ve,Vt),t(Vt,cl),t(ve,kt),p(s,Ga,i),p(s,qe,i),t(qe,fl),t(qe,Yt),t(Yt,Ze),t(qe,ml),p(s,Fa,i),p(s,ps,i),t(ps,Zt),t(Zt,ul),t(ps,dl),t(ps,Jt),t(Jt,Je),t(ps,hl),p(s,La,i),Qa[ws].m(s,i),p(s,jt,i),p(s,gt,i),t(gt,An),p(s,Vl,i),q(Ia,s,i),p(s,Yl,i),sl[Ee].m(s,i),p(s,$l,i),p(s,bl,i),t(bl,Mn),p(s,Zl,i),ss&&ss.m(s,i),p(s,kl,i),q(Qt,s,i),p(s,Jl,i),p(s,jl,i),t(jl,Gn),p(s,Ql,i),p(s,gl,i),t(gl,Fn),p(s,sn,i),q(Na,s,i),p(s,en,i),p(s,wl,i),t(wl,Ln),p(s,tn,i),p(s,yl,i),t(yl,In),p(s,an,i),q(Ha,s,i),p(s,ln,i),el[ze].m(s,i),p(s,vl,i),q(sa,s,i),p(s,nn,i),q(ea,s,i),p(s,rn,i),p(s,Sa,i),t(Sa,Nn),p(s,pn,i),p(s,ta,i),t(ta,Hn),t(ta,Gl),t(Gl,Sn),t(ta,Rn),p(s,on,i),tl[Te].m(s,i),p(s,ql,i),p(s,El,i),t(El,Bn),p(s,_n,i),q(Ra,s,i),p(s,cn,i),q(Ba,s,i),p(s,fn,i),p(s,Qe,i),t(Qe,Un),t(Qe,Fl),t(Fl,Wn),t(Qe,Xn),t(Qe,Ll),t(Ll,Kn),t(Qe,Vn),p(s,mn,i),q(Ua,s,i),p(s,un,i),q(Wa,s,i),p(s,dn,i),p(s,xl,i),t(xl,Yn),p(s,hn,i),p(s,se,i),t(se,Zn),t(se,Il),t(Il,Jn),t(se,Qn),t(se,Nl),t(Nl,sr),t(se,er),t(se,Hl),t(Hl,tr),t(se,ar),p(s,$n,i),q(Xa,s,i),p(s,bn,i),q(Ka,s,i),p(s,kn,i),p(s,aa,i),t(aa,lr),t(aa,Sl),t(Sl,nr),t(aa,rr),p(s,jn,i),q(Va,s,i),p(s,gn,i),q(Ya,s,i),p(s,wn,i),wt.m(s,i),p(s,zl,i),es&&es.m(s,i),p(s,Pl,i),yn=!0},p(s,[i]){const Rl={};i&1&&(Rl.fw=s[0]),o.$set(Rl);let st=T;T=cr(s),T!==st&&(_a(),j(Za[st],1,1,()=>{Za[st]=null}),ia(),w=Za[T],w||(w=Za[T]=_r[T](s),w.c()),b(w,1),w.m(C.parentNode,C));const Bl={};i&2&&(Bl.$$scope={dirty:i,ctx:s}),Hs.$set(Bl);const Ul={};i&2&&(Ul.$$scope={dirty:i,ctx:s}),U.$set(Ul);let ys=js;js=mr(s),js!==ys&&(_a(),j(Ja[ys],1,1,()=>{Ja[ys]=null}),ia(),gs=Ja[js],gs||(gs=Ja[js]=fr[js](s),gs.c()),b(gs,1),gs.m(Ps.parentNode,Ps));let Tl=ws;ws=dr(s),ws!==Tl&&(_a(),j(Qa[Tl],1,1,()=>{Qa[Tl]=null}),ia(),is=Qa[ws],is||(is=Qa[ws]=ur[ws](s),is.c()),b(is,1),is.m(jt.parentNode,jt));let Dl=Ee;Ee=$r(s),Ee!==Dl&&(_a(),j(sl[Dl],1,1,()=>{sl[Dl]=null}),ia(),xe=sl[Ee],xe||(xe=sl[Ee]=hr[Ee](s),xe.c()),b(xe,1),xe.m($l.parentNode,$l)),s[0]==="tf"?ss?i&1&&b(ss,1):(ss=$p(),ss.c(),b(ss,1),ss.m(kl.parentNode,kl)):ss&&(_a(),j(ss,1,1,()=>{ss=null}),ia());const Wl={};i&2&&(Wl.$$scope={dirty:i,ctx:s}),Qt.$set(Wl);let Cl=ze;ze=kr(s),ze!==Cl&&(_a(),j(el[Cl],1,1,()=>{el[Cl]=null}),ia(),Pe=el[ze],Pe||(Pe=el[ze]=br[ze](s),Pe.c()),b(Pe,1),Pe.m(vl.parentNode,vl));const la={};i&2&&(la.$$scope={dirty:i,ctx:s}),sa.$set(la);const Xl={};i&3&&(Xl.$$scope={dirty:i,ctx:s}),ea.$set(Xl);let Ol=Te;Te=gr(s),Te!==Ol&&(_a(),j(tl[Ol],1,1,()=>{tl[Ol]=null}),ia(),De=tl[Te],De||(De=tl[Te]=jr[Te](s),De.c()),b(De,1),De.m(ql.parentNode,ql)),vn!==(vn=wr(s))&&(wt.d(1),wt=vn(s),wt&&(wt.c(),wt.m(zl.parentNode,zl))),s[0]==="pt"?es?i&1&&b(es,1):(es=bp(s),es.c(),b(es,1),es.m(Pl.parentNode,Pl)):es&&(_a(),j(es,1,1,()=>{es=null}),ia())},i(s){yn||(b(o.$$.fragment,s),b(w),b(hs.$$.fragment,s),b(le.$$.fragment,s),b($s.$$.fragment,s),b(Os.$$.fragment,s),b(Ms.$$.fragment,s),b(ie.$$.fragment,s),b(bs.$$.fragment,s),b(Ls.$$.fragment,s),b(Ns.$$.fragment,s),b(Hs.$$.fragment,s),b(Rs.$$.fragment,s),b(fe.$$.fragment,s),b(Z.$$.fragment,s),b(be.$$.fragment,s),b(Xs.$$.fragment,s),b(Zs.$$.fragment,s),b(Qs.$$.fragment,s),b(U.$$.fragment,s),b(gs),b(is),b(Ia.$$.fragment,s),b(xe),b(ss),b(Qt.$$.fragment,s),b(Na.$$.fragment,s),b(Ha.$$.fragment,s),b(Pe),b(sa.$$.fragment,s),b(ea.$$.fragment,s),b(De),b(Ra.$$.fragment,s),b(Ba.$$.fragment,s),b(Ua.$$.fragment,s),b(Wa.$$.fragment,s),b(Xa.$$.fragment,s),b(Ka.$$.fragment,s),b(Va.$$.fragment,s),b(Ya.$$.fragment,s),b(es),yn=!0)},o(s){j(o.$$.fragment,s),j(w),j(hs.$$.fragment,s),j(le.$$.fragment,s),j($s.$$.fragment,s),j(Os.$$.fragment,s),j(Ms.$$.fragment,s),j(ie.$$.fragment,s),j(bs.$$.fragment,s),j(Ls.$$.fragment,s),j(Ns.$$.fragment,s),j(Hs.$$.fragment,s),j(Rs.$$.fragment,s),j(fe.$$.fragment,s),j(Z.$$.fragment,s),j(be.$$.fragment,s),j(Xs.$$.fragment,s),j(Zs.$$.fragment,s),j(Qs.$$.fragment,s),j(U.$$.fragment,s),j(gs),j(is),j(Ia.$$.fragment,s),j(xe),j(ss),j(Qt.$$.fragment,s),j(Na.$$.fragment,s),j(Ha.$$.fragment,s),j(Pe),j(sa.$$.fragment,s),j(ea.$$.fragment,s),j(De),j(Ra.$$.fragment,s),j(Ba.$$.fragment,s),j(Ua.$$.fragment,s),j(Wa.$$.fragment,s),j(Xa.$$.fragment,s),j(Ka.$$.fragment,s),j(Va.$$.fragment,s),j(Ya.$$.fragment,s),j(es),yn=!1},d(s){e(r),s&&e(d),E(o,s),s&&e(h),s&&e(x),s&&e(P),Za[T].d(s),s&&e(C),s&&e(A),s&&e(X),s&&e(z),s&&e(vs),E(hs,s),s&&e(yt),s&&e(cs),s&&e(Ds),s&&e(as),s&&e(at),s&&e(fs),s&&e(lt),s&&e(ms),s&&e(ee),s&&e(os),s&&e(it),s&&e(Q),s&&e(Fe),E(le,s),s&&e(xt),s&&e(ne),s&&e(_t),E($s,s),s&&e(zt),E(Os,s),s&&e(As),s&&e(pe),s&&e(Pt),E(Ms,s),s&&e(Gs),s&&e(oe),s&&e(Ie),E(ie,s),s&&e(Tt),E(bs,s),s&&e(Dt),s&&e(Ne),s&&e(Fs),s&&e(_e),s&&e(Ot),E(Ls,s),s&&e(Is),E(Ns,s),s&&e(ce),E(Hs,s),s&&e(ct),s&&e(ks),s&&e(Ss),E(Rs,s),s&&e(us),E(fe,s),s&&e(Se),s&&e(me),s&&e(Mt),s&&e(Bs),s&&e(ut),E(Z,s),s&&e(Gt),s&&e(Us),s&&e(Ft),s&&e(ns),s&&e($e),s&&e(Es),s&&e(We),s&&e(Xe),s&&e(Ke),E(be,s),s&&e(Ht),E(Xs,s),s&&e(ke),s&&e(Ks),s&&e($t),s&&e(Y),s&&e(Ys),E(Zs,s),s&&e(Js),E(Qs,s),s&&e(a),s&&e(k),s&&e(Da),s&&e(bt),s&&e(Ca),E(U,s),s&&e(Oa),s&&e(Ve),s&&e(Aa),s&&e(zs),s&&e(Ma),Ja[js].d(s),s&&e(Ps),s&&e(ve),s&&e(Ga),s&&e(qe),s&&e(Fa),s&&e(ps),s&&e(La),Qa[ws].d(s),s&&e(jt),s&&e(gt),s&&e(Vl),E(Ia,s),s&&e(Yl),sl[Ee].d(s),s&&e($l),s&&e(bl),s&&e(Zl),ss&&ss.d(s),s&&e(kl),E(Qt,s),s&&e(Jl),s&&e(jl),s&&e(Ql),s&&e(gl),s&&e(sn),E(Na,s),s&&e(en),s&&e(wl),s&&e(tn),s&&e(yl),s&&e(an),E(Ha,s),s&&e(ln),el[ze].d(s),s&&e(vl),E(sa,s),s&&e(nn),E(ea,s),s&&e(rn),s&&e(Sa),s&&e(pn),s&&e(ta),s&&e(on),tl[Te].d(s),s&&e(ql),s&&e(El),s&&e(_n),E(Ra,s),s&&e(cn),E(Ba,s),s&&e(fn),s&&e(Qe),s&&e(mn),E(Ua,s),s&&e(un),E(Wa,s),s&&e(dn),s&&e(xl),s&&e(hn),s&&e(se),s&&e($n),E(Xa,s),s&&e(bn),E(Ka,s),s&&e(kn),s&&e(aa),s&&e(jn),E(Va,s),s&&e(gn),E(Ya,s),s&&e(wn),wt.d(s),s&&e(zl),es&&es.d(s),s&&e(Pl)}}}const Jp={local:"",sections:[{local:"",title:"\u30C7\u30FC\u30BF\u3092\u53CE\u96C6\u3059\u308B"},{local:"",title:"\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u6E96\u5099"},{local:"",title:"\u65B0\u3057\u3044\u30E2\u30C7\u30EB\u3092\u521D\u671F\u5316\u3059\u308B"},{local:"",title:"\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u306B\u3088\u308B\u30B3\u30FC\u30C9\u751F\u6210"},{local:"accelerate",title:"\u{1F917} Accelerate \u3092\u4F7F\u3063\u305F\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0"}],title:"\u56E0\u679C\u8A00\u8A9E\u30E2\u30C7\u30EB\u3092\u4E00\u304B\u3089\u5B66\u7FD2"};function Qp(M,r,d){let o="pt";return vp(()=>{const h=new URLSearchParams(window.location.search);d(0,o=h.get("fw")||"pt")}),[o]}class po extends jp{constructor(r){super();gp(this,r,Qp,Zp,wp,{})}}export{po as default,Jp as metadata};
