import{s as Vl,o as Xl,n as ms}from"../chunks/scheduler.56730f09.js";import{S as Wl,i as Bl,g as J,s as c,r as y,A as Al,h as U,f as e,c as m,j as kl,u as h,x as T,k as Il,y as vl,a as t,v as d,d as u,t as f,w,m as Gl,n as Rl}from"../chunks/index.1f144517.js";import{T as ol}from"../chunks/Tip.41e845e5.js";import{C as R}from"../chunks/CodeBlock.738eeccb.js";import{D as xl}from"../chunks/DocNotebookDropdown.243c3df7.js";import{F as il,M as As}from"../chunks/Markdown.c541024b.js";import{H as Bs}from"../chunks/Heading.57d46534.js";function El(C){let a,r,l='<a href="../model_doc/albert">ALBERT</a>, <a href="../model_doc/bert">BERT</a>, <a href="../model_doc/big_bird">BigBird</a>, <a href="../model_doc/camembert">CamemBERT</a>, <a href="../model_doc/canine">CANINE</a>, <a href="../model_doc/convbert">ConvBERT</a>, <a href="../model_doc/data2vec-text">Data2VecText</a>, <a href="../model_doc/deberta-v2">DeBERTa-v2</a>, <a href="../model_doc/distilbert">DistilBERT</a>, <a href="../model_doc/electra">ELECTRA</a>, <a href="../model_doc/ernie">ERNIE</a>, <a href="../model_doc/ernie_m">ErnieM</a>, <a href="../model_doc/flaubert">FlauBERT</a>, <a href="../model_doc/fnet">FNet</a>, <a href="../model_doc/funnel">Funnel Transformer</a>, <a href="../model_doc/ibert">I-BERT</a>, <a href="../model_doc/longformer">Longformer</a>, <a href="../model_doc/luke">LUKE</a>, <a href="../model_doc/mega">MEGA</a>, <a href="../model_doc/megatron-bert">Megatron-BERT</a>, <a href="../model_doc/mobilebert">MobileBERT</a>, <a href="../model_doc/mpnet">MPNet</a>, <a href="../model_doc/nezha">Nezha</a>, <a href="../model_doc/nystromformer">Nyströmformer</a>, <a href="../model_doc/qdqbert">QDQBert</a>, <a href="../model_doc/rembert">RemBERT</a>, <a href="../model_doc/roberta">RoBERTa</a>, <a href="../model_doc/roberta-prelayernorm">RoBERTa-PreLayerNorm</a>, <a href="../model_doc/roc_bert">RoCBert</a>, <a href="../model_doc/roformer">RoFormer</a>, <a href="../model_doc/squeezebert">SqueezeBERT</a>, <a href="../model_doc/xlm">XLM</a>, <a href="../model_doc/xlm-roberta">XLM-RoBERTa</a>, <a href="../model_doc/xlm-roberta-xl">XLM-RoBERTa-XL</a>, <a href="../model_doc/xlnet">XLNet</a>, <a href="../model_doc/xmod">X-MOD</a>, <a href="../model_doc/yoso">YOSO</a>';return{c(){a=Gl(`이 튜토리얼에서 설명하는 작업은 다음 모델 아키텍처에서 지원됩니다:

`),r=J("p"),r.innerHTML=l},l(o){a=Rl(o,`이 튜토리얼에서 설명하는 작업은 다음 모델 아키텍처에서 지원됩니다:

`),r=U(o,"P",{"data-svelte-h":!0}),T(r)!=="svelte-1ggg0en"&&(r.innerHTML=l)},m(o,j){t(o,a,j),t(o,r,j)},p:ms,d(o){o&&(e(a),e(r))}}}function Yl(C){let a,r;return a=new R({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMHRyYW5zZm9ybWVycy50b2tlbml6YXRpb25fdXRpbHNfYmFzZSUyMGltcG9ydCUyMFByZVRyYWluZWRUb2tlbml6ZXJCYXNlJTJDJTIwUGFkZGluZ1N0cmF0ZWd5JTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSUwQSU0MGRhdGFjbGFzcyUwQWNsYXNzJTIwRGF0YUNvbGxhdG9yRm9yTXVsdGlwbGVDaG9pY2UlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBEYXRhJTIwY29sbGF0b3IlMjB0aGF0JTIwd2lsbCUyMGR5bmFtaWNhbGx5JTIwcGFkJTIwdGhlJTIwaW5wdXRzJTIwZm9yJTIwbXVsdGlwbGUlMjBjaG9pY2UlMjByZWNlaXZlZC4lMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlME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tX2Nob2ljZXMlMkMlMjAtMSklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwYmF0Y2guaXRlbXMoKSU3RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJhdGNoJTVCJTIybGFiZWxzJTIyJTVEJTIwJTNEJTIwdG9yY2gudGVuc29yKGxhYmVscyUyQyUyMGR0eXBlJTNEdG9yY2guaW50NjQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> dataclass
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.tokenization_utils_base <span class="hljs-keyword">import</span> PreTrainedTokenizerBase, PaddingStrategy
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">Optional</span>, <span class="hljs-type">Union</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch


<span class="hljs-meta">&gt;&gt;&gt; </span>@dataclass
<span class="hljs-meta">... </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">DataCollatorForMultipleChoice</span>:
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&quot;&quot;
<span class="hljs-meta">... </span>    Data collator that will dynamically pad the inputs for multiple choice received.
<span class="hljs-meta">... </span>    &quot;&quot;&quot;</span>

<span class="hljs-meta">... </span>    tokenizer: PreTrainedTokenizerBase
<span class="hljs-meta">... </span>    padding: <span class="hljs-type">Union</span>[<span class="hljs-built_in">bool</span>, <span class="hljs-built_in">str</span>, PaddingStrategy] = <span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>    max_length: <span class="hljs-type">Optional</span>[<span class="hljs-built_in">int</span>] = <span class="hljs-literal">None</span>
<span class="hljs-meta">... </span>    pad_to_multiple_of: <span class="hljs-type">Optional</span>[<span class="hljs-built_in">int</span>] = <span class="hljs-literal">None</span>

<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">self, features</span>):
<span class="hljs-meta">... </span>        label_name = <span class="hljs-string">&quot;label&quot;</span> <span class="hljs-keyword">if</span> <span class="hljs-string">&quot;label&quot;</span> <span class="hljs-keyword">in</span> features[<span class="hljs-number">0</span>].keys() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;labels&quot;</span>
<span class="hljs-meta">... </span>        labels = [feature.pop(label_name) <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features]
<span class="hljs-meta">... </span>        batch_size = <span class="hljs-built_in">len</span>(features)
<span class="hljs-meta">... </span>        num_choices = <span class="hljs-built_in">len</span>(features[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">... </span>        flattened_features = [
<span class="hljs-meta">... </span>            [{k: v[i] <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> feature.items()} <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_choices)] <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features
<span class="hljs-meta">... </span>        ]
<span class="hljs-meta">... </span>        flattened_features = <span class="hljs-built_in">sum</span>(flattened_features, [])

<span class="hljs-meta">... </span>        batch = self.tokenizer.pad(
<span class="hljs-meta">... </span>            flattened_features,
<span class="hljs-meta">... </span>            padding=self.padding,
<span class="hljs-meta">... </span>            max_length=self.max_length,
<span class="hljs-meta">... </span>            pad_to_multiple_of=self.pad_to_multiple_of,
<span class="hljs-meta">... </span>            return_tensors=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>        )

<span class="hljs-meta">... </span>        batch = {k: v.view(batch_size, num_choices, -<span class="hljs-number">1</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> batch.items()}
<span class="hljs-meta">... </span>        batch[<span class="hljs-string">&quot;labels&quot;</span>] = torch.tensor(labels, dtype=torch.int64)
<span class="hljs-meta">... </span>        <span class="hljs-keyword">return</span> batch`,wrap:!1}}),{c(){y(a.$$.fragment)},l(l){h(a.$$.fragment,l)},m(l,o){d(a,l,o),r=!0},p:ms,i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){f(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function Fl(C){let a,r;return a=new As({props:{$$slots:{default:[Yl]},$$scope:{ctx:C}}}),{c(){y(a.$$.fragment)},l(l){h(a.$$.fragment,l)},m(l,o){d(a,l,o),r=!0},p(l,o){const j={};o&2&&(j.$$scope={dirty:o,ctx:l}),a.$set(j)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){f(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function Nl(C){let a,r;return a=new R({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMHRyYW5zZm9ybWVycy50b2tlbml6YXRpb25fdXRpbHNfYmFzZSUyMGltcG9ydCUyMFByZVRyYWluZWRUb2tlbml6ZXJCYXNlJTJDJTIwUGFkZGluZ1N0cmF0ZWd5JTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQSUwQSU0MGRhdGFjbGFzcyUwQWNsYXNzJTIwRGF0YUNvbGxhdG9yRm9yTXVsdGlwbGVDaG9pY2UlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBEYXRhJTIwY29sbGF0b3IlMjB0aGF0JTIwd2lsbCUyMGR5bmFtaWNhbGx5JTIwcGFkJTIwdGhlJTIwaW5wdXRzJTIwZm9yJTIwbXVsdGlwbGUlMjBjaG9pY2UlMjByZWNlaXZlZC4lMEElMjAlMjAlMjAlMjAlMjIlMjIlMjI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jaF9zaXplJTJDJTIwbnVtX2Nob2ljZXMlMkMlMjAtMSkpJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGJhdGNoLml0ZW1zKCklN0QlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBiYXRjaCU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMHRmLmNvbnZlcnRfdG9fdGVuc29yKGxhYmVscyUyQyUyMGR0eXBlJTNEdGYuaW50NjQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> dataclass
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.tokenization_utils_base <span class="hljs-keyword">import</span> PreTrainedTokenizerBase, PaddingStrategy
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">Optional</span>, <span class="hljs-type">Union</span>
<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>@dataclass
<span class="hljs-meta">... </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">DataCollatorForMultipleChoice</span>:
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&quot;&quot;
<span class="hljs-meta">... </span>    Data collator that will dynamically pad the inputs for multiple choice received.
<span class="hljs-meta">... </span>    &quot;&quot;&quot;</span>

<span class="hljs-meta">... </span>    tokenizer: PreTrainedTokenizerBase
<span class="hljs-meta">... </span>    padding: <span class="hljs-type">Union</span>[<span class="hljs-built_in">bool</span>, <span class="hljs-built_in">str</span>, PaddingStrategy] = <span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>    max_length: <span class="hljs-type">Optional</span>[<span class="hljs-built_in">int</span>] = <span class="hljs-literal">None</span>
<span class="hljs-meta">... </span>    pad_to_multiple_of: <span class="hljs-type">Optional</span>[<span class="hljs-built_in">int</span>] = <span class="hljs-literal">None</span>

<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">self, features</span>):
<span class="hljs-meta">... </span>        label_name = <span class="hljs-string">&quot;label&quot;</span> <span class="hljs-keyword">if</span> <span class="hljs-string">&quot;label&quot;</span> <span class="hljs-keyword">in</span> features[<span class="hljs-number">0</span>].keys() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;labels&quot;</span>
<span class="hljs-meta">... </span>        labels = [feature.pop(label_name) <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features]
<span class="hljs-meta">... </span>        batch_size = <span class="hljs-built_in">len</span>(features)
<span class="hljs-meta">... </span>        num_choices = <span class="hljs-built_in">len</span>(features[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">... </span>        flattened_features = [
<span class="hljs-meta">... </span>            [{k: v[i] <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> feature.items()} <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_choices)] <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features
<span class="hljs-meta">... </span>        ]
<span class="hljs-meta">... </span>        flattened_features = <span class="hljs-built_in">sum</span>(flattened_features, [])

<span class="hljs-meta">... </span>        batch = self.tokenizer.pad(
<span class="hljs-meta">... </span>            flattened_features,
<span class="hljs-meta">... </span>            padding=self.padding,
<span class="hljs-meta">... </span>            max_length=self.max_length,
<span class="hljs-meta">... </span>            pad_to_multiple_of=self.pad_to_multiple_of,
<span class="hljs-meta">... </span>            return_tensors=<span class="hljs-string">&quot;tf&quot;</span>,
<span class="hljs-meta">... </span>        )

<span class="hljs-meta">... </span>        batch = {k: tf.reshape(v, (batch_size, num_choices, -<span class="hljs-number">1</span>)) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> batch.items()}
<span class="hljs-meta">... </span>        batch[<span class="hljs-string">&quot;labels&quot;</span>] = tf.convert_to_tensor(labels, dtype=tf.int64)
<span class="hljs-meta">... </span>        <span class="hljs-keyword">return</span> batch`,wrap:!1}}),{c(){y(a.$$.fragment)},l(l){h(a.$$.fragment,l)},m(l,o){d(a,l,o),r=!0},p:ms,i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){f(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function zl(C){let a,r;return a=new As({props:{$$slots:{default:[Nl]},$$scope:{ctx:C}}}),{c(){y(a.$$.fragment)},l(l){h(a.$$.fragment,l)},m(l,o){d(a,l,o),r=!0},p(l,o){const j={};o&2&&(j.$$scope={dirty:o,ctx:l}),a.$set(j)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){f(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function Ql(C){let a,r='<code>Trainer</code>로 모델을 미세 조정하는 데 익숙하지 않다면 기본 튜토리얼 <a href="../training#train-with-pytorch-trainer">여기</a>를 살펴보세요!';return{c(){a=J("p"),a.innerHTML=r},l(l){a=U(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-mnr18a"&&(a.innerHTML=r)},m(l,o){t(l,a,o)},p:ms,d(l){l&&e(a)}}}function Hl(C){let a,r,l,o="이제 모델 훈련을 시작할 준비가 되었습니다! <code>AutoModelForMultipleChoice</code>로 BERT를 로드합니다:",j,_,B,I,Z="이제 세 단계만 남았습니다:",X,k,A="<li>훈련 하이퍼파라미터를 <code>TrainingArguments</code>에 정의합니다. 유일한 필수 매개변수는 모델을 저장할 위치를 지정하는 <code>output_dir</code>입니다. <code>push_to_hub=True</code>를 설정하여 이 모델을 허브에 푸시합니다(모델을 업로드하려면 허깅 페이스에 로그인해야 합니다). 각 에폭이 끝날 때마다 <code>Trainer</code>가 정확도를 평가하고 훈련 체크포인트를 저장합니다.</li> <li>모델, 데이터 세트, 토크나이저, 데이터 콜레이터, <code>compute_metrics</code> 함수와 함께 훈련 인자를 <code>Trainer</code>에 전달합니다.</li> <li><code>train()</code>을 사용하여 모델을 미세 조정합니다.</li>",W,$,G,M,g="훈련이 완료되면 모든 사람이 모델을 사용할 수 있도록 <code>push_to_hub()</code> 메소드를 사용하여 모델을 허브에 공유하세요:",v,Y,x;return a=new ol({props:{$$slots:{default:[Ql]},$$scope:{ctx:C}}}),_=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvck11bHRpcGxlQ2hvaWNlJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMkMlMjBUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForMultipleChoice, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)`,wrap:!1}}),$=new R({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX3N3YWdfbW9kZWwlMjIlMkMlMEElMjAlMjAlMjAlMjBldmFsdWF0aW9uX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGxlYXJuaW5nX3JhdGUlM0Q1ZS01JTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3RyYWluX2Vwb2NocyUzRDMlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0R0b2tlbml6ZWRfc3dhZyU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEdG9rZW5pemVkX3N3YWclNUIlMjJ2YWxpZGF0aW9uJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemVyJTNEdG9rZW5pemVyJTJDJTBBJTIwJTIwJTIwJTIwZGF0YV9jb2xsYXRvciUzRERhdGFDb2xsYXRvckZvck11bHRpcGxlQ2hvaWNlKHRva2VuaXplciUzRHRva2VuaXplciklMkMlMEElMjAlMjAlMjAlMjBjb21wdXRlX21ldHJpY3MlM0Rjb21wdXRlX21ldHJpY3MlMkMlMEEpJTBBJTBBdHJhaW5lci50cmFpbigp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;my_awesome_swag_model&quot;</span>,
<span class="hljs-meta">... </span>    evaluation_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
<span class="hljs-meta">... </span>    save_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
<span class="hljs-meta">... </span>    load_best_model_at_end=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">5e-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>    num_train_epochs=<span class="hljs-number">3</span>,
<span class="hljs-meta">... </span>    weight_decay=<span class="hljs-number">0.01</span>,
<span class="hljs-meta">... </span>    push_to_hub=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=tokenized_swag[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=tokenized_swag[<span class="hljs-string">&quot;validation&quot;</span>],
<span class="hljs-meta">... </span>    tokenizer=tokenizer,
<span class="hljs-meta">... </span>    data_collator=DataCollatorForMultipleChoice(tokenizer=tokenizer),
<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}}),Y=new R({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){y(a.$$.fragment),r=c(),l=J("p"),l.innerHTML=o,j=c(),y(_.$$.fragment),B=c(),I=J("p"),I.textContent=Z,X=c(),k=J("ol"),k.innerHTML=A,W=c(),y($.$$.fragment),G=c(),M=J("p"),M.innerHTML=g,v=c(),y(Y.$$.fragment)},l(i){h(a.$$.fragment,i),r=m(i),l=U(i,"P",{"data-svelte-h":!0}),T(l)!=="svelte-1dl7gnk"&&(l.innerHTML=o),j=m(i),h(_.$$.fragment,i),B=m(i),I=U(i,"P",{"data-svelte-h":!0}),T(I)!=="svelte-1vwg7jz"&&(I.textContent=Z),X=m(i),k=U(i,"OL",{"data-svelte-h":!0}),T(k)!=="svelte-jig6dx"&&(k.innerHTML=A),W=m(i),h($.$$.fragment,i),G=m(i),M=U(i,"P",{"data-svelte-h":!0}),T(M)!=="svelte-yt6kqu"&&(M.innerHTML=g),v=m(i),h(Y.$$.fragment,i)},m(i,V){d(a,i,V),t(i,r,V),t(i,l,V),t(i,j,V),d(_,i,V),t(i,B,V),t(i,I,V),t(i,X,V),t(i,k,V),t(i,W,V),d($,i,V),t(i,G,V),t(i,M,V),t(i,v,V),d(Y,i,V),x=!0},p(i,V){const E={};V&2&&(E.$$scope={dirty:V,ctx:i}),a.$set(E)},i(i){x||(u(a.$$.fragment,i),u(_.$$.fragment,i),u($.$$.fragment,i),u(Y.$$.fragment,i),x=!0)},o(i){f(a.$$.fragment,i),f(_.$$.fragment,i),f($.$$.fragment,i),f(Y.$$.fragment,i),x=!1},d(i){i&&(e(r),e(l),e(j),e(B),e(I),e(X),e(k),e(W),e(G),e(M),e(v)),w(a,i),w(_,i),w($,i),w(Y,i)}}}function Sl(C){let a,r;return a=new As({props:{$$slots:{default:[Hl]},$$scope:{ctx:C}}}),{c(){y(a.$$.fragment)},l(l){h(a.$$.fragment,l)},m(l,o){d(a,l,o),r=!0},p(l,o){const j={};o&2&&(j.$$scope={dirty:o,ctx:l}),a.$set(j)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){f(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function ql(C){let a,r='Keras로 모델을 미세 조정하는 데 익숙하지 않다면 기본 튜토리얼 <a href="../training#train-a-tensorflow-model-with-keras">여기</a>를 살펴보시기 바랍니다!';return{c(){a=J("p"),a.innerHTML=r},l(l){a=U(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-16zjqtu"&&(a.innerHTML=r)},m(l,o){t(l,a,o)},p:ms,d(l){l&&e(a)}}}function Ll(C){let a,r,l,o,j,_="그리고 <code>TFAutoModelForMultipleChoice</code>로 BERT를 가져올 수 있습니다:",B,I,Z,X,k="<code>prepare_tf_dataset()</code>을 사용하여 데이터 세트를 <code>tf.data.Dataset</code> 형식으로 변환합니다:",A,W,$,G,M='<a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>을 사용하여 훈련 모델을 구성합니다:',g,v,Y,x,i='훈련을 시작하기 전에 설정해야 할 마지막 두 가지는 예측의 정확도를 계산하고 모델을 허브로 푸시하는 방법을 제공하는 것입니다. 이 두 가지 작업은 모두 <a href="../main_classes/keras_callbacks">Keras 콜백</a>을 사용하여 수행할 수 있습니다.',V,E,os="<code>compute_metrics</code>함수를 <code>KerasMetricCallback</code>에 전달하세요:",N,ss,ns,F,is="모델과 토크나이저를 업로드할 위치를 <code>PushToHubCallback</code>에서 지정하세요:",z,Q,H,ls,js="그리고 콜백을 함께 묶습니다:",S,q,L,as,ys='이제 모델 훈련을 시작합니다! 훈련 및 검증 데이터 세트, 에폭 수, 콜백을 사용하여 <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a>을 호출하고 모델을 미세 조정합니다:',D,P,K,es,hs="훈련이 완료되면 모델이 자동으로 허브에 업로드되어 누구나 사용할 수 있습니다!",O;return a=new ol({props:{$$slots:{default:[ql]},$$scope:{ctx:C}}}),l=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGNyZWF0ZV9vcHRpbWl6ZXIlMEElMEFiYXRjaF9zaXplJTIwJTNEJTIwMTYlMEFudW1fdHJhaW5fZXBvY2hzJTIwJTNEJTIwMiUwQXRvdGFsX3RyYWluX3N0ZXBzJTIwJTNEJTIwKGxlbih0b2tlbml6ZWRfc3dhZyU1QiUyMnRyYWluJTIyJTVEKSUyMCUyRiUyRiUyMGJhdGNoX3NpemUpJTIwKiUyMG51bV90cmFpbl9lcG9jaHMlMEFvcHRpbWl6ZXIlMkMlMjBzY2hlZHVsZSUyMCUzRCUyMGNyZWF0ZV9vcHRpbWl6ZXIoaW5pdF9sciUzRDVlLTUlMkMlMjBudW1fd2FybXVwX3N0ZXBzJTNEMCUyQyUyMG51bV90cmFpbl9zdGVwcyUzRHRvdGFsX3RyYWluX3N0ZXBzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer

<span class="hljs-meta">&gt;&gt;&gt; </span>batch_size = <span class="hljs-number">16</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_train_epochs = <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>total_train_steps = (<span class="hljs-built_in">len</span>(tokenized_swag[<span class="hljs-string">&quot;train&quot;</span>]) // batch_size) * num_train_epochs
<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer, schedule = create_optimizer(init_lr=<span class="hljs-number">5e-5</span>, num_warmup_steps=<span class="hljs-number">0</span>, num_train_steps=total_train_steps)`,wrap:!1}}),I=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yTXVsdGlwbGVDaG9pY2UlMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForMultipleChoice

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)`,wrap:!1}}),W=new R({props:{code:"ZGF0YV9jb2xsYXRvciUyMCUzRCUyMERhdGFDb2xsYXRvckZvck11bHRpcGxlQ2hvaWNlKHRva2VuaXplciUzRHRva2VuaXplciklMEF0Zl90cmFpbl9zZXQlMjAlM0QlMjBtb2RlbC5wcmVwYXJlX3RmX2RhdGFzZXQoJTBBJTIwJTIwJTIwJTIwdG9rZW5pemVkX3N3YWclNUIlMjJ0cmFpbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHNodWZmbGUlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRGJhdGNoX3NpemUlMkMlMEElMjAlMjAlMjAlMjBjb2xsYXRlX2ZuJTNEZGF0YV9jb2xsYXRvciUyQyUwQSklMEElMEF0Zl92YWxpZGF0aW9uX3NldCUyMCUzRCUyMG1vZGVsLnByZXBhcmVfdGZfZGF0YXNldCglMEElMjAlMjAlMjAlMjB0b2tlbml6ZWRfc3dhZyU1QiUyMnZhbGlkYXRpb24lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBzaHVmZmxlJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBiYXRjaF9zaXplJTNEYmF0Y2hfc2l6ZSUyQyUwQSUyMCUyMCUyMCUyMGNvbGxhdGVfZm4lM0RkYXRhX2NvbGxhdG9yJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForMultipleChoice(tokenizer=tokenizer)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_set = model.prepare_tf_dataset(
<span class="hljs-meta">... </span>    tokenized_swag[<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=batch_size,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_validation_set = model.prepare_tf_dataset(
<span class="hljs-meta">... </span>    tokenized_swag[<span class="hljs-string">&quot;validation&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    batch_size=batch_size,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)`,wrap:!1}}),v=new R({props:{code:"bW9kZWwuY29tcGlsZShvcHRpbWl6ZXIlM0RvcHRpbWl6ZXIp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)',wrap:!1}}),ss=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:"ZnJvbSUyMHRyYW5zZm9ybWVycy5rZXJhc19jYWxsYmFja3MlMjBpbXBvcnQlMjBQdXNoVG9IdWJDYWxsYmFjayUwQSUwQXB1c2hfdG9faHViX2NhbGxiYWNrJTIwJTNEJTIwUHVzaFRvSHViQ2FsbGJhY2soJTBBJTIwJTIwJTIwJTIwb3V0cHV0X2RpciUzRCUyMm15X2F3ZXNvbWVfbW9kZWwlMjIlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMEEp",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_model&quot;</span>,
<span class="hljs-meta">... </span>    tokenizer=tokenizer,
<span class="hljs-meta">... </span>)`,wrap:!1}}),q=new R({props:{code:"Y2FsbGJhY2tzJTIwJTNEJTIwJTVCbWV0cmljX2NhbGxiYWNrJTJDJTIwcHVzaF90b19odWJfY2FsbGJhY2slNUQ=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>callbacks = [metric_callback, push_to_hub_callback]',wrap:!1}}),P=new R({props:{code:"bW9kZWwuZml0KHglM0R0Zl90cmFpbl9zZXQlMkMlMjB2YWxpZGF0aW9uX2RhdGElM0R0Zl92YWxpZGF0aW9uX3NldCUyQyUyMGVwb2NocyUzRDIlMkMlMjBjYWxsYmFja3MlM0RjYWxsYmFja3Mp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(x=tf_train_set, validation_data=tf_validation_set, epochs=<span class="hljs-number">2</span>, callbacks=callbacks)',wrap:!1}}),{c(){y(a.$$.fragment),r=Gl(`
TensorFlow에서 모델을 미세 조정하려면 최적화 함수, 학습률 스케쥴 및 몇 가지 학습 하이퍼파라미터를 설정하는 것부터 시작하세요:

	`),y(l.$$.fragment),o=c(),j=J("p"),j.innerHTML=_,B=c(),y(I.$$.fragment),Z=c(),X=J("p"),X.innerHTML=k,A=c(),y(W.$$.fragment),$=c(),G=J("p"),G.innerHTML=M,g=c(),y(v.$$.fragment),Y=c(),x=J("p"),x.innerHTML=i,V=c(),E=J("p"),E.innerHTML=os,N=c(),y(ss.$$.fragment),ns=c(),F=J("p"),F.innerHTML=is,z=c(),y(Q.$$.fragment),H=c(),ls=J("p"),ls.textContent=js,S=c(),y(q.$$.fragment),L=c(),as=J("p"),as.innerHTML=ys,D=c(),y(P.$$.fragment),K=c(),es=J("p"),es.textContent=hs},l(n){h(a.$$.fragment,n),r=Rl(n,`
TensorFlow에서 모델을 미세 조정하려면 최적화 함수, 학습률 스케쥴 및 몇 가지 학습 하이퍼파라미터를 설정하는 것부터 시작하세요:

	`),h(l.$$.fragment,n),o=m(n),j=U(n,"P",{"data-svelte-h":!0}),T(j)!=="svelte-t1g1zp"&&(j.innerHTML=_),B=m(n),h(I.$$.fragment,n),Z=m(n),X=U(n,"P",{"data-svelte-h":!0}),T(X)!=="svelte-txv5rs"&&(X.innerHTML=k),A=m(n),h(W.$$.fragment,n),$=m(n),G=U(n,"P",{"data-svelte-h":!0}),T(G)!=="svelte-qo1enf"&&(G.innerHTML=M),g=m(n),h(v.$$.fragment,n),Y=m(n),x=U(n,"P",{"data-svelte-h":!0}),T(x)!=="svelte-1nxoekh"&&(x.innerHTML=i),V=m(n),E=U(n,"P",{"data-svelte-h":!0}),T(E)!=="svelte-zlosk8"&&(E.innerHTML=os),N=m(n),h(ss.$$.fragment,n),ns=m(n),F=U(n,"P",{"data-svelte-h":!0}),T(F)!=="svelte-1b0ip2a"&&(F.innerHTML=is),z=m(n),h(Q.$$.fragment,n),H=m(n),ls=U(n,"P",{"data-svelte-h":!0}),T(ls)!=="svelte-ernkdu"&&(ls.textContent=js),S=m(n),h(q.$$.fragment,n),L=m(n),as=U(n,"P",{"data-svelte-h":!0}),T(as)!=="svelte-1illf6u"&&(as.innerHTML=ys),D=m(n),h(P.$$.fragment,n),K=m(n),es=U(n,"P",{"data-svelte-h":!0}),T(es)!=="svelte-ymmthz"&&(es.textContent=hs)},m(n,b){d(a,n,b),t(n,r,b),d(l,n,b),t(n,o,b),t(n,j,b),t(n,B,b),d(I,n,b),t(n,Z,b),t(n,X,b),t(n,A,b),d(W,n,b),t(n,$,b),t(n,G,b),t(n,g,b),d(v,n,b),t(n,Y,b),t(n,x,b),t(n,V,b),t(n,E,b),t(n,N,b),d(ss,n,b),t(n,ns,b),t(n,F,b),t(n,z,b),d(Q,n,b),t(n,H,b),t(n,ls,b),t(n,S,b),d(q,n,b),t(n,L,b),t(n,as,b),t(n,D,b),d(P,n,b),t(n,K,b),t(n,es,b),O=!0},p(n,b){const ts={};b&2&&(ts.$$scope={dirty:b,ctx:n}),a.$set(ts)},i(n){O||(u(a.$$.fragment,n),u(l.$$.fragment,n),u(I.$$.fragment,n),u(W.$$.fragment,n),u(v.$$.fragment,n),u(ss.$$.fragment,n),u(Q.$$.fragment,n),u(q.$$.fragment,n),u(P.$$.fragment,n),O=!0)},o(n){f(a.$$.fragment,n),f(l.$$.fragment,n),f(I.$$.fragment,n),f(W.$$.fragment,n),f(v.$$.fragment,n),f(ss.$$.fragment,n),f(Q.$$.fragment,n),f(q.$$.fragment,n),f(P.$$.fragment,n),O=!1},d(n){n&&(e(r),e(o),e(j),e(B),e(Z),e(X),e(A),e($),e(G),e(g),e(Y),e(x),e(V),e(E),e(N),e(ns),e(F),e(z),e(H),e(ls),e(S),e(L),e(as),e(D),e(K),e(es)),w(a,n),w(l,n),w(I,n),w(W,n),w(v,n),w(ss,n),w(Q,n),w(q,n),w(P,n)}}}function Dl(C){let a,r;return a=new As({props:{$$slots:{default:[Ll]},$$scope:{ctx:C}}}),{c(){y(a.$$.fragment)},l(l){h(a.$$.fragment,l)},m(l,o){d(a,l,o),r=!0},p(l,o){const j={};o&2&&(j.$$scope={dirty:o,ctx:l}),a.$set(j)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){f(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function Pl(C){let a,r=`객관식 모델을 미세 조정하는 방법에 대한 보다 심층적인 예는 아래 문서를 참조하세요.
<a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb" rel="nofollow">PyTorch notebook</a>
또는 <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb" rel="nofollow">TensorFlow notebook</a>.`;return{c(){a=J("p"),a.innerHTML=r},l(l){a=U(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-i06vpg"&&(a.innerHTML=r)},m(l,o){t(l,a,o)},p:ms,d(l){l&&e(a)}}}function Kl(C){let a,r="각 프롬프트와 후보 답변 쌍을 토큰화하여 PyTorch 텐서를 반환합니다. 또한 <code>labels</code>을 생성해야 합니다:",l,o,j,_,B="입력과 레이블을 모델에 전달하고 <code>logits</code>을 반환합니다:",I,Z,X,k,A="가장 높은 확률을 가진 클래스를 가져옵니다:",W,$,G;return o=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJteV9hd2Vzb21lX3N3YWdfbW9kZWwlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiU1QnByb21wdCUyQyUyMGNhbmRpZGF0ZTElNUQlMkMlMjAlNUJwcm9tcHQlMkMlMjBjYW5kaWRhdGUyJTVEJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlKSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvcigwKS51bnNxdWVlemUoMCk=",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_swag_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([[prompt, candidate1], [prompt, candidate2]], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)`,wrap:!1}}),Z=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvck11bHRpcGxlQ2hvaWNlJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIybXlfYXdlc29tZV9zd2FnX21vZGVsJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKiU3QmslM0ElMjB2LnVuc3F1ZWV6ZSgwKSUyMGZvciUyMGslMkMlMjB2JTIwaW4lMjBpbnB1dHMuaXRlbXMoKSU3RCUyQyUyMGxhYmVscyUzRGxhYmVscyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForMultipleChoice

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;my_awesome_swag_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> inputs.items()}, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`,wrap:!1}}),$=new R({props:{code:"cHJlZGljdGVkX2NsYXNzJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQXByZWRpY3RlZF9jbGFzcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class
<span class="hljs-string">&#x27;0&#x27;</span>`,wrap:!1}}),{c(){a=J("p"),a.innerHTML=r,l=c(),y(o.$$.fragment),j=c(),_=J("p"),_.innerHTML=B,I=c(),y(Z.$$.fragment),X=c(),k=J("p"),k.textContent=A,W=c(),y($.$$.fragment)},l(M){a=U(M,"P",{"data-svelte-h":!0}),T(a)!=="svelte-35m9oi"&&(a.innerHTML=r),l=m(M),h(o.$$.fragment,M),j=m(M),_=U(M,"P",{"data-svelte-h":!0}),T(_)!=="svelte-x6lqnk"&&(_.innerHTML=B),I=m(M),h(Z.$$.fragment,M),X=m(M),k=U(M,"P",{"data-svelte-h":!0}),T(k)!=="svelte-for6x5"&&(k.textContent=A),W=m(M),h($.$$.fragment,M)},m(M,g){t(M,a,g),t(M,l,g),d(o,M,g),t(M,j,g),t(M,_,g),t(M,I,g),d(Z,M,g),t(M,X,g),t(M,k,g),t(M,W,g),d($,M,g),G=!0},p:ms,i(M){G||(u(o.$$.fragment,M),u(Z.$$.fragment,M),u($.$$.fragment,M),G=!0)},o(M){f(o.$$.fragment,M),f(Z.$$.fragment,M),f($.$$.fragment,M),G=!1},d(M){M&&(e(a),e(l),e(j),e(_),e(I),e(X),e(k),e(W)),w(o,M),w(Z,M),w($,M)}}}function Ol(C){let a,r;return a=new As({props:{$$slots:{default:[Kl]},$$scope:{ctx:C}}}),{c(){y(a.$$.fragment)},l(l){h(a.$$.fragment,l)},m(l,o){d(a,l,o),r=!0},p(l,o){const j={};o&2&&(j.$$scope={dirty:o,ctx:l}),a.$set(j)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){f(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function sa(C){let a,r="각 프롬프트와 후보 답안 쌍을 토큰화하여 텐서플로 텐서를 반환합니다:",l,o,j,_,B="모델에 입력을 전달하고 <code>logits</code>를 반환합니다:",I,Z,X,k,A="가장 높은 확률을 가진 클래스를 가져옵니다:",W,$,G;return o=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJteV9hd2Vzb21lX3N3YWdfbW9kZWwlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiU1QnByb21wdCUyQyUyMGNhbmRpZGF0ZTElNUQlMkMlMjAlNUJwcm9tcHQlMkMlMjBjYW5kaWRhdGUyJTVEJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiUyQyUyMHBhZGRpbmclM0RUcnVlKQ==",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_swag_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([[prompt, candidate1], [prompt, candidate2]], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>, padding=<span class="hljs-literal">True</span>)`,wrap:!1}}),Z=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yTXVsdGlwbGVDaG9pY2UlMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMm15X2F3ZXNvbWVfc3dhZ19tb2RlbCUyMiklMEFpbnB1dHMlMjAlM0QlMjAlN0JrJTNBJTIwdGYuZXhwYW5kX2RpbXModiUyQyUyMDApJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGlucHV0cy5pdGVtcygpJTdEJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForMultipleChoice

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;my_awesome_swag_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = {k: tf.expand_dims(v, <span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> inputs.items()}
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`,wrap:!1}}),$=new R({props:{code:"cHJlZGljdGVkX2NsYXNzJTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklNUIwJTVEKSUwQXByZWRpY3RlZF9jbGFzcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class
<span class="hljs-string">&#x27;0&#x27;</span>`,wrap:!1}}),{c(){a=J("p"),a.textContent=r,l=c(),y(o.$$.fragment),j=c(),_=J("p"),_.innerHTML=B,I=c(),y(Z.$$.fragment),X=c(),k=J("p"),k.textContent=A,W=c(),y($.$$.fragment)},l(M){a=U(M,"P",{"data-svelte-h":!0}),T(a)!=="svelte-1dzr36c"&&(a.textContent=r),l=m(M),h(o.$$.fragment,M),j=m(M),_=U(M,"P",{"data-svelte-h":!0}),T(_)!=="svelte-t69k4k"&&(_.innerHTML=B),I=m(M),h(Z.$$.fragment,M),X=m(M),k=U(M,"P",{"data-svelte-h":!0}),T(k)!=="svelte-for6x5"&&(k.textContent=A),W=m(M),h($.$$.fragment,M)},m(M,g){t(M,a,g),t(M,l,g),d(o,M,g),t(M,j,g),t(M,_,g),t(M,I,g),d(Z,M,g),t(M,X,g),t(M,k,g),t(M,W,g),d($,M,g),G=!0},p:ms,i(M){G||(u(o.$$.fragment,M),u(Z.$$.fragment,M),u($.$$.fragment,M),G=!0)},o(M){f(o.$$.fragment,M),f(Z.$$.fragment,M),f($.$$.fragment,M),G=!1},d(M){M&&(e(a),e(l),e(j),e(_),e(I),e(X),e(k),e(W)),w(o,M),w(Z,M),w($,M)}}}function la(C){let a,r;return a=new As({props:{$$slots:{default:[sa]},$$scope:{ctx:C}}}),{c(){y(a.$$.fragment)},l(l){h(a.$$.fragment,l)},m(l,o){d(a,l,o),r=!0},p(l,o){const j={};o&2&&(j.$$scope={dirty:o,ctx:l}),a.$set(j)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){f(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function aa(C){let a,r,l,o,j,_,B,I,Z,X="객관식 과제는 문맥과 함께 여러 개의 후보 답변이 제공되고 모델이 정답을 선택하도록 학습된다는 점을 제외하면 질의응답과 유사합니다.",k,A,W="진행하는 방법은 아래와 같습니다:",$,G,M='<li><a href="https://huggingface.co/datasets/swag" rel="nofollow">SWAG</a> 데이터 세트의 ‘regular’ 구성으로 <a href="https://huggingface.co/bert-base-uncased" rel="nofollow">BERT</a>를 미세 조정하여 여러 옵션과 일부 컨텍스트가 주어졌을 때 가장 적합한 답을 선택합니다.</li> <li>추론에 미세 조정된 모델을 사용합니다.</li>',g,v,Y,x,i="시작하기 전에 필요한 라이브러리가 모두 설치되어 있는지 확인하세요:",V,E,os,N,ss="모델을 업로드하고 커뮤니티와 공유할 수 있도록 허깅페이스 계정에 로그인하는 것이 좋습니다. 메시지가 표시되면 토큰을 입력하여 로그인합니다:",ns,F,is,z,Q,H,ls="먼저 🤗 Datasets  라이브러리에서 SWAG 데이터셋의 ‘일반’ 구성을 가져옵니다:",js,S,q,L,as="이제 데이터를 살펴봅니다:",ys,D,P,K,es="여기에는 많은 필드가 있는 것처럼 보이지만 실제로는 매우 간단합니다:",hs,O,n="<li><code>sent1</code> 및 <code>sent2</code>: 이 필드는 문장이 어떻게 시작되는지 보여주며, 이 두 필드를 합치면 <code>시작 구절(startphrase)</code> 필드가 됩니다.</li> <li><code>종료 구절(ending)</code>: 문장이 어떻게 끝날 수 있는지에 대한 가능한 종료 구절를 제시하지만 그 중 하나만 정답입니다.</li> <li><code>레이블(label)</code>: 올바른 문장 종료 구절을 식별합니다.</li>",b,ts,xs,ds,jl="다음 단계는 문장의 시작과 네 가지 가능한 구절을 처리하기 위해 BERT 토크나이저를 불러옵니다:",Es,us,Ys,fs,yl="생성하려는 전처리 함수는 다음과 같아야 합니다:",Fs,ws,hl="<li><code>sent1</code> 필드를 네 개 복사한 다음 각각을 <code>sent2</code>와 결합하여 문장이 시작되는 방식을 재현합니다.</li> <li><code>sent2</code>를 네 가지 가능한 문장 구절 각각과 결합합니다.</li> <li>이 두 목록을 토큰화할 수 있도록 평탄화(flatten)하고, 각 예제에 해당하는 <code>input_ids</code>, <code>attention_mask</code> 및 <code>labels</code> 필드를 갖도록 다차원화(unflatten) 합니다.</li>",Ns,Js,zs,Us,dl="전체 데이터 집합에 전처리 기능을 적용하려면 🤗 Datasets <code>map</code> 메소드를 사용합니다. <code>batched=True</code>를 설정하여 데이터 집합의 여러 요소를 한 번에 처리하면 <code>map</code> 함수의 속도를 높일 수 있습니다:",Qs,bs,Hs,Ts,ul="🤗 Transformers에는 객관식용 데이터 콜레이터가 없으므로 예제 배치를 만들려면 <code>DataCollatorWithPadding</code>을 조정해야 합니다. 데이터 정렬 중에 전체 데이터 집합을 최대 길이로 패딩하는 대신 배치 중 가장 긴 길이로 문장을 <em>동적 패딩</em>하는 것이 더 효율적입니다.",Ss,gs,fl="<code>DataCollatorForMultipleChoice</code>는 모든 모델 입력을 평탄화하고 패딩을 적용하며 그 결과를 결과를 다차원화합니다:",qs,ps,Ls,$s,Ds,Cs,wl='훈련 중에 메트릭을 포함하면 모델의 성능을 평가하는 데 도움이 되는 경우가 많습니다. 🤗<a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a> 라이브러리를 사용하여 평가 방법을 빠르게 가져올 수 있습니다. 이 작업에서는 <a href="https://huggingface.co/spaces/evaluate-metric/accuracy" rel="nofollow">accuracy</a> 지표를 가져옵니다(🤗 Evaluate <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">둘러보기</a>를 참조하여 지표를 가져오고 계산하는 방법에 대해 자세히 알아보세요):',Ps,_s,Ks,Zs,Jl="그리고 예측과 레이블을 <code>compute</code>에 전달하여 정확도를 계산하는 함수를 만듭니다:",Os,ks,sl,Is,Ul="이제 <code>compute_metrics</code> 함수를 사용할 준비가 되었으며, 훈련을 설정할 때 이 함수로 돌아가게 됩니다.",ll,Gs,al,Ms,el,rs,tl,Rs,nl,Vs,bl="이제 모델을 미세 조정했으니 추론에 사용할 수 있습니다!",pl,Xs,Tl="텍스트와 두 개의 후보 답안을 작성합니다:",Ml,Ws,rl,cs,cl,vs,ml;return j=new Bs({props:{title:"객관식 문제",local:"multiple-choice",headingTag:"h1"}}),B=new xl({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/multiple_choice.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/multiple_choice.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/multiple_choice.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/multiple_choice.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/multiple_choice.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/multiple_choice.ipynb"}]}}),v=new ol({props:{$$slots:{default:[El]},$$scope:{ctx:C}}}),E=new R({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGU=",highlighted:"pip install transformers datasets evaluate",wrap:!1}}),F=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}}),z=new Bs({props:{title:"SWAG 데이터 세트 가져오기",local:"load-swag-dataset",headingTag:"h2"}}),S=new R({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBc3dhZyUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJzd2FnJTIyJTJDJTIwJTIycmVndWxhciUyMik=",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>swag = load_dataset(<span class="hljs-string">&quot;swag&quot;</span>, <span class="hljs-string">&quot;regular&quot;</span>)`,wrap:!1}}),D=new R({props:{code:"c3dhZyU1QiUyMnRyYWluJTIyJTVEJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>swag[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;ending0&#x27;</span>: <span class="hljs-string">&#x27;passes by walking down the street playing their instruments.&#x27;</span>,
 <span class="hljs-string">&#x27;ending1&#x27;</span>: <span class="hljs-string">&#x27;has heard approaching them.&#x27;</span>,
 <span class="hljs-string">&#x27;ending2&#x27;</span>: <span class="hljs-string">&quot;arrives and they&#x27;re outside dancing and asleep.&quot;</span>,
 <span class="hljs-string">&#x27;ending3&#x27;</span>: <span class="hljs-string">&#x27;turns the lead singer watches the performance.&#x27;</span>,
 <span class="hljs-string">&#x27;fold-ind&#x27;</span>: <span class="hljs-string">&#x27;3416&#x27;</span>,
 <span class="hljs-string">&#x27;gold-source&#x27;</span>: <span class="hljs-string">&#x27;gold&#x27;</span>,
 <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-number">0</span>,
 <span class="hljs-string">&#x27;sent1&#x27;</span>: <span class="hljs-string">&#x27;Members of the procession walk down the street holding small horn brass instruments.&#x27;</span>,
 <span class="hljs-string">&#x27;sent2&#x27;</span>: <span class="hljs-string">&#x27;A drum line&#x27;</span>,
 <span class="hljs-string">&#x27;startphrase&#x27;</span>: <span class="hljs-string">&#x27;Members of the procession walk down the street holding small horn brass instruments. A drum line&#x27;</span>,
 <span class="hljs-string">&#x27;video-id&#x27;</span>: <span class="hljs-string">&#x27;anetv_jkn6uvmqwh4&#x27;</span>}`,wrap:!1}}),ts=new Bs({props:{title:"전처리",local:"preprocess",headingTag:"h2"}}),us=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMik=",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;bert-base-uncased&quot;</span>)`,wrap:!1}}),Js=new R({props:{code:"ZW5kaW5nX25hbWVzJTIwJTNEJTIwJTVCJTIyZW5kaW5nMCUyMiUyQyUyMCUyMmVuZGluZzElMjIlMkMlMjAlMjJlbmRpbmcyJTIyJTJDJTIwJTIyZW5kaW5nMyUyMiU1RCUwQSUwQSUwQWRlZiUyMHByZXByb2Nlc3NfZnVuY3Rpb24oZXhhbXBsZXMpJTNBJTBBJTIwJTIwJTIwJTIwZmlyc3Rfc2VudGVuY2VzJTIwJTNEJTIwJTVCJTVCY29udGV4dCU1RCUyMColMjA0JTIwZm9yJTIwY29udGV4dCUyMGluJTIwZXhhbXBsZXMlNUIlMjJzZW50MSUyMiU1RCU1RCU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string">&quot;ending1&quot;</span>, <span class="hljs-string">&quot;ending2&quot;</span>, <span class="hljs-string">&quot;ending3&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>    first_sentences = [[context] * <span class="hljs-number">4</span> <span class="hljs-keyword">for</span> context <span class="hljs-keyword">in</span> examples[<span class="hljs-string">&quot;sent1&quot;</span>]]
<span class="hljs-meta">... </span>    question_headers = examples[<span class="hljs-string">&quot;sent2&quot;</span>]
<span class="hljs-meta">... </span>    second_sentences = [
<span class="hljs-meta">... </span>        [<span class="hljs-string">f&quot;<span class="hljs-subst">{header}</span> <span class="hljs-subst">{examples[end][i]}</span>&quot;</span> <span class="hljs-keyword">for</span> end <span class="hljs-keyword">in</span> ending_names] <span class="hljs-keyword">for</span> i, header <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(question_headers)
<span class="hljs-meta">... </span>    ]

<span class="hljs-meta">... </span>    first_sentences = <span class="hljs-built_in">sum</span>(first_sentences, [])
<span class="hljs-meta">... </span>    second_sentences = <span class="hljs-built_in">sum</span>(second_sentences, [])

<span class="hljs-meta">... </span>    tokenized_examples = tokenizer(first_sentences, second_sentences, truncation=<span class="hljs-literal">True</span>)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {k: [v[i : i + <span class="hljs-number">4</span>] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">0</span>, <span class="hljs-built_in">len</span>(v), <span class="hljs-number">4</span>)] <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> tokenized_examples.items()}`,wrap:!1}}),bs=new R({props:{code:"dG9rZW5pemVkX3N3YWclMjAlM0QlMjBzd2FnLm1hcChwcmVwcm9jZXNzX2Z1bmN0aW9uJTJDJTIwYmF0Y2hlZCUzRFRydWUp",highlighted:'tokenized_swag = swag.<span class="hljs-built_in">map</span>(preprocess_function, batched=<span class="hljs-literal">True</span>)',wrap:!1}}),ps=new il({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[zl],pytorch:[Fl]},$$scope:{ctx:C}}}),$s=new Bs({props:{title:"평가 하기",local:"evaluate",headingTag:"h2"}}),_s=new R({props:{code:"aW1wb3J0JTIwZXZhbHVhdGUlMEElMEFhY2N1cmFjeSUyMCUzRCUyMGV2YWx1YXRlLmxvYWQoJTIyYWNjdXJhY3klMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> evaluate

<span class="hljs-meta">&gt;&gt;&gt; </span>accuracy = evaluate.load(<span class="hljs-string">&quot;accuracy&quot;</span>)`,wrap:!1}}),ks=new R({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBJTBBZGVmJTIwY29tcHV0ZV9tZXRyaWNzKGV2YWxfcHJlZCklM0ElMEElMjAlMjAlMjAlMjBwcmVkaWN0aW9ucyUyQyUyMGxhYmVscyUyMCUzRCUyMGV2YWxfcHJlZCUwQSUyMCUyMCUyMCUyMHByZWRpY3Rpb25zJTIwJTNEJTIwbnAuYXJnbWF4KHByZWRpY3Rpb25zJTJDJTIwYXhpcyUzRDEpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwYWNjdXJhY3kuY29tcHV0ZShwcmVkaWN0aW9ucyUzRHByZWRpY3Rpb25zJTJDJTIwcmVmZXJlbmNlcyUzRGxhYmVscyk=",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_">compute_metrics</span>(<span class="hljs-params">eval_pred</span>):
<span class="hljs-meta">... </span>    predictions, labels = eval_pred
<span class="hljs-meta">... </span>    predictions = np.argmax(predictions, axis=<span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> accuracy.compute(predictions=predictions, references=labels)`,wrap:!1}}),Gs=new Bs({props:{title:"훈련 하기",local:"train",headingTag:"h2"}}),Ms=new il({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Dl],pytorch:[Sl]},$$scope:{ctx:C}}}),rs=new ol({props:{$$slots:{default:[Pl]},$$scope:{ctx:C}}}),Rs=new Bs({props:{title:"추론 하기",local:"inference",headingTag:"h2"}}),Ws=new R({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyRnJhbmNlJTIwaGFzJTIwYSUyMGJyZWFkJTIwbGF3JTJDJTIwTGUlMjBEJUMzJUE5Y3JldCUyMFBhaW4lMkMlMjB3aXRoJTIwc3RyaWN0JTIwcnVsZXMlMjBvbiUyMHdoYXQlMjBpcyUyMGFsbG93ZWQlMjBpbiUyMGElMjB0cmFkaXRpb25hbCUyMGJhZ3VldHRlLiUyMiUwQWNhbmRpZGF0ZTElMjAlM0QlMjAlMjJUaGUlMjBsYXclMjBkb2VzJTIwbm90JTIwYXBwbHklMjB0byUyMGNyb2lzc2FudHMlMjBhbmQlMjBicmlvY2hlLiUyMiUwQWNhbmRpZGF0ZTIlMjAlM0QlMjAlMjJUaGUlMjBsYXclMjBhcHBsaWVzJTIwdG8lMjBiYWd1ZXR0ZXMuJTIy",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;France has a bread law, Le Décret Pain, with strict rules on what is allowed in a traditional baguette.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>candidate1 = <span class="hljs-string">&quot;The law does not apply to croissants and brioche.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>candidate2 = <span class="hljs-string">&quot;The law applies to baguettes.&quot;</span>`,wrap:!1}}),cs=new il({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[la],pytorch:[Ol]},$$scope:{ctx:C}}}),{c(){a=J("meta"),r=c(),l=J("p"),o=c(),y(j.$$.fragment),_=c(),y(B.$$.fragment),I=c(),Z=J("p"),Z.textContent=X,k=c(),A=J("p"),A.textContent=W,$=c(),G=J("ol"),G.innerHTML=M,g=c(),y(v.$$.fragment),Y=c(),x=J("p"),x.textContent=i,V=c(),y(E.$$.fragment),os=c(),N=J("p"),N.textContent=ss,ns=c(),y(F.$$.fragment),is=c(),y(z.$$.fragment),Q=c(),H=J("p"),H.textContent=ls,js=c(),y(S.$$.fragment),q=c(),L=J("p"),L.textContent=as,ys=c(),y(D.$$.fragment),P=c(),K=J("p"),K.textContent=es,hs=c(),O=J("ul"),O.innerHTML=n,b=c(),y(ts.$$.fragment),xs=c(),ds=J("p"),ds.textContent=jl,Es=c(),y(us.$$.fragment),Ys=c(),fs=J("p"),fs.textContent=yl,Fs=c(),ws=J("ol"),ws.innerHTML=hl,Ns=c(),y(Js.$$.fragment),zs=c(),Us=J("p"),Us.innerHTML=dl,Qs=c(),y(bs.$$.fragment),Hs=c(),Ts=J("p"),Ts.innerHTML=ul,Ss=c(),gs=J("p"),gs.innerHTML=fl,qs=c(),y(ps.$$.fragment),Ls=c(),y($s.$$.fragment),Ds=c(),Cs=J("p"),Cs.innerHTML=wl,Ps=c(),y(_s.$$.fragment),Ks=c(),Zs=J("p"),Zs.innerHTML=Jl,Os=c(),y(ks.$$.fragment),sl=c(),Is=J("p"),Is.innerHTML=Ul,ll=c(),y(Gs.$$.fragment),al=c(),y(Ms.$$.fragment),el=c(),y(rs.$$.fragment),tl=c(),y(Rs.$$.fragment),nl=c(),Vs=J("p"),Vs.textContent=bl,pl=c(),Xs=J("p"),Xs.textContent=Tl,Ml=c(),y(Ws.$$.fragment),rl=c(),y(cs.$$.fragment),cl=c(),vs=J("p"),this.h()},l(s){const p=Al("svelte-u9bgzb",document.head);a=U(p,"META",{name:!0,content:!0}),p.forEach(e),r=m(s),l=U(s,"P",{}),kl(l).forEach(e),o=m(s),h(j.$$.fragment,s),_=m(s),h(B.$$.fragment,s),I=m(s),Z=U(s,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-13wfm6g"&&(Z.textContent=X),k=m(s),A=U(s,"P",{"data-svelte-h":!0}),T(A)!=="svelte-10q09rv"&&(A.textContent=W),$=m(s),G=U(s,"OL",{"data-svelte-h":!0}),T(G)!=="svelte-1ymbs5w"&&(G.innerHTML=M),g=m(s),h(v.$$.fragment,s),Y=m(s),x=U(s,"P",{"data-svelte-h":!0}),T(x)!=="svelte-1k0z9pm"&&(x.textContent=i),V=m(s),h(E.$$.fragment,s),os=m(s),N=U(s,"P",{"data-svelte-h":!0}),T(N)!=="svelte-c0su0x"&&(N.textContent=ss),ns=m(s),h(F.$$.fragment,s),is=m(s),h(z.$$.fragment,s),Q=m(s),H=U(s,"P",{"data-svelte-h":!0}),T(H)!=="svelte-3ax2l8"&&(H.textContent=ls),js=m(s),h(S.$$.fragment,s),q=m(s),L=U(s,"P",{"data-svelte-h":!0}),T(L)!=="svelte-z8zknl"&&(L.textContent=as),ys=m(s),h(D.$$.fragment,s),P=m(s),K=U(s,"P",{"data-svelte-h":!0}),T(K)!=="svelte-uhrqn8"&&(K.textContent=es),hs=m(s),O=U(s,"UL",{"data-svelte-h":!0}),T(O)!=="svelte-12h9927"&&(O.innerHTML=n),b=m(s),h(ts.$$.fragment,s),xs=m(s),ds=U(s,"P",{"data-svelte-h":!0}),T(ds)!=="svelte-1ytvevd"&&(ds.textContent=jl),Es=m(s),h(us.$$.fragment,s),Ys=m(s),fs=U(s,"P",{"data-svelte-h":!0}),T(fs)!=="svelte-dr5hbo"&&(fs.textContent=yl),Fs=m(s),ws=U(s,"OL",{"data-svelte-h":!0}),T(ws)!=="svelte-1ur4b3u"&&(ws.innerHTML=hl),Ns=m(s),h(Js.$$.fragment,s),zs=m(s),Us=U(s,"P",{"data-svelte-h":!0}),T(Us)!=="svelte-1yi4yhv"&&(Us.innerHTML=dl),Qs=m(s),h(bs.$$.fragment,s),Hs=m(s),Ts=U(s,"P",{"data-svelte-h":!0}),T(Ts)!=="svelte-10mldg7"&&(Ts.innerHTML=ul),Ss=m(s),gs=U(s,"P",{"data-svelte-h":!0}),T(gs)!=="svelte-q9au9u"&&(gs.innerHTML=fl),qs=m(s),h(ps.$$.fragment,s),Ls=m(s),h($s.$$.fragment,s),Ds=m(s),Cs=U(s,"P",{"data-svelte-h":!0}),T(Cs)!=="svelte-fmkx3s"&&(Cs.innerHTML=wl),Ps=m(s),h(_s.$$.fragment,s),Ks=m(s),Zs=U(s,"P",{"data-svelte-h":!0}),T(Zs)!=="svelte-ezofyo"&&(Zs.innerHTML=Jl),Os=m(s),h(ks.$$.fragment,s),sl=m(s),Is=U(s,"P",{"data-svelte-h":!0}),T(Is)!=="svelte-7zql7p"&&(Is.innerHTML=Ul),ll=m(s),h(Gs.$$.fragment,s),al=m(s),h(Ms.$$.fragment,s),el=m(s),h(rs.$$.fragment,s),tl=m(s),h(Rs.$$.fragment,s),nl=m(s),Vs=U(s,"P",{"data-svelte-h":!0}),T(Vs)!=="svelte-174wmmm"&&(Vs.textContent=bl),pl=m(s),Xs=U(s,"P",{"data-svelte-h":!0}),T(Xs)!=="svelte-1h2wndb"&&(Xs.textContent=Tl),Ml=m(s),h(Ws.$$.fragment,s),rl=m(s),h(cs.$$.fragment,s),cl=m(s),vs=U(s,"P",{}),kl(vs).forEach(e),this.h()},h(){Il(a,"name","hf:doc:metadata"),Il(a,"content",ea)},m(s,p){vl(document.head,a),t(s,r,p),t(s,l,p),t(s,o,p),d(j,s,p),t(s,_,p),d(B,s,p),t(s,I,p),t(s,Z,p),t(s,k,p),t(s,A,p),t(s,$,p),t(s,G,p),t(s,g,p),d(v,s,p),t(s,Y,p),t(s,x,p),t(s,V,p),d(E,s,p),t(s,os,p),t(s,N,p),t(s,ns,p),d(F,s,p),t(s,is,p),d(z,s,p),t(s,Q,p),t(s,H,p),t(s,js,p),d(S,s,p),t(s,q,p),t(s,L,p),t(s,ys,p),d(D,s,p),t(s,P,p),t(s,K,p),t(s,hs,p),t(s,O,p),t(s,b,p),d(ts,s,p),t(s,xs,p),t(s,ds,p),t(s,Es,p),d(us,s,p),t(s,Ys,p),t(s,fs,p),t(s,Fs,p),t(s,ws,p),t(s,Ns,p),d(Js,s,p),t(s,zs,p),t(s,Us,p),t(s,Qs,p),d(bs,s,p),t(s,Hs,p),t(s,Ts,p),t(s,Ss,p),t(s,gs,p),t(s,qs,p),d(ps,s,p),t(s,Ls,p),d($s,s,p),t(s,Ds,p),t(s,Cs,p),t(s,Ps,p),d(_s,s,p),t(s,Ks,p),t(s,Zs,p),t(s,Os,p),d(ks,s,p),t(s,sl,p),t(s,Is,p),t(s,ll,p),d(Gs,s,p),t(s,al,p),d(Ms,s,p),t(s,el,p),d(rs,s,p),t(s,tl,p),d(Rs,s,p),t(s,nl,p),t(s,Vs,p),t(s,pl,p),t(s,Xs,p),t(s,Ml,p),d(Ws,s,p),t(s,rl,p),d(cs,s,p),t(s,cl,p),t(s,vs,p),ml=!0},p(s,[p]){const gl={};p&2&&(gl.$$scope={dirty:p,ctx:s}),v.$set(gl);const $l={};p&2&&($l.$$scope={dirty:p,ctx:s}),ps.$set($l);const Cl={};p&2&&(Cl.$$scope={dirty:p,ctx:s}),Ms.$set(Cl);const _l={};p&2&&(_l.$$scope={dirty:p,ctx:s}),rs.$set(_l);const Zl={};p&2&&(Zl.$$scope={dirty:p,ctx:s}),cs.$set(Zl)},i(s){ml||(u(j.$$.fragment,s),u(B.$$.fragment,s),u(v.$$.fragment,s),u(E.$$.fragment,s),u(F.$$.fragment,s),u(z.$$.fragment,s),u(S.$$.fragment,s),u(D.$$.fragment,s),u(ts.$$.fragment,s),u(us.$$.fragment,s),u(Js.$$.fragment,s),u(bs.$$.fragment,s),u(ps.$$.fragment,s),u($s.$$.fragment,s),u(_s.$$.fragment,s),u(ks.$$.fragment,s),u(Gs.$$.fragment,s),u(Ms.$$.fragment,s),u(rs.$$.fragment,s),u(Rs.$$.fragment,s),u(Ws.$$.fragment,s),u(cs.$$.fragment,s),ml=!0)},o(s){f(j.$$.fragment,s),f(B.$$.fragment,s),f(v.$$.fragment,s),f(E.$$.fragment,s),f(F.$$.fragment,s),f(z.$$.fragment,s),f(S.$$.fragment,s),f(D.$$.fragment,s),f(ts.$$.fragment,s),f(us.$$.fragment,s),f(Js.$$.fragment,s),f(bs.$$.fragment,s),f(ps.$$.fragment,s),f($s.$$.fragment,s),f(_s.$$.fragment,s),f(ks.$$.fragment,s),f(Gs.$$.fragment,s),f(Ms.$$.fragment,s),f(rs.$$.fragment,s),f(Rs.$$.fragment,s),f(Ws.$$.fragment,s),f(cs.$$.fragment,s),ml=!1},d(s){s&&(e(r),e(l),e(o),e(_),e(I),e(Z),e(k),e(A),e($),e(G),e(g),e(Y),e(x),e(V),e(os),e(N),e(ns),e(is),e(Q),e(H),e(js),e(q),e(L),e(ys),e(P),e(K),e(hs),e(O),e(b),e(xs),e(ds),e(Es),e(Ys),e(fs),e(Fs),e(ws),e(Ns),e(zs),e(Us),e(Qs),e(Hs),e(Ts),e(Ss),e(gs),e(qs),e(Ls),e(Ds),e(Cs),e(Ps),e(Ks),e(Zs),e(Os),e(sl),e(Is),e(ll),e(al),e(el),e(tl),e(nl),e(Vs),e(pl),e(Xs),e(Ml),e(rl),e(cl),e(vs)),e(a),w(j,s),w(B,s),w(v,s),w(E,s),w(F,s),w(z,s),w(S,s),w(D,s),w(ts,s),w(us,s),w(Js,s),w(bs,s),w(ps,s),w($s,s),w(_s,s),w(ks,s),w(Gs,s),w(Ms,s),w(rs,s),w(Rs,s),w(Ws,s),w(cs,s)}}}const ea='{"title":"객관식 문제","local":"multiple-choice","sections":[{"title":"SWAG 데이터 세트 가져오기","local":"load-swag-dataset","sections":[],"depth":2},{"title":"전처리","local":"preprocess","sections":[],"depth":2},{"title":"평가 하기","local":"evaluate","sections":[],"depth":2},{"title":"훈련 하기","local":"train","sections":[],"depth":2},{"title":"추론 하기","local":"inference","sections":[],"depth":2}],"depth":1}';function ta(C){return Xl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ia extends Wl{constructor(a){super(),Bl(this,a,ta,aa,Vl,{})}}export{ia as component};
