import{s as Il,o as Gl,n as Xs}from"../chunks/scheduler.25b97de1.js";import{S as Vl,i as Xl,g as b,s as o,r as h,A as Wl,h as J,f as t,c as i,j as Zl,u as y,x as T,k as _l,y as Rl,a,v as j,d as u,t as d,w as f,m as vl,n as Al}from"../chunks/index.d9030fc9.js";import{T as Ml}from"../chunks/Tip.baa67368.js";import{C as V}from"../chunks/CodeBlock.e6cd0d95.js";import{D as Bl}from"../chunks/DocNotebookDropdown.5ea6cb78.js";import{F as ml,M as Rs}from"../chunks/Markdown.7217f838.js";import{H as Ws,E as Yl}from"../chunks/EditOnGithub.91d95064.js";function xl(G){let e,c;return e=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(){h(e.$$.fragment)},l(l){y(e.$$.fragment,l)},m(l,m){j(e,l,m),c=!0},p:Xs,i(l){c||(u(e.$$.fragment,l),c=!0)},o(l){d(e.$$.fragment,l),c=!1},d(l){f(e,l)}}}function Fl(G){let e,c;return e=new Rs({props:{$$slots:{default:[xl]},$$scope:{ctx:G}}}),{c(){h(e.$$.fragment)},l(l){y(e.$$.fragment,l)},m(l,m){j(e,l,m),c=!0},p(l,m){const w={};m&2&&(w.$$scope={dirty:m,ctx:l}),e.$set(w)},i(l){c||(u(e.$$.fragment,l),c=!0)},o(l){d(e.$$.fragment,l),c=!1},d(l){f(e,l)}}}function zl(G){let e,c;return e=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(){h(e.$$.fragment)},l(l){y(e.$$.fragment,l)},m(l,m){j(e,l,m),c=!0},p:Xs,i(l){c||(u(e.$$.fragment,l),c=!0)},o(l){d(e.$$.fragment,l),c=!1},d(l){f(e,l)}}}function El(G){let e,c;return e=new Rs({props:{$$slots:{default:[zl]},$$scope:{ctx:G}}}),{c(){h(e.$$.fragment)},l(l){y(e.$$.fragment,l)},m(l,m){j(e,l,m),c=!0},p(l,m){const w={};m&2&&(w.$$scope={dirty:m,ctx:l}),e.$set(w)},i(l){c||(u(e.$$.fragment,l),c=!0)},o(l){d(e.$$.fragment,l),c=!1},d(l){f(e,l)}}}function Nl(G){let e,c='If you aren’t familiar with finetuning a model with the <a href="/docs/transformers/v4.42.4/en/main_classes/trainer#transformers.Trainer">Trainer</a>, take a look at the basic tutorial <a href="../training#train-with-pytorch-trainer">here</a>!';return{c(){e=b("p"),e.innerHTML=c},l(l){e=J(l,"P",{"data-svelte-h":!0}),T(e)!=="svelte-1kle7br"&&(e.innerHTML=c)},m(l,m){a(l,e,m)},p:Xs,d(l){l&&t(e)}}}function Ql(G){let e,c,l,m='You’re ready to start training your model now! Load BERT with <a href="/docs/transformers/v4.42.4/en/model_doc/auto#transformers.AutoModelForMultipleChoice">AutoModelForMultipleChoice</a>:',w,C,v,_,k="At this point, only three steps remain:",W,Z,A='<li>Define your training hyperparameters in <a href="/docs/transformers/v4.42.4/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>. The only required parameter is <code>output_dir</code> which specifies where to save your model. You’ll push this model to the Hub by setting <code>push_to_hub=True</code> (you need to be signed in to Hugging Face to upload your model). At the end of each epoch, the <a href="/docs/transformers/v4.42.4/en/main_classes/trainer#transformers.Trainer">Trainer</a> will evaluate the accuracy and save the training checkpoint.</li> <li>Pass the training arguments to <a href="/docs/transformers/v4.42.4/en/main_classes/trainer#transformers.Trainer">Trainer</a> along with the model, dataset, tokenizer, data collator, and <code>compute_metrics</code> function.</li> <li>Call <a href="/docs/transformers/v4.42.4/en/main_classes/trainer#transformers.Trainer.train">train()</a> to finetune your model.</li>',R,$,I,r,U='Once training is completed, share your model to the Hub with the <a href="/docs/transformers/v4.42.4/en/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> method so everyone can use your model:',B,F,x;return e=new Ml({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(){h(e.$$.fragment),c=o(),l=b("p"),l.innerHTML=m,w=o(),h(C.$$.fragment),v=o(),_=b("p"),_.textContent=k,W=o(),Z=b("ol"),Z.innerHTML=A,R=o(),h($.$$.fragment),I=o(),r=b("p"),r.innerHTML=U,B=o(),h(F.$$.fragment)},l(M){y(e.$$.fragment,M),c=i(M),l=J(M,"P",{"data-svelte-h":!0}),T(l)!=="svelte-i3zmja"&&(l.innerHTML=m),w=i(M),y(C.$$.fragment,M),v=i(M),_=J(M,"P",{"data-svelte-h":!0}),T(_)!=="svelte-l42k0i"&&(_.textContent=k),W=i(M),Z=J(M,"OL",{"data-svelte-h":!0}),T(Z)!=="svelte-1dyl1l1"&&(Z.innerHTML=A),R=i(M),y($.$$.fragment,M),I=i(M),r=J(M,"P",{"data-svelte-h":!0}),T(r)!=="svelte-1hcmaoz"&&(r.innerHTML=U),B=i(M),y(F.$$.fragment,M)},m(M,X){j(e,M,X),a(M,c,X),a(M,l,X),a(M,w,X),j(C,M,X),a(M,v,X),a(M,_,X),a(M,W,X),a(M,Z,X),a(M,R,X),j($,M,X),a(M,I,X),a(M,r,X),a(M,B,X),j(F,M,X),x=!0},p(M,X){const Y={};X&2&&(Y.$$scope={dirty:X,ctx:M}),e.$set(Y)},i(M){x||(u(e.$$.fragment,M),u(C.$$.fragment,M),u($.$$.fragment,M),u(F.$$.fragment,M),x=!0)},o(M){d(e.$$.fragment,M),d(C.$$.fragment,M),d($.$$.fragment,M),d(F.$$.fragment,M),x=!1},d(M){M&&(t(c),t(l),t(w),t(v),t(_),t(W),t(Z),t(R),t(I),t(r),t(B)),f(e,M),f(C,M),f($,M),f(F,M)}}}function Hl(G){let e,c;return e=new Rs({props:{$$slots:{default:[Ql]},$$scope:{ctx:G}}}),{c(){h(e.$$.fragment)},l(l){y(e.$$.fragment,l)},m(l,m){j(e,l,m),c=!0},p(l,m){const w={};m&2&&(w.$$scope={dirty:m,ctx:l}),e.$set(w)},i(l){c||(u(e.$$.fragment,l),c=!0)},o(l){d(e.$$.fragment,l),c=!1},d(l){f(e,l)}}}function Sl(G){let e,c='If you aren’t familiar with finetuning a model with Keras, take a look at the basic tutorial <a href="../training#train-a-tensorflow-model-with-keras">here</a>!';return{c(){e=b("p"),e.innerHTML=c},l(l){e=J(l,"P",{"data-svelte-h":!0}),T(e)!=="svelte-1rd4nl8"&&(e.innerHTML=c)},m(l,m){a(l,e,m)},p:Xs,d(l){l&&t(e)}}}function ql(G){let e,c,l,m,w,C='Then you can load BERT with <a href="/docs/transformers/v4.42.4/en/model_doc/auto#transformers.TFAutoModelForMultipleChoice">TFAutoModelForMultipleChoice</a>:',v,_,k,W,Z='Convert your datasets to the <code>tf.data.Dataset</code> format with <a href="/docs/transformers/v4.42.4/en/main_classes/model#transformers.TFPreTrainedModel.prepare_tf_dataset">prepare_tf_dataset()</a>:',A,R,$,I,r='Configure the model for training with <a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>. Note that Transformers models all have a default task-relevant loss function, so you don’t need to specify one unless you want to:',U,B,F,x,M='The last two things to setup before you start training is to compute the accuracy from the predictions, and provide a way to push your model to the Hub. Both are done by using <a href="../main_classes/keras_callbacks">Keras callbacks</a>.',X,Y,vs='Pass your <code>compute_metrics</code> function to <a href="/docs/transformers/v4.42.4/en/main_classes/keras_callbacks#transformers.KerasMetricCallback">KerasMetricCallback</a>:',ss,z,ls,E,cs='Specify where to push your model and tokenizer in the <a href="/docs/transformers/v4.42.4/en/main_classes/keras_callbacks#transformers.PushToHubCallback">PushToHubCallback</a>:',S,D,es,N,ms="Then bundle your callbacks together:",q,P,ts,Q,Ms='Finally, you’re ready to start training your model! Call <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a> with your training and validation datasets, the number of epochs, and your callbacks to finetune the model:',L,K,as,H,As="Once training is completed, your model is automatically uploaded to the Hub so everyone can use it!",ns;return e=new Ml({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}}),R=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}}),B=new V({props:{code:"bW9kZWwuY29tcGlsZShvcHRpbWl6ZXIlM0RvcHRpbWl6ZXIpJTIwJTIwJTIzJTIwTm8lMjBsb3NzJTIwYXJndW1lbnQh",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)  <span class="hljs-comment"># No loss argument!</span>',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(){h(e.$$.fragment),c=vl(`
To finetune a model in TensorFlow, start by setting up an optimizer function, learning rate schedule, and some training hyperparameters:

	`),h(l.$$.fragment),m=o(),w=b("p"),w.innerHTML=C,v=o(),h(_.$$.fragment),k=o(),W=b("p"),W.innerHTML=Z,A=o(),h(R.$$.fragment),$=o(),I=b("p"),I.innerHTML=r,U=o(),h(B.$$.fragment),F=o(),x=b("p"),x.innerHTML=M,X=o(),Y=b("p"),Y.innerHTML=vs,ss=o(),h(z.$$.fragment),ls=o(),E=b("p"),E.innerHTML=cs,S=o(),h(D.$$.fragment),es=o(),N=b("p"),N.textContent=ms,q=o(),h(P.$$.fragment),ts=o(),Q=b("p"),Q.innerHTML=Ms,L=o(),h(K.$$.fragment),as=o(),H=b("p"),H.textContent=As},l(n){y(e.$$.fragment,n),c=Al(n,`
To finetune a model in TensorFlow, start by setting up an optimizer function, learning rate schedule, and some training hyperparameters:

	`),y(l.$$.fragment,n),m=i(n),w=J(n,"P",{"data-svelte-h":!0}),T(w)!=="svelte-a1qpvg"&&(w.innerHTML=C),v=i(n),y(_.$$.fragment,n),k=i(n),W=J(n,"P",{"data-svelte-h":!0}),T(W)!=="svelte-1lg7gaw"&&(W.innerHTML=Z),A=i(n),y(R.$$.fragment,n),$=i(n),I=J(n,"P",{"data-svelte-h":!0}),T(I)!=="svelte-17cxx5e"&&(I.innerHTML=r),U=i(n),y(B.$$.fragment,n),F=i(n),x=J(n,"P",{"data-svelte-h":!0}),T(x)!=="svelte-6l1wkp"&&(x.innerHTML=M),X=i(n),Y=J(n,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-eipp9u"&&(Y.innerHTML=vs),ss=i(n),y(z.$$.fragment,n),ls=i(n),E=J(n,"P",{"data-svelte-h":!0}),T(E)!=="svelte-188hoec"&&(E.innerHTML=cs),S=i(n),y(D.$$.fragment,n),es=i(n),N=J(n,"P",{"data-svelte-h":!0}),T(N)!=="svelte-1lw9xm8"&&(N.textContent=ms),q=i(n),y(P.$$.fragment,n),ts=i(n),Q=J(n,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-1hrpv1v"&&(Q.innerHTML=Ms),L=i(n),y(K.$$.fragment,n),as=i(n),H=J(n,"P",{"data-svelte-h":!0}),T(H)!=="svelte-2s71om"&&(H.textContent=As)},m(n,g){j(e,n,g),a(n,c,g),j(l,n,g),a(n,m,g),a(n,w,g),a(n,v,g),j(_,n,g),a(n,k,g),a(n,W,g),a(n,A,g),j(R,n,g),a(n,$,g),a(n,I,g),a(n,U,g),j(B,n,g),a(n,F,g),a(n,x,g),a(n,X,g),a(n,Y,g),a(n,ss,g),j(z,n,g),a(n,ls,g),a(n,E,g),a(n,S,g),j(D,n,g),a(n,es,g),a(n,N,g),a(n,q,g),j(P,n,g),a(n,ts,g),a(n,Q,g),a(n,L,g),j(K,n,g),a(n,as,g),a(n,H,g),ns=!0},p(n,g){const O={};g&2&&(O.$$scope={dirty:g,ctx:n}),e.$set(O)},i(n){ns||(u(e.$$.fragment,n),u(l.$$.fragment,n),u(_.$$.fragment,n),u(R.$$.fragment,n),u(B.$$.fragment,n),u(z.$$.fragment,n),u(D.$$.fragment,n),u(P.$$.fragment,n),u(K.$$.fragment,n),ns=!0)},o(n){d(e.$$.fragment,n),d(l.$$.fragment,n),d(_.$$.fragment,n),d(R.$$.fragment,n),d(B.$$.fragment,n),d(z.$$.fragment,n),d(D.$$.fragment,n),d(P.$$.fragment,n),d(K.$$.fragment,n),ns=!1},d(n){n&&(t(c),t(m),t(w),t(v),t(k),t(W),t(A),t($),t(I),t(U),t(F),t(x),t(X),t(Y),t(ss),t(ls),t(E),t(S),t(es),t(N),t(q),t(ts),t(Q),t(L),t(as),t(H)),f(e,n),f(l,n),f(_,n),f(R,n),f(B,n),f(z,n),f(D,n),f(P,n),f(K,n)}}}function Ll(G){let e,c;return e=new Rs({props:{$$slots:{default:[ql]},$$scope:{ctx:G}}}),{c(){h(e.$$.fragment)},l(l){y(e.$$.fragment,l)},m(l,m){j(e,l,m),c=!0},p(l,m){const w={};m&2&&(w.$$scope={dirty:m,ctx:l}),e.$set(w)},i(l){c||(u(e.$$.fragment,l),c=!0)},o(l){d(e.$$.fragment,l),c=!1},d(l){f(e,l)}}}function Dl(G){let e,c=`For a more in-depth example of how to finetune a model for multiple choice, take a look at the corresponding
<a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb" rel="nofollow">PyTorch notebook</a>
or <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb" rel="nofollow">TensorFlow notebook</a>.`;return{c(){e=b("p"),e.innerHTML=c},l(l){e=J(l,"P",{"data-svelte-h":!0}),T(e)!=="svelte-1c9mh52"&&(e.innerHTML=c)},m(l,m){a(l,e,m)},p:Xs,d(l){l&&t(e)}}}function Pl(G){let e,c="Tokenize each prompt and candidate answer pair and return PyTorch tensors. You should also create some <code>labels</code>:",l,m,w,C,v="Pass your inputs and labels to the model and return the <code>logits</code>:",_,k,W,Z,A="Get the class with the highest probability:",R,$,I;return m=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}}),k=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(){e=b("p"),e.innerHTML=c,l=o(),h(m.$$.fragment),w=o(),C=b("p"),C.innerHTML=v,_=o(),h(k.$$.fragment),W=o(),Z=b("p"),Z.textContent=A,R=o(),h($.$$.fragment)},l(r){e=J(r,"P",{"data-svelte-h":!0}),T(e)!=="svelte-1qxmddt"&&(e.innerHTML=c),l=i(r),y(m.$$.fragment,r),w=i(r),C=J(r,"P",{"data-svelte-h":!0}),T(C)!=="svelte-10twm8n"&&(C.innerHTML=v),_=i(r),y(k.$$.fragment,r),W=i(r),Z=J(r,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-18e4iwl"&&(Z.textContent=A),R=i(r),y($.$$.fragment,r)},m(r,U){a(r,e,U),a(r,l,U),j(m,r,U),a(r,w,U),a(r,C,U),a(r,_,U),j(k,r,U),a(r,W,U),a(r,Z,U),a(r,R,U),j($,r,U),I=!0},p:Xs,i(r){I||(u(m.$$.fragment,r),u(k.$$.fragment,r),u($.$$.fragment,r),I=!0)},o(r){d(m.$$.fragment,r),d(k.$$.fragment,r),d($.$$.fragment,r),I=!1},d(r){r&&(t(e),t(l),t(w),t(C),t(_),t(W),t(Z),t(R)),f(m,r),f(k,r),f($,r)}}}function Kl(G){let e,c;return e=new Rs({props:{$$slots:{default:[Pl]},$$scope:{ctx:G}}}),{c(){h(e.$$.fragment)},l(l){y(e.$$.fragment,l)},m(l,m){j(e,l,m),c=!0},p(l,m){const w={};m&2&&(w.$$scope={dirty:m,ctx:l}),e.$set(w)},i(l){c||(u(e.$$.fragment,l),c=!0)},o(l){d(e.$$.fragment,l),c=!1},d(l){f(e,l)}}}function Ol(G){let e,c="Tokenize each prompt and candidate answer pair and return TensorFlow tensors:",l,m,w,C,v="Pass your inputs to the model and return the <code>logits</code>:",_,k,W,Z,A="Get the class with the highest probability:",R,$,I;return m=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}}),k=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(){e=b("p"),e.textContent=c,l=o(),h(m.$$.fragment),w=o(),C=b("p"),C.innerHTML=v,_=o(),h(k.$$.fragment),W=o(),Z=b("p"),Z.textContent=A,R=o(),h($.$$.fragment)},l(r){e=J(r,"P",{"data-svelte-h":!0}),T(e)!=="svelte-q8vskg"&&(e.textContent=c),l=i(r),y(m.$$.fragment,r),w=i(r),C=J(r,"P",{"data-svelte-h":!0}),T(C)!=="svelte-f3g043"&&(C.innerHTML=v),_=i(r),y(k.$$.fragment,r),W=i(r),Z=J(r,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-18e4iwl"&&(Z.textContent=A),R=i(r),y($.$$.fragment,r)},m(r,U){a(r,e,U),a(r,l,U),j(m,r,U),a(r,w,U),a(r,C,U),a(r,_,U),j(k,r,U),a(r,W,U),a(r,Z,U),a(r,R,U),j($,r,U),I=!0},p:Xs,i(r){I||(u(m.$$.fragment,r),u(k.$$.fragment,r),u($.$$.fragment,r),I=!0)},o(r){d(m.$$.fragment,r),d(k.$$.fragment,r),d($.$$.fragment,r),I=!1},d(r){r&&(t(e),t(l),t(w),t(C),t(_),t(W),t(Z),t(R)),f(m,r),f(k,r),f($,r)}}}function se(G){let e,c;return e=new Rs({props:{$$slots:{default:[Ol]},$$scope:{ctx:G}}}),{c(){h(e.$$.fragment)},l(l){y(e.$$.fragment,l)},m(l,m){j(e,l,m),c=!0},p(l,m){const w={};m&2&&(w.$$scope={dirty:m,ctx:l}),e.$set(w)},i(l){c||(u(e.$$.fragment,l),c=!0)},o(l){d(e.$$.fragment,l),c=!1},d(l){f(e,l)}}}function le(G){let e,c,l,m,w,C,v,_,k,W="A multiple choice task is similar to question answering, except several candidate answers are provided along with a context and the model is trained to select the correct answer.",Z,A,R="This guide will show you how to:",$,I,r='<li>Finetune <a href="https://huggingface.co/google-bert/bert-base-uncased" rel="nofollow">BERT</a> on the <code>regular</code> configuration of the <a href="https://huggingface.co/datasets/swag" rel="nofollow">SWAG</a> dataset to select the best answer given multiple options and some context.</li> <li>Use your finetuned model for inference.</li>',U,B,F="Before you begin, make sure you have all the necessary libraries installed:",x,M,X,Y,vs="We encourage you to login to your Hugging Face account so you can upload and share your model with the community. When prompted, enter your token to login:",ss,z,ls,E,cs,S,D="Start by loading the <code>regular</code> configuration of the SWAG dataset from the 🤗 Datasets library:",es,N,ms,q,P="Then take a look at an example:",ts,Q,Ms,L,K="While it looks like there are a lot of fields here, it is actually pretty straightforward:",as,H,As="<li><code>sent1</code> and <code>sent2</code>: these fields show how a sentence starts, and if you put the two together, you get the <code>startphrase</code> field.</li> <li><code>ending</code>: suggests a possible ending for how a sentence can end, but only one of them is correct.</li> <li><code>label</code>: identifies the correct sentence ending.</li>",ns,n,g,O,hl="The next step is to load a BERT tokenizer to process the sentence starts and the four possible endings:",Ys,hs,xs,ys,yl="The preprocessing function you want to create needs to:",Fs,js,jl="<li>Make four copies of the <code>sent1</code> field and combine each of them with <code>sent2</code> to recreate how a sentence starts.</li> <li>Combine <code>sent2</code> with each of the four possible sentence endings.</li> <li>Flatten these two lists so you can tokenize them, and then unflatten them afterward so each example has a corresponding <code>input_ids</code>, <code>attention_mask</code>, and <code>labels</code> field.</li>",zs,us,Es,ds,ul='To apply the preprocessing function over the entire dataset, use 🤗 Datasets <a href="https://huggingface.co/docs/datasets/v3.0.0/en/package_reference/main_classes#datasets.Dataset.map" rel="nofollow">map</a> method. You can speed up the <code>map</code> function by setting <code>batched=True</code> to process multiple elements of the dataset at once:',Ns,fs,Qs,ws,dl='🤗 Transformers doesn’t have a data collator for multiple choice, so you’ll need to adapt the <a href="/docs/transformers/v4.42.4/en/main_classes/data_collator#transformers.DataCollatorWithPadding">DataCollatorWithPadding</a> to create a batch of examples. It’s more efficient to <em>dynamically pad</em> the sentences to the longest length in a batch during collation, instead of padding the whole dataset to the maximum length.',Hs,bs,fl="<code>DataCollatorForMultipleChoice</code> flattens all the model inputs, applies padding, and then unflattens the results:",Ss,ps,qs,Js,Ls,gs,wl='Including a metric during training is often helpful for evaluating your model’s performance. You can quickly load a evaluation method with the 🤗 <a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a> library. For this task, load the <a href="https://huggingface.co/spaces/evaluate-metric/accuracy" rel="nofollow">accuracy</a> metric (see the 🤗 Evaluate <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">quick tour</a> to learn more about how to load and compute a metric):',Ds,Ts,Ps,Us,bl="Then create a function that passes your predictions and labels to <code>compute</code> to calculate the accuracy:",Ks,$s,Os,Cs,Jl="Your <code>compute_metrics</code> function is ready to go now, and you’ll return to it when you setup your training.",sl,ks,ll,rs,el,os,tl,Zs,al,_s,gl="Great, now that you’ve finetuned a model, you can use it for inference!",nl,Is,Tl="Come up with some text and two candidate answers:",pl,Gs,rl,is,ol,Vs,il,Bs,cl;return w=new Ws({props:{title:"Multiple choice",local:"multiple-choice",headingTag:"h1"}}),v=new Bl({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/en/multiple_choice.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/multiple_choice.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/multiple_choice.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/multiple_choice.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/multiple_choice.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/multiple_choice.ipynb"}]}}),M=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 Ws({props:{title:"Load SWAG dataset",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 Ws({props:{title:"Preprocess",local:"preprocess",headingTag:"h2"}}),hs=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}}),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 ml({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[El],pytorch:[Fl]},$$scope:{ctx:G}}}),Js=new Ws({props:{title:"Evaluate",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}}),ks=new Ws({props:{title:"Train",local:"train",headingTag:"h2"}}),rs=new ml({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ll],pytorch:[Hl]},$$scope:{ctx:G}}}),os=new Ml({props:{$$slots:{default:[Dl]},$$scope:{ctx:G}}}),Zs=new Ws({props:{title:"Inference",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}}),is=new ml({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[se],pytorch:[Kl]},$$scope:{ctx:G}}}),Vs=new Yl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/tasks/multiple_choice.md"}}),{c(){e=b("meta"),c=o(),l=b("p"),m=o(),h(w.$$.fragment),C=o(),h(v.$$.fragment),_=o(),k=b("p"),k.textContent=W,Z=o(),A=b("p"),A.textContent=R,$=o(),I=b("ol"),I.innerHTML=r,U=o(),B=b("p"),B.textContent=F,x=o(),h(M.$$.fragment),X=o(),Y=b("p"),Y.textContent=vs,ss=o(),h(z.$$.fragment),ls=o(),h(E.$$.fragment),cs=o(),S=b("p"),S.innerHTML=D,es=o(),h(N.$$.fragment),ms=o(),q=b("p"),q.textContent=P,ts=o(),h(Q.$$.fragment),Ms=o(),L=b("p"),L.textContent=K,as=o(),H=b("ul"),H.innerHTML=As,ns=o(),h(n.$$.fragment),g=o(),O=b("p"),O.textContent=hl,Ys=o(),h(hs.$$.fragment),xs=o(),ys=b("p"),ys.textContent=yl,Fs=o(),js=b("ol"),js.innerHTML=jl,zs=o(),h(us.$$.fragment),Es=o(),ds=b("p"),ds.innerHTML=ul,Ns=o(),h(fs.$$.fragment),Qs=o(),ws=b("p"),ws.innerHTML=dl,Hs=o(),bs=b("p"),bs.innerHTML=fl,Ss=o(),h(ps.$$.fragment),qs=o(),h(Js.$$.fragment),Ls=o(),gs=b("p"),gs.innerHTML=wl,Ds=o(),h(Ts.$$.fragment),Ps=o(),Us=b("p"),Us.innerHTML=bl,Ks=o(),h($s.$$.fragment),Os=o(),Cs=b("p"),Cs.innerHTML=Jl,sl=o(),h(ks.$$.fragment),ll=o(),h(rs.$$.fragment),el=o(),h(os.$$.fragment),tl=o(),h(Zs.$$.fragment),al=o(),_s=b("p"),_s.textContent=gl,nl=o(),Is=b("p"),Is.textContent=Tl,pl=o(),h(Gs.$$.fragment),rl=o(),h(is.$$.fragment),ol=o(),h(Vs.$$.fragment),il=o(),Bs=b("p"),this.h()},l(s){const p=Wl("svelte-u9bgzb",document.head);e=J(p,"META",{name:!0,content:!0}),p.forEach(t),c=i(s),l=J(s,"P",{}),Zl(l).forEach(t),m=i(s),y(w.$$.fragment,s),C=i(s),y(v.$$.fragment,s),_=i(s),k=J(s,"P",{"data-svelte-h":!0}),T(k)!=="svelte-gcifhg"&&(k.textContent=W),Z=i(s),A=J(s,"P",{"data-svelte-h":!0}),T(A)!=="svelte-1aff4p7"&&(A.textContent=R),$=i(s),I=J(s,"OL",{"data-svelte-h":!0}),T(I)!=="svelte-1iw2sa5"&&(I.innerHTML=r),U=i(s),B=J(s,"P",{"data-svelte-h":!0}),T(B)!=="svelte-1c9nexd"&&(B.textContent=F),x=i(s),y(M.$$.fragment,s),X=i(s),Y=J(s,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-k76o1m"&&(Y.textContent=vs),ss=i(s),y(z.$$.fragment,s),ls=i(s),y(E.$$.fragment,s),cs=i(s),S=J(s,"P",{"data-svelte-h":!0}),T(S)!=="svelte-ndvump"&&(S.innerHTML=D),es=i(s),y(N.$$.fragment,s),ms=i(s),q=J(s,"P",{"data-svelte-h":!0}),T(q)!=="svelte-1m91ua0"&&(q.textContent=P),ts=i(s),y(Q.$$.fragment,s),Ms=i(s),L=J(s,"P",{"data-svelte-h":!0}),T(L)!=="svelte-1dgdrcg"&&(L.textContent=K),as=i(s),H=J(s,"UL",{"data-svelte-h":!0}),T(H)!=="svelte-vj0noe"&&(H.innerHTML=As),ns=i(s),y(n.$$.fragment,s),g=i(s),O=J(s,"P",{"data-svelte-h":!0}),T(O)!=="svelte-j3i2fe"&&(O.textContent=hl),Ys=i(s),y(hs.$$.fragment,s),xs=i(s),ys=J(s,"P",{"data-svelte-h":!0}),T(ys)!=="svelte-pduvot"&&(ys.textContent=yl),Fs=i(s),js=J(s,"OL",{"data-svelte-h":!0}),T(js)!=="svelte-tso4vc"&&(js.innerHTML=jl),zs=i(s),y(us.$$.fragment,s),Es=i(s),ds=J(s,"P",{"data-svelte-h":!0}),T(ds)!=="svelte-188m6ea"&&(ds.innerHTML=ul),Ns=i(s),y(fs.$$.fragment,s),Qs=i(s),ws=J(s,"P",{"data-svelte-h":!0}),T(ws)!=="svelte-jb2uod"&&(ws.innerHTML=dl),Hs=i(s),bs=J(s,"P",{"data-svelte-h":!0}),T(bs)!=="svelte-1ytir7e"&&(bs.innerHTML=fl),Ss=i(s),y(ps.$$.fragment,s),qs=i(s),y(Js.$$.fragment,s),Ls=i(s),gs=J(s,"P",{"data-svelte-h":!0}),T(gs)!=="svelte-j1ipe9"&&(gs.innerHTML=wl),Ds=i(s),y(Ts.$$.fragment,s),Ps=i(s),Us=J(s,"P",{"data-svelte-h":!0}),T(Us)!=="svelte-o3o85z"&&(Us.innerHTML=bl),Ks=i(s),y($s.$$.fragment,s),Os=i(s),Cs=J(s,"P",{"data-svelte-h":!0}),T(Cs)!=="svelte-183aynn"&&(Cs.innerHTML=Jl),sl=i(s),y(ks.$$.fragment,s),ll=i(s),y(rs.$$.fragment,s),el=i(s),y(os.$$.fragment,s),tl=i(s),y(Zs.$$.fragment,s),al=i(s),_s=J(s,"P",{"data-svelte-h":!0}),T(_s)!=="svelte-633ppb"&&(_s.textContent=gl),nl=i(s),Is=J(s,"P",{"data-svelte-h":!0}),T(Is)!=="svelte-nni2mt"&&(Is.textContent=Tl),pl=i(s),y(Gs.$$.fragment,s),rl=i(s),y(is.$$.fragment,s),ol=i(s),y(Vs.$$.fragment,s),il=i(s),Bs=J(s,"P",{}),Zl(Bs).forEach(t),this.h()},h(){_l(e,"name","hf:doc:metadata"),_l(e,"content",ee)},m(s,p){Rl(document.head,e),a(s,c,p),a(s,l,p),a(s,m,p),j(w,s,p),a(s,C,p),j(v,s,p),a(s,_,p),a(s,k,p),a(s,Z,p),a(s,A,p),a(s,$,p),a(s,I,p),a(s,U,p),a(s,B,p),a(s,x,p),j(M,s,p),a(s,X,p),a(s,Y,p),a(s,ss,p),j(z,s,p),a(s,ls,p),j(E,s,p),a(s,cs,p),a(s,S,p),a(s,es,p),j(N,s,p),a(s,ms,p),a(s,q,p),a(s,ts,p),j(Q,s,p),a(s,Ms,p),a(s,L,p),a(s,as,p),a(s,H,p),a(s,ns,p),j(n,s,p),a(s,g,p),a(s,O,p),a(s,Ys,p),j(hs,s,p),a(s,xs,p),a(s,ys,p),a(s,Fs,p),a(s,js,p),a(s,zs,p),j(us,s,p),a(s,Es,p),a(s,ds,p),a(s,Ns,p),j(fs,s,p),a(s,Qs,p),a(s,ws,p),a(s,Hs,p),a(s,bs,p),a(s,Ss,p),j(ps,s,p),a(s,qs,p),j(Js,s,p),a(s,Ls,p),a(s,gs,p),a(s,Ds,p),j(Ts,s,p),a(s,Ps,p),a(s,Us,p),a(s,Ks,p),j($s,s,p),a(s,Os,p),a(s,Cs,p),a(s,sl,p),j(ks,s,p),a(s,ll,p),j(rs,s,p),a(s,el,p),j(os,s,p),a(s,tl,p),j(Zs,s,p),a(s,al,p),a(s,_s,p),a(s,nl,p),a(s,Is,p),a(s,pl,p),j(Gs,s,p),a(s,rl,p),j(is,s,p),a(s,ol,p),j(Vs,s,p),a(s,il,p),a(s,Bs,p),cl=!0},p(s,[p]){const Ul={};p&2&&(Ul.$$scope={dirty:p,ctx:s}),ps.$set(Ul);const $l={};p&2&&($l.$$scope={dirty:p,ctx:s}),rs.$set($l);const Cl={};p&2&&(Cl.$$scope={dirty:p,ctx:s}),os.$set(Cl);const kl={};p&2&&(kl.$$scope={dirty:p,ctx:s}),is.$set(kl)},i(s){cl||(u(w.$$.fragment,s),u(v.$$.fragment,s),u(M.$$.fragment,s),u(z.$$.fragment,s),u(E.$$.fragment,s),u(N.$$.fragment,s),u(Q.$$.fragment,s),u(n.$$.fragment,s),u(hs.$$.fragment,s),u(us.$$.fragment,s),u(fs.$$.fragment,s),u(ps.$$.fragment,s),u(Js.$$.fragment,s),u(Ts.$$.fragment,s),u($s.$$.fragment,s),u(ks.$$.fragment,s),u(rs.$$.fragment,s),u(os.$$.fragment,s),u(Zs.$$.fragment,s),u(Gs.$$.fragment,s),u(is.$$.fragment,s),u(Vs.$$.fragment,s),cl=!0)},o(s){d(w.$$.fragment,s),d(v.$$.fragment,s),d(M.$$.fragment,s),d(z.$$.fragment,s),d(E.$$.fragment,s),d(N.$$.fragment,s),d(Q.$$.fragment,s),d(n.$$.fragment,s),d(hs.$$.fragment,s),d(us.$$.fragment,s),d(fs.$$.fragment,s),d(ps.$$.fragment,s),d(Js.$$.fragment,s),d(Ts.$$.fragment,s),d($s.$$.fragment,s),d(ks.$$.fragment,s),d(rs.$$.fragment,s),d(os.$$.fragment,s),d(Zs.$$.fragment,s),d(Gs.$$.fragment,s),d(is.$$.fragment,s),d(Vs.$$.fragment,s),cl=!1},d(s){s&&(t(c),t(l),t(m),t(C),t(_),t(k),t(Z),t(A),t($),t(I),t(U),t(B),t(x),t(X),t(Y),t(ss),t(ls),t(cs),t(S),t(es),t(ms),t(q),t(ts),t(Ms),t(L),t(as),t(H),t(ns),t(g),t(O),t(Ys),t(xs),t(ys),t(Fs),t(js),t(zs),t(Es),t(ds),t(Ns),t(Qs),t(ws),t(Hs),t(bs),t(Ss),t(qs),t(Ls),t(gs),t(Ds),t(Ps),t(Us),t(Ks),t(Os),t(Cs),t(sl),t(ll),t(el),t(tl),t(al),t(_s),t(nl),t(Is),t(pl),t(rl),t(ol),t(il),t(Bs)),t(e),f(w,s),f(v,s),f(M,s),f(z,s),f(E,s),f(N,s),f(Q,s),f(n,s),f(hs,s),f(us,s),f(fs,s),f(ps,s),f(Js,s),f(Ts,s),f($s,s),f(ks,s),f(rs,s),f(os,s),f(Zs,s),f(Gs,s),f(is,s),f(Vs,s)}}}const ee='{"title":"Multiple choice","local":"multiple-choice","sections":[{"title":"Load SWAG dataset","local":"load-swag-dataset","sections":[],"depth":2},{"title":"Preprocess","local":"preprocess","sections":[],"depth":2},{"title":"Evaluate","local":"evaluate","sections":[],"depth":2},{"title":"Train","local":"train","sections":[],"depth":2},{"title":"Inference","local":"inference","sections":[],"depth":2}],"depth":1}';function te(G){return Gl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class me extends Vl{constructor(e){super(),Xl(this,e,te,le,Il,{})}}export{me as component};
