import{s as Il,o as Gl,n as Xs}from"../chunks/scheduler.56730f09.js";import{S as Vl,i as Xl,g as J,s as c,r as j,A as Rl,h as U,f as t,c as m,j as kl,u as y,x as T,k as _l,y as Wl,a as e,v as h,d as u,t as d,w,m as Bl,n as Al}from"../chunks/index.1f144517.js";import{T as ol}from"../chunks/Tip.41e845e5.js";import{C as V}from"../chunks/CodeBlock.738eeccb.js";import{D as vl}from"../chunks/DocNotebookDropdown.243c3df7.js";import{F as il,M as Ws}from"../chunks/Markdown.3289e0dc.js";import{H as Rs,E as Yl}from"../chunks/EditOnGithub.854793f1.js";function xl(G){let a,r;return a=new V({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMHRyYW5zZm9ybWVycy50b2tlbml6YXRpb25fdXRpbHNfYmFzZSUyMGltcG9ydCUyMFByZVRyYWluZWRUb2tlbml6ZXJCYXNlJTJDJTIwUGFkZGluZ1N0cmF0ZWd5JTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSUwQSU0MGRhdGFjbGFzcyUwQWNsYXNzJTIwRGF0YUNvbGxhdG9yRm9yTXVsdGlwbGVDaG9pY2UlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBEYXRhJTIwY29sbGF0b3IlMjB0aGF0JTIwd2lsbCUyMGR5bmFtaWNhbGx5JTIwcGFkJTIwdGhlJTIwaW5wdXRzJTIwZm9yJTIwbXVsdGlwbGUlMjBjaG9pY2UlMjByZWNlaXZlZC4lMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0ElMjBQcmVUcmFpbmVkVG9rZW5pemVyQmFzZSUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0ElMjBVbmlvbiU1QmJvb2wlMkMlMjBzdHIlMkMlMjBQYWRkaW5nU3RyYXRlZ3klNUQlMjAlM0QlMjBUcnVlJTBBJTIwJTIwJTIwJTIwbWF4X2xlbmd0aCUzQSUyME9wdGlvbmFsJTVCaW50JTVEJTIwJTNEJTIwTm9uZSUwQSUyMCUyMCUyMCUyMHBhZF90b19tdWx0aXBsZV9vZiUzQSUyME9wdGlvbmFsJTVCaW50JTVEJTIwJTNEJTIwTm9uZSUwQSUwQSUyMCUyMCUyMCUyMGRlZiUyMF9fY2FsbF9fKHNlbGYlMkMlMjBmZWF0dXJlcyklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsYWJlbF9uYW1lJTIwJTNEJTIwJTIybGFiZWwlMjIlMjBpZiUyMCUyMmxhYmVsJTIyJTIwaW4lMjBmZWF0dXJlcyU1QjAlNUQua2V5cygpJTIwZWxzZSUyMCUyMmxhYmVscyUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxhYmVscyUyMCUzRCUyMCU1QmZlYXR1cmUucG9wKGxhYmVsX25hbWUpJTIwZm9yJTIwZmVhdHVyZSUyMGluJTIwZmVhdHVyZXMlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBiYXRjaF9zaXplJTIwJTNEJTIwbGVuKGZlYXR1cmVzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG51bV9jaG9pY2VzJTIwJTNEJTIwbGVuKGZlYXR1cmVzJTVCMCU1RCU1QiUyMmlucHV0X2lkcyUyMiU1RCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmbGF0dGVuZWRfZmVhdHVyZXMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIlN0JrJTNBJTIwdiU1QmklNUQlMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwZmVhdHVyZS5pdGVtcygpJTdEJTIwZm9yJTIwaSUyMGluJTIwcmFuZ2UobnVtX2Nob2ljZXMpJTVEJTIwZm9yJTIwZmVhdHVyZSUyMGluJTIwZmVhdHVyZXMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmbGF0dGVuZWRfZmVhdHVyZXMlMjAlM0QlMjBzdW0oZmxhdHRlbmVkX2ZlYXR1cmVzJTJDJTIwJTVCJTVEKSUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJhdGNoJTIwJTNEJTIwc2VsZi50b2tlbml6ZXIucGFkKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZsYXR0ZW5lZF9mZWF0dXJlcyUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHBhZGRpbmclM0RzZWxmLnBhZGRpbmclMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtYXhfbGVuZ3RoJTNEc2VsZi5tYXhfbGVuZ3RoJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcGFkX3RvX211bHRpcGxlX29mJTNEc2VsZi5wYWRfdG9fbXVsdGlwbGVfb2YlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJhdGNoJTIwJTNEJTIwJTdCayUzQSUyMHYudmlldyhiYXRjaF9zaXplJTJDJTIwbnVtX2Nob2ljZXMlMkMlMjAtMSklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwYmF0Y2guaXRlbXMoKSU3RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJhdGNoJTVCJTIybGFiZWxzJTIyJTVEJTIwJTNEJTIwdG9yY2gudGVuc29yKGxhYmVscyUyQyUyMGR0eXBlJTNEdG9yY2guaW50NjQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",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,i){h(a,l,i),r=!0},p:Xs,i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){d(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function Fl(G){let a,r;return a=new Ws({props:{$$slots:{default:[xl]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),r=!0},p(l,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:l}),a.$set(f)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){d(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function zl(G){let a,r;return a=new V({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMHRyYW5zZm9ybWVycy50b2tlbml6YXRpb25fdXRpbHNfYmFzZSUyMGltcG9ydCUyMFByZVRyYWluZWRUb2tlbml6ZXJCYXNlJTJDJTIwUGFkZGluZ1N0cmF0ZWd5JTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQSUwQSU0MGRhdGFjbGFzcyUwQWNsYXNzJTIwRGF0YUNvbGxhdG9yRm9yTXVsdGlwbGVDaG9pY2UlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBEYXRhJTIwY29sbGF0b3IlMjB0aGF0JTIwd2lsbCUyMGR5bmFtaWNhbGx5JTIwcGFkJTIwdGhlJTIwaW5wdXRzJTIwZm9yJTIwbXVsdGlwbGUlMjBjaG9pY2UlMjByZWNlaXZlZC4lMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0ElMjBQcmVUcmFpbmVkVG9rZW5pemVyQmFzZSUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0ElMjBVbmlvbiU1QmJvb2wlMkMlMjBzdHIlMkMlMjBQYWRkaW5nU3RyYXRlZ3klNUQlMjAlM0QlMjBUcnVlJTBBJTIwJTIwJTIwJTIwbWF4X2xlbmd0aCUzQSUyME9wdGlvbmFsJTVCaW50JTVEJTIwJTNEJTIwTm9uZSUwQSUyMCUyMCUyMCUyMHBhZF90b19tdWx0aXBsZV9vZiUzQSUyME9wdGlvbmFsJTVCaW50JTVEJTIwJTNEJTIwTm9uZSUwQSUwQSUyMCUyMCUyMCUyMGRlZiUyMF9fY2FsbF9fKHNlbGYlMkMlMjBmZWF0dXJlcyklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsYWJlbF9uYW1lJTIwJTNEJTIwJTIybGFiZWwlMjIlMjBpZiUyMCUyMmxhYmVsJTIyJTIwaW4lMjBmZWF0dXJlcyU1QjAlNUQua2V5cygpJTIwZWxzZSUyMCUyMmxhYmVscyUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxhYmVscyUyMCUzRCUyMCU1QmZlYXR1cmUucG9wKGxhYmVsX25hbWUpJTIwZm9yJTIwZmVhdHVyZSUyMGluJTIwZmVhdHVyZXMlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBiYXRjaF9zaXplJTIwJTNEJTIwbGVuKGZlYXR1cmVzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG51bV9jaG9pY2VzJTIwJTNEJTIwbGVuKGZlYXR1cmVzJTVCMCU1RCU1QiUyMmlucHV0X2lkcyUyMiU1RCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmbGF0dGVuZWRfZmVhdHVyZXMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIlN0JrJTNBJTIwdiU1QmklNUQlMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwZmVhdHVyZS5pdGVtcygpJTdEJTIwZm9yJTIwaSUyMGluJTIwcmFuZ2UobnVtX2Nob2ljZXMpJTVEJTIwZm9yJTIwZmVhdHVyZSUyMGluJTIwZmVhdHVyZXMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmbGF0dGVuZWRfZmVhdHVyZXMlMjAlM0QlMjBzdW0oZmxhdHRlbmVkX2ZlYXR1cmVzJTJDJTIwJTVCJTVEKSUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJhdGNoJTIwJTNEJTIwc2VsZi50b2tlbml6ZXIucGFkKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZsYXR0ZW5lZF9mZWF0dXJlcyUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHBhZGRpbmclM0RzZWxmLnBhZGRpbmclMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtYXhfbGVuZ3RoJTNEc2VsZi5tYXhfbGVuZ3RoJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcGFkX3RvX211bHRpcGxlX29mJTNEc2VsZi5wYWRfdG9fbXVsdGlwbGVfb2YlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJhdGNoJTIwJTNEJTIwJTdCayUzQSUyMHRmLnJlc2hhcGUodiUyQyUyMChiYXRjaF9zaXplJTJDJTIwbnVtX2Nob2ljZXMlMkMlMjAtMSkpJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGJhdGNoLml0ZW1zKCklN0QlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBiYXRjaCU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMHRmLmNvbnZlcnRfdG9fdGVuc29yKGxhYmVscyUyQyUyMGR0eXBlJTNEdGYuaW50NjQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",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,i){h(a,l,i),r=!0},p:Xs,i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){d(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function El(G){let a,r;return a=new Ws({props:{$$slots:{default:[zl]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),r=!0},p(l,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:l}),a.$set(f)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){d(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function Nl(G){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,i){e(l,a,i)},p:Xs,d(l){l&&t(a)}}}function Ql(G){let a,r,l,i="이제 모델 훈련을 시작할 준비가 되었습니다! <code>AutoModelForMultipleChoice</code>로 BERT를 로드합니다:",f,C,B,_,Z="이제 세 단계만 남았습니다:",R,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,$,I,M,g="훈련이 완료되면 모든 사람이 모델을 사용할 수 있도록 <code>push_to_hub()</code> 메소드를 사용하여 모델을 허브에 공유하세요:",v,F,x;return a=new ol({props:{$$slots:{default:[Nl]},$$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:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX3N3YWdfbW9kZWwlMjIlMkMlMEElMjAlMjAlMjAlMjBldmFsX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGxlYXJuaW5nX3JhdGUlM0Q1ZS01JTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3RyYWluX2Vwb2NocyUzRDMlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0R0b2tlbml6ZWRfc3dhZyU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEdG9rZW5pemVkX3N3YWclNUIlMjJ2YWxpZGF0aW9uJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemVyJTNEdG9rZW5pemVyJTJDJTBBJTIwJTIwJTIwJTIwZGF0YV9jb2xsYXRvciUzRERhdGFDb2xsYXRvckZvck11bHRpcGxlQ2hvaWNlKHRva2VuaXplciUzRHRva2VuaXplciklMkMlMEElMjAlMjAlMjAlMjBjb21wdXRlX21ldHJpY3MlM0Rjb21wdXRlX21ldHJpY3MlMkMlMEEpJTBBJTBBdHJhaW5lci50cmFpbigp",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>    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>    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}}),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),r=c(),l=J("p"),l.innerHTML=i,f=c(),j(C.$$.fragment),B=c(),_=J("p"),_.textContent=Z,R=c(),k=J("ol"),k.innerHTML=A,W=c(),j($.$$.fragment),I=c(),M=J("p"),M.innerHTML=g,v=c(),j(F.$$.fragment)},l(o){y(a.$$.fragment,o),r=m(o),l=U(o,"P",{"data-svelte-h":!0}),T(l)!=="svelte-1dl7gnk"&&(l.innerHTML=i),f=m(o),y(C.$$.fragment,o),B=m(o),_=U(o,"P",{"data-svelte-h":!0}),T(_)!=="svelte-1vwg7jz"&&(_.textContent=Z),R=m(o),k=U(o,"OL",{"data-svelte-h":!0}),T(k)!=="svelte-jig6dx"&&(k.innerHTML=A),W=m(o),y($.$$.fragment,o),I=m(o),M=U(o,"P",{"data-svelte-h":!0}),T(M)!=="svelte-yt6kqu"&&(M.innerHTML=g),v=m(o),y(F.$$.fragment,o)},m(o,X){h(a,o,X),e(o,r,X),e(o,l,X),e(o,f,X),h(C,o,X),e(o,B,X),e(o,_,X),e(o,R,X),e(o,k,X),e(o,W,X),h($,o,X),e(o,I,X),e(o,M,X),e(o,v,X),h(F,o,X),x=!0},p(o,X){const Y={};X&2&&(Y.$$scope={dirty:X,ctx:o}),a.$set(Y)},i(o){x||(u(a.$$.fragment,o),u(C.$$.fragment,o),u($.$$.fragment,o),u(F.$$.fragment,o),x=!0)},o(o){d(a.$$.fragment,o),d(C.$$.fragment,o),d($.$$.fragment,o),d(F.$$.fragment,o),x=!1},d(o){o&&(t(r),t(l),t(f),t(B),t(_),t(R),t(k),t(W),t(I),t(M),t(v)),w(a,o),w(C,o),w($,o),w(F,o)}}}function Hl(G){let a,r;return a=new Ws({props:{$$slots:{default:[Ql]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),r=!0},p(l,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:l}),a.$set(f)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){d(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function Sl(G){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,i){e(l,a,i)},p:Xs,d(l){l&&t(a)}}}function ql(G){let a,r,l,i,f,C="그리고 <code>TFAutoModelForMultipleChoice</code>로 BERT를 가져올 수 있습니다:",B,_,Z,R,k="<code>prepare_tf_dataset()</code>을 사용하여 데이터 세트를 <code>tf.data.Dataset</code> 형식으로 변환합니다:",A,W,$,I,M='<a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>을 사용하여 훈련 모델을 구성합니다:',g,v,F,x,o='훈련을 시작하기 전에 설정해야 할 마지막 두 가지는 예측의 정확도를 계산하고 모델을 허브로 푸시하는 방법을 제공하는 것입니다. 이 두 가지 작업은 모두 <a href="../main_classes/keras_callbacks">Keras 콜백</a>을 사용하여 수행할 수 있습니다.',X,Y,Bs="<code>compute_metrics</code>함수를 <code>KerasMetricCallback</code>에 전달하세요:",ss,z,ls,E,rs="모델과 토크나이저를 업로드할 위치를 <code>PushToHubCallback</code>에서 지정하세요:",S,D,as,N,is="그리고 콜백을 함께 묶습니다:",q,P,ts,Q,os='이제 모델 훈련을 시작합니다! 훈련 및 검증 데이터 세트, 에폭 수, 콜백을 사용하여 <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a>을 호출하고 모델을 미세 조정합니다:',L,K,es,H,As="훈련이 완료되면 모델이 자동으로 허브에 업로드되어 누구나 사용할 수 있습니다!",ns;return a=new ol({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}}),_=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),r=Bl(`
TensorFlow에서 모델을 미세 조정하려면 최적화 함수, 학습률 스케쥴 및 몇 가지 학습 하이퍼파라미터를 설정하는 것부터 시작하세요:

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

	`),y(l.$$.fragment,n),i=m(n),f=U(n,"P",{"data-svelte-h":!0}),T(f)!=="svelte-t1g1zp"&&(f.innerHTML=C),B=m(n),y(_.$$.fragment,n),Z=m(n),R=U(n,"P",{"data-svelte-h":!0}),T(R)!=="svelte-txv5rs"&&(R.innerHTML=k),A=m(n),y(W.$$.fragment,n),$=m(n),I=U(n,"P",{"data-svelte-h":!0}),T(I)!=="svelte-qo1enf"&&(I.innerHTML=M),g=m(n),y(v.$$.fragment,n),F=m(n),x=U(n,"P",{"data-svelte-h":!0}),T(x)!=="svelte-1nxoekh"&&(x.innerHTML=o),X=m(n),Y=U(n,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-zlosk8"&&(Y.innerHTML=Bs),ss=m(n),y(z.$$.fragment,n),ls=m(n),E=U(n,"P",{"data-svelte-h":!0}),T(E)!=="svelte-1b0ip2a"&&(E.innerHTML=rs),S=m(n),y(D.$$.fragment,n),as=m(n),N=U(n,"P",{"data-svelte-h":!0}),T(N)!=="svelte-ernkdu"&&(N.textContent=is),q=m(n),y(P.$$.fragment,n),ts=m(n),Q=U(n,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-1illf6u"&&(Q.innerHTML=os),L=m(n),y(K.$$.fragment,n),es=m(n),H=U(n,"P",{"data-svelte-h":!0}),T(H)!=="svelte-ymmthz"&&(H.textContent=As)},m(n,b){h(a,n,b),e(n,r,b),h(l,n,b),e(n,i,b),e(n,f,b),e(n,B,b),h(_,n,b),e(n,Z,b),e(n,R,b),e(n,A,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,E,b),e(n,S,b),h(D,n,b),e(n,as,b),e(n,N,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(_.$$.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(_.$$.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(r),t(i),t(f),t(B),t(Z),t(R),t(A),t($),t(I),t(g),t(F),t(x),t(X),t(Y),t(ss),t(ls),t(E),t(S),t(as),t(N),t(q),t(ts),t(Q),t(L),t(es),t(H)),w(a,n),w(l,n),w(_,n),w(W,n),w(v,n),w(z,n),w(D,n),w(P,n),w(K,n)}}}function Ll(G){let a,r;return a=new Ws({props:{$$slots:{default:[ql]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),r=!0},p(l,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:l}),a.$set(f)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){d(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function Dl(G){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,i){e(l,a,i)},p:Xs,d(l){l&&t(a)}}}function Pl(G){let a,r="각 프롬프트와 후보 답변 쌍을 토큰화하여 PyTorch 텐서를 반환합니다. 또한 <code>labels</code>을 생성해야 합니다:",l,i,f,C,B="입력과 레이블을 모델에 전달하고 <code>logits</code>을 반환합니다:",_,Z,R,k,A="가장 높은 확률을 가진 클래스를 가져옵니다:",W,$,I;return i=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=r,l=c(),j(i.$$.fragment),f=c(),C=J("p"),C.innerHTML=B,_=c(),j(Z.$$.fragment),R=c(),k=J("p"),k.textContent=A,W=c(),j($.$$.fragment)},l(M){a=U(M,"P",{"data-svelte-h":!0}),T(a)!=="svelte-35m9oi"&&(a.innerHTML=r),l=m(M),y(i.$$.fragment,M),f=m(M),C=U(M,"P",{"data-svelte-h":!0}),T(C)!=="svelte-x6lqnk"&&(C.innerHTML=B),_=m(M),y(Z.$$.fragment,M),R=m(M),k=U(M,"P",{"data-svelte-h":!0}),T(k)!=="svelte-for6x5"&&(k.textContent=A),W=m(M),y($.$$.fragment,M)},m(M,g){e(M,a,g),e(M,l,g),h(i,M,g),e(M,f,g),e(M,C,g),e(M,_,g),h(Z,M,g),e(M,R,g),e(M,k,g),e(M,W,g),h($,M,g),I=!0},p:Xs,i(M){I||(u(i.$$.fragment,M),u(Z.$$.fragment,M),u($.$$.fragment,M),I=!0)},o(M){d(i.$$.fragment,M),d(Z.$$.fragment,M),d($.$$.fragment,M),I=!1},d(M){M&&(t(a),t(l),t(f),t(C),t(_),t(R),t(k),t(W)),w(i,M),w(Z,M),w($,M)}}}function Kl(G){let a,r;return a=new Ws({props:{$$slots:{default:[Pl]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),r=!0},p(l,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:l}),a.$set(f)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){d(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function Ol(G){let a,r="각 프롬프트와 후보 답안 쌍을 토큰화하여 텐서플로 텐서를 반환합니다:",l,i,f,C,B="모델에 입력을 전달하고 <code>logits</code>를 반환합니다:",_,Z,R,k,A="가장 높은 확률을 가진 클래스를 가져옵니다:",W,$,I;return i=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=r,l=c(),j(i.$$.fragment),f=c(),C=J("p"),C.innerHTML=B,_=c(),j(Z.$$.fragment),R=c(),k=J("p"),k.textContent=A,W=c(),j($.$$.fragment)},l(M){a=U(M,"P",{"data-svelte-h":!0}),T(a)!=="svelte-1dzr36c"&&(a.textContent=r),l=m(M),y(i.$$.fragment,M),f=m(M),C=U(M,"P",{"data-svelte-h":!0}),T(C)!=="svelte-t69k4k"&&(C.innerHTML=B),_=m(M),y(Z.$$.fragment,M),R=m(M),k=U(M,"P",{"data-svelte-h":!0}),T(k)!=="svelte-for6x5"&&(k.textContent=A),W=m(M),y($.$$.fragment,M)},m(M,g){e(M,a,g),e(M,l,g),h(i,M,g),e(M,f,g),e(M,C,g),e(M,_,g),h(Z,M,g),e(M,R,g),e(M,k,g),e(M,W,g),h($,M,g),I=!0},p:Xs,i(M){I||(u(i.$$.fragment,M),u(Z.$$.fragment,M),u($.$$.fragment,M),I=!0)},o(M){d(i.$$.fragment,M),d(Z.$$.fragment,M),d($.$$.fragment,M),I=!1},d(M){M&&(t(a),t(l),t(f),t(C),t(_),t(R),t(k),t(W)),w(i,M),w(Z,M),w($,M)}}}function sa(G){let a,r;return a=new Ws({props:{$$slots:{default:[Ol]},$$scope:{ctx:G}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),r=!0},p(l,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:l}),a.$set(f)},i(l){r||(u(a.$$.fragment,l),r=!0)},o(l){d(a.$$.fragment,l),r=!1},d(l){w(a,l)}}}function la(G){let a,r,l,i,f,C,B,_,Z,R="객관식 과제는 문맥과 함께 여러 개의 후보 답변이 제공되고 모델이 정답을 선택하도록 학습된다는 점을 제외하면 질의응답과 유사합니다.",k,A,W="진행하는 방법은 아래와 같습니다:",$,I,M='<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,o,X,Y,Bs="모델을 업로드하고 커뮤니티와 공유할 수 있도록 허깅페이스 계정에 로그인하는 것이 좋습니다. 메시지가 표시되면 토큰을 입력하여 로그인합니다:",ss,z,ls,E,rs,S,D="먼저 🤗 Datasets  라이브러리에서 SWAG 데이터셋의 ‘일반’ 구성을 가져옵니다:",as,N,is,q,P="이제 데이터를 살펴봅니다:",ts,Q,os,L,K="여기에는 많은 필드가 있는 것처럼 보이지만 실제로는 매우 간단합니다:",es,H,As="<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,Es,ds,ul="전체 데이터 집합에 전처리 기능을 적용하려면 🤗 Datasets <code>map</code> 메소드를 사용합니다. <code>batched=True</code>를 설정하여 데이터 집합의 여러 요소를 한 번에 처리하면 <code>map</code> 함수의 속도를 높일 수 있습니다:",Ns,ws,Qs,fs,dl="🤗 Transformers에는 객관식용 데이터 콜레이터가 없으므로 예제 배치를 만들려면 <code>DataCollatorWithPadding</code>을 조정해야 합니다. 데이터 정렬 중에 전체 데이터 집합을 최대 길이로 패딩하는 대신 배치 중 가장 긴 길이로 문장을 <em>동적 패딩</em>하는 것이 더 효율적입니다.",Hs,Js,wl="<code>DataCollatorForMultipleChoice</code>는 모든 모델 입력을 평탄화하고 패딩을 적용하며 그 결과를 결과를 다차원화합니다:",Ss,ps,qs,Us,Ls,bs,fl='훈련 중에 메트릭을 포함하면 모델의 성능을 평가하는 데 도움이 되는 경우가 많습니다. 🤗<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,Ms,al,cs,tl,ks,el,_s,bl="이제 모델을 미세 조정했으니 추론에 사용할 수 있습니다!",nl,Is,Tl="텍스트와 두 개의 후보 답안을 작성합니다:",pl,Gs,Ml,ms,cl,Vs,ml,vs,rl;return f=new Rs({props:{title:"객관식 문제",local:"multiple-choice",headingTag:"h1"}}),B=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"}]}}),o=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}}),E=new Rs({props:{title:"SWAG 데이터 세트 가져오기",local:"load-swag-dataset",headingTag:"h2"}}),N=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;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google-bert/bert-base-uncased&quot;</span>)`,wrap:!1}}),us=new V({props:{code:"ZW5kaW5nX25hbWVzJTIwJTNEJTIwJTVCJTIyZW5kaW5nMCUyMiUyQyUyMCUyMmVuZGluZzElMjIlMkMlMjAlMjJlbmRpbmcyJTIyJTJDJTIwJTIyZW5kaW5nMyUyMiU1RCUwQSUwQSUwQWRlZiUyMHByZXByb2Nlc3NfZnVuY3Rpb24oZXhhbXBsZXMpJTNBJTBBJTIwJTIwJTIwJTIwZmlyc3Rfc2VudGVuY2VzJTIwJTNEJTIwJTVCJTVCY29udGV4dCU1RCUyMColMjA0JTIwZm9yJTIwY29udGV4dCUyMGluJTIwZXhhbXBsZXMlNUIlMjJzZW50MSUyMiU1RCU1RCUwQSUyMCUyMCUyMCUyMHF1ZXN0aW9uX2hlYWRlcnMlMjAlM0QlMjBleGFtcGxlcyU1QiUyMnNlbnQyJTIyJTVEJTBBJTIwJTIwJTIwJTIwc2Vjb25kX3NlbnRlbmNlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QmYlMjIlN0JoZWFkZXIlN0QlMjAlN0JleGFtcGxlcyU1QmVuZCU1RCU1QmklNUQlN0QlMjIlMjBmb3IlMjBlbmQlMjBpbiUyMGVuZGluZ19uYW1lcyU1RCUyMGZvciUyMGklMkMlMjBoZWFkZXIlMjBpbiUyMGVudW1lcmF0ZShxdWVzdGlvbl9oZWFkZXJzKSUwQSUyMCUyMCUyMCUyMCU1RCUwQSUwQSUyMCUyMCUyMCUyMGZpcnN0X3NlbnRlbmNlcyUyMCUzRCUyMHN1bShmaXJzdF9zZW50ZW5jZXMlMkMlMjAlNUIlNUQpJTBBJTIwJTIwJTIwJTIwc2Vjb25kX3NlbnRlbmNlcyUyMCUzRCUyMHN1bShzZWNvbmRfc2VudGVuY2VzJTJDJTIwJTVCJTVEKSUwQSUwQSUyMCUyMCUyMCUyMHRva2VuaXplZF9leGFtcGxlcyUyMCUzRCUyMHRva2VuaXplcihmaXJzdF9zZW50ZW5jZXMlMkMlMjBzZWNvbmRfc2VudGVuY2VzJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCayUzQSUyMCU1QnYlNUJpJTIwJTNBJTIwaSUyMCUyQiUyMDQlNUQlMjBmb3IlMjBpJTIwaW4lMjByYW5nZSgwJTJDJTIwbGVuKHYpJTJDJTIwNCklNUQlMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwdG9rZW5pemVkX2V4YW1wbGVzLml0ZW1zKCklN0Q=",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}}),ws=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 il({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[El],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"}}),Ms=new il({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ll],pytorch:[Hl]},$$scope:{ctx:G}}}),cs=new ol({props:{$$slots:{default:[Dl]},$$scope:{ctx:G}}}),ks=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}}),ms=new il({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"),r=c(),l=J("p"),i=c(),j(f.$$.fragment),C=c(),j(B.$$.fragment),_=c(),Z=J("p"),Z.textContent=R,k=c(),A=J("p"),A.textContent=W,$=c(),I=J("ol"),I.innerHTML=M,g=c(),v=J("p"),v.textContent=F,x=c(),j(o.$$.fragment),X=c(),Y=J("p"),Y.textContent=Bs,ss=c(),j(z.$$.fragment),ls=c(),j(E.$$.fragment),rs=c(),S=J("p"),S.textContent=D,as=c(),j(N.$$.fragment),is=c(),q=J("p"),q.textContent=P,ts=c(),j(Q.$$.fragment),os=c(),L=J("p"),L.textContent=K,es=c(),H=J("ul"),H.innerHTML=As,ns=c(),j(n.$$.fragment),b=c(),O=J("p"),O.textContent=jl,Ys=c(),j(js.$$.fragment),xs=c(),ys=J("p"),ys.textContent=yl,Fs=c(),hs=J("ol"),hs.innerHTML=hl,zs=c(),j(us.$$.fragment),Es=c(),ds=J("p"),ds.innerHTML=ul,Ns=c(),j(ws.$$.fragment),Qs=c(),fs=J("p"),fs.innerHTML=dl,Hs=c(),Js=J("p"),Js.innerHTML=wl,Ss=c(),j(ps.$$.fragment),qs=c(),j(Us.$$.fragment),Ls=c(),bs=J("p"),bs.innerHTML=fl,Ds=c(),j(Ts.$$.fragment),Ps=c(),gs=J("p"),gs.innerHTML=Jl,Ks=c(),j($s.$$.fragment),Os=c(),Cs=J("p"),Cs.innerHTML=Ul,sl=c(),j(Zs.$$.fragment),ll=c(),j(Ms.$$.fragment),al=c(),j(cs.$$.fragment),tl=c(),j(ks.$$.fragment),el=c(),_s=J("p"),_s.textContent=bl,nl=c(),Is=J("p"),Is.textContent=Tl,pl=c(),j(Gs.$$.fragment),Ml=c(),j(ms.$$.fragment),cl=c(),j(Vs.$$.fragment),ml=c(),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),r=m(s),l=U(s,"P",{}),kl(l).forEach(t),i=m(s),y(f.$$.fragment,s),C=m(s),y(B.$$.fragment,s),_=m(s),Z=U(s,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-13wfm6g"&&(Z.textContent=R),k=m(s),A=U(s,"P",{"data-svelte-h":!0}),T(A)!=="svelte-10q09rv"&&(A.textContent=W),$=m(s),I=U(s,"OL",{"data-svelte-h":!0}),T(I)!=="svelte-1eak31y"&&(I.innerHTML=M),g=m(s),v=U(s,"P",{"data-svelte-h":!0}),T(v)!=="svelte-1k0z9pm"&&(v.textContent=F),x=m(s),y(o.$$.fragment,s),X=m(s),Y=U(s,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-c0su0x"&&(Y.textContent=Bs),ss=m(s),y(z.$$.fragment,s),ls=m(s),y(E.$$.fragment,s),rs=m(s),S=U(s,"P",{"data-svelte-h":!0}),T(S)!=="svelte-3ax2l8"&&(S.textContent=D),as=m(s),y(N.$$.fragment,s),is=m(s),q=U(s,"P",{"data-svelte-h":!0}),T(q)!=="svelte-z8zknl"&&(q.textContent=P),ts=m(s),y(Q.$$.fragment,s),os=m(s),L=U(s,"P",{"data-svelte-h":!0}),T(L)!=="svelte-uhrqn8"&&(L.textContent=K),es=m(s),H=U(s,"UL",{"data-svelte-h":!0}),T(H)!=="svelte-12h9927"&&(H.innerHTML=As),ns=m(s),y(n.$$.fragment,s),b=m(s),O=U(s,"P",{"data-svelte-h":!0}),T(O)!=="svelte-1ytvevd"&&(O.textContent=jl),Ys=m(s),y(js.$$.fragment,s),xs=m(s),ys=U(s,"P",{"data-svelte-h":!0}),T(ys)!=="svelte-dr5hbo"&&(ys.textContent=yl),Fs=m(s),hs=U(s,"OL",{"data-svelte-h":!0}),T(hs)!=="svelte-1ur4b3u"&&(hs.innerHTML=hl),zs=m(s),y(us.$$.fragment,s),Es=m(s),ds=U(s,"P",{"data-svelte-h":!0}),T(ds)!=="svelte-1yi4yhv"&&(ds.innerHTML=ul),Ns=m(s),y(ws.$$.fragment,s),Qs=m(s),fs=U(s,"P",{"data-svelte-h":!0}),T(fs)!=="svelte-10mldg7"&&(fs.innerHTML=dl),Hs=m(s),Js=U(s,"P",{"data-svelte-h":!0}),T(Js)!=="svelte-q9au9u"&&(Js.innerHTML=wl),Ss=m(s),y(ps.$$.fragment,s),qs=m(s),y(Us.$$.fragment,s),Ls=m(s),bs=U(s,"P",{"data-svelte-h":!0}),T(bs)!=="svelte-fmkx3s"&&(bs.innerHTML=fl),Ds=m(s),y(Ts.$$.fragment,s),Ps=m(s),gs=U(s,"P",{"data-svelte-h":!0}),T(gs)!=="svelte-ezofyo"&&(gs.innerHTML=Jl),Ks=m(s),y($s.$$.fragment,s),Os=m(s),Cs=U(s,"P",{"data-svelte-h":!0}),T(Cs)!=="svelte-7zql7p"&&(Cs.innerHTML=Ul),sl=m(s),y(Zs.$$.fragment,s),ll=m(s),y(Ms.$$.fragment,s),al=m(s),y(cs.$$.fragment,s),tl=m(s),y(ks.$$.fragment,s),el=m(s),_s=U(s,"P",{"data-svelte-h":!0}),T(_s)!=="svelte-174wmmm"&&(_s.textContent=bl),nl=m(s),Is=U(s,"P",{"data-svelte-h":!0}),T(Is)!=="svelte-1h2wndb"&&(Is.textContent=Tl),pl=m(s),y(Gs.$$.fragment,s),Ml=m(s),y(ms.$$.fragment,s),cl=m(s),y(Vs.$$.fragment,s),ml=m(s),vs=U(s,"P",{}),kl(vs).forEach(t),this.h()},h(){_l(a,"name","hf:doc:metadata"),_l(a,"content",aa)},m(s,p){Wl(document.head,a),e(s,r,p),e(s,l,p),e(s,i,p),h(f,s,p),e(s,C,p),h(B,s,p),e(s,_,p),e(s,Z,p),e(s,k,p),e(s,A,p),e(s,$,p),e(s,I,p),e(s,g,p),e(s,v,p),e(s,x,p),h(o,s,p),e(s,X,p),e(s,Y,p),e(s,ss,p),h(z,s,p),e(s,ls,p),h(E,s,p),e(s,rs,p),e(s,S,p),e(s,as,p),h(N,s,p),e(s,is,p),e(s,q,p),e(s,ts,p),h(Q,s,p),e(s,os,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,Es,p),e(s,ds,p),e(s,Ns,p),h(ws,s,p),e(s,Qs,p),e(s,fs,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(Ms,s,p),e(s,al,p),h(cs,s,p),e(s,tl,p),h(ks,s,p),e(s,el,p),e(s,_s,p),e(s,nl,p),e(s,Is,p),e(s,pl,p),h(Gs,s,p),e(s,Ml,p),h(ms,s,p),e(s,cl,p),h(Vs,s,p),e(s,ml,p),e(s,vs,p),rl=!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}),Ms.$set($l);const Cl={};p&2&&(Cl.$$scope={dirty:p,ctx:s}),cs.$set(Cl);const Zl={};p&2&&(Zl.$$scope={dirty:p,ctx:s}),ms.$set(Zl)},i(s){rl||(u(f.$$.fragment,s),u(B.$$.fragment,s),u(o.$$.fragment,s),u(z.$$.fragment,s),u(E.$$.fragment,s),u(N.$$.fragment,s),u(Q.$$.fragment,s),u(n.$$.fragment,s),u(js.$$.fragment,s),u(us.$$.fragment,s),u(ws.$$.fragment,s),u(ps.$$.fragment,s),u(Us.$$.fragment,s),u(Ts.$$.fragment,s),u($s.$$.fragment,s),u(Zs.$$.fragment,s),u(Ms.$$.fragment,s),u(cs.$$.fragment,s),u(ks.$$.fragment,s),u(Gs.$$.fragment,s),u(ms.$$.fragment,s),u(Vs.$$.fragment,s),rl=!0)},o(s){d(f.$$.fragment,s),d(B.$$.fragment,s),d(o.$$.fragment,s),d(z.$$.fragment,s),d(E.$$.fragment,s),d(N.$$.fragment,s),d(Q.$$.fragment,s),d(n.$$.fragment,s),d(js.$$.fragment,s),d(us.$$.fragment,s),d(ws.$$.fragment,s),d(ps.$$.fragment,s),d(Us.$$.fragment,s),d(Ts.$$.fragment,s),d($s.$$.fragment,s),d(Zs.$$.fragment,s),d(Ms.$$.fragment,s),d(cs.$$.fragment,s),d(ks.$$.fragment,s),d(Gs.$$.fragment,s),d(ms.$$.fragment,s),d(Vs.$$.fragment,s),rl=!1},d(s){s&&(t(r),t(l),t(i),t(C),t(_),t(Z),t(k),t(A),t($),t(I),t(g),t(v),t(x),t(X),t(Y),t(ss),t(ls),t(rs),t(S),t(as),t(is),t(q),t(ts),t(os),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(Es),t(ds),t(Ns),t(Qs),t(fs),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(_s),t(nl),t(Is),t(pl),t(Ml),t(cl),t(ml),t(vs)),t(a),w(f,s),w(B,s),w(o,s),w(z,s),w(E,s),w(N,s),w(Q,s),w(n,s),w(js,s),w(us,s),w(ws,s),w(ps,s),w(Us,s),w(Ts,s),w($s,s),w(Zs,s),w(Ms,s),w(cs,s),w(ks,s),w(Gs,s),w(ms,s),w(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 ia extends Vl{constructor(a){super(),Xl(this,a,ta,la,Il,{})}}export{ia as component};
