import{s as Gl,o as kl,n as Vs}from"../chunks/scheduler.56730f09.js";import{S as Xl,i as Vl,g as U,s as M,r as j,A as Rl,h as f,f as t,c as r,j as Il,u as y,x as T,k as _l,y as Wl,a as e,v as h,d as u,t as J,w as d,m as Bl,n as Al}from"../chunks/index.61415d3e.js";import{T as ol}from"../chunks/Tip.81680c40.js";import{C as X}from"../chunks/CodeBlock.501e762d.js";import{D as vl}from"../chunks/DocNotebookDropdown.de94d9b4.js";import{F as il,M as Ws}from"../chunks/Markdown.44d6dca7.js";import{H as Rs,E as Fl}from"../chunks/index.4ddfef9b.js";function Yl(k){let a,m;return a=new X({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMHRyYW5zZm9ybWVycy50b2tlbml6YXRpb25fdXRpbHNfYmFzZSUyMGltcG9ydCUyMFByZVRyYWluZWRUb2tlbml6ZXJCYXNlJTJDJTIwUGFkZGluZ1N0cmF0ZWd5JTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSU0MGRhdGFjbGFzcyUwQWNsYXNzJTIwRGF0YUNvbGxhdG9yRm9yTXVsdGlwbGVDaG9pY2UlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBEYXRhJTIwY29sbGF0b3IlMjB0aGF0JTIwd2lsbCUyMGR5bmFtaWNhbGx5JTIwcGFkJTIwdGhlJTIwaW5wdXRzJTIwZm9yJTIwbXVsdGlwbGUlMjBjaG9pY2UlMjByZWNlaXZlZC4lMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0ElMjBQcmVUcmFpbmVkVG9rZW5pemVyQmFzZSUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0ElMjBVbmlvbiU1QmJvb2wlMkMlMjBz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ZWxzJTIyJTVEJTIwJTNEJTIwdG9yY2gudGVuc29yKGxhYmVscyUyQyUyMGR0eXBlJTNEdG9yY2guaW50NjQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",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),m=!0},p:Vs,i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){J(a.$$.fragment,l),m=!1},d(l){d(a,l)}}}function xl(k){let a,m;return a=new Ws({props:{$$slots:{default:[Yl]},$$scope:{ctx:k}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),m=!0},p(l,i){const w={};i&2&&(w.$$scope={dirty:i,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){J(a.$$.fragment,l),m=!1},d(l){d(a,l)}}}function zl(k){let a,m;return a=new X({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMHRyYW5zZm9ybWVycy50b2tlbml6YXRpb25fdXRpbHNfYmFzZSUyMGltcG9ydCUyMFByZVRyYWluZWRUb2tlbml6ZXJCYXNlJTJDJTIwUGFkZGluZ1N0cmF0ZWd5JTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQSU0MGRhdGFjbGFzcyUwQWNsYXNzJTIwRGF0YUNvbGxhdG9yRm9yTXVsdGlwbGVDaG9pY2UlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBEYXRhJTIwY29sbGF0b3IlMjB0aGF0JTIwd2lsbCUyMGR5bmFtaWNhbGx5JTIwcGFkJTIwdGhlJTIwaW5wdXRzJTIwZm9yJTIwbXVsdGlwbGUlMjBjaG9pY2UlMjByZWNlaXZlZC4lMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIlMEElMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0ElMjBQcmVUcmFpbmVkVG9rZW5pemVyQmFzZSUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0ElMjBVbmlvbiU1QmJvb2wlMkMlMjBz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YXRjaCU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMHRmLmNvbnZlcnRfdG9fdGVuc29yKGxhYmVscyUyQyUyMGR0eXBlJTNEdGYuaW50NjQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",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),m=!0},p:Vs,i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){J(a.$$.fragment,l),m=!1},d(l){d(a,l)}}}function El(k){let a,m;return a=new Ws({props:{$$slots:{default:[zl]},$$scope:{ctx:k}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),m=!0},p(l,i){const w={};i&2&&(w.$$scope={dirty:i,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){J(a.$$.fragment,l),m=!1},d(l){d(a,l)}}}function Nl(k){let a,m='إذا لم تكن معتادًا على ضبط نموذج باستخدام <code>Trainer</code>, فراجع الدرس الأساسي <a href="../training#train-with-pytorch-trainer">هنا</a>!';return{c(){a=U("p"),a.innerHTML=m},l(l){a=f(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-ktdjrd"&&(a.innerHTML=m)},m(l,i){e(l,a,i)},p:Vs,d(l){l&&t(a)}}}function Ql(k){let a,m,l,i="أنت جاهز لبدء تدريب نموذجك الآن! قم بتحميل BERT باستخدام <code>AutoModelForMultipleChoice</code>:",w,C,B,_,Z="في هذه المرحلة، تبقى ثلاث خطوات فقط:",R,I,A="<li>حدد معلمات التدريب الخاصة بك في <code>TrainingArguments</code>. المعلمة الوحيدة المطلوبة هي <code>output_dir</code> التي تحدد مكان حفظ نموذجك. ستدفع هذا النموذج إلى Hub عن طريق تعيين <code>push_to_hub=True</code> (يجب عليك تسجيل الدخول إلى Hugging Face لتحميل نموذجك). في نهاية كل حقبة، سيقوم <code>Trainer</code> بتقييم الدقة وحفظ نقطة فحص التدريب.</li> <li>مرر معلمات التدريب إلى <code>Trainer</code> جنبًا إلى جنب مع النموذج ومُجمِّع البيانات والمعالج ودالة تجميع البيانات ودالة <code>compute_metrics</code>.</li> <li>استدعي <code>train()</code> لضبط نموذجك.</li>",W,$,G,c,g="بمجرد اكتمال التدريب، شارك نموذجك مع Hub باستخدام طريقة <code>push_to_hub()</code> حتى يتمكن الجميع من استخدام نموذجك:",v,x,Y;return a=new ol({props:{$$slots:{default:[Nl]},$$scope:{ctx:k}}}),C=new X({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 X({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX3N3YWdfbW9kZWwlMjIlMkMlMEElMjAlMjAlMjAlMjBldmFsX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGxlYXJuaW5nX3JhdGUlM0Q1ZS01JTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3RyYWluX2Vwb2NocyUzRDMlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0R0b2tlbml6ZWRfc3dhZyU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEdG9rZW5pemVkX3N3YWclNUIlMjJ2YWxpZGF0aW9uJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwcHJvY2Vzc2luZ19jbGFzcyUzRHRva2VuaXplciUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0REYXRhQ29sbGF0b3JGb3JNdWx0aXBsZUNob2ljZSh0b2tlbml6ZXIlM0R0b2tlbml6ZXIpJTJDJTBBJTIwJTIwJTIwJTIwY29tcHV0ZV9tZXRyaWNzJTNEY29tcHV0ZV9tZXRyaWNzJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",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>    processing_class=tokenizer,
<span class="hljs-meta">... </span>    data_collator=DataCollatorForMultipleChoice(tokenizer=tokenizer),
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`,wrap:!1}}),x=new X({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){j(a.$$.fragment),m=M(),l=U("p"),l.innerHTML=i,w=M(),j(C.$$.fragment),B=M(),_=U("p"),_.textContent=Z,R=M(),I=U("ol"),I.innerHTML=A,W=M(),j($.$$.fragment),G=M(),c=U("p"),c.innerHTML=g,v=M(),j(x.$$.fragment)},l(o){y(a.$$.fragment,o),m=r(o),l=f(o,"P",{"data-svelte-h":!0}),T(l)!=="svelte-10xy7jv"&&(l.innerHTML=i),w=r(o),y(C.$$.fragment,o),B=r(o),_=f(o,"P",{"data-svelte-h":!0}),T(_)!=="svelte-1taxt6y"&&(_.textContent=Z),R=r(o),I=f(o,"OL",{"data-svelte-h":!0}),T(I)!=="svelte-879m27"&&(I.innerHTML=A),W=r(o),y($.$$.fragment,o),G=r(o),c=f(o,"P",{"data-svelte-h":!0}),T(c)!=="svelte-1tbeblz"&&(c.innerHTML=g),v=r(o),y(x.$$.fragment,o)},m(o,V){h(a,o,V),e(o,m,V),e(o,l,V),e(o,w,V),h(C,o,V),e(o,B,V),e(o,_,V),e(o,R,V),e(o,I,V),e(o,W,V),h($,o,V),e(o,G,V),e(o,c,V),e(o,v,V),h(x,o,V),Y=!0},p(o,V){const F={};V&2&&(F.$$scope={dirty:V,ctx:o}),a.$set(F)},i(o){Y||(u(a.$$.fragment,o),u(C.$$.fragment,o),u($.$$.fragment,o),u(x.$$.fragment,o),Y=!0)},o(o){J(a.$$.fragment,o),J(C.$$.fragment,o),J($.$$.fragment,o),J(x.$$.fragment,o),Y=!1},d(o){o&&(t(m),t(l),t(w),t(B),t(_),t(R),t(I),t(W),t(G),t(c),t(v)),d(a,o),d(C,o),d($,o),d(x,o)}}}function Hl(k){let a,m;return a=new Ws({props:{$$slots:{default:[Ql]},$$scope:{ctx:k}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),m=!0},p(l,i){const w={};i&2&&(w.$$scope={dirty:i,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){J(a.$$.fragment,l),m=!1},d(l){d(a,l)}}}function Sl(k){let a,m='إذا لم تكن معتادًا على ضبط نموذج باستخدام Keras، فراجع الدرس الأساسي <a href="../training#train-a-tensorflow-model-with-keras">هنا</a>!';return{c(){a=U("p"),a.innerHTML=m},l(l){a=f(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-1qms100"&&(a.innerHTML=m)},m(l,i){e(l,a,i)},p:Vs,d(l){l&&t(a)}}}function ql(k){let a,m,l,i,w,C="ثم يمكنك تحميل BERT باستخدام <code>TFAutoModelForMultipleChoice</code>:",B,_,Z,R,I="حوّل مجموعات البيانات الخاصة بك إلى تنسيق <code>tf.data.Dataset</code> باستخدام <code>prepare_tf_dataset()</code>:",A,W,$,G,c='قم بتهيئة النموذج للتدريب باستخدام <a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>. لاحظ أن جميع نماذج Transformers تحتوي على دالة خسارة مناسبة للمهمة بشكل افتراضي، لذلك لا تحتاج إلى تحديد واحدة ما لم ترغب في ذلك:',g,v,x,Y,o='الخطوتان الأخيرتان قبل بدء التدريب هما: حساب دقة التنبؤات، وتوفير طريقة لرفع النموذج إلى Hub. ويمكن تحقيق ذلك باستخدام <a href="../main_classes/keras_callbacks">استدعاءات Keras</a>',V,F,Bs="مرر دالتك <code>compute_metrics</code> إلى <code>KerasMetricCallback</code>:",ss,z,ls,E,ms="حدد مكان دفع نموذجك ومعالجك في <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="بمجرد اكتمال التدريب، يتم تحميل نموذجك تلقائيًا إلى Hub حتى يتمكن الجميع من استخدامه!",ns;return a=new ol({props:{$$slots:{default:[Sl]},$$scope:{ctx:k}}}),l=new X({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 X({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 X({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 X({props:{code:"bW9kZWwuY29tcGlsZShvcHRpbWl6ZXIlM0RvcHRpbWl6ZXIpJTIwJTIwJTIzJTIwJUQ5JTg0JUQ4JUE3JTIwJUQ4JUFBJUQ5JTg4JUQ4JUFDJUQ4JUFGJTIwJUQ5JTg4JUQ4JUIzJUQ5JThBJUQ4JUI3JUQ4JUE5JTIwJUQ4JUFFJUQ4JUIzJUQ4JUE3JUQ4JUIxJUQ4JUE5IQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)  <span class="hljs-comment"># لا توجد وسيطة خسارة!</span>',wrap:!1}}),z=new X({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 X({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 X({props:{code:"Y2FsbGJhY2tzJTIwJTNEJTIwJTVCbWV0cmljX2NhbGxiYWNrJTJDJTIwcHVzaF90b19odWJfY2FsbGJhY2slNUQ=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>callbacks = [metric_callback, push_to_hub_callback]',wrap:!1}}),K=new X({props:{code:"bW9kZWwuZml0KHglM0R0Zl90cmFpbl9zZXQlMkMlMjB2YWxpZGF0aW9uX2RhdGElM0R0Zl92YWxpZGF0aW9uX3NldCUyQyUyMGVwb2NocyUzRDIlMkMlMjBjYWxsYmFja3MlM0RjYWxsYmFja3Mp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(x=tf_train_set, validation_data=tf_validation_set, epochs=<span class="hljs-number">2</span>, callbacks=callbacks)',wrap:!1}}),{c(){j(a.$$.fragment),m=Bl(`
لضبط نموذج في TensorFlow، ابدأ بإعداد دالة مُحسِّن وجدول معدل التعلم وبعض معلمات التدريب:

	`),j(l.$$.fragment),i=M(),w=U("p"),w.innerHTML=C,B=M(),j(_.$$.fragment),Z=M(),R=U("p"),R.innerHTML=I,A=M(),j(W.$$.fragment),$=M(),G=U("p"),G.innerHTML=c,g=M(),j(v.$$.fragment),x=M(),Y=U("p"),Y.innerHTML=o,V=M(),F=U("p"),F.innerHTML=Bs,ss=M(),j(z.$$.fragment),ls=M(),E=U("p"),E.innerHTML=ms,S=M(),j(D.$$.fragment),as=M(),N=U("p"),N.textContent=is,q=M(),j(P.$$.fragment),ts=M(),Q=U("p"),Q.innerHTML=os,L=M(),j(K.$$.fragment),es=M(),H=U("p"),H.textContent=As},l(n){y(a.$$.fragment,n),m=Al(n,`
لضبط نموذج في TensorFlow، ابدأ بإعداد دالة مُحسِّن وجدول معدل التعلم وبعض معلمات التدريب:

	`),y(l.$$.fragment,n),i=r(n),w=f(n,"P",{"data-svelte-h":!0}),T(w)!=="svelte-vtcqis"&&(w.innerHTML=C),B=r(n),y(_.$$.fragment,n),Z=r(n),R=f(n,"P",{"data-svelte-h":!0}),T(R)!=="svelte-tlcvmw"&&(R.innerHTML=I),A=r(n),y(W.$$.fragment,n),$=r(n),G=f(n,"P",{"data-svelte-h":!0}),T(G)!=="svelte-1nhcjxf"&&(G.innerHTML=c),g=r(n),y(v.$$.fragment,n),x=r(n),Y=f(n,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-lju7px"&&(Y.innerHTML=o),V=r(n),F=f(n,"P",{"data-svelte-h":!0}),T(F)!=="svelte-1quwha4"&&(F.innerHTML=Bs),ss=r(n),y(z.$$.fragment,n),ls=r(n),E=f(n,"P",{"data-svelte-h":!0}),T(E)!=="svelte-1v0jlm"&&(E.innerHTML=ms),S=r(n),y(D.$$.fragment,n),as=r(n),N=f(n,"P",{"data-svelte-h":!0}),T(N)!=="svelte-1pqto4a"&&(N.textContent=is),q=r(n),y(P.$$.fragment,n),ts=r(n),Q=f(n,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-ik3lm8"&&(Q.innerHTML=os),L=r(n),y(K.$$.fragment,n),es=r(n),H=f(n,"P",{"data-svelte-h":!0}),T(H)!=="svelte-2i53kw"&&(H.textContent=As)},m(n,b){h(a,n,b),e(n,m,b),h(l,n,b),e(n,i,b),e(n,w,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,G,b),e(n,g,b),h(v,n,b),e(n,x,b),e(n,Y,b),e(n,V,b),e(n,F,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){J(a.$$.fragment,n),J(l.$$.fragment,n),J(_.$$.fragment,n),J(W.$$.fragment,n),J(v.$$.fragment,n),J(z.$$.fragment,n),J(D.$$.fragment,n),J(P.$$.fragment,n),J(K.$$.fragment,n),ns=!1},d(n){n&&(t(m),t(i),t(w),t(B),t(Z),t(R),t(A),t($),t(G),t(g),t(x),t(Y),t(V),t(F),t(ss),t(ls),t(E),t(S),t(as),t(N),t(q),t(ts),t(Q),t(L),t(es),t(H)),d(a,n),d(l,n),d(_,n),d(W,n),d(v,n),d(z,n),d(D,n),d(P,n),d(K,n)}}}function Ll(k){let a,m;return a=new Ws({props:{$$slots:{default:[ql]},$$scope:{ctx:k}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),m=!0},p(l,i){const w={};i&2&&(w.$$scope={dirty:i,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){J(a.$$.fragment,l),m=!1},d(l){d(a,l)}}}function Dl(k){let a,m=`للحصول على مثال أكثر تعمقًا حول كيفية ضبط نموذج للاختيار من متعدد، ألق نظرة على <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb" rel="nofollow">دفتر ملاحظات PyTorch</a>
أو <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb" rel="nofollow">دفتر ملاحظات TensorFlow</a> المقابل.`;return{c(){a=U("p"),a.innerHTML=m},l(l){a=f(l,"P",{"data-svelte-h":!0}),T(a)!=="svelte-mv9mkp"&&(a.innerHTML=m)},m(l,i){e(l,a,i)},p:Vs,d(l){l&&t(a)}}}function Pl(k){let a,m="قم بتحليل كل مطالبة وزوج إجابة مرشح وأعد تنسورات PyTorch. يجب عليك أيضًا إنشاء بعض <code>العلامات</code>:",l,i,w,C,B="مرر مدخلاتك والعلامات إلى النموذج وأرجع<code>logits</code>:",_,Z,R,I,A="استخرج الفئة ذات الاحتمالية الأكبر:",W,$,G;return i=new X({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ1c2VybmFtZSUyRm15X2F3ZXNvbWVfc3dhZ19tb2RlbCUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTVCcHJvbXB0JTJDJTIwY2FuZGlkYXRlMSU1RCUyQyUyMCU1QnByb21wdCUyQyUyMGNhbmRpZGF0ZTIlNUQlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gudGVuc29yKDApLnVuc3F1ZWV6ZSgwKQ==",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;username/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 X({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvck11bHRpcGxlQ2hvaWNlJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIydXNlcm5hbWUlMkZteV9hd2Vzb21lX3N3YWdfbW9kZWwlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqJTdCayUzQSUyMHYudW5zcXVlZXplKDApJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGlucHV0cy5pdGVtcygpJTdEJTJDJTIwbGFiZWxzJTNEbGFiZWxzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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;username/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 X({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-number">0</span>`,wrap:!1}}),{c(){a=U("p"),a.innerHTML=m,l=M(),j(i.$$.fragment),w=M(),C=U("p"),C.innerHTML=B,_=M(),j(Z.$$.fragment),R=M(),I=U("p"),I.textContent=A,W=M(),j($.$$.fragment)},l(c){a=f(c,"P",{"data-svelte-h":!0}),T(a)!=="svelte-1mcww3"&&(a.innerHTML=m),l=r(c),y(i.$$.fragment,c),w=r(c),C=f(c,"P",{"data-svelte-h":!0}),T(C)!=="svelte-1mjobp2"&&(C.innerHTML=B),_=r(c),y(Z.$$.fragment,c),R=r(c),I=f(c,"P",{"data-svelte-h":!0}),T(I)!=="svelte-fbgxtv"&&(I.textContent=A),W=r(c),y($.$$.fragment,c)},m(c,g){e(c,a,g),e(c,l,g),h(i,c,g),e(c,w,g),e(c,C,g),e(c,_,g),h(Z,c,g),e(c,R,g),e(c,I,g),e(c,W,g),h($,c,g),G=!0},p:Vs,i(c){G||(u(i.$$.fragment,c),u(Z.$$.fragment,c),u($.$$.fragment,c),G=!0)},o(c){J(i.$$.fragment,c),J(Z.$$.fragment,c),J($.$$.fragment,c),G=!1},d(c){c&&(t(a),t(l),t(w),t(C),t(_),t(R),t(I),t(W)),d(i,c),d(Z,c),d($,c)}}}function Kl(k){let a,m;return a=new Ws({props:{$$slots:{default:[Pl]},$$scope:{ctx:k}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),m=!0},p(l,i){const w={};i&2&&(w.$$scope={dirty:i,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){J(a.$$.fragment,l),m=!1},d(l){d(a,l)}}}function Ol(k){let a,m="قم بتحليل كل مطالبة وزوج إجابة مرشح وأعد موترات TensorFlow:",l,i,w,C,B="مرر مدخلاتك إلى النموذج وأعد القيم logits:",_,Z,R,I,A="استخرج الفئة ذات الاحتمالية الأكبر:",W,$,G;return i=new X({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ1c2VybmFtZSUyRm15X2F3ZXNvbWVfc3dhZ19tb2RlbCUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTVCcHJvbXB0JTJDJTIwY2FuZGlkYXRlMSU1RCUyQyUyMCU1QnByb21wdCUyQyUyMGNhbmRpZGF0ZTIlNUQlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyJTJDJTIwcGFkZGluZyUzRFRydWUp",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;username/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 X({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yTXVsdGlwbGVDaG9pY2UlMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMnVzZXJuYW1lJTJGbXlfYXdlc29tZV9zd2FnX21vZGVsJTIyKSUwQWlucHV0cyUyMCUzRCUyMCU3QmslM0ElMjB0Zi5leHBhbmRfZGltcyh2JTJDJTIwMCklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwaW5wdXRzLml0ZW1zKCklN0QlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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;username/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 X({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-number">0</span>`,wrap:!1}}),{c(){a=U("p"),a.textContent=m,l=M(),j(i.$$.fragment),w=M(),C=U("p"),C.textContent=B,_=M(),j(Z.$$.fragment),R=M(),I=U("p"),I.textContent=A,W=M(),j($.$$.fragment)},l(c){a=f(c,"P",{"data-svelte-h":!0}),T(a)!=="svelte-dqeodo"&&(a.textContent=m),l=r(c),y(i.$$.fragment,c),w=r(c),C=f(c,"P",{"data-svelte-h":!0}),T(C)!=="svelte-1yfdceg"&&(C.textContent=B),_=r(c),y(Z.$$.fragment,c),R=r(c),I=f(c,"P",{"data-svelte-h":!0}),T(I)!=="svelte-fbgxtv"&&(I.textContent=A),W=r(c),y($.$$.fragment,c)},m(c,g){e(c,a,g),e(c,l,g),h(i,c,g),e(c,w,g),e(c,C,g),e(c,_,g),h(Z,c,g),e(c,R,g),e(c,I,g),e(c,W,g),h($,c,g),G=!0},p:Vs,i(c){G||(u(i.$$.fragment,c),u(Z.$$.fragment,c),u($.$$.fragment,c),G=!0)},o(c){J(i.$$.fragment,c),J(Z.$$.fragment,c),J($.$$.fragment,c),G=!1},d(c){c&&(t(a),t(l),t(w),t(C),t(_),t(R),t(I),t(W)),d(i,c),d(Z,c),d($,c)}}}function sa(k){let a,m;return a=new Ws({props:{$$slots:{default:[Ol]},$$scope:{ctx:k}}}),{c(){j(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,i){h(a,l,i),m=!0},p(l,i){const w={};i&2&&(w.$$scope={dirty:i,ctx:l}),a.$set(w)},i(l){m||(u(a.$$.fragment,l),m=!0)},o(l){J(a.$$.fragment,l),m=!1},d(l){d(a,l)}}}function la(k){let a,m,l,i,w,C,B,_,Z,R="مهمة الاختيار من متعدد مشابهة لمهمة الإجابة على الأسئلة، ولكن مع توفير عدة إجابات محتملة مع سياق، ويُدرّب النموذج على تحديد الإجابة الصحيحة.",I,A,W="سيوضح لك هذا الدليل كيفية:",$,G,c='<li>ضبط نموذج <a href="https://huggingface.co/google-bert/bert-base-uncased" rel="nofollow">BERT</a>  باستخدام الإعداد <code>regular</code> لمجموعة بيانات <a href="https://huggingface.co/datasets/swag" rel="nofollow">SWAG</a> لاختيار الإجابة الأفضل من بين الخيارات المتعددة المتاحة مع السياق.</li> <li>استخدام النموذج المضبوط للاستدلال.</li>',g,v,x="قبل البدء، تأكد من تثبيت جميع المكتبات الضرورية:",Y,o,V,F,Bs="نشجعك على تسجيل الدخول إلى حساب Hugging Face الخاص بك حتى تتمكن من تحميل نموذجك ومشاركته مع المجتمع. عند المطالبة، أدخل الرمز المميز الخاص بك لتسجيل الدخول:",ss,z,ls,E,ms,S,D="ابدأ بتحميل تهيئة <code>regular</code> لمجموعة بيانات SWAG من مكتبة 🤗 Datasets:",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 لمعالجة بدايات الجمل والنهايات الأربع المحتملة:",Fs,js,Ys,ys,yl="تحتاج دالة المعالجة المسبقة التي تريد إنشاءها إلى:",xs,hs,hl="<li>إنشاء أربع نسخ من حقل <code>sent1</code> ودمج كل منها مع <code>sent2</code> لإعادة إنشاء كيفية بدء الجملة.</li> <li>دمج <code>sent2</code> مع كل من نهايات الجمل الأربع المحتملة.</li> <li>تتجميع هاتين القائمتين لتتمكن من تجزئتهما، ثم إعادة ترتيبها بعد ذلك بحيث يكون لكل مثال حقول <code>input_ids</code> و <code>attention_mask</code> و <code>labels</code> مقابلة.</li>",zs,us,Es,Js,ul="لتطبيق دالة المعالجة المسبقة على مجموعة البيانات بأكملها، استخدم طريقة <code>map</code> الخاصة بـ 🤗 Datasets. يمكنك تسريع دالة <code>map</code> عن طريق تعيين <code>batched=True</code> لمعالجة عناصر متعددة من مجموعة البيانات في وقت واحد:",Ns,ds,Qs,ws,Jl="لا يحتوي 🤗 Transformers على مجمع بيانات للاختيار من متعدد، لذلك ستحتاج إلى تكييف <code>DataCollatorWithPadding</code> لإنشاء دفعة من الأمثلة. من الأكفأ إضافة حشو (padding) ديناميكي للجمل إلى أطول طول في دفعة أثناء التجميع، بدلاً من حشو مجموعة البيانات بأكملها إلى الحد الأقصى للطول.",Hs,Us,dl="يقوم <code>DataCollatorForMultipleChoice</code> بتجميع جميع مدخلات النموذج، ويطبق الحشو، ثم يعيد تجميع النتائج في شكلها الأصلي:",Ss,ps,qs,fs,Ls,bs,wl='يُفضل غالبًا تضمين مقياس أثناء التدريب لتقييم أداء نموذجك. يمكنك تحميل طريقة تقييم بسرعة باستخدام مكتبة 🤗 <a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a>. لهذه المهمة، قم بتحميل مقياس <a href="https://huggingface.co/spaces/evaluate-metric/accuracy" rel="nofollow">الدقة</a> (انظر إلى <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">الجولة السريعة</a> لـ 🤗 Evaluate لمعرفة المزيد حول كيفية تحميل المقياس وحسابه):',Ds,Ts,Ps,gs,Ul="ثم أنشئ دالة لتمرير التنبؤات والتسميات إلى <code>compute</code> لحساب الدقة:",Ks,$s,Os,Cs,fl="دالتك <code>compute_metrics</code> جاهزة الآن، وستعود إليها عند إعداد تدريبك.",sl,Zs,ll,cs,al,Ms,tl,Is,el,_s,bl="رائع، الآن بعد أن قمت بضبط نموذج، يمكنك استخدامه للاستدلال!",nl,Gs,Tl="قم بإنشاء نص واقتراح إجابتين محتملتين:",pl,ks,cl,rs,Ml,Xs,rl,vs,ml;return w=new Rs({props:{title:"الاختيار من متعدد (Multiple choice)",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/ar/multiple_choice.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ar/pytorch/multiple_choice.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ar/tensorflow/multiple_choice.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ar/multiple_choice.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ar/pytorch/multiple_choice.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ar/tensorflow/multiple_choice.ipynb"}]}}),o=new X({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGU=",highlighted:"pip install transformers datasets evaluate",wrap:!1}}),z=new X({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:"تحميل-مجموعة-بيانات-swag",headingTag:"h2"}}),N=new X({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 X({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:"المعالجة المسبقة (Preprocess)",local:"المعالجة-المسبقة-preprocess",headingTag:"h2"}}),js=new X({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>)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ZXMlMkMlMjBzZWNvbmRfc2VudGVuY2VzJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCayUzQSUyMCU1QnYlNUJpJTIwJTNBJTIwaSUyMCUyQiUyMDQlNUQlMjBmb3IlMjBpJTIwaW4lMjByYW5nZSgwJTJDJTIwbGVuKHYpJTJDJTIwNCklNUQlMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwdG9rZW5pemVkX2V4YW1wbGVzLml0ZW1zKCklN0Q=",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}}),ds=new X({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:[xl]},$$scope:{ctx:k}}}),fs=new Rs({props:{title:"التقييم (Evaluate)",local:"التقييم-evaluate",headingTag:"h2"}}),Ts=new X({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 X({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBZGVmJTIwY29tcHV0ZV9tZXRyaWNzKGV2YWxfcHJlZCklM0ElMEElMjAlMjAlMjAlMjBwcmVkaWN0aW9ucyUyQyUyMGxhYmVscyUyMCUzRCUyMGV2YWxfcHJlZCUwQSUyMCUyMCUyMCUyMHByZWRpY3Rpb25zJTIwJTNEJTIwbnAuYXJnbWF4KHByZWRpY3Rpb25zJTJDJTIwYXhpcyUzRDEpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwYWNjdXJhY3kuY29tcHV0ZShwcmVkaWN0aW9ucyUzRHByZWRpY3Rpb25zJTJDJTIwcmVmZXJlbmNlcyUzRGxhYmVscyk=",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:"التدريب (Train)",local:"التدريب-train",headingTag:"h2"}}),cs=new il({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ll],pytorch:[Hl]},$$scope:{ctx:k}}}),Ms=new ol({props:{$$slots:{default:[Dl]},$$scope:{ctx:k}}}),Is=new Rs({props:{title:"الاستدلال  (Inference)",local:"الاستدلال-inference",headingTag:"h2"}}),ks=new X({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}}),rs=new il({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[sa],pytorch:[Kl]},$$scope:{ctx:k}}}),Xs=new Fl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ar/tasks/multiple_choice.md"}}),{c(){a=U("meta"),m=M(),l=U("p"),i=M(),j(w.$$.fragment),C=M(),j(B.$$.fragment),_=M(),Z=U("p"),Z.textContent=R,I=M(),A=U("p"),A.textContent=W,$=M(),G=U("ol"),G.innerHTML=c,g=M(),v=U("p"),v.textContent=x,Y=M(),j(o.$$.fragment),V=M(),F=U("p"),F.textContent=Bs,ss=M(),j(z.$$.fragment),ls=M(),j(E.$$.fragment),ms=M(),S=U("p"),S.innerHTML=D,as=M(),j(N.$$.fragment),is=M(),q=U("p"),q.textContent=P,ts=M(),j(Q.$$.fragment),os=M(),L=U("p"),L.textContent=K,es=M(),H=U("ul"),H.innerHTML=As,ns=M(),j(n.$$.fragment),b=M(),O=U("p"),O.textContent=jl,Fs=M(),j(js.$$.fragment),Ys=M(),ys=U("p"),ys.textContent=yl,xs=M(),hs=U("ol"),hs.innerHTML=hl,zs=M(),j(us.$$.fragment),Es=M(),Js=U("p"),Js.innerHTML=ul,Ns=M(),j(ds.$$.fragment),Qs=M(),ws=U("p"),ws.innerHTML=Jl,Hs=M(),Us=U("p"),Us.innerHTML=dl,Ss=M(),j(ps.$$.fragment),qs=M(),j(fs.$$.fragment),Ls=M(),bs=U("p"),bs.innerHTML=wl,Ds=M(),j(Ts.$$.fragment),Ps=M(),gs=U("p"),gs.innerHTML=Ul,Ks=M(),j($s.$$.fragment),Os=M(),Cs=U("p"),Cs.innerHTML=fl,sl=M(),j(Zs.$$.fragment),ll=M(),j(cs.$$.fragment),al=M(),j(Ms.$$.fragment),tl=M(),j(Is.$$.fragment),el=M(),_s=U("p"),_s.textContent=bl,nl=M(),Gs=U("p"),Gs.textContent=Tl,pl=M(),j(ks.$$.fragment),cl=M(),j(rs.$$.fragment),Ml=M(),j(Xs.$$.fragment),rl=M(),vs=U("p"),this.h()},l(s){const p=Rl("svelte-u9bgzb",document.head);a=f(p,"META",{name:!0,content:!0}),p.forEach(t),m=r(s),l=f(s,"P",{}),Il(l).forEach(t),i=r(s),y(w.$$.fragment,s),C=r(s),y(B.$$.fragment,s),_=r(s),Z=f(s,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-yvmy0k"&&(Z.textContent=R),I=r(s),A=f(s,"P",{"data-svelte-h":!0}),T(A)!=="svelte-lp8700"&&(A.textContent=W),$=r(s),G=f(s,"OL",{"data-svelte-h":!0}),T(G)!=="svelte-1vjx6un"&&(G.innerHTML=c),g=r(s),v=f(s,"P",{"data-svelte-h":!0}),T(v)!=="svelte-1vj7g14"&&(v.textContent=x),Y=r(s),y(o.$$.fragment,s),V=r(s),F=f(s,"P",{"data-svelte-h":!0}),T(F)!=="svelte-mxr1c6"&&(F.textContent=Bs),ss=r(s),y(z.$$.fragment,s),ls=r(s),y(E.$$.fragment,s),ms=r(s),S=f(s,"P",{"data-svelte-h":!0}),T(S)!=="svelte-1mtz9kg"&&(S.innerHTML=D),as=r(s),y(N.$$.fragment,s),is=r(s),q=f(s,"P",{"data-svelte-h":!0}),T(q)!=="svelte-1e1soci"&&(q.textContent=P),ts=r(s),y(Q.$$.fragment,s),os=r(s),L=f(s,"P",{"data-svelte-h":!0}),T(L)!=="svelte-1id1wdd"&&(L.textContent=K),es=r(s),H=f(s,"UL",{"data-svelte-h":!0}),T(H)!=="svelte-1nfq940"&&(H.innerHTML=As),ns=r(s),y(n.$$.fragment,s),b=r(s),O=f(s,"P",{"data-svelte-h":!0}),T(O)!=="svelte-sh2kho"&&(O.textContent=jl),Fs=r(s),y(js.$$.fragment,s),Ys=r(s),ys=f(s,"P",{"data-svelte-h":!0}),T(ys)!=="svelte-80a7yy"&&(ys.textContent=yl),xs=r(s),hs=f(s,"OL",{"data-svelte-h":!0}),T(hs)!=="svelte-1019bbh"&&(hs.innerHTML=hl),zs=r(s),y(us.$$.fragment,s),Es=r(s),Js=f(s,"P",{"data-svelte-h":!0}),T(Js)!=="svelte-mrr32b"&&(Js.innerHTML=ul),Ns=r(s),y(ds.$$.fragment,s),Qs=r(s),ws=f(s,"P",{"data-svelte-h":!0}),T(ws)!=="svelte-u415jf"&&(ws.innerHTML=Jl),Hs=r(s),Us=f(s,"P",{"data-svelte-h":!0}),T(Us)!=="svelte-1pzj4vp"&&(Us.innerHTML=dl),Ss=r(s),y(ps.$$.fragment,s),qs=r(s),y(fs.$$.fragment,s),Ls=r(s),bs=f(s,"P",{"data-svelte-h":!0}),T(bs)!=="svelte-5la4hj"&&(bs.innerHTML=wl),Ds=r(s),y(Ts.$$.fragment,s),Ps=r(s),gs=f(s,"P",{"data-svelte-h":!0}),T(gs)!=="svelte-1mjdc8l"&&(gs.innerHTML=Ul),Ks=r(s),y($s.$$.fragment,s),Os=r(s),Cs=f(s,"P",{"data-svelte-h":!0}),T(Cs)!=="svelte-1dl1t0b"&&(Cs.innerHTML=fl),sl=r(s),y(Zs.$$.fragment,s),ll=r(s),y(cs.$$.fragment,s),al=r(s),y(Ms.$$.fragment,s),tl=r(s),y(Is.$$.fragment,s),el=r(s),_s=f(s,"P",{"data-svelte-h":!0}),T(_s)!=="svelte-25dfys"&&(_s.textContent=bl),nl=r(s),Gs=f(s,"P",{"data-svelte-h":!0}),T(Gs)!=="svelte-ds28li"&&(Gs.textContent=Tl),pl=r(s),y(ks.$$.fragment,s),cl=r(s),y(rs.$$.fragment,s),Ml=r(s),y(Xs.$$.fragment,s),rl=r(s),vs=f(s,"P",{}),Il(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,m,p),e(s,l,p),e(s,i,p),h(w,s,p),e(s,C,p),h(B,s,p),e(s,_,p),e(s,Z,p),e(s,I,p),e(s,A,p),e(s,$,p),e(s,G,p),e(s,g,p),e(s,v,p),e(s,Y,p),h(o,s,p),e(s,V,p),e(s,F,p),e(s,ss,p),h(z,s,p),e(s,ls,p),h(E,s,p),e(s,ms,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,Fs,p),h(js,s,p),e(s,Ys,p),e(s,ys,p),e(s,xs,p),e(s,hs,p),e(s,zs,p),h(us,s,p),e(s,Es,p),e(s,Js,p),e(s,Ns,p),h(ds,s,p),e(s,Qs,p),e(s,ws,p),e(s,Hs,p),e(s,Us,p),e(s,Ss,p),h(ps,s,p),e(s,qs,p),h(fs,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(cs,s,p),e(s,al,p),h(Ms,s,p),e(s,tl,p),h(Is,s,p),e(s,el,p),e(s,_s,p),e(s,nl,p),e(s,Gs,p),e(s,pl,p),h(ks,s,p),e(s,cl,p),h(rs,s,p),e(s,Ml,p),h(Xs,s,p),e(s,rl,p),e(s,vs,p),ml=!0},p(s,[p]){const gl={};p&2&&(gl.$$scope={dirty:p,ctx:s}),ps.$set(gl);const $l={};p&2&&($l.$$scope={dirty:p,ctx:s}),cs.$set($l);const Cl={};p&2&&(Cl.$$scope={dirty:p,ctx:s}),Ms.$set(Cl);const Zl={};p&2&&(Zl.$$scope={dirty:p,ctx:s}),rs.$set(Zl)},i(s){ml||(u(w.$$.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(ds.$$.fragment,s),u(ps.$$.fragment,s),u(fs.$$.fragment,s),u(Ts.$$.fragment,s),u($s.$$.fragment,s),u(Zs.$$.fragment,s),u(cs.$$.fragment,s),u(Ms.$$.fragment,s),u(Is.$$.fragment,s),u(ks.$$.fragment,s),u(rs.$$.fragment,s),u(Xs.$$.fragment,s),ml=!0)},o(s){J(w.$$.fragment,s),J(B.$$.fragment,s),J(o.$$.fragment,s),J(z.$$.fragment,s),J(E.$$.fragment,s),J(N.$$.fragment,s),J(Q.$$.fragment,s),J(n.$$.fragment,s),J(js.$$.fragment,s),J(us.$$.fragment,s),J(ds.$$.fragment,s),J(ps.$$.fragment,s),J(fs.$$.fragment,s),J(Ts.$$.fragment,s),J($s.$$.fragment,s),J(Zs.$$.fragment,s),J(cs.$$.fragment,s),J(Ms.$$.fragment,s),J(Is.$$.fragment,s),J(ks.$$.fragment,s),J(rs.$$.fragment,s),J(Xs.$$.fragment,s),ml=!1},d(s){s&&(t(m),t(l),t(i),t(C),t(_),t(Z),t(I),t(A),t($),t(G),t(g),t(v),t(Y),t(V),t(F),t(ss),t(ls),t(ms),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(Fs),t(Ys),t(ys),t(xs),t(hs),t(zs),t(Es),t(Js),t(Ns),t(Qs),t(ws),t(Hs),t(Us),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(Gs),t(pl),t(cl),t(Ml),t(rl),t(vs)),t(a),d(w,s),d(B,s),d(o,s),d(z,s),d(E,s),d(N,s),d(Q,s),d(n,s),d(js,s),d(us,s),d(ds,s),d(ps,s),d(fs,s),d(Ts,s),d($s,s),d(Zs,s),d(cs,s),d(Ms,s),d(Is,s),d(ks,s),d(rs,s),d(Xs,s)}}}const aa='{"title":"الاختيار من متعدد (Multiple choice)","local":"الاختيار-من-متعدد-multiple-choice","sections":[{"title":"تحميل مجموعة بيانات SWAG","local":"تحميل-مجموعة-بيانات-swag","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 ta(k){return kl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ia extends Xl{constructor(a){super(),Vl(this,a,ta,la,Gl,{})}}export{ia as component};
