import{s as Il,o as Gl,n as Xs}from"../chunks/scheduler.bdbef820.js";import{S as Vl,i as Xl,g as J,s as M,r as j,A as Rl,h as U,f as t,c,j as _l,u as y,x as T,k as kl,y as Wl,a as e,v as h,d as u,t as d,w as f,m as Al,n as Bl}from"../chunks/index.33f81d56.js";import{T as il}from"../chunks/Tip.34194030.js";import{C as V}from"../chunks/CodeBlock.362b34a4.js";import{D as vl}from"../chunks/DocNotebookDropdown.d5db5928.js";import{F as ol,M as Ws}from"../chunks/Markdown.03194dea.js";import{H as Rs,E as Yl}from"../chunks/EditOnGithub.a9246e21.js";function xl(G){let a,m;return a=new V({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMHRyYW5zZm9ybWVycy50b2tlbml6YXRpb25fdXRpbHNfYmFzZSUyMGltcG9ydCUyMFByZVRyYWluZWRUb2tlbml6ZXJCYXNlJTJDJTIwUGFkZGluZ1N0cmF0ZWd5JTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSUwQSU0MGRhdGFjbGFzcyUwQWNsYXNzJTIwRGF0YUNvbGxhdG9yRm9yTXVsdGlwbGVDaG9pY2UlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBEYXRhJTIwY29sbGF0b3IlMjB0aGF0JTIwd2lsbCUyMGR5bmFtaWNhbGx5JTIwcGFkJTIwdGhlJTIwaW5wdXRzJTIwZm9yJTIwbXVsdGlwbGUlMjBjaG9pY2UlMjByZWNlaXZlZC4lMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0ElMjBQcmVUcmFpbmVkVG9rZW5pemVyQmFzZSUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0ElMjBVbmlvbiU1QmJvb2wlMkMlM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GFiZWxzJTIyJTVEJTIwJTNEJTIwdG9yY2gudGVuc29yKGxhYmVscyUyQyUyMGR0eXBlJTNEdG9yY2guaW50NjQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",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(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,o){h(a,l,o),m=!0},p:Xs,i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){d(a.$$.fragment,l),m=!1},d(l){f(a,l)}}}function Fl(G){let a,m;return a=new Ws({props:{$$slots:{default:[xl]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,o){h(a,l,o),m=!0},p(l,o){const w={};o&2&&(w.$$scope={dirty:o,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){d(a.$$.fragment,l),m=!1},d(l){f(a,l)}}}function zl(G){let a,m;return a=new V({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMHRyYW5zZm9ybWVycy50b2tlbml6YXRpb25fdXRpbHNfYmFzZSUyMGltcG9ydCUyMFByZVRyYWluZWRUb2tlbml6ZXJCYXNlJTJDJTIwUGFkZGluZ1N0cmF0ZWd5JTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQSUwQSU0MGRhdGFjbGFzcyUwQWNsYXNzJTIwRGF0YUNvbGxhdG9yRm9yTXVsdGlwbGVDaG9pY2UlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBEYXRhJTIwY29sbGF0b3IlMjB0aGF0JTIwd2lsbCUyMGR5bmFtaWNhbGx5JTIwcGFkJTIwdGhlJTIwaW5wdXRzJTIwZm9yJTIwbXVsdGlwbGUlMjBjaG9pY2UlMjByZWNlaXZlZC4lMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0ElMjBQcmVUcmFpbmVkVG9rZW5pemVyQmFzZSUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0ElMjBVbmlvbiU1QmJvb2wlM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jAlMjBiYXRjaCU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMHRmLmNvbnZlcnRfdG9fdGVuc29yKGxhYmVscyUyQyUyMGR0eXBlJTNEdGYuaW50NjQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",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(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,o){h(a,l,o),m=!0},p:Xs,i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){d(a.$$.fragment,l),m=!1},d(l){f(a,l)}}}function Nl(G){let a,m;return a=new Ws({props:{$$slots:{default:[zl]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,o){h(a,l,o),m=!0},p(l,o){const w={};o&2&&(w.$$scope={dirty:o,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){d(a.$$.fragment,l),m=!1},d(l){f(a,l)}}}function El(G){let a,m='<a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer">Trainer</a>로 모델을 미세 조정하는 데 익숙하지 않다면 기본 튜토리얼 <a href="../training#train-with-pytorch-trainer">여기</a>를 살펴보세요!';return{c(){a=J("p"),a.innerHTML=m},l(l){a=U(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-1128228"&&(a.innerHTML=m)},m(l,o){e(l,a,o)},p:Xs,d(l){l&&t(a)}}}function Ql(G){let a,m,l,o='이제 모델 훈련을 시작할 준비가 되었습니다! <a href="/docs/transformers/pr_30530/ko/model_doc/auto#transformers.AutoModelForMultipleChoice">AutoModelForMultipleChoice</a>로 BERT를 로드합니다:',w,C,A,k,Z="이제 세 단계만 남았습니다:",R,_,B='<li>훈련 하이퍼파라미터를 <a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>에 정의합니다. 유일한 필수 매개변수는 모델을 저장할 위치를 지정하는 <code>output_dir</code>입니다. <code>push_to_hub=True</code>를 설정하여 이 모델을 허브에 푸시합니다(모델을 업로드하려면 허깅 페이스에 로그인해야 합니다). 각 에폭이 끝날 때마다 <a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer">Trainer</a>가 정확도를 평가하고 훈련 체크포인트를 저장합니다.</li> <li>모델, 데이터 세트, 토크나이저, 데이터 콜레이터, <code>compute_metrics</code> 함수와 함께 훈련 인자를 <a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer">Trainer</a>에 전달합니다.</li> <li><a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer.train">train()</a>을 사용하여 모델을 미세 조정합니다.</li>',W,$,I,r,g='훈련이 완료되면 모든 사람이 모델을 사용할 수 있도록 <a href="/docs/transformers/pr_30530/ko/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> 메소드를 사용하여 모델을 허브에 공유하세요:',v,F,x;return a=new il({props:{$$slots:{default:[El]},$$scope:{ctx:G}}}),C=new V({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvck11bHRpcGxlQ2hvaWNlJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMkMlMjBUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtdW5jYXNlZCUyMik=",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;google-bert/bert-base-uncased&quot;</span>)`,wrap:!1}}),$=new V({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX3N3YWdfbW9kZWwlMjIlMkMlMEElMjAlMjAlMjAlMjBldmFsX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjA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="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>    eval_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>    processing_class=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}}),F=new V({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){j(a.$$.fragment),m=M(),l=J("p"),l.innerHTML=o,w=M(),j(C.$$.fragment),A=M(),k=J("p"),k.textContent=Z,R=M(),_=J("ol"),_.innerHTML=B,W=M(),j($.$$.fragment),I=M(),r=J("p"),r.innerHTML=g,v=M(),j(F.$$.fragment)},l(i){y(a.$$.fragment,i),m=c(i),l=U(i,"P",{"data-svelte-h":!0}),T(l)!=="svelte-1ourrmj"&&(l.innerHTML=o),w=c(i),y(C.$$.fragment,i),A=c(i),k=U(i,"P",{"data-svelte-h":!0}),T(k)!=="svelte-1vwg7jz"&&(k.textContent=Z),R=c(i),_=U(i,"OL",{"data-svelte-h":!0}),T(_)!=="svelte-168r0ha"&&(_.innerHTML=B),W=c(i),y($.$$.fragment,i),I=c(i),r=U(i,"P",{"data-svelte-h":!0}),T(r)!=="svelte-1pf6g82"&&(r.innerHTML=g),v=c(i),y(F.$$.fragment,i)},m(i,X){h(a,i,X),e(i,m,X),e(i,l,X),e(i,w,X),h(C,i,X),e(i,A,X),e(i,k,X),e(i,R,X),e(i,_,X),e(i,W,X),h($,i,X),e(i,I,X),e(i,r,X),e(i,v,X),h(F,i,X),x=!0},p(i,X){const Y={};X&2&&(Y.$$scope={dirty:X,ctx:i}),a.$set(Y)},i(i){x||(u(a.$$.fragment,i),u(C.$$.fragment,i),u($.$$.fragment,i),u(F.$$.fragment,i),x=!0)},o(i){d(a.$$.fragment,i),d(C.$$.fragment,i),d($.$$.fragment,i),d(F.$$.fragment,i),x=!1},d(i){i&&(t(m),t(l),t(w),t(A),t(k),t(R),t(_),t(W),t(I),t(r),t(v)),f(a,i),f(C,i),f($,i),f(F,i)}}}function Hl(G){let a,m;return a=new Ws({props:{$$slots:{default:[Ql]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,o){h(a,l,o),m=!0},p(l,o){const w={};o&2&&(w.$$scope={dirty:o,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){d(a.$$.fragment,l),m=!1},d(l){f(a,l)}}}function Sl(G){let a,m='Keras로 모델을 미세 조정하는 데 익숙하지 않다면 기본 튜토리얼 <a href="../training#train-a-tensorflow-model-with-keras">여기</a>를 살펴보시기 바랍니다!';return{c(){a=J("p"),a.innerHTML=m},l(l){a=U(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-16zjqtu"&&(a.innerHTML=m)},m(l,o){e(l,a,o)},p:Xs,d(l){l&&t(a)}}}function ql(G){let a,m,l,o,w,C='그리고 <a href="/docs/transformers/pr_30530/ko/model_doc/auto#transformers.TFAutoModelForMultipleChoice">TFAutoModelForMultipleChoice</a>로 BERT를 가져올 수 있습니다:',A,k,Z,R,_='<a href="/docs/transformers/pr_30530/ko/main_classes/model#transformers.TFPreTrainedModel.prepare_tf_dataset">prepare_tf_dataset()</a>을 사용하여 데이터 세트를 <code>tf.data.Dataset</code> 형식으로 변환합니다:',B,W,$,I,r='<a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>을 사용하여 훈련 모델을 구성합니다:',g,v,F,x,i='훈련을 시작하기 전에 설정해야 할 마지막 두 가지는 예측의 정확도를 계산하고 모델을 허브로 푸시하는 방법을 제공하는 것입니다. 이 두 가지 작업은 모두 <a href="../main_classes/keras_callbacks">Keras 콜백</a>을 사용하여 수행할 수 있습니다.',X,Y,As='<code>compute_metrics</code>함수를 <a href="/docs/transformers/pr_30530/ko/main_classes/keras_callbacks#transformers.KerasMetricCallback">KerasMetricCallback</a>에 전달하세요:',ss,z,ls,N,ms='모델과 토크나이저를 업로드할 위치를 <a href="/docs/transformers/pr_30530/ko/main_classes/keras_callbacks#transformers.PushToHubCallback">PushToHubCallback</a>에서 지정하세요:',S,D,as,E,os="그리고 콜백을 함께 묶습니다:",q,P,ts,Q,is='이제 모델 훈련을 시작합니다! 훈련 및 검증 데이터 세트, 에폭 수, 콜백을 사용하여 <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a>을 호출하고 모델을 미세 조정합니다:',L,K,es,H,Bs="훈련이 완료되면 모델이 자동으로 허브에 업로드되어 누구나 사용할 수 있습니다!",ns;return a=new il({props:{$$slots:{default:[Sl]},$$scope:{ctx:G}}}),l=new V({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}}),k=new V({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yTXVsdGlwbGVDaG9pY2UlMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLXVuY2FzZWQlMjIp",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;google-bert/bert-base-uncased&quot;</span>)`,wrap:!1}}),W=new V({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 V({props:{code:"bW9kZWwuY29tcGlsZShvcHRpbWl6ZXIlM0RvcHRpbWl6ZXIp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)',wrap:!1}}),z=new V({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}}),D=new V({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}}),P=new V({props:{code:"Y2FsbGJhY2tzJTIwJTNEJTIwJTVCbWV0cmljX2NhbGxiYWNrJTJDJTIwcHVzaF90b19odWJfY2FsbGJhY2slNUQ=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>callbacks = [metric_callback, push_to_hub_callback]',wrap:!1}}),K=new V({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(){j(a.$$.fragment),m=Al(`
TensorFlow에서 모델을 미세 조정하려면 최적화 함수, 학습률 스케쥴 및 몇 가지 학습 하이퍼파라미터를 설정하는 것부터 시작하세요:

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

	`),y(l.$$.fragment,n),o=c(n),w=U(n,"P",{"data-svelte-h":!0}),T(w)!=="svelte-11gygyy"&&(w.innerHTML=C),A=c(n),y(k.$$.fragment,n),Z=c(n),R=U(n,"P",{"data-svelte-h":!0}),T(R)!=="svelte-sc7int"&&(R.innerHTML=_),B=c(n),y(W.$$.fragment,n),$=c(n),I=U(n,"P",{"data-svelte-h":!0}),T(I)!=="svelte-qo1enf"&&(I.innerHTML=r),g=c(n),y(v.$$.fragment,n),F=c(n),x=U(n,"P",{"data-svelte-h":!0}),T(x)!=="svelte-1nxoekh"&&(x.innerHTML=i),X=c(n),Y=U(n,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-1o684oa"&&(Y.innerHTML=As),ss=c(n),y(z.$$.fragment,n),ls=c(n),N=U(n,"P",{"data-svelte-h":!0}),T(N)!=="svelte-u4vpfo"&&(N.innerHTML=ms),S=c(n),y(D.$$.fragment,n),as=c(n),E=U(n,"P",{"data-svelte-h":!0}),T(E)!=="svelte-ernkdu"&&(E.textContent=os),q=c(n),y(P.$$.fragment,n),ts=c(n),Q=U(n,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-1illf6u"&&(Q.innerHTML=is),L=c(n),y(K.$$.fragment,n),es=c(n),H=U(n,"P",{"data-svelte-h":!0}),T(H)!=="svelte-ymmthz"&&(H.textContent=Bs)},m(n,b){h(a,n,b),e(n,m,b),h(l,n,b),e(n,o,b),e(n,w,b),e(n,A,b),h(k,n,b),e(n,Z,b),e(n,R,b),e(n,B,b),h(W,n,b),e(n,$,b),e(n,I,b),e(n,g,b),h(v,n,b),e(n,F,b),e(n,x,b),e(n,X,b),e(n,Y,b),e(n,ss,b),h(z,n,b),e(n,ls,b),e(n,N,b),e(n,S,b),h(D,n,b),e(n,as,b),e(n,E,b),e(n,q,b),h(P,n,b),e(n,ts,b),e(n,Q,b),e(n,L,b),h(K,n,b),e(n,es,b),e(n,H,b),ns=!0},p(n,b){const O={};b&2&&(O.$$scope={dirty:b,ctx:n}),a.$set(O)},i(n){ns||(u(a.$$.fragment,n),u(l.$$.fragment,n),u(k.$$.fragment,n),u(W.$$.fragment,n),u(v.$$.fragment,n),u(z.$$.fragment,n),u(D.$$.fragment,n),u(P.$$.fragment,n),u(K.$$.fragment,n),ns=!0)},o(n){d(a.$$.fragment,n),d(l.$$.fragment,n),d(k.$$.fragment,n),d(W.$$.fragment,n),d(v.$$.fragment,n),d(z.$$.fragment,n),d(D.$$.fragment,n),d(P.$$.fragment,n),d(K.$$.fragment,n),ns=!1},d(n){n&&(t(m),t(o),t(w),t(A),t(Z),t(R),t(B),t($),t(I),t(g),t(F),t(x),t(X),t(Y),t(ss),t(ls),t(N),t(S),t(as),t(E),t(q),t(ts),t(Q),t(L),t(es),t(H)),f(a,n),f(l,n),f(k,n),f(W,n),f(v,n),f(z,n),f(D,n),f(P,n),f(K,n)}}}function Ll(G){let a,m;return a=new Ws({props:{$$slots:{default:[ql]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,o){h(a,l,o),m=!0},p(l,o){const w={};o&2&&(w.$$scope={dirty:o,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){d(a.$$.fragment,l),m=!1},d(l){f(a,l)}}}function Dl(G){let a,m=`객관식 모델을 미세 조정하는 방법에 대한 보다 심층적인 예는 아래 문서를 참조하세요.
<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=m},l(l){a=U(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-i06vpg"&&(a.innerHTML=m)},m(l,o){e(l,a,o)},p:Xs,d(l){l&&t(a)}}}function Pl(G){let a,m="각 프롬프트와 후보 답변 쌍을 토큰화하여 PyTorch 텐서를 반환합니다. 또한 <code>labels</code>을 생성해야 합니다:",l,o,w,C,A="입력과 레이블을 모델에 전달하고 <code>logits</code>을 반환합니다:",k,Z,R,_,B="가장 높은 확률을 가진 클래스를 가져옵니다:",W,$,I;return o=new V({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 V({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 V({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=m,l=M(),j(o.$$.fragment),w=M(),C=J("p"),C.innerHTML=A,k=M(),j(Z.$$.fragment),R=M(),_=J("p"),_.textContent=B,W=M(),j($.$$.fragment)},l(r){a=U(r,"P",{"data-svelte-h":!0}),T(a)!=="svelte-35m9oi"&&(a.innerHTML=m),l=c(r),y(o.$$.fragment,r),w=c(r),C=U(r,"P",{"data-svelte-h":!0}),T(C)!=="svelte-x6lqnk"&&(C.innerHTML=A),k=c(r),y(Z.$$.fragment,r),R=c(r),_=U(r,"P",{"data-svelte-h":!0}),T(_)!=="svelte-for6x5"&&(_.textContent=B),W=c(r),y($.$$.fragment,r)},m(r,g){e(r,a,g),e(r,l,g),h(o,r,g),e(r,w,g),e(r,C,g),e(r,k,g),h(Z,r,g),e(r,R,g),e(r,_,g),e(r,W,g),h($,r,g),I=!0},p:Xs,i(r){I||(u(o.$$.fragment,r),u(Z.$$.fragment,r),u($.$$.fragment,r),I=!0)},o(r){d(o.$$.fragment,r),d(Z.$$.fragment,r),d($.$$.fragment,r),I=!1},d(r){r&&(t(a),t(l),t(w),t(C),t(k),t(R),t(_),t(W)),f(o,r),f(Z,r),f($,r)}}}function Kl(G){let a,m;return a=new Ws({props:{$$slots:{default:[Pl]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,o){h(a,l,o),m=!0},p(l,o){const w={};o&2&&(w.$$scope={dirty:o,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){d(a.$$.fragment,l),m=!1},d(l){f(a,l)}}}function Ol(G){let a,m="각 프롬프트와 후보 답안 쌍을 토큰화하여 텐서플로 텐서를 반환합니다:",l,o,w,C,A="모델에 입력을 전달하고 <code>logits</code>를 반환합니다:",k,Z,R,_,B="가장 높은 확률을 가진 클래스를 가져옵니다:",W,$,I;return o=new V({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 V({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 V({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=m,l=M(),j(o.$$.fragment),w=M(),C=J("p"),C.innerHTML=A,k=M(),j(Z.$$.fragment),R=M(),_=J("p"),_.textContent=B,W=M(),j($.$$.fragment)},l(r){a=U(r,"P",{"data-svelte-h":!0}),T(a)!=="svelte-1dzr36c"&&(a.textContent=m),l=c(r),y(o.$$.fragment,r),w=c(r),C=U(r,"P",{"data-svelte-h":!0}),T(C)!=="svelte-t69k4k"&&(C.innerHTML=A),k=c(r),y(Z.$$.fragment,r),R=c(r),_=U(r,"P",{"data-svelte-h":!0}),T(_)!=="svelte-for6x5"&&(_.textContent=B),W=c(r),y($.$$.fragment,r)},m(r,g){e(r,a,g),e(r,l,g),h(o,r,g),e(r,w,g),e(r,C,g),e(r,k,g),h(Z,r,g),e(r,R,g),e(r,_,g),e(r,W,g),h($,r,g),I=!0},p:Xs,i(r){I||(u(o.$$.fragment,r),u(Z.$$.fragment,r),u($.$$.fragment,r),I=!0)},o(r){d(o.$$.fragment,r),d(Z.$$.fragment,r),d($.$$.fragment,r),I=!1},d(r){r&&(t(a),t(l),t(w),t(C),t(k),t(R),t(_),t(W)),f(o,r),f(Z,r),f($,r)}}}function sa(G){let a,m;return a=new Ws({props:{$$slots:{default:[Ol]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,o){h(a,l,o),m=!0},p(l,o){const w={};o&2&&(w.$$scope={dirty:o,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){d(a.$$.fragment,l),m=!1},d(l){f(a,l)}}}function la(G){let a,m,l,o,w,C,A,k,Z,R="객관식 과제는 문맥과 함께 여러 개의 후보 답변이 제공되고 모델이 정답을 선택하도록 학습된다는 점을 제외하면 질의응답과 유사합니다.",_,B,W="진행하는 방법은 아래와 같습니다:",$,I,r='<li><a href="https://huggingface.co/datasets/swag" rel="nofollow">SWAG</a> 데이터 세트의 ‘regular’ 구성으로 <a href="https://huggingface.co/google-bert/bert-base-uncased" rel="nofollow">BERT</a>를 미세 조정하여 여러 옵션과 일부 컨텍스트가 주어졌을 때 가장 적합한 답을 선택합니다.</li> <li>추론에 미세 조정된 모델을 사용합니다.</li>',g,v,F="시작하기 전에 필요한 라이브러리가 모두 설치되어 있는지 확인하세요:",x,i,X,Y,As="모델을 업로드하고 커뮤니티와 공유할 수 있도록 허깅페이스 계정에 로그인하는 것이 좋습니다. 메시지가 표시되면 토큰을 입력하여 로그인합니다:",ss,z,ls,N,ms,S,D="먼저 🤗 Datasets  라이브러리에서 SWAG 데이터셋의 ‘일반’ 구성을 가져옵니다:",as,E,os,q,P="이제 데이터를 살펴봅니다:",ts,Q,is,L,K="여기에는 많은 필드가 있는 것처럼 보이지만 실제로는 매우 간단합니다:",es,H,Bs="<li><code>sent1</code> 및 <code>sent2</code>: 이 필드는 문장이 어떻게 시작되는지 보여주며, 이 두 필드를 합치면 <code>시작 구절(startphrase)</code> 필드가 됩니다.</li> <li><code>종료 구절(ending)</code>: 문장이 어떻게 끝날 수 있는지에 대한 가능한 종료 구절를 제시하지만 그 중 하나만 정답입니다.</li> <li><code>레이블(label)</code>: 올바른 문장 종료 구절을 식별합니다.</li>",ns,n,b,O,jl="다음 단계는 문장의 시작과 네 가지 가능한 구절을 처리하기 위해 BERT 토크나이저를 불러옵니다:",Ys,js,xs,ys,yl="생성하려는 전처리 함수는 다음과 같아야 합니다:",Fs,hs,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>",zs,us,Ns,ds,ul="전체 데이터 집합에 전처리 기능을 적용하려면 🤗 Datasets <code>map</code> 메소드를 사용합니다. <code>batched=True</code>를 설정하여 데이터 집합의 여러 요소를 한 번에 처리하면 <code>map</code> 함수의 속도를 높일 수 있습니다:",Es,fs,Qs,ws,dl='🤗 Transformers에는 객관식용 데이터 콜레이터가 없으므로 예제 배치를 만들려면 <a href="/docs/transformers/pr_30530/ko/main_classes/data_collator#transformers.DataCollatorWithPadding">DataCollatorWithPadding</a>을 조정해야 합니다. 데이터 정렬 중에 전체 데이터 집합을 최대 길이로 패딩하는 대신 배치 중 가장 긴 길이로 문장을 <em>동적 패딩</em>하는 것이 더 효율적입니다.',Hs,Js,fl="<code>DataCollatorForMultipleChoice</code>는 모든 모델 입력을 평탄화하고 패딩을 적용하며 그 결과를 결과를 다차원화합니다:",Ss,ps,qs,Us,Ls,bs,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>를 참조하여 지표를 가져오고 계산하는 방법에 대해 자세히 알아보세요):',Ds,Ts,Ps,gs,Jl="그리고 예측과 레이블을 <code>compute</code>에 전달하여 정확도를 계산하는 함수를 만듭니다:",Ks,$s,Os,Cs,Ul="이제 <code>compute_metrics</code> 함수를 사용할 준비가 되었으며, 훈련을 설정할 때 이 함수로 돌아가게 됩니다.",sl,Zs,ll,rs,al,Ms,tl,_s,el,ks,bl="이제 모델을 미세 조정했으니 추론에 사용할 수 있습니다!",nl,Is,Tl="텍스트와 두 개의 후보 답안을 작성합니다:",pl,Gs,rl,cs,Ml,Vs,cl,vs,ml;return w=new Rs({props:{title:"객관식 문제",local:"multiple-choice",headingTag:"h1"}}),A=new vl({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"}]}}),i=new V({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGU=",highlighted:"pip install transformers datasets evaluate",wrap:!1}}),z=new V({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

<span class="hljs-meta">&gt;&gt;&gt; </span>notebook_login()`,wrap:!1}}),N=new Rs({props:{title:"SWAG 데이터 세트 가져오기",local:"load-swag-dataset",headingTag:"h2"}}),E=new V({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}}),Q=new V({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}}),n=new Rs({props:{title:"전처리",local:"preprocess",headingTag:"h2"}}),js=new V({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUtYmVydCUyRmJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",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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CUyMCUyMCUyMHRva2VuaXplZF9leGFtcGxlcyUyMCUzRCUyMHRva2VuaXplcihmaXJzdF9zZW50ZW5jZXMlMkMlMjBzZWNvbmRfc2VudGVuY2VzJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCayUzQSUyMCU1QnYlNUJpJTIwJTNBJTIwaSUyMCUyQiUyMDQlNUQlMjBmb3IlMjBpJTIwaW4lMjByYW5nZSgwJTJDJTIwbGVuKHYpJTJDJTIwNCklNUQlMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwdG9rZW5pemVkX2V4YW1wbGVzLml0ZW1zKCklN0Q=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>ending_names = [<span class="hljs-string">&quot;ending0&quot;</span>, <span class="hljs-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}}),fs=new V({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 ol({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Nl],pytorch:[Fl]},$$scope:{ctx:G}}}),Us=new Rs({props:{title:"평가 하기",local:"evaluate",headingTag:"h2"}}),Ts=new V({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}}),$s=new V({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}}),Zs=new Rs({props:{title:"훈련 하기",local:"train",headingTag:"h2"}}),rs=new ol({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ll],pytorch:[Hl]},$$scope:{ctx:G}}}),Ms=new il({props:{$$slots:{default:[Dl]},$$scope:{ctx:G}}}),_s=new Rs({props:{title:"추론 하기",local:"inference",headingTag:"h2"}}),Gs=new V({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 ol({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[sa],pytorch:[Kl]},$$scope:{ctx:G}}}),Vs=new Yl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/tasks/multiple_choice.md"}}),{c(){a=J("meta"),m=M(),l=J("p"),o=M(),j(w.$$.fragment),C=M(),j(A.$$.fragment),k=M(),Z=J("p"),Z.textContent=R,_=M(),B=J("p"),B.textContent=W,$=M(),I=J("ol"),I.innerHTML=r,g=M(),v=J("p"),v.textContent=F,x=M(),j(i.$$.fragment),X=M(),Y=J("p"),Y.textContent=As,ss=M(),j(z.$$.fragment),ls=M(),j(N.$$.fragment),ms=M(),S=J("p"),S.textContent=D,as=M(),j(E.$$.fragment),os=M(),q=J("p"),q.textContent=P,ts=M(),j(Q.$$.fragment),is=M(),L=J("p"),L.textContent=K,es=M(),H=J("ul"),H.innerHTML=Bs,ns=M(),j(n.$$.fragment),b=M(),O=J("p"),O.textContent=jl,Ys=M(),j(js.$$.fragment),xs=M(),ys=J("p"),ys.textContent=yl,Fs=M(),hs=J("ol"),hs.innerHTML=hl,zs=M(),j(us.$$.fragment),Ns=M(),ds=J("p"),ds.innerHTML=ul,Es=M(),j(fs.$$.fragment),Qs=M(),ws=J("p"),ws.innerHTML=dl,Hs=M(),Js=J("p"),Js.innerHTML=fl,Ss=M(),j(ps.$$.fragment),qs=M(),j(Us.$$.fragment),Ls=M(),bs=J("p"),bs.innerHTML=wl,Ds=M(),j(Ts.$$.fragment),Ps=M(),gs=J("p"),gs.innerHTML=Jl,Ks=M(),j($s.$$.fragment),Os=M(),Cs=J("p"),Cs.innerHTML=Ul,sl=M(),j(Zs.$$.fragment),ll=M(),j(rs.$$.fragment),al=M(),j(Ms.$$.fragment),tl=M(),j(_s.$$.fragment),el=M(),ks=J("p"),ks.textContent=bl,nl=M(),Is=J("p"),Is.textContent=Tl,pl=M(),j(Gs.$$.fragment),rl=M(),j(cs.$$.fragment),Ml=M(),j(Vs.$$.fragment),cl=M(),vs=J("p"),this.h()},l(s){const p=Rl("svelte-u9bgzb",document.head);a=U(p,"META",{name:!0,content:!0}),p.forEach(t),m=c(s),l=U(s,"P",{}),_l(l).forEach(t),o=c(s),y(w.$$.fragment,s),C=c(s),y(A.$$.fragment,s),k=c(s),Z=U(s,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-13wfm6g"&&(Z.textContent=R),_=c(s),B=U(s,"P",{"data-svelte-h":!0}),T(B)!=="svelte-10q09rv"&&(B.textContent=W),$=c(s),I=U(s,"OL",{"data-svelte-h":!0}),T(I)!=="svelte-1eak31y"&&(I.innerHTML=r),g=c(s),v=U(s,"P",{"data-svelte-h":!0}),T(v)!=="svelte-1k0z9pm"&&(v.textContent=F),x=c(s),y(i.$$.fragment,s),X=c(s),Y=U(s,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-c0su0x"&&(Y.textContent=As),ss=c(s),y(z.$$.fragment,s),ls=c(s),y(N.$$.fragment,s),ms=c(s),S=U(s,"P",{"data-svelte-h":!0}),T(S)!=="svelte-3ax2l8"&&(S.textContent=D),as=c(s),y(E.$$.fragment,s),os=c(s),q=U(s,"P",{"data-svelte-h":!0}),T(q)!=="svelte-z8zknl"&&(q.textContent=P),ts=c(s),y(Q.$$.fragment,s),is=c(s),L=U(s,"P",{"data-svelte-h":!0}),T(L)!=="svelte-uhrqn8"&&(L.textContent=K),es=c(s),H=U(s,"UL",{"data-svelte-h":!0}),T(H)!=="svelte-12h9927"&&(H.innerHTML=Bs),ns=c(s),y(n.$$.fragment,s),b=c(s),O=U(s,"P",{"data-svelte-h":!0}),T(O)!=="svelte-1ytvevd"&&(O.textContent=jl),Ys=c(s),y(js.$$.fragment,s),xs=c(s),ys=U(s,"P",{"data-svelte-h":!0}),T(ys)!=="svelte-dr5hbo"&&(ys.textContent=yl),Fs=c(s),hs=U(s,"OL",{"data-svelte-h":!0}),T(hs)!=="svelte-1ur4b3u"&&(hs.innerHTML=hl),zs=c(s),y(us.$$.fragment,s),Ns=c(s),ds=U(s,"P",{"data-svelte-h":!0}),T(ds)!=="svelte-1yi4yhv"&&(ds.innerHTML=ul),Es=c(s),y(fs.$$.fragment,s),Qs=c(s),ws=U(s,"P",{"data-svelte-h":!0}),T(ws)!=="svelte-1wi91xj"&&(ws.innerHTML=dl),Hs=c(s),Js=U(s,"P",{"data-svelte-h":!0}),T(Js)!=="svelte-q9au9u"&&(Js.innerHTML=fl),Ss=c(s),y(ps.$$.fragment,s),qs=c(s),y(Us.$$.fragment,s),Ls=c(s),bs=U(s,"P",{"data-svelte-h":!0}),T(bs)!=="svelte-fmkx3s"&&(bs.innerHTML=wl),Ds=c(s),y(Ts.$$.fragment,s),Ps=c(s),gs=U(s,"P",{"data-svelte-h":!0}),T(gs)!=="svelte-ezofyo"&&(gs.innerHTML=Jl),Ks=c(s),y($s.$$.fragment,s),Os=c(s),Cs=U(s,"P",{"data-svelte-h":!0}),T(Cs)!=="svelte-7zql7p"&&(Cs.innerHTML=Ul),sl=c(s),y(Zs.$$.fragment,s),ll=c(s),y(rs.$$.fragment,s),al=c(s),y(Ms.$$.fragment,s),tl=c(s),y(_s.$$.fragment,s),el=c(s),ks=U(s,"P",{"data-svelte-h":!0}),T(ks)!=="svelte-174wmmm"&&(ks.textContent=bl),nl=c(s),Is=U(s,"P",{"data-svelte-h":!0}),T(Is)!=="svelte-1h2wndb"&&(Is.textContent=Tl),pl=c(s),y(Gs.$$.fragment,s),rl=c(s),y(cs.$$.fragment,s),Ml=c(s),y(Vs.$$.fragment,s),cl=c(s),vs=U(s,"P",{}),_l(vs).forEach(t),this.h()},h(){kl(a,"name","hf:doc:metadata"),kl(a,"content",aa)},m(s,p){Wl(document.head,a),e(s,m,p),e(s,l,p),e(s,o,p),h(w,s,p),e(s,C,p),h(A,s,p),e(s,k,p),e(s,Z,p),e(s,_,p),e(s,B,p),e(s,$,p),e(s,I,p),e(s,g,p),e(s,v,p),e(s,x,p),h(i,s,p),e(s,X,p),e(s,Y,p),e(s,ss,p),h(z,s,p),e(s,ls,p),h(N,s,p),e(s,ms,p),e(s,S,p),e(s,as,p),h(E,s,p),e(s,os,p),e(s,q,p),e(s,ts,p),h(Q,s,p),e(s,is,p),e(s,L,p),e(s,es,p),e(s,H,p),e(s,ns,p),h(n,s,p),e(s,b,p),e(s,O,p),e(s,Ys,p),h(js,s,p),e(s,xs,p),e(s,ys,p),e(s,Fs,p),e(s,hs,p),e(s,zs,p),h(us,s,p),e(s,Ns,p),e(s,ds,p),e(s,Es,p),h(fs,s,p),e(s,Qs,p),e(s,ws,p),e(s,Hs,p),e(s,Js,p),e(s,Ss,p),h(ps,s,p),e(s,qs,p),h(Us,s,p),e(s,Ls,p),e(s,bs,p),e(s,Ds,p),h(Ts,s,p),e(s,Ps,p),e(s,gs,p),e(s,Ks,p),h($s,s,p),e(s,Os,p),e(s,Cs,p),e(s,sl,p),h(Zs,s,p),e(s,ll,p),h(rs,s,p),e(s,al,p),h(Ms,s,p),e(s,tl,p),h(_s,s,p),e(s,el,p),e(s,ks,p),e(s,nl,p),e(s,Is,p),e(s,pl,p),h(Gs,s,p),e(s,rl,p),h(cs,s,p),e(s,Ml,p),h(Vs,s,p),e(s,cl,p),e(s,vs,p),ml=!0},p(s,[p]){const gl={};p&2&&(gl.$$scope={dirty:p,ctx:s}),ps.$set(gl);const $l={};p&2&&($l.$$scope={dirty:p,ctx:s}),rs.$set($l);const Cl={};p&2&&(Cl.$$scope={dirty:p,ctx:s}),Ms.$set(Cl);const Zl={};p&2&&(Zl.$$scope={dirty:p,ctx:s}),cs.$set(Zl)},i(s){ml||(u(w.$$.fragment,s),u(A.$$.fragment,s),u(i.$$.fragment,s),u(z.$$.fragment,s),u(N.$$.fragment,s),u(E.$$.fragment,s),u(Q.$$.fragment,s),u(n.$$.fragment,s),u(js.$$.fragment,s),u(us.$$.fragment,s),u(fs.$$.fragment,s),u(ps.$$.fragment,s),u(Us.$$.fragment,s),u(Ts.$$.fragment,s),u($s.$$.fragment,s),u(Zs.$$.fragment,s),u(rs.$$.fragment,s),u(Ms.$$.fragment,s),u(_s.$$.fragment,s),u(Gs.$$.fragment,s),u(cs.$$.fragment,s),u(Vs.$$.fragment,s),ml=!0)},o(s){d(w.$$.fragment,s),d(A.$$.fragment,s),d(i.$$.fragment,s),d(z.$$.fragment,s),d(N.$$.fragment,s),d(E.$$.fragment,s),d(Q.$$.fragment,s),d(n.$$.fragment,s),d(js.$$.fragment,s),d(us.$$.fragment,s),d(fs.$$.fragment,s),d(ps.$$.fragment,s),d(Us.$$.fragment,s),d(Ts.$$.fragment,s),d($s.$$.fragment,s),d(Zs.$$.fragment,s),d(rs.$$.fragment,s),d(Ms.$$.fragment,s),d(_s.$$.fragment,s),d(Gs.$$.fragment,s),d(cs.$$.fragment,s),d(Vs.$$.fragment,s),ml=!1},d(s){s&&(t(m),t(l),t(o),t(C),t(k),t(Z),t(_),t(B),t($),t(I),t(g),t(v),t(x),t(X),t(Y),t(ss),t(ls),t(ms),t(S),t(as),t(os),t(q),t(ts),t(is),t(L),t(es),t(H),t(ns),t(b),t(O),t(Ys),t(xs),t(ys),t(Fs),t(hs),t(zs),t(Ns),t(ds),t(Es),t(Qs),t(ws),t(Hs),t(Js),t(Ss),t(qs),t(Ls),t(bs),t(Ds),t(Ps),t(gs),t(Ks),t(Os),t(Cs),t(sl),t(ll),t(al),t(tl),t(el),t(ks),t(nl),t(Is),t(pl),t(rl),t(Ml),t(cl),t(vs)),t(a),f(w,s),f(A,s),f(i,s),f(z,s),f(N,s),f(E,s),f(Q,s),f(n,s),f(js,s),f(us,s),f(fs,s),f(ps,s),f(Us,s),f(Ts,s),f($s,s),f(Zs,s),f(rs,s),f(Ms,s),f(_s,s),f(Gs,s),f(cs,s),f(Vs,s)}}}const aa='{"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(G){return Gl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class oa extends Vl{constructor(a){super(),Xl(this,a,ta,la,Il,{})}}export{oa as component};
