import{s as Ss,o as Qs,n as me}from"../chunks/scheduler.56730f09.js";import{S as qs,i as As,g as b,s as o,r as M,A as Ls,h as j,f as l,c as m,j as zs,u,x as T,k as Es,y as Ps,a,v as y,d as h,t as $,w as d,m as Ds,n as Ks}from"../chunks/index.1f144517.js";import{T as ws}from"../chunks/Tip.41e845e5.js";import{Y as Ys}from"../chunks/Youtube.62e0f062.js";import{C as R}from"../chunks/CodeBlock.738eeccb.js";import{D as Os}from"../chunks/DocNotebookDropdown.243c3df7.js";import{F as Ts,M as Ee}from"../chunks/Markdown.3289e0dc.js";import{H as ze,E as et}from"../chunks/EditOnGithub.854793f1.js";function st(_){let t,c='이 작업과 호환되는 모든 아키텍처와 체크포인트를 보려면 <a href="https://huggingface.co/tasks/translation" rel="nofollow">작업 페이지</a>를 확인하는 것이 좋습니다.';return{c(){t=b("p"),t.innerHTML=c},l(s){t=j(s,"P",{"data-svelte-h":!0}),T(t)!=="svelte-11fatqs"&&(t.innerHTML=c)},m(s,i){a(s,t,i)},p:me,d(s){s&&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(s){u(t.$$.fragment,s)},m(s,i){y(t,s,i),c=!0},p:me,i(s){c||(h(t.$$.fragment,s),c=!0)},o(s){$(t.$$.fragment,s),c=!1},d(s){d(t,s)}}}function lt(_){let t,c;return t=new Ee({props:{$$slots:{default:[tt]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(s){u(t.$$.fragment,s)},m(s,i){y(t,s,i),c=!0},p(s,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:s}),t.$set(g)},i(s){c||(h(t.$$.fragment,s),c=!0)},o(s){$(t.$$.fragment,s),c=!1},d(s){d(t,s)}}}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(s){u(t.$$.fragment,s)},m(s,i){y(t,s,i),c=!0},p:me,i(s){c||(h(t.$$.fragment,s),c=!0)},o(s){$(t.$$.fragment,s),c=!1},d(s){d(t,s)}}}function nt(_){let t,c;return t=new Ee({props:{$$slots:{default:[at]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(s){u(t.$$.fragment,s)},m(s,i){y(t,s,i),c=!0},p(s,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:s}),t.$set(g)},i(s){c||(h(t.$$.fragment,s),c=!0)},o(s){$(t.$$.fragment,s),c=!1},d(s){d(t,s)}}}function pt(_){let t,c='<code>Trainer</code>로 모델을 파인튜닝하는 방법에 익숙하지 않다면 <a href="../training#train-with-pytorch-trainer">여기</a>에서 기본 튜토리얼을 살펴보시기 바랍니다!';return{c(){t=b("p"),t.innerHTML=c},l(s){t=j(s,"P",{"data-svelte-h":!0}),T(t)!=="svelte-1ba0r5n"&&(t.innerHTML=c)},m(s,i){a(s,t,i)},p:me,d(s){s&&l(t)}}}function rt(_){let t,c,s,i="모델을 훈련시킬 준비가 되었군요! <code>AutoModelForSeq2SeqLM</code>으로 T5를 로드하세요:",g,Z,x,X,C="이제 세 단계만 거치면 끝입니다:",G,k,I="<li><code>Seq2SeqTrainingArguments</code>에서 훈련 하이퍼파라미터를 정의하세요. 유일한 필수 매개변수는 모델을 저장할 위치인 <code>output_dir</code>입니다. 모델을 Hub에 푸시하기 위해 <code>push_to_hub=True</code>로 설정하세요. (모델을 업로드하려면 Hugging Face에 로그인해야 합니다.) <code>Trainer</code>는 에폭이 끝날때마다 SacreBLEU 메트릭을 평가하고 훈련 체크포인트를 저장합니다.</li> <li><code>Seq2SeqTrainer</code>에 훈련 인수를 전달하세요. 모델, 데이터 세트, 토크나이저, data collator 및 <code>compute_metrics</code> 함수도 덩달아 전달해야 합니다.</li> <li><code>train()</code>을 호출하여 모델을 파인튜닝하세요.</li>",W,U,V,r,J="학습이 완료되면 <code>push_to_hub()</code> 메서드로 모델을 Hub에 공유하세요. 이러면 누구나 모델을 사용할 수 있게 됩니다:",F,H,B;return t=new ws({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:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFNlcTJTZXFUcmFpbmluZ0FyZ3VtZW50cyglMEElMjAlMjAlMjAlMjBvdXRwdXRfZGlyJTNEJTIybXlfYXdlc29tZV9vcHVzX2Jvb2tzX21vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdHJhdGVneSUzRCUyMmVwb2NoJTIyJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDJlLTUlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0QxNiUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBJTIwJTIwJTIwJTIwc2F2ZV90b3RhbF9saW1pdCUzRDMlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNEMiUyQyUwQSUyMCUyMCUyMCUyMHByZWRpY3Rfd2l0aF9nZW5lcmF0ZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBmcDE2JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHB1c2hfdG9faHViJTNEVHJ1ZSUyQyUwQSklMEElMEF0cmFpbmVyJTIwJTNEJTIwU2VxMlNlcVRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRHRva2VuaXplZF9ib29rcyU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEdG9rZW5pemVkX2Jvb2tzJTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRHRva2VuaXplciUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBJTIwJTIwJTIwJTIwY29tcHV0ZV9tZXRyaWNzJTNEY29tcHV0ZV9tZXRyaWNzJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",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>    tokenizer=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(),s=b("p"),s.innerHTML=i,g=o(),M(Z.$$.fragment),x=o(),X=b("p"),X.textContent=C,G=o(),k=b("ol"),k.innerHTML=I,W=o(),M(U.$$.fragment),V=o(),r=b("p"),r.innerHTML=J,F=o(),M(H.$$.fragment)},l(f){u(t.$$.fragment,f),c=m(f),s=j(f,"P",{"data-svelte-h":!0}),T(s)!=="svelte-4h5y1d"&&(s.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-df1avs"&&(k.innerHTML=I),W=m(f),u(U.$$.fragment,f),V=m(f),r=j(f,"P",{"data-svelte-h":!0}),T(r)!=="svelte-y88jp6"&&(r.innerHTML=J),F=m(f),u(H.$$.fragment,f)},m(f,v){y(t,f,v),a(f,c,v),a(f,s,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,W,v),y(U,f,v),a(f,V,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(s),l(g),l(x),l(X),l(G),l(k),l(W),l(V),l(r),l(F)),d(t,f),d(Z,f),d(U,f),d(H,f)}}}function ot(_){let t,c;return t=new Ee({props:{$$slots:{default:[rt]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(s){u(t.$$.fragment,s)},m(s,i){y(t,s,i),c=!0},p(s,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:s}),t.$set(g)},i(s){c||(h(t.$$.fragment,s),c=!0)},o(s){$(t.$$.fragment,s),c=!1},d(s){d(t,s)}}}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(s){t=j(s,"P",{"data-svelte-h":!0}),T(t)!=="svelte-5a866m"&&(t.innerHTML=c)},m(s,i){a(s,t,i)},p:me,d(s){s&&l(t)}}}function ct(_){let t,c,s,i,g,Z="이제 <code>TFAutoModelForSeq2SeqLM</code>로 T5를 가져오세요:",x,X,C,G,k="<code>prepare_tf_dataset()</code>로 데이터 세트를 <code>tf.data.Dataset</code> 형식으로 변환하세요:",I,W,U,V,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,ce="<code>KerasMetricCallback</code>에 <code>compute_metrics</code> 함수를 전달하세요.",z,E,Y,se,ie="모델과 토크나이저를 업로드할 위치를 <code>PushToHubCallback</code>에서 지정하세요:",S,Q,q,A,te="이제 콜백들을 한데로 묶어주세요:",fe,L,P,D,le='드디어 모델을 훈련시킬 모든 준비를 마쳤군요! 이제 훈련 및 검증 데이터 세트에 <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a> 메서드를 에폭 수와 만들어둔 콜백과 함께 호출하여 모델을 파인튜닝하세요:',Me,K,O,ee,ae="학습이 완료되면 모델이 자동으로 Hub에 업로드되고, 누구나 사용할 수 있게 됩니다!",ue;return t=new ws({props:{$$slots:{default:[mt]},$$scope:{ctx:_}}}),s=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}}),W=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}}),E=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=Ds(`
TensorFlow에서 모델을 파인튜닝하려면 우선 optimizer 함수, 학습률 스케줄 등의 훈련 하이퍼파라미터를 설정하세요:

	`),M(s.$$.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(W.$$.fragment),U=o(),V=b("p"),V.innerHTML=r,J=o(),M(F.$$.fragment),H=o(),B=b("p"),B.innerHTML=f,v=o(),N=b("p"),N.innerHTML=ce,z=o(),M(E.$$.fragment),Y=o(),se=b("p"),se.innerHTML=ie,S=o(),M(Q.$$.fragment),q=o(),A=b("p"),A.textContent=te,fe=o(),M(L.$$.fragment),P=o(),D=b("p"),D.innerHTML=le,Me=o(),M(K.$$.fragment),O=o(),ee=b("p"),ee.textContent=ae},l(p){u(t.$$.fragment,p),c=Ks(p,`
TensorFlow에서 모델을 파인튜닝하려면 우선 optimizer 함수, 학습률 스케줄 등의 훈련 하이퍼파라미터를 설정하세요:

	`),u(s.$$.fragment,p),i=m(p),g=j(p,"P",{"data-svelte-h":!0}),T(g)!=="svelte-187gdfo"&&(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(W.$$.fragment,p),U=m(p),V=j(p,"P",{"data-svelte-h":!0}),T(V)!=="svelte-lcjrv5"&&(V.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=ce),z=m(p),u(E.$$.fragment,p),Y=m(p),se=j(p,"P",{"data-svelte-h":!0}),T(se)!=="svelte-1b0ip2a"&&(se.innerHTML=ie),S=m(p),u(Q.$$.fragment,p),q=m(p),A=j(p,"P",{"data-svelte-h":!0}),T(A)!=="svelte-1hl7vtj"&&(A.textContent=te),fe=m(p),u(L.$$.fragment,p),P=m(p),D=j(p,"P",{"data-svelte-h":!0}),T(D)!=="svelte-13m2vb0"&&(D.innerHTML=le),Me=m(p),u(K.$$.fragment,p),O=m(p),ee=j(p,"P",{"data-svelte-h":!0}),T(ee)!=="svelte-w4puhc"&&(ee.textContent=ae)},m(p,w){y(t,p,w),a(p,c,w),y(s,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(W,p,w),a(p,U,w),a(p,V,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,z,w),y(E,p,w),a(p,Y,w),a(p,se,w),a(p,S,w),y(Q,p,w),a(p,q,w),a(p,A,w),a(p,fe,w),y(L,p,w),a(p,P,w),a(p,D,w),a(p,Me,w),y(K,p,w),a(p,O,w),a(p,ee,w),ue=!0},p(p,w){const ye={};w&2&&(ye.$$scope={dirty:w,ctx:p}),t.$set(ye)},i(p){ue||(h(t.$$.fragment,p),h(s.$$.fragment,p),h(X.$$.fragment,p),h(W.$$.fragment,p),h(F.$$.fragment,p),h(E.$$.fragment,p),h(Q.$$.fragment,p),h(L.$$.fragment,p),h(K.$$.fragment,p),ue=!0)},o(p){$(t.$$.fragment,p),$(s.$$.fragment,p),$(X.$$.fragment,p),$(W.$$.fragment,p),$(F.$$.fragment,p),$(E.$$.fragment,p),$(Q.$$.fragment,p),$(L.$$.fragment,p),$(K.$$.fragment,p),ue=!1},d(p){p&&(l(c),l(i),l(g),l(x),l(C),l(G),l(I),l(U),l(V),l(J),l(H),l(B),l(v),l(N),l(z),l(Y),l(se),l(S),l(q),l(A),l(fe),l(P),l(D),l(Me),l(O),l(ee)),d(t,p),d(s,p),d(X,p),d(W,p),d(F,p),d(E,p),d(Q,p),d(L,p),d(K,p)}}}function it(_){let t,c;return t=new Ee({props:{$$slots:{default:[ct]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(s){u(t.$$.fragment,s)},m(s,i){y(t,s,i),c=!0},p(s,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:s}),t.$set(g)},i(s){c||(h(t.$$.fragment,s),c=!0)},o(s){$(t.$$.fragment,s),c=!1},d(s){d(t,s)}}}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(s){t=j(s,"P",{"data-svelte-h":!0}),T(t)!=="svelte-ar4lcc"&&(t.innerHTML=c)},m(s,i){a(s,t,i)},p:me,d(s){s&&l(t)}}}function Mt(_){let t,c="텍스트를 토큰화하고 <code>input_ids</code>를 PyTorch 텐서로 반환하세요:",s,i,g,Z,x='<code>generate()</code> 메서드로 번역을 생성하세요. 다양한 텍스트 생성 전략 및 생성을 제어하기 위한 매개변수에 대한 자세한 내용은 <a href="../main_classes/text_generation">Text Generation</a> API를 살펴보시기 바랍니다.',X,C,G,k,I="생성된 토큰 ID들을 다시 텍스트로 디코딩하세요:",W,U,V;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,s=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,W=o(),M(U.$$.fragment)},l(r){t=j(r,"P",{"data-svelte-h":!0}),T(t)!=="svelte-1b4fw1g"&&(t.innerHTML=c),s=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),W=m(r),u(U.$$.fragment,r)},m(r,J){a(r,t,J),a(r,s,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,W,J),y(U,r,J),V=!0},p:me,i(r){V||(h(i.$$.fragment,r),h(C.$$.fragment,r),h(U.$$.fragment,r),V=!0)},o(r){$(i.$$.fragment,r),$(C.$$.fragment,r),$(U.$$.fragment,r),V=!1},d(r){r&&(l(t),l(s),l(g),l(Z),l(X),l(G),l(k),l(W)),d(i,r),d(C,r),d(U,r)}}}function ut(_){let t,c;return t=new Ee({props:{$$slots:{default:[Mt]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(s){u(t.$$.fragment,s)},m(s,i){y(t,s,i),c=!0},p(s,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:s}),t.$set(g)},i(s){c||(h(t.$$.fragment,s),c=!0)},o(s){$(t.$$.fragment,s),c=!1},d(s){d(t,s)}}}function yt(_){let t,c="텍스트를 토큰화하고 <code>input_ids</code>를 TensorFlow 텐서로 반환하세요:",s,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들을 다시 텍스트로 디코딩하세요:",W,U,V;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,s=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,W=o(),M(U.$$.fragment)},l(r){t=j(r,"P",{"data-svelte-h":!0}),T(t)!=="svelte-jhzp8k"&&(t.innerHTML=c),s=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),W=m(r),u(U.$$.fragment,r)},m(r,J){a(r,t,J),a(r,s,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,W,J),y(U,r,J),V=!0},p:me,i(r){V||(h(i.$$.fragment,r),h(C.$$.fragment,r),h(U.$$.fragment,r),V=!0)},o(r){$(i.$$.fragment,r),$(C.$$.fragment,r),$(U.$$.fragment,r),V=!1},d(r){r&&(l(t),l(s),l(g),l(Z),l(X),l(G),l(k),l(W)),d(i,r),d(C,r),d(U,r)}}}function ht(_){let t,c;return t=new Ee({props:{$$slots:{default:[yt]},$$scope:{ctx:_}}}),{c(){M(t.$$.fragment)},l(s){u(t.$$.fragment,s)},m(s,i){y(t,s,i),c=!0},p(s,i){const g={};i&2&&(g.$$scope={dirty:i,ctx:s}),t.$set(g)},i(s){c||(h(t.$$.fragment,s),c=!0)},o(s){$(t.$$.fragment,s),c=!1},d(s){d(t,s)}}}function $t(_){let t,c,s,i,g,Z,x,X,C,G,k,I="번역은 한 언어로 된 시퀀스를 다른 언어로 변환합니다. 번역이나 요약은 입력을 받아 일련의 출력을 반환하는 강력한 프레임워크인 시퀀스-투-시퀀스 문제로 구성할 수 있는 대표적인 태스크입니다. 번역 시스템은 일반적으로 다른 언어로 된 텍스트 간의 번역에 사용되지만, 음성 간의 통역이나 텍스트-음성 또는 음성-텍스트와 같은 조합에도 사용될 수 있습니다.",W,U,V="이 가이드에서 학습할 내용은:",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="시작하기 전에 필요한 라이브러리가 모두 설치되어 있는지 확인하세요:",ce,z,E,Y,se="모델을 업로드하고 커뮤니티와 공유할 수 있도록 Hugging Face 계정에 로그인하는 것이 좋습니다. 새로운 창이 표시되면 토큰을 입력하여 로그인하세요.",ie,S,Q,q,A,te,fe='먼저 🤗 Datasets 라이브러리에서 <a href="https://huggingface.co/datasets/opus_books" rel="nofollow">OPUS Books</a> 데이터세트의 영어-프랑스어 하위 집합을 가져오세요.',L,P,D,le,Me="데이터세트를 <code>train_test_split</code> 메서드를 사용하여 훈련 및 테스트 데이터로 분할하세요.",K,O,ee,ae,ue="훈련 데이터에서 예시를 살펴볼까요?",p,w,ye,he,Js="반환된 딕셔너리의 <code>translation</code> 키가 텍스트의 영어, 프랑스어 버전을 포함하고 있는 것을 볼 수 있습니다.",Se,$e,Qe,de,qe,ge,Us="다음 단계로 영어-프랑스어 쌍을 처리하기 위해 T5 토크나이저를 가져오세요.",Ae,be,Le,je,ks="만들 전처리 함수는 아래 요구사항을 충족해야 합니다:",Pe,we,_s="<li>T5가 번역 태스크임을 인지할 수 있도록 입력 앞에 프롬프트를 추가하세요. 여러 NLP 태스크를 할 수 있는 모델 중 일부는 이렇게 태스크 프롬프트를 미리 줘야합니다.</li> <li>원어(영어)과 번역어(프랑스어)를 별도로 토큰화하세요. 영어 어휘로 사전 학습된 토크나이저로 프랑스어 텍스트를 토큰화할 수는 없기 때문입니다.</li> <li><code>max_length</code> 매개변수로 설정한 최대 길이보다 길지 않도록 시퀀스를 truncate하세요.</li>",De,Te,Ke,Je,Zs="전체 데이터세트에 전처리 함수를 적용하려면 🤗 Datasets의 <code>map</code> 메서드를 사용하세요. <code>map</code> 함수의 속도를 높이려면 <code>batched=True</code>를 설정하여 데이터세트의 여러 요소를 한 번에 처리하는 방법이 있습니다.",Oe,Ue,es,ke,Cs="이제 <code>DataCollatorForSeq2Seq</code>를 사용하여 예제 배치를 생성합니다. 데이터세트의 최대 길이로 전부를 padding하는 대신, 데이터 정렬 중 각 배치의 최대 길이로 문장을 <em>동적으로 padding</em>하는 것이 더 효율적입니다.",ss,ne,ts,_e,ls,Ze,vs='훈련 중에 메트릭을 포함하면 모델의 성능을 평가하는 데 도움이 됩니다. 🤗 <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>를 참조하세요):',as,Ce,ns,ve,Rs="그런 다음 <code>compute</code>에 예측값과 레이블을 전달하여 SacreBLEU 점수를 계산하는 함수를 생성하세요:",ps,Re,rs,Xe,Xs="이제 <code>compute_metrics</code> 함수는 준비되었고, 훈련 과정을 설정할 때 다시 살펴볼 예정입니다.",os,Ge,ms,pe,cs,re,is,We,fs,Ve,Gs="좋아요, 이제 모델을 파인튜닝했으니 추론에 사용할 수 있습니다!",Ms,xe,Ws="다른 언어로 번역하고 싶은 텍스트를 써보세요. T5의 경우 원하는 태스크를 입력의 접두사로 추가해야 합니다. 예를 들어 영어에서 프랑스어로 번역하는 경우, 아래와 같은 접두사가 추가됩니다:",us,Be,ys,He,Vs="파인튜닝된 모델로 추론하기에 제일 간단한 방법은 <code>pipeline()</code>을 사용하는 것입니다. 해당 모델로 번역 <code>pipeline</code>을 만든 뒤, 텍스트를 전달하세요:",hs,Ie,$s,Fe,xs="원한다면 <code>pipeline</code>의 결과를 직접 복제할 수도 있습니다:",ds,oe,gs,Ne,bs,Ye,js;return g=new ze({props:{title:"번역",local:"translation",headingTag:"h1"}}),x=new Os({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 Ys({props:{id:"1JvfrvZgi6c"}}),B=new ws({props:{$$slots:{default:[st]},$$scope:{ctx:_}}}),z=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 ze({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}}),$e=new ze({props:{title:"전처리",local:"preprocess",headingTag:"h2"}}),de=new Ys({props:{id:"XAR8jnZZuUs"}}),be=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}}),Te=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}}),Ue=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}}),ne=new Ts({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[nt],pytorch:[lt]},$$scope:{ctx:_}}}),_e=new ze({props:{title:"평가",local:"evalulate",headingTag:"h2"}}),Ce=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}}),Re=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}}),Ge=new ze({props:{title:"훈련",local:"train",headingTag:"h2"}}),pe=new Ts({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[it],pytorch:[ot]},$$scope:{ctx:_}}}),re=new ws({props:{$$slots:{default:[ft]},$$scope:{ctx:_}}}),We=new ze({props:{title:"추론",local:"inference",headingTag:"h2"}}),Be=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}}),Ie=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}}),oe=new Ts({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ht],pytorch:[ut]},$$scope:{ctx:_}}}),Ne=new et({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/tasks/translation.md"}}),{c(){t=b("meta"),c=o(),s=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,W=o(),U=b("p"),U.textContent=V,r=o(),J=b("ol"),J.innerHTML=F,H=o(),M(B.$$.fragment),f=o(),v=b("p"),v.textContent=N,ce=o(),M(z.$$.fragment),E=o(),Y=b("p"),Y.textContent=se,ie=o(),M(S.$$.fragment),Q=o(),M(q.$$.fragment),A=o(),te=b("p"),te.innerHTML=fe,L=o(),M(P.$$.fragment),D=o(),le=b("p"),le.innerHTML=Me,K=o(),M(O.$$.fragment),ee=o(),ae=b("p"),ae.textContent=ue,p=o(),M(w.$$.fragment),ye=o(),he=b("p"),he.innerHTML=Js,Se=o(),M($e.$$.fragment),Qe=o(),M(de.$$.fragment),qe=o(),ge=b("p"),ge.textContent=Us,Ae=o(),M(be.$$.fragment),Le=o(),je=b("p"),je.textContent=ks,Pe=o(),we=b("ol"),we.innerHTML=_s,De=o(),M(Te.$$.fragment),Ke=o(),Je=b("p"),Je.innerHTML=Zs,Oe=o(),M(Ue.$$.fragment),es=o(),ke=b("p"),ke.innerHTML=Cs,ss=o(),M(ne.$$.fragment),ts=o(),M(_e.$$.fragment),ls=o(),Ze=b("p"),Ze.innerHTML=vs,as=o(),M(Ce.$$.fragment),ns=o(),ve=b("p"),ve.innerHTML=Rs,ps=o(),M(Re.$$.fragment),rs=o(),Xe=b("p"),Xe.innerHTML=Xs,os=o(),M(Ge.$$.fragment),ms=o(),M(pe.$$.fragment),cs=o(),M(re.$$.fragment),is=o(),M(We.$$.fragment),fs=o(),Ve=b("p"),Ve.textContent=Gs,Ms=o(),xe=b("p"),xe.textContent=Ws,us=o(),M(Be.$$.fragment),ys=o(),He=b("p"),He.innerHTML=Vs,hs=o(),M(Ie.$$.fragment),$s=o(),Fe=b("p"),Fe.innerHTML=xs,ds=o(),M(oe.$$.fragment),gs=o(),M(Ne.$$.fragment),bs=o(),Ye=b("p"),this.h()},l(e){const n=Ls("svelte-u9bgzb",document.head);t=j(n,"META",{name:!0,content:!0}),n.forEach(l),c=m(e),s=j(e,"P",{}),zs(s).forEach(l),i=m(e),u(g.$$.fragment,e),Z=m(e),u(x.$$.fragment,e),X=m(e),u(C.$$.fragment,e),G=m(e),k=j(e,"P",{"data-svelte-h":!0}),T(k)!=="svelte-1k3fp3p"&&(k.textContent=I),W=m(e),U=j(e,"P",{"data-svelte-h":!0}),T(U)!=="svelte-14hiaa1"&&(U.textContent=V),r=m(e),J=j(e,"OL",{"data-svelte-h":!0}),T(J)!=="svelte-4n42lt"&&(J.innerHTML=F),H=m(e),u(B.$$.fragment,e),f=m(e),v=j(e,"P",{"data-svelte-h":!0}),T(v)!=="svelte-1k0z9pm"&&(v.textContent=N),ce=m(e),u(z.$$.fragment,e),E=m(e),Y=j(e,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-1jstx1u"&&(Y.textContent=se),ie=m(e),u(S.$$.fragment,e),Q=m(e),u(q.$$.fragment,e),A=m(e),te=j(e,"P",{"data-svelte-h":!0}),T(te)!=="svelte-adgncb"&&(te.innerHTML=fe),L=m(e),u(P.$$.fragment,e),D=m(e),le=j(e,"P",{"data-svelte-h":!0}),T(le)!=="svelte-19d5a0p"&&(le.innerHTML=Me),K=m(e),u(O.$$.fragment,e),ee=m(e),ae=j(e,"P",{"data-svelte-h":!0}),T(ae)!=="svelte-o7e31d"&&(ae.textContent=ue),p=m(e),u(w.$$.fragment,e),ye=m(e),he=j(e,"P",{"data-svelte-h":!0}),T(he)!=="svelte-18ww8rs"&&(he.innerHTML=Js),Se=m(e),u($e.$$.fragment,e),Qe=m(e),u(de.$$.fragment,e),qe=m(e),ge=j(e,"P",{"data-svelte-h":!0}),T(ge)!=="svelte-1mrpk7j"&&(ge.textContent=Us),Ae=m(e),u(be.$$.fragment,e),Le=m(e),je=j(e,"P",{"data-svelte-h":!0}),T(je)!=="svelte-cw39ls"&&(je.textContent=ks),Pe=m(e),we=j(e,"OL",{"data-svelte-h":!0}),T(we)!=="svelte-1a06q10"&&(we.innerHTML=_s),De=m(e),u(Te.$$.fragment,e),Ke=m(e),Je=j(e,"P",{"data-svelte-h":!0}),T(Je)!=="svelte-1lmdyeh"&&(Je.innerHTML=Zs),Oe=m(e),u(Ue.$$.fragment,e),es=m(e),ke=j(e,"P",{"data-svelte-h":!0}),T(ke)!=="svelte-1lgij5g"&&(ke.innerHTML=Cs),ss=m(e),u(ne.$$.fragment,e),ts=m(e),u(_e.$$.fragment,e),ls=m(e),Ze=j(e,"P",{"data-svelte-h":!0}),T(Ze)!=="svelte-1fiqbd1"&&(Ze.innerHTML=vs),as=m(e),u(Ce.$$.fragment,e),ns=m(e),ve=j(e,"P",{"data-svelte-h":!0}),T(ve)!=="svelte-1925cbb"&&(ve.innerHTML=Rs),ps=m(e),u(Re.$$.fragment,e),rs=m(e),Xe=j(e,"P",{"data-svelte-h":!0}),T(Xe)!=="svelte-11m7xom"&&(Xe.innerHTML=Xs),os=m(e),u(Ge.$$.fragment,e),ms=m(e),u(pe.$$.fragment,e),cs=m(e),u(re.$$.fragment,e),is=m(e),u(We.$$.fragment,e),fs=m(e),Ve=j(e,"P",{"data-svelte-h":!0}),T(Ve)!=="svelte-1nv1rsn"&&(Ve.textContent=Gs),Ms=m(e),xe=j(e,"P",{"data-svelte-h":!0}),T(xe)!=="svelte-1kbteb5"&&(xe.textContent=Ws),us=m(e),u(Be.$$.fragment,e),ys=m(e),He=j(e,"P",{"data-svelte-h":!0}),T(He)!=="svelte-19gmubo"&&(He.innerHTML=Vs),hs=m(e),u(Ie.$$.fragment,e),$s=m(e),Fe=j(e,"P",{"data-svelte-h":!0}),T(Fe)!=="svelte-ckakkh"&&(Fe.innerHTML=xs),ds=m(e),u(oe.$$.fragment,e),gs=m(e),u(Ne.$$.fragment,e),bs=m(e),Ye=j(e,"P",{}),zs(Ye).forEach(l),this.h()},h(){Es(t,"name","hf:doc:metadata"),Es(t,"content",dt)},m(e,n){Ps(document.head,t),a(e,c,n),a(e,s,n),a(e,i,n),y(g,e,n),a(e,Z,n),y(x,e,n),a(e,X,n),y(C,e,n),a(e,G,n),a(e,k,n),a(e,W,n),a(e,U,n),a(e,r,n),a(e,J,n),a(e,H,n),y(B,e,n),a(e,f,n),a(e,v,n),a(e,ce,n),y(z,e,n),a(e,E,n),a(e,Y,n),a(e,ie,n),y(S,e,n),a(e,Q,n),y(q,e,n),a(e,A,n),a(e,te,n),a(e,L,n),y(P,e,n),a(e,D,n),a(e,le,n),a(e,K,n),y(O,e,n),a(e,ee,n),a(e,ae,n),a(e,p,n),y(w,e,n),a(e,ye,n),a(e,he,n),a(e,Se,n),y($e,e,n),a(e,Qe,n),y(de,e,n),a(e,qe,n),a(e,ge,n),a(e,Ae,n),y(be,e,n),a(e,Le,n),a(e,je,n),a(e,Pe,n),a(e,we,n),a(e,De,n),y(Te,e,n),a(e,Ke,n),a(e,Je,n),a(e,Oe,n),y(Ue,e,n),a(e,es,n),a(e,ke,n),a(e,ss,n),y(ne,e,n),a(e,ts,n),y(_e,e,n),a(e,ls,n),a(e,Ze,n),a(e,as,n),y(Ce,e,n),a(e,ns,n),a(e,ve,n),a(e,ps,n),y(Re,e,n),a(e,rs,n),a(e,Xe,n),a(e,os,n),y(Ge,e,n),a(e,ms,n),y(pe,e,n),a(e,cs,n),y(re,e,n),a(e,is,n),y(We,e,n),a(e,fs,n),a(e,Ve,n),a(e,Ms,n),a(e,xe,n),a(e,us,n),y(Be,e,n),a(e,ys,n),a(e,He,n),a(e,hs,n),y(Ie,e,n),a(e,$s,n),a(e,Fe,n),a(e,ds,n),y(oe,e,n),a(e,gs,n),y(Ne,e,n),a(e,bs,n),a(e,Ye,n),js=!0},p(e,[n]){const Bs={};n&2&&(Bs.$$scope={dirty:n,ctx:e}),B.$set(Bs);const Hs={};n&2&&(Hs.$$scope={dirty:n,ctx:e}),ne.$set(Hs);const Is={};n&2&&(Is.$$scope={dirty:n,ctx:e}),pe.$set(Is);const Fs={};n&2&&(Fs.$$scope={dirty:n,ctx:e}),re.$set(Fs);const Ns={};n&2&&(Ns.$$scope={dirty:n,ctx:e}),oe.$set(Ns)},i(e){js||(h(g.$$.fragment,e),h(x.$$.fragment,e),h(C.$$.fragment,e),h(B.$$.fragment,e),h(z.$$.fragment,e),h(S.$$.fragment,e),h(q.$$.fragment,e),h(P.$$.fragment,e),h(O.$$.fragment,e),h(w.$$.fragment,e),h($e.$$.fragment,e),h(de.$$.fragment,e),h(be.$$.fragment,e),h(Te.$$.fragment,e),h(Ue.$$.fragment,e),h(ne.$$.fragment,e),h(_e.$$.fragment,e),h(Ce.$$.fragment,e),h(Re.$$.fragment,e),h(Ge.$$.fragment,e),h(pe.$$.fragment,e),h(re.$$.fragment,e),h(We.$$.fragment,e),h(Be.$$.fragment,e),h(Ie.$$.fragment,e),h(oe.$$.fragment,e),h(Ne.$$.fragment,e),js=!0)},o(e){$(g.$$.fragment,e),$(x.$$.fragment,e),$(C.$$.fragment,e),$(B.$$.fragment,e),$(z.$$.fragment,e),$(S.$$.fragment,e),$(q.$$.fragment,e),$(P.$$.fragment,e),$(O.$$.fragment,e),$(w.$$.fragment,e),$($e.$$.fragment,e),$(de.$$.fragment,e),$(be.$$.fragment,e),$(Te.$$.fragment,e),$(Ue.$$.fragment,e),$(ne.$$.fragment,e),$(_e.$$.fragment,e),$(Ce.$$.fragment,e),$(Re.$$.fragment,e),$(Ge.$$.fragment,e),$(pe.$$.fragment,e),$(re.$$.fragment,e),$(We.$$.fragment,e),$(Be.$$.fragment,e),$(Ie.$$.fragment,e),$(oe.$$.fragment,e),$(Ne.$$.fragment,e),js=!1},d(e){e&&(l(c),l(s),l(i),l(Z),l(X),l(G),l(k),l(W),l(U),l(r),l(J),l(H),l(f),l(v),l(ce),l(E),l(Y),l(ie),l(Q),l(A),l(te),l(L),l(D),l(le),l(K),l(ee),l(ae),l(p),l(ye),l(he),l(Se),l(Qe),l(qe),l(ge),l(Ae),l(Le),l(je),l(Pe),l(we),l(De),l(Ke),l(Je),l(Oe),l(es),l(ke),l(ss),l(ts),l(ls),l(Ze),l(as),l(ns),l(ve),l(ps),l(rs),l(Xe),l(os),l(ms),l(cs),l(is),l(fs),l(Ve),l(Ms),l(xe),l(us),l(ys),l(He),l(hs),l($s),l(Fe),l(ds),l(gs),l(bs),l(Ye)),l(t),d(g,e),d(x,e),d(C,e),d(B,e),d(z,e),d(S,e),d(q,e),d(P,e),d(O,e),d(w,e),d($e,e),d(de,e),d(be,e),d(Te,e),d(Ue,e),d(ne,e),d(_e,e),d(Ce,e),d(Re,e),d(Ge,e),d(pe,e),d(re,e),d(We,e),d(Be,e),d(Ie,e),d(oe,e),d(Ne,e)}}}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 Qs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zt extends qs{constructor(t){super(),As(this,t,gt,$t,Ss,{})}}export{Zt as component};
