import{s as Bs,o as zs,n as ce}from"../chunks/scheduler.56730f09.js";import{S as Fs,i as Hs,g as f,s as r,u as M,A as Es,h as d,f as t,c as o,j as Q,v as y,y as T,k as X,o as B,a as l,w as $,d as w,t as b,x as j,m as Ws,n as Xs}from"../chunks/index.ba464511.js";import{T as es}from"../chunks/Tip.70442610.js";import{Y as Vs}from"../chunks/Youtube.7b20230c.js";import{I as mt}from"../chunks/IconCopyLink.89bde88e.js";import{C as v}from"../chunks/CodeBlock.2302fd0d.js";import{D as As}from"../chunks/DocNotebookDropdown.68fd8653.js";import{F as ns,M as tt}from"../chunks/Markdown.6303afae.js";function Ns(U){let s,c,a='<a href="../model_doc/bart">BART</a>, <a href="../model_doc/bert">BERT</a>, <a href="../model_doc/bert-generation">Bert Generation</a>, <a href="../model_doc/big_bird">BigBird</a>, <a href="../model_doc/bigbird_pegasus">BigBird-Pegasus</a>, <a href="../model_doc/biogpt">BioGpt</a>, <a href="../model_doc/blenderbot">Blenderbot</a>, <a href="../model_doc/blenderbot-small">BlenderbotSmall</a>, <a href="../model_doc/bloom">BLOOM</a>, <a href="../model_doc/camembert">CamemBERT</a>, <a href="../model_doc/codegen">CodeGen</a>, <a href="../model_doc/cpmant">CPM-Ant</a>, <a href="../model_doc/ctrl">CTRL</a>, <a href="../model_doc/data2vec-text">Data2VecText</a>, <a href="../model_doc/electra">ELECTRA</a>, <a href="../model_doc/ernie">ERNIE</a>, <a href="../model_doc/git">GIT</a>, <a href="../model_doc/gpt-sw3">GPT-Sw3</a>, <a href="../model_doc/gpt2">OpenAI GPT-2</a>, <a href="../model_doc/gpt_bigcode">GPTBigCode</a>, <a href="../model_doc/gpt_neo">GPT Neo</a>, <a href="../model_doc/gpt_neox">GPT NeoX</a>, <a href="../model_doc/gpt_neox_japanese">GPT NeoX Japanese</a>, <a href="../model_doc/gptj">GPT-J</a>, <a href="../model_doc/llama">LLaMA</a>, <a href="../model_doc/marian">Marian</a>, <a href="../model_doc/mbart">mBART</a>, <a href="../model_doc/mega">MEGA</a>, <a href="../model_doc/megatron-bert">Megatron-BERT</a>, <a href="../model_doc/mvp">MVP</a>, <a href="../model_doc/open-llama">OpenLlama</a>, <a href="../model_doc/openai-gpt">OpenAI GPT</a>, <a href="../model_doc/opt">OPT</a>, <a href="../model_doc/pegasus">Pegasus</a>, <a href="../model_doc/plbart">PLBart</a>, <a href="../model_doc/prophetnet">ProphetNet</a>, <a href="../model_doc/qdqbert">QDQBert</a>, <a href="../model_doc/reformer">Reformer</a>, <a href="../model_doc/rembert">RemBERT</a>, <a href="../model_doc/roberta">RoBERTa</a>, <a href="../model_doc/roberta-prelayernorm">RoBERTa-PreLayerNorm</a>, <a href="../model_doc/roc_bert">RoCBert</a>, <a href="../model_doc/roformer">RoFormer</a>, <a href="../model_doc/rwkv">RWKV</a>, <a href="../model_doc/speech_to_text_2">Speech2Text2</a>, <a href="../model_doc/transfo-xl">Transformer-XL</a>, <a href="../model_doc/trocr">TrOCR</a>, <a href="../model_doc/xglm">XGLM</a>, <a href="../model_doc/xlm">XLM</a>, <a href="../model_doc/xlm-prophetnet">XLM-ProphetNet</a>, <a href="../model_doc/xlm-roberta">XLM-RoBERTa</a>, <a href="../model_doc/xlm-roberta-xl">XLM-RoBERTa-XL</a>, <a href="../model_doc/xlnet">XLNet</a>, <a href="../model_doc/xmod">X-MOD</a>';return{c(){s=Ws(`이 안내서의 단계와 동일한 방법으로 인과 언어 모델링을 위해 다른 아키텍처를 미세 조정할 수 있습니다.
다음 아키텍처 중 하나를 선택하세요:

`),c=f("p"),c.innerHTML=a},l(p){s=Xs(p,`이 안내서의 단계와 동일한 방법으로 인과 언어 모델링을 위해 다른 아키텍처를 미세 조정할 수 있습니다.
다음 아키텍처 중 하나를 선택하세요:

`),c=d(p,"P",{"data-svelte-h":!0}),T(c)!=="svelte-8bi7rm"&&(c.innerHTML=a)},m(p,g){l(p,s,g),l(p,c,g)},p:ce,d(p){p&&(t(s),t(c))}}}function Qs(U){let s,c="패딩 토큰으로 종결 토큰을 사용하고 <code>mlm=False</code>로 설정하세요. 이렇게 하면 입력을 오른쪽으로 한 칸씩 시프트한 값을 레이블로 사용합니다:",a,p,g;return p=new v({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(){s=f("p"),s.innerHTML=c,a=r(),M(p.$$.fragment)},l(u){s=d(u,"P",{"data-svelte-h":!0}),T(s)!=="svelte-xhgrka"&&(s.innerHTML=c),a=o(u),y(p.$$.fragment,u)},m(u,Z){l(u,s,Z),l(u,a,Z),$(p,u,Z),g=!0},p:ce,i(u){g||(w(p.$$.fragment,u),g=!0)},o(u){b(p.$$.fragment,u),g=!1},d(u){u&&(t(s),t(a)),j(p,u)}}}function Ys(U){let s,c;return s=new tt({props:{$$slots:{default:[Qs]},$$scope:{ctx:U}}}),{c(){M(s.$$.fragment)},l(a){y(s.$$.fragment,a)},m(a,p){$(s,a,p),c=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){c||(w(s.$$.fragment,a),c=!0)},o(a){b(s.$$.fragment,a),c=!1},d(a){j(s,a)}}}function Ls(U){let s,c="패딩 토큰으로 종결 토큰을 사용하고 <code>mlm=False</code>로 설정하세요. 이렇게 하면 입력을 오른쪽으로 한 칸씩 시프트한 값을 레이블로 사용합니다:",a,p,g;return p=new v({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(){s=f("p"),s.innerHTML=c,a=r(),M(p.$$.fragment)},l(u){s=d(u,"P",{"data-svelte-h":!0}),T(s)!=="svelte-xhgrka"&&(s.innerHTML=c),a=o(u),y(p.$$.fragment,u)},m(u,Z){l(u,s,Z),l(u,a,Z),$(p,u,Z),g=!0},p:ce,i(u){g||(w(p.$$.fragment,u),g=!0)},o(u){b(p.$$.fragment,u),g=!1},d(u){u&&(t(s),t(a)),j(p,u)}}}function qs(U){let s,c;return s=new tt({props:{$$slots:{default:[Ls]},$$scope:{ctx:U}}}),{c(){M(s.$$.fragment)},l(a){y(s.$$.fragment,a)},m(a,p){$(s,a,p),c=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){c||(w(s.$$.fragment,a),c=!0)},o(a){b(s.$$.fragment,a),c=!1},d(a){j(s,a)}}}function Ss(U){let s,c='<code>Trainer</code>를 사용하여 모델을 미세 조정하는 방법을 잘 모르신다면 <a href="../training#train-with-pytorch-trainer">기본 튜토리얼</a>을 확인해보세요!';return{c(){s=f("p"),s.innerHTML=c},l(a){s=d(a,"P",{"data-svelte-h":!0}),T(s)!=="svelte-1n631xc"&&(s.innerHTML=c)},m(a,p){l(a,s,p)},p:ce,d(a){a&&t(s)}}}function Ps(U){let s,c,a,p="이제 모델을 훈련하기 준비가 되었습니다! <code>AutoModelForCausalLM</code>를 사용하여 DistilGPT2를 불러옵니다:",g,u,Z,x,W="여기까지 진행하면 세 단계만 남았습니다:",R,V,E="<li><code>TrainingArguments</code>에서 훈련 하이퍼파라미터를 정의하세요. <code>output_dir</code>은 유일한 필수 매개변수로, 모델을 저장할 위치를 지정합니다. (먼저 Hugging Face에 로그인 필수) <code>push_to_hub=True</code>로 설정하여 이 모델을 허브에 업로드할 수 있습니다.</li> <li>훈련 인수를 <code>Trainer</code>에 모델, 데이터 세트 및 데이터 콜레이터와 함께 전달하세요.</li> <li><code>train()</code>을 호출하여 모델을 미세 조정하세요.</li>",C,k,G,i,_="훈련이 완료되면 <code>evaluate()</code> 메소드를 사용하여 모델을 평가하고 퍼플렉서티를 얻을 수 있습니다:",z,A,F,q,P="그런 다음 <code>push_to_hub()</code> 메소드를 사용하여 모델을 허브에 공유하세요. 이렇게 하면 누구나 모델을 사용할 수 있습니다:",H,Y,N;return s=new es({props:{$$slots:{default:[Ss]},$$scope:{ctx:U}}}),u=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMkMlMjBUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsZ3B0MiUyMik=",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;distilgpt2&quot;</span>)`,wrap:!1}}),k=new v({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX2VsaTVfY2xtLW1vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwZXZhbHVhdGlvbl9zdHJhdGVneSUzRCUyMmVwb2NoJTIyJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDJlLTUlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0RsbV9kYXRhc2V0JTVCJTIydHJhaW4lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0RsbV9kYXRhc2V0JTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",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>    evaluation_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}}),A=new v({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}}),Y=new v({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){M(s.$$.fragment),c=r(),a=f("p"),a.innerHTML=p,g=r(),M(u.$$.fragment),Z=r(),x=f("p"),x.textContent=W,R=r(),V=f("ol"),V.innerHTML=E,C=r(),M(k.$$.fragment),G=r(),i=f("p"),i.innerHTML=_,z=r(),M(A.$$.fragment),F=r(),q=f("p"),q.innerHTML=P,H=r(),M(Y.$$.fragment)},l(h){y(s.$$.fragment,h),c=o(h),a=d(h,"P",{"data-svelte-h":!0}),T(a)!=="svelte-lq6v0y"&&(a.innerHTML=p),g=o(h),y(u.$$.fragment,h),Z=o(h),x=d(h,"P",{"data-svelte-h":!0}),T(x)!=="svelte-scyina"&&(x.textContent=W),R=o(h),V=d(h,"OL",{"data-svelte-h":!0}),T(V)!=="svelte-zqr9wu"&&(V.innerHTML=E),C=o(h),y(k.$$.fragment,h),G=o(h),i=d(h,"P",{"data-svelte-h":!0}),T(i)!=="svelte-amixb4"&&(i.innerHTML=_),z=o(h),y(A.$$.fragment,h),F=o(h),q=d(h,"P",{"data-svelte-h":!0}),T(q)!=="svelte-1bxxjwl"&&(q.innerHTML=P),H=o(h),y(Y.$$.fragment,h)},m(h,I){$(s,h,I),l(h,c,I),l(h,a,I),l(h,g,I),$(u,h,I),l(h,Z,I),l(h,x,I),l(h,R,I),l(h,V,I),l(h,C,I),$(k,h,I),l(h,G,I),l(h,i,I),l(h,z,I),$(A,h,I),l(h,F,I),l(h,q,I),l(h,H,I),$(Y,h,I),N=!0},p(h,I){const L={};I&2&&(L.$$scope={dirty:I,ctx:h}),s.$set(L)},i(h){N||(w(s.$$.fragment,h),w(u.$$.fragment,h),w(k.$$.fragment,h),w(A.$$.fragment,h),w(Y.$$.fragment,h),N=!0)},o(h){b(s.$$.fragment,h),b(u.$$.fragment,h),b(k.$$.fragment,h),b(A.$$.fragment,h),b(Y.$$.fragment,h),N=!1},d(h){h&&(t(c),t(a),t(g),t(Z),t(x),t(R),t(V),t(C),t(G),t(i),t(z),t(F),t(q),t(H)),j(s,h),j(u,h),j(k,h),j(A,h),j(Y,h)}}}function Ds(U){let s,c;return s=new tt({props:{$$slots:{default:[Ps]},$$scope:{ctx:U}}}),{c(){M(s.$$.fragment)},l(a){y(s.$$.fragment,a)},m(a,p){$(s,a,p),c=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){c||(w(s.$$.fragment,a),c=!0)},o(a){b(s.$$.fragment,a),c=!1},d(a){j(s,a)}}}function Ks(U){let s,c='Keras를 사용하여 모델을 미세 조정하는 방법에 익숙하지 않다면 <a href="../training#train-a-tensorflow-model-with-keras">기본 튜토리얼</a>을 확인해보세요!';return{c(){s=f("p"),s.innerHTML=c},l(a){s=d(a,"P",{"data-svelte-h":!0}),T(s)!=="svelte-1qjtntp"&&(s.innerHTML=c)},m(a,p){l(a,s,p)},p:ce,d(a){a&&t(s)}}}function Os(U){let s,c,a,p,g,u="그런 다음 <code>TFAutoModelForCausalLM</code>를 사용하여 DistilGPT2를 불러옵니다:",Z,x,W,R,V="<code>prepare_tf_dataset()</code>을 사용하여 데이터 세트를 <code>tf.data.Dataset</code> 형식으로 변환하세요:",E,C,k,G,i='<a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>을 사용하여 모델을 훈련하기 위해 구성하세요. Transformers 모델은 모두 기본적인 작업 관련 손실 함수를 가지고 있으므로, 원한다면 별도로 지정하지 않아도 됩니다:',_,z,A,F,q="<code>PushToHubCallback</code>에서 모델과 토크나이저를 업로드할 위치를 지정할 수 있습니다:",P,H,Y,N,h='마지막으로, 모델을 훈련하기 위해 <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a>을 호출하세요. 훈련 데이터 세트, 검증 데이터 세트, 에폭 수 및 콜백을 전달하세요:',I,L,S,D,K="훈련이 완료되면 모델이 자동으로 허브에 업로드되어 모두가 사용할 수 있습니다!",he;return s=new es({props:{$$slots:{default:[Ks]},$$scope:{ctx:U}}}),a=new v({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}}),x=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIp",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;distilgpt2&quot;</span>)`,wrap:!1}}),C=new v({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}}),z=new v({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}}),H=new v({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}}),L=new v({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(){M(s.$$.fragment),c=Ws(`
TensorFlow에서 모델을 미세 조정하려면, 먼저 옵티마이저 함수, 학습률 스케줄 및 일부 훈련 하이퍼파라미터를 설정하세요:

	`),M(a.$$.fragment),p=r(),g=f("p"),g.innerHTML=u,Z=r(),M(x.$$.fragment),W=r(),R=f("p"),R.innerHTML=V,E=r(),M(C.$$.fragment),k=r(),G=f("p"),G.innerHTML=i,_=r(),M(z.$$.fragment),A=r(),F=f("p"),F.innerHTML=q,P=r(),M(H.$$.fragment),Y=r(),N=f("p"),N.innerHTML=h,I=r(),M(L.$$.fragment),S=r(),D=f("p"),D.textContent=K},l(m){y(s.$$.fragment,m),c=Xs(m,`
TensorFlow에서 모델을 미세 조정하려면, 먼저 옵티마이저 함수, 학습률 스케줄 및 일부 훈련 하이퍼파라미터를 설정하세요:

	`),y(a.$$.fragment,m),p=o(m),g=d(m,"P",{"data-svelte-h":!0}),T(g)!=="svelte-1xfjl2y"&&(g.innerHTML=u),Z=o(m),y(x.$$.fragment,m),W=o(m),R=d(m,"P",{"data-svelte-h":!0}),T(R)!=="svelte-57oj0z"&&(R.innerHTML=V),E=o(m),y(C.$$.fragment,m),k=o(m),G=d(m,"P",{"data-svelte-h":!0}),T(G)!=="svelte-bkxxon"&&(G.innerHTML=i),_=o(m),y(z.$$.fragment,m),A=o(m),F=d(m,"P",{"data-svelte-h":!0}),T(F)!=="svelte-6m34m7"&&(F.innerHTML=q),P=o(m),y(H.$$.fragment,m),Y=o(m),N=d(m,"P",{"data-svelte-h":!0}),T(N)!=="svelte-az37qz"&&(N.innerHTML=h),I=o(m),y(L.$$.fragment,m),S=o(m),D=d(m,"P",{"data-svelte-h":!0}),T(D)!=="svelte-avna1r"&&(D.textContent=K)},m(m,J){$(s,m,J),l(m,c,J),$(a,m,J),l(m,p,J),l(m,g,J),l(m,Z,J),$(x,m,J),l(m,W,J),l(m,R,J),l(m,E,J),$(C,m,J),l(m,k,J),l(m,G,J),l(m,_,J),$(z,m,J),l(m,A,J),l(m,F,J),l(m,P,J),$(H,m,J),l(m,Y,J),l(m,N,J),l(m,I,J),$(L,m,J),l(m,S,J),l(m,D,J),he=!0},p(m,J){const fe={};J&2&&(fe.$$scope={dirty:J,ctx:m}),s.$set(fe)},i(m){he||(w(s.$$.fragment,m),w(a.$$.fragment,m),w(x.$$.fragment,m),w(C.$$.fragment,m),w(z.$$.fragment,m),w(H.$$.fragment,m),w(L.$$.fragment,m),he=!0)},o(m){b(s.$$.fragment,m),b(a.$$.fragment,m),b(x.$$.fragment,m),b(C.$$.fragment,m),b(z.$$.fragment,m),b(H.$$.fragment,m),b(L.$$.fragment,m),he=!1},d(m){m&&(t(c),t(p),t(g),t(Z),t(W),t(R),t(E),t(k),t(G),t(_),t(A),t(F),t(P),t(Y),t(N),t(I),t(S),t(D)),j(s,m),j(a,m),j(x,m),j(C,m),j(z,m),j(H,m),j(L,m)}}}function el(U){let s,c;return s=new tt({props:{$$slots:{default:[Os]},$$scope:{ctx:U}}}),{c(){M(s.$$.fragment)},l(a){y(s.$$.fragment,a)},m(a,p){$(s,a,p),c=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){c||(w(s.$$.fragment,a),c=!0)},o(a){b(s.$$.fragment,a),c=!1},d(a){j(s,a)}}}function tl(U){let s,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(){s=f("p"),s.innerHTML=c},l(a){s=d(a,"P",{"data-svelte-h":!0}),T(s)!=="svelte-7gnqxq"&&(s.innerHTML=c)},m(a,p){l(a,s,p)},p:ce,d(a){a&&t(s)}}}function sl(U){let s,c="텍스트를 토큰화하고 <code>input_ids</code>를 PyTorch 텐서로 반환하세요:",a,p,g,u,Z='<code>generate()</code> 메소드를 사용하여 텍스트를 생성하세요. 생성을 제어하는 다양한 텍스트 생성 전략과 매개변수에 대한 자세한 내용은 <a href="../generation_strategies">텍스트 생성 전략</a> 페이지를 확인하세요.',x,W,R,V,E="생성된 토큰 ID를 다시 텍스트로 디코딩하세요:",C,k,G;return p=new v({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}}),W=new v({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}}),k=new v({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(){s=f("p"),s.innerHTML=c,a=r(),M(p.$$.fragment),g=r(),u=f("p"),u.innerHTML=Z,x=r(),M(W.$$.fragment),R=r(),V=f("p"),V.textContent=E,C=r(),M(k.$$.fragment)},l(i){s=d(i,"P",{"data-svelte-h":!0}),T(s)!=="svelte-1b4fw1g"&&(s.innerHTML=c),a=o(i),y(p.$$.fragment,i),g=o(i),u=d(i,"P",{"data-svelte-h":!0}),T(u)!=="svelte-3u1s1i"&&(u.innerHTML=Z),x=o(i),y(W.$$.fragment,i),R=o(i),V=d(i,"P",{"data-svelte-h":!0}),T(V)!=="svelte-1wns5q7"&&(V.textContent=E),C=o(i),y(k.$$.fragment,i)},m(i,_){l(i,s,_),l(i,a,_),$(p,i,_),l(i,g,_),l(i,u,_),l(i,x,_),$(W,i,_),l(i,R,_),l(i,V,_),l(i,C,_),$(k,i,_),G=!0},p:ce,i(i){G||(w(p.$$.fragment,i),w(W.$$.fragment,i),w(k.$$.fragment,i),G=!0)},o(i){b(p.$$.fragment,i),b(W.$$.fragment,i),b(k.$$.fragment,i),G=!1},d(i){i&&(t(s),t(a),t(g),t(u),t(x),t(R),t(V),t(C)),j(p,i),j(W,i),j(k,i)}}}function ll(U){let s,c;return s=new tt({props:{$$slots:{default:[sl]},$$scope:{ctx:U}}}),{c(){M(s.$$.fragment)},l(a){y(s.$$.fragment,a)},m(a,p){$(s,a,p),c=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){c||(w(s.$$.fragment,a),c=!0)},o(a){b(s.$$.fragment,a),c=!1},d(a){j(s,a)}}}function al(U){let s,c="텍스트를 토큰화하고 <code>input_ids</code>를 TensorFlow 텐서로 반환하세요:",a,p,g,u,Z='<code>generate()</code> 메소드를 사용하여 요약을 생성하세요. 생성을 제어하는 다양한 텍스트 생성 전략과 매개변수에 대한 자세한 내용은 <a href="../generation_strategies">텍스트 생성 전략</a> 페이지를 확인하세요.',x,W,R,V,E="생성된 토큰 ID를 다시 텍스트로 디코딩하세요:",C,k,G;return p=new v({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}}),W=new v({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}}),k=new v({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(){s=f("p"),s.innerHTML=c,a=r(),M(p.$$.fragment),g=r(),u=f("p"),u.innerHTML=Z,x=r(),M(W.$$.fragment),R=r(),V=f("p"),V.textContent=E,C=r(),M(k.$$.fragment)},l(i){s=d(i,"P",{"data-svelte-h":!0}),T(s)!=="svelte-jhzp8k"&&(s.innerHTML=c),a=o(i),y(p.$$.fragment,i),g=o(i),u=d(i,"P",{"data-svelte-h":!0}),T(u)!=="svelte-170xtje"&&(u.innerHTML=Z),x=o(i),y(W.$$.fragment,i),R=o(i),V=d(i,"P",{"data-svelte-h":!0}),T(V)!=="svelte-1wns5q7"&&(V.textContent=E),C=o(i),y(k.$$.fragment,i)},m(i,_){l(i,s,_),l(i,a,_),$(p,i,_),l(i,g,_),l(i,u,_),l(i,x,_),$(W,i,_),l(i,R,_),l(i,V,_),l(i,C,_),$(k,i,_),G=!0},p:ce,i(i){G||(w(p.$$.fragment,i),w(W.$$.fragment,i),w(k.$$.fragment,i),G=!0)},o(i){b(p.$$.fragment,i),b(W.$$.fragment,i),b(k.$$.fragment,i),G=!1},d(i){i&&(t(s),t(a),t(g),t(u),t(x),t(R),t(V),t(C)),j(p,i),j(W,i),j(k,i)}}}function nl(U){let s,c;return s=new tt({props:{$$slots:{default:[al]},$$scope:{ctx:U}}}),{c(){M(s.$$.fragment)},l(a){y(s.$$.fragment,a)},m(a,p){$(s,a,p),c=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){c||(w(s.$$.fragment,a),c=!0)},o(a){b(s.$$.fragment,a),c=!1},d(a){j(s,a)}}}function pl(U){let s,c,a,p,g,u,Z,x,W,R,V="인과 언어 모델링",E,C,k,G,i=`언어 모델링은 인과적 언어 모델링과 마스크드 언어 모델링, 두 가지 유형으로 나뉩니다. 이 가이드에서는 인과적 언어 모델링을 설명합니다.
인과 언어 모델은 텍스트 생성에 자주 사용됩니다. 또 창의적인 방향으로 응용할 수 있습니다.
직접 사용하며 재미있는 탐구를 해보거나, Copilot 또는 CodeParrot와 같은 지능형 코딩 어시스턴트의 기반이 되기도 합니다.`,_,z,A,F,q=`인과 언어 모델링은 토큰 시퀀스에서 다음 토큰을 예측하며, 모델은 왼쪽의 토큰에만 접근할 수 있습니다.
이는 모델이 미래의 토큰을 볼 수 없다는 것을 의미합니다. 인과 언어 모델의 예로 GPT-2가 있죠.`,P,H,Y="이 가이드에서는 다음 작업을 수행하는 방법을 안내합니다:",N,h,I='<li><a href="https://huggingface.co/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,S,D,K,he="시작하기 전에 필요한 라이브러리가 모두 설치되어 있는지 확인하세요:",m,J,fe,de,ps="커뮤니티에 모델을 업로드하고 공유하기 위해 Hugging Face 계정에 로그인하는 것을 권장합니다. 알림이 표시되면 토큰을 입력하여 로그인하세요:",ct,ue,ht,O,le,st,ge,ts,De,rs="ELI5 데이터 세트 불러오기",ft,Me,os=`먼저, 🤗 Datasets 라이브러리에서 r/askscience의 작은 하위 집합인 ELI5 데이터 세트를 불러옵니다.
이를 통해 전체 데이터 세트에서 학습하는 데 더 많은 시간을 투자하기 전에, 실험해봄으로써 모든 것이 작동하는지 확인할 수 있습니다.`,dt,ye,ut,$e,is="데이터 세트의 <code>train_asks</code> 분할을 <code>train_test_split</code> 메소드를 사용하여 학습 및 테스트 세트로 분할합니다:",gt,we,Mt,be,ms="그런 다음 예제를 살펴보세요:",yt,je,$t,Te,cs="많아 보일 수 있지만, 실제로는 <code>text</code> 필드만 중요합니다. 언어 모델링 작업의 장점은 레이블이 필요하지 않다는 것입니다. 다음 단어 <em>자체가</em> 레이블입니다. (이렇게 레이블을 제공하지 않아도 되는 학습을 비지도 학습이라고 일컫습니다)",wt,ee,ae,lt,_e,ss,Ke,hs="전처리",bt,Je,jt,xe,fs="다음 단계는 <code>text</code> 필드를 전처리하기 위해 DistilGPT2 토크나이저를 불러오는 것입니다.",Tt,ke,_t,Ue,ds='위의 예제에서 알 수 있듯이, <code>text</code> 필드는 <code>answers</code> 아래에 중첩되어 있습니다. 따라서 <a href="https://huggingface.co/docs/datasets/process.html#flatten" rel="nofollow"><code>flatten</code></a> 메소드를 사용하여 중첩 구조에서 <code>text</code> 하위 필드를 추출해야 합니다.',Jt,ve,xt,Ce,us="각 하위 필드는 이제 <code>answers</code> 접두사를 가진 별도의 열로 나뉘었으며, <code>text</code> 필드는 이제 리스트입니다. 각 문장을 개별적으로 토큰화하는 대신, 먼저 리스트를 문자열로 변환하여 한꺼번에 토큰화할 수 있습니다.",kt,Ge,gs="다음은 문자열 리스트를 결합하고 결과를 토큰화하는 첫 번째 전처리 함수입니다:",Ut,Ie,vt,Ze,Ms="이 전처리 함수를 전체 데이터 세트에 적용하려면 🤗 Datasets <code>map</code> 메소드를 사용하세요. <code>batched=True</code>로 설정하여 데이터셋의 여러 요소를 한 번에 처리하고, <code>num_proc</code>를 증가시켜 프로세스 수를 늘릴 수 있습니다. 필요 없는 열은 제거하세요:",Ct,Re,Gt,Ve,ys="이제 데이터 세트는 시퀀스가 토큰화됐지만, 일부 시퀀스는 모델의 최대 입력 길이보다 길 수 있습니다.",It,We,$s="이제 두 번째 전처리 함수를 사용하여",Zt,Xe,ws="<li>모든 시퀀스를 연결하고,</li> <li><code>block_size</code>로 정의된 길이로 연결된 시퀀스를 여러 개의 짧은 묶음으로 나눕니다. 이 값은 최대 입력 길이와 GPU RAM을 고려해 충분히 짧아야 합니다.</li>",Rt,Be,Vt,ze,bs="전체 데이터 세트에 <code>group_texts</code> 함수를 적용하세요:",Wt,Fe,Xt,He,js="그런 다음 <code>DataCollatorForLanguageModeling</code>을 사용하여 예제의 배치를 만듭니다. 데이터 세트 전체를 최대 길이로 패딩하는 것보다, 취합 단계에서 각 배치의 최대 길이로 문장을 <em>동적으로 패딩</em>하는 것이 더 효율적입니다.",Bt,ne,zt,te,pe,at,Ee,ls,Oe,Ts="훈련",Ft,re,Ht,oe,Et,se,ie,nt,Ae,as,et,_s="추론",At,Ne,Js="좋아요, 이제 모델을 미세 조정했으므로 추론에 사용할 수 있습니다!",Nt,Qe,xs="생성할 텍스트를 위한 프롬프트를 만들어보세요:",Qt,Ye,Yt,Le,ks="추론을 위해 미세 조정된 모델을 간단히 사용하는 가장 간단한 방법은 <code>pipeline()</code>에서 사용하는 것입니다. 모델과 함께 텍스트 생성을 위한 <code>pipeline</code>을 인스턴스화하고 텍스트를 전달하세요:",Lt,qe,qt,me,St,pt,Pt;return x=new mt({}),C=new As({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"}]}}),z=new Vs({props:{id:"Vpjb1lu0MDk"}}),S=new es({props:{$$slots:{default:[Ns]},$$scope:{ctx:U}}}),J=new v({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGU=",highlighted:"pip install transformers datasets evaluate",wrap:!1}}),ue=new v({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}}),ge=new mt({}),ye=new v({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}}),we=new v({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}}),je=new v({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}}),_e=new mt({}),Je=new Vs({props:{id:"ma1TrR7gE7I"}}),ke=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxncHQyJTIyKQ==",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;distilgpt2&quot;</span>)`,wrap:!1}}),ve=new v({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}}),Ie=new v({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}}),Re=new v({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}}),Be=new v({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}}),Fe=new v({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}}),ne=new ns({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[qs],pytorch:[Ys]},$$scope:{ctx:U}}}),Ee=new mt({}),re=new ns({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[el],pytorch:[Ds]},$$scope:{ctx:U}}}),oe=new es({props:{$$slots:{default:[tl]},$$scope:{ctx:U}}}),Ae=new mt({}),Ye=new v({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}}),qe=new v({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}}),me=new ns({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[nl],pytorch:[ll]},$$scope:{ctx:U}}}),{c(){s=f("meta"),c=r(),a=f("p"),p=r(),g=f("h1"),u=f("a"),Z=f("span"),M(x.$$.fragment),W=r(),R=f("span"),R.textContent=V,E=r(),M(C.$$.fragment),k=r(),G=f("p"),G.textContent=i,_=r(),M(z.$$.fragment),A=r(),F=f("p"),F.textContent=q,P=r(),H=f("p"),H.textContent=Y,N=r(),h=f("ol"),h.innerHTML=I,L=r(),M(S.$$.fragment),D=r(),K=f("p"),K.textContent=he,m=r(),M(J.$$.fragment),fe=r(),de=f("p"),de.textContent=ps,ct=r(),M(ue.$$.fragment),ht=r(),O=f("h2"),le=f("a"),st=f("span"),M(ge.$$.fragment),ts=r(),De=f("span"),De.textContent=rs,ft=r(),Me=f("p"),Me.textContent=os,dt=r(),M(ye.$$.fragment),ut=r(),$e=f("p"),$e.innerHTML=is,gt=r(),M(we.$$.fragment),Mt=r(),be=f("p"),be.textContent=ms,yt=r(),M(je.$$.fragment),$t=r(),Te=f("p"),Te.innerHTML=cs,wt=r(),ee=f("h2"),ae=f("a"),lt=f("span"),M(_e.$$.fragment),ss=r(),Ke=f("span"),Ke.textContent=hs,bt=r(),M(Je.$$.fragment),jt=r(),xe=f("p"),xe.innerHTML=fs,Tt=r(),M(ke.$$.fragment),_t=r(),Ue=f("p"),Ue.innerHTML=ds,Jt=r(),M(ve.$$.fragment),xt=r(),Ce=f("p"),Ce.innerHTML=us,kt=r(),Ge=f("p"),Ge.textContent=gs,Ut=r(),M(Ie.$$.fragment),vt=r(),Ze=f("p"),Ze.innerHTML=Ms,Ct=r(),M(Re.$$.fragment),Gt=r(),Ve=f("p"),Ve.textContent=ys,It=r(),We=f("p"),We.textContent=$s,Zt=r(),Xe=f("ul"),Xe.innerHTML=ws,Rt=r(),M(Be.$$.fragment),Vt=r(),ze=f("p"),ze.innerHTML=bs,Wt=r(),M(Fe.$$.fragment),Xt=r(),He=f("p"),He.innerHTML=js,Bt=r(),M(ne.$$.fragment),zt=r(),te=f("h2"),pe=f("a"),at=f("span"),M(Ee.$$.fragment),ls=r(),Oe=f("span"),Oe.textContent=Ts,Ft=r(),M(re.$$.fragment),Ht=r(),M(oe.$$.fragment),Et=r(),se=f("h2"),ie=f("a"),nt=f("span"),M(Ae.$$.fragment),as=r(),et=f("span"),et.textContent=_s,At=r(),Ne=f("p"),Ne.textContent=Js,Nt=r(),Qe=f("p"),Qe.textContent=xs,Qt=r(),M(Ye.$$.fragment),Yt=r(),Le=f("p"),Le.innerHTML=ks,Lt=r(),M(qe.$$.fragment),qt=r(),M(me.$$.fragment),St=r(),pt=f("p"),this.h()},l(e){const n=Es("svelte-1phssyn",document.head);s=d(n,"META",{name:!0,content:!0}),n.forEach(t),c=o(e),a=d(e,"P",{}),Q(a).forEach(t),p=o(e),g=d(e,"H1",{class:!0});var Se=Q(g);u=d(Se,"A",{id:!0,class:!0,href:!0});var rt=Q(u);Z=d(rt,"SPAN",{});var ot=Q(Z);y(x.$$.fragment,ot),ot.forEach(t),rt.forEach(t),W=o(Se),R=d(Se,"SPAN",{"data-svelte-h":!0}),T(R)!=="svelte-1hvvhyg"&&(R.textContent=V),Se.forEach(t),E=o(e),y(C.$$.fragment,e),k=o(e),G=d(e,"P",{"data-svelte-h":!0}),T(G)!=="svelte-zdtuex"&&(G.textContent=i),_=o(e),y(z.$$.fragment,e),A=o(e),F=d(e,"P",{"data-svelte-h":!0}),T(F)!=="svelte-611b95"&&(F.textContent=q),P=o(e),H=d(e,"P",{"data-svelte-h":!0}),T(H)!=="svelte-x18r2q"&&(H.textContent=Y),N=o(e),h=d(e,"OL",{"data-svelte-h":!0}),T(h)!=="svelte-cwdzqr"&&(h.innerHTML=I),L=o(e),y(S.$$.fragment,e),D=o(e),K=d(e,"P",{"data-svelte-h":!0}),T(K)!=="svelte-1k0z9pm"&&(K.textContent=he),m=o(e),y(J.$$.fragment,e),fe=o(e),de=d(e,"P",{"data-svelte-h":!0}),T(de)!=="svelte-tqxze0"&&(de.textContent=ps),ct=o(e),y(ue.$$.fragment,e),ht=o(e),O=d(e,"H2",{class:!0});var Pe=Q(O);le=d(Pe,"A",{id:!0,class:!0,href:!0});var it=Q(le);st=d(it,"SPAN",{});var Us=Q(st);y(ge.$$.fragment,Us),Us.forEach(t),it.forEach(t),ts=o(Pe),De=d(Pe,"SPAN",{"data-svelte-h":!0}),T(De)!=="svelte-14ot0k"&&(De.textContent=rs),Pe.forEach(t),ft=o(e),Me=d(e,"P",{"data-svelte-h":!0}),T(Me)!=="svelte-8ukoq1"&&(Me.textContent=os),dt=o(e),y(ye.$$.fragment,e),ut=o(e),$e=d(e,"P",{"data-svelte-h":!0}),T($e)!=="svelte-12jrw1i"&&($e.innerHTML=is),gt=o(e),y(we.$$.fragment,e),Mt=o(e),be=d(e,"P",{"data-svelte-h":!0}),T(be)!=="svelte-12bood2"&&(be.textContent=ms),yt=o(e),y(je.$$.fragment,e),$t=o(e),Te=d(e,"P",{"data-svelte-h":!0}),T(Te)!=="svelte-j851qf"&&(Te.innerHTML=cs),wt=o(e),ee=d(e,"H2",{class:!0});var Dt=Q(ee);ae=d(Dt,"A",{id:!0,class:!0,href:!0});var vs=Q(ae);lt=d(vs,"SPAN",{});var Cs=Q(lt);y(_e.$$.fragment,Cs),Cs.forEach(t),vs.forEach(t),ss=o(Dt),Ke=d(Dt,"SPAN",{"data-svelte-h":!0}),T(Ke)!=="svelte-1cte2wb"&&(Ke.textContent=hs),Dt.forEach(t),bt=o(e),y(Je.$$.fragment,e),jt=o(e),xe=d(e,"P",{"data-svelte-h":!0}),T(xe)!=="svelte-vkts6u"&&(xe.innerHTML=fs),Tt=o(e),y(ke.$$.fragment,e),_t=o(e),Ue=d(e,"P",{"data-svelte-h":!0}),T(Ue)!=="svelte-ti0izn"&&(Ue.innerHTML=ds),Jt=o(e),y(ve.$$.fragment,e),xt=o(e),Ce=d(e,"P",{"data-svelte-h":!0}),T(Ce)!=="svelte-16uyepd"&&(Ce.innerHTML=us),kt=o(e),Ge=d(e,"P",{"data-svelte-h":!0}),T(Ge)!=="svelte-1n68t0t"&&(Ge.textContent=gs),Ut=o(e),y(Ie.$$.fragment,e),vt=o(e),Ze=d(e,"P",{"data-svelte-h":!0}),T(Ze)!=="svelte-321xw1"&&(Ze.innerHTML=Ms),Ct=o(e),y(Re.$$.fragment,e),Gt=o(e),Ve=d(e,"P",{"data-svelte-h":!0}),T(Ve)!=="svelte-lan0yv"&&(Ve.textContent=ys),It=o(e),We=d(e,"P",{"data-svelte-h":!0}),T(We)!=="svelte-1mquexd"&&(We.textContent=$s),Zt=o(e),Xe=d(e,"UL",{"data-svelte-h":!0}),T(Xe)!=="svelte-hoxk8w"&&(Xe.innerHTML=ws),Rt=o(e),y(Be.$$.fragment,e),Vt=o(e),ze=d(e,"P",{"data-svelte-h":!0}),T(ze)!=="svelte-51k2an"&&(ze.innerHTML=bs),Wt=o(e),y(Fe.$$.fragment,e),Xt=o(e),He=d(e,"P",{"data-svelte-h":!0}),T(He)!=="svelte-n2vyhz"&&(He.innerHTML=js),Bt=o(e),y(ne.$$.fragment,e),zt=o(e),te=d(e,"H2",{class:!0});var Kt=Q(te);pe=d(Kt,"A",{id:!0,class:!0,href:!0});var Gs=Q(pe);at=d(Gs,"SPAN",{});var Is=Q(at);y(Ee.$$.fragment,Is),Is.forEach(t),Gs.forEach(t),ls=o(Kt),Oe=d(Kt,"SPAN",{"data-svelte-h":!0}),T(Oe)!=="svelte-tdy10p"&&(Oe.textContent=Ts),Kt.forEach(t),Ft=o(e),y(re.$$.fragment,e),Ht=o(e),y(oe.$$.fragment,e),Et=o(e),se=d(e,"H2",{class:!0});var Ot=Q(se);ie=d(Ot,"A",{id:!0,class:!0,href:!0});var Zs=Q(ie);nt=d(Zs,"SPAN",{});var Rs=Q(nt);y(Ae.$$.fragment,Rs),Rs.forEach(t),Zs.forEach(t),as=o(Ot),et=d(Ot,"SPAN",{"data-svelte-h":!0}),T(et)!=="svelte-8litrx"&&(et.textContent=_s),Ot.forEach(t),At=o(e),Ne=d(e,"P",{"data-svelte-h":!0}),T(Ne)!=="svelte-jox0kl"&&(Ne.textContent=Js),Nt=o(e),Qe=d(e,"P",{"data-svelte-h":!0}),T(Qe)!=="svelte-itb1wv"&&(Qe.textContent=xs),Qt=o(e),y(Ye.$$.fragment,e),Yt=o(e),Le=d(e,"P",{"data-svelte-h":!0}),T(Le)!=="svelte-3cxlyd"&&(Le.innerHTML=ks),Lt=o(e),y(qe.$$.fragment,e),qt=o(e),y(me.$$.fragment,e),St=o(e),pt=d(e,"P",{}),Q(pt).forEach(t),this.h()},h(){X(s,"name","hf:doc:metadata"),X(s,"content",JSON.stringify(rl)),X(u,"id","causal-language-modeling"),X(u,"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"),X(u,"href","#causal-language-modeling"),X(g,"class","relative group"),X(le,"id","load-eli5-dataset"),X(le,"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"),X(le,"href","#load-eli5-dataset"),X(O,"class","relative group"),X(ae,"id","preprocess"),X(ae,"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"),X(ae,"href","#preprocess"),X(ee,"class","relative group"),X(pe,"id","train"),X(pe,"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"),X(pe,"href","#train"),X(te,"class","relative group"),X(ie,"id","inference"),X(ie,"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"),X(ie,"href","#inference"),X(se,"class","relative group")},m(e,n){B(document.head,s),l(e,c,n),l(e,a,n),l(e,p,n),l(e,g,n),B(g,u),B(u,Z),$(x,Z,null),B(g,W),B(g,R),l(e,E,n),$(C,e,n),l(e,k,n),l(e,G,n),l(e,_,n),$(z,e,n),l(e,A,n),l(e,F,n),l(e,P,n),l(e,H,n),l(e,N,n),l(e,h,n),l(e,L,n),$(S,e,n),l(e,D,n),l(e,K,n),l(e,m,n),$(J,e,n),l(e,fe,n),l(e,de,n),l(e,ct,n),$(ue,e,n),l(e,ht,n),l(e,O,n),B(O,le),B(le,st),$(ge,st,null),B(O,ts),B(O,De),l(e,ft,n),l(e,Me,n),l(e,dt,n),$(ye,e,n),l(e,ut,n),l(e,$e,n),l(e,gt,n),$(we,e,n),l(e,Mt,n),l(e,be,n),l(e,yt,n),$(je,e,n),l(e,$t,n),l(e,Te,n),l(e,wt,n),l(e,ee,n),B(ee,ae),B(ae,lt),$(_e,lt,null),B(ee,ss),B(ee,Ke),l(e,bt,n),$(Je,e,n),l(e,jt,n),l(e,xe,n),l(e,Tt,n),$(ke,e,n),l(e,_t,n),l(e,Ue,n),l(e,Jt,n),$(ve,e,n),l(e,xt,n),l(e,Ce,n),l(e,kt,n),l(e,Ge,n),l(e,Ut,n),$(Ie,e,n),l(e,vt,n),l(e,Ze,n),l(e,Ct,n),$(Re,e,n),l(e,Gt,n),l(e,Ve,n),l(e,It,n),l(e,We,n),l(e,Zt,n),l(e,Xe,n),l(e,Rt,n),$(Be,e,n),l(e,Vt,n),l(e,ze,n),l(e,Wt,n),$(Fe,e,n),l(e,Xt,n),l(e,He,n),l(e,Bt,n),$(ne,e,n),l(e,zt,n),l(e,te,n),B(te,pe),B(pe,at),$(Ee,at,null),B(te,ls),B(te,Oe),l(e,Ft,n),$(re,e,n),l(e,Ht,n),$(oe,e,n),l(e,Et,n),l(e,se,n),B(se,ie),B(ie,nt),$(Ae,nt,null),B(se,as),B(se,et),l(e,At,n),l(e,Ne,n),l(e,Nt,n),l(e,Qe,n),l(e,Qt,n),$(Ye,e,n),l(e,Yt,n),l(e,Le,n),l(e,Lt,n),$(qe,e,n),l(e,qt,n),$(me,e,n),l(e,St,n),l(e,pt,n),Pt=!0},p(e,[n]){const Se={};n&2&&(Se.$$scope={dirty:n,ctx:e}),S.$set(Se);const rt={};n&2&&(rt.$$scope={dirty:n,ctx:e}),ne.$set(rt);const ot={};n&2&&(ot.$$scope={dirty:n,ctx:e}),re.$set(ot);const Pe={};n&2&&(Pe.$$scope={dirty:n,ctx:e}),oe.$set(Pe);const it={};n&2&&(it.$$scope={dirty:n,ctx:e}),me.$set(it)},i(e){Pt||(w(x.$$.fragment,e),w(C.$$.fragment,e),w(z.$$.fragment,e),w(S.$$.fragment,e),w(J.$$.fragment,e),w(ue.$$.fragment,e),w(ge.$$.fragment,e),w(ye.$$.fragment,e),w(we.$$.fragment,e),w(je.$$.fragment,e),w(_e.$$.fragment,e),w(Je.$$.fragment,e),w(ke.$$.fragment,e),w(ve.$$.fragment,e),w(Ie.$$.fragment,e),w(Re.$$.fragment,e),w(Be.$$.fragment,e),w(Fe.$$.fragment,e),w(ne.$$.fragment,e),w(Ee.$$.fragment,e),w(re.$$.fragment,e),w(oe.$$.fragment,e),w(Ae.$$.fragment,e),w(Ye.$$.fragment,e),w(qe.$$.fragment,e),w(me.$$.fragment,e),Pt=!0)},o(e){b(x.$$.fragment,e),b(C.$$.fragment,e),b(z.$$.fragment,e),b(S.$$.fragment,e),b(J.$$.fragment,e),b(ue.$$.fragment,e),b(ge.$$.fragment,e),b(ye.$$.fragment,e),b(we.$$.fragment,e),b(je.$$.fragment,e),b(_e.$$.fragment,e),b(Je.$$.fragment,e),b(ke.$$.fragment,e),b(ve.$$.fragment,e),b(Ie.$$.fragment,e),b(Re.$$.fragment,e),b(Be.$$.fragment,e),b(Fe.$$.fragment,e),b(ne.$$.fragment,e),b(Ee.$$.fragment,e),b(re.$$.fragment,e),b(oe.$$.fragment,e),b(Ae.$$.fragment,e),b(Ye.$$.fragment,e),b(qe.$$.fragment,e),b(me.$$.fragment,e),Pt=!1},d(e){e&&(t(c),t(a),t(p),t(g),t(E),t(k),t(G),t(_),t(A),t(F),t(P),t(H),t(N),t(h),t(L),t(D),t(K),t(m),t(fe),t(de),t(ct),t(ht),t(O),t(ft),t(Me),t(dt),t(ut),t($e),t(gt),t(Mt),t(be),t(yt),t($t),t(Te),t(wt),t(ee),t(bt),t(jt),t(xe),t(Tt),t(_t),t(Ue),t(Jt),t(xt),t(Ce),t(kt),t(Ge),t(Ut),t(vt),t(Ze),t(Ct),t(Gt),t(Ve),t(It),t(We),t(Zt),t(Xe),t(Rt),t(Vt),t(ze),t(Wt),t(Xt),t(He),t(Bt),t(zt),t(te),t(Ft),t(Ht),t(Et),t(se),t(At),t(Ne),t(Nt),t(Qe),t(Qt),t(Yt),t(Le),t(Lt),t(qt),t(St),t(pt)),t(s),j(x),j(C,e),j(z,e),j(S,e),j(J,e),j(ue,e),j(ge),j(ye,e),j(we,e),j(je,e),j(_e),j(Je,e),j(ke,e),j(ve,e),j(Ie,e),j(Re,e),j(Be,e),j(Fe,e),j(ne,e),j(Ee),j(re,e),j(oe,e),j(Ae),j(Ye,e),j(qe,e),j(me,e)}}}const rl={local:"causal-language-modeling",sections:[{local:"load-eli5-dataset",title:"ELI5 데이터 세트 불러오기"},{local:"preprocess",title:"전처리"},{local:"train",title:"훈련"},{local:"inference",title:"추론"}],title:"인과 언어 모델링"};function ol(U){return zs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ml extends Fs{constructor(s){super(),Hs(this,s,ol,pl,Bs,{})}}export{Ml as component};
