import{s as Se,o as Qe,n as ms}from"../chunks/scheduler.bdbef820.js";import{S as qe,i as Ae,g as b,s as o,r as M,A as Le,h as j,f as l,c as m,j as Ee,u,x as T,k as ze,y as Pe,a,v as y,d as h,t as $,w as d,m as De,n as Ke}from"../chunks/index.33f81d56.js";import{T as we}from"../chunks/Tip.34194030.js";import{Y as Ye}from"../chunks/Youtube.0e329b00.js";import{C as R}from"../chunks/CodeBlock.362b34a4.js";import{D as Oe}from"../chunks/DocNotebookDropdown.d5db5928.js";import{F as Te,M as zs}from"../chunks/Markdown.03194dea.js";import{H as Es,E as st}from"../chunks/EditOnGithub.a9246e21.js";function et(_){let t,c='이 작업과 호환되는 모든 아키텍처와 체크포인트를 보려면 <a href="https://huggingface.co/tasks/translation" rel="nofollow">작업 페이지</a>를 확인하는 것이 좋습니다.';return{c(){t=b("p"),t.innerHTML=c},l(e){t=j(e,"P",{"data-svelte-h":!0}),T(t)!=="svelte-11fatqs"&&(t.innerHTML=c)},m(e,i){a(e,t,i)},p:ms,d(e){e&&l(t)}}}function tt(_){let t,c;return t=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvckZvclNlcTJTZXElMEElMEFkYXRhX2NvbGxhdG9yJTIwJTNEJTIwRGF0YUNvbGxhdG9yRm9yU2VxMlNlcSh0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMjBtb2RlbCUzRGNoZWNrcG9pbnQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForSeq2Seq

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForSeq2Seq(tokenizer=tokenizer, model=checkpoint)`,wrap:!1}}),{c(){M(t.$$.fragment)},l(e){u(t.$$.fragment,e)},m(e,i){y(t,e,i),c=!0},p:ms,i(e){c||(h(t.$$.fragment,e),c=!0)},o(e){$(t.$$.fragment,e),c=!1},d(e){d(t,e)}}}function lt(_){let t,c;return t=new zs({props:{$$slots:{default:[tt]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(e){u(t.$$.fragment,e)},m(e,i){y(t,e,i),c=!0},p(e,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:e}),t.$set(g)},i(e){c||(h(t.$$.fragment,e),c=!0)},o(e){$(t.$$.fragment,e),c=!1},d(e){d(t,e)}}}function at(_){let t,c;return t=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvckZvclNlcTJTZXElMEElMEFkYXRhX2NvbGxhdG9yJTIwJTNEJTIwRGF0YUNvbGxhdG9yRm9yU2VxMlNlcSh0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMjBtb2RlbCUzRGNoZWNrcG9pbnQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForSeq2Seq

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForSeq2Seq(tokenizer=tokenizer, model=checkpoint, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`,wrap:!1}}),{c(){M(t.$$.fragment)},l(e){u(t.$$.fragment,e)},m(e,i){y(t,e,i),c=!0},p:ms,i(e){c||(h(t.$$.fragment,e),c=!0)},o(e){$(t.$$.fragment,e),c=!1},d(e){d(t,e)}}}function nt(_){let t,c;return t=new zs({props:{$$slots:{default:[at]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(e){u(t.$$.fragment,e)},m(e,i){y(t,e,i),c=!0},p(e,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:e}),t.$set(g)},i(e){c||(h(t.$$.fragment,e),c=!0)},o(e){$(t.$$.fragment,e),c=!1},d(e){d(t,e)}}}function pt(_){let t,c='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>로 모델을 파인튜닝하는 방법에 익숙하지 않다면 <a href="../training#train-with-pytorch-trainer">여기</a>에서 기본 튜토리얼을 살펴보시기 바랍니다!';return{c(){t=b("p"),t.innerHTML=c},l(e){t=j(e,"P",{"data-svelte-h":!0}),T(t)!=="svelte-lrzeqk"&&(t.innerHTML=c)},m(e,i){a(e,t,i)},p:ms,d(e){e&&l(t)}}}function rt(_){let t,c,e,i='모델을 훈련시킬 준비가 되었군요! <a href="/docs/transformers/main/ko/model_doc/auto#transformers.AutoModelForSeq2SeqLM">AutoModelForSeq2SeqLM</a>으로 T5를 로드하세요:',g,Z,x,X,C="이제 세 단계만 거치면 끝입니다:",G,k,I='<li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Seq2SeqTrainingArguments">Seq2SeqTrainingArguments</a>에서 훈련 하이퍼파라미터를 정의하세요. 유일한 필수 매개변수는 모델을 저장할 위치인 <code>output_dir</code>입니다. 모델을 Hub에 푸시하기 위해 <code>push_to_hub=True</code>로 설정하세요. (모델을 업로드하려면 Hugging Face에 로그인해야 합니다.) <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>는 에폭이 끝날때마다 SacreBLEU 메트릭을 평가하고 훈련 체크포인트를 저장합니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Seq2SeqTrainer">Seq2SeqTrainer</a>에 훈련 인수를 전달하세요. 모델, 데이터 세트, 토크나이저, data collator 및 <code>compute_metrics</code> 함수도 덩달아 전달해야 합니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.train">train()</a>을 호출하여 모델을 파인튜닝하세요.</li>',V,U,W,r,J='학습이 완료되면 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> 메서드로 모델을 Hub에 공유하세요. 이러면 누구나 모델을 사용할 수 있게 됩니다:',F,H,B;return t=new we({props:{$$slots:{default:[pt]},$$scope:{ctx:_}}}),Z=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUyQyUyMFNlcTJTZXFUcmFpbmluZ0FyZ3VtZW50cyUyQyUyMFNlcTJTZXFUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXEyU2VxTE0uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSeq2SeqLM, Seq2SeqTrainingArguments, Seq2SeqTrainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(checkpoint)`,wrap:!1}}),U=new R({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFNlcTJTZXFUcmFpbmluZ0FyZ3VtZW50cyglMEElMjAlMjAlMjAlMjBvdXRwdXRfZGlyJTNEJTIybXlfYXdlc29tZV9vcHVzX2Jvb2tzX21vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdHJhdGVneSUzRCUyMmVwb2NoJTIyJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDJlLTUlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0QxNiUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBJTIwJTIwJTIwJTIwc2F2ZV90b3RhbF9saW1pdCUzRDMlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNEMiUyQyUwQSUyMCUyMCUyMCUyMHByZWRpY3Rfd2l0aF9nZW5lcmF0ZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBmcDE2JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHB1c2hfdG9faHViJTNEVHJ1ZSUyQyUwQSklMEElMEF0cmFpbmVyJTIwJTNEJTIwU2VxMlNlcVRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRHRva2VuaXplZF9ib29rcyU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEdG9rZW5pemVkX2Jvb2tzJTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHByb2Nlc3NpbmdfY2xhc3MlM0R0b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBkYXRhX2NvbGxhdG9yJTNEZGF0YV9jb2xsYXRvciUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfbWV0cmljcyUzRGNvbXB1dGVfbWV0cmljcyUyQyUwQSklMEElMEF0cmFpbmVyLnRyYWluKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = Seq2SeqTrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;my_awesome_opus_books_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>    per_device_train_batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    per_device_eval_batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    weight_decay=<span class="hljs-number">0.01</span>,
<span class="hljs-meta">... </span>    save_total_limit=<span class="hljs-number">3</span>,
<span class="hljs-meta">... </span>    num_train_epochs=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    predict_with_generate=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    fp16=<span class="hljs-literal">True</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 = Seq2SeqTrainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=tokenized_books[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=tokenized_books[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    processing_class=tokenizer,
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`,wrap:!1}}),H=new R({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){M(t.$$.fragment),c=o(),e=b("p"),e.innerHTML=i,g=o(),M(Z.$$.fragment),x=o(),X=b("p"),X.textContent=C,G=o(),k=b("ol"),k.innerHTML=I,V=o(),M(U.$$.fragment),W=o(),r=b("p"),r.innerHTML=J,F=o(),M(H.$$.fragment)},l(f){u(t.$$.fragment,f),c=m(f),e=j(f,"P",{"data-svelte-h":!0}),T(e)!=="svelte-799a1"&&(e.innerHTML=i),g=m(f),u(Z.$$.fragment,f),x=m(f),X=j(f,"P",{"data-svelte-h":!0}),T(X)!=="svelte-14zzcxs"&&(X.textContent=C),G=m(f),k=j(f,"OL",{"data-svelte-h":!0}),T(k)!=="svelte-znon93"&&(k.innerHTML=I),V=m(f),u(U.$$.fragment,f),W=m(f),r=j(f,"P",{"data-svelte-h":!0}),T(r)!=="svelte-1wimnen"&&(r.innerHTML=J),F=m(f),u(H.$$.fragment,f)},m(f,v){y(t,f,v),a(f,c,v),a(f,e,v),a(f,g,v),y(Z,f,v),a(f,x,v),a(f,X,v),a(f,G,v),a(f,k,v),a(f,V,v),y(U,f,v),a(f,W,v),a(f,r,v),a(f,F,v),y(H,f,v),B=!0},p(f,v){const N={};v&2&&(N.$$scope={dirty:v,ctx:f}),t.$set(N)},i(f){B||(h(t.$$.fragment,f),h(Z.$$.fragment,f),h(U.$$.fragment,f),h(H.$$.fragment,f),B=!0)},o(f){$(t.$$.fragment,f),$(Z.$$.fragment,f),$(U.$$.fragment,f),$(H.$$.fragment,f),B=!1},d(f){f&&(l(c),l(e),l(g),l(x),l(X),l(G),l(k),l(V),l(W),l(r),l(F)),d(t,f),d(Z,f),d(U,f),d(H,f)}}}function ot(_){let t,c;return t=new zs({props:{$$slots:{default:[rt]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(e){u(t.$$.fragment,e)},m(e,i){y(t,e,i),c=!0},p(e,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:e}),t.$set(g)},i(e){c||(h(t.$$.fragment,e),c=!0)},o(e){$(t.$$.fragment,e),c=!1},d(e){d(t,e)}}}function mt(_){let t,c='Keras로 모델을 파인튜닝하는 방법이 익숙하지 않다면, <a href="../training#train-a-tensorflow-model-with-keras">여기</a>에서 기본 튜토리얼을 살펴보시기 바랍니다!';return{c(){t=b("p"),t.innerHTML=c},l(e){t=j(e,"P",{"data-svelte-h":!0}),T(t)!=="svelte-5a866m"&&(t.innerHTML=c)},m(e,i){a(e,t,i)},p:ms,d(e){e&&l(t)}}}function ct(_){let t,c,e,i,g,Z='이제 <a href="/docs/transformers/main/ko/model_doc/auto#transformers.TFAutoModelForSeq2SeqLM">TFAutoModelForSeq2SeqLM</a>로 T5를 가져오세요:',x,X,C,G,k="<code>prepare_tf_dataset()</code>로 데이터 세트를 <code>tf.data.Dataset</code> 형식으로 변환하세요:",I,V,U,W,r='훈련하기 위해 <a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a> 메서드로 모델을 구성하세요:',J,F,H,B,f='훈련을 시작하기 전에 예측값으로부터 SacreBLEU 메트릭을 계산하는 방법과 모델을 Hub에 업로드하는 방법 두 가지를 미리 설정해둬야 합니다. 둘 다 <a href="../main_classes/keras_callbacks">Keras callbacks</a>로 구현하세요.',v,N,cs="<code>KerasMetricCallback</code>에 <code>compute_metrics</code> 함수를 전달하세요.",E,z,Y,es,is="모델과 토크나이저를 업로드할 위치를 <code>PushToHubCallback</code>에서 지정하세요:",S,Q,q,A,ts="이제 콜백들을 한데로 묶어주세요:",fs,L,P,D,ls='드디어 모델을 훈련시킬 모든 준비를 마쳤군요! 이제 훈련 및 검증 데이터 세트에 <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a> 메서드를 에폭 수와 만들어둔 콜백과 함께 호출하여 모델을 파인튜닝하세요:',Ms,K,O,ss,as="학습이 완료되면 모델이 자동으로 Hub에 업로드되고, 누구나 사용할 수 있게 됩니다!",us;return t=new we({props:{$$slots:{default:[mt]},$$scope:{ctx:_}}}),e=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEFkYW1XZWlnaHREZWNheSUwQSUwQW9wdGltaXplciUyMCUzRCUyMEFkYW1XZWlnaHREZWNheShsZWFybmluZ19yYXRlJTNEMmUtNSUyQyUyMHdlaWdodF9kZWNheV9yYXRlJTNEMC4wMSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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 R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VxMlNlcUxNJTBBJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvclNlcTJTZXFMTS5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSeq2SeqLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSeq2SeqLM.from_pretrained(checkpoint)`,wrap:!1}}),V=new R({props:{code:"dGZfdHJhaW5fc2V0JTIwJTNEJTIwbW9kZWwucHJlcGFyZV90Zl9kYXRhc2V0KCUwQSUyMCUyMCUyMCUyMHRva2VuaXplZF9ib29rcyU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwc2h1ZmZsZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBiYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBjb2xsYXRlX2ZuJTNEZGF0YV9jb2xsYXRvciUyQyUwQSklMEElMEF0Zl90ZXN0X3NldCUyMCUzRCUyMG1vZGVsLnByZXBhcmVfdGZfZGF0YXNldCglMEElMjAlMjAlMjAlMjB0b2tlbml6ZWRfYm9va3MlNUIlMjJ0ZXN0JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwc2h1ZmZsZSUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwY29sbGF0ZV9mbiUzRGRhdGFfY29sbGF0b3IlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_set = model.prepare_tf_dataset(
<span class="hljs-meta">... </span>    tokenized_books[<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>    tokenized_books[<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}}),F=new R({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEFtb2RlbC5jb21waWxlKG9wdGltaXplciUzRG9wdGltaXplcik=",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)`,wrap:!1}}),z=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5rZXJhc19jYWxsYmFja3MlMjBpbXBvcnQlMjBLZXJhc01ldHJpY0NhbGxiYWNrJTBBJTBBbWV0cmljX2NhbGxiYWNrJTIwJTNEJTIwS2VyYXNNZXRyaWNDYWxsYmFjayhtZXRyaWNfZm4lM0Rjb21wdXRlX21ldHJpY3MlMkMlMjBldmFsX2RhdGFzZXQlM0R0Zl92YWxpZGF0aW9uX3NldCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.keras_callbacks <span class="hljs-keyword">import</span> KerasMetricCallback

<span class="hljs-meta">&gt;&gt;&gt; </span>metric_callback = KerasMetricCallback(metric_fn=compute_metrics, eval_dataset=tf_validation_set)`,wrap:!1}}),Q=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5rZXJhc19jYWxsYmFja3MlMjBpbXBvcnQlMjBQdXNoVG9IdWJDYWxsYmFjayUwQSUwQXB1c2hfdG9faHViX2NhbGxiYWNrJTIwJTNEJTIwUHVzaFRvSHViQ2FsbGJhY2soJTBBJTIwJTIwJTIwJTIwb3V0cHV0X2RpciUzRCUyMm15X2F3ZXNvbWVfb3B1c19ib29rc19tb2RlbCUyMiUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRHRva2VuaXplciUyQyUwQSk=",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>push_to_hub_callback = PushToHubCallback(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;my_awesome_opus_books_model&quot;</span>,
<span class="hljs-meta">... </span>    tokenizer=tokenizer,
<span class="hljs-meta">... </span>)`,wrap:!1}}),L=new R({props:{code:"Y2FsbGJhY2tzJTIwJTNEJTIwJTVCbWV0cmljX2NhbGxiYWNrJTJDJTIwcHVzaF90b19odWJfY2FsbGJhY2slNUQ=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>callbacks = [metric_callback, push_to_hub_callback]',wrap:!1}}),K=new R({props:{code:"bW9kZWwuZml0KHglM0R0Zl90cmFpbl9zZXQlMkMlMjB2YWxpZGF0aW9uX2RhdGElM0R0Zl90ZXN0X3NldCUyQyUyMGVwb2NocyUzRDMlMkMlMjBjYWxsYmFja3MlM0RjYWxsYmFja3Mp",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=callbacks)',wrap:!1}}),{c(){M(t.$$.fragment),c=De(`
TensorFlow에서 모델을 파인튜닝하려면 우선 optimizer 함수, 학습률 스케줄 등의 훈련 하이퍼파라미터를 설정하세요:

	`),M(e.$$.fragment),i=o(),g=b("p"),g.innerHTML=Z,x=o(),M(X.$$.fragment),C=o(),G=b("p"),G.innerHTML=k,I=o(),M(V.$$.fragment),U=o(),W=b("p"),W.innerHTML=r,J=o(),M(F.$$.fragment),H=o(),B=b("p"),B.innerHTML=f,v=o(),N=b("p"),N.innerHTML=cs,E=o(),M(z.$$.fragment),Y=o(),es=b("p"),es.innerHTML=is,S=o(),M(Q.$$.fragment),q=o(),A=b("p"),A.textContent=ts,fs=o(),M(L.$$.fragment),P=o(),D=b("p"),D.innerHTML=ls,Ms=o(),M(K.$$.fragment),O=o(),ss=b("p"),ss.textContent=as},l(p){u(t.$$.fragment,p),c=Ke(p,`
TensorFlow에서 모델을 파인튜닝하려면 우선 optimizer 함수, 학습률 스케줄 등의 훈련 하이퍼파라미터를 설정하세요:

	`),u(e.$$.fragment,p),i=m(p),g=j(p,"P",{"data-svelte-h":!0}),T(g)!=="svelte-1o23wa2"&&(g.innerHTML=Z),x=m(p),u(X.$$.fragment,p),C=m(p),G=j(p,"P",{"data-svelte-h":!0}),T(G)!=="svelte-bc4nau"&&(G.innerHTML=k),I=m(p),u(V.$$.fragment,p),U=m(p),W=j(p,"P",{"data-svelte-h":!0}),T(W)!=="svelte-lcjrv5"&&(W.innerHTML=r),J=m(p),u(F.$$.fragment,p),H=m(p),B=j(p,"P",{"data-svelte-h":!0}),T(B)!=="svelte-1r18s5x"&&(B.innerHTML=f),v=m(p),N=j(p,"P",{"data-svelte-h":!0}),T(N)!=="svelte-1g3zl6s"&&(N.innerHTML=cs),E=m(p),u(z.$$.fragment,p),Y=m(p),es=j(p,"P",{"data-svelte-h":!0}),T(es)!=="svelte-1b0ip2a"&&(es.innerHTML=is),S=m(p),u(Q.$$.fragment,p),q=m(p),A=j(p,"P",{"data-svelte-h":!0}),T(A)!=="svelte-1hl7vtj"&&(A.textContent=ts),fs=m(p),u(L.$$.fragment,p),P=m(p),D=j(p,"P",{"data-svelte-h":!0}),T(D)!=="svelte-13m2vb0"&&(D.innerHTML=ls),Ms=m(p),u(K.$$.fragment,p),O=m(p),ss=j(p,"P",{"data-svelte-h":!0}),T(ss)!=="svelte-w4puhc"&&(ss.textContent=as)},m(p,w){y(t,p,w),a(p,c,w),y(e,p,w),a(p,i,w),a(p,g,w),a(p,x,w),y(X,p,w),a(p,C,w),a(p,G,w),a(p,I,w),y(V,p,w),a(p,U,w),a(p,W,w),a(p,J,w),y(F,p,w),a(p,H,w),a(p,B,w),a(p,v,w),a(p,N,w),a(p,E,w),y(z,p,w),a(p,Y,w),a(p,es,w),a(p,S,w),y(Q,p,w),a(p,q,w),a(p,A,w),a(p,fs,w),y(L,p,w),a(p,P,w),a(p,D,w),a(p,Ms,w),y(K,p,w),a(p,O,w),a(p,ss,w),us=!0},p(p,w){const ys={};w&2&&(ys.$$scope={dirty:w,ctx:p}),t.$set(ys)},i(p){us||(h(t.$$.fragment,p),h(e.$$.fragment,p),h(X.$$.fragment,p),h(V.$$.fragment,p),h(F.$$.fragment,p),h(z.$$.fragment,p),h(Q.$$.fragment,p),h(L.$$.fragment,p),h(K.$$.fragment,p),us=!0)},o(p){$(t.$$.fragment,p),$(e.$$.fragment,p),$(X.$$.fragment,p),$(V.$$.fragment,p),$(F.$$.fragment,p),$(z.$$.fragment,p),$(Q.$$.fragment,p),$(L.$$.fragment,p),$(K.$$.fragment,p),us=!1},d(p){p&&(l(c),l(i),l(g),l(x),l(C),l(G),l(I),l(U),l(W),l(J),l(H),l(B),l(v),l(N),l(E),l(Y),l(es),l(S),l(q),l(A),l(fs),l(P),l(D),l(Ms),l(O),l(ss)),d(t,p),d(e,p),d(X,p),d(V,p),d(F,p),d(z,p),d(Q,p),d(L,p),d(K,p)}}}function it(_){let t,c;return t=new zs({props:{$$slots:{default:[ct]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(e){u(t.$$.fragment,e)},m(e,i){y(t,e,i),c=!0},p(e,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:e}),t.$set(g)},i(e){c||(h(t.$$.fragment,e),c=!0)},o(e){$(t.$$.fragment,e),c=!1},d(e){d(t,e)}}}function ft(_){let t,c='번역을 위해 모델을 파인튜닝하는 방법에 대한 보다 자세한 예제는 해당 <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation.ipynb" rel="nofollow">PyTorch 노트북</a> 또는 <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation-tf.ipynb" rel="nofollow">TensorFlow 노트북</a>을 참조하세요.';return{c(){t=b("p"),t.innerHTML=c},l(e){t=j(e,"P",{"data-svelte-h":!0}),T(t)!=="svelte-ar4lcc"&&(t.innerHTML=c)},m(e,i){a(e,t,i)},p:ms,d(e){e&&l(t)}}}function Mt(_){let t,c="텍스트를 토큰화하고 <code>input_ids</code>를 PyTorch 텐서로 반환하세요:",e,i,g,Z,x='<code>generate()</code> 메서드로 번역을 생성하세요. 다양한 텍스트 생성 전략 및 생성을 제어하기 위한 매개변수에 대한 자세한 내용은 <a href="../main_classes/text_generation">Text Generation</a> API를 살펴보시기 바랍니다.',X,C,G,k,I="생성된 토큰 ID들을 다시 텍스트로 디코딩하세요:",V,U,W;return i=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJteV9hd2Vzb21lX29wdXNfYm9va3NfbW9kZWwlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHM=",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_opus_books_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids`,wrap:!1}}),C=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yU2VxMlNlcUxNLmZyb21fcHJldHJhaW5lZCglMjJteV9hd2Vzb21lX29wdXNfYm9va3NfbW9kZWwlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyUyQyUyMG1heF9uZXdfdG9rZW5zJTNENDAlMkMlMjBkb19zYW1wbGUlM0RUcnVlJTJDJTIwdG9wX2slM0QzMCUyQyUyMHRvcF9wJTNEMC45NSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSeq2SeqLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;my_awesome_opus_books_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(inputs, max_new_tokens=<span class="hljs-number">40</span>, do_sample=<span class="hljs-literal">True</span>, top_k=<span class="hljs-number">30</span>, top_p=<span class="hljs-number">0.95</span>)`,wrap:!1}}),U=new R({props:{code:"dG9rZW5pemVyLmRlY29kZShvdXRwdXRzJTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27;Les lignées partagent des ressources avec des bactéries enfixant l&#x27;</span>azote.<span class="hljs-string">&#x27;</span>`,wrap:!1}}),{c(){t=b("p"),t.innerHTML=c,e=o(),M(i.$$.fragment),g=o(),Z=b("p"),Z.innerHTML=x,X=o(),M(C.$$.fragment),G=o(),k=b("p"),k.textContent=I,V=o(),M(U.$$.fragment)},l(r){t=j(r,"P",{"data-svelte-h":!0}),T(t)!=="svelte-1b4fw1g"&&(t.innerHTML=c),e=m(r),u(i.$$.fragment,r),g=m(r),Z=j(r,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-14d7ihu"&&(Z.innerHTML=x),X=m(r),u(C.$$.fragment,r),G=m(r),k=j(r,"P",{"data-svelte-h":!0}),T(k)!=="svelte-1u14r4v"&&(k.textContent=I),V=m(r),u(U.$$.fragment,r)},m(r,J){a(r,t,J),a(r,e,J),y(i,r,J),a(r,g,J),a(r,Z,J),a(r,X,J),y(C,r,J),a(r,G,J),a(r,k,J),a(r,V,J),y(U,r,J),W=!0},p:ms,i(r){W||(h(i.$$.fragment,r),h(C.$$.fragment,r),h(U.$$.fragment,r),W=!0)},o(r){$(i.$$.fragment,r),$(C.$$.fragment,r),$(U.$$.fragment,r),W=!1},d(r){r&&(l(t),l(e),l(g),l(Z),l(X),l(G),l(k),l(V)),d(i,r),d(C,r),d(U,r)}}}function ut(_){let t,c;return t=new zs({props:{$$slots:{default:[Mt]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(e){u(t.$$.fragment,e)},m(e,i){y(t,e,i),c=!0},p(e,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:e}),t.$set(g)},i(e){c||(h(t.$$.fragment,e),c=!0)},o(e){$(t.$$.fragment,e),c=!1},d(e){d(t,e)}}}function yt(_){let t,c="텍스트를 토큰화하고 <code>input_ids</code>를 TensorFlow 텐서로 반환하세요:",e,i,g,Z,x='<code>~transformers.generation_tf_utils.TFGenerationMixin.generate</code> 메서드로 번역을 생성하세요. 다양한 텍스트 생성 전략 및 생성을 제어하기 위한 매개변수에 대한 자세한 내용은 <a href="../main_classes/text_generation">Text Generation</a> API를 살펴보시기 바랍니다.',X,C,G,k,I="생성된 토큰 ID들을 다시 텍스트로 디코딩하세요:",V,U,W;return i=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJteV9hd2Vzb21lX29wdXNfYm9va3NfbW9kZWwlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKS5pbnB1dF9pZHM=",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_opus_books_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_ids`,wrap:!1}}),C=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VxMlNlcUxNJTBBJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvclNlcTJTZXFMTS5mcm9tX3ByZXRyYWluZWQoJTIybXlfYXdlc29tZV9vcHVzX2Jvb2tzX21vZGVsJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDQwJTJDJTIwZG9fc2FtcGxlJTNEVHJ1ZSUyQyUyMHRvcF9rJTNEMzAlMkMlMjB0b3BfcCUzRDAuOTUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSeq2SeqLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;my_awesome_opus_books_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(inputs, max_new_tokens=<span class="hljs-number">40</span>, do_sample=<span class="hljs-literal">True</span>, top_k=<span class="hljs-number">30</span>, top_p=<span class="hljs-number">0.95</span>)`,wrap:!1}}),U=new R({props:{code:"dG9rZW5pemVyLmRlY29kZShvdXRwdXRzJTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27;Les lugumes partagent les ressources avec des bactéries fixatrices d&#x27;</span>azote.<span class="hljs-string">&#x27;</span>`,wrap:!1}}),{c(){t=b("p"),t.innerHTML=c,e=o(),M(i.$$.fragment),g=o(),Z=b("p"),Z.innerHTML=x,X=o(),M(C.$$.fragment),G=o(),k=b("p"),k.textContent=I,V=o(),M(U.$$.fragment)},l(r){t=j(r,"P",{"data-svelte-h":!0}),T(t)!=="svelte-jhzp8k"&&(t.innerHTML=c),e=m(r),u(i.$$.fragment,r),g=m(r),Z=j(r,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-1jkrgix"&&(Z.innerHTML=x),X=m(r),u(C.$$.fragment,r),G=m(r),k=j(r,"P",{"data-svelte-h":!0}),T(k)!=="svelte-1u14r4v"&&(k.textContent=I),V=m(r),u(U.$$.fragment,r)},m(r,J){a(r,t,J),a(r,e,J),y(i,r,J),a(r,g,J),a(r,Z,J),a(r,X,J),y(C,r,J),a(r,G,J),a(r,k,J),a(r,V,J),y(U,r,J),W=!0},p:ms,i(r){W||(h(i.$$.fragment,r),h(C.$$.fragment,r),h(U.$$.fragment,r),W=!0)},o(r){$(i.$$.fragment,r),$(C.$$.fragment,r),$(U.$$.fragment,r),W=!1},d(r){r&&(l(t),l(e),l(g),l(Z),l(X),l(G),l(k),l(V)),d(i,r),d(C,r),d(U,r)}}}function ht(_){let t,c;return t=new zs({props:{$$slots:{default:[yt]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(e){u(t.$$.fragment,e)},m(e,i){y(t,e,i),c=!0},p(e,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:e}),t.$set(g)},i(e){c||(h(t.$$.fragment,e),c=!0)},o(e){$(t.$$.fragment,e),c=!1},d(e){d(t,e)}}}function $t(_){let t,c,e,i,g,Z,x,X,C,G,k,I="번역은 한 언어로 된 시퀀스를 다른 언어로 변환합니다. 번역이나 요약은 입력을 받아 일련의 출력을 반환하는 강력한 프레임워크인 시퀀스-투-시퀀스 문제로 구성할 수 있는 대표적인 태스크입니다. 번역 시스템은 일반적으로 다른 언어로 된 텍스트 간의 번역에 사용되지만, 음성 간의 통역이나 텍스트-음성 또는 음성-텍스트와 같은 조합에도 사용될 수 있습니다.",V,U,W="이 가이드에서 학습할 내용은:",r,J,F='<li>영어 텍스트를 프랑스어로 번역하기 위해 <a href="https://huggingface.co/google-t5/t5-small" rel="nofollow">T5</a> 모델을 OPUS Books 데이터세트의 영어-프랑스어 하위 집합으로 파인튜닝하는 방법과</li> <li>파인튜닝된 모델을 추론에 사용하는 방법입니다.</li>',H,B,f,v,N="시작하기 전에 필요한 라이브러리가 모두 설치되어 있는지 확인하세요:",cs,E,z,Y,es="모델을 업로드하고 커뮤니티와 공유할 수 있도록 Hugging Face 계정에 로그인하는 것이 좋습니다. 새로운 창이 표시되면 토큰을 입력하여 로그인하세요.",is,S,Q,q,A,ts,fs='먼저 🤗 Datasets 라이브러리에서 <a href="https://huggingface.co/datasets/opus_books" rel="nofollow">OPUS Books</a> 데이터세트의 영어-프랑스어 하위 집합을 가져오세요.',L,P,D,ls,Ms="데이터세트를 <code>train_test_split</code> 메서드를 사용하여 훈련 및 테스트 데이터로 분할하세요.",K,O,ss,as,us="훈련 데이터에서 예시를 살펴볼까요?",p,w,ys,hs,Je="반환된 딕셔너리의 <code>translation</code> 키가 텍스트의 영어, 프랑스어 버전을 포함하고 있는 것을 볼 수 있습니다.",Ss,$s,Qs,ds,qs,gs,Ue="다음 단계로 영어-프랑스어 쌍을 처리하기 위해 T5 토크나이저를 가져오세요.",As,bs,Ls,js,ke="만들 전처리 함수는 아래 요구사항을 충족해야 합니다:",Ps,ws,_e="<li>T5가 번역 태스크임을 인지할 수 있도록 입력 앞에 프롬프트를 추가하세요. 여러 NLP 태스크를 할 수 있는 모델 중 일부는 이렇게 태스크 프롬프트를 미리 줘야합니다.</li> <li>원어(영어)과 번역어(프랑스어)를 별도로 토큰화하세요. 영어 어휘로 사전 학습된 토크나이저로 프랑스어 텍스트를 토큰화할 수는 없기 때문입니다.</li> <li><code>max_length</code> 매개변수로 설정한 최대 길이보다 길지 않도록 시퀀스를 truncate하세요.</li>",Ds,Ts,Ks,Js,Ze="전체 데이터세트에 전처리 함수를 적용하려면 🤗 Datasets의 <code>map</code> 메서드를 사용하세요. <code>map</code> 함수의 속도를 높이려면 <code>batched=True</code>를 설정하여 데이터세트의 여러 요소를 한 번에 처리하는 방법이 있습니다.",Os,Us,se,ks,Ce="이제 <code>DataCollatorForSeq2Seq</code>를 사용하여 예제 배치를 생성합니다. 데이터세트의 최대 길이로 전부를 padding하는 대신, 데이터 정렬 중 각 배치의 최대 길이로 문장을 <em>동적으로 padding</em>하는 것이 더 효율적입니다.",ee,ns,te,_s,le,Zs,ve='훈련 중에 메트릭을 포함하면 모델의 성능을 평가하는 데 도움이 됩니다. 🤗 <a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a> 라이브러리로 평가 방법(evaluation method)을 빠르게 가져올 수 있습니다. 현재 태스크에 적합한 SacreBLEU 메트릭을 가져오세요. (메트릭을 가져오고 계산하는 방법에 대해 자세히 알아보려면 🤗 Evaluate <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">둘러보기</a>를 참조하세요):',ae,Cs,ne,vs,Re="그런 다음 <code>compute</code>에 예측값과 레이블을 전달하여 SacreBLEU 점수를 계산하는 함수를 생성하세요:",pe,Rs,re,Xs,Xe="이제 <code>compute_metrics</code> 함수는 준비되었고, 훈련 과정을 설정할 때 다시 살펴볼 예정입니다.",oe,Gs,me,ps,ce,rs,ie,Vs,fe,Ws,Ge="좋아요, 이제 모델을 파인튜닝했으니 추론에 사용할 수 있습니다!",Me,xs,Ve="다른 언어로 번역하고 싶은 텍스트를 써보세요. T5의 경우 원하는 태스크를 입력의 접두사로 추가해야 합니다. 예를 들어 영어에서 프랑스어로 번역하는 경우, 아래와 같은 접두사가 추가됩니다:",ue,Bs,ye,Hs,We="파인튜닝된 모델로 추론하기에 제일 간단한 방법은 <code>pipeline()</code>을 사용하는 것입니다. 해당 모델로 번역 <code>pipeline</code>을 만든 뒤, 텍스트를 전달하세요:",he,Is,$e,Fs,xe="원한다면 <code>pipeline</code>의 결과를 직접 복제할 수도 있습니다:",de,os,ge,Ns,be,Ys,je;return g=new Es({props:{title:"번역",local:"translation",headingTag:"h1"}}),x=new Oe({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/translation.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/translation.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/translation.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/translation.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/translation.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/translation.ipynb"}]}}),C=new Ye({props:{id:"1JvfrvZgi6c"}}),B=new we({props:{$$slots:{default:[et]},$$scope:{ctx:_}}}),E=new R({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGUlMjBzYWNyZWJsZXU=",highlighted:"pip install transformers datasets evaluate sacrebleu",wrap:!1}}),S=new R({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 Es({props:{title:"OPUS Books 데이터세트 가져오기",local:"load-opus-books-dataset",headingTag:"h2"}}),P=new R({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBYm9va3MlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyb3B1c19ib29rcyUyMiUyQyUyMCUyMmVuLWZyJTIyKQ==",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>books = load_dataset(<span class="hljs-string">&quot;opus_books&quot;</span>, <span class="hljs-string">&quot;en-fr&quot;</span>)`,wrap:!1}}),O=new R({props:{code:"Ym9va3MlMjAlM0QlMjBib29rcyU1QiUyMnRyYWluJTIyJTVELnRyYWluX3Rlc3Rfc3BsaXQodGVzdF9zaXplJTNEMC4yKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>books = books[<span class="hljs-string">&quot;train&quot;</span>].train_test_split(test_size=<span class="hljs-number">0.2</span>)',wrap:!1}}),w=new R({props:{code:"Ym9va3MlNUIlMjJ0cmFpbiUyMiU1RCU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>books[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;id&#x27;</span>: <span class="hljs-string">&#x27;90560&#x27;</span>,
 <span class="hljs-string">&#x27;translation&#x27;</span>: {<span class="hljs-string">&#x27;en&#x27;</span>: <span class="hljs-string">&#x27;But this lofty plateau measured only a few fathoms, and soon we reentered Our Element.&#x27;</span>,
  <span class="hljs-string">&#x27;fr&#x27;</span>: <span class="hljs-string">&#x27;Mais ce plateau élevé ne mesurait que quelques toises, et bientôt nous fûmes rentrés dans notre élément.&#x27;</span>}}`,wrap:!1}}),$s=new Es({props:{title:"전처리",local:"preprocess",headingTag:"h2"}}),ds=new Ye({props:{id:"XAR8jnZZuUs"}}),bs=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEFjaGVja3BvaW50JTIwJTNEJTIwJTIyZ29vZ2xlLXQ1JTJGdDUtc21hbGwlMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KQ==",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>checkpoint = <span class="hljs-string">&quot;google-t5/t5-small&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(checkpoint)`,wrap:!1}}),Ts=new R({props:{code:"c291cmNlX2xhbmclMjAlM0QlMjAlMjJlbiUyMiUwQXRhcmdldF9sYW5nJTIwJTNEJTIwJTIyZnIlMjIlMEFwcmVmaXglMjAlM0QlMjAlMjJ0cmFuc2xhdGUlMjBFbmdsaXNoJTIwdG8lMjBGcmVuY2glM0ElMjAlMjIlMEElMEElMEFkZWYlMjBwcmVwcm9jZXNzX2Z1bmN0aW9uKGV4YW1wbGVzKSUzQSUwQSUyMCUyMCUyMCUyMGlucHV0cyUyMCUzRCUyMCU1QnByZWZpeCUyMCUyQiUyMGV4YW1wbGUlNUJzb3VyY2VfbGFuZyU1RCUyMGZvciUyMGV4YW1wbGUlMjBpbiUyMGV4YW1wbGVzJTVCJTIydHJhbnNsYXRpb24lMjIlNUQlNUQlMEElMjAlMjAlMjAlMjB0YXJnZXRzJTIwJTNEJTIwJTVCZXhhbXBsZSU1QnRhcmdldF9sYW5nJTVEJTIwZm9yJTIwZXhhbXBsZSUyMGluJTIwZXhhbXBsZXMlNUIlMjJ0cmFuc2xhdGlvbiUyMiU1RCU1RCUwQSUyMCUyMCUyMCUyMG1vZGVsX2lucHV0cyUyMCUzRCUyMHRva2VuaXplcihpbnB1dHMlMkMlMjB0ZXh0X3RhcmdldCUzRHRhcmdldHMlMkMlMjBtYXhfbGVuZ3RoJTNEMTI4JTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwbW9kZWxfaW5wdXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>source_lang = <span class="hljs-string">&quot;en&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_lang = <span class="hljs-string">&quot;fr&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prefix = <span class="hljs-string">&quot;translate English to French: &quot;</span>


<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>    inputs = [prefix + example[source_lang] <span class="hljs-keyword">for</span> example <span class="hljs-keyword">in</span> examples[<span class="hljs-string">&quot;translation&quot;</span>]]
<span class="hljs-meta">... </span>    targets = [example[target_lang] <span class="hljs-keyword">for</span> example <span class="hljs-keyword">in</span> examples[<span class="hljs-string">&quot;translation&quot;</span>]]
<span class="hljs-meta">... </span>    model_inputs = tokenizer(inputs, text_target=targets, max_length=<span class="hljs-number">128</span>, truncation=<span class="hljs-literal">True</span>)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> model_inputs`,wrap:!1}}),Us=new R({props:{code:"dG9rZW5pemVkX2Jvb2tzJTIwJTNEJTIwYm9va3MubWFwKHByZXByb2Nlc3NfZnVuY3Rpb24lMkMlMjBiYXRjaGVkJTNEVHJ1ZSk=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_books = books.<span class="hljs-built_in">map</span>(preprocess_function, batched=<span class="hljs-literal">True</span>)',wrap:!1}}),ns=new Te({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[nt],pytorch:[lt]},$$scope:{ctx:_}}}),_s=new Es({props:{title:"평가",local:"evalulate",headingTag:"h2"}}),Cs=new R({props:{code:"aW1wb3J0JTIwZXZhbHVhdGUlMEElMEFtZXRyaWMlMjAlM0QlMjBldmFsdWF0ZS5sb2FkKCUyMnNhY3JlYmxldSUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> evaluate

<span class="hljs-meta">&gt;&gt;&gt; </span>metric = evaluate.load(<span class="hljs-string">&quot;sacrebleu&quot;</span>)`,wrap:!1}}),Rs=new R({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBJTBBZGVmJTIwcG9zdHByb2Nlc3NfdGV4dChwcmVkcyUyQyUyMGxhYmVscyklM0ElMEElMjAlMjAlMjAlMjBwcmVkcyUyMCUzRCUyMCU1QnByZWQuc3RyaXAoKSUyMGZvciUyMHByZWQlMjBpbiUyMHByZWRzJTVEJTBBJTIwJTIwJTIwJTIwbGFiZWxzJTIwJTNEJTIwJTVCJTVCbGFiZWwuc3RyaXAoKSU1RCUyMGZvciUyMGxhYmVsJTIwaW4lMjBsYWJlbHMlNUQlMEElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBwcmVkcyUyQyUyMGxhYmVscyUwQSUwQSUwQWRlZiUyMGNvbXB1dGVfbWV0cmljcyhldmFsX3ByZWRzKSUzQSUwQSUyMCUyMCUyMCUyMHByZWRzJTJDJTIwbGFiZWxzJTIwJTNEJTIwZXZhbF9wcmVkcyUwQSUyMCUyMCUyMCUyMGlmJTIwaXNpbnN0YW5jZShwcmVkcyUyQyUyMHR1cGxlKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByZWRzJTIwJTNEJTIwcHJlZHMlNUIwJTVEJTBBJTIwJTIwJTIwJTIwZGVjb2RlZF9wcmVkcyUyMCUzRCUyMHRva2VuaXplci5iYXRjaF9kZWNvZGUocHJlZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklMEElMEElMjAlMjAlMjAlMjBsYWJlbHMlMjAlM0QlMjBucC53aGVyZShsYWJlbHMlMjAhJTNEJTIwLTEwMCUyQyUyMGxhYmVscyUyQyUyMHRva2VuaXplci5wYWRfdG9rZW5faWQpJTBBJTIwJTIwJTIwJTIwZGVjb2RlZF9sYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGxhYmVscyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSUwQSUwQSUyMCUyMCUyMCUyMGRlY29kZWRfcHJlZHMlMkMlMjBkZWNvZGVkX2xhYmVscyUyMCUzRCUyMHBvc3Rwcm9jZXNzX3RleHQoZGVjb2RlZF9wcmVkcyUyQyUyMGRlY29kZWRfbGFiZWxzKSUwQSUwQSUyMCUyMCUyMCUyMHJlc3VsdCUyMCUzRCUyMG1ldHJpYy5jb21wdXRlKHByZWRpY3Rpb25zJTNEZGVjb2RlZF9wcmVkcyUyQyUyMHJlZmVyZW5jZXMlM0RkZWNvZGVkX2xhYmVscyklMEElMjAlMjAlMjAlMjByZXN1bHQlMjAlM0QlMjAlN0IlMjJibGV1JTIyJTNBJTIwcmVzdWx0JTVCJTIyc2NvcmUlMjIlNUQlN0QlMEElMEElMjAlMjAlMjAlMjBwcmVkaWN0aW9uX2xlbnMlMjAlM0QlMjAlNUJucC5jb3VudF9ub256ZXJvKHByZWQlMjAhJTNEJTIwdG9rZW5pemVyLnBhZF90b2tlbl9pZCklMjBmb3IlMjBwcmVkJTIwaW4lMjBwcmVkcyU1RCUwQSUyMCUyMCUyMCUyMHJlc3VsdCU1QiUyMmdlbl9sZW4lMjIlNUQlMjAlM0QlMjBucC5tZWFuKHByZWRpY3Rpb25fbGVucyklMEElMjAlMjAlMjAlMjByZXN1bHQlMjAlM0QlMjAlN0JrJTNBJTIwcm91bmQodiUyQyUyMDQpJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMHJlc3VsdC5pdGVtcygpJTdEJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwcmVzdWx0",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">postprocess_text</span>(<span class="hljs-params">preds, labels</span>):
<span class="hljs-meta">... </span>    preds = [pred.strip() <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds]
<span class="hljs-meta">... </span>    labels = [[label.strip()] <span class="hljs-keyword">for</span> label <span class="hljs-keyword">in</span> labels]

<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> preds, labels


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">compute_metrics</span>(<span class="hljs-params">eval_preds</span>):
<span class="hljs-meta">... </span>    preds, labels = eval_preds
<span class="hljs-meta">... </span>    <span class="hljs-keyword">if</span> <span class="hljs-built_in">isinstance</span>(preds, <span class="hljs-built_in">tuple</span>):
<span class="hljs-meta">... </span>        preds = preds[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>    decoded_preds = tokenizer.batch_decode(preds, skip_special_tokens=<span class="hljs-literal">True</span>)

<span class="hljs-meta">... </span>    labels = np.where(labels != -<span class="hljs-number">100</span>, labels, tokenizer.pad_token_id)
<span class="hljs-meta">... </span>    decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=<span class="hljs-literal">True</span>)

<span class="hljs-meta">... </span>    decoded_preds, decoded_labels = postprocess_text(decoded_preds, decoded_labels)

<span class="hljs-meta">... </span>    result = metric.compute(predictions=decoded_preds, references=decoded_labels)
<span class="hljs-meta">... </span>    result = {<span class="hljs-string">&quot;bleu&quot;</span>: result[<span class="hljs-string">&quot;score&quot;</span>]}

<span class="hljs-meta">... </span>    prediction_lens = [np.count_nonzero(pred != tokenizer.pad_token_id) <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds]
<span class="hljs-meta">... </span>    result[<span class="hljs-string">&quot;gen_len&quot;</span>] = np.mean(prediction_lens)
<span class="hljs-meta">... </span>    result = {k: <span class="hljs-built_in">round</span>(v, <span class="hljs-number">4</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> result.items()}
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> result`,wrap:!1}}),Gs=new Es({props:{title:"훈련",local:"train",headingTag:"h2"}}),ps=new Te({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[it],pytorch:[ot]},$$scope:{ctx:_}}}),rs=new we({props:{$$slots:{default:[ft]},$$scope:{ctx:_}}}),Vs=new Es({props:{title:"추론",local:"inference",headingTag:"h2"}}),Bs=new R({props:{code:"dGV4dCUyMCUzRCUyMCUyMnRyYW5zbGF0ZSUyMEVuZ2xpc2glMjB0byUyMEZyZW5jaCUzQSUyMExlZ3VtZXMlMjBzaGFyZSUyMHJlc291cmNlcyUyMHdpdGglMjBuaXRyb2dlbi1maXhpbmclMjBiYWN0ZXJpYS4lMjI=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;translate English to French: Legumes share resources with nitrogen-fixing bacteria.&quot;</span>',wrap:!1}}),Is=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBdHJhbnNsYXRvciUyMCUzRCUyMHBpcGVsaW5lKCUyMnRyYW5zbGF0aW9uX3h4X3RvX3l5JTIyJTJDJTIwbW9kZWwlM0QlMjJteV9hd2Vzb21lX29wdXNfYm9va3NfbW9kZWwlMjIpJTBBdHJhbnNsYXRvcih0ZXh0KQ==",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-comment"># Change \`xx\` to the language of the input and \`yy\` to the language of the desired output.</span>
<span class="hljs-comment"># Examples: &quot;en&quot; for English, &quot;fr&quot; for French, &quot;de&quot; for German, &quot;es&quot; for Spanish, &quot;zh&quot; for Chinese, etc; translation_en_to_fr translates English to French</span>
<span class="hljs-comment"># You can view all the lists of languages here - https://huggingface.co/languages</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>translator = pipeline(<span class="hljs-string">&quot;translation_xx_to_yy&quot;</span>, model=<span class="hljs-string">&quot;my_awesome_opus_books_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>translator(text)
[{<span class="hljs-string">&#x27;translation_text&#x27;</span>: <span class="hljs-string">&#x27;Legumes partagent des ressources avec des bactéries azotantes.&#x27;</span>}]`,wrap:!1}}),os=new Te({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ht],pytorch:[ut]},$$scope:{ctx:_}}}),Ns=new st({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/tasks/translation.md"}}),{c(){t=b("meta"),c=o(),e=b("p"),i=o(),M(g.$$.fragment),Z=o(),M(x.$$.fragment),X=o(),M(C.$$.fragment),G=o(),k=b("p"),k.textContent=I,V=o(),U=b("p"),U.textContent=W,r=o(),J=b("ol"),J.innerHTML=F,H=o(),M(B.$$.fragment),f=o(),v=b("p"),v.textContent=N,cs=o(),M(E.$$.fragment),z=o(),Y=b("p"),Y.textContent=es,is=o(),M(S.$$.fragment),Q=o(),M(q.$$.fragment),A=o(),ts=b("p"),ts.innerHTML=fs,L=o(),M(P.$$.fragment),D=o(),ls=b("p"),ls.innerHTML=Ms,K=o(),M(O.$$.fragment),ss=o(),as=b("p"),as.textContent=us,p=o(),M(w.$$.fragment),ys=o(),hs=b("p"),hs.innerHTML=Je,Ss=o(),M($s.$$.fragment),Qs=o(),M(ds.$$.fragment),qs=o(),gs=b("p"),gs.textContent=Ue,As=o(),M(bs.$$.fragment),Ls=o(),js=b("p"),js.textContent=ke,Ps=o(),ws=b("ol"),ws.innerHTML=_e,Ds=o(),M(Ts.$$.fragment),Ks=o(),Js=b("p"),Js.innerHTML=Ze,Os=o(),M(Us.$$.fragment),se=o(),ks=b("p"),ks.innerHTML=Ce,ee=o(),M(ns.$$.fragment),te=o(),M(_s.$$.fragment),le=o(),Zs=b("p"),Zs.innerHTML=ve,ae=o(),M(Cs.$$.fragment),ne=o(),vs=b("p"),vs.innerHTML=Re,pe=o(),M(Rs.$$.fragment),re=o(),Xs=b("p"),Xs.innerHTML=Xe,oe=o(),M(Gs.$$.fragment),me=o(),M(ps.$$.fragment),ce=o(),M(rs.$$.fragment),ie=o(),M(Vs.$$.fragment),fe=o(),Ws=b("p"),Ws.textContent=Ge,Me=o(),xs=b("p"),xs.textContent=Ve,ue=o(),M(Bs.$$.fragment),ye=o(),Hs=b("p"),Hs.innerHTML=We,he=o(),M(Is.$$.fragment),$e=o(),Fs=b("p"),Fs.innerHTML=xe,de=o(),M(os.$$.fragment),ge=o(),M(Ns.$$.fragment),be=o(),Ys=b("p"),this.h()},l(s){const n=Le("svelte-u9bgzb",document.head);t=j(n,"META",{name:!0,content:!0}),n.forEach(l),c=m(s),e=j(s,"P",{}),Ee(e).forEach(l),i=m(s),u(g.$$.fragment,s),Z=m(s),u(x.$$.fragment,s),X=m(s),u(C.$$.fragment,s),G=m(s),k=j(s,"P",{"data-svelte-h":!0}),T(k)!=="svelte-1k3fp3p"&&(k.textContent=I),V=m(s),U=j(s,"P",{"data-svelte-h":!0}),T(U)!=="svelte-14hiaa1"&&(U.textContent=W),r=m(s),J=j(s,"OL",{"data-svelte-h":!0}),T(J)!=="svelte-4n42lt"&&(J.innerHTML=F),H=m(s),u(B.$$.fragment,s),f=m(s),v=j(s,"P",{"data-svelte-h":!0}),T(v)!=="svelte-1k0z9pm"&&(v.textContent=N),cs=m(s),u(E.$$.fragment,s),z=m(s),Y=j(s,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-1jstx1u"&&(Y.textContent=es),is=m(s),u(S.$$.fragment,s),Q=m(s),u(q.$$.fragment,s),A=m(s),ts=j(s,"P",{"data-svelte-h":!0}),T(ts)!=="svelte-adgncb"&&(ts.innerHTML=fs),L=m(s),u(P.$$.fragment,s),D=m(s),ls=j(s,"P",{"data-svelte-h":!0}),T(ls)!=="svelte-19d5a0p"&&(ls.innerHTML=Ms),K=m(s),u(O.$$.fragment,s),ss=m(s),as=j(s,"P",{"data-svelte-h":!0}),T(as)!=="svelte-o7e31d"&&(as.textContent=us),p=m(s),u(w.$$.fragment,s),ys=m(s),hs=j(s,"P",{"data-svelte-h":!0}),T(hs)!=="svelte-18ww8rs"&&(hs.innerHTML=Je),Ss=m(s),u($s.$$.fragment,s),Qs=m(s),u(ds.$$.fragment,s),qs=m(s),gs=j(s,"P",{"data-svelte-h":!0}),T(gs)!=="svelte-1mrpk7j"&&(gs.textContent=Ue),As=m(s),u(bs.$$.fragment,s),Ls=m(s),js=j(s,"P",{"data-svelte-h":!0}),T(js)!=="svelte-cw39ls"&&(js.textContent=ke),Ps=m(s),ws=j(s,"OL",{"data-svelte-h":!0}),T(ws)!=="svelte-1a06q10"&&(ws.innerHTML=_e),Ds=m(s),u(Ts.$$.fragment,s),Ks=m(s),Js=j(s,"P",{"data-svelte-h":!0}),T(Js)!=="svelte-1lmdyeh"&&(Js.innerHTML=Ze),Os=m(s),u(Us.$$.fragment,s),se=m(s),ks=j(s,"P",{"data-svelte-h":!0}),T(ks)!=="svelte-1lgij5g"&&(ks.innerHTML=Ce),ee=m(s),u(ns.$$.fragment,s),te=m(s),u(_s.$$.fragment,s),le=m(s),Zs=j(s,"P",{"data-svelte-h":!0}),T(Zs)!=="svelte-1fiqbd1"&&(Zs.innerHTML=ve),ae=m(s),u(Cs.$$.fragment,s),ne=m(s),vs=j(s,"P",{"data-svelte-h":!0}),T(vs)!=="svelte-1925cbb"&&(vs.innerHTML=Re),pe=m(s),u(Rs.$$.fragment,s),re=m(s),Xs=j(s,"P",{"data-svelte-h":!0}),T(Xs)!=="svelte-11m7xom"&&(Xs.innerHTML=Xe),oe=m(s),u(Gs.$$.fragment,s),me=m(s),u(ps.$$.fragment,s),ce=m(s),u(rs.$$.fragment,s),ie=m(s),u(Vs.$$.fragment,s),fe=m(s),Ws=j(s,"P",{"data-svelte-h":!0}),T(Ws)!=="svelte-1nv1rsn"&&(Ws.textContent=Ge),Me=m(s),xs=j(s,"P",{"data-svelte-h":!0}),T(xs)!=="svelte-1kbteb5"&&(xs.textContent=Ve),ue=m(s),u(Bs.$$.fragment,s),ye=m(s),Hs=j(s,"P",{"data-svelte-h":!0}),T(Hs)!=="svelte-19gmubo"&&(Hs.innerHTML=We),he=m(s),u(Is.$$.fragment,s),$e=m(s),Fs=j(s,"P",{"data-svelte-h":!0}),T(Fs)!=="svelte-ckakkh"&&(Fs.innerHTML=xe),de=m(s),u(os.$$.fragment,s),ge=m(s),u(Ns.$$.fragment,s),be=m(s),Ys=j(s,"P",{}),Ee(Ys).forEach(l),this.h()},h(){ze(t,"name","hf:doc:metadata"),ze(t,"content",dt)},m(s,n){Pe(document.head,t),a(s,c,n),a(s,e,n),a(s,i,n),y(g,s,n),a(s,Z,n),y(x,s,n),a(s,X,n),y(C,s,n),a(s,G,n),a(s,k,n),a(s,V,n),a(s,U,n),a(s,r,n),a(s,J,n),a(s,H,n),y(B,s,n),a(s,f,n),a(s,v,n),a(s,cs,n),y(E,s,n),a(s,z,n),a(s,Y,n),a(s,is,n),y(S,s,n),a(s,Q,n),y(q,s,n),a(s,A,n),a(s,ts,n),a(s,L,n),y(P,s,n),a(s,D,n),a(s,ls,n),a(s,K,n),y(O,s,n),a(s,ss,n),a(s,as,n),a(s,p,n),y(w,s,n),a(s,ys,n),a(s,hs,n),a(s,Ss,n),y($s,s,n),a(s,Qs,n),y(ds,s,n),a(s,qs,n),a(s,gs,n),a(s,As,n),y(bs,s,n),a(s,Ls,n),a(s,js,n),a(s,Ps,n),a(s,ws,n),a(s,Ds,n),y(Ts,s,n),a(s,Ks,n),a(s,Js,n),a(s,Os,n),y(Us,s,n),a(s,se,n),a(s,ks,n),a(s,ee,n),y(ns,s,n),a(s,te,n),y(_s,s,n),a(s,le,n),a(s,Zs,n),a(s,ae,n),y(Cs,s,n),a(s,ne,n),a(s,vs,n),a(s,pe,n),y(Rs,s,n),a(s,re,n),a(s,Xs,n),a(s,oe,n),y(Gs,s,n),a(s,me,n),y(ps,s,n),a(s,ce,n),y(rs,s,n),a(s,ie,n),y(Vs,s,n),a(s,fe,n),a(s,Ws,n),a(s,Me,n),a(s,xs,n),a(s,ue,n),y(Bs,s,n),a(s,ye,n),a(s,Hs,n),a(s,he,n),y(Is,s,n),a(s,$e,n),a(s,Fs,n),a(s,de,n),y(os,s,n),a(s,ge,n),y(Ns,s,n),a(s,be,n),a(s,Ys,n),je=!0},p(s,[n]){const Be={};n&2&&(Be.$$scope={dirty:n,ctx:s}),B.$set(Be);const He={};n&2&&(He.$$scope={dirty:n,ctx:s}),ns.$set(He);const Ie={};n&2&&(Ie.$$scope={dirty:n,ctx:s}),ps.$set(Ie);const Fe={};n&2&&(Fe.$$scope={dirty:n,ctx:s}),rs.$set(Fe);const Ne={};n&2&&(Ne.$$scope={dirty:n,ctx:s}),os.$set(Ne)},i(s){je||(h(g.$$.fragment,s),h(x.$$.fragment,s),h(C.$$.fragment,s),h(B.$$.fragment,s),h(E.$$.fragment,s),h(S.$$.fragment,s),h(q.$$.fragment,s),h(P.$$.fragment,s),h(O.$$.fragment,s),h(w.$$.fragment,s),h($s.$$.fragment,s),h(ds.$$.fragment,s),h(bs.$$.fragment,s),h(Ts.$$.fragment,s),h(Us.$$.fragment,s),h(ns.$$.fragment,s),h(_s.$$.fragment,s),h(Cs.$$.fragment,s),h(Rs.$$.fragment,s),h(Gs.$$.fragment,s),h(ps.$$.fragment,s),h(rs.$$.fragment,s),h(Vs.$$.fragment,s),h(Bs.$$.fragment,s),h(Is.$$.fragment,s),h(os.$$.fragment,s),h(Ns.$$.fragment,s),je=!0)},o(s){$(g.$$.fragment,s),$(x.$$.fragment,s),$(C.$$.fragment,s),$(B.$$.fragment,s),$(E.$$.fragment,s),$(S.$$.fragment,s),$(q.$$.fragment,s),$(P.$$.fragment,s),$(O.$$.fragment,s),$(w.$$.fragment,s),$($s.$$.fragment,s),$(ds.$$.fragment,s),$(bs.$$.fragment,s),$(Ts.$$.fragment,s),$(Us.$$.fragment,s),$(ns.$$.fragment,s),$(_s.$$.fragment,s),$(Cs.$$.fragment,s),$(Rs.$$.fragment,s),$(Gs.$$.fragment,s),$(ps.$$.fragment,s),$(rs.$$.fragment,s),$(Vs.$$.fragment,s),$(Bs.$$.fragment,s),$(Is.$$.fragment,s),$(os.$$.fragment,s),$(Ns.$$.fragment,s),je=!1},d(s){s&&(l(c),l(e),l(i),l(Z),l(X),l(G),l(k),l(V),l(U),l(r),l(J),l(H),l(f),l(v),l(cs),l(z),l(Y),l(is),l(Q),l(A),l(ts),l(L),l(D),l(ls),l(K),l(ss),l(as),l(p),l(ys),l(hs),l(Ss),l(Qs),l(qs),l(gs),l(As),l(Ls),l(js),l(Ps),l(ws),l(Ds),l(Ks),l(Js),l(Os),l(se),l(ks),l(ee),l(te),l(le),l(Zs),l(ae),l(ne),l(vs),l(pe),l(re),l(Xs),l(oe),l(me),l(ce),l(ie),l(fe),l(Ws),l(Me),l(xs),l(ue),l(ye),l(Hs),l(he),l($e),l(Fs),l(de),l(ge),l(be),l(Ys)),l(t),d(g,s),d(x,s),d(C,s),d(B,s),d(E,s),d(S,s),d(q,s),d(P,s),d(O,s),d(w,s),d($s,s),d(ds,s),d(bs,s),d(Ts,s),d(Us,s),d(ns,s),d(_s,s),d(Cs,s),d(Rs,s),d(Gs,s),d(ps,s),d(rs,s),d(Vs,s),d(Bs,s),d(Is,s),d(os,s),d(Ns,s)}}}const dt='{"title":"번역","local":"translation","sections":[{"title":"OPUS Books 데이터세트 가져오기","local":"load-opus-books-dataset","sections":[],"depth":2},{"title":"전처리","local":"preprocess","sections":[],"depth":2},{"title":"평가","local":"evalulate","sections":[],"depth":2},{"title":"훈련","local":"train","sections":[],"depth":2},{"title":"추론","local":"inference","sections":[],"depth":2}],"depth":1}';function gt(_){return Qe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zt extends qe{constructor(t){super(),Ae(this,t,gt,$t,Se,{})}}export{Zt as component};
