import{S as Lr,i as Fr,s as Gr,e as n,k as c,t as l,w as d,M as Nr,c as p,d as s,m,a as i,h as r,x as u,b as j,G as t,g as o,y as f,q as _,o as h,B as $,v as Hr}from"../../chunks/vendor-hf-doc-builder.js";import{T as Mr}from"../../chunks/Tip-hf-doc-builder.js";import{Y as Ur}from"../../chunks/Youtube-hf-doc-builder.js";import{I as Ir}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as k}from"../../chunks/CodeBlock-hf-doc-builder.js";import{D as Br}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function Rr(Te){let b,g,w,se,M;return{c(){b=n("p"),g=l("\u270F\uFE0F "),w=n("strong"),se=l("\u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0915\u0947 \u0926\u0947\u0916\u0947!"),M=l(" \u092A\u093F\u091B\u0932\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u094B \u0938\u0902\u0936\u094B\u0927\u093F\u0924 \u0915\u0930\u0947\u0902 \u0924\u093E\u0915\u093F \u0905\u092A\u0928\u0947 \u092E\u0949\u0921\u0932 \u0915\u094B SST-2 \u0921\u0947\u091F\u093E\u0938\u0947\u091F \u092A\u0930 \u092B\u093E\u0907\u0928-\u091F\u094D\u092F\u0942\u0928 \u0915\u0930 \u0938\u0915\u0947\u0964")},l(E){b=p(E,"P",{});var C=i(b);g=r(C,"\u270F\uFE0F "),w=p(C,"STRONG",{});var D=i(w);se=r(D,"\u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0915\u0947 \u0926\u0947\u0916\u0947!"),D.forEach(s),M=r(C," \u092A\u093F\u091B\u0932\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u094B \u0938\u0902\u0936\u094B\u0927\u093F\u0924 \u0915\u0930\u0947\u0902 \u0924\u093E\u0915\u093F \u0905\u092A\u0928\u0947 \u092E\u0949\u0921\u0932 \u0915\u094B SST-2 \u0921\u0947\u091F\u093E\u0938\u0947\u091F \u092A\u0930 \u092B\u093E\u0907\u0928-\u091F\u094D\u092F\u0942\u0928 \u0915\u0930 \u0938\u0915\u0947\u0964"),C.forEach(s)},m(E,C){o(E,b,C),t(b,g),t(b,w),t(w,se),t(b,M)},d(E){E&&s(b)}}}function Jr(Te){let b;return{c(){b=l('\u26A0\uFE0F Cloud TPUs \u0926\u094D\u0935\u093E\u0930\u093E \u092A\u0947\u0936 \u0915\u093F\u090F \u0917\u090F \u0938\u094D\u092A\u0940\u0921-\u0905\u092A \u0938\u0947 \u0932\u093E\u092D \u0909\u0920\u093E\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F, \u0939\u092E \u0905\u0928\u0941\u0936\u0902\u0938\u093E \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u0915\u093F \u0906\u092A \u0905\u092A\u0928\u0947 \u0938\u0948\u092E\u094D\u092A\u0932\u094D\u0938 \u0915\u094B \u091F\u094B\u0915\u0928\u0928\u093E\u0907\u091C\u093C\u0930 \u0915\u0947 `padding="max_length"` \u0914\u0930 `max_length` \u092A\u094D\u0930\u093E\u091A\u0932 \u092F\u093E\u0928\u093F \u0906\u0930\u094D\u0917\u0941\u092E\u0947\u0902\u091F \u0915\u0947 \u0938\u093E\u0925 \u090F\u0915 \u0928\u093F\u0936\u094D\u091A\u093F\u0924 \u0932\u0902\u092C\u093E\u0908 \u0924\u0915 \u092A\u0948\u0921\u093F\u0902\u0917 \u0915\u0930\u0947\u0902\u0964')},l(g){b=r(g,'\u26A0\uFE0F Cloud TPUs \u0926\u094D\u0935\u093E\u0930\u093E \u092A\u0947\u0936 \u0915\u093F\u090F \u0917\u090F \u0938\u094D\u092A\u0940\u0921-\u0905\u092A \u0938\u0947 \u0932\u093E\u092D \u0909\u0920\u093E\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F, \u0939\u092E \u0905\u0928\u0941\u0936\u0902\u0938\u093E \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u0915\u093F \u0906\u092A \u0905\u092A\u0928\u0947 \u0938\u0948\u092E\u094D\u092A\u0932\u094D\u0938 \u0915\u094B \u091F\u094B\u0915\u0928\u0928\u093E\u0907\u091C\u093C\u0930 \u0915\u0947 `padding="max_length"` \u0914\u0930 `max_length` \u092A\u094D\u0930\u093E\u091A\u0932 \u092F\u093E\u0928\u093F \u0906\u0930\u094D\u0917\u0941\u092E\u0947\u0902\u091F \u0915\u0947 \u0938\u093E\u0925 \u090F\u0915 \u0928\u093F\u0936\u094D\u091A\u093F\u0924 \u0932\u0902\u092C\u093E\u0908 \u0924\u0915 \u092A\u0948\u0921\u093F\u0902\u0917 \u0915\u0930\u0947\u0902\u0964')},m(g,w){o(g,b,w)},d(g){g&&s(b)}}}function Yr(Te){let b,g,w,se,M,E,C,D,Cs,U,Bt,Qe,Rt,Jt,Ps,te,Ds,ae,Yt,xs,x,Qt,Ke,Kt,Vt,Ve,Xt,Zt,Ss,S,O,ea,Xe,sa,ta,Ze,aa,la,ra,P,oa,es,na,pa,ss,ia,ca,ts,ma,da,ua,as,fa,Ts,L,_a,ls,ha,$a,Os,le,Ws,Oe,ba,Ms,re,Us,We,ka,Ls,oe,Fs,Me,va,Gs,ne,Ns,pe,Hs,F,ja,rs,wa,ga,Is,Ue,za,Bs,ie,Rs,Le,Ea,Js,ce,Ys,me,Qs,G,qa,os,ya,Aa,Ks,z,Ca,ns,Pa,Da,ps,xa,Sa,is,Ta,Oa,de,Wa,Ma,Vs,ue,Xs,N,Ua,cs,La,Fa,Zs,fe,et,_e,st,he,Ga,tt,H,Na,ms,Ha,Ia,at,$e,lt,be,rt,I,Ba,ds,Ra,Ja,ot,ke,nt,Fe,Ya,pt,ve,Qa,it,q,Ka,us,Va,Xa,fs,Za,el,_s,sl,tl,ct,je,mt,we,dt,Ge,al,ut,B,ft,W,R,hs,ge,ll,$s,rl,_t,ze,ht,J,ol,Ee,nl,pl,$t,qe,bt,Ne,il,kt,ye,vt,y,cl,bs,ml,dl,ks,ul,fl,vs,_l,hl,jt,v,$l,js,bl,kl,ws,vl,jl,gs,wl,gl,zs,zl,El,Es,ql,yl,wt,Y,gt,He,Al,zt,Ae,Et,Q,Cl,qs,Pl,Dl,qt,Ce,yt,Ie,xl,At,Pe,Ct,Be,Sl,Pt,K,Tl,ys,Ol,Wl,Dt,De,xt,V,Ml,xe,Ul,Ll,St;return E=new Br({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/chapter3/section4.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/chapter3/section4.ipynb"}]}}),D=new Ur({props:{id:"Dh9CL8fyG80"}}),te=new k({props:{code:`from datasets import load_dataset
from transformers import AutoTokenizer, DataCollatorWithPadding

raw_datasets = load_dataset("glue", "mrpc")
checkpoint = "bert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)


def tokenize_function(example):
    return tokenizer(example["sentence1"], example["sentence2"], truncation=True)


tokenized_datasets = raw_datasets.map(tokenize_function, batched=True)
data_collator = DataCollatorWithPadding(tokenizer=tokenizer)`,highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, DataCollatorWithPadding

raw_datasets = load_dataset(<span class="hljs-string">&quot;glue&quot;</span>, <span class="hljs-string">&quot;mrpc&quot;</span>)
checkpoint = <span class="hljs-string">&quot;bert-base-uncased&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(checkpoint)


<span class="hljs-keyword">def</span> <span class="hljs-title function_">tokenize_function</span>(<span class="hljs-params">example</span>):
    <span class="hljs-keyword">return</span> tokenizer(example[<span class="hljs-string">&quot;sentence1&quot;</span>], example[<span class="hljs-string">&quot;sentence2&quot;</span>], truncation=<span class="hljs-literal">True</span>)


tokenized_datasets = raw_datasets.<span class="hljs-built_in">map</span>(tokenize_function, batched=<span class="hljs-literal">True</span>)
data_collator = DataCollatorWithPadding(tokenizer=tokenizer)`}}),le=new k({props:{code:`tokenized_datasets = tokenized_datasets.remove_columns(["sentence1", "sentence2", "idx"])
tokenized_datasets = tokenized_datasets.rename_column("label", "labels")
tokenized_datasets.set_format("torch")
tokenized_datasets["train"].column_names`,highlighted:`tokenized_datasets = tokenized_datasets.remove_columns([<span class="hljs-string">&quot;sentence1&quot;</span>, <span class="hljs-string">&quot;sentence2&quot;</span>, <span class="hljs-string">&quot;idx&quot;</span>])
tokenized_datasets = tokenized_datasets.rename_column(<span class="hljs-string">&quot;label&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>)
tokenized_datasets.set_format(<span class="hljs-string">&quot;torch&quot;</span>)
tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>].column_names`}}),re=new k({props:{code:'["attention_mask", "input_ids", "labels", "token_type_ids"]',highlighted:'[<span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>, <span class="hljs-string">&quot;token_type_ids&quot;</span>]'}}),oe=new k({props:{code:`from torch.utils.data import DataLoader

train_dataloader = DataLoader(
    tokenized_datasets["train"], shuffle=True, batch_size=8, collate_fn=data_collator
)
eval_dataloader = DataLoader(
    tokenized_datasets["validation"], batch_size=8, collate_fn=data_collator
)`,highlighted:`<span class="hljs-keyword">from</span> torch.utils.data <span class="hljs-keyword">import</span> DataLoader

train_dataloader = DataLoader(
    tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>], shuffle=<span class="hljs-literal">True</span>, batch_size=<span class="hljs-number">8</span>, collate_fn=data_collator
)
eval_dataloader = DataLoader(
    tokenized_datasets[<span class="hljs-string">&quot;validation&quot;</span>], batch_size=<span class="hljs-number">8</span>, collate_fn=data_collator
)`}}),ne=new k({props:{code:`for batch in train_dataloader:
    break
{k: v.shape for k, v in batch.items()}`,highlighted:`<span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> train_dataloader:
    <span class="hljs-keyword">break</span>
{k: v.shape <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> batch.items()}`}}),pe=new k({props:{code:`{'attention_mask': torch.Size([8, 65]),
 'input_ids': torch.Size([8, 65]),
 'labels': torch.Size([8]),
 'token_type_ids': torch.Size([8, 65])}`,highlighted:`{<span class="hljs-string">&#x27;attention_mask&#x27;</span>: torch.Size([<span class="hljs-number">8</span>, <span class="hljs-number">65</span>]),
 <span class="hljs-string">&#x27;input_ids&#x27;</span>: torch.Size([<span class="hljs-number">8</span>, <span class="hljs-number">65</span>]),
 <span class="hljs-string">&#x27;labels&#x27;</span>: torch.Size([<span class="hljs-number">8</span>]),
 <span class="hljs-string">&#x27;token_type_ids&#x27;</span>: torch.Size([<span class="hljs-number">8</span>, <span class="hljs-number">65</span>])}`}}),ie=new k({props:{code:`from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=<span class="hljs-number">2</span>)`}}),ce=new k({props:{code:`outputs = model(**batch)
print(outputs.loss, outputs.logits.shape)`,highlighted:`outputs = model(**batch)
<span class="hljs-built_in">print</span>(outputs.loss, outputs.logits.shape)`}}),me=new k({props:{code:"tensor(0.5441, grad_fn=<NllLossBackward>) torch.Size([8, 2])",highlighted:'tensor(<span class="hljs-number">0.5441</span>, grad_fn=&lt;NllLossBackward&gt;) torch.Size([<span class="hljs-number">8</span>, <span class="hljs-number">2</span>])'}}),ue=new k({props:{code:`from transformers import AdamW

optimizer = AdamW(model.parameters(), lr=5e-5)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AdamW

optimizer = AdamW(model.parameters(), lr=<span class="hljs-number">5e-5</span>)`}}),fe=new k({props:{code:`from transformers import get_scheduler

num_epochs = 3
num_training_steps = num_epochs * len(train_dataloader)
lr_scheduler = get_scheduler(
    "linear",
    optimizer=optimizer,
    num_warmup_steps=0,
    num_training_steps=num_training_steps,
)
print(num_training_steps)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> get_scheduler

num_epochs = <span class="hljs-number">3</span>
num_training_steps = num_epochs * <span class="hljs-built_in">len</span>(train_dataloader)
lr_scheduler = get_scheduler(
    <span class="hljs-string">&quot;linear&quot;</span>,
    optimizer=optimizer,
    num_warmup_steps=<span class="hljs-number">0</span>,
    num_training_steps=num_training_steps,
)
<span class="hljs-built_in">print</span>(num_training_steps)`}}),_e=new k({props:{code:"1377",highlighted:'<span class="hljs-number">1377</span>'}}),$e=new k({props:{code:`import torch

device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
model.to(device)
device`,highlighted:`<span class="hljs-keyword">import</span> torch

device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span>) <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> torch.device(<span class="hljs-string">&quot;cpu&quot;</span>)
model.to(device)
device`}}),be=new k({props:{code:"device(type='cuda')",highlighted:'device(<span class="hljs-built_in">type</span>=<span class="hljs-string">&#x27;cuda&#x27;</span>)'}}),ke=new k({props:{code:`from tqdm.auto import tqdm

progress_bar = tqdm(range(num_training_steps))

model.train()
for epoch in range(num_epochs):
    for batch in train_dataloader:
        batch = {k: v.to(device) for k, v in batch.items()}
        outputs = model(**batch)
        loss = outputs.loss
        loss.backward()

        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()
        progress_bar.update(1)`,highlighted:`<span class="hljs-keyword">from</span> tqdm.auto <span class="hljs-keyword">import</span> tqdm

progress_bar = tqdm(<span class="hljs-built_in">range</span>(num_training_steps))

model.train()
<span class="hljs-keyword">for</span> epoch <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_epochs):
    <span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> train_dataloader:
        batch = {k: v.to(device) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> batch.items()}
        outputs = model(**batch)
        loss = outputs.loss
        loss.backward()

        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()
        progress_bar.update(<span class="hljs-number">1</span>)`}}),je=new k({props:{code:`from datasets import load_metric

metric = load_metric("glue", "mrpc")
model.eval()
for batch in eval_dataloader:
    batch = {k: v.to(device) for k, v in batch.items()}
    with torch.no_grad():
        outputs = model(**batch)

    logits = outputs.logits
    predictions = torch.argmax(logits, dim=-1)
    metric.add_batch(predictions=predictions, references=batch["labels"])

metric.compute()`,highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_metric

metric = load_metric(<span class="hljs-string">&quot;glue&quot;</span>, <span class="hljs-string">&quot;mrpc&quot;</span>)
model.<span class="hljs-built_in">eval</span>()
<span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> eval_dataloader:
    batch = {k: v.to(device) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> batch.items()}
    <span class="hljs-keyword">with</span> torch.no_grad():
        outputs = model(**batch)

    logits = outputs.logits
    predictions = torch.argmax(logits, dim=-<span class="hljs-number">1</span>)
    metric.add_batch(predictions=predictions, references=batch[<span class="hljs-string">&quot;labels&quot;</span>])

metric.compute()`}}),we=new k({props:{code:"{'accuracy': 0.8431372549019608, 'f1': 0.8907849829351535}",highlighted:'{<span class="hljs-string">&#x27;accuracy&#x27;</span>: <span class="hljs-number">0.8431372549019608</span>, <span class="hljs-string">&#x27;f1&#x27;</span>: <span class="hljs-number">0.8907849829351535</span>}'}}),B=new Mr({props:{$$slots:{default:[Rr]},$$scope:{ctx:Te}}}),ge=new Ir({}),ze=new Ur({props:{id:"s7dy8QRgjJ0"}}),qe=new k({props:{code:`from transformers import AdamW, AutoModelForSequenceClassification, get_scheduler

model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)
optimizer = AdamW(model.parameters(), lr=3e-5)

device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
model.to(device)

num_epochs = 3
num_training_steps = num_epochs * len(train_dataloader)
lr_scheduler = get_scheduler(
    "linear",
    optimizer=optimizer,
    num_warmup_steps=0,
    num_training_steps=num_training_steps,
)

progress_bar = tqdm(range(num_training_steps))

model.train()
for epoch in range(num_epochs):
    for batch in train_dataloader:
        batch = {k: v.to(device) for k, v in batch.items()}
        outputs = model(**batch)
        loss = outputs.loss
        loss.backward()

        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()
        progress_bar.update(1)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AdamW, AutoModelForSequenceClassification, get_scheduler

model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=<span class="hljs-number">2</span>)
optimizer = AdamW(model.parameters(), lr=<span class="hljs-number">3e-5</span>)

device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span>) <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> torch.device(<span class="hljs-string">&quot;cpu&quot;</span>)
model.to(device)

num_epochs = <span class="hljs-number">3</span>
num_training_steps = num_epochs * <span class="hljs-built_in">len</span>(train_dataloader)
lr_scheduler = get_scheduler(
    <span class="hljs-string">&quot;linear&quot;</span>,
    optimizer=optimizer,
    num_warmup_steps=<span class="hljs-number">0</span>,
    num_training_steps=num_training_steps,
)

progress_bar = tqdm(<span class="hljs-built_in">range</span>(num_training_steps))

model.train()
<span class="hljs-keyword">for</span> epoch <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_epochs):
    <span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> train_dataloader:
        batch = {k: v.to(device) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> batch.items()}
        outputs = model(**batch)
        loss = outputs.loss
        loss.backward()

        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()
        progress_bar.update(<span class="hljs-number">1</span>)`}}),ye=new k({props:{code:`+ from accelerate import Accelerator
  from transformers import AdamW, AutoModelForSequenceClassification, get_scheduler

+ accelerator = Accelerator()

  model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)
  optimizer = AdamW(model.parameters(), lr=3e-5)

- device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
- model.to(device)

+ train_dataloader, eval_dataloader, model, optimizer = accelerator.prepare(
+     train_dataloader, eval_dataloader, model, optimizer
+ )

  num_epochs = 3
  num_training_steps = num_epochs * len(train_dataloader)
  lr_scheduler = get_scheduler(
      "linear",
      optimizer=optimizer,
      num_warmup_steps=0,
      num_training_steps=num_training_steps
  )

  progress_bar = tqdm(range(num_training_steps))

  model.train()
  for epoch in range(num_epochs):
      for batch in train_dataloader:
-         batch = {k: v.to(device) for k, v in batch.items()}
          outputs = model(**batch)
          loss = outputs.loss
-         loss.backward()
+         accelerator.backward(loss)

          optimizer.step()
          lr_scheduler.step()
          optimizer.zero_grad()
          progress_bar.update(1)`,highlighted:`<span class="hljs-addition">+ from accelerate import Accelerator</span>
  from transformers import AdamW, AutoModelForSequenceClassification, get_scheduler

<span class="hljs-addition">+ accelerator = Accelerator()</span>

  model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)
  optimizer = AdamW(model.parameters(), lr=3e-5)

<span class="hljs-deletion">- device = torch.device(&quot;cuda&quot;) if torch.cuda.is_available() else torch.device(&quot;cpu&quot;)</span>
<span class="hljs-deletion">- model.to(device)</span>

<span class="hljs-addition">+ train_dataloader, eval_dataloader, model, optimizer = accelerator.prepare(</span>
<span class="hljs-addition">+     train_dataloader, eval_dataloader, model, optimizer</span>
<span class="hljs-addition">+ )</span>

  num_epochs = 3
  num_training_steps = num_epochs * len(train_dataloader)
  lr_scheduler = get_scheduler(
      &quot;linear&quot;,
      optimizer=optimizer,
      num_warmup_steps=0,
      num_training_steps=num_training_steps
  )

  progress_bar = tqdm(range(num_training_steps))

  model.train()
  for epoch in range(num_epochs):
      for batch in train_dataloader:
<span class="hljs-deletion">-         batch = {k: v.to(device) for k, v in batch.items()}</span>
          outputs = model(**batch)
          loss = outputs.loss
<span class="hljs-deletion">-         loss.backward()</span>
<span class="hljs-addition">+         accelerator.backward(loss)</span>

          optimizer.step()
          lr_scheduler.step()
          optimizer.zero_grad()
          progress_bar.update(1)`}}),Y=new Mr({props:{$$slots:{default:[Jr]},$$scope:{ctx:Te}}}),Ae=new k({props:{code:`from accelerate import Accelerator
from transformers import AdamW, AutoModelForSequenceClassification, get_scheduler

accelerator = Accelerator()

model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)
optimizer = AdamW(model.parameters(), lr=3e-5)

train_dl, eval_dl, model, optimizer = accelerator.prepare(
    train_dataloader, eval_dataloader, model, optimizer
)

num_epochs = 3
num_training_steps = num_epochs * len(train_dl)
lr_scheduler = get_scheduler(
    "linear",
    optimizer=optimizer,
    num_warmup_steps=0,
    num_training_steps=num_training_steps,
)

progress_bar = tqdm(range(num_training_steps))

model.train()
for epoch in range(num_epochs):
    for batch in train_dl:
        outputs = model(**batch)
        loss = outputs.loss
        accelerator.backward(loss)

        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()
        progress_bar.update(1)`,highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AdamW, AutoModelForSequenceClassification, get_scheduler

accelerator = Accelerator()

model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=<span class="hljs-number">2</span>)
optimizer = AdamW(model.parameters(), lr=<span class="hljs-number">3e-5</span>)

train_dl, eval_dl, model, optimizer = accelerator.prepare(
    train_dataloader, eval_dataloader, model, optimizer
)

num_epochs = <span class="hljs-number">3</span>
num_training_steps = num_epochs * <span class="hljs-built_in">len</span>(train_dl)
lr_scheduler = get_scheduler(
    <span class="hljs-string">&quot;linear&quot;</span>,
    optimizer=optimizer,
    num_warmup_steps=<span class="hljs-number">0</span>,
    num_training_steps=num_training_steps,
)

progress_bar = tqdm(<span class="hljs-built_in">range</span>(num_training_steps))

model.train()
<span class="hljs-keyword">for</span> epoch <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_epochs):
    <span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> train_dl:
        outputs = model(**batch)
        loss = outputs.loss
        accelerator.backward(loss)

        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()
        progress_bar.update(<span class="hljs-number">1</span>)`}}),Ce=new k({props:{code:"accelerate config",highlighted:"accelerate config"}}),Pe=new k({props:{code:"accelerate launch train.py",highlighted:'accelerate <span class="hljs-built_in">launch</span> train.py'}}),De=new k({props:{code:`from accelerate import notebook_launcher

notebook_launcher(training_function)`,highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> notebook_launcher

notebook_launcher(training_function)`}}),{c(){b=n("meta"),g=c(),w=n("h1"),se=l("\u090F\u0915 \u092A\u0942\u0930\u094D\u0923 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923"),M=c(),d(E.$$.fragment),C=c(),d(D.$$.fragment),Cs=c(),U=n("p"),Bt=l("\u0905\u092C \u0939\u092E \u0926\u0947\u0916\u0947\u0902\u0917\u0947 \u0915\u093F "),Qe=n("code"),Rt=l("Trainer"),Jt=l(" \u0915\u094D\u0932\u093E\u0938 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u093F\u090F \u092C\u093F\u0928\u093E \u0915\u0948\u0938\u0947 \u0939\u092E \u0938\u092E\u093E\u0928  \u092A\u0930\u093F\u0923\u093E\u092E \u092A\u094D\u0930\u093E\u092A\u094D\u0924 \u0915\u0930\u0947 \u091C\u0948\u0938\u093E \u0915\u0940 \u0939\u092E\u0928\u0947 \u092A\u093F\u091B\u0932\u0947 \u0916\u0902\u0921 \u092A\u094D\u0930\u093E\u092A\u094D\u0924 \u0915\u093F\u092F\u093E \u0925\u093E\u0964 \u092B\u093F\u0930 \u0938\u0947, \u0939\u092E \u092E\u093E\u0928\u0924\u0947 \u0939\u0948\u0902 \u0915\u093F \u0906\u092A\u0928\u0947 \u0905\u0928\u0941\u092D\u093E\u0917 2 \u092E\u0947\u0902 \u0921\u0947\u091F\u093E \u092A\u094D\u0930\u0938\u0902\u0938\u094D\u0915\u0930\u0923 \u092F\u093E\u0928\u093F \u0921\u0947\u091F\u093E \u092A\u094D\u0930\u094B\u0938\u0947\u0938\u093F\u0902\u0917 \u0915\u0930 \u0932\u0940 \u0939\u0948\u0964 \u092F\u0939\u093E\u0902 \u090F\u0915 \u0938\u0902\u0915\u094D\u0937\u093F\u092A\u094D\u0924 \u0938\u093E\u0930\u093E\u0902\u0936 \u0926\u093F\u092F\u093E \u0917\u092F\u093E \u0939\u0948 \u091C\u094B \u0935\u0939 \u0938\u092C \u0915\u0941\u091B \u0936\u093E\u092E\u093F\u0932 \u0915\u0930 \u0930\u0939\u093E \u0939\u0948 \u091C\u093F\u0938\u0915\u0940 \u0906\u092A\u0915\u094B \u0906\u0935\u0936\u094D\u092F\u0915\u0924\u093E \u0939\u094B\u0917\u0940:"),Ps=c(),d(te.$$.fragment),Ds=c(),ae=n("h3"),Yt=l("\u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u0947 \u0932\u093F\u090F \u0924\u0948\u092F\u093E\u0930 \u0915\u0930\u0947\u0902"),xs=c(),x=n("p"),Qt=l("\u0939\u092E\u093E\u0930\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0935\u093E\u0938\u094D\u0924\u0935 \u092E\u0947\u0902 \u0932\u093F\u0916\u0928\u0947 \u0938\u0947 \u092A\u0939\u0932\u0947, \u0939\u092E\u0947\u0902 \u0915\u0941\u091B \u0935\u0938\u094D\u0924\u0941\u0913\u0902 \u0915\u094B \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930\u0928\u0947 \u0915\u0940 \u0906\u0935\u0936\u094D\u092F\u0915\u0924\u093E \u0939\u094B\u0917\u0940\u0964 \u092A\u0939\u0932\u0947 \u0939\u0948 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930\u094D\u0938  \u091C\u093F\u0928\u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0939\u092E \u092C\u0948\u091A\u094B\u0902 \u092A\u0930 \u092A\u0941\u0928\u0930\u093E\u0935\u0943\u0924\u093F \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u0930\u0947\u0902\u0917\u0947\u0964 \u0932\u0947\u0915\u093F\u0928 \u0907\u0938\u0938\u0947 \u092A\u0939\u0932\u0947 \u0915\u093F \u0939\u092E \u0909\u0928 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930\u094D\u0938 \u0915\u094B \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930 \u0938\u0915\u0947, \u0939\u092E\u0947\u0902 \u0905\u092A\u0928\u0947 "),Ke=n("code"),Kt=l("tokenized_datasets"),Vt=l(" \u092E\u0947\u0902 \u0915\u0941\u091B \u092A\u094B\u0938\u094D\u091F\u092A\u094D\u0930\u094B\u0938\u0947\u0938\u093F\u0902\u0917 \u0932\u093E\u0917\u0942 \u0915\u0930\u0928\u0947 \u0915\u0940 \u091C\u0930\u0942\u0930\u0924 \u0939\u0948, \u0924\u093E\u0915\u093F \u0915\u0941\u091B \u091A\u0940\u091C\u094B\u0902 \u0915\u093E \u0916\u094D\u092F\u093E\u0932 \u0930\u0916\u093E \u091C\u093E \u0938\u0915\u0947 \u091C\u094B "),Ve=n("code"),Xt=l("Trainer"),Zt=l(" \u0928\u0947 \u0939\u092E\u093E\u0930\u0947 \u0932\u093F\u090F \u0938\u094D\u0935\u091A\u093E\u0932\u093F\u0924 \u0930\u0942\u092A \u0938\u0947 \u0915\u093F\u092F\u093E \u0925\u093E\u0964 \u0935\u093F\u0936\u0947\u0937 \u0930\u0942\u092A \u0938\u0947, \u0939\u092E\u0947\u0902 \u091C\u0930\u0942\u0930\u0924 \u0939\u0948 \u0915\u0940:"),Ss=c(),S=n("ul"),O=n("li"),ea=l("\u0909\u0928 \u0935\u0948\u0932\u094D\u092F\u0942\u091C \u0915\u0947 \u0905\u0928\u0941\u0930\u0942\u092A \u0915\u0949\u0932\u092E \u0928\u093F\u0915\u093E\u0932\u0947\u0902 \u091C\u093F\u0928\u0915\u0940 \u092E\u0949\u0921\u0932 \u0905\u092A\u0947\u0915\u094D\u0937\u093E \u0928\u0939\u0940\u0902 \u0915\u0930\u0924\u093E (\u091C\u0948\u0938\u0947 "),Xe=n("code"),sa=l("sentence1"),ta=l(" \u0914\u0930 "),Ze=n("code"),aa=l("sentence2"),la=l(" \u0915\u0949\u0932\u092E)\u0964"),ra=c(),P=n("li"),oa=l("\u0915\u0949\u0932\u092E "),es=n("code"),na=l("label"),pa=l(" \u0915\u093E \u0928\u093E\u092E \u092C\u0926\u0932\u0915\u0930 "),ss=n("code"),ia=l("labels"),ca=l(" \u0915\u0930 \u0926\u0947\u0902 (\u0915\u094D\u092F\u094B\u0902\u0915\u093F \u092E\u0949\u0921\u0932 \u0909\u092E\u094D\u092E\u0940\u0926 \u0915\u0930\u0924\u093E \u0939\u0948 \u0915\u0940 \u0935\u093F\u0924\u0930\u094D\u0915 \u0915\u093E \u0928\u093E\u092E "),ts=n("code"),ma=l("labels"),da=l(" \u0939\u094B)\u0964"),ua=c(),as=n("li"),fa=l("\u0921\u0947\u091F\u093E\u0938\u0947\u091F \u0915\u093E \u092A\u094D\u0930\u093E\u0930\u0942\u092A \u0938\u0947\u091F \u0915\u0930\u0947\u0902 \u0924\u093E\u0915\u093F \u0935\u0947 \u0938\u0942\u091A\u093F\u092F\u094B\u0902 \u0915\u0947 \u092C\u091C\u093E\u092F PyTorch \u091F\u0947\u0902\u0938\u0930 \u0932\u094C\u091F\u093E\u090F\u0902\u0964"),Ts=c(),L=n("p"),_a=l("\u0939\u092E\u093E\u0930\u0947 "),ls=n("code"),ha=l("tokenized_datasets"),$a=l(" \u092E\u0947\u0902 \u0909\u0928\u092E\u0947 \u0938\u0947 \u092A\u094D\u0930\u0924\u094D\u092F\u0947\u0915 \u091A\u0930\u0923 \u0915\u0947 \u0932\u093F\u090F \u090F\u0915 \u0935\u093F\u0927\u093F \u0939\u0948:"),Os=c(),d(le.$$.fragment),Ws=c(),Oe=n("p"),ba=l("\u0939\u092E \u092B\u093F\u0930 \u091C\u093E\u0902\u091A \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0915\u093F \u092A\u0930\u093F\u0923\u093E\u092E \u092E\u0947\u0902 \u0915\u0947\u0935\u0932 \u0915\u0949\u0932\u092E \u0939\u0948 \u091C\u093F\u0928\u094D\u0939\u0947\u0902 \u0939\u092E\u093E\u0930\u093E \u092E\u0949\u0921\u0932 \u0938\u094D\u0935\u0940\u0915\u093E\u0930 \u0915\u0930\u0947\u0917\u093E:"),Ms=c(),d(re.$$.fragment),Us=c(),We=n("p"),ka=l("\u0905\u092C \u091C\u092C \u092F\u0939 \u0939\u094B \u0917\u092F\u093E \u0939\u0948, \u0924\u094B \u0939\u092E \u0906\u0938\u093E\u0928\u0940 \u0938\u0947 \u0905\u092A\u0928\u0947 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930\u094D\u0938 \u0915\u094B \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902:"),Ls=c(),d(oe.$$.fragment),Fs=c(),Me=n("p"),va=l("\u092F\u0939 \u091C\u093E\u0902\u091A\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u093F \u0921\u0947\u091F\u093E \u092A\u094D\u0930\u094B\u0938\u0947\u0938\u093F\u0902\u0917 \u092E\u0947\u0902 \u0915\u094B\u0908 \u0917\u0932\u0924\u0940 \u0924\u094B \u0928\u0939\u0940\u0902 \u0939\u0948, \u0939\u092E \u0907\u0938 \u0924\u0930\u0939 \u090F\u0915 \u092C\u0948\u091A \u0915\u093E \u0928\u093F\u0930\u0940\u0915\u094D\u0937\u0923 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902:"),Gs=c(),d(ne.$$.fragment),Ns=c(),d(pe.$$.fragment),Hs=c(),F=n("p"),ja=l("\u0927\u094D\u092F\u093E\u0928 \u0926\u0947\u0902 \u0915\u093F \u0935\u093E\u0938\u094D\u0924\u0935\u093F\u0915 \u0906\u0915\u093E\u0930 \u0906\u092A\u0915\u0947 \u0932\u093F\u090F \u0936\u093E\u092F\u0926 \u0925\u094B\u0921\u093C\u093E \u0905\u0932\u0917 \u0939\u094B\u0917\u093E \u0915\u094D\u092F\u094B\u0902\u0915\u093F \u0939\u092E\u0928\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930 \u0915\u0947 \u0932\u093F\u090F "),rs=n("code"),wa=l("shuffle=True"),ga=l(" \u0938\u0947\u091F \u0915\u093F\u092F\u093E \u0939\u0948 \u0914\u0930 \u0939\u092E \u092C\u0948\u091A \u0915\u0947 \u0905\u0902\u0926\u0930 \u0905\u0927\u093F\u0915\u0924\u092E \u0932\u0902\u092C\u093E\u0908 \u0924\u0915 \u092A\u0948\u0921\u093F\u0902\u0917 \u0915\u0930 \u0930\u0939\u0947 \u0939\u0948\u0902\u0964"),Is=c(),Ue=n("p"),za=l("\u0905\u092C \u091C\u092C\u0915\u093F \u0939\u092E \u0921\u0947\u091F\u093E \u092A\u094D\u0930\u0940\u092A\u094D\u0930\u094B\u0938\u0947\u0938\u093F\u0902\u0917 (\u090F\u0915 \u0938\u0902\u0924\u094B\u0937\u091C\u0928\u0915 \u0932\u0947\u0915\u093F\u0928 \u092E\u093E\u092F\u093E\u0935\u0940 \u0932\u0915\u094D\u0937\u094D\u092F \u0915\u093F\u0938\u0940 \u092D\u0940 ML \u092A\u094D\u0930\u0948\u0915\u094D\u091F\u093F\u0936\u0928\u0930 \u0915\u0947 \u0932\u093F\u090F) \u0915\u0947 \u0938\u093E\u0925 \u092A\u0942\u0930\u0940 \u0924\u0930\u0939 \u0938\u0947 \u0938\u092E\u093E\u092A\u094D\u0924 \u0915\u0930 \u091A\u0941\u0915\u0947 \u0939\u0948\u0902, \u0906\u0907\u090F \u092E\u0949\u0921\u0932 \u0915\u0940 \u0913\u0930 \u092E\u0941\u0921\u093C\u0947\u0902\u0964 \u0939\u092E \u0907\u0938\u0947 \u0920\u0940\u0915 \u0935\u0948\u0938\u0947 \u0939\u0940 \u0907\u0928\u094D\u0938\u094D\u091F\u0948\u0928\u094D\u0936\u0940\u0910\u091F \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u091C\u0948\u0938\u0947 \u0939\u092E\u0928\u0947 \u092A\u093F\u091B\u0932\u0947 \u0938\u0947\u0915\u094D\u0936\u0928 \u092E\u0947\u0902 \u0915\u093F\u092F\u093E \u0925\u093E:"),Bs=c(),d(ie.$$.fragment),Rs=c(),Le=n("p"),Ea=l("\u092F\u0939 \u0938\u0941\u0928\u093F\u0936\u094D\u091A\u093F\u0924 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u093F \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u0947 \u0926\u094C\u0930\u093E\u0928 \u0938\u092C \u0915\u0941\u091B \u0938\u0941\u091A\u093E\u0930\u0942 \u0930\u0942\u092A \u0938\u0947 \u091A\u0932\u0947, \u0939\u092E \u0905\u092A\u0928\u0947 \u092C\u0948\u091A \u0915\u094B \u0907\u0938 \u092E\u0949\u0921\u0932 \u092E\u0947\u0902 \u092A\u093E\u0938 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902:"),Js=c(),d(ce.$$.fragment),Ys=c(),d(me.$$.fragment),Qs=c(),G=n("p"),qa=l("\u0938\u092D\u0940 \u{1F917} \u091F\u094D\u0930\u093E\u0902\u0938\u092B\u0949\u0930\u094D\u092E\u0930 \u092E\u0949\u0921\u0932 \u0932\u0949\u0938 \u0932\u094C\u091F\u093E\u090F\u0902\u0917\u0947 \u091C\u092C "),os=n("code"),ya=l("labels"),Aa=l(" \u092A\u094D\u0930\u0926\u093E\u0928 \u0915\u093F\u092F\u093E \u091C\u093E\u0924\u0947 \u0939\u0948, \u0914\u0930 \u0939\u092E\u0947\u0902 logits \u092D\u0940 \u092E\u093F\u0932\u0924\u0947 \u0939\u0948\u0902 (\u0939\u092E\u093E\u0930\u0947 \u092C\u0948\u091A \u092E\u0947\u0902 \u092A\u094D\u0930\u0924\u094D\u092F\u0947\u0915 \u0907\u0928\u092A\u0941\u091F \u0915\u0947 \u0932\u093F\u090F \u0926\u094B, \u0907\u0938\u0932\u093F\u090F \u091F\u0947\u0902\u0938\u0930 \u0906\u0915\u093E\u0930 \u0915\u093E 8 x 2)\u0964"),Ks=c(),z=n("p"),Ca=l("\u0939\u092E \u0905\u092A\u0928\u093E \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0932\u093F\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0932\u0917\u092D\u0917 \u0924\u0948\u092F\u093E\u0930 \u0939\u0948\u0902! \u0939\u092E \u0915\u0947\u0935\u0932 \u0926\u094B \u091A\u0940\u091C\u0947\u0902 \u0916\u094B \u0930\u0939\u0947 \u0939\u0948\u0902: \u090F\u0915 \u0911\u092A\u094D\u091F\u093F\u092E\u093E\u0907\u091C\u093C\u0930 \u0914\u0930 \u090F\u0915 \u0932\u0930\u094D\u0928\u093F\u0902\u0917 \u0930\u0947\u091F \u0905\u0928\u0941\u0938\u0942\u091A\u0915\u0964 \u091A\u0942\u0902\u0915\u093F "),ns=n("code"),Pa=l("Trainer"),Da=l(" \u091C\u094B \u0915\u0930 \u0930\u0939\u093E \u0925\u093E \u0909\u0938\u0947 \u0939\u092E \u0916\u0941\u0926 \u0938\u0947 \u0926\u094B\u0939\u0930\u093E\u0928\u0947 \u0915\u0940 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930 \u0930\u0939\u0947 \u0939\u0948\u0902, \u0924\u094B \u0939\u092E \u0909\u0928\u094D\u0939\u0940 \u0921\u093F\u092B\u093C\u0949\u0932\u094D\u091F \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0947\u0902\u0917\u0947\u0964 "),ps=n("code"),xa=l("Trainer"),Sa=l(" \u0926\u094D\u0935\u093E\u0930\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u093F\u092F\u093E \u091C\u093E\u0928\u0947 \u0935\u093E\u0932\u093E \u0911\u092A\u094D\u091F\u093F\u092E\u093E\u0907\u091C\u093C\u0930 "),is=n("code"),Ta=l("AdamW"),Oa=l(" \u0939\u0948, \u091C\u094B Adam \u0915\u0947 \u0938\u092E\u093E\u0928 \u0939\u0948, \u0932\u0947\u0915\u093F\u0928 \u090F\u0915 \u092E\u094B\u0921\u093C \u0915\u0947 \u0938\u093E\u0925 \u0935\u091C\u0928 \u0915\u094D\u0937\u092F \u0928\u093F\u092F\u092E\u093F\u0924\u0940\u0915\u0930\u0923 \u0915\u0947 \u0932\u093F\u090F (\u0907\u0932\u094D\u092F\u093E \u0932\u094B\u0936\u093F\u0932\u094B\u0935 \u0914\u0930 \u092B\u094D\u0930\u0948\u0902\u0915 \u0939\u091F\u0930 \u0926\u094D\u0935\u093E\u0930\u093E "),de=n("a"),Wa=l("\u201C\u0921\u0940\u0915\u092A\u0932\u0921 \u0935\u0947\u091F \u0921\u0947\u0915\u0947 \u0930\u0947\u0917\u0941\u0932\u0930\u093E\u0907\u091C\u0947\u0936\u0928\u201D"),Ma=l(" \u0926\u0947\u0916\u0947\u0902):"),Vs=c(),d(ue.$$.fragment),Xs=c(),N=n("p"),Ua=l("\u0905\u0902\u0924 \u092E\u0947\u0902, \u0932\u0930\u094D\u0928\u093F\u0902\u0917 \u0930\u0947\u091F \u0905\u0928\u0941\u0938\u0942\u091A\u0915 \u091C\u093F\u0938\u0947 \u0921\u093F\u092B\u093C\u0949\u0932\u094D\u091F \u0930\u0942\u092A \u0938\u0947 \u0909\u092A\u092F\u094B\u0917 \u0915\u093F\u092F\u093E \u091C\u093E\u0924\u093E \u0939\u0948 \u0915\u0947\u0935\u0932 \u090F\u0915 \u0930\u0948\u0916\u093F\u0915 \u0915\u094D\u0937\u092F \u0939\u0948 \u091C\u094B \u0905\u0927\u093F\u0915\u0924\u092E \u092E\u0942\u0932\u094D\u092F (5e-5) \u0938\u0947 0 \u0924\u0915 \u0939\u0948\u0964 \u0907\u0938\u0947 \u0920\u0940\u0915 \u0938\u0947 \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F, \u0939\u092E\u0947\u0902 \u092F\u0939 \u091C\u093E\u0928\u0928\u093E \u0939\u094B\u0917\u093E \u0915\u093F \u0939\u092E \u0915\u093F\u0924\u0928\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u0926\u092E \u0909\u0920\u093E\u090F\u0902\u0917\u0947, \u091C\u094B \u0915\u093F \u0939\u0948 \u092F\u0941\u0917\u094B\u0902 \u092F\u093E\u0928\u093F \u090F\u092A\u094B\u0915 \u0915\u0940 \u0938\u0902\u0916\u094D\u092F\u093E \u091C\u093F\u0928\u094D\u0939\u0947 \u0939\u092E\u0947 \u0930\u0928 \u0915\u0930\u0928\u093E \u0939\u0948 \u0909\u0938\u0915\u093E \u0917\u0941\u0923\u093E \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u092C\u0948\u091A\u094B\u0902 \u0915\u0940 \u0938\u0902\u0916\u094D\u092F\u093E \u0938\u0947 \u0915\u0930\u0928\u093E (\u091C\u094B \u0915\u093F \u0939\u092E\u093E\u0930\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930 \u0915\u0940 \u0932\u0902\u092C\u093E\u0908 \u0939\u0948)\u0964 "),cs=n("code"),La=l("Trainer"),Fa=l(" \u0921\u093F\u092B\u093C\u0949\u0932\u094D\u091F \u0930\u0942\u092A \u0938\u0947 \u0924\u0940\u0928 \u092F\u0941\u0917\u094B\u0902 \u092F\u093E\u0928\u093F \u090F\u092A\u094B\u0915 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0924\u093E \u0939\u0948, \u0907\u0938\u0932\u093F\u090F \u0939\u092E \u0909\u0938\u0915\u093E \u0905\u0928\u0941\u0938\u0930\u0923 \u0915\u0930\u0947\u0902\u0917\u0947:"),Zs=c(),d(fe.$$.fragment),et=c(),d(_e.$$.fragment),st=c(),he=n("h3"),Ga=l("\u091F\u094D\u0930\u0947\u0928\u093F\u0902\u0917 \u0932\u0942\u092A"),tt=c(),H=n("p"),Na=l("\u090F\u0915 \u0906\u0916\u093F\u0930\u0940 \u092C\u093E\u0924: \u0939\u092E GPU \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0928\u093E \u091A\u093E\u0939\u0947\u0902\u0917\u0947 \u0905\u0917\u0930 \u0939\u092E\u093E\u0930\u0947 \u092A\u093E\u0938 \u090F\u0915 \u0915\u093E \u090F\u0915\u094D\u0938\u0947\u0938 \u0939\u0948 \u0924\u094B (CPU \u092A\u0930, \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u092E\u0947\u0902 \u0915\u0941\u091B \u092E\u093F\u0928\u091F\u094B\u0902 \u0915\u0947 \u092C\u091C\u093E\u092F \u0915\u0908 \u0918\u0902\u091F\u0947 \u0932\u0917 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902)\u0964 \u0910\u0938\u093E \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F, \u0939\u092E \u090F\u0915 "),ms=n("code"),Ha=l("device"),Ia=l(" \u0915\u094B \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930\u0947\u0902\u0917\u0947, \u091C\u093F\u0938 \u092A\u0930 \u0939\u092E \u0905\u092A\u0928\u0947 \u092E\u0949\u0921\u0932 \u0915\u094B \u0914\u0930 \u0905\u092A\u0928\u0947 \u092C\u0948\u091A\u094B\u0902 \u0915\u094B \u0930\u0916\u0947\u0902\u0917\u0947:"),at=c(),d($e.$$.fragment),lt=c(),d(be.$$.fragment),rt=c(),I=n("p"),Ba=l("\u0905\u092C \u0939\u092E \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u0947 \u0932\u093F\u090F \u0924\u0948\u092F\u093E\u0930 \u0939\u0948\u0902! \u092F\u0939 \u091C\u093E\u0928\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u093F \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u092C \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0917\u093E, \u0939\u092E "),ds=n("code"),Ra=l("tqdm"),Ja=l(" \u0932\u093E\u0907\u092C\u094D\u0930\u0947\u0930\u0940 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0915\u0947 \u0905\u092A\u0928\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u091A\u0930\u0923\u094B\u0902 \u0915\u0940 \u0938\u0902\u0916\u094D\u092F\u093E \u092A\u0930 \u090F\u0915 \u092A\u094D\u0930\u0917\u0924\u093F \u092A\u091F\u094D\u091F\u0940 \u091C\u094B\u095C\u0947\u0917\u0947:"),ot=c(),d(ke.$$.fragment),nt=c(),Fe=n("p"),Ya=l("\u0906\u092A \u0926\u0947\u0916 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0915\u093F \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u093E \u092E\u0942\u0932 \u091C\u094B \u092A\u0930\u093F\u091A\u092F \u092E\u0947\u0902 \u0939\u0948 \u0909\u0938\u0915\u0947 \u0938\u092E\u093E\u0928 \u0926\u093F\u0916\u0924\u093E \u0939\u0948\u0964 \u0939\u092E\u0928\u0947 \u0915\u094B\u0908 \u0930\u093F\u092A\u094B\u0930\u094D\u091F\u093F\u0902\u0917 \u0928\u0939\u0940\u0902 \u092E\u093E\u0902\u0917\u0940, \u0907\u0938\u0932\u093F\u090F \u092F\u0939 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0939\u092E\u0947\u0902 \u0907\u0938 \u092C\u093E\u0930\u0947 \u092E\u0947\u0902 \u0915\u0941\u091B \u0928\u0939\u0940\u0902 \u092C\u0924\u093E\u090F\u0917\u093E \u0915\u093F \u092E\u0949\u0921\u0932 \u0915\u093E \u0915\u093F\u0930\u093E\u092F\u093E \u0915\u0948\u0938\u093E \u0939\u0948\u0964 \u0939\u092E\u0947\u0902 \u0909\u0938\u0915\u0947 \u0932\u093F\u090F \u090F\u0915 \u092E\u0942\u0932\u094D\u092F\u093E\u0902\u0915\u0928 \u0932\u0942\u092A \u091C\u094B\u0921\u093C\u0928\u0947 \u0915\u0940 \u091C\u0930\u0942\u0930\u0924 \u0939\u0948\u0964"),pt=c(),ve=n("h3"),Qa=l("\u092E\u0942\u0932\u094D\u092F\u093E\u0902\u0915\u0928 \u0932\u0942\u092A"),it=c(),q=n("p"),Ka=l("\u091C\u0948\u0938\u093E \u0915\u093F \u0939\u092E\u0928\u0947 \u092A\u0939\u0932\u0947 \u0915\u093F\u092F\u093E \u0925\u093E, \u0939\u092E \u{1F917} \u0921\u0947\u091F\u093E\u0938\u0947\u091F \u0932\u093E\u0907\u092C\u094D\u0930\u0947\u0930\u0940 \u0926\u094D\u0935\u093E\u0930\u093E \u092A\u094D\u0930\u0926\u093E\u0928 \u0915\u093F\u090F \u0917\u090F \u092E\u0940\u091F\u094D\u0930\u093F\u0915 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0947\u0902\u0917\u0947\u0964 \u0939\u092E \u092A\u0939\u0932\u0947 \u0939\u0940 "),us=n("code"),Va=l("metric.compute()"),Xa=l(" \u0935\u093F\u0927\u093F \u0926\u0947\u0916 \u091A\u0941\u0915\u0947 \u0939\u0948\u0902, \u0932\u0947\u0915\u093F\u0928 \u092E\u0947\u091F\u094D\u0930\u093F\u0915\u094D\u0938 \u0935\u093E\u0938\u094D\u0924\u0935 \u092E\u0947\u0902 \u0939\u092E\u093E\u0930\u0947 \u0932\u093F\u090F \u092C\u0948\u091A \u091C\u092E\u093E \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u091C\u092C \u0939\u092E \u092D\u0935\u093F\u0937\u094D\u092F\u0935\u093E\u0923\u0940 \u0932\u0942\u092A \u092A\u0930 \u091C\u093E\u0924\u0947 \u0939\u0948\u0902 "),fs=n("code"),Za=l("add_batch()"),el=l(" \u0935\u093F\u0927\u093F \u0915\u0947 \u0938\u093E\u0925 \u0964 \u090F\u0915 \u092C\u093E\u0930 \u091C\u092C \u0939\u092E \u0938\u092D\u0940 \u092C\u0948\u091A\u094B\u0902 \u0915\u094B \u091C\u092E\u093E \u0915\u0930 \u0932\u0947\u0924\u0947 \u0939\u0948\u0902, \u0924\u094B \u0939\u092E "),_s=n("code"),sl=l("metric.compute()"),tl=l(" \u0915\u0947 \u0938\u093E\u0925 \u0905\u0902\u0924\u093F\u092E \u092A\u0930\u093F\u0923\u093E\u092E \u092A\u094D\u0930\u093E\u092A\u094D\u0924 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902\u0964 \u092E\u0942\u0932\u094D\u092F\u093E\u0902\u0915\u0928 \u0932\u0942\u092A \u092E\u0947\u0902 \u0907\u0928 \u0938\u092D\u0940 \u0915\u094B \u0915\u093E\u0930\u094D\u092F\u093E\u0928\u094D\u0935\u093F\u0924 \u0915\u0930\u0928\u0947 \u0915\u093E \u0924\u0930\u0940\u0915\u093E \u092F\u0939\u093E\u0902 \u0926\u093F\u092F\u093E \u0917\u092F\u093E \u0939\u0948:"),ct=c(),d(je.$$.fragment),mt=c(),d(we.$$.fragment),dt=c(),Ge=n("p"),al=l("\u092B\u093F\u0930 \u0938\u0947, \u092E\u0949\u0921\u0932 \u0939\u0947\u0921 \u0907\u0928\u093F\u0936\u093F\u092F\u0932\u093E\u0907\u091C\u093C\u0947\u0936\u0928 \u0914\u0930 \u0921\u0947\u091F\u093E \u092B\u0947\u0930\u092C\u0926\u0932 \u092E\u0947\u0902 \u0915\u094D\u0930\u092E\u0930\u0939\u093F\u0924 \u0939\u094B\u0928\u0947 \u0915\u0947 \u0915\u093E\u0930\u0923 \u0906\u092A\u0915\u0947 \u092A\u0930\u093F\u0923\u093E\u092E \u0925\u094B\u0921\u093C\u0947 \u092D\u093F\u0928\u094D\u0928 \u0939\u094B\u0902\u0917\u0947, \u0932\u0947\u0915\u093F\u0928 \u0935\u0947 \u090F\u0915 \u0939\u0940 \u092C\u0949\u0932\u092A\u093E\u0930\u094D\u0915 \u092E\u0947\u0902 \u0939\u094B\u0928\u0947 \u091A\u093E\u0939\u093F\u090F\u0964"),ut=c(),d(B.$$.fragment),ft=c(),W=n("h3"),R=n("a"),hs=n("span"),d(ge.$$.fragment),ll=c(),$s=n("span"),rl=l("\u0905\u092A\u0928\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u094B \u0938\u0941\u092A\u0930\u091A\u093E\u0930\u094D\u091C \u0915\u0930\u0947\u0902 \u{1F917} Accelerate \u0915\u0947 \u0938\u093E\u0925\u0964"),_t=c(),d(ze.$$.fragment),ht=c(),J=n("p"),ol=l("\u0939\u092E\u0928\u0947 \u092A\u0939\u0932\u0947 \u091C\u094B \u091F\u094D\u0930\u0947\u0928\u093F\u0902\u0917 \u0932\u0942\u092A \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u093F\u092F\u093E \u0925\u093E, \u0935\u0939 \u0938\u093F\u0902\u0917\u0932 CPU \u092F\u093E GPU \u092A\u0930 \u0920\u0940\u0915 \u0915\u093E\u092E \u0915\u0930\u0924\u093E \u0939\u0948\u0964 \u0932\u0947\u0915\u093F\u0928  "),Ee=n("a"),nl=l("\u{1F917} Accelerate"),pl=l(" \u0932\u093E\u0907\u092C\u094D\u0930\u0947\u0930\u0940 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0915\u0947, \u092C\u0938 \u0915\u0941\u091B \u0938\u092E\u093E\u092F\u094B\u091C\u0928 \u0915\u0947 \u0938\u093E\u0925 \u0939\u092E \u0915\u0908 GPUs \u092F\u093E TPUs \u092A\u0930 \u0935\u093F\u0924\u0930\u093F\u0924 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u094B \u0938\u0915\u094D\u0937\u092E \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902\u0964 \u0936\u0941\u0930\u0941\u0906\u0924 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0914\u0930 \u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0921\u0947\u091F\u093E \u0932\u094B\u0921\u0930 \u0915\u0947 \u0928\u093F\u0930\u094D\u092E\u093E\u0923 \u0938\u0947 \u0939\u0941\u0908, \u092F\u0939\u093E\u0901 \u0939\u092E\u093E\u0930\u093E \u092E\u0948\u0928\u0941\u0905\u0932 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u0948\u0938\u093E \u0926\u093F\u0916\u0924\u093E \u0939\u0948:"),$t=c(),d(qe.$$.fragment),bt=c(),Ne=n("p"),il=l("\u0914\u0930 \u092A\u0930\u093F\u0935\u0930\u094D\u0924\u0928 \u092F\u0939\u093E\u0901 \u0939\u0948\u0902:"),kt=c(),d(ye.$$.fragment),vt=c(),y=n("p"),cl=l("\u0938\u092C\u0938\u0947 \u092A\u0939\u0932\u0940 \u0932\u093E\u0907\u0928 \u091C\u094B \u091C\u094B\u0921\u093C\u0928\u0940 \u0939\u0948 \u0935\u094B \u0939\u0948 \u0907\u092E\u094D\u092A\u094B\u0930\u094D\u091F \u0932\u093E\u0907\u0928\u0964 \u0926\u0942\u0938\u0930\u0940 \u0932\u093E\u0907\u0928 \u090F\u0915 "),bs=n("code"),ml=l("Accelerator"),dl=l(" \u0935\u0938\u094D\u0924\u0941 \u0915\u094B \u0907\u0928\u094D\u0938\u094D\u091F\u0948\u0928\u094D\u0936\u0940\u0910\u091F \u0915\u0930\u0924\u0940 \u0939\u0948 \u091C\u094B \u0935\u093E\u0924\u093E\u0935\u0930\u0923 \u0915\u094B \u0926\u0947\u0916\u0947\u0917\u0940 \u0914\u0930 \u0909\u091A\u093F\u0924 \u0935\u093F\u0924\u0930\u093F\u0924 \u0938\u0947\u091F\u0905\u092A \u0915\u094B \u0907\u0928\u093F\u0936\u093F\u092F\u0932\u093E\u0907\u091C\u093C \u0915\u0930\u0947\u0917\u0940\u0964 \u{1F917} Accelerate \u0906\u092A\u0915\u0947 \u0932\u093F\u090F \u0921\u093F\u0935\u093E\u0907\u0938 \u092A\u094D\u0932\u0947\u0938\u092E\u0947\u0902\u091F \u0915\u094B \u0939\u0948\u0902\u0921\u0932 \u0915\u0930\u0924\u093E \u0939\u0948, \u0924\u093E\u0915\u093F \u0906\u092A \u0909\u0928 \u0932\u093E\u0907\u0928\u094B\u0902 \u0915\u094B \u0939\u091F\u093E \u0938\u0915\u0947\u0902 \u091C\u094B \u092E\u0949\u0921\u0932 \u0915\u094B \u0921\u093F\u0935\u093E\u0907\u0938 \u092A\u0930 \u0930\u0916\u0924\u0940 \u0939\u0948\u0902 (\u092F\u093E, \u092F\u0926\u093F \u0906\u092A \u091A\u093E\u0939\u0947\u0902, \u0924\u094B \u0909\u0928\u094D\u0939\u0947\u0902 "),ks=n("code"),ul=l("device"),fl=l(" \u0915\u0947 \u092C\u091C\u093E\u092F "),vs=n("code"),_l=l("accelerator.device"),hl=l(" \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u092C\u0926\u0932\u0947\u0902)\u0964"),jt=c(),v=n("p"),$l=l("\u092B\u093F\u0930 \u0915\u093E\u092E \u0915\u093E \u092E\u0941\u0916\u094D\u092F \u0939\u093F\u0938\u094D\u0938\u093E \u0909\u0938 \u0932\u093E\u0907\u0928 \u092E\u0947\u0902 \u0915\u093F\u092F\u093E \u091C\u093E\u0924\u093E \u0939\u0948 \u091C\u094B \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930\u094D\u0938, \u092E\u0949\u0921\u0932 \u0914\u0930 \u0911\u092A\u094D\u091F\u093F\u092E\u093E\u0907\u091C\u093C\u0930 \u0915\u094B "),js=n("code"),bl=l("accelerator.prepare()"),kl=l(" \u092A\u0930 \u092D\u0947\u091C\u0924\u093E \u0939\u0948\u0964 \u092F\u0939 \u0909\u0928 \u0935\u0938\u094D\u0924\u0941\u0913\u0902 \u0915\u094B \u0909\u091A\u093F\u0924 \u0915\u0902\u091F\u0947\u0928\u0930 \u092E\u0947\u0902 \u0932\u092A\u0947\u091F \u0926\u0947\u0917\u093E \u0924\u093E\u0915\u093F \u092F\u0939 \u0938\u0941\u0928\u093F\u0936\u094D\u091A\u093F\u0924 \u0939\u094B \u0938\u0915\u0947 \u0915\u093F \u0906\u092A\u0915\u093E \u0935\u093F\u0924\u0930\u093F\u0924 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F \u0915\u0947 \u0905\u0928\u0941\u0938\u093E\u0930 \u0915\u093E\u092E \u0915\u0930\u0924\u093E \u0939\u0948\u0964 \u0936\u0947\u0937 \u092A\u0930\u093F\u0935\u0930\u094D\u0924\u0928 \u0939\u0948 \u0909\u0938 \u0932\u093E\u0907\u0928 \u0915\u094B \u0939\u091F\u093E\u0928\u093E \u091C\u094B \u092C\u0948\u091A \u0915\u094B "),ws=n("code"),vl=l("device"),jl=l(" \u092A\u0930 \u0930\u0916\u0924\u093E \u0939\u0948 (\u092B\u093F\u0930 \u0938\u0947, \u092F\u0926\u093F \u0906\u092A \u0907\u0938\u0947 \u0930\u0916\u0928\u093E \u091A\u093E\u0939\u0924\u0947 \u0939\u0948\u0902 \u0924\u094B \u0906\u092A \u0907\u0938\u0947 \u0915\u0947\u0935\u0932 "),gs=n("code"),wl=l("accelerator.device"),gl=l(" \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u092C\u0926\u0932 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902) \u0914\u0930 "),zs=n("code"),zl=l("loss.backward()"),El=l(" \u0915\u094B "),Es=n("code"),ql=l("accelerator.backward(loss)"),yl=l(" \u0915\u0947 \u0938\u093E\u0925 \u092C\u0926\u0932\u0928\u093E\u0964"),wt=c(),d(Y.$$.fragment),gt=c(),He=n("p"),Al=l("\u092F\u0926\u093F \u0906\u092A \u0907\u0938\u0947 \u0916\u0947\u0932\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u0949\u092A\u0940 \u0914\u0930 \u092A\u0947\u0938\u094D\u091F \u0915\u0930\u0928\u093E \u091A\u093E\u0939\u0924\u0947 \u0939\u0948\u0902, \u0924\u094B \u092F\u0939\u093E\u0902 \u092C\u0924\u093E\u092F\u093E \u0917\u092F\u093E \u0939\u0948 \u0915\u093F \u{1F917} Accelerate \u0915\u0947 \u0938\u093E\u0925 \u092A\u0942\u0930\u093E \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u0948\u0938\u093E \u0926\u093F\u0916\u0924\u093E \u0939\u0948:"),zt=c(),d(Ae.$$.fragment),Et=c(),Q=n("p"),Cl=l("\u0907\u0938\u0947 \u090F\u0915 "),qs=n("code"),Pl=l("train.py"),Dl=l(" \u0938\u094D\u0915\u094D\u0930\u093F\u092A\u094D\u091F \u092E\u0947\u0902 \u0930\u0916\u0928\u0947 \u0938\u0947 \u0935\u0939 \u0938\u094D\u0915\u094D\u0930\u093F\u092A\u094D\u091F \u0915\u093F\u0938\u0940 \u092D\u0940 \u092A\u094D\u0930\u0915\u093E\u0930 \u0915\u0947 \u0935\u093F\u0924\u0930\u093F\u0924 \u0938\u0947\u091F\u0905\u092A \u092A\u0930 \u091A\u0932\u0928\u0947 \u092F\u094B\u0917\u094D\u092F \u0939\u094B \u091C\u093E\u090F\u0917\u0940\u0964 \u0907\u0938\u0947 \u0905\u092A\u0928\u0947 \u0935\u093F\u0924\u0930\u093F\u0924 \u0938\u0947\u091F\u0905\u092A \u092E\u0947\u0902 \u0906\u091C\u093C\u092E\u093E\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F, \u0915\u092E\u093E\u0902\u0921 \u091A\u0932\u093E\u090F\u0901:"),qt=c(),d(Ce.$$.fragment),yt=c(),Ie=n("p"),xl=l("\u091C\u094B \u0906\u092A\u0915\u094B \u0915\u0941\u091B \u0938\u0935\u093E\u0932\u094B\u0902 \u0915\u0947 \u091C\u0935\u093E\u092C \u0926\u0947\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u092A\u094D\u0930\u0947\u0930\u093F\u0924 \u0915\u0930\u0947\u0917\u093E \u0914\u0930 \u0907\u0938 \u0915\u092E\u093E\u0902\u0921 \u0926\u094D\u0935\u093E\u0930\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0940 \u091C\u093E\u0928\u0947 \u0935\u093E\u0932\u0940 \u0915\u0949\u0928\u094D\u092B\u093C\u093F\u0917\u0930\u0947\u0936\u0928 \u092B\u093C\u093E\u0907\u0932 \u092E\u0947\u0902 \u0906\u092A\u0915\u0947 \u0909\u0924\u094D\u0924\u0930\u094B\u0902 \u0915\u094B \u0921\u0902\u092A \u0915\u0930 \u0926\u0947\u0917\u093E:"),At=c(),d(Pe.$$.fragment),Ct=c(),Be=n("p"),Sl=l("\u091C\u094B \u0935\u093F\u0924\u0930\u093F\u0924 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u094B \u0936\u0941\u0930\u0942 \u0915\u0930\u0947\u0917\u093E\u0964"),Pt=c(),K=n("p"),Tl=l("\u092F\u0926\u093F \u0906\u092A \u0907\u0938\u0947 \u0928\u094B\u091F\u092C\u0941\u0915 \u092E\u0947\u0902 \u0906\u091C\u093C\u092E\u093E\u0928\u093E \u091A\u093E\u0939\u0924\u0947 \u0939\u0948\u0902 (\u0909\u0926\u093E\u0939\u0930\u0923 \u0915\u0947 \u0932\u093F\u090F, Colab \u092A\u0930 TPUs \u0915\u0947 \u0938\u093E\u0925 \u0907\u0938\u0915\u093E \u092A\u0930\u0940\u0915\u094D\u0937\u0923 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F), \u0924\u094B \u092C\u0938 \u0915\u094B\u0921 \u0915\u094B "),ys=n("code"),Ol=l("training_function()"),Wl=l(" \u092E\u0947\u0902 \u092A\u0947\u0938\u094D\u091F \u0915\u0930\u0947\u0902 \u0914\u0930 \u090F\u0915 \u0905\u0902\u0924\u093F\u092E \u0938\u0947\u0932 \u091A\u0932\u093E\u090F\u0901 \u0938\u093E\u0925 \u092E\u0947\u0902:"),Dt=c(),d(De.$$.fragment),xt=c(),V=n("p"),Ml=l("\u0906\u092A \u0915\u0908 \u0905\u0927\u093F\u0915 \u0909\u0926\u093E\u0939\u0930\u0923 "),xe=n("a"),Ul=l("\u{1F917} Accelerate repo"),Ll=l(" \u092E\u0947\u0902 \u092A\u093E \u0938\u0915\u0924\u0947 \u0939\u0948\u0964"),this.h()},l(e){const a=Nr('[data-svelte="svelte-1phssyn"]',document.head);b=p(a,"META",{name:!0,content:!0}),a.forEach(s),g=m(e),w=p(e,"H1",{id:!0});var As=i(w);se=r(As,"\u090F\u0915 \u092A\u0942\u0930\u094D\u0923 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923"),As.forEach(s),M=m(e),u(E.$$.fragment,e),C=m(e),u(D.$$.fragment,e),Cs=m(e),U=p(e,"P",{});var Se=i(U);Bt=r(Se,"\u0905\u092C \u0939\u092E \u0926\u0947\u0916\u0947\u0902\u0917\u0947 \u0915\u093F "),Qe=p(Se,"CODE",{});var Fl=i(Qe);Rt=r(Fl,"Trainer"),Fl.forEach(s),Jt=r(Se," \u0915\u094D\u0932\u093E\u0938 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u093F\u090F \u092C\u093F\u0928\u093E \u0915\u0948\u0938\u0947 \u0939\u092E \u0938\u092E\u093E\u0928  \u092A\u0930\u093F\u0923\u093E\u092E \u092A\u094D\u0930\u093E\u092A\u094D\u0924 \u0915\u0930\u0947 \u091C\u0948\u0938\u093E \u0915\u0940 \u0939\u092E\u0928\u0947 \u092A\u093F\u091B\u0932\u0947 \u0916\u0902\u0921 \u092A\u094D\u0930\u093E\u092A\u094D\u0924 \u0915\u093F\u092F\u093E \u0925\u093E\u0964 \u092B\u093F\u0930 \u0938\u0947, \u0939\u092E \u092E\u093E\u0928\u0924\u0947 \u0939\u0948\u0902 \u0915\u093F \u0906\u092A\u0928\u0947 \u0905\u0928\u0941\u092D\u093E\u0917 2 \u092E\u0947\u0902 \u0921\u0947\u091F\u093E \u092A\u094D\u0930\u0938\u0902\u0938\u094D\u0915\u0930\u0923 \u092F\u093E\u0928\u093F \u0921\u0947\u091F\u093E \u092A\u094D\u0930\u094B\u0938\u0947\u0938\u093F\u0902\u0917 \u0915\u0930 \u0932\u0940 \u0939\u0948\u0964 \u092F\u0939\u093E\u0902 \u090F\u0915 \u0938\u0902\u0915\u094D\u0937\u093F\u092A\u094D\u0924 \u0938\u093E\u0930\u093E\u0902\u0936 \u0926\u093F\u092F\u093E \u0917\u092F\u093E \u0939\u0948 \u091C\u094B \u0935\u0939 \u0938\u092C \u0915\u0941\u091B \u0936\u093E\u092E\u093F\u0932 \u0915\u0930 \u0930\u0939\u093E \u0939\u0948 \u091C\u093F\u0938\u0915\u0940 \u0906\u092A\u0915\u094B \u0906\u0935\u0936\u094D\u092F\u0915\u0924\u093E \u0939\u094B\u0917\u0940:"),Se.forEach(s),Ps=m(e),u(te.$$.fragment,e),Ds=m(e),ae=p(e,"H3",{id:!0});var Gl=i(ae);Yt=r(Gl,"\u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u0947 \u0932\u093F\u090F \u0924\u0948\u092F\u093E\u0930 \u0915\u0930\u0947\u0902"),Gl.forEach(s),xs=m(e),x=p(e,"P",{});var Re=i(x);Qt=r(Re,"\u0939\u092E\u093E\u0930\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0935\u093E\u0938\u094D\u0924\u0935 \u092E\u0947\u0902 \u0932\u093F\u0916\u0928\u0947 \u0938\u0947 \u092A\u0939\u0932\u0947, \u0939\u092E\u0947\u0902 \u0915\u0941\u091B \u0935\u0938\u094D\u0924\u0941\u0913\u0902 \u0915\u094B \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930\u0928\u0947 \u0915\u0940 \u0906\u0935\u0936\u094D\u092F\u0915\u0924\u093E \u0939\u094B\u0917\u0940\u0964 \u092A\u0939\u0932\u0947 \u0939\u0948 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930\u094D\u0938  \u091C\u093F\u0928\u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0939\u092E \u092C\u0948\u091A\u094B\u0902 \u092A\u0930 \u092A\u0941\u0928\u0930\u093E\u0935\u0943\u0924\u093F \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u0930\u0947\u0902\u0917\u0947\u0964 \u0932\u0947\u0915\u093F\u0928 \u0907\u0938\u0938\u0947 \u092A\u0939\u0932\u0947 \u0915\u093F \u0939\u092E \u0909\u0928 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930\u094D\u0938 \u0915\u094B \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930 \u0938\u0915\u0947, \u0939\u092E\u0947\u0902 \u0905\u092A\u0928\u0947 "),Ke=p(Re,"CODE",{});var Nl=i(Ke);Kt=r(Nl,"tokenized_datasets"),Nl.forEach(s),Vt=r(Re," \u092E\u0947\u0902 \u0915\u0941\u091B \u092A\u094B\u0938\u094D\u091F\u092A\u094D\u0930\u094B\u0938\u0947\u0938\u093F\u0902\u0917 \u0932\u093E\u0917\u0942 \u0915\u0930\u0928\u0947 \u0915\u0940 \u091C\u0930\u0942\u0930\u0924 \u0939\u0948, \u0924\u093E\u0915\u093F \u0915\u0941\u091B \u091A\u0940\u091C\u094B\u0902 \u0915\u093E \u0916\u094D\u092F\u093E\u0932 \u0930\u0916\u093E \u091C\u093E \u0938\u0915\u0947 \u091C\u094B "),Ve=p(Re,"CODE",{});var Hl=i(Ve);Xt=r(Hl,"Trainer"),Hl.forEach(s),Zt=r(Re," \u0928\u0947 \u0939\u092E\u093E\u0930\u0947 \u0932\u093F\u090F \u0938\u094D\u0935\u091A\u093E\u0932\u093F\u0924 \u0930\u0942\u092A \u0938\u0947 \u0915\u093F\u092F\u093E \u0925\u093E\u0964 \u0935\u093F\u0936\u0947\u0937 \u0930\u0942\u092A \u0938\u0947, \u0939\u092E\u0947\u0902 \u091C\u0930\u0942\u0930\u0924 \u0939\u0948 \u0915\u0940:"),Re.forEach(s),Ss=m(e),S=p(e,"UL",{});var Je=i(S);O=p(Je,"LI",{});var Ye=i(O);ea=r(Ye,"\u0909\u0928 \u0935\u0948\u0932\u094D\u092F\u0942\u091C \u0915\u0947 \u0905\u0928\u0941\u0930\u0942\u092A \u0915\u0949\u0932\u092E \u0928\u093F\u0915\u093E\u0932\u0947\u0902 \u091C\u093F\u0928\u0915\u0940 \u092E\u0949\u0921\u0932 \u0905\u092A\u0947\u0915\u094D\u0937\u093E \u0928\u0939\u0940\u0902 \u0915\u0930\u0924\u093E (\u091C\u0948\u0938\u0947 "),Xe=p(Ye,"CODE",{});var Il=i(Xe);sa=r(Il,"sentence1"),Il.forEach(s),ta=r(Ye," \u0914\u0930 "),Ze=p(Ye,"CODE",{});var Bl=i(Ze);aa=r(Bl,"sentence2"),Bl.forEach(s),la=r(Ye," \u0915\u0949\u0932\u092E)\u0964"),Ye.forEach(s),ra=m(Je),P=p(Je,"LI",{});var X=i(P);oa=r(X,"\u0915\u0949\u0932\u092E "),es=p(X,"CODE",{});var Rl=i(es);na=r(Rl,"label"),Rl.forEach(s),pa=r(X," \u0915\u093E \u0928\u093E\u092E \u092C\u0926\u0932\u0915\u0930 "),ss=p(X,"CODE",{});var Jl=i(ss);ia=r(Jl,"labels"),Jl.forEach(s),ca=r(X," \u0915\u0930 \u0926\u0947\u0902 (\u0915\u094D\u092F\u094B\u0902\u0915\u093F \u092E\u0949\u0921\u0932 \u0909\u092E\u094D\u092E\u0940\u0926 \u0915\u0930\u0924\u093E \u0939\u0948 \u0915\u0940 \u0935\u093F\u0924\u0930\u094D\u0915 \u0915\u093E \u0928\u093E\u092E "),ts=p(X,"CODE",{});var Yl=i(ts);ma=r(Yl,"labels"),Yl.forEach(s),da=r(X," \u0939\u094B)\u0964"),X.forEach(s),ua=m(Je),as=p(Je,"LI",{});var Ql=i(as);fa=r(Ql,"\u0921\u0947\u091F\u093E\u0938\u0947\u091F \u0915\u093E \u092A\u094D\u0930\u093E\u0930\u0942\u092A \u0938\u0947\u091F \u0915\u0930\u0947\u0902 \u0924\u093E\u0915\u093F \u0935\u0947 \u0938\u0942\u091A\u093F\u092F\u094B\u0902 \u0915\u0947 \u092C\u091C\u093E\u092F PyTorch \u091F\u0947\u0902\u0938\u0930 \u0932\u094C\u091F\u093E\u090F\u0902\u0964"),Ql.forEach(s),Je.forEach(s),Ts=m(e),L=p(e,"P",{});var Tt=i(L);_a=r(Tt,"\u0939\u092E\u093E\u0930\u0947 "),ls=p(Tt,"CODE",{});var Kl=i(ls);ha=r(Kl,"tokenized_datasets"),Kl.forEach(s),$a=r(Tt," \u092E\u0947\u0902 \u0909\u0928\u092E\u0947 \u0938\u0947 \u092A\u094D\u0930\u0924\u094D\u092F\u0947\u0915 \u091A\u0930\u0923 \u0915\u0947 \u0932\u093F\u090F \u090F\u0915 \u0935\u093F\u0927\u093F \u0939\u0948:"),Tt.forEach(s),Os=m(e),u(le.$$.fragment,e),Ws=m(e),Oe=p(e,"P",{});var Vl=i(Oe);ba=r(Vl,"\u0939\u092E \u092B\u093F\u0930 \u091C\u093E\u0902\u091A \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0915\u093F \u092A\u0930\u093F\u0923\u093E\u092E \u092E\u0947\u0902 \u0915\u0947\u0935\u0932 \u0915\u0949\u0932\u092E \u0939\u0948 \u091C\u093F\u0928\u094D\u0939\u0947\u0902 \u0939\u092E\u093E\u0930\u093E \u092E\u0949\u0921\u0932 \u0938\u094D\u0935\u0940\u0915\u093E\u0930 \u0915\u0930\u0947\u0917\u093E:"),Vl.forEach(s),Ms=m(e),u(re.$$.fragment,e),Us=m(e),We=p(e,"P",{});var Xl=i(We);ka=r(Xl,"\u0905\u092C \u091C\u092C \u092F\u0939 \u0939\u094B \u0917\u092F\u093E \u0939\u0948, \u0924\u094B \u0939\u092E \u0906\u0938\u093E\u0928\u0940 \u0938\u0947 \u0905\u092A\u0928\u0947 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930\u094D\u0938 \u0915\u094B \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902:"),Xl.forEach(s),Ls=m(e),u(oe.$$.fragment,e),Fs=m(e),Me=p(e,"P",{});var Zl=i(Me);va=r(Zl,"\u092F\u0939 \u091C\u093E\u0902\u091A\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u093F \u0921\u0947\u091F\u093E \u092A\u094D\u0930\u094B\u0938\u0947\u0938\u093F\u0902\u0917 \u092E\u0947\u0902 \u0915\u094B\u0908 \u0917\u0932\u0924\u0940 \u0924\u094B \u0928\u0939\u0940\u0902 \u0939\u0948, \u0939\u092E \u0907\u0938 \u0924\u0930\u0939 \u090F\u0915 \u092C\u0948\u091A \u0915\u093E \u0928\u093F\u0930\u0940\u0915\u094D\u0937\u0923 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902:"),Zl.forEach(s),Gs=m(e),u(ne.$$.fragment,e),Ns=m(e),u(pe.$$.fragment,e),Hs=m(e),F=p(e,"P",{});var Ot=i(F);ja=r(Ot,"\u0927\u094D\u092F\u093E\u0928 \u0926\u0947\u0902 \u0915\u093F \u0935\u093E\u0938\u094D\u0924\u0935\u093F\u0915 \u0906\u0915\u093E\u0930 \u0906\u092A\u0915\u0947 \u0932\u093F\u090F \u0936\u093E\u092F\u0926 \u0925\u094B\u0921\u093C\u093E \u0905\u0932\u0917 \u0939\u094B\u0917\u093E \u0915\u094D\u092F\u094B\u0902\u0915\u093F \u0939\u092E\u0928\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930 \u0915\u0947 \u0932\u093F\u090F "),rs=p(Ot,"CODE",{});var er=i(rs);wa=r(er,"shuffle=True"),er.forEach(s),ga=r(Ot," \u0938\u0947\u091F \u0915\u093F\u092F\u093E \u0939\u0948 \u0914\u0930 \u0939\u092E \u092C\u0948\u091A \u0915\u0947 \u0905\u0902\u0926\u0930 \u0905\u0927\u093F\u0915\u0924\u092E \u0932\u0902\u092C\u093E\u0908 \u0924\u0915 \u092A\u0948\u0921\u093F\u0902\u0917 \u0915\u0930 \u0930\u0939\u0947 \u0939\u0948\u0902\u0964"),Ot.forEach(s),Is=m(e),Ue=p(e,"P",{});var sr=i(Ue);za=r(sr,"\u0905\u092C \u091C\u092C\u0915\u093F \u0939\u092E \u0921\u0947\u091F\u093E \u092A\u094D\u0930\u0940\u092A\u094D\u0930\u094B\u0938\u0947\u0938\u093F\u0902\u0917 (\u090F\u0915 \u0938\u0902\u0924\u094B\u0937\u091C\u0928\u0915 \u0932\u0947\u0915\u093F\u0928 \u092E\u093E\u092F\u093E\u0935\u0940 \u0932\u0915\u094D\u0937\u094D\u092F \u0915\u093F\u0938\u0940 \u092D\u0940 ML \u092A\u094D\u0930\u0948\u0915\u094D\u091F\u093F\u0936\u0928\u0930 \u0915\u0947 \u0932\u093F\u090F) \u0915\u0947 \u0938\u093E\u0925 \u092A\u0942\u0930\u0940 \u0924\u0930\u0939 \u0938\u0947 \u0938\u092E\u093E\u092A\u094D\u0924 \u0915\u0930 \u091A\u0941\u0915\u0947 \u0939\u0948\u0902, \u0906\u0907\u090F \u092E\u0949\u0921\u0932 \u0915\u0940 \u0913\u0930 \u092E\u0941\u0921\u093C\u0947\u0902\u0964 \u0939\u092E \u0907\u0938\u0947 \u0920\u0940\u0915 \u0935\u0948\u0938\u0947 \u0939\u0940 \u0907\u0928\u094D\u0938\u094D\u091F\u0948\u0928\u094D\u0936\u0940\u0910\u091F \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u091C\u0948\u0938\u0947 \u0939\u092E\u0928\u0947 \u092A\u093F\u091B\u0932\u0947 \u0938\u0947\u0915\u094D\u0936\u0928 \u092E\u0947\u0902 \u0915\u093F\u092F\u093E \u0925\u093E:"),sr.forEach(s),Bs=m(e),u(ie.$$.fragment,e),Rs=m(e),Le=p(e,"P",{});var tr=i(Le);Ea=r(tr,"\u092F\u0939 \u0938\u0941\u0928\u093F\u0936\u094D\u091A\u093F\u0924 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u093F \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u0947 \u0926\u094C\u0930\u093E\u0928 \u0938\u092C \u0915\u0941\u091B \u0938\u0941\u091A\u093E\u0930\u0942 \u0930\u0942\u092A \u0938\u0947 \u091A\u0932\u0947, \u0939\u092E \u0905\u092A\u0928\u0947 \u092C\u0948\u091A \u0915\u094B \u0907\u0938 \u092E\u0949\u0921\u0932 \u092E\u0947\u0902 \u092A\u093E\u0938 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902:"),tr.forEach(s),Js=m(e),u(ce.$$.fragment,e),Ys=m(e),u(me.$$.fragment,e),Qs=m(e),G=p(e,"P",{});var Wt=i(G);qa=r(Wt,"\u0938\u092D\u0940 \u{1F917} \u091F\u094D\u0930\u093E\u0902\u0938\u092B\u0949\u0930\u094D\u092E\u0930 \u092E\u0949\u0921\u0932 \u0932\u0949\u0938 \u0932\u094C\u091F\u093E\u090F\u0902\u0917\u0947 \u091C\u092C "),os=p(Wt,"CODE",{});var ar=i(os);ya=r(ar,"labels"),ar.forEach(s),Aa=r(Wt," \u092A\u094D\u0930\u0926\u093E\u0928 \u0915\u093F\u092F\u093E \u091C\u093E\u0924\u0947 \u0939\u0948, \u0914\u0930 \u0939\u092E\u0947\u0902 logits \u092D\u0940 \u092E\u093F\u0932\u0924\u0947 \u0939\u0948\u0902 (\u0939\u092E\u093E\u0930\u0947 \u092C\u0948\u091A \u092E\u0947\u0902 \u092A\u094D\u0930\u0924\u094D\u092F\u0947\u0915 \u0907\u0928\u092A\u0941\u091F \u0915\u0947 \u0932\u093F\u090F \u0926\u094B, \u0907\u0938\u0932\u093F\u090F \u091F\u0947\u0902\u0938\u0930 \u0906\u0915\u093E\u0930 \u0915\u093E 8 x 2)\u0964"),Wt.forEach(s),Ks=m(e),z=p(e,"P",{});var T=i(z);Ca=r(T,"\u0939\u092E \u0905\u092A\u0928\u093E \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0932\u093F\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0932\u0917\u092D\u0917 \u0924\u0948\u092F\u093E\u0930 \u0939\u0948\u0902! \u0939\u092E \u0915\u0947\u0935\u0932 \u0926\u094B \u091A\u0940\u091C\u0947\u0902 \u0916\u094B \u0930\u0939\u0947 \u0939\u0948\u0902: \u090F\u0915 \u0911\u092A\u094D\u091F\u093F\u092E\u093E\u0907\u091C\u093C\u0930 \u0914\u0930 \u090F\u0915 \u0932\u0930\u094D\u0928\u093F\u0902\u0917 \u0930\u0947\u091F \u0905\u0928\u0941\u0938\u0942\u091A\u0915\u0964 \u091A\u0942\u0902\u0915\u093F "),ns=p(T,"CODE",{});var lr=i(ns);Pa=r(lr,"Trainer"),lr.forEach(s),Da=r(T," \u091C\u094B \u0915\u0930 \u0930\u0939\u093E \u0925\u093E \u0909\u0938\u0947 \u0939\u092E \u0916\u0941\u0926 \u0938\u0947 \u0926\u094B\u0939\u0930\u093E\u0928\u0947 \u0915\u0940 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930 \u0930\u0939\u0947 \u0939\u0948\u0902, \u0924\u094B \u0939\u092E \u0909\u0928\u094D\u0939\u0940 \u0921\u093F\u092B\u093C\u0949\u0932\u094D\u091F \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0947\u0902\u0917\u0947\u0964 "),ps=p(T,"CODE",{});var rr=i(ps);xa=r(rr,"Trainer"),rr.forEach(s),Sa=r(T," \u0926\u094D\u0935\u093E\u0930\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u093F\u092F\u093E \u091C\u093E\u0928\u0947 \u0935\u093E\u0932\u093E \u0911\u092A\u094D\u091F\u093F\u092E\u093E\u0907\u091C\u093C\u0930 "),is=p(T,"CODE",{});var or=i(is);Ta=r(or,"AdamW"),or.forEach(s),Oa=r(T," \u0939\u0948, \u091C\u094B Adam \u0915\u0947 \u0938\u092E\u093E\u0928 \u0939\u0948, \u0932\u0947\u0915\u093F\u0928 \u090F\u0915 \u092E\u094B\u0921\u093C \u0915\u0947 \u0938\u093E\u0925 \u0935\u091C\u0928 \u0915\u094D\u0937\u092F \u0928\u093F\u092F\u092E\u093F\u0924\u0940\u0915\u0930\u0923 \u0915\u0947 \u0932\u093F\u090F (\u0907\u0932\u094D\u092F\u093E \u0932\u094B\u0936\u093F\u0932\u094B\u0935 \u0914\u0930 \u092B\u094D\u0930\u0948\u0902\u0915 \u0939\u091F\u0930 \u0926\u094D\u0935\u093E\u0930\u093E "),de=p(T,"A",{href:!0,rel:!0});var nr=i(de);Wa=r(nr,"\u201C\u0921\u0940\u0915\u092A\u0932\u0921 \u0935\u0947\u091F \u0921\u0947\u0915\u0947 \u0930\u0947\u0917\u0941\u0932\u0930\u093E\u0907\u091C\u0947\u0936\u0928\u201D"),nr.forEach(s),Ma=r(T," \u0926\u0947\u0916\u0947\u0902):"),T.forEach(s),Vs=m(e),u(ue.$$.fragment,e),Xs=m(e),N=p(e,"P",{});var Mt=i(N);Ua=r(Mt,"\u0905\u0902\u0924 \u092E\u0947\u0902, \u0932\u0930\u094D\u0928\u093F\u0902\u0917 \u0930\u0947\u091F \u0905\u0928\u0941\u0938\u0942\u091A\u0915 \u091C\u093F\u0938\u0947 \u0921\u093F\u092B\u093C\u0949\u0932\u094D\u091F \u0930\u0942\u092A \u0938\u0947 \u0909\u092A\u092F\u094B\u0917 \u0915\u093F\u092F\u093E \u091C\u093E\u0924\u093E \u0939\u0948 \u0915\u0947\u0935\u0932 \u090F\u0915 \u0930\u0948\u0916\u093F\u0915 \u0915\u094D\u0937\u092F \u0939\u0948 \u091C\u094B \u0905\u0927\u093F\u0915\u0924\u092E \u092E\u0942\u0932\u094D\u092F (5e-5) \u0938\u0947 0 \u0924\u0915 \u0939\u0948\u0964 \u0907\u0938\u0947 \u0920\u0940\u0915 \u0938\u0947 \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F, \u0939\u092E\u0947\u0902 \u092F\u0939 \u091C\u093E\u0928\u0928\u093E \u0939\u094B\u0917\u093E \u0915\u093F \u0939\u092E \u0915\u093F\u0924\u0928\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u0926\u092E \u0909\u0920\u093E\u090F\u0902\u0917\u0947, \u091C\u094B \u0915\u093F \u0939\u0948 \u092F\u0941\u0917\u094B\u0902 \u092F\u093E\u0928\u093F \u090F\u092A\u094B\u0915 \u0915\u0940 \u0938\u0902\u0916\u094D\u092F\u093E \u091C\u093F\u0928\u094D\u0939\u0947 \u0939\u092E\u0947 \u0930\u0928 \u0915\u0930\u0928\u093E \u0939\u0948 \u0909\u0938\u0915\u093E \u0917\u0941\u0923\u093E \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u092C\u0948\u091A\u094B\u0902 \u0915\u0940 \u0938\u0902\u0916\u094D\u092F\u093E \u0938\u0947 \u0915\u0930\u0928\u093E (\u091C\u094B \u0915\u093F \u0939\u092E\u093E\u0930\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930 \u0915\u0940 \u0932\u0902\u092C\u093E\u0908 \u0939\u0948)\u0964 "),cs=p(Mt,"CODE",{});var pr=i(cs);La=r(pr,"Trainer"),pr.forEach(s),Fa=r(Mt," \u0921\u093F\u092B\u093C\u0949\u0932\u094D\u091F \u0930\u0942\u092A \u0938\u0947 \u0924\u0940\u0928 \u092F\u0941\u0917\u094B\u0902 \u092F\u093E\u0928\u093F \u090F\u092A\u094B\u0915 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0924\u093E \u0939\u0948, \u0907\u0938\u0932\u093F\u090F \u0939\u092E \u0909\u0938\u0915\u093E \u0905\u0928\u0941\u0938\u0930\u0923 \u0915\u0930\u0947\u0902\u0917\u0947:"),Mt.forEach(s),Zs=m(e),u(fe.$$.fragment,e),et=m(e),u(_e.$$.fragment,e),st=m(e),he=p(e,"H3",{id:!0});var ir=i(he);Ga=r(ir,"\u091F\u094D\u0930\u0947\u0928\u093F\u0902\u0917 \u0932\u0942\u092A"),ir.forEach(s),tt=m(e),H=p(e,"P",{});var Ut=i(H);Na=r(Ut,"\u090F\u0915 \u0906\u0916\u093F\u0930\u0940 \u092C\u093E\u0924: \u0939\u092E GPU \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0928\u093E \u091A\u093E\u0939\u0947\u0902\u0917\u0947 \u0905\u0917\u0930 \u0939\u092E\u093E\u0930\u0947 \u092A\u093E\u0938 \u090F\u0915 \u0915\u093E \u090F\u0915\u094D\u0938\u0947\u0938 \u0939\u0948 \u0924\u094B (CPU \u092A\u0930, \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u092E\u0947\u0902 \u0915\u0941\u091B \u092E\u093F\u0928\u091F\u094B\u0902 \u0915\u0947 \u092C\u091C\u093E\u092F \u0915\u0908 \u0918\u0902\u091F\u0947 \u0932\u0917 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902)\u0964 \u0910\u0938\u093E \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F, \u0939\u092E \u090F\u0915 "),ms=p(Ut,"CODE",{});var cr=i(ms);Ha=r(cr,"device"),cr.forEach(s),Ia=r(Ut," \u0915\u094B \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u0930\u0947\u0902\u0917\u0947, \u091C\u093F\u0938 \u092A\u0930 \u0939\u092E \u0905\u092A\u0928\u0947 \u092E\u0949\u0921\u0932 \u0915\u094B \u0914\u0930 \u0905\u092A\u0928\u0947 \u092C\u0948\u091A\u094B\u0902 \u0915\u094B \u0930\u0916\u0947\u0902\u0917\u0947:"),Ut.forEach(s),at=m(e),u($e.$$.fragment,e),lt=m(e),u(be.$$.fragment,e),rt=m(e),I=p(e,"P",{});var Lt=i(I);Ba=r(Lt,"\u0905\u092C \u0939\u092E \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u0947 \u0932\u093F\u090F \u0924\u0948\u092F\u093E\u0930 \u0939\u0948\u0902! \u092F\u0939 \u091C\u093E\u0928\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u093F \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u092C \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0917\u093E, \u0939\u092E "),ds=p(Lt,"CODE",{});var mr=i(ds);Ra=r(mr,"tqdm"),mr.forEach(s),Ja=r(Lt," \u0932\u093E\u0907\u092C\u094D\u0930\u0947\u0930\u0940 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0915\u0947 \u0905\u092A\u0928\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u091A\u0930\u0923\u094B\u0902 \u0915\u0940 \u0938\u0902\u0916\u094D\u092F\u093E \u092A\u0930 \u090F\u0915 \u092A\u094D\u0930\u0917\u0924\u093F \u092A\u091F\u094D\u091F\u0940 \u091C\u094B\u095C\u0947\u0917\u0947:"),Lt.forEach(s),ot=m(e),u(ke.$$.fragment,e),nt=m(e),Fe=p(e,"P",{});var dr=i(Fe);Ya=r(dr,"\u0906\u092A \u0926\u0947\u0916 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0915\u093F \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u093E \u092E\u0942\u0932 \u091C\u094B \u092A\u0930\u093F\u091A\u092F \u092E\u0947\u0902 \u0939\u0948 \u0909\u0938\u0915\u0947 \u0938\u092E\u093E\u0928 \u0926\u093F\u0916\u0924\u093E \u0939\u0948\u0964 \u0939\u092E\u0928\u0947 \u0915\u094B\u0908 \u0930\u093F\u092A\u094B\u0930\u094D\u091F\u093F\u0902\u0917 \u0928\u0939\u0940\u0902 \u092E\u093E\u0902\u0917\u0940, \u0907\u0938\u0932\u093F\u090F \u092F\u0939 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0939\u092E\u0947\u0902 \u0907\u0938 \u092C\u093E\u0930\u0947 \u092E\u0947\u0902 \u0915\u0941\u091B \u0928\u0939\u0940\u0902 \u092C\u0924\u093E\u090F\u0917\u093E \u0915\u093F \u092E\u0949\u0921\u0932 \u0915\u093E \u0915\u093F\u0930\u093E\u092F\u093E \u0915\u0948\u0938\u093E \u0939\u0948\u0964 \u0939\u092E\u0947\u0902 \u0909\u0938\u0915\u0947 \u0932\u093F\u090F \u090F\u0915 \u092E\u0942\u0932\u094D\u092F\u093E\u0902\u0915\u0928 \u0932\u0942\u092A \u091C\u094B\u0921\u093C\u0928\u0947 \u0915\u0940 \u091C\u0930\u0942\u0930\u0924 \u0939\u0948\u0964"),dr.forEach(s),pt=m(e),ve=p(e,"H3",{id:!0});var ur=i(ve);Qa=r(ur,"\u092E\u0942\u0932\u094D\u092F\u093E\u0902\u0915\u0928 \u0932\u0942\u092A"),ur.forEach(s),it=m(e),q=p(e,"P",{});var Z=i(q);Ka=r(Z,"\u091C\u0948\u0938\u093E \u0915\u093F \u0939\u092E\u0928\u0947 \u092A\u0939\u0932\u0947 \u0915\u093F\u092F\u093E \u0925\u093E, \u0939\u092E \u{1F917} \u0921\u0947\u091F\u093E\u0938\u0947\u091F \u0932\u093E\u0907\u092C\u094D\u0930\u0947\u0930\u0940 \u0926\u094D\u0935\u093E\u0930\u093E \u092A\u094D\u0930\u0926\u093E\u0928 \u0915\u093F\u090F \u0917\u090F \u092E\u0940\u091F\u094D\u0930\u093F\u0915 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0947\u0902\u0917\u0947\u0964 \u0939\u092E \u092A\u0939\u0932\u0947 \u0939\u0940 "),us=p(Z,"CODE",{});var fr=i(us);Va=r(fr,"metric.compute()"),fr.forEach(s),Xa=r(Z," \u0935\u093F\u0927\u093F \u0926\u0947\u0916 \u091A\u0941\u0915\u0947 \u0939\u0948\u0902, \u0932\u0947\u0915\u093F\u0928 \u092E\u0947\u091F\u094D\u0930\u093F\u0915\u094D\u0938 \u0935\u093E\u0938\u094D\u0924\u0935 \u092E\u0947\u0902 \u0939\u092E\u093E\u0930\u0947 \u0932\u093F\u090F \u092C\u0948\u091A \u091C\u092E\u093E \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u091C\u092C \u0939\u092E \u092D\u0935\u093F\u0937\u094D\u092F\u0935\u093E\u0923\u0940 \u0932\u0942\u092A \u092A\u0930 \u091C\u093E\u0924\u0947 \u0939\u0948\u0902 "),fs=p(Z,"CODE",{});var _r=i(fs);Za=r(_r,"add_batch()"),_r.forEach(s),el=r(Z," \u0935\u093F\u0927\u093F \u0915\u0947 \u0938\u093E\u0925 \u0964 \u090F\u0915 \u092C\u093E\u0930 \u091C\u092C \u0939\u092E \u0938\u092D\u0940 \u092C\u0948\u091A\u094B\u0902 \u0915\u094B \u091C\u092E\u093E \u0915\u0930 \u0932\u0947\u0924\u0947 \u0939\u0948\u0902, \u0924\u094B \u0939\u092E "),_s=p(Z,"CODE",{});var hr=i(_s);sl=r(hr,"metric.compute()"),hr.forEach(s),tl=r(Z," \u0915\u0947 \u0938\u093E\u0925 \u0905\u0902\u0924\u093F\u092E \u092A\u0930\u093F\u0923\u093E\u092E \u092A\u094D\u0930\u093E\u092A\u094D\u0924 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902\u0964 \u092E\u0942\u0932\u094D\u092F\u093E\u0902\u0915\u0928 \u0932\u0942\u092A \u092E\u0947\u0902 \u0907\u0928 \u0938\u092D\u0940 \u0915\u094B \u0915\u093E\u0930\u094D\u092F\u093E\u0928\u094D\u0935\u093F\u0924 \u0915\u0930\u0928\u0947 \u0915\u093E \u0924\u0930\u0940\u0915\u093E \u092F\u0939\u093E\u0902 \u0926\u093F\u092F\u093E \u0917\u092F\u093E \u0939\u0948:"),Z.forEach(s),ct=m(e),u(je.$$.fragment,e),mt=m(e),u(we.$$.fragment,e),dt=m(e),Ge=p(e,"P",{});var $r=i(Ge);al=r($r,"\u092B\u093F\u0930 \u0938\u0947, \u092E\u0949\u0921\u0932 \u0939\u0947\u0921 \u0907\u0928\u093F\u0936\u093F\u092F\u0932\u093E\u0907\u091C\u093C\u0947\u0936\u0928 \u0914\u0930 \u0921\u0947\u091F\u093E \u092B\u0947\u0930\u092C\u0926\u0932 \u092E\u0947\u0902 \u0915\u094D\u0930\u092E\u0930\u0939\u093F\u0924 \u0939\u094B\u0928\u0947 \u0915\u0947 \u0915\u093E\u0930\u0923 \u0906\u092A\u0915\u0947 \u092A\u0930\u093F\u0923\u093E\u092E \u0925\u094B\u0921\u093C\u0947 \u092D\u093F\u0928\u094D\u0928 \u0939\u094B\u0902\u0917\u0947, \u0932\u0947\u0915\u093F\u0928 \u0935\u0947 \u090F\u0915 \u0939\u0940 \u092C\u0949\u0932\u092A\u093E\u0930\u094D\u0915 \u092E\u0947\u0902 \u0939\u094B\u0928\u0947 \u091A\u093E\u0939\u093F\u090F\u0964"),$r.forEach(s),ut=m(e),u(B.$$.fragment,e),ft=m(e),W=p(e,"H3",{class:!0});var Ft=i(W);R=p(Ft,"A",{id:!0,class:!0,href:!0});var br=i(R);hs=p(br,"SPAN",{});var kr=i(hs);u(ge.$$.fragment,kr),kr.forEach(s),br.forEach(s),ll=m(Ft),$s=p(Ft,"SPAN",{});var vr=i($s);rl=r(vr,"\u0905\u092A\u0928\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u094B \u0938\u0941\u092A\u0930\u091A\u093E\u0930\u094D\u091C \u0915\u0930\u0947\u0902 \u{1F917} Accelerate \u0915\u0947 \u0938\u093E\u0925\u0964"),vr.forEach(s),Ft.forEach(s),_t=m(e),u(ze.$$.fragment,e),ht=m(e),J=p(e,"P",{});var Gt=i(J);ol=r(Gt,"\u0939\u092E\u0928\u0947 \u092A\u0939\u0932\u0947 \u091C\u094B \u091F\u094D\u0930\u0947\u0928\u093F\u0902\u0917 \u0932\u0942\u092A \u092A\u0930\u093F\u092D\u093E\u0937\u093F\u0924 \u0915\u093F\u092F\u093E \u0925\u093E, \u0935\u0939 \u0938\u093F\u0902\u0917\u0932 CPU \u092F\u093E GPU \u092A\u0930 \u0920\u0940\u0915 \u0915\u093E\u092E \u0915\u0930\u0924\u093E \u0939\u0948\u0964 \u0932\u0947\u0915\u093F\u0928  "),Ee=p(Gt,"A",{href:!0,rel:!0});var jr=i(Ee);nl=r(jr,"\u{1F917} Accelerate"),jr.forEach(s),pl=r(Gt," \u0932\u093E\u0907\u092C\u094D\u0930\u0947\u0930\u0940 \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0915\u0947, \u092C\u0938 \u0915\u0941\u091B \u0938\u092E\u093E\u092F\u094B\u091C\u0928 \u0915\u0947 \u0938\u093E\u0925 \u0939\u092E \u0915\u0908 GPUs \u092F\u093E TPUs \u092A\u0930 \u0935\u093F\u0924\u0930\u093F\u0924 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u094B \u0938\u0915\u094D\u0937\u092E \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902\u0964 \u0936\u0941\u0930\u0941\u0906\u0924 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0914\u0930 \u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0921\u0947\u091F\u093E \u0932\u094B\u0921\u0930 \u0915\u0947 \u0928\u093F\u0930\u094D\u092E\u093E\u0923 \u0938\u0947 \u0939\u0941\u0908, \u092F\u0939\u093E\u0901 \u0939\u092E\u093E\u0930\u093E \u092E\u0948\u0928\u0941\u0905\u0932 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u0948\u0938\u093E \u0926\u093F\u0916\u0924\u093E \u0939\u0948:"),Gt.forEach(s),$t=m(e),u(qe.$$.fragment,e),bt=m(e),Ne=p(e,"P",{});var wr=i(Ne);il=r(wr,"\u0914\u0930 \u092A\u0930\u093F\u0935\u0930\u094D\u0924\u0928 \u092F\u0939\u093E\u0901 \u0939\u0948\u0902:"),wr.forEach(s),kt=m(e),u(ye.$$.fragment,e),vt=m(e),y=p(e,"P",{});var ee=i(y);cl=r(ee,"\u0938\u092C\u0938\u0947 \u092A\u0939\u0932\u0940 \u0932\u093E\u0907\u0928 \u091C\u094B \u091C\u094B\u0921\u093C\u0928\u0940 \u0939\u0948 \u0935\u094B \u0939\u0948 \u0907\u092E\u094D\u092A\u094B\u0930\u094D\u091F \u0932\u093E\u0907\u0928\u0964 \u0926\u0942\u0938\u0930\u0940 \u0932\u093E\u0907\u0928 \u090F\u0915 "),bs=p(ee,"CODE",{});var gr=i(bs);ml=r(gr,"Accelerator"),gr.forEach(s),dl=r(ee," \u0935\u0938\u094D\u0924\u0941 \u0915\u094B \u0907\u0928\u094D\u0938\u094D\u091F\u0948\u0928\u094D\u0936\u0940\u0910\u091F \u0915\u0930\u0924\u0940 \u0939\u0948 \u091C\u094B \u0935\u093E\u0924\u093E\u0935\u0930\u0923 \u0915\u094B \u0926\u0947\u0916\u0947\u0917\u0940 \u0914\u0930 \u0909\u091A\u093F\u0924 \u0935\u093F\u0924\u0930\u093F\u0924 \u0938\u0947\u091F\u0905\u092A \u0915\u094B \u0907\u0928\u093F\u0936\u093F\u092F\u0932\u093E\u0907\u091C\u093C \u0915\u0930\u0947\u0917\u0940\u0964 \u{1F917} Accelerate \u0906\u092A\u0915\u0947 \u0932\u093F\u090F \u0921\u093F\u0935\u093E\u0907\u0938 \u092A\u094D\u0932\u0947\u0938\u092E\u0947\u0902\u091F \u0915\u094B \u0939\u0948\u0902\u0921\u0932 \u0915\u0930\u0924\u093E \u0939\u0948, \u0924\u093E\u0915\u093F \u0906\u092A \u0909\u0928 \u0932\u093E\u0907\u0928\u094B\u0902 \u0915\u094B \u0939\u091F\u093E \u0938\u0915\u0947\u0902 \u091C\u094B \u092E\u0949\u0921\u0932 \u0915\u094B \u0921\u093F\u0935\u093E\u0907\u0938 \u092A\u0930 \u0930\u0916\u0924\u0940 \u0939\u0948\u0902 (\u092F\u093E, \u092F\u0926\u093F \u0906\u092A \u091A\u093E\u0939\u0947\u0902, \u0924\u094B \u0909\u0928\u094D\u0939\u0947\u0902 "),ks=p(ee,"CODE",{});var zr=i(ks);ul=r(zr,"device"),zr.forEach(s),fl=r(ee," \u0915\u0947 \u092C\u091C\u093E\u092F "),vs=p(ee,"CODE",{});var Er=i(vs);_l=r(Er,"accelerator.device"),Er.forEach(s),hl=r(ee," \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u092C\u0926\u0932\u0947\u0902)\u0964"),ee.forEach(s),jt=m(e),v=p(e,"P",{});var A=i(v);$l=r(A,"\u092B\u093F\u0930 \u0915\u093E\u092E \u0915\u093E \u092E\u0941\u0916\u094D\u092F \u0939\u093F\u0938\u094D\u0938\u093E \u0909\u0938 \u0932\u093E\u0907\u0928 \u092E\u0947\u0902 \u0915\u093F\u092F\u093E \u091C\u093E\u0924\u093E \u0939\u0948 \u091C\u094B \u0921\u0947\u091F\u093E\u0932\u094B\u0921\u0930\u094D\u0938, \u092E\u0949\u0921\u0932 \u0914\u0930 \u0911\u092A\u094D\u091F\u093F\u092E\u093E\u0907\u091C\u093C\u0930 \u0915\u094B "),js=p(A,"CODE",{});var qr=i(js);bl=r(qr,"accelerator.prepare()"),qr.forEach(s),kl=r(A," \u092A\u0930 \u092D\u0947\u091C\u0924\u093E \u0939\u0948\u0964 \u092F\u0939 \u0909\u0928 \u0935\u0938\u094D\u0924\u0941\u0913\u0902 \u0915\u094B \u0909\u091A\u093F\u0924 \u0915\u0902\u091F\u0947\u0928\u0930 \u092E\u0947\u0902 \u0932\u092A\u0947\u091F \u0926\u0947\u0917\u093E \u0924\u093E\u0915\u093F \u092F\u0939 \u0938\u0941\u0928\u093F\u0936\u094D\u091A\u093F\u0924 \u0939\u094B \u0938\u0915\u0947 \u0915\u093F \u0906\u092A\u0915\u093E \u0935\u093F\u0924\u0930\u093F\u0924 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F \u0915\u0947 \u0905\u0928\u0941\u0938\u093E\u0930 \u0915\u093E\u092E \u0915\u0930\u0924\u093E \u0939\u0948\u0964 \u0936\u0947\u0937 \u092A\u0930\u093F\u0935\u0930\u094D\u0924\u0928 \u0939\u0948 \u0909\u0938 \u0932\u093E\u0907\u0928 \u0915\u094B \u0939\u091F\u093E\u0928\u093E \u091C\u094B \u092C\u0948\u091A \u0915\u094B "),ws=p(A,"CODE",{});var yr=i(ws);vl=r(yr,"device"),yr.forEach(s),jl=r(A," \u092A\u0930 \u0930\u0916\u0924\u093E \u0939\u0948 (\u092B\u093F\u0930 \u0938\u0947, \u092F\u0926\u093F \u0906\u092A \u0907\u0938\u0947 \u0930\u0916\u0928\u093E \u091A\u093E\u0939\u0924\u0947 \u0939\u0948\u0902 \u0924\u094B \u0906\u092A \u0907\u0938\u0947 \u0915\u0947\u0935\u0932 "),gs=p(A,"CODE",{});var Ar=i(gs);wl=r(Ar,"accelerator.device"),Ar.forEach(s),gl=r(A," \u0915\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u092C\u0926\u0932 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902) \u0914\u0930 "),zs=p(A,"CODE",{});var Cr=i(zs);zl=r(Cr,"loss.backward()"),Cr.forEach(s),El=r(A," \u0915\u094B "),Es=p(A,"CODE",{});var Pr=i(Es);ql=r(Pr,"accelerator.backward(loss)"),Pr.forEach(s),yl=r(A," \u0915\u0947 \u0938\u093E\u0925 \u092C\u0926\u0932\u0928\u093E\u0964"),A.forEach(s),wt=m(e),u(Y.$$.fragment,e),gt=m(e),He=p(e,"P",{});var Dr=i(He);Al=r(Dr,"\u092F\u0926\u093F \u0906\u092A \u0907\u0938\u0947 \u0916\u0947\u0932\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u0915\u0949\u092A\u0940 \u0914\u0930 \u092A\u0947\u0938\u094D\u091F \u0915\u0930\u0928\u093E \u091A\u093E\u0939\u0924\u0947 \u0939\u0948\u0902, \u0924\u094B \u092F\u0939\u093E\u0902 \u092C\u0924\u093E\u092F\u093E \u0917\u092F\u093E \u0939\u0948 \u0915\u093F \u{1F917} Accelerate \u0915\u0947 \u0938\u093E\u0925 \u092A\u0942\u0930\u093E \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u0948\u0938\u093E \u0926\u093F\u0916\u0924\u093E \u0939\u0948:"),Dr.forEach(s),zt=m(e),u(Ae.$$.fragment,e),Et=m(e),Q=p(e,"P",{});var Nt=i(Q);Cl=r(Nt,"\u0907\u0938\u0947 \u090F\u0915 "),qs=p(Nt,"CODE",{});var xr=i(qs);Pl=r(xr,"train.py"),xr.forEach(s),Dl=r(Nt," \u0938\u094D\u0915\u094D\u0930\u093F\u092A\u094D\u091F \u092E\u0947\u0902 \u0930\u0916\u0928\u0947 \u0938\u0947 \u0935\u0939 \u0938\u094D\u0915\u094D\u0930\u093F\u092A\u094D\u091F \u0915\u093F\u0938\u0940 \u092D\u0940 \u092A\u094D\u0930\u0915\u093E\u0930 \u0915\u0947 \u0935\u093F\u0924\u0930\u093F\u0924 \u0938\u0947\u091F\u0905\u092A \u092A\u0930 \u091A\u0932\u0928\u0947 \u092F\u094B\u0917\u094D\u092F \u0939\u094B \u091C\u093E\u090F\u0917\u0940\u0964 \u0907\u0938\u0947 \u0905\u092A\u0928\u0947 \u0935\u093F\u0924\u0930\u093F\u0924 \u0938\u0947\u091F\u0905\u092A \u092E\u0947\u0902 \u0906\u091C\u093C\u092E\u093E\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F, \u0915\u092E\u093E\u0902\u0921 \u091A\u0932\u093E\u090F\u0901:"),Nt.forEach(s),qt=m(e),u(Ce.$$.fragment,e),yt=m(e),Ie=p(e,"P",{});var Sr=i(Ie);xl=r(Sr,"\u091C\u094B \u0906\u092A\u0915\u094B \u0915\u0941\u091B \u0938\u0935\u093E\u0932\u094B\u0902 \u0915\u0947 \u091C\u0935\u093E\u092C \u0926\u0947\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F \u092A\u094D\u0930\u0947\u0930\u093F\u0924 \u0915\u0930\u0947\u0917\u093E \u0914\u0930 \u0907\u0938 \u0915\u092E\u093E\u0902\u0921 \u0926\u094D\u0935\u093E\u0930\u093E \u0909\u092A\u092F\u094B\u0917 \u0915\u0940 \u091C\u093E\u0928\u0947 \u0935\u093E\u0932\u0940 \u0915\u0949\u0928\u094D\u092B\u093C\u093F\u0917\u0930\u0947\u0936\u0928 \u092B\u093C\u093E\u0907\u0932 \u092E\u0947\u0902 \u0906\u092A\u0915\u0947 \u0909\u0924\u094D\u0924\u0930\u094B\u0902 \u0915\u094B \u0921\u0902\u092A \u0915\u0930 \u0926\u0947\u0917\u093E:"),Sr.forEach(s),At=m(e),u(Pe.$$.fragment,e),Ct=m(e),Be=p(e,"P",{});var Tr=i(Be);Sl=r(Tr,"\u091C\u094B \u0935\u093F\u0924\u0930\u093F\u0924 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u094B \u0936\u0941\u0930\u0942 \u0915\u0930\u0947\u0917\u093E\u0964"),Tr.forEach(s),Pt=m(e),K=p(e,"P",{});var Ht=i(K);Tl=r(Ht,"\u092F\u0926\u093F \u0906\u092A \u0907\u0938\u0947 \u0928\u094B\u091F\u092C\u0941\u0915 \u092E\u0947\u0902 \u0906\u091C\u093C\u092E\u093E\u0928\u093E \u091A\u093E\u0939\u0924\u0947 \u0939\u0948\u0902 (\u0909\u0926\u093E\u0939\u0930\u0923 \u0915\u0947 \u0932\u093F\u090F, Colab \u092A\u0930 TPUs \u0915\u0947 \u0938\u093E\u0925 \u0907\u0938\u0915\u093E \u092A\u0930\u0940\u0915\u094D\u0937\u0923 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F), \u0924\u094B \u092C\u0938 \u0915\u094B\u0921 \u0915\u094B "),ys=p(Ht,"CODE",{});var Or=i(ys);Ol=r(Or,"training_function()"),Or.forEach(s),Wl=r(Ht," \u092E\u0947\u0902 \u092A\u0947\u0938\u094D\u091F \u0915\u0930\u0947\u0902 \u0914\u0930 \u090F\u0915 \u0905\u0902\u0924\u093F\u092E \u0938\u0947\u0932 \u091A\u0932\u093E\u090F\u0901 \u0938\u093E\u0925 \u092E\u0947\u0902:"),Ht.forEach(s),Dt=m(e),u(De.$$.fragment,e),xt=m(e),V=p(e,"P",{});var It=i(V);Ml=r(It,"\u0906\u092A \u0915\u0908 \u0905\u0927\u093F\u0915 \u0909\u0926\u093E\u0939\u0930\u0923 "),xe=p(It,"A",{href:!0,rel:!0});var Wr=i(xe);Ul=r(Wr,"\u{1F917} Accelerate repo"),Wr.forEach(s),Ll=r(It," \u092E\u0947\u0902 \u092A\u093E \u0938\u0915\u0924\u0947 \u0939\u0948\u0964"),It.forEach(s),this.h()},h(){j(b,"name","hf:doc:metadata"),j(b,"content",JSON.stringify(Qr)),j(w,"id",""),j(ae,"id",""),j(de,"href","https://arxiv.org/abs/1711.05101"),j(de,"rel","nofollow"),j(he,"id",""),j(ve,"id",""),j(R,"id","accelerate"),j(R,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),j(R,"href","#accelerate"),j(W,"class","relative group"),j(Ee,"href","https://github.com/huggingface/accelerate"),j(Ee,"rel","nofollow"),j(xe,"href","https://github.com/huggingface/accelerate/tree/main/examples"),j(xe,"rel","nofollow")},m(e,a){t(document.head,b),o(e,g,a),o(e,w,a),t(w,se),o(e,M,a),f(E,e,a),o(e,C,a),f(D,e,a),o(e,Cs,a),o(e,U,a),t(U,Bt),t(U,Qe),t(Qe,Rt),t(U,Jt),o(e,Ps,a),f(te,e,a),o(e,Ds,a),o(e,ae,a),t(ae,Yt),o(e,xs,a),o(e,x,a),t(x,Qt),t(x,Ke),t(Ke,Kt),t(x,Vt),t(x,Ve),t(Ve,Xt),t(x,Zt),o(e,Ss,a),o(e,S,a),t(S,O),t(O,ea),t(O,Xe),t(Xe,sa),t(O,ta),t(O,Ze),t(Ze,aa),t(O,la),t(S,ra),t(S,P),t(P,oa),t(P,es),t(es,na),t(P,pa),t(P,ss),t(ss,ia),t(P,ca),t(P,ts),t(ts,ma),t(P,da),t(S,ua),t(S,as),t(as,fa),o(e,Ts,a),o(e,L,a),t(L,_a),t(L,ls),t(ls,ha),t(L,$a),o(e,Os,a),f(le,e,a),o(e,Ws,a),o(e,Oe,a),t(Oe,ba),o(e,Ms,a),f(re,e,a),o(e,Us,a),o(e,We,a),t(We,ka),o(e,Ls,a),f(oe,e,a),o(e,Fs,a),o(e,Me,a),t(Me,va),o(e,Gs,a),f(ne,e,a),o(e,Ns,a),f(pe,e,a),o(e,Hs,a),o(e,F,a),t(F,ja),t(F,rs),t(rs,wa),t(F,ga),o(e,Is,a),o(e,Ue,a),t(Ue,za),o(e,Bs,a),f(ie,e,a),o(e,Rs,a),o(e,Le,a),t(Le,Ea),o(e,Js,a),f(ce,e,a),o(e,Ys,a),f(me,e,a),o(e,Qs,a),o(e,G,a),t(G,qa),t(G,os),t(os,ya),t(G,Aa),o(e,Ks,a),o(e,z,a),t(z,Ca),t(z,ns),t(ns,Pa),t(z,Da),t(z,ps),t(ps,xa),t(z,Sa),t(z,is),t(is,Ta),t(z,Oa),t(z,de),t(de,Wa),t(z,Ma),o(e,Vs,a),f(ue,e,a),o(e,Xs,a),o(e,N,a),t(N,Ua),t(N,cs),t(cs,La),t(N,Fa),o(e,Zs,a),f(fe,e,a),o(e,et,a),f(_e,e,a),o(e,st,a),o(e,he,a),t(he,Ga),o(e,tt,a),o(e,H,a),t(H,Na),t(H,ms),t(ms,Ha),t(H,Ia),o(e,at,a),f($e,e,a),o(e,lt,a),f(be,e,a),o(e,rt,a),o(e,I,a),t(I,Ba),t(I,ds),t(ds,Ra),t(I,Ja),o(e,ot,a),f(ke,e,a),o(e,nt,a),o(e,Fe,a),t(Fe,Ya),o(e,pt,a),o(e,ve,a),t(ve,Qa),o(e,it,a),o(e,q,a),t(q,Ka),t(q,us),t(us,Va),t(q,Xa),t(q,fs),t(fs,Za),t(q,el),t(q,_s),t(_s,sl),t(q,tl),o(e,ct,a),f(je,e,a),o(e,mt,a),f(we,e,a),o(e,dt,a),o(e,Ge,a),t(Ge,al),o(e,ut,a),f(B,e,a),o(e,ft,a),o(e,W,a),t(W,R),t(R,hs),f(ge,hs,null),t(W,ll),t(W,$s),t($s,rl),o(e,_t,a),f(ze,e,a),o(e,ht,a),o(e,J,a),t(J,ol),t(J,Ee),t(Ee,nl),t(J,pl),o(e,$t,a),f(qe,e,a),o(e,bt,a),o(e,Ne,a),t(Ne,il),o(e,kt,a),f(ye,e,a),o(e,vt,a),o(e,y,a),t(y,cl),t(y,bs),t(bs,ml),t(y,dl),t(y,ks),t(ks,ul),t(y,fl),t(y,vs),t(vs,_l),t(y,hl),o(e,jt,a),o(e,v,a),t(v,$l),t(v,js),t(js,bl),t(v,kl),t(v,ws),t(ws,vl),t(v,jl),t(v,gs),t(gs,wl),t(v,gl),t(v,zs),t(zs,zl),t(v,El),t(v,Es),t(Es,ql),t(v,yl),o(e,wt,a),f(Y,e,a),o(e,gt,a),o(e,He,a),t(He,Al),o(e,zt,a),f(Ae,e,a),o(e,Et,a),o(e,Q,a),t(Q,Cl),t(Q,qs),t(qs,Pl),t(Q,Dl),o(e,qt,a),f(Ce,e,a),o(e,yt,a),o(e,Ie,a),t(Ie,xl),o(e,At,a),f(Pe,e,a),o(e,Ct,a),o(e,Be,a),t(Be,Sl),o(e,Pt,a),o(e,K,a),t(K,Tl),t(K,ys),t(ys,Ol),t(K,Wl),o(e,Dt,a),f(De,e,a),o(e,xt,a),o(e,V,a),t(V,Ml),t(V,xe),t(xe,Ul),t(V,Ll),St=!0},p(e,[a]){const As={};a&2&&(As.$$scope={dirty:a,ctx:e}),B.$set(As);const Se={};a&2&&(Se.$$scope={dirty:a,ctx:e}),Y.$set(Se)},i(e){St||(_(E.$$.fragment,e),_(D.$$.fragment,e),_(te.$$.fragment,e),_(le.$$.fragment,e),_(re.$$.fragment,e),_(oe.$$.fragment,e),_(ne.$$.fragment,e),_(pe.$$.fragment,e),_(ie.$$.fragment,e),_(ce.$$.fragment,e),_(me.$$.fragment,e),_(ue.$$.fragment,e),_(fe.$$.fragment,e),_(_e.$$.fragment,e),_($e.$$.fragment,e),_(be.$$.fragment,e),_(ke.$$.fragment,e),_(je.$$.fragment,e),_(we.$$.fragment,e),_(B.$$.fragment,e),_(ge.$$.fragment,e),_(ze.$$.fragment,e),_(qe.$$.fragment,e),_(ye.$$.fragment,e),_(Y.$$.fragment,e),_(Ae.$$.fragment,e),_(Ce.$$.fragment,e),_(Pe.$$.fragment,e),_(De.$$.fragment,e),St=!0)},o(e){h(E.$$.fragment,e),h(D.$$.fragment,e),h(te.$$.fragment,e),h(le.$$.fragment,e),h(re.$$.fragment,e),h(oe.$$.fragment,e),h(ne.$$.fragment,e),h(pe.$$.fragment,e),h(ie.$$.fragment,e),h(ce.$$.fragment,e),h(me.$$.fragment,e),h(ue.$$.fragment,e),h(fe.$$.fragment,e),h(_e.$$.fragment,e),h($e.$$.fragment,e),h(be.$$.fragment,e),h(ke.$$.fragment,e),h(je.$$.fragment,e),h(we.$$.fragment,e),h(B.$$.fragment,e),h(ge.$$.fragment,e),h(ze.$$.fragment,e),h(qe.$$.fragment,e),h(ye.$$.fragment,e),h(Y.$$.fragment,e),h(Ae.$$.fragment,e),h(Ce.$$.fragment,e),h(Pe.$$.fragment,e),h(De.$$.fragment,e),St=!1},d(e){s(b),e&&s(g),e&&s(w),e&&s(M),$(E,e),e&&s(C),$(D,e),e&&s(Cs),e&&s(U),e&&s(Ps),$(te,e),e&&s(Ds),e&&s(ae),e&&s(xs),e&&s(x),e&&s(Ss),e&&s(S),e&&s(Ts),e&&s(L),e&&s(Os),$(le,e),e&&s(Ws),e&&s(Oe),e&&s(Ms),$(re,e),e&&s(Us),e&&s(We),e&&s(Ls),$(oe,e),e&&s(Fs),e&&s(Me),e&&s(Gs),$(ne,e),e&&s(Ns),$(pe,e),e&&s(Hs),e&&s(F),e&&s(Is),e&&s(Ue),e&&s(Bs),$(ie,e),e&&s(Rs),e&&s(Le),e&&s(Js),$(ce,e),e&&s(Ys),$(me,e),e&&s(Qs),e&&s(G),e&&s(Ks),e&&s(z),e&&s(Vs),$(ue,e),e&&s(Xs),e&&s(N),e&&s(Zs),$(fe,e),e&&s(et),$(_e,e),e&&s(st),e&&s(he),e&&s(tt),e&&s(H),e&&s(at),$($e,e),e&&s(lt),$(be,e),e&&s(rt),e&&s(I),e&&s(ot),$(ke,e),e&&s(nt),e&&s(Fe),e&&s(pt),e&&s(ve),e&&s(it),e&&s(q),e&&s(ct),$(je,e),e&&s(mt),$(we,e),e&&s(dt),e&&s(Ge),e&&s(ut),$(B,e),e&&s(ft),e&&s(W),$(ge),e&&s(_t),$(ze,e),e&&s(ht),e&&s(J),e&&s($t),$(qe,e),e&&s(bt),e&&s(Ne),e&&s(kt),$(ye,e),e&&s(vt),e&&s(y),e&&s(jt),e&&s(v),e&&s(wt),$(Y,e),e&&s(gt),e&&s(He),e&&s(zt),$(Ae,e),e&&s(Et),e&&s(Q),e&&s(qt),$(Ce,e),e&&s(yt),e&&s(Ie),e&&s(At),$(Pe,e),e&&s(Ct),e&&s(Be),e&&s(Pt),e&&s(K),e&&s(Dt),$(De,e),e&&s(xt),e&&s(V)}}}const Qr={local:"",sections:[{local:"",title:"\u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0915\u0947 \u0932\u093F\u090F \u0924\u0948\u092F\u093E\u0930 \u0915\u0930\u0947\u0902"},{local:"",title:"\u091F\u094D\u0930\u0947\u0928\u093F\u0902\u0917 \u0932\u0942\u092A"},{local:"",title:"\u092E\u0942\u0932\u094D\u092F\u093E\u0902\u0915\u0928 \u0932\u0942\u092A"},{local:"accelerate",title:"\u0905\u092A\u0928\u0947 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923 \u0932\u0942\u092A \u0915\u094B \u0938\u0941\u092A\u0930\u091A\u093E\u0930\u094D\u091C \u0915\u0930\u0947\u0902 \u{1F917} Accelerate \u0915\u0947 \u0938\u093E\u0925\u0964"}],title:"\u090F\u0915 \u092A\u0942\u0930\u094D\u0923 \u092A\u094D\u0930\u0936\u093F\u0915\u094D\u0937\u0923"};function Kr(Te){return Hr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ao extends Lr{constructor(b){super();Fr(this,b,Kr,Yr,Gr,{})}}export{ao as default,Qr as metadata};
