import{s as Pt,o as Kt,n as ts}from"../chunks/scheduler.bdbef820.js";import{S as Ot,i as se,g as w,s as o,r as g,A as te,h as b,f as l,c as i,j as qt,u as d,x as T,k as St,y as ee,a,v as M,d as $,t as y,w as j,m as le,n as ae}from"../chunks/index.33f81d56.js";import{T as Jt}from"../chunks/Tip.34194030.js";import{Y as Dt}from"../chunks/Youtube.0e329b00.js";import{C as Z}from"../chunks/CodeBlock.362b34a4.js";import{D as ne}from"../chunks/DocNotebookDropdown.d5db5928.js";import{F as _t,M as Rs}from"../chunks/Markdown.03194dea.js";import{H as Fs,E as pe}from"../chunks/EditOnGithub.a9246e21.js";function re(U){let t,c='이 작업과 호환되는 모든 아키텍처와 체크포인트를 보려면 <a href="https://huggingface.co/tasks/text-generation" rel="nofollow">작업 페이지</a>를 확인하는 것이 좋습니다.';return{c(){t=w("p"),t.innerHTML=c},l(e){t=b(e,"P",{"data-svelte-h":!0}),T(t)!=="svelte-mlywsx"&&(t.innerHTML=c)},m(e,m){a(e,t,m)},p:ts,d(e){e&&l(t)}}}function oe(U){let t,c="패딩 토큰으로 종결 토큰을 사용하고 <code>mlm=False</code>로 설정하세요. 이렇게 하면 입력을 오른쪽으로 한 칸씩 시프트한 값을 레이블로 사용합니다:",e,m,h;return m=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvckZvckxhbmd1YWdlTW9kZWxpbmclMEElMEF0b2tlbml6ZXIucGFkX3Rva2VuJTIwJTNEJTIwdG9rZW5pemVyLmVvc190b2tlbiUwQWRhdGFfY29sbGF0b3IlMjAlM0QlMjBEYXRhQ29sbGF0b3JGb3JMYW5ndWFnZU1vZGVsaW5nKHRva2VuaXplciUzRHRva2VuaXplciUyQyUyMG1sbSUzREZhbHNlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForLanguageModeling

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.pad_token = tokenizer.eos_token
<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=<span class="hljs-literal">False</span>)`,wrap:!1}}),{c(){t=w("p"),t.innerHTML=c,e=o(),g(m.$$.fragment)},l(u){t=b(u,"P",{"data-svelte-h":!0}),T(t)!=="svelte-xhgrka"&&(t.innerHTML=c),e=i(u),d(m.$$.fragment,u)},m(u,v){a(u,t,v),a(u,e,v),M(m,u,v),h=!0},p:ts,i(u){h||($(m.$$.fragment,u),h=!0)},o(u){y(m.$$.fragment,u),h=!1},d(u){u&&(l(t),l(e)),j(m,u)}}}function ie(U){let t,c;return t=new Rs({props:{$$slots:{default:[oe]},$$scope:{ctx:U}}}),{c(){g(t.$$.fragment)},l(e){d(t.$$.fragment,e)},m(e,m){M(t,e,m),c=!0},p(e,m){const h={};m&2&&(h.$$scope={dirty:m,ctx:e}),t.$set(h)},i(e){c||($(t.$$.fragment,e),c=!0)},o(e){y(t.$$.fragment,e),c=!1},d(e){j(t,e)}}}function me(U){let t,c="패딩 토큰으로 종결 토큰을 사용하고 <code>mlm=False</code>로 설정하세요. 이렇게 하면 입력을 오른쪽으로 한 칸씩 시프트한 값을 레이블로 사용합니다:",e,m,h;return m=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvckZvckxhbmd1YWdlTW9kZWxpbmclMEElMEFkYXRhX2NvbGxhdG9yJTIwJTNEJTIwRGF0YUNvbGxhdG9yRm9yTGFuZ3VhZ2VNb2RlbGluZyh0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMjBtbG0lM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForLanguageModeling

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`,wrap:!1}}),{c(){t=w("p"),t.innerHTML=c,e=o(),g(m.$$.fragment)},l(u){t=b(u,"P",{"data-svelte-h":!0}),T(t)!=="svelte-xhgrka"&&(t.innerHTML=c),e=i(u),d(m.$$.fragment,u)},m(u,v){a(u,t,v),a(u,e,v),M(m,u,v),h=!0},p:ts,i(u){h||($(m.$$.fragment,u),h=!0)},o(u){y(m.$$.fragment,u),h=!1},d(u){u&&(l(t),l(e)),j(m,u)}}}function ce(U){let t,c;return t=new Rs({props:{$$slots:{default:[me]},$$scope:{ctx:U}}}),{c(){g(t.$$.fragment)},l(e){d(t.$$.fragment,e)},m(e,m){M(t,e,m),c=!0},p(e,m){const h={};m&2&&(h.$$scope={dirty:m,ctx:e}),t.$set(h)},i(e){c||($(t.$$.fragment,e),c=!0)},o(e){y(t.$$.fragment,e),c=!1},d(e){j(t,e)}}}function fe(U){let t,c='<a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer">Trainer</a>를 사용하여 모델을 미세 조정하는 방법을 잘 모르신다면 <a href="../training#train-with-pytorch-trainer">기본 튜토리얼</a>을 확인해보세요!';return{c(){t=w("p"),t.innerHTML=c},l(e){t=b(e,"P",{"data-svelte-h":!0}),T(t)!=="svelte-1upaaem"&&(t.innerHTML=c)},m(e,m){a(e,t,m)},p:ts,d(e){e&&l(t)}}}function ue(U){let t,c,e,m='이제 모델을 훈련하기 준비가 되었습니다! <a href="/docs/transformers/pr_30530/ko/model_doc/auto#transformers.AutoModelForCausalLM">AutoModelForCausalLM</a>를 사용하여 DistilGPT2를 불러옵니다:',h,u,v,I,G="여기까지 진행하면 세 단계만 남았습니다:",R,C,X='<li><a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>에서 훈련 하이퍼파라미터를 정의하세요. <code>output_dir</code>은 유일한 필수 매개변수로, 모델을 저장할 위치를 지정합니다. (먼저 Hugging Face에 로그인 필수) <code>push_to_hub=True</code>로 설정하여 이 모델을 허브에 업로드할 수 있습니다.</li> <li>훈련 인수를 <a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer">Trainer</a>에 모델, 데이터 세트 및 데이터 콜레이터와 함께 전달하세요.</li> <li><a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer.train">train()</a>을 호출하여 모델을 미세 조정하세요.</li>',V,_,W,p,J='훈련이 완료되면 <a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer.evaluate">evaluate()</a> 메소드를 사용하여 모델을 평가하고 퍼플렉서티를 얻을 수 있습니다:',Q,Y,z,N,L='그런 다음 <a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> 메소드를 사용하여 모델을 허브에 공유하세요. 이렇게 하면 누구나 모델을 사용할 수 있습니다:',F,E,B;return t=new Jt({props:{$$slots:{default:[fe]},$$scope:{ctx:U}}}),u=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMkMlMjBUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGdwdDIlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilbert/distilgpt2&quot;</span>)`,wrap:!1}}),_=new Z({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX2VsaTVfY2xtLW1vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdHJhdGVneSUzRCUyMmVwb2NoJTIyJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDJlLTUlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0RsbV9kYXRhc2V0JTVCJTIydHJhaW4lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0RsbV9kYXRhc2V0JTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;my_awesome_eli5_clm-model&quot;</span>,
<span class="hljs-meta">... </span>    eval_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">2e-5</span>,
<span class="hljs-meta">... </span>    weight_decay=<span class="hljs-number">0.01</span>,
<span class="hljs-meta">... </span>    push_to_hub=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=lm_dataset[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=lm_dataset[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`,wrap:!1}}),Y=new Z({props:{code:"aW1wb3J0JTIwbWF0aCUwQSUwQWV2YWxfcmVzdWx0cyUyMCUzRCUyMHRyYWluZXIuZXZhbHVhdGUoKSUwQXByaW50KGYlMjJQZXJwbGV4aXR5JTNBJTIwJTdCbWF0aC5leHAoZXZhbF9yZXN1bHRzJTVCJ2V2YWxfbG9zcyclNUQpJTNBLjJmJTdEJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> math

<span class="hljs-meta">&gt;&gt;&gt; </span>eval_results = trainer.evaluate()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Perplexity: <span class="hljs-subst">{math.exp(eval_results[<span class="hljs-string">&#x27;eval_loss&#x27;</span>]):<span class="hljs-number">.2</span>f}</span>&quot;</span>)
Perplexity: <span class="hljs-number">49.61</span>`,wrap:!1}}),E=new Z({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){g(t.$$.fragment),c=o(),e=w("p"),e.innerHTML=m,h=o(),g(u.$$.fragment),v=o(),I=w("p"),I.textContent=G,R=o(),C=w("ol"),C.innerHTML=X,V=o(),g(_.$$.fragment),W=o(),p=w("p"),p.innerHTML=J,Q=o(),g(Y.$$.fragment),z=o(),N=w("p"),N.innerHTML=L,F=o(),g(E.$$.fragment)},l(f){d(t.$$.fragment,f),c=i(f),e=b(f,"P",{"data-svelte-h":!0}),T(e)!=="svelte-i23f7m"&&(e.innerHTML=m),h=i(f),d(u.$$.fragment,f),v=i(f),I=b(f,"P",{"data-svelte-h":!0}),T(I)!=="svelte-scyina"&&(I.textContent=G),R=i(f),C=b(f,"OL",{"data-svelte-h":!0}),T(C)!=="svelte-dg3vep"&&(C.innerHTML=X),V=i(f),d(_.$$.fragment,f),W=i(f),p=b(f,"P",{"data-svelte-h":!0}),T(p)!=="svelte-p2nepn"&&(p.innerHTML=J),Q=i(f),d(Y.$$.fragment,f),z=i(f),N=b(f,"P",{"data-svelte-h":!0}),T(N)!=="svelte-15dm5mn"&&(N.innerHTML=L),F=i(f),d(E.$$.fragment,f)},m(f,k){M(t,f,k),a(f,c,k),a(f,e,k),a(f,h,k),M(u,f,k),a(f,v,k),a(f,I,k),a(f,R,k),a(f,C,k),a(f,V,k),M(_,f,k),a(f,W,k),a(f,p,k),a(f,Q,k),M(Y,f,k),a(f,z,k),a(f,N,k),a(f,F,k),M(E,f,k),B=!0},p(f,k){const H={};k&2&&(H.$$scope={dirty:k,ctx:f}),t.$set(H)},i(f){B||($(t.$$.fragment,f),$(u.$$.fragment,f),$(_.$$.fragment,f),$(Y.$$.fragment,f),$(E.$$.fragment,f),B=!0)},o(f){y(t.$$.fragment,f),y(u.$$.fragment,f),y(_.$$.fragment,f),y(Y.$$.fragment,f),y(E.$$.fragment,f),B=!1},d(f){f&&(l(c),l(e),l(h),l(v),l(I),l(R),l(C),l(V),l(W),l(p),l(Q),l(z),l(N),l(F)),j(t,f),j(u,f),j(_,f),j(Y,f),j(E,f)}}}function he(U){let t,c;return t=new Rs({props:{$$slots:{default:[ue]},$$scope:{ctx:U}}}),{c(){g(t.$$.fragment)},l(e){d(t.$$.fragment,e)},m(e,m){M(t,e,m),c=!0},p(e,m){const h={};m&2&&(h.$$scope={dirty:m,ctx:e}),t.$set(h)},i(e){c||($(t.$$.fragment,e),c=!0)},o(e){y(t.$$.fragment,e),c=!1},d(e){j(t,e)}}}function ge(U){let t,c='Keras를 사용하여 모델을 미세 조정하는 방법에 익숙하지 않다면 <a href="../training#train-a-tensorflow-model-with-keras">기본 튜토리얼</a>을 확인해보세요!';return{c(){t=w("p"),t.innerHTML=c},l(e){t=b(e,"P",{"data-svelte-h":!0}),T(t)!=="svelte-1qjtntp"&&(t.innerHTML=c)},m(e,m){a(e,t,m)},p:ts,d(e){e&&l(t)}}}function de(U){let t,c,e,m,h,u='그런 다음 <a href="/docs/transformers/pr_30530/ko/model_doc/auto#transformers.TFAutoModelForCausalLM">TFAutoModelForCausalLM</a>를 사용하여 DistilGPT2를 불러옵니다:',v,I,G,R,C='<a href="/docs/transformers/pr_30530/ko/main_classes/model#transformers.TFPreTrainedModel.prepare_tf_dataset">prepare_tf_dataset()</a>을 사용하여 데이터 세트를 <code>tf.data.Dataset</code> 형식으로 변환하세요:',X,V,_,W,p='<a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>을 사용하여 모델을 훈련하기 위해 구성하세요. Transformers 모델은 모두 기본적인 작업 관련 손실 함수를 가지고 있으므로, 원한다면 별도로 지정하지 않아도 됩니다:',J,Q,Y,z,N='<a href="/docs/transformers/pr_30530/ko/main_classes/keras_callbacks#transformers.PushToHubCallback">PushToHubCallback</a>에서 모델과 토크나이저를 업로드할 위치를 지정할 수 있습니다:',L,F,E,B,f='마지막으로, 모델을 훈련하기 위해 <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a>을 호출하세요. 훈련 데이터 세트, 검증 데이터 세트, 에폭 수 및 콜백을 전달하세요:',k,H,S,A,Ws="훈련이 완료되면 모델이 자동으로 허브에 업로드되어 모두가 사용할 수 있습니다!",D;return t=new Jt({props:{$$slots:{default:[ge]},$$scope:{ctx:U}}}),e=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGNyZWF0ZV9vcHRpbWl6ZXIlMkMlMjBBZGFtV2VpZ2h0RGVjYXklMEElMEFvcHRpbWl6ZXIlMjAlM0QlMjBBZGFtV2VpZ2h0RGVjYXkobGVhcm5pbmdfcmF0ZSUzRDJlLTUlMkMlMjB3ZWlnaHRfZGVjYXlfcmF0ZSUzRDAuMDEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer, AdamWeightDecay

<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer = AdamWeightDecay(learning_rate=<span class="hljs-number">2e-5</span>, weight_decay_rate=<span class="hljs-number">0.01</span>)`,wrap:!1}}),I=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQlMkZkaXN0aWxncHQyJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilbert/distilgpt2&quot;</span>)`,wrap:!1}}),V=new Z({props:{code:"dGZfdHJhaW5fc2V0JTIwJTNEJTIwbW9kZWwucHJlcGFyZV90Zl9kYXRhc2V0KCUwQSUyMCUyMCUyMCUyMGxtX2RhdGFzZXQlNUIlMjJ0cmFpbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHNodWZmbGUlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwY29sbGF0ZV9mbiUzRGRhdGFfY29sbGF0b3IlMkMlMEEpJTBBJTBBdGZfdGVzdF9zZXQlMjAlM0QlMjBtb2RlbC5wcmVwYXJlX3RmX2RhdGFzZXQoJTBBJTIwJTIwJTIwJTIwbG1fZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBzaHVmZmxlJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBiYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBjb2xsYXRlX2ZuJTNEZGF0YV9jb2xsYXRvciUyQyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_set = model.prepare_tf_dataset(
<span class="hljs-meta">... </span>    lm_dataset[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_test_set = model.prepare_tf_dataset(
<span class="hljs-meta">... </span>    lm_dataset[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)`,wrap:!1}}),Q=new Z({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEFtb2RlbC5jb21waWxlKG9wdGltaXplciUzRG9wdGltaXplciklMjAlMjAlMjMlMjAlRUIlQjMlODQlRUIlOEYlODQlRUIlQTElOUMlMjBsb3NzJTIwJUVDJTlEJUI4JUVDJTlFJTkwJUVCJUE1JUJDJTIwJUVCJTg0JUEzJUVDJUE3JTgwJTIwJUVDJTk1JThBJUVDJTk1JTk4JUVDJTk2JUI0JUVDJTlBJTk0IQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)  <span class="hljs-comment"># 별도로 loss 인자를 넣지 않았어요!</span>`,wrap:!1}}),F=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5rZXJhc19jYWxsYmFja3MlMjBpbXBvcnQlMjBQdXNoVG9IdWJDYWxsYmFjayUwQSUwQWNhbGxiYWNrJTIwJTNEJTIwUHVzaFRvSHViQ2FsbGJhY2soJTBBJTIwJTIwJTIwJTIwb3V0cHV0X2RpciUzRCUyMm15X2F3ZXNvbWVfZWxpNV9jbG0tbW9kZWwlMjIlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.keras_callbacks <span class="hljs-keyword">import</span> PushToHubCallback

<span class="hljs-meta">&gt;&gt;&gt; </span>callback = PushToHubCallback(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;my_awesome_eli5_clm-model&quot;</span>,
<span class="hljs-meta">... </span>    tokenizer=tokenizer,
<span class="hljs-meta">... </span>)`,wrap:!1}}),H=new Z({props:{code:"bW9kZWwuZml0KHglM0R0Zl90cmFpbl9zZXQlMkMlMjB2YWxpZGF0aW9uX2RhdGElM0R0Zl90ZXN0X3NldCUyQyUyMGVwb2NocyUzRDMlMkMlMjBjYWxsYmFja3MlM0QlNUJjYWxsYmFjayU1RCk=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(x=tf_train_set, validation_data=tf_test_set, epochs=<span class="hljs-number">3</span>, callbacks=[callback])',wrap:!1}}),{c(){g(t.$$.fragment),c=le(`
TensorFlow에서 모델을 미세 조정하려면, 먼저 옵티마이저 함수, 학습률 스케줄 및 일부 훈련 하이퍼파라미터를 설정하세요:

	`),g(e.$$.fragment),m=o(),h=w("p"),h.innerHTML=u,v=o(),g(I.$$.fragment),G=o(),R=w("p"),R.innerHTML=C,X=o(),g(V.$$.fragment),_=o(),W=w("p"),W.innerHTML=p,J=o(),g(Q.$$.fragment),Y=o(),z=w("p"),z.innerHTML=N,L=o(),g(F.$$.fragment),E=o(),B=w("p"),B.innerHTML=f,k=o(),g(H.$$.fragment),S=o(),A=w("p"),A.textContent=Ws},l(r){d(t.$$.fragment,r),c=ae(r,`
TensorFlow에서 모델을 미세 조정하려면, 먼저 옵티마이저 함수, 학습률 스케줄 및 일부 훈련 하이퍼파라미터를 설정하세요:

	`),d(e.$$.fragment,r),m=i(r),h=b(r,"P",{"data-svelte-h":!0}),T(h)!=="svelte-3jsda0"&&(h.innerHTML=u),v=i(r),d(I.$$.fragment,r),G=i(r),R=b(r,"P",{"data-svelte-h":!0}),T(R)!=="svelte-j9nq3u"&&(R.innerHTML=C),X=i(r),d(V.$$.fragment,r),_=i(r),W=b(r,"P",{"data-svelte-h":!0}),T(W)!=="svelte-bkxxon"&&(W.innerHTML=p),J=i(r),d(Q.$$.fragment,r),Y=i(r),z=b(r,"P",{"data-svelte-h":!0}),T(z)!=="svelte-8lv4ip"&&(z.innerHTML=N),L=i(r),d(F.$$.fragment,r),E=i(r),B=b(r,"P",{"data-svelte-h":!0}),T(B)!=="svelte-az37qz"&&(B.innerHTML=f),k=i(r),d(H.$$.fragment,r),S=i(r),A=b(r,"P",{"data-svelte-h":!0}),T(A)!=="svelte-avna1r"&&(A.textContent=Ws)},m(r,x){M(t,r,x),a(r,c,x),M(e,r,x),a(r,m,x),a(r,h,x),a(r,v,x),M(I,r,x),a(r,G,x),a(r,R,x),a(r,X,x),M(V,r,x),a(r,_,x),a(r,W,x),a(r,J,x),M(Q,r,x),a(r,Y,x),a(r,z,x),a(r,L,x),M(F,r,x),a(r,E,x),a(r,B,x),a(r,k,x),M(H,r,x),a(r,S,x),a(r,A,x),D=!0},p(r,x){const q={};x&2&&(q.$$scope={dirty:x,ctx:r}),t.$set(q)},i(r){D||($(t.$$.fragment,r),$(e.$$.fragment,r),$(I.$$.fragment,r),$(V.$$.fragment,r),$(Q.$$.fragment,r),$(F.$$.fragment,r),$(H.$$.fragment,r),D=!0)},o(r){y(t.$$.fragment,r),y(e.$$.fragment,r),y(I.$$.fragment,r),y(V.$$.fragment,r),y(Q.$$.fragment,r),y(F.$$.fragment,r),y(H.$$.fragment,r),D=!1},d(r){r&&(l(c),l(m),l(h),l(v),l(G),l(R),l(X),l(_),l(W),l(J),l(Y),l(z),l(L),l(E),l(B),l(k),l(S),l(A)),j(t,r),j(e,r),j(I,r),j(V,r),j(Q,r),j(F,r),j(H,r)}}}function Me(U){let t,c;return t=new Rs({props:{$$slots:{default:[de]},$$scope:{ctx:U}}}),{c(){g(t.$$.fragment)},l(e){d(t.$$.fragment,e)},m(e,m){M(t,e,m),c=!0},p(e,m){const h={};m&2&&(h.$$scope={dirty:m,ctx:e}),t.$set(h)},i(e){c||($(t.$$.fragment,e),c=!0)},o(e){y(t.$$.fragment,e),c=!1},d(e){j(t,e)}}}function $e(U){let t,c='인과 언어 모델링을 위해 모델을 미세 조정하는 더 자세한 예제는 해당하는 <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb" rel="nofollow">PyTorch 노트북</a> 또는 <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb" rel="nofollow">TensorFlow 노트북</a>을 참조하세요.';return{c(){t=w("p"),t.innerHTML=c},l(e){t=b(e,"P",{"data-svelte-h":!0}),T(t)!=="svelte-7gnqxq"&&(t.innerHTML=c)},m(e,m){a(e,t,m)},p:ts,d(e){e&&l(t)}}}function ye(U){let t,c="텍스트를 토큰화하고 <code>input_ids</code>를 PyTorch 텐서로 반환하세요:",e,m,h,u,v='<a href="/docs/transformers/pr_30530/ko/main_classes/text_generation#transformers.GenerationMixin.generate">generate()</a> 메소드를 사용하여 텍스트를 생성하세요. 생성을 제어하는 다양한 텍스트 생성 전략과 매개변수에 대한 자세한 내용은 <a href="../generation_strategies">텍스트 생성 전략</a> 페이지를 확인하세요.',I,G,R,C,X="생성된 토큰 ID를 다시 텍스트로 디코딩하세요:",V,_,W;return m=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJteV9hd2Vzb21lX2VsaTVfY2xtLW1vZGVsJTIyKSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;my_awesome_eli5_clm-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids`,wrap:!1}}),G=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIybXlfYXdlc29tZV9lbGk1X2NsbS1tb2RlbCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzJTJDJTIwbWF4X25ld190b2tlbnMlM0QxMDAlMkMlMjBkb19zYW1wbGUlM0RUcnVlJTJDJTIwdG9wX2slM0Q1MCUyQyUyMHRvcF9wJTNEMC45NSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;my_awesome_eli5_clm-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(inputs, max_new_tokens=<span class="hljs-number">100</span>, do_sample=<span class="hljs-literal">True</span>, top_k=<span class="hljs-number">50</span>, top_p=<span class="hljs-number">0.95</span>)`,wrap:!1}}),_=new Z({props:{code:"dG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)
[<span class="hljs-string">&quot;Somatic hypermutation allows the immune system to react to drugs with the ability to adapt to a different environmental situation. In other words, a system of &#x27;hypermutation&#x27; can help the immune system to adapt to a different environmental situation or in some cases even a single life. In contrast, researchers at the University of Massachusetts-Boston have found that &#x27;hypermutation&#x27; is much stronger in mice than in humans but can be found in humans, and that it&#x27;s not completely unknown to the immune system. A study on how the immune system&quot;</span>]`,wrap:!1}}),{c(){t=w("p"),t.innerHTML=c,e=o(),g(m.$$.fragment),h=o(),u=w("p"),u.innerHTML=v,I=o(),g(G.$$.fragment),R=o(),C=w("p"),C.textContent=X,V=o(),g(_.$$.fragment)},l(p){t=b(p,"P",{"data-svelte-h":!0}),T(t)!=="svelte-1b4fw1g"&&(t.innerHTML=c),e=i(p),d(m.$$.fragment,p),h=i(p),u=b(p,"P",{"data-svelte-h":!0}),T(u)!=="svelte-9j0u2s"&&(u.innerHTML=v),I=i(p),d(G.$$.fragment,p),R=i(p),C=b(p,"P",{"data-svelte-h":!0}),T(C)!=="svelte-1wns5q7"&&(C.textContent=X),V=i(p),d(_.$$.fragment,p)},m(p,J){a(p,t,J),a(p,e,J),M(m,p,J),a(p,h,J),a(p,u,J),a(p,I,J),M(G,p,J),a(p,R,J),a(p,C,J),a(p,V,J),M(_,p,J),W=!0},p:ts,i(p){W||($(m.$$.fragment,p),$(G.$$.fragment,p),$(_.$$.fragment,p),W=!0)},o(p){y(m.$$.fragment,p),y(G.$$.fragment,p),y(_.$$.fragment,p),W=!1},d(p){p&&(l(t),l(e),l(h),l(u),l(I),l(R),l(C),l(V)),j(m,p),j(G,p),j(_,p)}}}function je(U){let t,c;return t=new Rs({props:{$$slots:{default:[ye]},$$scope:{ctx:U}}}),{c(){g(t.$$.fragment)},l(e){d(t.$$.fragment,e)},m(e,m){M(t,e,m),c=!0},p(e,m){const h={};m&2&&(h.$$scope={dirty:m,ctx:e}),t.$set(h)},i(e){c||($(t.$$.fragment,e),c=!0)},o(e){y(t.$$.fragment,e),c=!1},d(e){j(t,e)}}}function we(U){let t,c="텍스트를 토큰화하고 <code>input_ids</code>를 TensorFlow 텐서로 반환하세요:",e,m,h,u,v='<code>~transformers.generation_tf_utils.TFGenerationMixin.generate</code> 메소드를 사용하여 요약을 생성하세요. 생성을 제어하는 다양한 텍스트 생성 전략과 매개변수에 대한 자세한 내용은 <a href="../generation_strategies">텍스트 생성 전략</a> 페이지를 확인하세요.',I,G,R,C,X="생성된 토큰 ID를 다시 텍스트로 디코딩하세요:",V,_,W;return m=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJteV9hd2Vzb21lX2VsaTVfY2xtLW1vZGVsJTIyKSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKS5pbnB1dF9pZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;my_awesome_eli5_clm-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_ids`,wrap:!1}}),G=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMm15X2F3ZXNvbWVfZWxpNV9jbG0tbW9kZWwlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0X2lkcyUzRGlucHV0cyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTAwJTJDJTIwZG9fc2FtcGxlJTNEVHJ1ZSUyQyUyMHRvcF9rJTNENTAlMkMlMjB0b3BfcCUzRDAuOTUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;my_awesome_eli5_clm-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids=inputs, max_new_tokens=<span class="hljs-number">100</span>, do_sample=<span class="hljs-literal">True</span>, top_k=<span class="hljs-number">50</span>, top_p=<span class="hljs-number">0.95</span>)`,wrap:!1}}),_=new Z({props:{code:"dG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)
[<span class="hljs-string">&#x27;Somatic hypermutation allows the immune system to detect the presence of other viruses as they become more prevalent. Therefore, researchers have identified a high proportion of human viruses. The proportion of virus-associated viruses in our study increases with age. Therefore, we propose a simple algorithm to detect the presence of these new viruses in our samples as a sign of improved immunity. A first study based on this algorithm, which will be published in Science on Friday, aims to show that this finding could translate into the development of a better vaccine that is more effective for&#x27;</span>]`,wrap:!1}}),{c(){t=w("p"),t.innerHTML=c,e=o(),g(m.$$.fragment),h=o(),u=w("p"),u.innerHTML=v,I=o(),g(G.$$.fragment),R=o(),C=w("p"),C.textContent=X,V=o(),g(_.$$.fragment)},l(p){t=b(p,"P",{"data-svelte-h":!0}),T(t)!=="svelte-jhzp8k"&&(t.innerHTML=c),e=i(p),d(m.$$.fragment,p),h=i(p),u=b(p,"P",{"data-svelte-h":!0}),T(u)!=="svelte-10xpnv5"&&(u.innerHTML=v),I=i(p),d(G.$$.fragment,p),R=i(p),C=b(p,"P",{"data-svelte-h":!0}),T(C)!=="svelte-1wns5q7"&&(C.textContent=X),V=i(p),d(_.$$.fragment,p)},m(p,J){a(p,t,J),a(p,e,J),M(m,p,J),a(p,h,J),a(p,u,J),a(p,I,J),M(G,p,J),a(p,R,J),a(p,C,J),a(p,V,J),M(_,p,J),W=!0},p:ts,i(p){W||($(m.$$.fragment,p),$(G.$$.fragment,p),$(_.$$.fragment,p),W=!0)},o(p){y(m.$$.fragment,p),y(G.$$.fragment,p),y(_.$$.fragment,p),W=!1},d(p){p&&(l(t),l(e),l(h),l(u),l(I),l(R),l(C),l(V)),j(m,p),j(G,p),j(_,p)}}}function be(U){let t,c;return t=new Rs({props:{$$slots:{default:[we]},$$scope:{ctx:U}}}),{c(){g(t.$$.fragment)},l(e){d(t.$$.fragment,e)},m(e,m){M(t,e,m),c=!0},p(e,m){const h={};m&2&&(h.$$scope={dirty:m,ctx:e}),t.$set(h)},i(e){c||($(t.$$.fragment,e),c=!0)},o(e){y(t.$$.fragment,e),c=!1},d(e){j(t,e)}}}function Te(U){let t,c,e,m,h,u,v,I,G,R=`언어 모델링은 인과적 언어 모델링과 마스크드 언어 모델링, 두 가지 유형으로 나뉩니다. 이 가이드에서는 인과적 언어 모델링을 설명합니다.
인과 언어 모델은 텍스트 생성에 자주 사용됩니다. 또 창의적인 방향으로 응용할 수 있습니다.
직접 사용하며 재미있는 탐구를 해보거나, Copilot 또는 CodeParrot와 같은 지능형 코딩 어시스턴트의 기반이 되기도 합니다.`,C,X,V,_,W=`인과 언어 모델링은 토큰 시퀀스에서 다음 토큰을 예측하며, 모델은 왼쪽의 토큰에만 접근할 수 있습니다.
이는 모델이 미래의 토큰을 볼 수 없다는 것을 의미합니다. 인과 언어 모델의 예로 GPT-2가 있죠.`,p,J,Q="이 가이드에서는 다음 작업을 수행하는 방법을 안내합니다:",Y,z,N='<li><a href="https://huggingface.co/distilbert/distilgpt2" rel="nofollow">DistilGPT2</a> 모델을 <a href="https://huggingface.co/datasets/eli5" rel="nofollow">ELI5</a> 데이터 세트의 <a href="https://www.reddit.com/r/askscience/" rel="nofollow">r/askscience</a> 하위 집합으로 미세 조정</li> <li>미세 조정된 모델을 추론에 사용</li>',L,F,E,B,f="시작하기 전에 필요한 라이브러리가 모두 설치되어 있는지 확인하세요:",k,H,S,A,Ws="커뮤니티에 모델을 업로드하고 공유하기 위해 Hugging Face 계정에 로그인하는 것을 권장합니다. 알림이 표시되면 토큰을 입력하여 로그인하세요:",D,r,x,q,zs,es,xt=`먼저, 🤗 Datasets 라이브러리에서 r/askscience의 작은 하위 집합인 ELI5 데이터 세트를 불러옵니다.
이를 통해 전체 데이터 세트에서 학습하는 데 더 많은 시간을 투자하기 전에, 실험해봄으로써 모든 것이 작동하는지 확인할 수 있습니다.`,Bs,ls,Hs,as,kt="데이터 세트의 <code>train_asks</code> 분할을 <code>train_test_split</code> 메소드를 사용하여 학습 및 테스트 세트로 분할합니다:",Ys,ns,Es,ps,Ut="그런 다음 예제를 살펴보세요:",Qs,rs,As,os,vt="많아 보일 수 있지만, 실제로는 <code>text</code> 필드만 중요합니다. 언어 모델링 작업의 장점은 레이블이 필요하지 않다는 것입니다. 다음 단어 <em>자체가</em> 레이블입니다. (이렇게 레이블을 제공하지 않아도 되는 학습을 비지도 학습이라고 일컫습니다)",Ns,is,Ls,ms,qs,cs,Gt="다음 단계는 <code>text</code> 필드를 전처리하기 위해 DistilGPT2 토크나이저를 불러오는 것입니다.",Ss,fs,Ds,us,Ct='위의 예제에서 알 수 있듯이, <code>text</code> 필드는 <code>answers</code> 아래에 중첩되어 있습니다. 따라서 <a href="https://huggingface.co/docs/datasets/process#flatten" rel="nofollow"><code>flatten</code></a> 메소드를 사용하여 중첩 구조에서 <code>text</code> 하위 필드를 추출해야 합니다.',Ps,hs,Ks,gs,Zt="각 하위 필드는 이제 <code>answers</code> 접두사를 가진 별도의 열로 나뉘었으며, <code>text</code> 필드는 이제 리스트입니다. 각 문장을 개별적으로 토큰화하는 대신, 먼저 리스트를 문자열로 변환하여 한꺼번에 토큰화할 수 있습니다.",Os,ds,It="다음은 문자열 리스트를 결합하고 결과를 토큰화하는 첫 번째 전처리 함수입니다:",st,Ms,tt,$s,Vt="이 전처리 함수를 전체 데이터 세트에 적용하려면 🤗 Datasets <code>map</code> 메소드를 사용하세요. <code>batched=True</code>로 설정하여 데이터셋의 여러 요소를 한 번에 처리하고, <code>num_proc</code>를 증가시켜 프로세스 수를 늘릴 수 있습니다. 필요 없는 열은 제거하세요:",et,ys,lt,js,Rt="이제 데이터 세트는 시퀀스가 토큰화됐지만, 일부 시퀀스는 모델의 최대 입력 길이보다 길 수 있습니다.",at,ws,Wt="이제 두 번째 전처리 함수를 사용하여",nt,bs,Xt="<li>모든 시퀀스를 연결하고,</li> <li><code>block_size</code>로 정의된 길이로 연결된 시퀀스를 여러 개의 짧은 묶음으로 나눕니다. 이 값은 최대 입력 길이와 GPU RAM을 고려해 충분히 짧아야 합니다.</li>",pt,Ts,rt,Js,Ft="전체 데이터 세트에 <code>group_texts</code> 함수를 적용하세요:",ot,_s,it,xs,zt='그런 다음 <a href="/docs/transformers/pr_30530/ko/main_classes/data_collator#transformers.DataCollatorForLanguageModeling">DataCollatorForLanguageModeling</a>을 사용하여 예제의 배치를 만듭니다. 데이터 세트 전체를 최대 길이로 패딩하는 것보다, 취합 단계에서 각 배치의 최대 길이로 문장을 <em>동적으로 패딩</em>하는 것이 더 효율적입니다.',mt,P,ct,ks,ft,K,ut,O,ht,Us,gt,vs,Bt="좋아요, 이제 모델을 미세 조정했으므로 추론에 사용할 수 있습니다!",dt,Gs,Ht="생성할 텍스트를 위한 프롬프트를 만들어보세요:",Mt,Cs,$t,Zs,Yt="추론을 위해 미세 조정된 모델을 간단히 사용하는 가장 간단한 방법은 <code>pipeline()</code>에서 사용하는 것입니다. 모델과 함께 텍스트 생성을 위한 <code>pipeline</code>을 인스턴스화하고 텍스트를 전달하세요:",yt,Is,jt,ss,wt,Vs,bt,Xs,Tt;return h=new Fs({props:{title:"인과 언어 모델링",local:"causal-language-modeling",headingTag:"h1"}}),v=new ne({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/language_modeling.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/language_modeling.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/language_modeling.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/language_modeling.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/language_modeling.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/language_modeling.ipynb"}]}}),X=new Dt({props:{id:"Vpjb1lu0MDk"}}),F=new Jt({props:{$$slots:{default:[re]},$$scope:{ctx:U}}}),H=new Z({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGU=",highlighted:"pip install transformers datasets evaluate",wrap:!1}}),r=new Z({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

<span class="hljs-meta">&gt;&gt;&gt; </span>notebook_login()`,wrap:!1}}),q=new Fs({props:{title:"ELI5 데이터 세트 불러오기",local:"load-eli5-dataset",headingTag:"h2"}}),ls=new Z({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZWxpNSUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJlbGk1JTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbl9hc2tzJTVCJTNBNTAwMCU1RCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>eli5 = load_dataset(<span class="hljs-string">&quot;eli5&quot;</span>, split=<span class="hljs-string">&quot;train_asks[:5000]&quot;</span>)`,wrap:!1}}),ns=new Z({props:{code:"ZWxpNSUyMCUzRCUyMGVsaTUudHJhaW5fdGVzdF9zcGxpdCh0ZXN0X3NpemUlM0QwLjIp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>eli5 = eli5.train_test_split(test_size=<span class="hljs-number">0.2</span>)',wrap:!1}}),rs=new Z({props:{code:"ZWxpNSU1QiUyMnRyYWluJTIyJTVEJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>eli5[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;answers&#x27;</span>: {<span class="hljs-string">&#x27;a_id&#x27;</span>: [<span class="hljs-string">&#x27;c3d1aib&#x27;</span>, <span class="hljs-string">&#x27;c3d4lya&#x27;</span>],
  <span class="hljs-string">&#x27;score&#x27;</span>: [<span class="hljs-number">6</span>, <span class="hljs-number">3</span>],
  <span class="hljs-string">&#x27;text&#x27;</span>: [<span class="hljs-string">&quot;The velocity needed to remain in orbit is equal to the square root of Newton&#x27;s constant times the mass of earth divided by the distance from the center of the earth. I don&#x27;t know the altitude of that specific mission, but they&#x27;re usually around 300 km. That means he&#x27;s going 7-8 km/s.\\n\\nIn space there are no other forces acting on either the shuttle or the guy, so they stay in the same position relative to each other. If he were to become unable to return to the ship, he would presumably run out of oxygen, or slowly fall into the atmosphere and burn up.&quot;</span>,
   <span class="hljs-string">&quot;Hope you don&#x27;t mind me asking another question, but why aren&#x27;t there any stars visible in this photo?&quot;</span>]},
 <span class="hljs-string">&#x27;answers_urls&#x27;</span>: {<span class="hljs-string">&#x27;url&#x27;</span>: []},
 <span class="hljs-string">&#x27;document&#x27;</span>: <span class="hljs-string">&#x27;&#x27;</span>,
 <span class="hljs-string">&#x27;q_id&#x27;</span>: <span class="hljs-string">&#x27;nyxfp&#x27;</span>,
 <span class="hljs-string">&#x27;selftext&#x27;</span>: <span class="hljs-string">&#x27;_URL_0_\\n\\nThis was on the front page earlier and I have a few questions about it. Is it possible to calculate how fast the astronaut would be orbiting the earth? Also how does he stay close to the shuttle so that he can return safely, i.e is he orbiting at the same speed and can therefore stay next to it? And finally if his propulsion system failed, would he eventually re-enter the atmosphere and presumably die?&#x27;</span>,
 <span class="hljs-string">&#x27;selftext_urls&#x27;</span>: {<span class="hljs-string">&#x27;url&#x27;</span>: [<span class="hljs-string">&#x27;http://apod.nasa.gov/apod/image/1201/freeflyer_nasa_3000.jpg&#x27;</span>]},
 <span class="hljs-string">&#x27;subreddit&#x27;</span>: <span class="hljs-string">&#x27;askscience&#x27;</span>,
 <span class="hljs-string">&#x27;title&#x27;</span>: <span class="hljs-string">&#x27;Few questions about this space walk photograph.&#x27;</span>,
 <span class="hljs-string">&#x27;title_urls&#x27;</span>: {<span class="hljs-string">&#x27;url&#x27;</span>: []}}`,wrap:!1}}),is=new Fs({props:{title:"전처리",local:"preprocess",headingTag:"h2"}}),ms=new Dt({props:{id:"ma1TrR7gE7I"}}),fs=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0JTJGZGlzdGlsZ3B0MiUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert/distilgpt2&quot;</span>)`,wrap:!1}}),hs=new Z({props:{code:"ZWxpNSUyMCUzRCUyMGVsaTUuZmxhdHRlbigpJTBBZWxpNSU1QiUyMnRyYWluJTIyJTVEJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>eli5 = eli5.flatten()
<span class="hljs-meta">&gt;&gt;&gt; </span>eli5[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;answers.a_id&#x27;</span>: [<span class="hljs-string">&#x27;c3d1aib&#x27;</span>, <span class="hljs-string">&#x27;c3d4lya&#x27;</span>],
 <span class="hljs-string">&#x27;answers.score&#x27;</span>: [<span class="hljs-number">6</span>, <span class="hljs-number">3</span>],
 <span class="hljs-string">&#x27;answers.text&#x27;</span>: [<span class="hljs-string">&quot;The velocity needed to remain in orbit is equal to the square root of Newton&#x27;s constant times the mass of earth divided by the distance from the center of the earth. I don&#x27;t know the altitude of that specific mission, but they&#x27;re usually around 300 km. That means he&#x27;s going 7-8 km/s.\\n\\nIn space there are no other forces acting on either the shuttle or the guy, so they stay in the same position relative to each other. If he were to become unable to return to the ship, he would presumably run out of oxygen, or slowly fall into the atmosphere and burn up.&quot;</span>,
  <span class="hljs-string">&quot;Hope you don&#x27;t mind me asking another question, but why aren&#x27;t there any stars visible in this photo?&quot;</span>],
 <span class="hljs-string">&#x27;answers_urls.url&#x27;</span>: [],
 <span class="hljs-string">&#x27;document&#x27;</span>: <span class="hljs-string">&#x27;&#x27;</span>,
 <span class="hljs-string">&#x27;q_id&#x27;</span>: <span class="hljs-string">&#x27;nyxfp&#x27;</span>,
 <span class="hljs-string">&#x27;selftext&#x27;</span>: <span class="hljs-string">&#x27;_URL_0_\\n\\nThis was on the front page earlier and I have a few questions about it. Is it possible to calculate how fast the astronaut would be orbiting the earth? Also how does he stay close to the shuttle so that he can return safely, i.e is he orbiting at the same speed and can therefore stay next to it? And finally if his propulsion system failed, would he eventually re-enter the atmosphere and presumably die?&#x27;</span>,
 <span class="hljs-string">&#x27;selftext_urls.url&#x27;</span>: [<span class="hljs-string">&#x27;http://apod.nasa.gov/apod/image/1201/freeflyer_nasa_3000.jpg&#x27;</span>],
 <span class="hljs-string">&#x27;subreddit&#x27;</span>: <span class="hljs-string">&#x27;askscience&#x27;</span>,
 <span class="hljs-string">&#x27;title&#x27;</span>: <span class="hljs-string">&#x27;Few questions about this space walk photograph.&#x27;</span>,
 <span class="hljs-string">&#x27;title_urls.url&#x27;</span>: []}`,wrap:!1}}),Ms=new Z({props:{code:"ZGVmJTIwcHJlcHJvY2Vzc19mdW5jdGlvbihleGFtcGxlcyklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjB0b2tlbml6ZXIoJTVCJTIyJTIwJTIyLmpvaW4oeCklMjBmb3IlMjB4JTIwaW4lMjBleGFtcGxlcyU1QiUyMmFuc3dlcnMudGV4dCUyMiU1RCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">preprocess_function</span>(<span class="hljs-params">examples</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> tokenizer([<span class="hljs-string">&quot; &quot;</span>.join(x) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> examples[<span class="hljs-string">&quot;answers.text&quot;</span>]])`,wrap:!1}}),ys=new Z({props:{code:"dG9rZW5pemVkX2VsaTUlMjAlM0QlMjBlbGk1Lm1hcCglMEElMjAlMjAlMjAlMjBwcmVwcm9jZXNzX2Z1bmN0aW9uJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hlZCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBudW1fcHJvYyUzRDQlMkMlMEElMjAlMjAlMjAlMjByZW1vdmVfY29sdW1ucyUzRGVsaTUlNUIlMjJ0cmFpbiUyMiU1RC5jb2x1bW5fbmFtZXMlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_eli5 = eli5.<span class="hljs-built_in">map</span>(
<span class="hljs-meta">... </span>    preprocess_function,
<span class="hljs-meta">... </span>    batched=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    num_proc=<span class="hljs-number">4</span>,
<span class="hljs-meta">... </span>    remove_columns=eli5[<span class="hljs-string">&quot;train&quot;</span>].column_names,
<span class="hljs-meta">... </span>)`,wrap:!1}}),Ts=new Z({props:{code:"YmxvY2tfc2l6ZSUyMCUzRCUyMDEyOCUwQSUwQSUwQWRlZiUyMGdyb3VwX3RleHRzKGV4YW1wbGVzKSUzQSUwQSUyMCUyMCUyMCUyMCUyMyUyMENvbmNhdGVuYXRlJTIwYWxsJTIwdGV4dHMuJTBBJTIwJTIwJTIwJTIwY29uY2F0ZW5hdGVkX2V4YW1wbGVzJTIwJTNEJTIwJTdCayUzQSUyMHN1bShleGFtcGxlcyU1QmslNUQlMkMlMjAlNUIlNUQpJTIwZm9yJTIwayUyMGluJTIwZXhhbXBsZXMua2V5cygpJTdEJTBBJTIwJTIwJTIwJTIwdG90YWxfbGVuZ3RoJTIwJTNEJTIwbGVuKGNvbmNhdGVuYXRlZF9leGFtcGxlcyU1Qmxpc3QoZXhhbXBsZXMua2V5cygpKSU1QjAlNUQlNUQpJTBBJTIwJTIwJTIwJTIwJTIzJTIwV2UlMjBkcm9wJTIwdGhlJTIwc21hbGwlMjByZW1haW5kZXIlMkMlMjB3ZSUyMGNvdWxkJTIwYWRkJTIwcGFkZGluZyUyMGlmJTIwdGhlJTIwbW9kZWwlMjBzdXBwb3J0ZWQlMjBpdCUyMGluc3RlYWQlMjBvZiUyMHRoaXMlMjBkcm9wJTJDJTIweW91JTIwY2FuJTBBJTIwJTIwJTIwJTIwJTIzJTIwY3VzdG9taXplJTIwdGhpcyUyMHBhcnQlMjB0byUyMHlvdXIlMjBuZWVkcy4lMEElMjAlMjAlMjAlMjBpZiUyMHRvdGFsX2xlbmd0aCUyMCUzRSUzRCUyMGJsb2NrX3NpemUlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB0b3RhbF9sZW5ndGglMjAlM0QlMjAodG90YWxfbGVuZ3RoJTIwJTJGJTJGJTIwYmxvY2tfc2l6ZSklMjAqJTIwYmxvY2tfc2l6ZSUwQSUyMCUyMCUyMCUyMCUyMyUyMFNwbGl0JTIwYnklMjBjaHVua3MlMjBvZiUyMGJsb2NrX3NpemUuJTBBJTIwJTIwJTIwJTIwcmVzdWx0JTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwayUzQSUyMCU1QnQlNUJpJTIwJTNBJTIwaSUyMCUyQiUyMGJsb2NrX3NpemUlNUQlMjBmb3IlMjBpJTIwaW4lMjByYW5nZSgwJTJDJTIwdG90YWxfbGVuZ3RoJTJDJTIwYmxvY2tfc2l6ZSklNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmb3IlMjBrJTJDJTIwdCUyMGluJTIwY29uY2F0ZW5hdGVkX2V4YW1wbGVzLml0ZW1zKCklMEElMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlMjAlMjByZXN1bHQlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjByZXN1bHQlNUIlMjJpbnB1dF9pZHMlMjIlNUQuY29weSgpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwcmVzdWx0",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>block_size = <span class="hljs-number">128</span>


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">group_texts</span>(<span class="hljs-params">examples</span>):
<span class="hljs-meta">... </span>    <span class="hljs-comment"># Concatenate all texts.</span>
<span class="hljs-meta">... </span>    concatenated_examples = {k: <span class="hljs-built_in">sum</span>(examples[k], []) <span class="hljs-keyword">for</span> k <span class="hljs-keyword">in</span> examples.keys()}
<span class="hljs-meta">... </span>    total_length = <span class="hljs-built_in">len</span>(concatenated_examples[<span class="hljs-built_in">list</span>(examples.keys())[<span class="hljs-number">0</span>]])
<span class="hljs-meta">... </span>    <span class="hljs-comment"># We drop the small remainder, we could add padding if the model supported it instead of this drop, you can</span>
<span class="hljs-meta">... </span>    <span class="hljs-comment"># customize this part to your needs.</span>
<span class="hljs-meta">... </span>    <span class="hljs-keyword">if</span> total_length &gt;= block_size:
<span class="hljs-meta">... </span>        total_length = (total_length // block_size) * block_size
<span class="hljs-meta">... </span>    <span class="hljs-comment"># Split by chunks of block_size.</span>
<span class="hljs-meta">... </span>    result = {
<span class="hljs-meta">... </span>        k: [t[i : i + block_size] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">0</span>, total_length, block_size)]
<span class="hljs-meta">... </span>        <span class="hljs-keyword">for</span> k, t <span class="hljs-keyword">in</span> concatenated_examples.items()
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>    result[<span class="hljs-string">&quot;labels&quot;</span>] = result[<span class="hljs-string">&quot;input_ids&quot;</span>].copy()
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> result`,wrap:!1}}),_s=new Z({props:{code:"bG1fZGF0YXNldCUyMCUzRCUyMHRva2VuaXplZF9lbGk1Lm1hcChncm91cF90ZXh0cyUyQyUyMGJhdGNoZWQlM0RUcnVlJTJDJTIwbnVtX3Byb2MlM0Q0KQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>lm_dataset = tokenized_eli5.<span class="hljs-built_in">map</span>(group_texts, batched=<span class="hljs-literal">True</span>, num_proc=<span class="hljs-number">4</span>)',wrap:!1}}),P=new _t({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ce],pytorch:[ie]},$$scope:{ctx:U}}}),ks=new Fs({props:{title:"훈련",local:"train",headingTag:"h2"}}),K=new _t({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Me],pytorch:[he]},$$scope:{ctx:U}}}),O=new Jt({props:{$$slots:{default:[$e]},$$scope:{ctx:U}}}),Us=new Fs({props:{title:"추론",local:"inference",headingTag:"h2"}}),Cs=new Z({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyU29tYXRpYyUyMGh5cGVybXV0YXRpb24lMjBhbGxvd3MlMjB0aGUlMjBpbW11bmUlMjBzeXN0ZW0lMjB0byUyMg==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Somatic hypermutation allows the immune system to&quot;</span>',wrap:!1}}),Is=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBZ2VuZXJhdG9yJTIwJTNEJTIwcGlwZWxpbmUoJTIydGV4dC1nZW5lcmF0aW9uJTIyJTJDJTIwbW9kZWwlM0QlMjJteV9hd2Vzb21lX2VsaTVfY2xtLW1vZGVsJTIyKSUwQWdlbmVyYXRvcihwcm9tcHQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>generator = pipeline(<span class="hljs-string">&quot;text-generation&quot;</span>, model=<span class="hljs-string">&quot;my_awesome_eli5_clm-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generator(prompt)
[{<span class="hljs-string">&#x27;generated_text&#x27;</span>: <span class="hljs-string">&quot;Somatic hypermutation allows the immune system to be able to effectively reverse the damage caused by an infection.\\n\\n\\nThe damage caused by an infection is caused by the immune system&#x27;s ability to perform its own self-correcting tasks.&quot;</span>}]`,wrap:!1}}),ss=new _t({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[be],pytorch:[je]},$$scope:{ctx:U}}}),Vs=new pe({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/tasks/language_modeling.md"}}),{c(){t=w("meta"),c=o(),e=w("p"),m=o(),g(h.$$.fragment),u=o(),g(v.$$.fragment),I=o(),G=w("p"),G.textContent=R,C=o(),g(X.$$.fragment),V=o(),_=w("p"),_.textContent=W,p=o(),J=w("p"),J.textContent=Q,Y=o(),z=w("ol"),z.innerHTML=N,L=o(),g(F.$$.fragment),E=o(),B=w("p"),B.textContent=f,k=o(),g(H.$$.fragment),S=o(),A=w("p"),A.textContent=Ws,D=o(),g(r.$$.fragment),x=o(),g(q.$$.fragment),zs=o(),es=w("p"),es.textContent=xt,Bs=o(),g(ls.$$.fragment),Hs=o(),as=w("p"),as.innerHTML=kt,Ys=o(),g(ns.$$.fragment),Es=o(),ps=w("p"),ps.textContent=Ut,Qs=o(),g(rs.$$.fragment),As=o(),os=w("p"),os.innerHTML=vt,Ns=o(),g(is.$$.fragment),Ls=o(),g(ms.$$.fragment),qs=o(),cs=w("p"),cs.innerHTML=Gt,Ss=o(),g(fs.$$.fragment),Ds=o(),us=w("p"),us.innerHTML=Ct,Ps=o(),g(hs.$$.fragment),Ks=o(),gs=w("p"),gs.innerHTML=Zt,Os=o(),ds=w("p"),ds.textContent=It,st=o(),g(Ms.$$.fragment),tt=o(),$s=w("p"),$s.innerHTML=Vt,et=o(),g(ys.$$.fragment),lt=o(),js=w("p"),js.textContent=Rt,at=o(),ws=w("p"),ws.textContent=Wt,nt=o(),bs=w("ul"),bs.innerHTML=Xt,pt=o(),g(Ts.$$.fragment),rt=o(),Js=w("p"),Js.innerHTML=Ft,ot=o(),g(_s.$$.fragment),it=o(),xs=w("p"),xs.innerHTML=zt,mt=o(),g(P.$$.fragment),ct=o(),g(ks.$$.fragment),ft=o(),g(K.$$.fragment),ut=o(),g(O.$$.fragment),ht=o(),g(Us.$$.fragment),gt=o(),vs=w("p"),vs.textContent=Bt,dt=o(),Gs=w("p"),Gs.textContent=Ht,Mt=o(),g(Cs.$$.fragment),$t=o(),Zs=w("p"),Zs.innerHTML=Yt,yt=o(),g(Is.$$.fragment),jt=o(),g(ss.$$.fragment),wt=o(),g(Vs.$$.fragment),bt=o(),Xs=w("p"),this.h()},l(s){const n=te("svelte-u9bgzb",document.head);t=b(n,"META",{name:!0,content:!0}),n.forEach(l),c=i(s),e=b(s,"P",{}),qt(e).forEach(l),m=i(s),d(h.$$.fragment,s),u=i(s),d(v.$$.fragment,s),I=i(s),G=b(s,"P",{"data-svelte-h":!0}),T(G)!=="svelte-zdtuex"&&(G.textContent=R),C=i(s),d(X.$$.fragment,s),V=i(s),_=b(s,"P",{"data-svelte-h":!0}),T(_)!=="svelte-611b95"&&(_.textContent=W),p=i(s),J=b(s,"P",{"data-svelte-h":!0}),T(J)!=="svelte-x18r2q"&&(J.textContent=Q),Y=i(s),z=b(s,"OL",{"data-svelte-h":!0}),T(z)!=="svelte-uvx0a8"&&(z.innerHTML=N),L=i(s),d(F.$$.fragment,s),E=i(s),B=b(s,"P",{"data-svelte-h":!0}),T(B)!=="svelte-1k0z9pm"&&(B.textContent=f),k=i(s),d(H.$$.fragment,s),S=i(s),A=b(s,"P",{"data-svelte-h":!0}),T(A)!=="svelte-tqxze0"&&(A.textContent=Ws),D=i(s),d(r.$$.fragment,s),x=i(s),d(q.$$.fragment,s),zs=i(s),es=b(s,"P",{"data-svelte-h":!0}),T(es)!=="svelte-8ukoq1"&&(es.textContent=xt),Bs=i(s),d(ls.$$.fragment,s),Hs=i(s),as=b(s,"P",{"data-svelte-h":!0}),T(as)!=="svelte-12jrw1i"&&(as.innerHTML=kt),Ys=i(s),d(ns.$$.fragment,s),Es=i(s),ps=b(s,"P",{"data-svelte-h":!0}),T(ps)!=="svelte-12bood2"&&(ps.textContent=Ut),Qs=i(s),d(rs.$$.fragment,s),As=i(s),os=b(s,"P",{"data-svelte-h":!0}),T(os)!=="svelte-j851qf"&&(os.innerHTML=vt),Ns=i(s),d(is.$$.fragment,s),Ls=i(s),d(ms.$$.fragment,s),qs=i(s),cs=b(s,"P",{"data-svelte-h":!0}),T(cs)!=="svelte-vkts6u"&&(cs.innerHTML=Gt),Ss=i(s),d(fs.$$.fragment,s),Ds=i(s),us=b(s,"P",{"data-svelte-h":!0}),T(us)!=="svelte-cu6vm0"&&(us.innerHTML=Ct),Ps=i(s),d(hs.$$.fragment,s),Ks=i(s),gs=b(s,"P",{"data-svelte-h":!0}),T(gs)!=="svelte-16uyepd"&&(gs.innerHTML=Zt),Os=i(s),ds=b(s,"P",{"data-svelte-h":!0}),T(ds)!=="svelte-1n68t0t"&&(ds.textContent=It),st=i(s),d(Ms.$$.fragment,s),tt=i(s),$s=b(s,"P",{"data-svelte-h":!0}),T($s)!=="svelte-321xw1"&&($s.innerHTML=Vt),et=i(s),d(ys.$$.fragment,s),lt=i(s),js=b(s,"P",{"data-svelte-h":!0}),T(js)!=="svelte-lan0yv"&&(js.textContent=Rt),at=i(s),ws=b(s,"P",{"data-svelte-h":!0}),T(ws)!=="svelte-1mquexd"&&(ws.textContent=Wt),nt=i(s),bs=b(s,"UL",{"data-svelte-h":!0}),T(bs)!=="svelte-hoxk8w"&&(bs.innerHTML=Xt),pt=i(s),d(Ts.$$.fragment,s),rt=i(s),Js=b(s,"P",{"data-svelte-h":!0}),T(Js)!=="svelte-51k2an"&&(Js.innerHTML=Ft),ot=i(s),d(_s.$$.fragment,s),it=i(s),xs=b(s,"P",{"data-svelte-h":!0}),T(xs)!=="svelte-1o601ai"&&(xs.innerHTML=zt),mt=i(s),d(P.$$.fragment,s),ct=i(s),d(ks.$$.fragment,s),ft=i(s),d(K.$$.fragment,s),ut=i(s),d(O.$$.fragment,s),ht=i(s),d(Us.$$.fragment,s),gt=i(s),vs=b(s,"P",{"data-svelte-h":!0}),T(vs)!=="svelte-jox0kl"&&(vs.textContent=Bt),dt=i(s),Gs=b(s,"P",{"data-svelte-h":!0}),T(Gs)!=="svelte-itb1wv"&&(Gs.textContent=Ht),Mt=i(s),d(Cs.$$.fragment,s),$t=i(s),Zs=b(s,"P",{"data-svelte-h":!0}),T(Zs)!=="svelte-3cxlyd"&&(Zs.innerHTML=Yt),yt=i(s),d(Is.$$.fragment,s),jt=i(s),d(ss.$$.fragment,s),wt=i(s),d(Vs.$$.fragment,s),bt=i(s),Xs=b(s,"P",{}),qt(Xs).forEach(l),this.h()},h(){St(t,"name","hf:doc:metadata"),St(t,"content",Je)},m(s,n){ee(document.head,t),a(s,c,n),a(s,e,n),a(s,m,n),M(h,s,n),a(s,u,n),M(v,s,n),a(s,I,n),a(s,G,n),a(s,C,n),M(X,s,n),a(s,V,n),a(s,_,n),a(s,p,n),a(s,J,n),a(s,Y,n),a(s,z,n),a(s,L,n),M(F,s,n),a(s,E,n),a(s,B,n),a(s,k,n),M(H,s,n),a(s,S,n),a(s,A,n),a(s,D,n),M(r,s,n),a(s,x,n),M(q,s,n),a(s,zs,n),a(s,es,n),a(s,Bs,n),M(ls,s,n),a(s,Hs,n),a(s,as,n),a(s,Ys,n),M(ns,s,n),a(s,Es,n),a(s,ps,n),a(s,Qs,n),M(rs,s,n),a(s,As,n),a(s,os,n),a(s,Ns,n),M(is,s,n),a(s,Ls,n),M(ms,s,n),a(s,qs,n),a(s,cs,n),a(s,Ss,n),M(fs,s,n),a(s,Ds,n),a(s,us,n),a(s,Ps,n),M(hs,s,n),a(s,Ks,n),a(s,gs,n),a(s,Os,n),a(s,ds,n),a(s,st,n),M(Ms,s,n),a(s,tt,n),a(s,$s,n),a(s,et,n),M(ys,s,n),a(s,lt,n),a(s,js,n),a(s,at,n),a(s,ws,n),a(s,nt,n),a(s,bs,n),a(s,pt,n),M(Ts,s,n),a(s,rt,n),a(s,Js,n),a(s,ot,n),M(_s,s,n),a(s,it,n),a(s,xs,n),a(s,mt,n),M(P,s,n),a(s,ct,n),M(ks,s,n),a(s,ft,n),M(K,s,n),a(s,ut,n),M(O,s,n),a(s,ht,n),M(Us,s,n),a(s,gt,n),a(s,vs,n),a(s,dt,n),a(s,Gs,n),a(s,Mt,n),M(Cs,s,n),a(s,$t,n),a(s,Zs,n),a(s,yt,n),M(Is,s,n),a(s,jt,n),M(ss,s,n),a(s,wt,n),M(Vs,s,n),a(s,bt,n),a(s,Xs,n),Tt=!0},p(s,[n]){const Et={};n&2&&(Et.$$scope={dirty:n,ctx:s}),F.$set(Et);const Qt={};n&2&&(Qt.$$scope={dirty:n,ctx:s}),P.$set(Qt);const At={};n&2&&(At.$$scope={dirty:n,ctx:s}),K.$set(At);const Nt={};n&2&&(Nt.$$scope={dirty:n,ctx:s}),O.$set(Nt);const Lt={};n&2&&(Lt.$$scope={dirty:n,ctx:s}),ss.$set(Lt)},i(s){Tt||($(h.$$.fragment,s),$(v.$$.fragment,s),$(X.$$.fragment,s),$(F.$$.fragment,s),$(H.$$.fragment,s),$(r.$$.fragment,s),$(q.$$.fragment,s),$(ls.$$.fragment,s),$(ns.$$.fragment,s),$(rs.$$.fragment,s),$(is.$$.fragment,s),$(ms.$$.fragment,s),$(fs.$$.fragment,s),$(hs.$$.fragment,s),$(Ms.$$.fragment,s),$(ys.$$.fragment,s),$(Ts.$$.fragment,s),$(_s.$$.fragment,s),$(P.$$.fragment,s),$(ks.$$.fragment,s),$(K.$$.fragment,s),$(O.$$.fragment,s),$(Us.$$.fragment,s),$(Cs.$$.fragment,s),$(Is.$$.fragment,s),$(ss.$$.fragment,s),$(Vs.$$.fragment,s),Tt=!0)},o(s){y(h.$$.fragment,s),y(v.$$.fragment,s),y(X.$$.fragment,s),y(F.$$.fragment,s),y(H.$$.fragment,s),y(r.$$.fragment,s),y(q.$$.fragment,s),y(ls.$$.fragment,s),y(ns.$$.fragment,s),y(rs.$$.fragment,s),y(is.$$.fragment,s),y(ms.$$.fragment,s),y(fs.$$.fragment,s),y(hs.$$.fragment,s),y(Ms.$$.fragment,s),y(ys.$$.fragment,s),y(Ts.$$.fragment,s),y(_s.$$.fragment,s),y(P.$$.fragment,s),y(ks.$$.fragment,s),y(K.$$.fragment,s),y(O.$$.fragment,s),y(Us.$$.fragment,s),y(Cs.$$.fragment,s),y(Is.$$.fragment,s),y(ss.$$.fragment,s),y(Vs.$$.fragment,s),Tt=!1},d(s){s&&(l(c),l(e),l(m),l(u),l(I),l(G),l(C),l(V),l(_),l(p),l(J),l(Y),l(z),l(L),l(E),l(B),l(k),l(S),l(A),l(D),l(x),l(zs),l(es),l(Bs),l(Hs),l(as),l(Ys),l(Es),l(ps),l(Qs),l(As),l(os),l(Ns),l(Ls),l(qs),l(cs),l(Ss),l(Ds),l(us),l(Ps),l(Ks),l(gs),l(Os),l(ds),l(st),l(tt),l($s),l(et),l(lt),l(js),l(at),l(ws),l(nt),l(bs),l(pt),l(rt),l(Js),l(ot),l(it),l(xs),l(mt),l(ct),l(ft),l(ut),l(ht),l(gt),l(vs),l(dt),l(Gs),l(Mt),l($t),l(Zs),l(yt),l(jt),l(wt),l(bt),l(Xs)),l(t),j(h,s),j(v,s),j(X,s),j(F,s),j(H,s),j(r,s),j(q,s),j(ls,s),j(ns,s),j(rs,s),j(is,s),j(ms,s),j(fs,s),j(hs,s),j(Ms,s),j(ys,s),j(Ts,s),j(_s,s),j(P,s),j(ks,s),j(K,s),j(O,s),j(Us,s),j(Cs,s),j(Is,s),j(ss,s),j(Vs,s)}}}const Je='{"title":"인과 언어 모델링","local":"causal-language-modeling","sections":[{"title":"ELI5 데이터 세트 불러오기","local":"load-eli5-dataset","sections":[],"depth":2},{"title":"전처리","local":"preprocess","sections":[],"depth":2},{"title":"훈련","local":"train","sections":[],"depth":2},{"title":"추론","local":"inference","sections":[],"depth":2}],"depth":1}';function _e(U){return Kt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ve extends Ot{constructor(t){super(),se(this,t,_e,Te,Pt,{})}}export{Ve as component};
