import{S as A0,i as x0,s as P0,e as s,k as f,w as c,t as o,M as q0,c as r,d as t,m as d,a as n,x as u,h as l,b as p,G as a,g as h,y as m,q as v,o as g,B as w,v as T0}from"../chunks/vendor-hf-doc-builder.js";import{T as j0}from"../chunks/Tip-hf-doc-builder.js";import{Y as Wh}from"../chunks/Youtube-hf-doc-builder.js";import{I as b}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as x}from"../chunks/CodeBlock-hf-doc-builder.js";function S0(Uh){let y,ct;return{c(){y=s("p"),ct=o(`Each model\u2019s labels may be different, so be sure to always check the documentation of each model for more information
about their specific labels!`)},l(P){y=r(P,"P",{});var S=n(y);ct=l(S,`Each model\u2019s labels may be different, so be sure to always check the documentation of each model for more information
about their specific labels!`),S.forEach(t)},m(P,S){h(P,y,S),a(y,ct)},d(P){P&&t(y)}}}function N0(Uh){let y,ct,P,S,So,Ua,ju,No,Su,Xh,Cr,Nu,Yh,J,ut,zo,Xa,zu,Co,Cu,Qh,Z,mt,Do,Ya,Du,Fo,Fu,Jh,Dr,Iu,Zh,Qa,Kh,Fr,Hu,ep,Ir,Mu,tp,Ja,ap,Hr,Ou,sp,Za,rp,Mr,Bu,np,Or,Lu,op,Ka,lp,Br,Ru,ip,es,hp,z,Vu,Lr,Gu,Wu,Io,Uu,Xu,Ho,Yu,Qu,pp,ts,fp,K,vt,Mo,as,Ju,Oo,Zu,dp,ee,Ku,Rr,em,tm,Vr,am,cp,te,gt,Bo,ss,sm,Lo,rm,up,ae,nm,Gr,om,lm,Wr,im,mp,se,wt,Ro,rs,hm,Vo,pm,vp,re,bt,Go,ns,fm,Wo,dm,gp,q,cm,Ur,um,mm,Xr,vm,gm,Uo,wm,bm,Yr,_m,$m,wp,ne,_t,Xo,os,km,Yo,Em,bp,oe,$t,Qo,ls,ym,Jo,Am,_p,Qr,xm,$p,le,kt,Zo,is,Pm,Ko,qm,kp,k,Tm,el,jm,Sm,tl,Nm,zm,al,Cm,Dm,sl,Fm,Im,rl,Hm,M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c,mo,m$,ac;return Ua=new b({}),Xa=new b({}),Ya=new b({}),Qa=new Wh({props:{id:"M6adb1j2jPI"}}),Ja=new x({props:{code:`from transformers import BertTokenizer

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")

sequence_a = "This is a short sequence."
sequence_b = "This is a rather long sequence. It is at least longer than the sequence A."

encoded_sequence_a = tokenizer(sequence_a)["input_ids"]
encoded_sequence_b = tokenizer(sequence_b)["input_ids"]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_a = <span class="hljs-string">&quot;This is a short sequence.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_b = <span class="hljs-string">&quot;This is a rather long sequence. It is at least longer than the sequence A.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_sequence_a = tokenizer(sequence_a)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_sequence_b = tokenizer(sequence_b)[<span class="hljs-string">&quot;input_ids&quot;</span>]`}}),Za=new x({props:{code:"len(encoded_sequence_a), len(encoded_sequence_b)",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">len</span>(encoded_sequence_a), <span class="hljs-built_in">len</span>(encoded_sequence_b)
(<span class="hljs-number">8</span>, <span class="hljs-number">19</span>)`}}),Ka=new x({props:{code:"padded_sequences = tokenizer([sequence_a, sequence_b], padding=True)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>padded_sequences = tokenizer([sequence_a, sequence_b], padding=<span class="hljs-literal">True</span>)'}}),es=new x({props:{code:'padded_sequences["input_ids"]',highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>padded_sequences[<span class="hljs-string">&quot;input_ids&quot;</span>]
[[<span class="hljs-number">101</span>, <span class="hljs-number">1188</span>, <span class="hljs-number">1110</span>, <span class="hljs-number">170</span>, <span class="hljs-number">1603</span>, <span class="hljs-number">4954</span>, <span class="hljs-number">119</span>, <span class="hljs-number">102</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>], [<span class="hljs-number">101</span>, <span class="hljs-number">1188</span>, <span class="hljs-number">1110</span>, <span class="hljs-number">170</span>, <span class="hljs-number">1897</span>, <span class="hljs-number">1263</span>, <span class="hljs-number">4954</span>, <span class="hljs-number">119</span>, <span class="hljs-number">1135</span>, <span class="hljs-number">1110</span>, <span class="hljs-number">1120</span>, <span class="hljs-number">1655</span>, <span class="hljs-number">2039</span>, <span class="hljs-number">1190</span>, <span class="hljs-number">1103</span>, <span class="hljs-number">4954</span>, <span class="hljs-number">138</span>, <span class="hljs-number">119</span>, <span class="hljs-number">102</span>]]`}}),ts=new x({props:{code:'padded_sequences["attention_mask"]',highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>padded_sequences[<span class="hljs-string">&quot;attention_mask&quot;</span>]
[[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>], [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>]]`}}),as=new b({}),ss=new b({}),rs=new b({}),ns=new b({}),os=new b({}),ls=new b({}),is=new b({}),hs=new b({}),ps=new b({}),fs=new b({}),ds=new b({}),cs=new b({}),us=new Wh({props:{id:"d_ixlCubqQw"}}),ms=new b({}),vs=new b({}),gs=new b({}),ws=new Wh({props:{id:"H39Z_720T5s"}}),bs=new b({}),_s=new b({}),$s=new b({}),Es=new b({}),As=new b({}),xs=new b({}),Ps=new b({}),qs=new b({}),Ts=new b({}),Ss=new b({}),Ns=new Wh({props:{id:"VFp38yj8h3A"}}),Cs=new x({props:{code:`from transformers import BertTokenizer

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")

sequence = "A Titan RTX has 24GB of VRAM"`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>sequence = <span class="hljs-string">&quot;A Titan RTX has 24GB of VRAM&quot;</span>`}}),Ds=new x({props:{code:"tokenized_sequence = tokenizer.tokenize(sequence)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_sequence = tokenizer.tokenize(sequence)'}}),Fs=new x({props:{code:"print(tokenized_sequence)",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenized_sequence)
[<span class="hljs-string">&#x27;A&#x27;</span>, <span class="hljs-string">&#x27;Titan&#x27;</span>, <span class="hljs-string">&#x27;R&#x27;</span>, <span class="hljs-string">&#x27;##T&#x27;</span>, <span class="hljs-string">&#x27;##X&#x27;</span>, <span class="hljs-string">&#x27;has&#x27;</span>, <span class="hljs-string">&#x27;24&#x27;</span>, <span class="hljs-string">&#x27;##GB&#x27;</span>, <span class="hljs-string">&#x27;of&#x27;</span>, <span class="hljs-string">&#x27;V&#x27;</span>, <span class="hljs-string">&#x27;##RA&#x27;</span>, <span class="hljs-string">&#x27;##M&#x27;</span>]`}}),Hs=new x({props:{code:"inputs = tokenizer(sequence)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(sequence)'}}),Ms=new x({props:{code:`encoded_sequence = inputs["input_ids"]
print(encoded_sequence)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_sequence = inputs[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoded_sequence)
[<span class="hljs-number">101</span>, <span class="hljs-number">138</span>, <span class="hljs-number">18696</span>, <span class="hljs-number">155</span>, <span class="hljs-number">1942</span>, <span class="hljs-number">3190</span>, <span class="hljs-number">1144</span>, <span class="hljs-number">1572</span>, <span class="hljs-number">13745</span>, <span class="hljs-number">1104</span>, <span class="hljs-number">159</span>, <span class="hljs-number">9664</span>, <span class="hljs-number">2107</span>, <span class="hljs-number">102</span>]`}}),Os=new x({props:{code:"decoded_sequence = tokenizer.decode(encoded_sequence)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>decoded_sequence = tokenizer.decode(encoded_sequence)'}}),Bs=new x({props:{code:"print(decoded_sequence)",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(decoded_sequence)
[CLS] A Titan RTX has 24GB of VRAM [SEP]`}}),Ls=new b({}),Rs=new b({}),ea=new j0({props:{$$slots:{default:[S0]},$$scope:{ctx:Uh}}}),Vs=new b({}),Gs=new b({}),Ws=new b({}),Us=new b({}),Xs=new b({}),Ys=new b({}),Js=new b({}),Zs=new b({}),Ks=new b({}),er=new b({}),ar=new b({}),sr=new b({}),rr=new b({}),nr=new b({}),lr=new b({}),ir=new b({}),hr=new b({}),pr=new b({}),fr=new b({}),dr=new b({}),cr=new b({}),ur=new b({}),mr=new b({}),vr=new b({}),gr=new b({}),wr=new b({}),br=new b({}),_r=new b({}),$r=new b({}),kr=new Wh({props:{id:"0u3ioSwev3s"}}),Er=new x({props:{code:"# [CLS] SEQUENCE_A [SEP] SEQUENCE_B [SEP]",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># [CLS] SEQUENCE_A [SEP] SEQUENCE_B [SEP]</span>'}}),yr=new x({props:{code:`from transformers import BertTokenizer

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
sequence_a = "HuggingFace is based in NYC"
sequence_b = "Where is HuggingFace based?"

encoded_dict = tokenizer(sequence_a, sequence_b)
decoded = tokenizer.decode(encoded_dict["input_ids"])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_a = <span class="hljs-string">&quot;HuggingFace is based in NYC&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_b = <span class="hljs-string">&quot;Where is HuggingFace based?&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_dict = tokenizer(sequence_a, sequence_b)
<span class="hljs-meta">&gt;&gt;&gt; </span>decoded = tokenizer.decode(encoded_dict[<span class="hljs-string">&quot;input_ids&quot;</span>])`}}),Ar=new x({props:{code:"print(decoded)",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(decoded)
[CLS] HuggingFace <span class="hljs-keyword">is</span> based <span class="hljs-keyword">in</span> NYC [SEP] Where <span class="hljs-keyword">is</span> HuggingFace based? [SEP]`}}),xr=new x({props:{code:'encoded_dict["token_type_ids"]',highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_dict[<span class="hljs-string">&quot;token_type_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>]`}}),Pr=new b({}),qr=new b({}),Tr=new b({}),jr=new b({}),{c(){y=s("meta"),ct=f(),P=s("h1"),S=s("a"),So=s("span"),c(Ua.$$.fragment),ju=f(),No=s("span"),Su=o("Glossary"),Xh=f(),Cr=s("p"),Nu=o(`This glossary defines general machine learning and \u{1F917} Transformers terms to help you better understand the
documentation.`),Yh=f(),J=s("h2"),ut=s("a"),zo=s("span"),c(Xa.$$.fragment),zu=f(),Co=s("span"),Cu=o("A"),Qh=f(),Z=s("h3"),mt=s("a"),Do=s("span"),c(Ya.$$.fragment),Du=f(),Fo=s("span"),Fu=o("attention mask"),Jh=f(),Dr=s("p"),Iu=o("The attention mask is an optional argument used when batching sequences together."),Zh=f(),c(Qa.$$.fragment),Kh=f(),Fr=s("p"),Hu=o("This argument indicates to the model which tokens should be attended to, and which should not."),ep=f(),Ir=s("p"),Mu=o("For example, consider these two sequences:"),tp=f(),c(Ja.$$.fragment),ap=f(),Hr=s("p"),Ou=o("The encoded versions have different lengths:"),sp=f(),c(Za.$$.fragment),rp=f(),Mr=s("p"),Bu=o(`Therefore, we can\u2019t put them together in the same tensor as-is. The first sequence needs to be padded up to the length
of the second one, or the second one needs to be truncated down to the length of the first one.`),np=f(),Or=s("p"),Lu=o(`In the first case, the list of IDs will be extended by the padding indices. We can pass a list to the tokenizer and ask
it to pad like this:`),op=f(),c(Ka.$$.fragment),lp=f(),Br=s("p"),Ru=o("We can see that 0s have been added on the right of the first sentence to make it the same length as the second one:"),ip=f(),c(es.$$.fragment),hp=f(),z=s("p"),Vu=o(`This can then be converted into a tensor in PyTorch or TensorFlow. The attention mask is a binary tensor indicating the
position of the padded indices so that the model does not attend to them. For the `),Lr=s("a"),Gu=o("BertTokenizer"),Wu=o(", "),Io=s("code"),Uu=o("1"),Xu=o(` indicates a
value that should be attended to, while `),Ho=s("code"),Yu=o("0"),Qu=o(` indicates a padded value. This attention mask is in the dictionary returned
by the tokenizer under the key \u201Cattention_mask\u201D:`),pp=f(),c(ts.$$.fragment),fp=f(),K=s("h3"),vt=s("a"),Mo=s("span"),c(as.$$.fragment),Ju=f(),Oo=s("span"),Zu=o("autoencoding models"),dp=f(),ee=s("p"),Ku=o("See "),Rr=s("a"),em=o("encoder models"),tm=o(" and "),Vr=s("a"),am=o("masked language modeling"),cp=f(),te=s("h3"),gt=s("a"),Bo=s("span"),c(ss.$$.fragment),sm=f(),Lo=s("span"),rm=o("autoregressive models"),up=f(),ae=s("p"),nm=o("See "),Gr=s("a"),om=o("causal language modeling"),lm=o(" and "),Wr=s("a"),im=o("decoder models"),mp=f(),se=s("h2"),wt=s("a"),Ro=s("span"),c(rs.$$.fragment),hm=f(),Vo=s("span"),pm=o("B"),vp=f(),re=s("h3"),bt=s("a"),Go=s("span"),c(ns.$$.fragment),fm=f(),Wo=s("span"),dm=o("backbone"),gp=f(),q=s("p"),cm=o("The backbone is the network (embeddings and layers) that outputs the raw hidden states or features. It is usually connected to a "),Ur=s("a"),um=o("head"),mm=o(" which accepts the features as its input to make a prediction. For example, "),Xr=s("a"),vm=o("ViTModel"),gm=o(" is a backbone without a specific head on top. Other models can also use "),Uo=s("code"),wm=o("VitModel"),bm=o(" as a backbone such as "),Yr=s("a"),_m=o("DPT"),$m=o("."),wp=f(),ne=s("h2"),_t=s("a"),Xo=s("span"),c(os.$$.fragment),km=f(),Yo=s("span"),Em=o("C"),bp=f(),oe=s("h3"),$t=s("a"),Qo=s("span"),c(ls.$$.fragment),ym=f(),Jo=s("span"),Am=o("causal language modeling"),_p=f(),Qr=s("p"),xm=o(`A pretraining task where the model reads the texts in order and has to predict the next word. It\u2019s usually done by
reading the whole sentence but using a mask inside the model to hide the future tokens at a certain timestep.`),$p=f(),le=s("h3"),kt=s("a"),Zo=s("span"),c(is.$$.fragment),Pm=f(),Ko=s("span"),qm=o("channel"),kp=f(),k=s("p"),Tm=o("Color images are made up of some combination of values in three channels - red, green, and blue (RGB) - and grayscale images only have one channel. In \u{1F917} Transformers, the channel can be the first or last dimension of an image\u2019s tensor: ["),el=s("code"),jm=o("n_channels"),Sm=o(", "),tl=s("code"),Nm=o("height"),zm=o(", "),al=s("code"),Cm=o("width"),Dm=o("] or ["),sl=s("code"),Fm=o("height"),Im=o(", "),rl=s("code"),Hm=o("width"),Mm=o(", "),nl=s("code"),Om=o("n_channels"),Bm=o("]."),Ep=f(),ie=s("h3"),Et=s("a"),ol=s("span"),c(hs.$$.fragment),Lm=f(),ll=s("span"),Rm=o("connectionist temporal classification (CTC)"),yp=f(),Jr=s("p"),Vm=o("An algorithm which allows a model to learn without knowing exactly how the input and output are aligned; CTC calculates the distribution of all possible outputs for a given input and chooses the most likely output from it. CTC is commonly used in speech recognition tasks because speech doesn\u2019t always cleanly align with the transcript for a variety of reasons such as a speaker\u2019s different speech rates."),Ap=f(),he=s("h3"),yt=s("a"),il=s("span"),c(ps.$$.fragment),Gm=f(),hl=s("span"),Wm=o("convolution"),xp=f(),Zr=s("p"),Um=o("A type of layer in a neural network where the input matrix is multiplied element-wise by a smaller matrix (kernel or filter) and the values are summed up in a new matrix. This is known as a convolutional operation which is repeated over the entire input matrix. Each operation is applied to a different segment of the input matrix. Convolutional neural networks (CNNs) are commonly used in computer vision."),Pp=f(),pe=s("h2"),At=s("a"),pl=s("span"),c(fs.$$.fragment),Xm=f(),fl=s("span"),Ym=o("D"),qp=f(),fe=s("h3"),xt=s("a"),dl=s("span"),c(ds.$$.fragment),Qm=f(),cl=s("span"),Jm=o("decoder input IDs"),Tp=f(),Kr=s("p"),Zm=o(`This input is specific to encoder-decoder models, and contains the input IDs that will be fed to the decoder. These
inputs should be used for sequence to sequence tasks, such as translation or summarization, and are usually built in a
way specific to each model.`),jp=f(),C=s("p"),Km=o("Most encoder-decoder models (BART, T5) create their "),ul=s("code"),ev=o("decoder_input_ids"),tv=o(" on their own from the "),ml=s("code"),av=o("labels"),sv=o(`. In such models,
passing the `),vl=s("code"),rv=o("labels"),nv=o(" is the preferred way to handle training."),Sp=f(),en=s("p"),ov=o("Please check each model\u2019s docs to see how they handle these input IDs for sequence to sequence training."),Np=f(),de=s("h3"),Pt=s("a"),gl=s("span"),c(cs.$$.fragment),lv=f(),wl=s("span"),iv=o("decoder models"),zp=f(),tn=s("p"),hv=o(`Also referred to as autoregressive models, decoder models involve a pretraining task (called causal language modeling) where the model reads the texts in order and has to predict the next word. It\u2019s usually done by
reading the whole sentence with a mask to hide future tokens at a certain timestep.`),Cp=f(),c(us.$$.fragment),Dp=f(),ce=s("h3"),qt=s("a"),bl=s("span"),c(ms.$$.fragment),pv=f(),_l=s("span"),fv=o("deep learning (DL)"),Fp=f(),an=s("p"),dv=o("Machine learning algorithms which uses neural networks with several layers."),Ip=f(),ue=s("h2"),Tt=s("a"),$l=s("span"),c(vs.$$.fragment),cv=f(),kl=s("span"),uv=o("E"),Hp=f(),me=s("h3"),jt=s("a"),El=s("span"),c(gs.$$.fragment),mv=f(),yl=s("span"),vv=o("encoder models"),Mp=f(),St=s("p"),gv=o("Also known as autoencoding models, encoder models take an input (such as text or images) and transform them into a condensed numerical representation called an embedding. Oftentimes, encoder models are pretrained using techniques like "),sn=s("a"),wv=o("masked language modeling"),bv=o(", which masks parts of the input sequence and forces the model to create more meaningful representations."),Op=f(),c(ws.$$.fragment),Bp=f(),ve=s("h2"),Nt=s("a"),Al=s("span"),c(bs.$$.fragment),_v=f(),xl=s("span"),$v=o("F"),Lp=f(),ge=s("h3"),zt=s("a"),Pl=s("span"),c(_s.$$.fragment),kv=f(),ql=s("span"),Ev=o("feature extraction"),Rp=f(),rn=s("p"),yv=o("The process of selecting and transforming raw data into a set of features that are more informative and useful for machine learning algorithms. Some examples of feature extraction include transforming raw text into word embeddings and extracting important features such as edges or shapes from image/video data."),Vp=f(),we=s("h3"),Ct=s("a"),Tl=s("span"),c($s.$$.fragment),Av=f(),jl=s("span"),xv=o("feed forward chunking"),Gp=f(),Dt=s("p"),Pv=o(`In each residual attention block in transformers the self-attention layer is usually followed by 2 feed forward layers.
The intermediate embedding size of the feed forward layers is often bigger than the hidden size of the model (e.g., for
`),Sl=s("code"),qv=o("bert-base-uncased"),Tv=o(")."),Wp=f(),_=s("p"),jv=o("For an input of size "),Nl=s("code"),Sv=o("[batch_size, sequence_length]"),Nv=o(`, the memory required to store the intermediate feed forward
embeddings `),zl=s("code"),zv=o("[batch_size, sequence_length, config.intermediate_size]"),Cv=o(` can account for a large fraction of the memory
use. The authors of `),ks=s("a"),Dv=o("Reformer: The Efficient Transformer"),Fv=o(` noticed that since the
computation is independent of the `),Cl=s("code"),Iv=o("sequence_length"),Hv=o(` dimension, it is mathematically equivalent to compute the output
embeddings of both feed forward layers `),Dl=s("code"),Mv=o("[batch_size, config.hidden_size]_0, ..., [batch_size, config.hidden_size]_n"),Ov=o(`
individually and concat them afterward to `),Fl=s("code"),Bv=o("[batch_size, sequence_length, config.hidden_size]"),Lv=o(" with "),Il=s("code"),Rv=o("n = sequence_length"),Vv=o(`, which trades increased computation time against reduced memory use, but yields a mathematically
`),Hl=s("strong"),Gv=o("equivalent"),Wv=o(" result."),Up=f(),D=s("p"),Uv=o("For models employing the function "),nn=s("a"),Xv=o("apply_chunking_to_forward()"),Yv=o(", the "),Ml=s("code"),Qv=o("chunk_size"),Jv=o(` defines the number of output
embeddings that are computed in parallel and thus defines the trade-off between memory and time complexity. If
`),Ol=s("code"),Zv=o("chunk_size"),Kv=o(" is set to 0, no feed forward chunking is done."),Xp=f(),be=s("h3"),Ft=s("a"),Bl=s("span"),c(Es.$$.fragment),e1=f(),Ll=s("span"),t1=o("finetuned models"),Yp=f(),It=s("p"),a1=o("Finetuning is a form of transfer learning which involves taking a pretrained model, freezing its weights, and replacing the output layer with a newly added "),on=s("a"),s1=o("model head"),r1=o(". The model head is trained on your target dataset."),Qp=f(),Ht=s("p"),n1=o("See the "),ys=s("a"),o1=o("Fine-tune a pretrained model"),l1=o(" tutorial for more details, and learn how to fine-tune models with \u{1F917} Transformers."),Jp=f(),_e=s("h2"),Mt=s("a"),Rl=s("span"),c(As.$$.fragment),i1=f(),Vl=s("span"),h1=o("H"),Zp=f(),$e=s("h3"),Ot=s("a"),Gl=s("span"),c(xs.$$.fragment),p1=f(),Wl=s("span"),f1=o("head"),Kp=f(),ln=s("p"),d1=o("The model head refers to the last layer of a neural network that accepts the raw hidden states and projects them onto a different dimension. There is a different model head for each task. For example:"),ef=f(),I=s("ul"),Bt=s("li"),hn=s("a"),c1=o("GPT2ForSequenceClassification"),u1=o(" is a sequence classification head - a linear layer - on top of the base "),pn=s("a"),m1=o("GPT2Model"),v1=o("."),g1=f(),H=s("li"),fn=s("a"),w1=o("ViTForImageClassification"),b1=o(" is an image classification head - a linear layer on top of the final hidden state of the "),Ul=s("code"),_1=o("CLS"),$1=o(" token - on top of the base "),dn=s("a"),k1=o("ViTModel"),E1=o("."),y1=f(),M=s("li"),cn=s("a"),A1=o("Wav2Vec2ForCTC"),x1=o(" ia a language modeling head with "),un=s("a"),P1=o("CTC"),q1=o(" on top of the base "),mn=s("a"),T1=o("Wav2Vec2Model"),j1=o("."),tf=f(),ke=s("h2"),Lt=s("a"),Xl=s("span"),c(Ps.$$.fragment),S1=f(),Yl=s("span"),N1=o("I"),af=f(),Ee=s("h3"),Rt=s("a"),Ql=s("span"),c(qs.$$.fragment),z1=f(),Jl=s("span"),C1=o("image patch"),sf=f(),Vt=s("p"),D1=o("Vision-based Transformers models split an image into smaller patches which are linearly embedded, and then passed as a sequence to the model. You can find the "),Zl=s("code"),F1=o("patch_size"),I1=o(" - or resolution - of the model in it\u2019s configuration."),rf=f(),ye=s("h3"),Gt=s("a"),Kl=s("span"),c(Ts.$$.fragment),H1=f(),ei=s("span"),M1=o("inference"),nf=f(),Wt=s("p"),O1=o("Inference is the process of evaluating a model on new data after training is complete. See the "),js=s("a"),B1=o("Pipeline for inference"),L1=o(" tutorial to learn how to perform inference with \u{1F917} Transformers."),of=f(),Ae=s("h3"),Ut=s("a"),ti=s("span"),c(Ss.$$.fragment),R1=f(),ai=s("span"),V1=o("input IDs"),lf=f(),vn=s("p"),G1=o(`The input ids are often the only required parameters to be passed to the model as input. They are token indices,
numerical representations of tokens building the sequences that will be used as input by the model.`),hf=f(),c(Ns.$$.fragment),pf=f(),Xt=s("p"),W1=o(`Each tokenizer works differently but the underlying mechanism remains the same. Here\u2019s an example using the BERT
tokenizer, which is a `),zs=s("a"),U1=o("WordPiece"),X1=o(" tokenizer:"),ff=f(),c(Cs.$$.fragment),df=f(),gn=s("p"),Y1=o("The tokenizer takes care of splitting the sequence into tokens available in the tokenizer vocabulary."),cf=f(),c(Ds.$$.fragment),uf=f(),wn=s("p"),Q1=o(`The tokens are either words or subwords. Here for instance, \u201CVRAM\u201D wasn\u2019t in the model vocabulary, so it\u2019s been split
in \u201CV\u201D, \u201CRA\u201D and \u201CM\u201D. To indicate those tokens are not separate words but parts of the same word, a double-hash prefix
is added for \u201CRA\u201D and \u201CM\u201D:`),mf=f(),c(Fs.$$.fragment),vf=f(),Yt=s("p"),J1=o(`These tokens can then be converted into IDs which are understandable by the model. This can be done by directly feeding
the sentence to the tokenizer, which leverages the Rust implementation of `),Is=s("a"),Z1=o(`\u{1F917}
Tokenizers`),K1=o(" for peak performance."),gf=f(),c(Hs.$$.fragment),wf=f(),Qt=s("p"),eg=o(`The tokenizer returns a dictionary with all the arguments necessary for its corresponding model to work properly. The
token indices are under the key `),si=s("code"),tg=o("input_ids"),ag=o(":"),bf=f(),c(Ms.$$.fragment),_f=f(),bn=s("p"),sg=o(`Note that the tokenizer automatically adds \u201Cspecial tokens\u201D (if the associated model relies on them) which are special
IDs the model sometimes uses.`),$f=f(),_n=s("p"),rg=o("If we decode the previous sequence of ids,"),kf=f(),c(Os.$$.fragment),Ef=f(),$n=s("p"),ng=o("we will see"),yf=f(),c(Bs.$$.fragment),Af=f(),Jt=s("p"),og=o("because this is the way a "),kn=s("a"),lg=o("BertModel"),ig=o(" is going to expect its inputs."),xf=f(),xe=s("h2"),Zt=s("a"),ri=s("span"),c(Ls.$$.fragment),hg=f(),ni=s("span"),pg=o("L"),Pf=f(),Pe=s("h3"),Kt=s("a"),oi=s("span"),c(Rs.$$.fragment),fg=f(),li=s("span"),dg=o("labels"),qf=f(),En=s("p"),cg=o(`The labels are an optional argument which can be passed in order for the model to compute the loss itself. These labels
should be the expected prediction of the model: it will use the standard loss in order to compute the loss between its
predictions and the expected value (the label).`),Tf=f(),yn=s("p"),ug=o("These labels are different according to the model head, for example:"),jf=f(),$=s("ul"),qe=s("li"),mg=o("For sequence classification models, ("),An=s("a"),vg=o("BertForSequenceClassification"),gg=o(`), the model expects a tensor of dimension
`),ii=s("code"),wg=o("(batch_size)"),bg=o(" with each value of the batch corresponding to the expected label of the entire sequence."),_g=f(),Te=s("li"),$g=o("For token classification models, ("),xn=s("a"),kg=o("BertForTokenClassification"),Eg=o(`), the model expects a tensor of dimension
`),hi=s("code"),yg=o("(batch_size, seq_length)"),Ag=o(" with each value corresponding to the expected label of each individual token."),xg=f(),je=s("li"),Pg=o("For masked language modeling, ("),Pn=s("a"),qg=o("BertForMaskedLM"),Tg=o("), the model expects a tensor of dimension "),pi=s("code"),jg=o("(batch_size, seq_length)"),Sg=o(` with each value corresponding to the expected label of each individual token: the labels being the token
ID for the masked token, and values to be ignored for the rest (usually -100).`),Ng=f(),N=s("li"),zg=o("For sequence to sequence tasks, ("),qn=s("a"),Cg=o("BartForConditionalGeneration"),Dg=o(", "),Tn=s("a"),Fg=o("MBartForConditionalGeneration"),Ig=o(`), the model
expects a tensor of dimension `),fi=s("code"),Hg=o("(batch_size, tgt_seq_length)"),Mg=o(` with each value corresponding to the target sequences
associated with each input sequence. During training, both BART and T5 will make the appropriate
`),di=s("code"),Og=o("decoder_input_ids"),Bg=o(` and decoder attention masks internally. They usually do not need to be supplied. This does not
apply to models leveraging the Encoder-Decoder framework.`),Lg=f(),Se=s("li"),Rg=o("For image classification models, ("),jn=s("a"),Vg=o("ViTForImageClassification"),Gg=o(`), the model expects a tensor of dimension
`),ci=s("code"),Wg=o("(batch_size)"),Ug=o(" with each value of the batch corresponding to the expected label of each individual image."),Xg=f(),Ne=s("li"),Yg=o("For semantic segmentation models, ("),Sn=s("a"),Qg=o("SegformerForSemanticSegmentation"),Jg=o(`), the model expects a tensor of dimension
`),ui=s("code"),Zg=o("(batch_size, height, width)"),Kg=o(" with each value of the batch corresponding to the expected label of each individual pixel."),ew=f(),F=s("li"),tw=o("For object detection models, ("),Nn=s("a"),aw=o("DetrForObjectDetection"),sw=o(`), the model expects a list of dictionaries with a
`),mi=s("code"),rw=o("class_labels"),nw=o(" and "),vi=s("code"),ow=o("boxes"),lw=o(" key where each value of the batch corresponds to the expected label and number of bounding boxes of each individual image."),iw=f(),ze=s("li"),hw=o("For automatic speech recognition models, ("),zn=s("a"),pw=o("Wav2Vec2ForCTC"),fw=o("), the model expects a tensor of dimension "),gi=s("code"),dw=o("(batch_size, target_length)"),cw=o(" with each value corresponding to the expected label of each individual token."),Sf=f(),c(ea.$$.fragment),Nf=f(),ta=s("p"),uw=o("The base models ("),Cn=s("a"),mw=o("BertModel"),vw=o(`) do not accept labels, as these are the base transformer models, simply outputting
features.`),zf=f(),Ce=s("h3"),aa=s("a"),wi=s("span"),c(Vs.$$.fragment),gw=f(),bi=s("span"),ww=o("large language models (LLM)"),Cf=f(),Dn=s("p"),bw=o("A generic term that refers to transformer language models (GPT-3, BLOOM, OPT) that were trained on a large quantity of data. These models also tend to have a large number of learnable parameters (e.g. 175 billion for GPT-3)."),Df=f(),De=s("h2"),sa=s("a"),_i=s("span"),c(Gs.$$.fragment),_w=f(),$i=s("span"),$w=o("M"),Ff=f(),Fe=s("h3"),ra=s("a"),ki=s("span"),c(Ws.$$.fragment),kw=f(),Ei=s("span"),Ew=o("masked language modeling (MLM)"),If=f(),Fn=s("p"),yw=o(`A pretraining task where the model sees a corrupted version of the texts, usually done by
masking some tokens randomly, and has to predict the original text.`),Hf=f(),Ie=s("h3"),na=s("a"),yi=s("span"),c(Us.$$.fragment),Aw=f(),Ai=s("span"),xw=o("multimodal"),Mf=f(),In=s("p"),Pw=o("A task that combines texts with another kind of inputs (for instance images)."),Of=f(),He=s("h2"),oa=s("a"),xi=s("span"),c(Xs.$$.fragment),qw=f(),Pi=s("span"),Tw=o("N"),Bf=f(),Me=s("h3"),la=s("a"),qi=s("span"),c(Ys.$$.fragment),jw=f(),Ti=s("span"),Sw=o("Natural language generation (NLG)"),Lf=f(),ia=s("p"),Nw=o("All tasks related to generating text (for instance, "),Qs=s("a"),zw=o("Write With Transformers"),Cw=o(", translation)."),Rf=f(),Oe=s("h3"),ha=s("a"),ji=s("span"),c(Js.$$.fragment),Dw=f(),Si=s("span"),Fw=o("Natural language processing (NLP)"),Vf=f(),Hn=s("p"),Iw=o("A generic way to say \u201Cdeal with texts\u201D."),Gf=f(),Be=s("h3"),pa=s("a"),Ni=s("span"),c(Zs.$$.fragment),Hw=f(),zi=s("span"),Mw=o("Natural language understanding (NLU)"),Wf=f(),Mn=s("p"),Ow=o(`All tasks related to understanding what is in a text (for instance classifying the
whole text, individual words).`),Uf=f(),Le=s("h2"),fa=s("a"),Ci=s("span"),c(Ks.$$.fragment),Bw=f(),Di=s("span"),Lw=o("P"),Xf=f(),Re=s("h3"),da=s("a"),Fi=s("span"),c(er.$$.fragment),Rw=f(),Ii=s("span"),Vw=o("pipeline"),Yf=f(),On=s("p"),Gw=o("A pipeline in \u{1F917} Transformers is an abstraction referring to a series of steps that are executed in a specific order to preprocess and transform data and return a prediction from a model. Some example stages found in a pipeline might be data preprocessing, feature extraction, and normalization."),Qf=f(),ca=s("p"),Ww=o("For more details, see "),tr=s("a"),Uw=o("Pipelines for inference"),Xw=o("."),Jf=f(),Ve=s("h3"),ua=s("a"),Hi=s("span"),c(ar.$$.fragment),Yw=f(),Mi=s("span"),Qw=o("pixel values"),Zf=f(),T=s("p"),Jw=o("A tensor of the numerical representations of an image that is passed to a model. The pixel values have a shape of ["),Oi=s("code"),Zw=o("batch_size"),Kw=o(", "),Bi=s("code"),eb=o("num_channels"),tb=o(", "),Li=s("code"),ab=o("height"),sb=o(", "),Ri=s("code"),rb=o("width"),nb=o("], and are generated from an image processor."),Kf=f(),Ge=s("h3"),ma=s("a"),Vi=s("span"),c(sr.$$.fragment),ob=f(),Gi=s("span"),lb=o("pooling"),ed=f(),Bn=s("p"),ib=o("An operation that reduces a matrix into a smaller matrix, either by taking the maximum or average of the pooled dimension(s). Pooling layers are commonly found between convolutional layers to downsample the feature representation."),td=f(),We=s("h3"),va=s("a"),Wi=s("span"),c(rr.$$.fragment),hb=f(),Ui=s("span"),pb=o("position IDs"),ad=f(),ga=s("p"),fb=o(`Contrary to RNNs that have the position of each token embedded within them, transformers are unaware of the position of
each token. Therefore, the position IDs (`),Xi=s("code"),db=o("position_ids"),cb=o(`) are used by the model to identify each token\u2019s position in the
list of tokens.`),sd=f(),wa=s("p"),ub=o("They are an optional parameter. If no "),Yi=s("code"),mb=o("position_ids"),vb=o(` are passed to the model, the IDs are automatically created as
absolute positional embeddings.`),rd=f(),ba=s("p"),gb=o("Absolute positional embeddings are selected in the range "),Qi=s("code"),wb=o("[0, config.max_position_embeddings - 1]"),bb=o(`. Some models use
other types of positional embeddings, such as sinusoidal position embeddings or relative position embeddings.`),nd=f(),Ue=s("h3"),_a=s("a"),Ji=s("span"),c(nr.$$.fragment),_b=f(),Zi=s("span"),$b=o("preprocessing"),od=f(),$a=s("p"),kb=o("The task of preparing raw data into a format that can be easily consumed by machine learning models. For example, text is typically preprocessed by tokenization. To gain a better idea of what preprocessing looks like for other input types, check out the "),or=s("a"),Eb=o("Preprocess"),yb=o(" tutorial."),ld=f(),Xe=s("h3"),ka=s("a"),Ki=s("span"),c(lr.$$.fragment),Ab=f(),eh=s("span"),xb=o("pretrained model"),id=f(),O=s("p"),Pb=o(`A model that has been pretrained on some data (for instance all of Wikipedia). Pretraining methods involve a
self-supervised objective, which can be reading the text and trying to predict the next word (see `),Ln=s("a"),qb=o(`causal language
modeling`),Tb=o(") or masking some words and trying to predict them (see "),Rn=s("a"),jb=o(`masked language
modeling`),Sb=o(")."),hd=f(),Vn=s("p"),Nb=o("Speech and vision models have their own pretraining objectives. For example, Wav2Vec2 is a speech model pretrained on a contrastive task which requires the model to identify the \u201Ctrue\u201D speech representation from a set of \u201Cfalse\u201D speech representations. On the other hand, BEiT is a vision model pretrained on a masked image modeling task which masks some of the image patches and requires the model to predict the masked patches (similar to the masked language modeling objective)."),pd=f(),Ye=s("h2"),Ea=s("a"),th=s("span"),c(ir.$$.fragment),zb=f(),ah=s("span"),Cb=o("R"),fd=f(),Qe=s("h3"),ya=s("a"),sh=s("span"),c(hr.$$.fragment),Db=f(),rh=s("span"),Fb=o("recurrent neural network (RNN)"),dd=f(),Gn=s("p"),Ib=o("A type of model that uses a loop over a layer to process texts."),cd=f(),Je=s("h3"),Aa=s("a"),nh=s("span"),c(pr.$$.fragment),Hb=f(),oh=s("span"),Mb=o("representation learning"),ud=f(),Wn=s("p"),Ob=o("A subfield of machine learning which focuses on learning meaningful representations of raw data. Some examples of representation learning techniques include word embeddings, autoencoders, and Generative Adversarial Networks (GANs)."),md=f(),Ze=s("h2"),xa=s("a"),lh=s("span"),c(fr.$$.fragment),Bb=f(),ih=s("span"),Lb=o("S"),vd=f(),Ke=s("h3"),Pa=s("a"),hh=s("span"),c(dr.$$.fragment),Rb=f(),ph=s("span"),Vb=o("sampling rate"),gd=f(),Un=s("p"),Gb=o("A measurement in hertz of the number of samples (the audio signal) taken per second. The sampling rate is a result of discretizing a continuous signal such as speech."),wd=f(),et=s("h3"),qa=s("a"),fh=s("span"),c(cr.$$.fragment),Wb=f(),dh=s("span"),Ub=o("self-attention"),bd=f(),Xn=s("p"),Xb=o("Each element of the input finds out which other elements of the input they should attend to."),_d=f(),tt=s("h3"),Ta=s("a"),ch=s("span"),c(ur.$$.fragment),Yb=f(),uh=s("span"),Qb=o("self-supervised learning"),$d=f(),B=s("p"),Jb=o("A category of machine learning techniques in which a model creates its own learning objective from unlabeled data. It differs from "),Yn=s("a"),Zb=o("unsupervised learning"),Kb=o(" and "),Qn=s("a"),e_=o("supervised learning"),t_=o(" in that the learning process is supervised, but not explicitly from the user."),kd=f(),ja=s("p"),a_=o("One example of self-supervised learning is "),Jn=s("a"),s_=o("masked language modeling"),r_=o(", where a model is passed sentences with a proportion of its tokens removed and learns to predict the missing tokens."),Ed=f(),at=s("h3"),Sa=s("a"),mh=s("span"),c(mr.$$.fragment),n_=f(),vh=s("span"),o_=o("semi-supervised learning"),yd=f(),L=s("p"),l_=o("A broad category of machine learning training techniques that leverages a small amount of labeled data with a larger quantity of unlabeled data to improve the accuracy of a model, unlike "),Zn=s("a"),i_=o("supervised learning"),h_=o(" and "),Kn=s("a"),p_=o("unsupervised learning"),f_=o("."),Ad=f(),eo=s("p"),d_=o("An example of a semi-supervised learning approach is \u201Cself-training\u201D, in which a model is trained on labeled data, and then used to make predictions on the unlabeled data. The portion of the unlabeled data that the model predicts with the most confidence gets added to the labeled dataset and used to retrain the model."),xd=f(),st=s("h3"),Na=s("a"),gh=s("span"),c(vr.$$.fragment),c_=f(),wh=s("span"),u_=o("sequence-to-sequence (seq2seq)"),Pd=f(),R=s("p"),m_=o(`Models that generate a new sequence from an input, like translation models, or summarization models (such as
`),to=s("a"),v_=o("Bart"),g_=o(" or "),ao=s("a"),w_=o("T5"),b_=o(")."),qd=f(),rt=s("h3"),za=s("a"),bh=s("span"),c(gr.$$.fragment),__=f(),_h=s("span"),$_=o("stride"),Td=f(),V=s("p"),k_=o("In "),so=s("a"),E_=o("convolution"),y_=o(" or "),ro=s("a"),A_=o("pooling"),x_=o(", the stride refers to the distance the kernel is moved over a matrix. A stride of 1 means the kernel is moved one pixel over at a time, and a stride of 2 means the kernel is moved two pixels over at a time."),jd=f(),nt=s("h3"),Ca=s("a"),$h=s("span"),c(wr.$$.fragment),P_=f(),kh=s("span"),q_=o("supervised learning"),Sd=f(),no=s("p"),T_=o("A form of model training that directly uses labeled data to correct and instruct model performance. Data is fed into the model being trained, and its predictions are compared to the known labels. The model updates its weights based on how incorrect its predictions were, and the process is repeated to optimize model performance."),Nd=f(),ot=s("h2"),Da=s("a"),Eh=s("span"),c(br.$$.fragment),j_=f(),yh=s("span"),S_=o("T"),zd=f(),lt=s("h3"),Fa=s("a"),Ah=s("span"),c(_r.$$.fragment),N_=f(),xh=s("span"),z_=o("token"),Cd=f(),oo=s("p"),C_=o(`A part of a sentence, usually a word, but can also be a subword (non-common words are often split in subwords) or a
punctuation symbol.`),Dd=f(),it=s("h3"),Ia=s("a"),Ph=s("span"),c($r.$$.fragment),D_=f(),qh=s("span"),F_=o("token Type IDs"),Fd=f(),lo=s("p"),I_=o("Some models\u2019 purpose is to do classification on pairs of sentences or question answering."),Id=f(),c(kr.$$.fragment),Hd=f(),G=s("p"),H_=o(`These require two different sequences to be joined in a single \u201Cinput_ids\u201D entry, which usually is performed with the
help of special tokens, such as the classifier (`),Th=s("code"),M_=o("[CLS]"),O_=o(") and separator ("),jh=s("code"),B_=o("[SEP]"),L_=o(`) tokens. For example, the BERT model
builds its two sequence input as such:`),Md=f(),c(Er.$$.fragment),Od=f(),Ha=s("p"),R_=o("We can use our tokenizer to automatically generate such a sentence by passing the two sequences to "),Sh=s("code"),V_=o("tokenizer"),G_=o(` as two
arguments (and not a list, like before) like this:`),Bd=f(),c(yr.$$.fragment),Ld=f(),io=s("p"),W_=o("which will return:"),Rd=f(),c(Ar.$$.fragment),Vd=f(),ho=s("p"),U_=o(`This is enough for some models to understand where one sequence ends and where another begins. However, other models,
such as BERT, also deploy token type IDs (also called segment IDs). They are represented as a binary mask identifying
the two types of sequence in the model.`),Gd=f(),po=s("p"),X_=o("The tokenizer returns this mask as the \u201Ctoken_type_ids\u201D entry:"),Wd=f(),c(xr.$$.fragment),Ud=f(),W=s("p"),Y_=o("The first sequence, the \u201Ccontext\u201D used for the question, has all its tokens represented by a "),Nh=s("code"),Q_=o("0"),J_=o(`, whereas the second
sequence, corresponding to the \u201Cquestion\u201D, has all its tokens represented by a `),zh=s("code"),Z_=o("1"),K_=o("."),Xd=f(),U=s("p"),e$=o("Some models, like "),fo=s("a"),t$=o("XLNetModel"),a$=o(" use an additional token represented by a "),Ch=s("code"),s$=o("2"),r$=o("."),Yd=f(),ht=s("h3"),Ma=s("a"),Dh=s("span"),c(Pr.$$.fragment),n$=f(),Fh=s("span"),o$=o("transfer learning"),Qd=f(),co=s("p"),l$=o("A technique that involves taking a pretrained model and adapting it to a dataset specific to your task. Instead of training a model from scratch, you can leverage knowledge obtained from an existing model as a starting point. This speeds up the learning process and reduces the amount of training data needed."),Jd=f(),pt=s("h3"),Oa=s("a"),Ih=s("span"),c(qr.$$.fragment),i$=f(),Hh=s("span"),h$=o("transformer"),Zd=f(),uo=s("p"),p$=o("Self-attention based deep learning model architecture."),Kd=f(),ft=s("h2"),Ba=s("a"),Mh=s("span"),c(Tr.$$.fragment),f$=f(),Oh=s("span"),d$=o("U"),ec=f(),dt=s("h3"),La=s("a"),Bh=s("span"),c(jr.$$.fragment),c$=f(),Lh=s("span"),u$=o("unsupervised learning"),tc=f(),mo=s("p"),m$=o("A form of model training in which data provided to the model is not labeled. Unsupervised learning techniques leverage statistical information of the data distribution to find patterns useful for the task at hand."),this.h()},l(e){const i=q0('[data-svelte="svelte-1phssyn"]',document.head);y=r(i,"META",{name:!0,content:!0}),i.forEach(t),ct=d(e),P=r(e,"H1",{class:!0});var Sr=n(P);S=r(Sr,"A",{id:!0,class:!0,href:!0});var v$=n(S);So=r(v$,"SPAN",{});var g$=n(So);u(Ua.$$.fragment,g$),g$.forEach(t),v$.forEach(t),ju=d(Sr),No=r(Sr,"SPAN",{});var w$=n(No);Su=l(w$,"Glossary"),w$.forEach(t),Sr.forEach(t),Xh=d(e),Cr=r(e,"P",{});var b$=n(Cr);Nu=l(b$,`This glossary defines general machine learning and \u{1F917} Transformers terms to help you better understand the
documentation.`),b$.forEach(t),Yh=d(e),J=r(e,"H2",{class:!0});var sc=n(J);ut=r(sc,"A",{id:!0,class:!0,href:!0});var _$=n(ut);zo=r(_$,"SPAN",{});var $$=n(zo);u(Xa.$$.fragment,$$),$$.forEach(t),_$.forEach(t),zu=d(sc),Co=r(sc,"SPAN",{});var k$=n(Co);Cu=l(k$,"A"),k$.forEach(t),sc.forEach(t),Qh=d(e),Z=r(e,"H3",{class:!0});var rc=n(Z);mt=r(rc,"A",{id:!0,class:!0,href:!0});var E$=n(mt);Do=r(E$,"SPAN",{});var y$=n(Do);u(Ya.$$.fragment,y$),y$.forEach(t),E$.forEach(t),Du=d(rc),Fo=r(rc,"SPAN",{});var A$=n(Fo);Fu=l(A$,"attention mask"),A$.forEach(t),rc.forEach(t),Jh=d(e),Dr=r(e,"P",{});var x$=n(Dr);Iu=l(x$,"The attention mask is an optional argument used when batching sequences together."),x$.forEach(t),Zh=d(e),u(Qa.$$.fragment,e),Kh=d(e),Fr=r(e,"P",{});var P$=n(Fr);Hu=l(P$,"This argument indicates to the model which tokens should be attended to, and which should not."),P$.forEach(t),ep=d(e),Ir=r(e,"P",{});var q$=n(Ir);Mu=l(q$,"For example, consider these two sequences:"),q$.forEach(t),tp=d(e),u(Ja.$$.fragment,e),ap=d(e),Hr=r(e,"P",{});var T$=n(Hr);Ou=l(T$,"The encoded versions have different lengths:"),T$.forEach(t),sp=d(e),u(Za.$$.fragment,e),rp=d(e),Mr=r(e,"P",{});var j$=n(Mr);Bu=l(j$,`Therefore, we can\u2019t put them together in the same tensor as-is. The first sequence needs to be padded up to the length
of the second one, or the second one needs to be truncated down to the length of the first one.`),j$.forEach(t),np=d(e),Or=r(e,"P",{});var S$=n(Or);Lu=l(S$,`In the first case, the list of IDs will be extended by the padding indices. We can pass a list to the tokenizer and ask
it to pad like this:`),S$.forEach(t),op=d(e),u(Ka.$$.fragment,e),lp=d(e),Br=r(e,"P",{});var N$=n(Br);Ru=l(N$,"We can see that 0s have been added on the right of the first sentence to make it the same length as the second one:"),N$.forEach(t),ip=d(e),u(es.$$.fragment,e),hp=d(e),z=r(e,"P",{});var Ra=n(z);Vu=l(Ra,`This can then be converted into a tensor in PyTorch or TensorFlow. The attention mask is a binary tensor indicating the
position of the padded indices so that the model does not attend to them. For the `),Lr=r(Ra,"A",{href:!0});var z$=n(Lr);Gu=l(z$,"BertTokenizer"),z$.forEach(t),Wu=l(Ra,", "),Io=r(Ra,"CODE",{});var C$=n(Io);Uu=l(C$,"1"),C$.forEach(t),Xu=l(Ra,` indicates a
value that should be attended to, while `),Ho=r(Ra,"CODE",{});var D$=n(Ho);Yu=l(D$,"0"),D$.forEach(t),Qu=l(Ra,` indicates a padded value. This attention mask is in the dictionary returned
by the tokenizer under the key \u201Cattention_mask\u201D:`),Ra.forEach(t),pp=d(e),u(ts.$$.fragment,e),fp=d(e),K=r(e,"H3",{class:!0});var nc=n(K);vt=r(nc,"A",{id:!0,class:!0,href:!0});var F$=n(vt);Mo=r(F$,"SPAN",{});var I$=n(Mo);u(as.$$.fragment,I$),I$.forEach(t),F$.forEach(t),Ju=d(nc),Oo=r(nc,"SPAN",{});var H$=n(Oo);Zu=l(H$,"autoencoding models"),H$.forEach(t),nc.forEach(t),dp=d(e),ee=r(e,"P",{});var Rh=n(ee);Ku=l(Rh,"See "),Rr=r(Rh,"A",{href:!0});var M$=n(Rr);em=l(M$,"encoder models"),M$.forEach(t),tm=l(Rh," and "),Vr=r(Rh,"A",{href:!0});var O$=n(Vr);am=l(O$,"masked language modeling"),O$.forEach(t),Rh.forEach(t),cp=d(e),te=r(e,"H3",{class:!0});var oc=n(te);gt=r(oc,"A",{id:!0,class:!0,href:!0});var B$=n(gt);Bo=r(B$,"SPAN",{});var L$=n(Bo);u(ss.$$.fragment,L$),L$.forEach(t),B$.forEach(t),sm=d(oc),Lo=r(oc,"SPAN",{});var R$=n(Lo);rm=l(R$,"autoregressive models"),R$.forEach(t),oc.forEach(t),up=d(e),ae=r(e,"P",{});var Vh=n(ae);nm=l(Vh,"See "),Gr=r(Vh,"A",{href:!0});var V$=n(Gr);om=l(V$,"causal language modeling"),V$.forEach(t),lm=l(Vh," and "),Wr=r(Vh,"A",{href:!0});var G$=n(Wr);im=l(G$,"decoder models"),G$.forEach(t),Vh.forEach(t),mp=d(e),se=r(e,"H2",{class:!0});var lc=n(se);wt=r(lc,"A",{id:!0,class:!0,href:!0});var W$=n(wt);Ro=r(W$,"SPAN",{});var U$=n(Ro);u(rs.$$.fragment,U$),U$.forEach(t),W$.forEach(t),hm=d(lc),Vo=r(lc,"SPAN",{});var X$=n(Vo);pm=l(X$,"B"),X$.forEach(t),lc.forEach(t),vp=d(e),re=r(e,"H3",{class:!0});var ic=n(re);bt=r(ic,"A",{id:!0,class:!0,href:!0});var Y$=n(bt);Go=r(Y$,"SPAN",{});var Q$=n(Go);u(ns.$$.fragment,Q$),Q$.forEach(t),Y$.forEach(t),fm=d(ic),Wo=r(ic,"SPAN",{});var J$=n(Wo);dm=l(J$,"backbone"),J$.forEach(t),ic.forEach(t),gp=d(e),q=r(e,"P",{});var X=n(q);cm=l(X,"The backbone is the network (embeddings and layers) that outputs the raw hidden states or features. It is usually connected to a "),Ur=r(X,"A",{href:!0});var Z$=n(Ur);um=l(Z$,"head"),Z$.forEach(t),mm=l(X," which accepts the features as its input to make a prediction. For example, "),Xr=r(X,"A",{href:!0});var K$=n(Xr);vm=l(K$,"ViTModel"),K$.forEach(t),gm=l(X," is a backbone without a specific head on top. Other models can also use "),Uo=r(X,"CODE",{});var e3=n(Uo);wm=l(e3,"VitModel"),e3.forEach(t),bm=l(X," as a backbone such as "),Yr=r(X,"A",{href:!0});var t3=n(Yr);_m=l(t3,"DPT"),t3.forEach(t),$m=l(X,"."),X.forEach(t),wp=d(e),ne=r(e,"H2",{class:!0});var hc=n(ne);_t=r(hc,"A",{id:!0,class:!0,href:!0});var a3=n(_t);Xo=r(a3,"SPAN",{});var s3=n(Xo);u(os.$$.fragment,s3),s3.forEach(t),a3.forEach(t),km=d(hc),Yo=r(hc,"SPAN",{});var r3=n(Yo);Em=l(r3,"C"),r3.forEach(t),hc.forEach(t),bp=d(e),oe=r(e,"H3",{class:!0});var pc=n(oe);$t=r(pc,"A",{id:!0,class:!0,href:!0});var n3=n($t);Qo=r(n3,"SPAN",{});var o3=n(Qo);u(ls.$$.fragment,o3),o3.forEach(t),n3.forEach(t),ym=d(pc),Jo=r(pc,"SPAN",{});var l3=n(Jo);Am=l(l3,"causal language modeling"),l3.forEach(t),pc.forEach(t),_p=d(e),Qr=r(e,"P",{});var i3=n(Qr);xm=l(i3,`A pretraining task where the model reads the texts in order and has to predict the next word. It\u2019s usually done by
reading the whole sentence but using a mask inside the model to hide the future tokens at a certain timestep.`),i3.forEach(t),$p=d(e),le=r(e,"H3",{class:!0});var fc=n(le);kt=r(fc,"A",{id:!0,class:!0,href:!0});var h3=n(kt);Zo=r(h3,"SPAN",{});var p3=n(Zo);u(is.$$.fragment,p3),p3.forEach(t),h3.forEach(t),Pm=d(fc),Ko=r(fc,"SPAN",{});var f3=n(Ko);qm=l(f3,"channel"),f3.forEach(t),fc.forEach(t),kp=d(e),k=r(e,"P",{});var j=n(k);Tm=l(j,"Color images are made up of some combination of values in three channels - red, green, and blue (RGB) - and grayscale images only have one channel. In \u{1F917} Transformers, the channel can be the first or last dimension of an image\u2019s tensor: ["),el=r(j,"CODE",{});var d3=n(el);jm=l(d3,"n_channels"),d3.forEach(t),Sm=l(j,", "),tl=r(j,"CODE",{});var c3=n(tl);Nm=l(c3,"height"),c3.forEach(t),zm=l(j,", "),al=r(j,"CODE",{});var u3=n(al);Cm=l(u3,"width"),u3.forEach(t),Dm=l(j,"] or ["),sl=r(j,"CODE",{});var m3=n(sl);Fm=l(m3,"height"),m3.forEach(t),Im=l(j,", "),rl=r(j,"CODE",{});var v3=n(rl);Hm=l(v3,"width"),v3.forEach(t),Mm=l(j,", "),nl=r(j,"CODE",{});var g3=n(nl);Om=l(g3,"n_channels"),g3.forEach(t),Bm=l(j,"]."),j.forEach(t),Ep=d(e),ie=r(e,"H3",{class:!0});var dc=n(ie);Et=r(dc,"A",{id:!0,class:!0,href:!0});var w3=n(Et);ol=r(w3,"SPAN",{});var b3=n(ol);u(hs.$$.fragment,b3),b3.forEach(t),w3.forEach(t),Lm=d(dc),ll=r(dc,"SPAN",{});var _3=n(ll);Rm=l(_3,"connectionist temporal classification (CTC)"),_3.forEach(t),dc.forEach(t),yp=d(e),Jr=r(e,"P",{});var $3=n(Jr);Vm=l($3,"An algorithm which allows a model to learn without knowing exactly how the input and output are aligned; CTC calculates the distribution of all possible outputs for a given input and chooses the most likely output from it. CTC is commonly used in speech recognition tasks because speech doesn\u2019t always cleanly align with the transcript for a variety of reasons such as a speaker\u2019s different speech rates."),$3.forEach(t),Ap=d(e),he=r(e,"H3",{class:!0});var cc=n(he);yt=r(cc,"A",{id:!0,class:!0,href:!0});var k3=n(yt);il=r(k3,"SPAN",{});var E3=n(il);u(ps.$$.fragment,E3),E3.forEach(t),k3.forEach(t),Gm=d(cc),hl=r(cc,"SPAN",{});var y3=n(hl);Wm=l(y3,"convolution"),y3.forEach(t),cc.forEach(t),xp=d(e),Zr=r(e,"P",{});var A3=n(Zr);Um=l(A3,"A type of layer in a neural network where the input matrix is multiplied element-wise by a smaller matrix (kernel or filter) and the values are summed up in a new matrix. This is known as a convolutional operation which is repeated over the entire input matrix. Each operation is applied to a different segment of the input matrix. Convolutional neural networks (CNNs) are commonly used in computer vision."),A3.forEach(t),Pp=d(e),pe=r(e,"H2",{class:!0});var uc=n(pe);At=r(uc,"A",{id:!0,class:!0,href:!0});var x3=n(At);pl=r(x3,"SPAN",{});var P3=n(pl);u(fs.$$.fragment,P3),P3.forEach(t),x3.forEach(t),Xm=d(uc),fl=r(uc,"SPAN",{});var q3=n(fl);Ym=l(q3,"D"),q3.forEach(t),uc.forEach(t),qp=d(e),fe=r(e,"H3",{class:!0});var mc=n(fe);xt=r(mc,"A",{id:!0,class:!0,href:!0});var T3=n(xt);dl=r(T3,"SPAN",{});var j3=n(dl);u(ds.$$.fragment,j3),j3.forEach(t),T3.forEach(t),Qm=d(mc),cl=r(mc,"SPAN",{});var S3=n(cl);Jm=l(S3,"decoder input IDs"),S3.forEach(t),mc.forEach(t),Tp=d(e),Kr=r(e,"P",{});var N3=n(Kr);Zm=l(N3,`This input is specific to encoder-decoder models, and contains the input IDs that will be fed to the decoder. These
inputs should be used for sequence to sequence tasks, such as translation or summarization, and are usually built in a
way specific to each model.`),N3.forEach(t),jp=d(e),C=r(e,"P",{});var Va=n(C);Km=l(Va,"Most encoder-decoder models (BART, T5) create their "),ul=r(Va,"CODE",{});var z3=n(ul);ev=l(z3,"decoder_input_ids"),z3.forEach(t),tv=l(Va," on their own from the "),ml=r(Va,"CODE",{});var C3=n(ml);av=l(C3,"labels"),C3.forEach(t),sv=l(Va,`. In such models,
passing the `),vl=r(Va,"CODE",{});var D3=n(vl);rv=l(D3,"labels"),D3.forEach(t),nv=l(Va," is the preferred way to handle training."),Va.forEach(t),Sp=d(e),en=r(e,"P",{});var F3=n(en);ov=l(F3,"Please check each model\u2019s docs to see how they handle these input IDs for sequence to sequence training."),F3.forEach(t),Np=d(e),de=r(e,"H3",{class:!0});var vc=n(de);Pt=r(vc,"A",{id:!0,class:!0,href:!0});var I3=n(Pt);gl=r(I3,"SPAN",{});var H3=n(gl);u(cs.$$.fragment,H3),H3.forEach(t),I3.forEach(t),lv=d(vc),wl=r(vc,"SPAN",{});var M3=n(wl);iv=l(M3,"decoder models"),M3.forEach(t),vc.forEach(t),zp=d(e),tn=r(e,"P",{});var O3=n(tn);hv=l(O3,`Also referred to as autoregressive models, decoder models involve a pretraining task (called causal language modeling) where the model reads the texts in order and has to predict the next word. It\u2019s usually done by
reading the whole sentence with a mask to hide future tokens at a certain timestep.`),O3.forEach(t),Cp=d(e),u(us.$$.fragment,e),Dp=d(e),ce=r(e,"H3",{class:!0});var gc=n(ce);qt=r(gc,"A",{id:!0,class:!0,href:!0});var B3=n(qt);bl=r(B3,"SPAN",{});var L3=n(bl);u(ms.$$.fragment,L3),L3.forEach(t),B3.forEach(t),pv=d(gc),_l=r(gc,"SPAN",{});var R3=n(_l);fv=l(R3,"deep learning (DL)"),R3.forEach(t),gc.forEach(t),Fp=d(e),an=r(e,"P",{});var V3=n(an);dv=l(V3,"Machine learning algorithms which uses neural networks with several layers."),V3.forEach(t),Ip=d(e),ue=r(e,"H2",{class:!0});var wc=n(ue);Tt=r(wc,"A",{id:!0,class:!0,href:!0});var G3=n(Tt);$l=r(G3,"SPAN",{});var W3=n($l);u(vs.$$.fragment,W3),W3.forEach(t),G3.forEach(t),cv=d(wc),kl=r(wc,"SPAN",{});var U3=n(kl);uv=l(U3,"E"),U3.forEach(t),wc.forEach(t),Hp=d(e),me=r(e,"H3",{class:!0});var bc=n(me);jt=r(bc,"A",{id:!0,class:!0,href:!0});var X3=n(jt);El=r(X3,"SPAN",{});var Y3=n(El);u(gs.$$.fragment,Y3),Y3.forEach(t),X3.forEach(t),mv=d(bc),yl=r(bc,"SPAN",{});var Q3=n(yl);vv=l(Q3,"encoder models"),Q3.forEach(t),bc.forEach(t),Mp=d(e),St=r(e,"P",{});var _c=n(St);gv=l(_c,"Also known as autoencoding models, encoder models take an input (such as text or images) and transform them into a condensed numerical representation called an embedding. Oftentimes, encoder models are pretrained using techniques like "),sn=r(_c,"A",{href:!0});var J3=n(sn);wv=l(J3,"masked language modeling"),J3.forEach(t),bv=l(_c,", which masks parts of the input sequence and forces the model to create more meaningful representations."),_c.forEach(t),Op=d(e),u(ws.$$.fragment,e),Bp=d(e),ve=r(e,"H2",{class:!0});var $c=n(ve);Nt=r($c,"A",{id:!0,class:!0,href:!0});var Z3=n(Nt);Al=r(Z3,"SPAN",{});var K3=n(Al);u(bs.$$.fragment,K3),K3.forEach(t),Z3.forEach(t),_v=d($c),xl=r($c,"SPAN",{});var e2=n(xl);$v=l(e2,"F"),e2.forEach(t),$c.forEach(t),Lp=d(e),ge=r(e,"H3",{class:!0});var kc=n(ge);zt=r(kc,"A",{id:!0,class:!0,href:!0});var t2=n(zt);Pl=r(t2,"SPAN",{});var a2=n(Pl);u(_s.$$.fragment,a2),a2.forEach(t),t2.forEach(t),kv=d(kc),ql=r(kc,"SPAN",{});var s2=n(ql);Ev=l(s2,"feature extraction"),s2.forEach(t),kc.forEach(t),Rp=d(e),rn=r(e,"P",{});var r2=n(rn);yv=l(r2,"The process of selecting and transforming raw data into a set of features that are more informative and useful for machine learning algorithms. Some examples of feature extraction include transforming raw text into word embeddings and extracting important features such as edges or shapes from image/video data."),r2.forEach(t),Vp=d(e),we=r(e,"H3",{class:!0});var Ec=n(we);Ct=r(Ec,"A",{id:!0,class:!0,href:!0});var n2=n(Ct);Tl=r(n2,"SPAN",{});var o2=n(Tl);u($s.$$.fragment,o2),o2.forEach(t),n2.forEach(t),Av=d(Ec),jl=r(Ec,"SPAN",{});var l2=n(jl);xv=l(l2,"feed forward chunking"),l2.forEach(t),Ec.forEach(t),Gp=d(e),Dt=r(e,"P",{});var yc=n(Dt);Pv=l(yc,`In each residual attention block in transformers the self-attention layer is usually followed by 2 feed forward layers.
The intermediate embedding size of the feed forward layers is often bigger than the hidden size of the model (e.g., for
`),Sl=r(yc,"CODE",{});var i2=n(Sl);qv=l(i2,"bert-base-uncased"),i2.forEach(t),Tv=l(yc,")."),yc.forEach(t),Wp=d(e),_=r(e,"P",{});var E=n(_);jv=l(E,"For an input of size "),Nl=r(E,"CODE",{});var h2=n(Nl);Sv=l(h2,"[batch_size, sequence_length]"),h2.forEach(t),Nv=l(E,`, the memory required to store the intermediate feed forward
embeddings `),zl=r(E,"CODE",{});var p2=n(zl);zv=l(p2,"[batch_size, sequence_length, config.intermediate_size]"),p2.forEach(t),Cv=l(E,` can account for a large fraction of the memory
use. The authors of `),ks=r(E,"A",{href:!0,rel:!0});var f2=n(ks);Dv=l(f2,"Reformer: The Efficient Transformer"),f2.forEach(t),Fv=l(E,` noticed that since the
computation is independent of the `),Cl=r(E,"CODE",{});var d2=n(Cl);Iv=l(d2,"sequence_length"),d2.forEach(t),Hv=l(E,` dimension, it is mathematically equivalent to compute the output
embeddings of both feed forward layers `),Dl=r(E,"CODE",{});var c2=n(Dl);Mv=l(c2,"[batch_size, config.hidden_size]_0, ..., [batch_size, config.hidden_size]_n"),c2.forEach(t),Ov=l(E,`
individually and concat them afterward to `),Fl=r(E,"CODE",{});var u2=n(Fl);Bv=l(u2,"[batch_size, sequence_length, config.hidden_size]"),u2.forEach(t),Lv=l(E," with "),Il=r(E,"CODE",{});var m2=n(Il);Rv=l(m2,"n = sequence_length"),m2.forEach(t),Vv=l(E,`, which trades increased computation time against reduced memory use, but yields a mathematically
`),Hl=r(E,"STRONG",{});var v2=n(Hl);Gv=l(v2,"equivalent"),v2.forEach(t),Wv=l(E," result."),E.forEach(t),Up=d(e),D=r(e,"P",{});var Ga=n(D);Uv=l(Ga,"For models employing the function "),nn=r(Ga,"A",{href:!0});var g2=n(nn);Xv=l(g2,"apply_chunking_to_forward()"),g2.forEach(t),Yv=l(Ga,", the "),Ml=r(Ga,"CODE",{});var w2=n(Ml);Qv=l(w2,"chunk_size"),w2.forEach(t),Jv=l(Ga,` defines the number of output
embeddings that are computed in parallel and thus defines the trade-off between memory and time complexity. If
`),Ol=r(Ga,"CODE",{});var b2=n(Ol);Zv=l(b2,"chunk_size"),b2.forEach(t),Kv=l(Ga," is set to 0, no feed forward chunking is done."),Ga.forEach(t),Xp=d(e),be=r(e,"H3",{class:!0});var Ac=n(be);Ft=r(Ac,"A",{id:!0,class:!0,href:!0});var _2=n(Ft);Bl=r(_2,"SPAN",{});var $2=n(Bl);u(Es.$$.fragment,$2),$2.forEach(t),_2.forEach(t),e1=d(Ac),Ll=r(Ac,"SPAN",{});var k2=n(Ll);t1=l(k2,"finetuned models"),k2.forEach(t),Ac.forEach(t),Yp=d(e),It=r(e,"P",{});var xc=n(It);a1=l(xc,"Finetuning is a form of transfer learning which involves taking a pretrained model, freezing its weights, and replacing the output layer with a newly added "),on=r(xc,"A",{href:!0});var E2=n(on);s1=l(E2,"model head"),E2.forEach(t),r1=l(xc,". The model head is trained on your target dataset."),xc.forEach(t),Qp=d(e),Ht=r(e,"P",{});var Pc=n(Ht);n1=l(Pc,"See the "),ys=r(Pc,"A",{href:!0,rel:!0});var y2=n(ys);o1=l(y2,"Fine-tune a pretrained model"),y2.forEach(t),l1=l(Pc," tutorial for more details, and learn how to fine-tune models with \u{1F917} Transformers."),Pc.forEach(t),Jp=d(e),_e=r(e,"H2",{class:!0});var qc=n(_e);Mt=r(qc,"A",{id:!0,class:!0,href:!0});var A2=n(Mt);Rl=r(A2,"SPAN",{});var x2=n(Rl);u(As.$$.fragment,x2),x2.forEach(t),A2.forEach(t),i1=d(qc),Vl=r(qc,"SPAN",{});var P2=n(Vl);h1=l(P2,"H"),P2.forEach(t),qc.forEach(t),Zp=d(e),$e=r(e,"H3",{class:!0});var Tc=n($e);Ot=r(Tc,"A",{id:!0,class:!0,href:!0});var q2=n(Ot);Gl=r(q2,"SPAN",{});var T2=n(Gl);u(xs.$$.fragment,T2),T2.forEach(t),q2.forEach(t),p1=d(Tc),Wl=r(Tc,"SPAN",{});var j2=n(Wl);f1=l(j2,"head"),j2.forEach(t),Tc.forEach(t),Kp=d(e),ln=r(e,"P",{});var S2=n(ln);d1=l(S2,"The model head refers to the last layer of a neural network that accepts the raw hidden states and projects them onto a different dimension. There is a different model head for each task. For example:"),S2.forEach(t),ef=d(e),I=r(e,"UL",{});var vo=n(I);Bt=r(vo,"LI",{});var Gh=n(Bt);hn=r(Gh,"A",{href:!0});var N2=n(hn);c1=l(N2,"GPT2ForSequenceClassification"),N2.forEach(t),u1=l(Gh," is a sequence classification head - a linear layer - on top of the base "),pn=r(Gh,"A",{href:!0});var z2=n(pn);m1=l(z2,"GPT2Model"),z2.forEach(t),v1=l(Gh,"."),Gh.forEach(t),g1=d(vo),H=r(vo,"LI",{});var Nr=n(H);fn=r(Nr,"A",{href:!0});var C2=n(fn);w1=l(C2,"ViTForImageClassification"),C2.forEach(t),b1=l(Nr," is an image classification head - a linear layer on top of the final hidden state of the "),Ul=r(Nr,"CODE",{});var D2=n(Ul);_1=l(D2,"CLS"),D2.forEach(t),$1=l(Nr," token - on top of the base "),dn=r(Nr,"A",{href:!0});var F2=n(dn);k1=l(F2,"ViTModel"),F2.forEach(t),E1=l(Nr,"."),Nr.forEach(t),y1=d(vo),M=r(vo,"LI",{});var zr=n(M);cn=r(zr,"A",{href:!0});var I2=n(cn);A1=l(I2,"Wav2Vec2ForCTC"),I2.forEach(t),x1=l(zr," ia a language modeling head with "),un=r(zr,"A",{href:!0});var H2=n(un);P1=l(H2,"CTC"),H2.forEach(t),q1=l(zr," on top of the base "),mn=r(zr,"A",{href:!0});var M2=n(mn);T1=l(M2,"Wav2Vec2Model"),M2.forEach(t),j1=l(zr,"."),zr.forEach(t),vo.forEach(t),tf=d(e),ke=r(e,"H2",{class:!0});var jc=n(ke);Lt=r(jc,"A",{id:!0,class:!0,href:!0});var O2=n(Lt);Xl=r(O2,"SPAN",{});var B2=n(Xl);u(Ps.$$.fragment,B2),B2.forEach(t),O2.forEach(t),S1=d(jc),Yl=r(jc,"SPAN",{});var L2=n(Yl);N1=l(L2,"I"),L2.forEach(t),jc.forEach(t),af=d(e),Ee=r(e,"H3",{class:!0});var Sc=n(Ee);Rt=r(Sc,"A",{id:!0,class:!0,href:!0});var R2=n(Rt);Ql=r(R2,"SPAN",{});var V2=n(Ql);u(qs.$$.fragment,V2),V2.forEach(t),R2.forEach(t),z1=d(Sc),Jl=r(Sc,"SPAN",{});var G2=n(Jl);C1=l(G2,"image patch"),G2.forEach(t),Sc.forEach(t),sf=d(e),Vt=r(e,"P",{});var Nc=n(Vt);D1=l(Nc,"Vision-based Transformers models split an image into smaller patches which are linearly embedded, and then passed as a sequence to the model. You can find the "),Zl=r(Nc,"CODE",{});var W2=n(Zl);F1=l(W2,"patch_size"),W2.forEach(t),I1=l(Nc," - or resolution - of the model in it\u2019s configuration."),Nc.forEach(t),rf=d(e),ye=r(e,"H3",{class:!0});var zc=n(ye);Gt=r(zc,"A",{id:!0,class:!0,href:!0});var U2=n(Gt);Kl=r(U2,"SPAN",{});var X2=n(Kl);u(Ts.$$.fragment,X2),X2.forEach(t),U2.forEach(t),H1=d(zc),ei=r(zc,"SPAN",{});var Y2=n(ei);M1=l(Y2,"inference"),Y2.forEach(t),zc.forEach(t),nf=d(e),Wt=r(e,"P",{});var Cc=n(Wt);O1=l(Cc,"Inference is the process of evaluating a model on new data after training is complete. See the "),js=r(Cc,"A",{href:!0,rel:!0});var Q2=n(js);B1=l(Q2,"Pipeline for inference"),Q2.forEach(t),L1=l(Cc," tutorial to learn how to perform inference with \u{1F917} Transformers."),Cc.forEach(t),of=d(e),Ae=r(e,"H3",{class:!0});var Dc=n(Ae);Ut=r(Dc,"A",{id:!0,class:!0,href:!0});var J2=n(Ut);ti=r(J2,"SPAN",{});var Z2=n(ti);u(Ss.$$.fragment,Z2),Z2.forEach(t),J2.forEach(t),R1=d(Dc),ai=r(Dc,"SPAN",{});var K2=n(ai);V1=l(K2,"input IDs"),K2.forEach(t),Dc.forEach(t),lf=d(e),vn=r(e,"P",{});var ek=n(vn);G1=l(ek,`The input ids are often the only required parameters to be passed to the model as input. They are token indices,
numerical representations of tokens building the sequences that will be used as input by the model.`),ek.forEach(t),hf=d(e),u(Ns.$$.fragment,e),pf=d(e),Xt=r(e,"P",{});var Fc=n(Xt);W1=l(Fc,`Each tokenizer works differently but the underlying mechanism remains the same. Here\u2019s an example using the BERT
tokenizer, which is a `),zs=r(Fc,"A",{href:!0,rel:!0});var tk=n(zs);U1=l(tk,"WordPiece"),tk.forEach(t),X1=l(Fc," tokenizer:"),Fc.forEach(t),ff=d(e),u(Cs.$$.fragment,e),df=d(e),gn=r(e,"P",{});var ak=n(gn);Y1=l(ak,"The tokenizer takes care of splitting the sequence into tokens available in the tokenizer vocabulary."),ak.forEach(t),cf=d(e),u(Ds.$$.fragment,e),uf=d(e),wn=r(e,"P",{});var sk=n(wn);Q1=l(sk,`The tokens are either words or subwords. Here for instance, \u201CVRAM\u201D wasn\u2019t in the model vocabulary, so it\u2019s been split
in \u201CV\u201D, \u201CRA\u201D and \u201CM\u201D. To indicate those tokens are not separate words but parts of the same word, a double-hash prefix
is added for \u201CRA\u201D and \u201CM\u201D:`),sk.forEach(t),mf=d(e),u(Fs.$$.fragment,e),vf=d(e),Yt=r(e,"P",{});var Ic=n(Yt);J1=l(Ic,`These tokens can then be converted into IDs which are understandable by the model. This can be done by directly feeding
the sentence to the tokenizer, which leverages the Rust implementation of `),Is=r(Ic,"A",{href:!0,rel:!0});var rk=n(Is);Z1=l(rk,`\u{1F917}
Tokenizers`),rk.forEach(t),K1=l(Ic," for peak performance."),Ic.forEach(t),gf=d(e),u(Hs.$$.fragment,e),wf=d(e),Qt=r(e,"P",{});var Hc=n(Qt);eg=l(Hc,`The tokenizer returns a dictionary with all the arguments necessary for its corresponding model to work properly. The
token indices are under the key `),si=r(Hc,"CODE",{});var nk=n(si);tg=l(nk,"input_ids"),nk.forEach(t),ag=l(Hc,":"),Hc.forEach(t),bf=d(e),u(Ms.$$.fragment,e),_f=d(e),bn=r(e,"P",{});var ok=n(bn);sg=l(ok,`Note that the tokenizer automatically adds \u201Cspecial tokens\u201D (if the associated model relies on them) which are special
IDs the model sometimes uses.`),ok.forEach(t),$f=d(e),_n=r(e,"P",{});var lk=n(_n);rg=l(lk,"If we decode the previous sequence of ids,"),lk.forEach(t),kf=d(e),u(Os.$$.fragment,e),Ef=d(e),$n=r(e,"P",{});var ik=n($n);ng=l(ik,"we will see"),ik.forEach(t),yf=d(e),u(Bs.$$.fragment,e),Af=d(e),Jt=r(e,"P",{});var Mc=n(Jt);og=l(Mc,"because this is the way a "),kn=r(Mc,"A",{href:!0});var hk=n(kn);lg=l(hk,"BertModel"),hk.forEach(t),ig=l(Mc," is going to expect its inputs."),Mc.forEach(t),xf=d(e),xe=r(e,"H2",{class:!0});var Oc=n(xe);Zt=r(Oc,"A",{id:!0,class:!0,href:!0});var pk=n(Zt);ri=r(pk,"SPAN",{});var fk=n(ri);u(Ls.$$.fragment,fk),fk.forEach(t),pk.forEach(t),hg=d(Oc),ni=r(Oc,"SPAN",{});var dk=n(ni);pg=l(dk,"L"),dk.forEach(t),Oc.forEach(t),Pf=d(e),Pe=r(e,"H3",{class:!0});var Bc=n(Pe);Kt=r(Bc,"A",{id:!0,class:!0,href:!0});var ck=n(Kt);oi=r(ck,"SPAN",{});var uk=n(oi);u(Rs.$$.fragment,uk),uk.forEach(t),ck.forEach(t),fg=d(Bc),li=r(Bc,"SPAN",{});var mk=n(li);dg=l(mk,"labels"),mk.forEach(t),Bc.forEach(t),qf=d(e),En=r(e,"P",{});var vk=n(En);cg=l(vk,`The labels are an optional argument which can be passed in order for the model to compute the loss itself. These labels
should be the expected prediction of the model: it will use the standard loss in order to compute the loss between its
predictions and the expected value (the label).`),vk.forEach(t),Tf=d(e),yn=r(e,"P",{});var gk=n(yn);ug=l(gk,"These labels are different according to the model head, for example:"),gk.forEach(t),jf=d(e),$=r(e,"UL",{});var A=n($);qe=r(A,"LI",{});var go=n(qe);mg=l(go,"For sequence classification models, ("),An=r(go,"A",{href:!0});var wk=n(An);vg=l(wk,"BertForSequenceClassification"),wk.forEach(t),gg=l(go,`), the model expects a tensor of dimension
`),ii=r(go,"CODE",{});var bk=n(ii);wg=l(bk,"(batch_size)"),bk.forEach(t),bg=l(go," with each value of the batch corresponding to the expected label of the entire sequence."),go.forEach(t),_g=d(A),Te=r(A,"LI",{});var wo=n(Te);$g=l(wo,"For token classification models, ("),xn=r(wo,"A",{href:!0});var _k=n(xn);kg=l(_k,"BertForTokenClassification"),_k.forEach(t),Eg=l(wo,`), the model expects a tensor of dimension
`),hi=r(wo,"CODE",{});var $k=n(hi);yg=l($k,"(batch_size, seq_length)"),$k.forEach(t),Ag=l(wo," with each value corresponding to the expected label of each individual token."),wo.forEach(t),xg=d(A),je=r(A,"LI",{});var bo=n(je);Pg=l(bo,"For masked language modeling, ("),Pn=r(bo,"A",{href:!0});var kk=n(Pn);qg=l(kk,"BertForMaskedLM"),kk.forEach(t),Tg=l(bo,"), the model expects a tensor of dimension "),pi=r(bo,"CODE",{});var Ek=n(pi);jg=l(Ek,"(batch_size, seq_length)"),Ek.forEach(t),Sg=l(bo,` with each value corresponding to the expected label of each individual token: the labels being the token
ID for the masked token, and values to be ignored for the rest (usually -100).`),bo.forEach(t),Ng=d(A),N=r(A,"LI",{});var Y=n(N);zg=l(Y,"For sequence to sequence tasks, ("),qn=r(Y,"A",{href:!0});var yk=n(qn);Cg=l(yk,"BartForConditionalGeneration"),yk.forEach(t),Dg=l(Y,", "),Tn=r(Y,"A",{href:!0});var Ak=n(Tn);Fg=l(Ak,"MBartForConditionalGeneration"),Ak.forEach(t),Ig=l(Y,`), the model
expects a tensor of dimension `),fi=r(Y,"CODE",{});var xk=n(fi);Hg=l(xk,"(batch_size, tgt_seq_length)"),xk.forEach(t),Mg=l(Y,` with each value corresponding to the target sequences
associated with each input sequence. During training, both BART and T5 will make the appropriate
`),di=r(Y,"CODE",{});var Pk=n(di);Og=l(Pk,"decoder_input_ids"),Pk.forEach(t),Bg=l(Y,` and decoder attention masks internally. They usually do not need to be supplied. This does not
apply to models leveraging the Encoder-Decoder framework.`),Y.forEach(t),Lg=d(A),Se=r(A,"LI",{});var _o=n(Se);Rg=l(_o,"For image classification models, ("),jn=r(_o,"A",{href:!0});var qk=n(jn);Vg=l(qk,"ViTForImageClassification"),qk.forEach(t),Gg=l(_o,`), the model expects a tensor of dimension
`),ci=r(_o,"CODE",{});var Tk=n(ci);Wg=l(Tk,"(batch_size)"),Tk.forEach(t),Ug=l(_o," with each value of the batch corresponding to the expected label of each individual image."),_o.forEach(t),Xg=d(A),Ne=r(A,"LI",{});var $o=n(Ne);Yg=l($o,"For semantic segmentation models, ("),Sn=r($o,"A",{href:!0});var jk=n(Sn);Qg=l(jk,"SegformerForSemanticSegmentation"),jk.forEach(t),Jg=l($o,`), the model expects a tensor of dimension
`),ui=r($o,"CODE",{});var Sk=n(ui);Zg=l(Sk,"(batch_size, height, width)"),Sk.forEach(t),Kg=l($o," with each value of the batch corresponding to the expected label of each individual pixel."),$o.forEach(t),ew=d(A),F=r(A,"LI",{});var Wa=n(F);tw=l(Wa,"For object detection models, ("),Nn=r(Wa,"A",{href:!0});var Nk=n(Nn);aw=l(Nk,"DetrForObjectDetection"),Nk.forEach(t),sw=l(Wa,`), the model expects a list of dictionaries with a
`),mi=r(Wa,"CODE",{});var zk=n(mi);rw=l(zk,"class_labels"),zk.forEach(t),nw=l(Wa," and "),vi=r(Wa,"CODE",{});var Ck=n(vi);ow=l(Ck,"boxes"),Ck.forEach(t),lw=l(Wa," key where each value of the batch corresponds to the expected label and number of bounding boxes of each individual image."),Wa.forEach(t),iw=d(A),ze=r(A,"LI",{});var ko=n(ze);hw=l(ko,"For automatic speech recognition models, ("),zn=r(ko,"A",{href:!0});var Dk=n(zn);pw=l(Dk,"Wav2Vec2ForCTC"),Dk.forEach(t),fw=l(ko,"), the model expects a tensor of dimension "),gi=r(ko,"CODE",{});var Fk=n(gi);dw=l(Fk,"(batch_size, target_length)"),Fk.forEach(t),cw=l(ko," with each value corresponding to the expected label of each individual token."),ko.forEach(t),A.forEach(t),Sf=d(e),u(ea.$$.fragment,e),Nf=d(e),ta=r(e,"P",{});var Lc=n(ta);uw=l(Lc,"The base models ("),Cn=r(Lc,"A",{href:!0});var Ik=n(Cn);mw=l(Ik,"BertModel"),Ik.forEach(t),vw=l(Lc,`) do not accept labels, as these are the base transformer models, simply outputting
features.`),Lc.forEach(t),zf=d(e),Ce=r(e,"H3",{class:!0});var Rc=n(Ce);aa=r(Rc,"A",{id:!0,class:!0,href:!0});var Hk=n(aa);wi=r(Hk,"SPAN",{});var Mk=n(wi);u(Vs.$$.fragment,Mk),Mk.forEach(t),Hk.forEach(t),gw=d(Rc),bi=r(Rc,"SPAN",{});var Ok=n(bi);ww=l(Ok,"large language models (LLM)"),Ok.forEach(t),Rc.forEach(t),Cf=d(e),Dn=r(e,"P",{});var Bk=n(Dn);bw=l(Bk,"A generic term that refers to transformer language models (GPT-3, BLOOM, OPT) that were trained on a large quantity of data. These models also tend to have a large number of learnable parameters (e.g. 175 billion for GPT-3)."),Bk.forEach(t),Df=d(e),De=r(e,"H2",{class:!0});var Vc=n(De);sa=r(Vc,"A",{id:!0,class:!0,href:!0});var Lk=n(sa);_i=r(Lk,"SPAN",{});var Rk=n(_i);u(Gs.$$.fragment,Rk),Rk.forEach(t),Lk.forEach(t),_w=d(Vc),$i=r(Vc,"SPAN",{});var Vk=n($i);$w=l(Vk,"M"),Vk.forEach(t),Vc.forEach(t),Ff=d(e),Fe=r(e,"H3",{class:!0});var Gc=n(Fe);ra=r(Gc,"A",{id:!0,class:!0,href:!0});var Gk=n(ra);ki=r(Gk,"SPAN",{});var Wk=n(ki);u(Ws.$$.fragment,Wk),Wk.forEach(t),Gk.forEach(t),kw=d(Gc),Ei=r(Gc,"SPAN",{});var Uk=n(Ei);Ew=l(Uk,"masked language modeling (MLM)"),Uk.forEach(t),Gc.forEach(t),If=d(e),Fn=r(e,"P",{});var Xk=n(Fn);yw=l(Xk,`A pretraining task where the model sees a corrupted version of the texts, usually done by
masking some tokens randomly, and has to predict the original text.`),Xk.forEach(t),Hf=d(e),Ie=r(e,"H3",{class:!0});var Wc=n(Ie);na=r(Wc,"A",{id:!0,class:!0,href:!0});var Yk=n(na);yi=r(Yk,"SPAN",{});var Qk=n(yi);u(Us.$$.fragment,Qk),Qk.forEach(t),Yk.forEach(t),Aw=d(Wc),Ai=r(Wc,"SPAN",{});var Jk=n(Ai);xw=l(Jk,"multimodal"),Jk.forEach(t),Wc.forEach(t),Mf=d(e),In=r(e,"P",{});var Zk=n(In);Pw=l(Zk,"A task that combines texts with another kind of inputs (for instance images)."),Zk.forEach(t),Of=d(e),He=r(e,"H2",{class:!0});var Uc=n(He);oa=r(Uc,"A",{id:!0,class:!0,href:!0});var Kk=n(oa);xi=r(Kk,"SPAN",{});var eE=n(xi);u(Xs.$$.fragment,eE),eE.forEach(t),Kk.forEach(t),qw=d(Uc),Pi=r(Uc,"SPAN",{});var tE=n(Pi);Tw=l(tE,"N"),tE.forEach(t),Uc.forEach(t),Bf=d(e),Me=r(e,"H3",{class:!0});var Xc=n(Me);la=r(Xc,"A",{id:!0,class:!0,href:!0});var aE=n(la);qi=r(aE,"SPAN",{});var sE=n(qi);u(Ys.$$.fragment,sE),sE.forEach(t),aE.forEach(t),jw=d(Xc),Ti=r(Xc,"SPAN",{});var rE=n(Ti);Sw=l(rE,"Natural language generation (NLG)"),rE.forEach(t),Xc.forEach(t),Lf=d(e),ia=r(e,"P",{});var Yc=n(ia);Nw=l(Yc,"All tasks related to generating text (for instance, "),Qs=r(Yc,"A",{href:!0,rel:!0});var nE=n(Qs);zw=l(nE,"Write With Transformers"),nE.forEach(t),Cw=l(Yc,", translation)."),Yc.forEach(t),Rf=d(e),Oe=r(e,"H3",{class:!0});var Qc=n(Oe);ha=r(Qc,"A",{id:!0,class:!0,href:!0});var oE=n(ha);ji=r(oE,"SPAN",{});var lE=n(ji);u(Js.$$.fragment,lE),lE.forEach(t),oE.forEach(t),Dw=d(Qc),Si=r(Qc,"SPAN",{});var iE=n(Si);Fw=l(iE,"Natural language processing (NLP)"),iE.forEach(t),Qc.forEach(t),Vf=d(e),Hn=r(e,"P",{});var hE=n(Hn);Iw=l(hE,"A generic way to say \u201Cdeal with texts\u201D."),hE.forEach(t),Gf=d(e),Be=r(e,"H3",{class:!0});var Jc=n(Be);pa=r(Jc,"A",{id:!0,class:!0,href:!0});var pE=n(pa);Ni=r(pE,"SPAN",{});var fE=n(Ni);u(Zs.$$.fragment,fE),fE.forEach(t),pE.forEach(t),Hw=d(Jc),zi=r(Jc,"SPAN",{});var dE=n(zi);Mw=l(dE,"Natural language understanding (NLU)"),dE.forEach(t),Jc.forEach(t),Wf=d(e),Mn=r(e,"P",{});var cE=n(Mn);Ow=l(cE,`All tasks related to understanding what is in a text (for instance classifying the
whole text, individual words).`),cE.forEach(t),Uf=d(e),Le=r(e,"H2",{class:!0});var Zc=n(Le);fa=r(Zc,"A",{id:!0,class:!0,href:!0});var uE=n(fa);Ci=r(uE,"SPAN",{});var mE=n(Ci);u(Ks.$$.fragment,mE),mE.forEach(t),uE.forEach(t),Bw=d(Zc),Di=r(Zc,"SPAN",{});var vE=n(Di);Lw=l(vE,"P"),vE.forEach(t),Zc.forEach(t),Xf=d(e),Re=r(e,"H3",{class:!0});var Kc=n(Re);da=r(Kc,"A",{id:!0,class:!0,href:!0});var gE=n(da);Fi=r(gE,"SPAN",{});var wE=n(Fi);u(er.$$.fragment,wE),wE.forEach(t),gE.forEach(t),Rw=d(Kc),Ii=r(Kc,"SPAN",{});var bE=n(Ii);Vw=l(bE,"pipeline"),bE.forEach(t),Kc.forEach(t),Yf=d(e),On=r(e,"P",{});var _E=n(On);Gw=l(_E,"A pipeline in \u{1F917} Transformers is an abstraction referring to a series of steps that are executed in a specific order to preprocess and transform data and return a prediction from a model. Some example stages found in a pipeline might be data preprocessing, feature extraction, and normalization."),_E.forEach(t),Qf=d(e),ca=r(e,"P",{});var eu=n(ca);Ww=l(eu,"For more details, see "),tr=r(eu,"A",{href:!0,rel:!0});var $E=n(tr);Uw=l($E,"Pipelines for inference"),$E.forEach(t),Xw=l(eu,"."),eu.forEach(t),Jf=d(e),Ve=r(e,"H3",{class:!0});var tu=n(Ve);ua=r(tu,"A",{id:!0,class:!0,href:!0});var kE=n(ua);Hi=r(kE,"SPAN",{});var EE=n(Hi);u(ar.$$.fragment,EE),EE.forEach(t),kE.forEach(t),Yw=d(tu),Mi=r(tu,"SPAN",{});var yE=n(Mi);Qw=l(yE,"pixel values"),yE.forEach(t),tu.forEach(t),Zf=d(e),T=r(e,"P",{});var Q=n(T);Jw=l(Q,"A tensor of the numerical representations of an image that is passed to a model. The pixel values have a shape of ["),Oi=r(Q,"CODE",{});var AE=n(Oi);Zw=l(AE,"batch_size"),AE.forEach(t),Kw=l(Q,", "),Bi=r(Q,"CODE",{});var xE=n(Bi);eb=l(xE,"num_channels"),xE.forEach(t),tb=l(Q,", "),Li=r(Q,"CODE",{});var PE=n(Li);ab=l(PE,"height"),PE.forEach(t),sb=l(Q,", "),Ri=r(Q,"CODE",{});var qE=n(Ri);rb=l(qE,"width"),qE.forEach(t),nb=l(Q,"], and are generated from an image processor."),Q.forEach(t),Kf=d(e),Ge=r(e,"H3",{class:!0});var au=n(Ge);ma=r(au,"A",{id:!0,class:!0,href:!0});var TE=n(ma);Vi=r(TE,"SPAN",{});var jE=n(Vi);u(sr.$$.fragment,jE),jE.forEach(t),TE.forEach(t),ob=d(au),Gi=r(au,"SPAN",{});var SE=n(Gi);lb=l(SE,"pooling"),SE.forEach(t),au.forEach(t),ed=d(e),Bn=r(e,"P",{});var NE=n(Bn);ib=l(NE,"An operation that reduces a matrix into a smaller matrix, either by taking the maximum or average of the pooled dimension(s). Pooling layers are commonly found between convolutional layers to downsample the feature representation."),NE.forEach(t),td=d(e),We=r(e,"H3",{class:!0});var su=n(We);va=r(su,"A",{id:!0,class:!0,href:!0});var zE=n(va);Wi=r(zE,"SPAN",{});var CE=n(Wi);u(rr.$$.fragment,CE),CE.forEach(t),zE.forEach(t),hb=d(su),Ui=r(su,"SPAN",{});var DE=n(Ui);pb=l(DE,"position IDs"),DE.forEach(t),su.forEach(t),ad=d(e),ga=r(e,"P",{});var ru=n(ga);fb=l(ru,`Contrary to RNNs that have the position of each token embedded within them, transformers are unaware of the position of
each token. Therefore, the position IDs (`),Xi=r(ru,"CODE",{});var FE=n(Xi);db=l(FE,"position_ids"),FE.forEach(t),cb=l(ru,`) are used by the model to identify each token\u2019s position in the
list of tokens.`),ru.forEach(t),sd=d(e),wa=r(e,"P",{});var nu=n(wa);ub=l(nu,"They are an optional parameter. If no "),Yi=r(nu,"CODE",{});var IE=n(Yi);mb=l(IE,"position_ids"),IE.forEach(t),vb=l(nu,` are passed to the model, the IDs are automatically created as
absolute positional embeddings.`),nu.forEach(t),rd=d(e),ba=r(e,"P",{});var ou=n(ba);gb=l(ou,"Absolute positional embeddings are selected in the range "),Qi=r(ou,"CODE",{});var HE=n(Qi);wb=l(HE,"[0, config.max_position_embeddings - 1]"),HE.forEach(t),bb=l(ou,`. Some models use
other types of positional embeddings, such as sinusoidal position embeddings or relative position embeddings.`),ou.forEach(t),nd=d(e),Ue=r(e,"H3",{class:!0});var lu=n(Ue);_a=r(lu,"A",{id:!0,class:!0,href:!0});var ME=n(_a);Ji=r(ME,"SPAN",{});var OE=n(Ji);u(nr.$$.fragment,OE),OE.forEach(t),ME.forEach(t),_b=d(lu),Zi=r(lu,"SPAN",{});var BE=n(Zi);$b=l(BE,"preprocessing"),BE.forEach(t),lu.forEach(t),od=d(e),$a=r(e,"P",{});var iu=n($a);kb=l(iu,"The task of preparing raw data into a format that can be easily consumed by machine learning models. For example, text is typically preprocessed by tokenization. To gain a better idea of what preprocessing looks like for other input types, check out the "),or=r(iu,"A",{href:!0,rel:!0});var LE=n(or);Eb=l(LE,"Preprocess"),LE.forEach(t),yb=l(iu," tutorial."),iu.forEach(t),ld=d(e),Xe=r(e,"H3",{class:!0});var hu=n(Xe);ka=r(hu,"A",{id:!0,class:!0,href:!0});var RE=n(ka);Ki=r(RE,"SPAN",{});var VE=n(Ki);u(lr.$$.fragment,VE),VE.forEach(t),RE.forEach(t),Ab=d(hu),eh=r(hu,"SPAN",{});var GE=n(eh);xb=l(GE,"pretrained model"),GE.forEach(t),hu.forEach(t),id=d(e),O=r(e,"P",{});var Eo=n(O);Pb=l(Eo,`A model that has been pretrained on some data (for instance all of Wikipedia). Pretraining methods involve a
self-supervised objective, which can be reading the text and trying to predict the next word (see `),Ln=r(Eo,"A",{href:!0});var WE=n(Ln);qb=l(WE,`causal language
modeling`),WE.forEach(t),Tb=l(Eo,") or masking some words and trying to predict them (see "),Rn=r(Eo,"A",{href:!0});var UE=n(Rn);jb=l(UE,`masked language
modeling`),UE.forEach(t),Sb=l(Eo,")."),Eo.forEach(t),hd=d(e),Vn=r(e,"P",{});var XE=n(Vn);Nb=l(XE,"Speech and vision models have their own pretraining objectives. For example, Wav2Vec2 is a speech model pretrained on a contrastive task which requires the model to identify the \u201Ctrue\u201D speech representation from a set of \u201Cfalse\u201D speech representations. On the other hand, BEiT is a vision model pretrained on a masked image modeling task which masks some of the image patches and requires the model to predict the masked patches (similar to the masked language modeling objective)."),XE.forEach(t),pd=d(e),Ye=r(e,"H2",{class:!0});var pu=n(Ye);Ea=r(pu,"A",{id:!0,class:!0,href:!0});var YE=n(Ea);th=r(YE,"SPAN",{});var QE=n(th);u(ir.$$.fragment,QE),QE.forEach(t),YE.forEach(t),zb=d(pu),ah=r(pu,"SPAN",{});var JE=n(ah);Cb=l(JE,"R"),JE.forEach(t),pu.forEach(t),fd=d(e),Qe=r(e,"H3",{class:!0});var fu=n(Qe);ya=r(fu,"A",{id:!0,class:!0,href:!0});var ZE=n(ya);sh=r(ZE,"SPAN",{});var KE=n(sh);u(hr.$$.fragment,KE),KE.forEach(t),ZE.forEach(t),Db=d(fu),rh=r(fu,"SPAN",{});var e5=n(rh);Fb=l(e5,"recurrent neural network (RNN)"),e5.forEach(t),fu.forEach(t),dd=d(e),Gn=r(e,"P",{});var t5=n(Gn);Ib=l(t5,"A type of model that uses a loop over a layer to process texts."),t5.forEach(t),cd=d(e),Je=r(e,"H3",{class:!0});var du=n(Je);Aa=r(du,"A",{id:!0,class:!0,href:!0});var a5=n(Aa);nh=r(a5,"SPAN",{});var s5=n(nh);u(pr.$$.fragment,s5),s5.forEach(t),a5.forEach(t),Hb=d(du),oh=r(du,"SPAN",{});var r5=n(oh);Mb=l(r5,"representation learning"),r5.forEach(t),du.forEach(t),ud=d(e),Wn=r(e,"P",{});var n5=n(Wn);Ob=l(n5,"A subfield of machine learning which focuses on learning meaningful representations of raw data. Some examples of representation learning techniques include word embeddings, autoencoders, and Generative Adversarial Networks (GANs)."),n5.forEach(t),md=d(e),Ze=r(e,"H2",{class:!0});var cu=n(Ze);xa=r(cu,"A",{id:!0,class:!0,href:!0});var o5=n(xa);lh=r(o5,"SPAN",{});var l5=n(lh);u(fr.$$.fragment,l5),l5.forEach(t),o5.forEach(t),Bb=d(cu),ih=r(cu,"SPAN",{});var i5=n(ih);Lb=l(i5,"S"),i5.forEach(t),cu.forEach(t),vd=d(e),Ke=r(e,"H3",{class:!0});var uu=n(Ke);Pa=r(uu,"A",{id:!0,class:!0,href:!0});var h5=n(Pa);hh=r(h5,"SPAN",{});var p5=n(hh);u(dr.$$.fragment,p5),p5.forEach(t),h5.forEach(t),Rb=d(uu),ph=r(uu,"SPAN",{});var f5=n(ph);Vb=l(f5,"sampling rate"),f5.forEach(t),uu.forEach(t),gd=d(e),Un=r(e,"P",{});var d5=n(Un);Gb=l(d5,"A measurement in hertz of the number of samples (the audio signal) taken per second. The sampling rate is a result of discretizing a continuous signal such as speech."),d5.forEach(t),wd=d(e),et=r(e,"H3",{class:!0});var mu=n(et);qa=r(mu,"A",{id:!0,class:!0,href:!0});var c5=n(qa);fh=r(c5,"SPAN",{});var u5=n(fh);u(cr.$$.fragment,u5),u5.forEach(t),c5.forEach(t),Wb=d(mu),dh=r(mu,"SPAN",{});var m5=n(dh);Ub=l(m5,"self-attention"),m5.forEach(t),mu.forEach(t),bd=d(e),Xn=r(e,"P",{});var v5=n(Xn);Xb=l(v5,"Each element of the input finds out which other elements of the input they should attend to."),v5.forEach(t),_d=d(e),tt=r(e,"H3",{class:!0});var vu=n(tt);Ta=r(vu,"A",{id:!0,class:!0,href:!0});var g5=n(Ta);ch=r(g5,"SPAN",{});var w5=n(ch);u(ur.$$.fragment,w5),w5.forEach(t),g5.forEach(t),Yb=d(vu),uh=r(vu,"SPAN",{});var b5=n(uh);Qb=l(b5,"self-supervised learning"),b5.forEach(t),vu.forEach(t),$d=d(e),B=r(e,"P",{});var yo=n(B);Jb=l(yo,"A category of machine learning techniques in which a model creates its own learning objective from unlabeled data. It differs from "),Yn=r(yo,"A",{href:!0});var _5=n(Yn);Zb=l(_5,"unsupervised learning"),_5.forEach(t),Kb=l(yo," and "),Qn=r(yo,"A",{href:!0});var $5=n(Qn);e_=l($5,"supervised learning"),$5.forEach(t),t_=l(yo," in that the learning process is supervised, but not explicitly from the user."),yo.forEach(t),kd=d(e),ja=r(e,"P",{});var gu=n(ja);a_=l(gu,"One example of self-supervised learning is "),Jn=r(gu,"A",{href:!0});var k5=n(Jn);s_=l(k5,"masked language modeling"),k5.forEach(t),r_=l(gu,", where a model is passed sentences with a proportion of its tokens removed and learns to predict the missing tokens."),gu.forEach(t),Ed=d(e),at=r(e,"H3",{class:!0});var wu=n(at);Sa=r(wu,"A",{id:!0,class:!0,href:!0});var E5=n(Sa);mh=r(E5,"SPAN",{});var y5=n(mh);u(mr.$$.fragment,y5),y5.forEach(t),E5.forEach(t),n_=d(wu),vh=r(wu,"SPAN",{});var A5=n(vh);o_=l(A5,"semi-supervised learning"),A5.forEach(t),wu.forEach(t),yd=d(e),L=r(e,"P",{});var Ao=n(L);l_=l(Ao,"A broad category of machine learning training techniques that leverages a small amount of labeled data with a larger quantity of unlabeled data to improve the accuracy of a model, unlike "),Zn=r(Ao,"A",{href:!0});var x5=n(Zn);i_=l(x5,"supervised learning"),x5.forEach(t),h_=l(Ao," and "),Kn=r(Ao,"A",{href:!0});var P5=n(Kn);p_=l(P5,"unsupervised learning"),P5.forEach(t),f_=l(Ao,"."),Ao.forEach(t),Ad=d(e),eo=r(e,"P",{});var q5=n(eo);d_=l(q5,"An example of a semi-supervised learning approach is \u201Cself-training\u201D, in which a model is trained on labeled data, and then used to make predictions on the unlabeled data. The portion of the unlabeled data that the model predicts with the most confidence gets added to the labeled dataset and used to retrain the model."),q5.forEach(t),xd=d(e),st=r(e,"H3",{class:!0});var bu=n(st);Na=r(bu,"A",{id:!0,class:!0,href:!0});var T5=n(Na);gh=r(T5,"SPAN",{});var j5=n(gh);u(vr.$$.fragment,j5),j5.forEach(t),T5.forEach(t),c_=d(bu),wh=r(bu,"SPAN",{});var S5=n(wh);u_=l(S5,"sequence-to-sequence (seq2seq)"),S5.forEach(t),bu.forEach(t),Pd=d(e),R=r(e,"P",{});var xo=n(R);m_=l(xo,`Models that generate a new sequence from an input, like translation models, or summarization models (such as
`),to=r(xo,"A",{href:!0});var N5=n(to);v_=l(N5,"Bart"),N5.forEach(t),g_=l(xo," or "),ao=r(xo,"A",{href:!0});var z5=n(ao);w_=l(z5,"T5"),z5.forEach(t),b_=l(xo,")."),xo.forEach(t),qd=d(e),rt=r(e,"H3",{class:!0});var _u=n(rt);za=r(_u,"A",{id:!0,class:!0,href:!0});var C5=n(za);bh=r(C5,"SPAN",{});var D5=n(bh);u(gr.$$.fragment,D5),D5.forEach(t),C5.forEach(t),__=d(_u),_h=r(_u,"SPAN",{});var F5=n(_h);$_=l(F5,"stride"),F5.forEach(t),_u.forEach(t),Td=d(e),V=r(e,"P",{});var Po=n(V);k_=l(Po,"In "),so=r(Po,"A",{href:!0});var I5=n(so);E_=l(I5,"convolution"),I5.forEach(t),y_=l(Po," or "),ro=r(Po,"A",{href:!0});var H5=n(ro);A_=l(H5,"pooling"),H5.forEach(t),x_=l(Po,", the stride refers to the distance the kernel is moved over a matrix. A stride of 1 means the kernel is moved one pixel over at a time, and a stride of 2 means the kernel is moved two pixels over at a time."),Po.forEach(t),jd=d(e),nt=r(e,"H3",{class:!0});var $u=n(nt);Ca=r($u,"A",{id:!0,class:!0,href:!0});var M5=n(Ca);$h=r(M5,"SPAN",{});var O5=n($h);u(wr.$$.fragment,O5),O5.forEach(t),M5.forEach(t),P_=d($u),kh=r($u,"SPAN",{});var B5=n(kh);q_=l(B5,"supervised learning"),B5.forEach(t),$u.forEach(t),Sd=d(e),no=r(e,"P",{});var L5=n(no);T_=l(L5,"A form of model training that directly uses labeled data to correct and instruct model performance. Data is fed into the model being trained, and its predictions are compared to the known labels. The model updates its weights based on how incorrect its predictions were, and the process is repeated to optimize model performance."),L5.forEach(t),Nd=d(e),ot=r(e,"H2",{class:!0});var ku=n(ot);Da=r(ku,"A",{id:!0,class:!0,href:!0});var R5=n(Da);Eh=r(R5,"SPAN",{});var V5=n(Eh);u(br.$$.fragment,V5),V5.forEach(t),R5.forEach(t),j_=d(ku),yh=r(ku,"SPAN",{});var G5=n(yh);S_=l(G5,"T"),G5.forEach(t),ku.forEach(t),zd=d(e),lt=r(e,"H3",{class:!0});var Eu=n(lt);Fa=r(Eu,"A",{id:!0,class:!0,href:!0});var W5=n(Fa);Ah=r(W5,"SPAN",{});var U5=n(Ah);u(_r.$$.fragment,U5),U5.forEach(t),W5.forEach(t),N_=d(Eu),xh=r(Eu,"SPAN",{});var X5=n(xh);z_=l(X5,"token"),X5.forEach(t),Eu.forEach(t),Cd=d(e),oo=r(e,"P",{});var Y5=n(oo);C_=l(Y5,`A part of a sentence, usually a word, but can also be a subword (non-common words are often split in subwords) or a
punctuation symbol.`),Y5.forEach(t),Dd=d(e),it=r(e,"H3",{class:!0});var yu=n(it);Ia=r(yu,"A",{id:!0,class:!0,href:!0});var Q5=n(Ia);Ph=r(Q5,"SPAN",{});var J5=n(Ph);u($r.$$.fragment,J5),J5.forEach(t),Q5.forEach(t),D_=d(yu),qh=r(yu,"SPAN",{});var Z5=n(qh);F_=l(Z5,"token Type IDs"),Z5.forEach(t),yu.forEach(t),Fd=d(e),lo=r(e,"P",{});var K5=n(lo);I_=l(K5,"Some models\u2019 purpose is to do classification on pairs of sentences or question answering."),K5.forEach(t),Id=d(e),u(kr.$$.fragment,e),Hd=d(e),G=r(e,"P",{});var qo=n(G);H_=l(qo,`These require two different sequences to be joined in a single \u201Cinput_ids\u201D entry, which usually is performed with the
help of special tokens, such as the classifier (`),Th=r(qo,"CODE",{});var e0=n(Th);M_=l(e0,"[CLS]"),e0.forEach(t),O_=l(qo,") and separator ("),jh=r(qo,"CODE",{});var t0=n(jh);B_=l(t0,"[SEP]"),t0.forEach(t),L_=l(qo,`) tokens. For example, the BERT model
builds its two sequence input as such:`),qo.forEach(t),Md=d(e),u(Er.$$.fragment,e),Od=d(e),Ha=r(e,"P",{});var Au=n(Ha);R_=l(Au,"We can use our tokenizer to automatically generate such a sentence by passing the two sequences to "),Sh=r(Au,"CODE",{});var a0=n(Sh);V_=l(a0,"tokenizer"),a0.forEach(t),G_=l(Au,` as two
arguments (and not a list, like before) like this:`),Au.forEach(t),Bd=d(e),u(yr.$$.fragment,e),Ld=d(e),io=r(e,"P",{});var s0=n(io);W_=l(s0,"which will return:"),s0.forEach(t),Rd=d(e),u(Ar.$$.fragment,e),Vd=d(e),ho=r(e,"P",{});var r0=n(ho);U_=l(r0,`This is enough for some models to understand where one sequence ends and where another begins. However, other models,
such as BERT, also deploy token type IDs (also called segment IDs). They are represented as a binary mask identifying
the two types of sequence in the model.`),r0.forEach(t),Gd=d(e),po=r(e,"P",{});var n0=n(po);X_=l(n0,"The tokenizer returns this mask as the \u201Ctoken_type_ids\u201D entry:"),n0.forEach(t),Wd=d(e),u(xr.$$.fragment,e),Ud=d(e),W=r(e,"P",{});var To=n(W);Y_=l(To,"The first sequence, the \u201Ccontext\u201D used for the question, has all its tokens represented by a "),Nh=r(To,"CODE",{});var o0=n(Nh);Q_=l(o0,"0"),o0.forEach(t),J_=l(To,`, whereas the second
sequence, corresponding to the \u201Cquestion\u201D, has all its tokens represented by a `),zh=r(To,"CODE",{});var l0=n(zh);Z_=l(l0,"1"),l0.forEach(t),K_=l(To,"."),To.forEach(t),Xd=d(e),U=r(e,"P",{});var jo=n(U);e$=l(jo,"Some models, like "),fo=r(jo,"A",{href:!0});var i0=n(fo);t$=l(i0,"XLNetModel"),i0.forEach(t),a$=l(jo," use an additional token represented by a "),Ch=r(jo,"CODE",{});var h0=n(Ch);s$=l(h0,"2"),h0.forEach(t),r$=l(jo,"."),jo.forEach(t),Yd=d(e),ht=r(e,"H3",{class:!0});var xu=n(ht);Ma=r(xu,"A",{id:!0,class:!0,href:!0});var p0=n(Ma);Dh=r(p0,"SPAN",{});var f0=n(Dh);u(Pr.$$.fragment,f0),f0.forEach(t),p0.forEach(t),n$=d(xu),Fh=r(xu,"SPAN",{});var d0=n(Fh);o$=l(d0,"transfer learning"),d0.forEach(t),xu.forEach(t),Qd=d(e),co=r(e,"P",{});var c0=n(co);l$=l(c0,"A technique that involves taking a pretrained model and adapting it to a dataset specific to your task. Instead of training a model from scratch, you can leverage knowledge obtained from an existing model as a starting point. This speeds up the learning process and reduces the amount of training data needed."),c0.forEach(t),Jd=d(e),pt=r(e,"H3",{class:!0});var Pu=n(pt);Oa=r(Pu,"A",{id:!0,class:!0,href:!0});var u0=n(Oa);Ih=r(u0,"SPAN",{});var m0=n(Ih);u(qr.$$.fragment,m0),m0.forEach(t),u0.forEach(t),i$=d(Pu),Hh=r(Pu,"SPAN",{});var v0=n(Hh);h$=l(v0,"transformer"),v0.forEach(t),Pu.forEach(t),Zd=d(e),uo=r(e,"P",{});var g0=n(uo);p$=l(g0,"Self-attention based deep learning model architecture."),g0.forEach(t),Kd=d(e),ft=r(e,"H2",{class:!0});var qu=n(ft);Ba=r(qu,"A",{id:!0,class:!0,href:!0});var w0=n(Ba);Mh=r(w0,"SPAN",{});var b0=n(Mh);u(Tr.$$.fragment,b0),b0.forEach(t),w0.forEach(t),f$=d(qu),Oh=r(qu,"SPAN",{});var _0=n(Oh);d$=l(_0,"U"),_0.forEach(t),qu.forEach(t),ec=d(e),dt=r(e,"H3",{class:!0});var Tu=n(dt);La=r(Tu,"A",{id:!0,class:!0,href:!0});var $0=n(La);Bh=r($0,"SPAN",{});var k0=n(Bh);u(jr.$$.fragment,k0),k0.forEach(t),$0.forEach(t),c$=d(Tu),Lh=r(Tu,"SPAN",{});var E0=n(Lh);u$=l(E0,"unsupervised learning"),E0.forEach(t),Tu.forEach(t),tc=d(e),mo=r(e,"P",{});var y0=n(mo);m$=l(y0,"A form of model training in which data provided to the model is not labeled. Unsupervised learning techniques leverage statistical information of the data distribution to find patterns useful for the task at hand."),y0.forEach(t),this.h()},h(){p(y,"name","hf:doc:metadata"),p(y,"content",JSON.stringify(z0)),p(S,"id","glossary"),p(S,"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"),p(S,"href","#glossary"),p(P,"class","relative group"),p(ut,"id","a"),p(ut,"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"),p(ut,"href","#a"),p(J,"class","relative group"),p(mt,"id","attention-mask"),p(mt,"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"),p(mt,"href","#attention-mask"),p(Z,"class","relative group"),p(Lr,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer"),p(vt,"id","autoencoding-models"),p(vt,"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"),p(vt,"href","#autoencoding-models"),p(K,"class","relative group"),p(Rr,"href","#encoder-models"),p(Vr,"href","#masked-language-modeling-mlm"),p(gt,"id","autoregressive-models"),p(gt,"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"),p(gt,"href","#autoregressive-models"),p(te,"class","relative group"),p(Gr,"href","#causal-language-modeling"),p(Wr,"href","#decoder-models"),p(wt,"id","b"),p(wt,"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"),p(wt,"href","#b"),p(se,"class","relative group"),p(bt,"id","backbone"),p(bt,"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"),p(bt,"href","#backbone"),p(re,"class","relative group"),p(Ur,"href","#head"),p(Xr,"href","/docs/transformers/v4.27.1/en/model_doc/vit#transformers.ViTModel"),p(Yr,"href","model_doc/dpt"),p(_t,"id","c"),p(_t,"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"),p(_t,"href","#c"),p(ne,"class","relative group"),p($t,"id","causal-language-modeling"),p($t,"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"),p($t,"href","#causal-language-modeling"),p(oe,"class","relative group"),p(kt,"id","channel"),p(kt,"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"),p(kt,"href","#channel"),p(le,"class","relative group"),p(Et,"id","connectionist-temporal-classification-ctc"),p(Et,"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"),p(Et,"href","#connectionist-temporal-classification-ctc"),p(ie,"class","relative group"),p(yt,"id","convolution"),p(yt,"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"),p(yt,"href","#convolution"),p(he,"class","relative group"),p(At,"id","d"),p(At,"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"),p(At,"href","#d"),p(pe,"class","relative group"),p(xt,"id","decoder-input-ids"),p(xt,"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"),p(xt,"href","#decoder-input-ids"),p(fe,"class","relative group"),p(Pt,"id","decoder-models"),p(Pt,"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"),p(Pt,"href","#decoder-models"),p(de,"class","relative group"),p(qt,"id","deep-learning-dl"),p(qt,"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"),p(qt,"href","#deep-learning-dl"),p(ce,"class","relative group"),p(Tt,"id","e"),p(Tt,"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"),p(Tt,"href","#e"),p(ue,"class","relative group"),p(jt,"id","encoder-models"),p(jt,"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"),p(jt,"href","#encoder-models"),p(me,"class","relative group"),p(sn,"href","#masked-language-modeling-mlm"),p(Nt,"id","f"),p(Nt,"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"),p(Nt,"href","#f"),p(ve,"class","relative group"),p(zt,"id","feature-extraction"),p(zt,"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"),p(zt,"href","#feature-extraction"),p(ge,"class","relative group"),p(Ct,"id","feed-forward-chunking"),p(Ct,"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"),p(Ct,"href","#feed-forward-chunking"),p(we,"class","relative group"),p(ks,"href","https://arxiv.org/abs/2001.04451"),p(ks,"rel","nofollow"),p(nn,"href","/docs/transformers/v4.27.1/en/internal/modeling_utils#transformers.apply_chunking_to_forward"),p(Ft,"id","finetuned-models"),p(Ft,"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"),p(Ft,"href","#finetuned-models"),p(be,"class","relative group"),p(on,"href","#head"),p(ys,"href","https://huggingface.co/docs/transformers/training"),p(ys,"rel","nofollow"),p(Mt,"id","h"),p(Mt,"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"),p(Mt,"href","#h"),p(_e,"class","relative group"),p(Ot,"id","head"),p(Ot,"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"),p(Ot,"href","#head"),p($e,"class","relative group"),p(hn,"href","/docs/transformers/v4.27.1/en/model_doc/gpt2#transformers.GPT2ForSequenceClassification"),p(pn,"href","/docs/transformers/v4.27.1/en/model_doc/gpt2#transformers.GPT2Model"),p(fn,"href","/docs/transformers/v4.27.1/en/model_doc/vit#transformers.ViTForImageClassification"),p(dn,"href","/docs/transformers/v4.27.1/en/model_doc/vit#transformers.ViTModel"),p(cn,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC"),p(un,"href","#connectionist-temporal-classification-(CTC)"),p(mn,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Model"),p(Lt,"id","i"),p(Lt,"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"),p(Lt,"href","#i"),p(ke,"class","relative group"),p(Rt,"id","image-patch"),p(Rt,"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"),p(Rt,"href","#image-patch"),p(Ee,"class","relative group"),p(Gt,"id","inference"),p(Gt,"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"),p(Gt,"href","#inference"),p(ye,"class","relative group"),p(js,"href","https://huggingface.co/docs/transformers/pipeline_tutorial"),p(js,"rel","nofollow"),p(Ut,"id","input-ids"),p(Ut,"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"),p(Ut,"href","#input-ids"),p(Ae,"class","relative group"),p(zs,"href","https://arxiv.org/pdf/1609.08144.pdf"),p(zs,"rel","nofollow"),p(Is,"href","https://github.com/huggingface/tokenizers"),p(Is,"rel","nofollow"),p(kn,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertModel"),p(Zt,"id","l"),p(Zt,"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"),p(Zt,"href","#l"),p(xe,"class","relative group"),p(Kt,"id","labels"),p(Kt,"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"),p(Kt,"href","#labels"),p(Pe,"class","relative group"),p(An,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertForSequenceClassification"),p(xn,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertForTokenClassification"),p(Pn,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertForMaskedLM"),p(qn,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartForConditionalGeneration"),p(Tn,"href","/docs/transformers/v4.27.1/en/model_doc/mbart#transformers.MBartForConditionalGeneration"),p(jn,"href","/docs/transformers/v4.27.1/en/model_doc/vit#transformers.ViTForImageClassification"),p(Sn,"href","/docs/transformers/v4.27.1/en/model_doc/segformer#transformers.SegformerForSemanticSegmentation"),p(Nn,"href","/docs/transformers/v4.27.1/en/model_doc/detr#transformers.DetrForObjectDetection"),p(zn,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC"),p(Cn,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertModel"),p(aa,"id","large-language-models-llm"),p(aa,"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"),p(aa,"href","#large-language-models-llm"),p(Ce,"class","relative group"),p(sa,"id","m"),p(sa,"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"),p(sa,"href","#m"),p(De,"class","relative group"),p(ra,"id","masked-language-modeling-mlm"),p(ra,"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"),p(ra,"href","#masked-language-modeling-mlm"),p(Fe,"class","relative group"),p(na,"id","multimodal"),p(na,"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"),p(na,"href","#multimodal"),p(Ie,"class","relative group"),p(oa,"id","n"),p(oa,"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"),p(oa,"href","#n"),p(He,"class","relative group"),p(la,"id","natural-language-generation-nlg"),p(la,"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"),p(la,"href","#natural-language-generation-nlg"),p(Me,"class","relative group"),p(Qs,"href","https://transformer.huggingface.co/"),p(Qs,"rel","nofollow"),p(ha,"id","natural-language-processing-nlp"),p(ha,"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"),p(ha,"href","#natural-language-processing-nlp"),p(Oe,"class","relative group"),p(pa,"id","natural-language-understanding-nlu"),p(pa,"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"),p(pa,"href","#natural-language-understanding-nlu"),p(Be,"class","relative group"),p(fa,"id","p"),p(fa,"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"),p(fa,"href","#p"),p(Le,"class","relative group"),p(da,"id","pipeline"),p(da,"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"),p(da,"href","#pipeline"),p(Re,"class","relative group"),p(tr,"href","https://huggingface.co/docs/transformers/pipeline_tutorial"),p(tr,"rel","nofollow"),p(ua,"id","pixel-values"),p(ua,"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"),p(ua,"href","#pixel-values"),p(Ve,"class","relative group"),p(ma,"id","pooling"),p(ma,"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"),p(ma,"href","#pooling"),p(Ge,"class","relative group"),p(va,"id","position-ids"),p(va,"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"),p(va,"href","#position-ids"),p(We,"class","relative group"),p(_a,"id","preprocessing"),p(_a,"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"),p(_a,"href","#preprocessing"),p(Ue,"class","relative group"),p(or,"href","https://huggingface.co/docs/transformers/preprocessing"),p(or,"rel","nofollow"),p(ka,"id","pretrained-model"),p(ka,"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"),p(ka,"href","#pretrained-model"),p(Xe,"class","relative group"),p(Ln,"href","#causal-language-modeling"),p(Rn,"href","#masked-language-modeling-mlm"),p(Ea,"id","r"),p(Ea,"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"),p(Ea,"href","#r"),p(Ye,"class","relative group"),p(ya,"id","recurrent-neural-network-rnn"),p(ya,"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"),p(ya,"href","#recurrent-neural-network-rnn"),p(Qe,"class","relative group"),p(Aa,"id","representation-learning"),p(Aa,"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"),p(Aa,"href","#representation-learning"),p(Je,"class","relative group"),p(xa,"id","s"),p(xa,"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"),p(xa,"href","#s"),p(Ze,"class","relative group"),p(Pa,"id","sampling-rate"),p(Pa,"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"),p(Pa,"href","#sampling-rate"),p(Ke,"class","relative group"),p(qa,"id","selfattention"),p(qa,"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"),p(qa,"href","#selfattention"),p(et,"class","relative group"),p(Ta,"id","selfsupervised-learning"),p(Ta,"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"),p(Ta,"href","#selfsupervised-learning"),p(tt,"class","relative group"),p(Yn,"href","#unsupervised-learning"),p(Qn,"href","#supervised-learning"),p(Jn,"href","#masked-language-modeling-mlm"),p(Sa,"id","semisupervised-learning"),p(Sa,"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"),p(Sa,"href","#semisupervised-learning"),p(at,"class","relative group"),p(Zn,"href","#supervised-learning"),p(Kn,"href","#unsupervised-learning"),p(Na,"id","sequencetosequence-seq2seq"),p(Na,"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"),p(Na,"href","#sequencetosequence-seq2seq"),p(st,"class","relative group"),p(to,"href","model_doc/bart"),p(ao,"href","model_doc/t5"),p(za,"id","stride"),p(za,"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"),p(za,"href","#stride"),p(rt,"class","relative group"),p(so,"href","#convolution"),p(ro,"href","#pooling"),p(Ca,"id","supervised-learning"),p(Ca,"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"),p(Ca,"href","#supervised-learning"),p(nt,"class","relative group"),p(Da,"id","t"),p(Da,"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"),p(Da,"href","#t"),p(ot,"class","relative group"),p(Fa,"id","token"),p(Fa,"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"),p(Fa,"href","#token"),p(lt,"class","relative group"),p(Ia,"id","token-type-ids"),p(Ia,"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"),p(Ia,"href","#token-type-ids"),p(it,"class","relative group"),p(fo,"href","/docs/transformers/v4.27.1/en/model_doc/xlnet#transformers.XLNetModel"),p(Ma,"id","transfer-learning"),p(Ma,"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"),p(Ma,"href","#transfer-learning"),p(ht,"class","relative group"),p(Oa,"id","transformer"),p(Oa,"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"),p(Oa,"href","#transformer"),p(pt,"class","relative group"),p(Ba,"id","u"),p(Ba,"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"),p(Ba,"href","#u"),p(ft,"class","relative group"),p(La,"id","unsupervised-learning"),p(La,"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"),p(La,"href","#unsupervised-learning"),p(dt,"class","relative group")},m(e,i){a(document.head,y),h(e,ct,i),h(e,P,i),a(P,S),a(S,So),m(Ua,So,null),a(P,ju),a(P,No),a(No,Su),h(e,Xh,i),h(e,Cr,i),a(Cr,Nu),h(e,Yh,i),h(e,J,i),a(J,ut),a(ut,zo),m(Xa,zo,null),a(J,zu),a(J,Co),a(Co,Cu),h(e,Qh,i),h(e,Z,i),a(Z,mt),a(mt,Do),m(Ya,Do,null),a(Z,Du),a(Z,Fo),a(Fo,Fu),h(e,Jh,i),h(e,Dr,i),a(Dr,Iu),h(e,Zh,i),m(Qa,e,i),h(e,Kh,i),h(e,Fr,i),a(Fr,Hu),h(e,ep,i),h(e,Ir,i),a(Ir,Mu),h(e,tp,i),m(Ja,e,i),h(e,ap,i),h(e,Hr,i),a(Hr,Ou),h(e,sp,i),m(Za,e,i),h(e,rp,i),h(e,Mr,i),a(Mr,Bu),h(e,np,i),h(e,Or,i),a(Or,Lu),h(e,op,i),m(Ka,e,i),h(e,lp,i),h(e,Br,i),a(Br,Ru),h(e,ip,i),m(es,e,i),h(e,hp,i),h(e,z,i),a(z,Vu),a(z,Lr),a(Lr,Gu),a(z,Wu),a(z,Io),a(Io,Uu),a(z,Xu),a(z,Ho),a(Ho,Yu),a(z,Qu),h(e,pp,i),m(ts,e,i),h(e,fp,i),h(e,K,i),a(K,vt),a(vt,Mo),m(as,Mo,null),a(K,Ju),a(K,Oo),a(Oo,Zu),h(e,dp,i),h(e,ee,i),a(ee,Ku),a(ee,Rr),a(Rr,em),a(ee,tm),a(ee,Vr),a(Vr,am),h(e,cp,i),h(e,te,i),a(te,gt),a(gt,Bo),m(ss,Bo,null),a(te,sm),a(te,Lo),a(Lo,rm),h(e,up,i),h(e,ae,i),a(ae,nm),a(ae,Gr),a(Gr,om),a(ae,lm),a(ae,Wr),a(Wr,im),h(e,mp,i),h(e,se,i),a(se,wt),a(wt,Ro),m(rs,Ro,null),a(se,hm),a(se,Vo),a(Vo,pm),h(e,vp,i),h(e,re,i),a(re,bt),a(bt,Go),m(ns,Go,null),a(re,fm),a(re,Wo),a(Wo,dm),h(e,gp,i),h(e,q,i),a(q,cm),a(q,Ur),a(Ur,um),a(q,mm),a(q,Xr),a(Xr,vm),a(q,gm),a(q,Uo),a(Uo,wm),a(q,bm),a(q,Yr),a(Yr,_m),a(q,$m),h(e,wp,i),h(e,ne,i),a(ne,_t),a(_t,Xo),m(os,Xo,null),a(ne,km),a(ne,Yo),a(Yo,Em),h(e,bp,i),h(e,oe,i),a(oe,$t),a($t,Qo),m(ls,Qo,null),a(oe,ym),a(oe,Jo),a(Jo,Am),h(e,_p,i),h(e,Qr,i),a(Qr,xm),h(e,$p,i),h(e,le,i),a(le,kt),a(kt,Zo),m(is,Zo,null),a(le,Pm),a(le,Ko),a(Ko,qm),h(e,kp,i),h(e,k,i),a(k,Tm),a(k,el),a(el,jm),a(k,Sm),a(k,tl),a(tl,Nm),a(k,zm),a(k,al),a(al,Cm),a(k,Dm),a(k,sl),a(sl,Fm),a(k,Im),a(k,rl),a(rl,Hm),a(k,Mm),a(k,nl),a(nl,Om),a(k,Bm),h(e,Ep,i),h(e,ie,i),a(ie,Et),a(Et,ol),m(hs,ol,null),a(ie,Lm),a(ie,ll),a(ll,Rm),h(e,yp,i),h(e,Jr,i),a(Jr,Vm),h(e,Ap,i),h(e,he,i),a(he,yt),a(yt,il),m(ps,il,null),a(he,Gm),a(he,hl),a(hl,Wm),h(e,xp,i),h(e,Zr,i),a(Zr,Um),h(e,Pp,i),h(e,pe,i),a(pe,At),a(At,pl),m(fs,pl,null),a(pe,Xm),a(pe,fl),a(fl,Ym),h(e,qp,i),h(e,fe,i),a(fe,xt),a(xt,dl),m(ds,dl,null),a(fe,Qm),a(fe,cl),a(cl,Jm),h(e,Tp,i),h(e,Kr,i),a(Kr,Zm),h(e,jp,i),h(e,C,i),a(C,Km),a(C,ul),a(ul,ev),a(C,tv),a(C,ml),a(ml,av),a(C,sv),a(C,vl),a(vl,rv),a(C,nv),h(e,Sp,i),h(e,en,i),a(en,ov),h(e,Np,i),h(e,de,i),a(de,Pt),a(Pt,gl),m(cs,gl,null),a(de,lv),a(de,wl),a(wl,iv),h(e,zp,i),h(e,tn,i),a(tn,hv),h(e,Cp,i),m(us,e,i),h(e,Dp,i),h(e,ce,i),a(ce,qt),a(qt,bl),m(ms,bl,null),a(ce,pv),a(ce,_l),a(_l,fv),h(e,Fp,i),h(e,an,i),a(an,dv),h(e,Ip,i),h(e,ue,i),a(ue,Tt),a(Tt,$l),m(vs,$l,null),a(ue,cv),a(ue,kl),a(kl,uv),h(e,Hp,i),h(e,me,i),a(me,jt),a(jt,El),m(gs,El,null),a(me,mv),a(me,yl),a(yl,vv),h(e,Mp,i),h(e,St,i),a(St,gv),a(St,sn),a(sn,wv),a(St,bv),h(e,Op,i),m(ws,e,i),h(e,Bp,i),h(e,ve,i),a(ve,Nt),a(Nt,Al),m(bs,Al,null),a(ve,_v),a(ve,xl),a(xl,$v),h(e,Lp,i),h(e,ge,i),a(ge,zt),a(zt,Pl),m(_s,Pl,null),a(ge,kv),a(ge,ql),a(ql,Ev),h(e,Rp,i),h(e,rn,i),a(rn,yv),h(e,Vp,i),h(e,we,i),a(we,Ct),a(Ct,Tl),m($s,Tl,null),a(we,Av),a(we,jl),a(jl,xv),h(e,Gp,i),h(e,Dt,i),a(Dt,Pv),a(Dt,Sl),a(Sl,qv),a(Dt,Tv),h(e,Wp,i),h(e,_,i),a(_,jv),a(_,Nl),a(Nl,Sv),a(_,Nv),a(_,zl),a(zl,zv),a(_,Cv),a(_,ks),a(ks,Dv),a(_,Fv),a(_,Cl),a(Cl,Iv),a(_,Hv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a(Qn,e_),a(B,t_),h(e,kd,i),h(e,ja,i),a(ja,a_),a(ja,Jn),a(Jn,s_),a(ja,r_),h(e,Ed,i),h(e,at,i),a(at,Sa),a(Sa,mh),m(mr,mh,null),a(at,n_),a(at,vh),a(vh,o_),h(e,yd,i),h(e,L,i),a(L,l_),a(L,Zn),a(Zn,i_),a(L,h_),a(L,Kn),a(Kn,p_),a(L,f_),h(e,Ad,i),h(e,eo,i),a(eo,d_),h(e,xd,i),h(e,st,i),a(st,Na),a(Na,gh),m(vr,gh,null),a(st,c_),a(st,wh),a(wh,u_),h(e,Pd,i),h(e,R,i),a(R,m_),a(R,to),a(to,v_),a(R,g_),a(R,ao),a(ao,w_),a(R,b_),h(e,qd,i),h(e,rt,i),a(rt,za),a(za,bh),m(gr,bh,null),a(rt,__),a(rt,_h),a(_h,$_),h(e,Td,i),h(e,V,i),a(V,k_),a(V,so),a(so,E_),a(V,y_),a(V,ro),a(ro,A_),a(V,x_),h(e,jd,i),h(e,nt,i),a(nt,Ca),a(Ca,$h),m(wr,$h,null),a(nt,P_),a(nt,kh),a(kh,q_),h(e,Sd,i),h(e,no,i),a(no,T_),h(e,Nd,i),h(e,ot,i),a(ot,Da),a(Da,Eh),m(br,Eh,null),a(ot,j_),a(ot,yh),a(yh,S_),h(e,zd,i),h(e,lt,i),a(lt,Fa),a(Fa,Ah),m(_r,Ah,null),a(lt,N_),a(lt,xh),a(xh,z_),h(e,Cd,i),h(e,oo,i),a(oo,C_),h(e,Dd,i),h(e,it,i),a(it,Ia),a(Ia,Ph),m($r,Ph,null),a(it,D_),a(it,qh),a(qh,F_),h(e,Fd,i),h(e,lo,i),a(lo,I_),h(e,Id,i),m(kr,e,i),h(e,Hd,i),h(e,G,i),a(G,H_),a(G,Th),a(Th,M_),a(G,O_),a(G,jh),a(jh,B_),a(G,L_),h(e,Md,i),m(Er,e,i),h(e,Od,i),h(e,Ha,i),a(Ha,R_),a(Ha,Sh),a(Sh,V_),a(Ha,G_),h(e,Bd,i),m(yr,e,i),h(e,Ld,i),h(e,io,i),a(io,W_),h(e,Rd,i),m(Ar,e,i),h(e,Vd,i),h(e,ho,i),a(ho,U_),h(e,Gd,i),h(e,po,i),a(po,X_),h(e,Wd,i),m(xr,e,i),h(e,Ud,i),h(e,W,i),a(W,Y_),a(W,Nh),a(Nh,Q_),a(W,J_),a(W,zh),a(zh,Z_),a(W,K_),h(e,Xd,i),h(e,U,i),a(U,e$),a(U,fo),a(fo,t$),a(U,a$),a(U,Ch),a(Ch,s$),a(U,r$),h(e,Yd,i),h(e,ht,i),a(ht,Ma),a(Ma,Dh),m(Pr,Dh,null),a(ht,n$),a(ht,Fh),a(Fh,o$),h(e,Qd,i),h(e,co,i),a(co,l$),h(e,Jd,i),h(e,pt,i),a(pt,Oa),a(Oa,Ih),m(qr,Ih,null),a(pt,i$),a(pt,Hh),a(Hh,h$),h(e,Zd,i),h(e,uo,i),a(uo,p$),h(e,Kd,i),h(e,ft,i),a(ft,Ba),a(Ba,Mh),m(Tr,Mh,null),a(ft,f$),a(ft,Oh),a(Oh,d$),h(e,ec,i),h(e,dt,i),a(dt,La),a(La,Bh),m(jr,Bh,null),a(dt,c$),a(dt,Lh),a(Lh,u$),h(e,tc,i),h(e,mo,i),a(mo,m$),ac=!0},p(e,[i]){const Sr={};i&2&&(Sr.$$scope={dirty:i,ctx:e}),ea.$set(Sr)},i(e){ac||(v(Ua.$$.fragment,e),v(Xa.$$.fragment,e),v(Ya.$$.fragment,e),v(Qa.$$.fragment,e),v(Ja.$$.fragment,e),v(Za.$$.fragment,e),v(Ka.$$.fragment,e),v(es.$$.fragment,e),v(ts.$$.fragment,e),v(as.$$.fragment,e),v(ss.$$.fragment,e),v(rs.$$.fragment,e),v(ns.$$.fragment,e),v(os.$$.fragment,e),v(ls.$$.fragment,e),v(is.$$.fragment,e),v(hs.$$.fragment,e),v(ps.$$.fragment,e),v(fs.$$.fragment,e),v(ds.$$.fragment,e),v(cs.$$.fragment,e),v(us.$$.fragment,e),v(ms.$$.fragment,e),v(vs.$$.fragment,e),v(gs.$$.fragment,e),v(ws.$$.fragment,e),v(bs.$$.fragment,e),v(_s.$$.fragment,e),v($s.$$.fragment,e),v(Es.$$.fragment,e),v(As.$$.fragment,e),v(xs.$$.fragment,e),v(Ps.$$.fragment,e),v(qs.$$.fragment,e),v(Ts.$$.fragment,e),v(Ss.$$.fragment,e),v(Ns.$$.fragment,e),v(Cs.$$.fragment,e),v(Ds.$$.fragment,e),v(Fs.$$.fragment,e),v(Hs.$$.fragment,e),v(Ms.$$.fragment,e),v(Os.$$.fragment,e),v(Bs.$$.fragment,e),v(Ls.$$.fragment,e),v(Rs.$$.fragment,e),v(ea.$$.fragment,e),v(Vs.$$.fragment,e),v(Gs.$$.fragment,e),v(Ws.$$.fragment,e),v(Us.$$.fragment,e),v(Xs.$$.fragment,e),v(Ys.$$.fragment,e),v(Js.$$.fragment,e),v(Zs.$$.fragment,e),v(Ks.$$.fragment,e),v(er.$$.fragment,e),v(ar.$$.fragment,e),v(sr.$$.fragment,e),v(rr.$$.fragment,e),v(nr.$$.fragment,e),v(lr.$$.fragment,e),v(ir.$$.fragment,e),v(hr.$$.fragment,e),v(pr.$$.fragment,e),v(fr.$$.fragment,e),v(dr.$$.fragment,e),v(cr.$$.fragment,e),v(ur.$$.fragment,e),v(mr.$$.fragment,e),v(vr.$$.fragment,e),v(gr.$$.fragment,e),v(wr.$$.fragment,e),v(br.$$.fragment,e),v(_r.$$.fragment,e),v($r.$$.fragment,e),v(kr.$$.fragment,e),v(Er.$$.fragment,e),v(yr.$$.fragment,e),v(Ar.$$.fragment,e),v(xr.$$.fragment,e),v(Pr.$$.fragment,e),v(qr.$$.fragment,e),v(Tr.$$.fragment,e),v(jr.$$.fragment,e),ac=!0)},o(e){g(Ua.$$.fragment,e),g(Xa.$$.fragment,e),g(Ya.$$.fragment,e),g(Qa.$$.fragment,e),g(Ja.$$.fragment,e),g(Za.$$.fragment,e),g(Ka.$$.fragment,e),g(es.$$.fragment,e),g(ts.$$.fragment,e),g(as.$$.fragment,e),g(ss.$$.fragment,e),g(rs.$$.fragment,e),g(ns.$$.fragment,e),g(os.$$.fragment,e),g(ls.$$.fragment,e),g(is.$$.fragment,e),g(hs.$$.fragment,e),g(ps.$$.fragment,e),g(fs.$$.fragment,e),g(ds.$$.fragment,e),g(cs.$$.fragment,e),g(us.$$.fragment,e),g(ms.$$.fragment,e),g(vs.$$.fragment,e),g(gs.$$.fragment,e),g(ws.$$.fragment,e),g(bs.$$.fragment,e),g(_s.$$.fragment,e),g($s.$$.fragment,e),g(Es.$$.fragment,e),g(As.$$.fragment,e),g(xs.$$.fragment,e),g(Ps.$$.fragment,e),g(qs.$$.fragment,e),g(Ts.$$.fragment,e),g(Ss.$$.fragment,e),g(Ns.$$.fragment,e),g(Cs.$$.fragment,e),g(Ds.$$.fragment,e),g(Fs.$$.fragment,e),g(Hs.$$.fragment,e),g(Ms.$$.fragment,e),g(Os.$$.fragment,e),g(Bs.$$.fragment,e),g(Ls.$$.fragment,e),g(Rs.$$.fragment,e),g(ea.$$.fragment,e),g(Vs.$$.fragment,e),g(Gs.$$.fragment,e),g(Ws.$$.fragment,e),g(Us.$$.fragment,e),g(Xs.$$.fragment,e),g(Ys.$$.fragment,e),g(Js.$$.fragment,e),g(Zs.$$.fragment,e),g(Ks.$$.fragment,e),g(er.$$.fragment,e),g(ar.$$.fragment,e),g(sr.$$.fragment,e),g(rr.$$.fragment,e),g(nr.$$.fragment,e),g(lr.$$.fragment,e),g(ir.$$.fragment,e),g(hr.$$.fragment,e),g(pr.$$.fragment,e),g(fr.$$.fragment,e),g(dr.$$.fragment,e),g(cr.$$.fragment,e),g(ur.$$.fragment,e),g(mr.$$.fragment,e),g(vr.$$.fragment,e),g(gr.$$.fragment,e),g(wr.$$.fragment,e),g(br.$$.fragment,e),g(_r.$$.fragment,e),g($r.$$.fragment,e),g(kr.$$.fragment,e),g(Er.$$.fragment,e),g(yr.$$.fragment,e),g(Ar.$$.fragment,e),g(xr.$$.fragment,e),g(Pr.$$.fragment,e),g(qr.$$.fragment,e),g(Tr.$$.fragment,e),g(jr.$$.fragment,e),ac=!1},d(e){t(y),e&&t(ct),e&&t(P),w(Ua),e&&t(Xh),e&&t(Cr),e&&t(Yh),e&&t(J),w(Xa),e&&t(Qh),e&&t(Z),w(Ya),e&&t(Jh),e&&t(Dr),e&&t(Zh),w(Qa,e),e&&t(Kh),e&&t(Fr),e&&t(ep),e&&t(Ir),e&&t(tp),w(Ja,e),e&&t(ap),e&&t(Hr),e&&t(sp),w(Za,e),e&&t(rp),e&&t(Mr),e&&t(np),e&&t(Or),e&&t(op),w(Ka,e),e&&t(lp),e&&t(Br),e&&t(ip),w(es,e),e&&t(hp),e&&t(z),e&&t(pp),w(ts,e),e&&t(fp),e&&t(K),w(as),e&&t(dp),e&&t(ee),e&&t(cp),e&&t(te),w(ss),e&&t(up),e&&t(ae),e&&t(mp),e&&t(se),w(rs),e&&t(vp),e&&t(re),w(ns),e&&t(gp),e&&t(q),e&&t(wp),e&&t(ne),w(os),e&&t(bp),e&&t(oe),w(ls),e&&t(_p),e&&t(Qr),e&&t($p),e&&t(le),w(is),e&&t(kp),e&&t(k),e&&t(Ep),e&&t(ie),w(hs),e&&t(yp),e&&t(Jr),e&&t(Ap),e&&t(he),w(ps),e&&t(xp),e&&t(Zr),e&&t(Pp),e&&t(pe),w(fs),e&&t(qp),e&&t(fe),w(ds),e&&t(Tp),e&&t(Kr),e&&t(jp),e&&t(C),e&&t(Sp),e&&t(en),e&&t(Np),e&&t(de),w(cs),e&&t(zp),e&&t(tn),e&&t(Cp),w(us,e),e&&t(Dp),e&&t(ce),w(ms),e&&t(Fp),e&&t(an),e&&t(Ip),e&&t(ue),w(vs),e&&t(Hp),e&&t(me),w(gs),e&&t(Mp),e&&t(St),e&&t(Op),w(ws,e),e&&t(Bp),e&&t(ve),w(bs),e&&t(Lp),e&&t(ge),w(_s),e&&t(Rp),e&&t(rn),e&&t(Vp),e&&t(we),w($s),e&&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f),e&&t(Re),w(er),e&&t(Yf),e&&t(On),e&&t(Qf),e&&t(ca),e&&t(Jf),e&&t(Ve),w(ar),e&&t(Zf),e&&t(T),e&&t(Kf),e&&t(Ge),w(sr),e&&t(ed),e&&t(Bn),e&&t(td),e&&t(We),w(rr),e&&t(ad),e&&t(ga),e&&t(sd),e&&t(wa),e&&t(rd),e&&t(ba),e&&t(nd),e&&t(Ue),w(nr),e&&t(od),e&&t($a),e&&t(ld),e&&t(Xe),w(lr),e&&t(id),e&&t(O),e&&t(hd),e&&t(Vn),e&&t(pd),e&&t(Ye),w(ir),e&&t(fd),e&&t(Qe),w(hr),e&&t(dd),e&&t(Gn),e&&t(cd),e&&t(Je),w(pr),e&&t(ud),e&&t(Wn),e&&t(md),e&&t(Ze),w(fr),e&&t(vd),e&&t(Ke),w(dr),e&&t(gd),e&&t(Un),e&&t(wd),e&&t(et),w(cr),e&&t(bd),e&&t(Xn),e&&t(_d),e&&t(tt),w(ur),e&&t($d),e&&t(B),e&&t(kd),e&&t(ja),e&&t(Ed),e&&t(at),w(mr),e&&t(yd),e&&t(L),e&&t(Ad),e&&t(eo),e&&t(xd),e&&t(st),w(vr),e&&t(Pd),e&&t(R),e&&t(qd),e&&t(rt),w(gr),e&&t(Td),e&&t(V),e&&t(jd),e&&t(nt),w(wr),e&&t(Sd),e&&t(no),e&&t(Nd),e&&t(ot),w(br),e&&t(zd),e&&t(lt),w(_r),e&&t(Cd),e&&t(oo),e&&t(Dd),e&&t(it),w($r),e&&t(Fd),e&&t(lo),e&&t(Id),w(kr,e),e&&t(Hd),e&&t(G),e&&t(Md),w(Er,e),e&&t(Od),e&&t(Ha),e&&t(Bd),w(yr,e),e&&t(Ld),e&&t(io),e&&t(Rd),w(Ar,e),e&&t(Vd),e&&t(ho),e&&t(Gd),e&&t(po),e&&t(Wd),w(xr,e),e&&t(Ud),e&&t(W),e&&t(Xd),e&&t(U),e&&t(Yd),e&&t(ht),w(Pr),e&&t(Qd),e&&t(co),e&&t(Jd),e&&t(pt),w(qr),e&&t(Zd),e&&t(uo),e&&t(Kd),e&&t(ft),w(Tr),e&&t(ec),e&&t(dt),w(jr),e&&t(tc),e&&t(mo)}}}const z0={local:"glossary",sections:[{local:"a",sections:[{local:"attention-mask",title:"attention mask"},{local:"autoencoding-models",title:"autoencoding models"},{local:"autoregressive-models",title:"autoregressive models"}],title:"A"},{local:"b",sections:[{local:"backbone",title:"backbone"}],title:"B"},{local:"c",sections:[{local:"causal-language-modeling",title:"causal language modeling"},{local:"channel",title:"channel"},{local:"connectionist-temporal-classification-ctc",title:"connectionist temporal classification (CTC)"},{local:"convolution",title:"convolution"}],title:"C"},{local:"d",sections:[{local:"decoder-input-ids",title:"decoder input IDs"},{local:"decoder-models",title:"decoder models"},{local:"deep-learning-dl",title:"deep learning (DL)"}],title:"D"},{local:"e",sections:[{local:"encoder-models",title:"encoder models"}],title:"E"},{local:"f",sections:[{local:"feature-extraction",title:"feature extraction"},{local:"feed-forward-chunking",title:"feed forward chunking"},{local:"finetuned-models",title:"finetuned models"}],title:"F"},{local:"h",sections:[{local:"head",title:"head"}],title:"H"},{local:"i",sections:[{local:"image-patch",title:"image patch"},{local:"inference",title:"inference"},{local:"input-ids",title:"input IDs"}],title:"I"},{local:"l",sections:[{local:"labels",title:"labels"},{local:"large-language-models-llm",title:"large language models (LLM)"}],title:"L"},{local:"m",sections:[{local:"masked-language-modeling-mlm",title:"masked language modeling (MLM)"},{local:"multimodal",title:"multimodal"}],title:"M"},{local:"n",sections:[{local:"natural-language-generation-nlg",title:"Natural language generation (NLG)"},{local:"natural-language-processing-nlp",title:"Natural language processing (NLP)"},{local:"natural-language-understanding-nlu",title:"Natural language understanding (NLU)"}],title:"N"},{local:"p",sections:[{local:"pipeline",title:"pipeline"},{local:"pixel-values",title:"pixel values"},{local:"pooling",title:"pooling"},{local:"position-ids",title:"position IDs"},{local:"preprocessing",title:"preprocessing"},{local:"pretrained-model",title:"pretrained model"}],title:"P"},{local:"r",sections:[{local:"recurrent-neural-network-rnn",title:"recurrent neural network (RNN)"},{local:"representation-learning",title:"representation learning"}],title:"R"},{local:"s",sections:[{local:"sampling-rate",title:"sampling rate"},{local:"selfattention",title:"self-attention"},{local:"selfsupervised-learning",title:"self-supervised learning "},{local:"semisupervised-learning",title:"semi-supervised learning"},{local:"sequencetosequence-seq2seq",title:"sequence-to-sequence (seq2seq)"},{local:"stride",title:"stride"},{local:"supervised-learning",title:"supervised learning"}],title:"S"},{local:"t",sections:[{local:"token",title:"token"},{local:"token-type-ids",title:"token Type IDs"},{local:"transfer-learning",title:"transfer learning"},{local:"transformer",title:"transformer"}],title:"T"},{local:"u",sections:[{local:"unsupervised-learning",title:"unsupervised learning"}],title:"U"}],title:"Glossary"};function C0(Uh){return T0(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class O0 extends A0{constructor(y){super();x0(this,y,C0,N0,P0,{})}}export{O0 as default,z0 as metadata};
