import{S as Am,i as Lm,s as Nm,e as r,k as l,w as m,t as n,M as Im,c as a,d as s,m as d,a as i,x as f,h as o,b as c,F as e,g as u,y as g,q as _,o as z,B as b}from"../../chunks/vendor-4833417e.js";import{T as $n}from"../../chunks/Tip-fffd6df1.js";import{D as R}from"../../chunks/Docstring-4f315ed9.js";import{C as D}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as te}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function Dm(H){let h,y,q,w,T;return{c(){h=r("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),q=r("code"),w=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(v){h=a(v,"P",{});var k=i(h);y=o(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),q=a(k,"CODE",{});var F=i(q);w=o(F,"Module"),F.forEach(s),T=o(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(s)},m(v,k){u(v,h,k),e(h,y),e(h,q),e(q,w),e(h,T)},d(v){v&&s(h)}}}function Rm(H){let h,y,q,w,T;return{c(){h=r("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),q=r("code"),w=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(v){h=a(v,"P",{});var k=i(h);y=o(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),q=a(k,"CODE",{});var F=i(q);w=o(F,"Module"),F.forEach(s),T=o(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(s)},m(v,k){u(v,h,k),e(h,y),e(h,q),e(q,w),e(h,T)},d(v){v&&s(h)}}}function Wm(H){let h,y,q,w,T;return{c(){h=r("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),q=r("code"),w=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(v){h=a(v,"P",{});var k=i(h);y=o(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),q=a(k,"CODE",{});var F=i(q);w=o(F,"Module"),F.forEach(s),T=o(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(s)},m(v,k){u(v,h,k),e(h,y),e(h,q),e(q,w),e(h,T)},d(v){v&&s(h)}}}function Om(H){let h,y,q,w,T;return{c(){h=r("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),q=r("code"),w=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(v){h=a(v,"P",{});var k=i(h);y=o(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),q=a(k,"CODE",{});var F=i(q);w=o(F,"Module"),F.forEach(s),T=o(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(s)},m(v,k){u(v,h,k),e(h,y),e(h,q),e(q,w),e(h,T)},d(v){v&&s(h)}}}function Km(H){let h,y,q,w,T;return{c(){h=r("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),q=r("code"),w=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(v){h=a(v,"P",{});var k=i(h);y=o(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),q=a(k,"CODE",{});var F=i(q);w=o(F,"Module"),F.forEach(s),T=o(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(s)},m(v,k){u(v,h,k),e(h,y),e(h,q),e(q,w),e(h,T)},d(v){v&&s(h)}}}function Hm(H){let h,y,q,w,T;return{c(){h=r("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),q=r("code"),w=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(v){h=a(v,"P",{});var k=i(h);y=o(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),q=a(k,"CODE",{});var F=i(q);w=o(F,"Module"),F.forEach(s),T=o(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(s)},m(v,k){u(v,h,k),e(h,y),e(h,q),e(q,w),e(h,T)},d(v){v&&s(h)}}}function Qm(H){let h,y,q,w,T,v,k,F,za,nr,ce,Ee,En,Xe,ba,jn,qa,or,se,ka,Ye,va,wa,Ze,ya,Ta,rr,Ws,Sa,ar,Os,Mn,Ba,ir,Ks,$a,lr,ne,Fn,Ea,ja,Cn,Ma,Fa,et,Ca,Pn,Pa,xa,dr,je,Aa,tt,La,Na,cr,pe,Me,xn,st,Ia,An,Da,pr,K,nt,Ra,ot,Wa,Hs,Oa,Ka,Ha,he,Qa,Qs,Ua,Va,Us,Ga,Ja,Xa,Ln,Ya,Za,rt,ei,Nn,ti,hr,ue,Fe,In,at,si,Dn,ni,ur,C,it,oi,Rn,ri,ai,Ce,Vs,ii,li,Gs,di,ci,pi,Wn,On,hi,ui,lt,mi,Js,fi,gi,_i,oe,dt,zi,Kn,bi,qi,ct,Xs,ki,Hn,vi,wi,Ys,yi,Qn,Ti,Si,Pe,pt,Bi,ht,$i,Un,Ei,ji,Mi,Z,ut,Fi,Vn,Ci,Pi,mt,xi,me,Ai,Gn,Li,Ni,Jn,Ii,Di,Ri,Zs,ft,mr,fe,xe,Xn,gt,Wi,Yn,Oi,fr,Y,_t,Ki,zt,Hi,Zn,Qi,Ui,Vi,Ae,en,Gi,Ji,tn,Xi,Yi,Zi,bt,el,sn,tl,sl,gr,ge,Le,eo,qt,nl,to,ol,_r,S,kt,rl,so,al,il,vt,ll,wt,dl,cl,pl,yt,hl,nn,ul,ml,fl,Tt,gl,St,_l,zl,bl,Bt,ql,no,kl,vl,wl,oo,yl,Tl,$t,Sl,ro,Bl,$l,Et,El,Q,jt,jl,_e,Ml,on,Fl,Cl,ao,Pl,xl,Al,Ne,Ll,io,Nl,Il,Mt,zr,ze,Ie,lo,Ft,Dl,co,Rl,br,B,Ct,Wl,Pt,Ol,po,Kl,Hl,Ql,xt,Ul,At,Vl,Gl,Jl,Lt,Xl,rn,Yl,Zl,ed,Nt,td,It,sd,nd,od,Dt,rd,ho,ad,id,ld,uo,dd,cd,Rt,pd,mo,hd,ud,Wt,md,U,Ot,fd,be,gd,an,_d,zd,fo,bd,qd,kd,De,vd,go,wd,yd,Kt,qr,qe,Re,_o,Ht,Td,zo,Sd,kr,$,Qt,Bd,bo,$d,Ed,Ut,jd,Vt,Md,Fd,Cd,Gt,Pd,ln,xd,Ad,Ld,Jt,Nd,Xt,Id,Dd,Rd,Yt,Wd,qo,Od,Kd,Hd,ko,Qd,Ud,Zt,Vd,vo,Gd,Jd,es,Xd,W,ts,Yd,ke,Zd,dn,ec,tc,wo,sc,nc,oc,We,rc,yo,ac,ic,ss,lc,To,dc,cc,ns,vr,ve,Oe,So,os,pc,Bo,hc,wr,E,rs,uc,$o,mc,fc,as,gc,is,_c,zc,bc,ls,qc,cn,kc,vc,wc,ds,yc,cs,Tc,Sc,Bc,ps,$c,Eo,Ec,jc,Mc,jo,Fc,Cc,hs,Pc,Mo,xc,Ac,us,Lc,V,ms,Nc,we,Ic,pn,Dc,Rc,Fo,Wc,Oc,Kc,Ke,Hc,Co,Qc,Uc,fs,yr,ye,He,Po,gs,Vc,xo,Gc,Tr,j,_s,Jc,Ao,Xc,Yc,zs,Zc,bs,ep,tp,sp,qs,np,hn,op,rp,ap,ks,ip,vs,lp,dp,cp,ws,pp,Lo,hp,up,mp,No,fp,gp,ys,_p,Io,zp,bp,Ts,qp,G,Ss,kp,Te,vp,un,wp,yp,Do,Tp,Sp,Bp,Qe,$p,Ro,Ep,jp,Bs,Sr,Se,Ue,Wo,$s,Mp,Oo,Fp,Br,M,Es,Cp,Be,Pp,Ko,xp,Ap,Ho,Lp,Np,Ip,js,Dp,Ms,Rp,Wp,Op,Fs,Kp,mn,Hp,Qp,Up,Cs,Vp,Ps,Gp,Jp,Xp,xs,Yp,Qo,Zp,eh,th,Uo,sh,nh,As,oh,Vo,rh,ah,Ls,ih,J,Ns,lh,$e,dh,fn,ch,ph,Go,hh,uh,mh,Ve,fh,Jo,gh,_h,Is,$r;return v=new te({}),Xe=new te({}),st=new te({}),nt=new R({props:{name:"class transformers.SqueezeBertConfig",anchor:"transformers.SqueezeBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"embedding_size",val:" = 768"},{name:"q_groups",val:" = 4"},{name:"k_groups",val:" = 4"},{name:"v_groups",val:" = 4"},{name:"post_attention_groups",val:" = 1"},{name:"intermediate_groups",val:" = 4"},{name:"output_groups",val:" = 4"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/configuration_squeezebert.py#L30",parametersDescription:[{anchor:"transformers.SqueezeBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the SqueezeBERT model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertModel">SqueezeBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.SqueezeBertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.SqueezeBertConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.SqueezeBertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.SqueezeBertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.SqueezeBertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.SqueezeBertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.SqueezeBertConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.SqueezeBertConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.SqueezeBertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/pr_15839/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.SqueezeBertConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.SqueezeBertConfig.layer_norm_eps",description:"<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;",name:"layer_norm_eps"},{anchor:"transformers.SqueezeBertConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The ID of the token in the word embedding to use as padding.`,name:"pad_token_id"},{anchor:"transformers.SqueezeBertConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
The dimension of the word embedding vectors.`,name:"embedding_size"},{anchor:"transformers.SqueezeBertConfig.q_groups",description:`<strong>q_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in Q layer.`,name:"q_groups"},{anchor:"transformers.SqueezeBertConfig.k_groups",description:`<strong>k_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in K layer.`,name:"k_groups"},{anchor:"transformers.SqueezeBertConfig.v_groups",description:`<strong>v_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in V layer.`,name:"v_groups"},{anchor:"transformers.SqueezeBertConfig.post_attention_groups",description:`<strong>post_attention_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of groups in the first feed forward network layer.`,name:"post_attention_groups"},{anchor:"transformers.SqueezeBertConfig.intermediate_groups",description:`<strong>intermediate_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in the second feed forward network layer.`,name:"intermediate_groups"},{anchor:"transformers.SqueezeBertConfig.output_groups",description:`<strong>output_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in the third feed forward network layer.`,name:"output_groups"}]}}),rt=new D({props:{code:`from transformers import SqueezeBertModel, SqueezeBertConfig

# Initializing a SqueezeBERT configuration
configuration = SqueezeBertConfig()

# Initializing a model from the configuration above
model = SqueezeBertModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SqueezeBertModel, SqueezeBertConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a SqueezeBERT configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = SqueezeBertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the configuration above</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),at=new te({}),it=new R({props:{name:"class transformers.SqueezeBertTokenizer",anchor:"transformers.SqueezeBertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/tokenization_squeezebert.py#L47"}}),dt=new R({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert.py#L248",parametersDescription:[{anchor:"transformers.BertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),pt=new R({props:{name:"get_special_tokens_mask",anchor:"transformers.BertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert.py#L273",parametersDescription:[{anchor:"transformers.BertTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.BertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ut=new R({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert.py#L301",parametersDescription:[{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),mt=new D({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),ft=new R({props:{name:"save_vocabulary",anchor:"transformers.BertTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bert/tokenization_bert.py#L330"}}),gt=new te({}),_t=new R({props:{name:"class transformers.SqueezeBertTokenizerFast",anchor:"transformers.SqueezeBertTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py#L53"}}),qt=new te({}),kt=new R({props:{name:"class transformers.SqueezeBertModel",anchor:"transformers.SqueezeBertModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L549",parametersDescription:[{anchor:"transformers.SqueezeBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),$t=new D({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),Et=new D({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),jt=new R({props:{name:"forward",anchor:"transformers.SqueezeBertModel.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L574",parametersDescription:[{anchor:"transformers.SqueezeBertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertTokenizer">SqueezeBertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SqueezeBertModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.SqueezeBertModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.SqueezeBertModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SqueezeBertModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SqueezeBertModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ne=new $n({props:{$$slots:{default:[Dm]},$$scope:{ctx:H}}}),Mt=new D({props:{code:`from transformers import SqueezeBertTokenizer, SqueezeBertModel
import torch

tokenizer = SqueezeBertTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertModel.from_pretrained("squeezebert/squeezebert-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SqueezeBertTokenizer, SqueezeBertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = SqueezeBertTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertModel.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),Ft=new te({}),Ct=new R({props:{name:"class transformers.SqueezeBertForMaskedLM",anchor:"transformers.SqueezeBertForMaskedLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L649",parametersDescription:[{anchor:"transformers.SqueezeBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Rt=new D({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),Wt=new D({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),Ot=new R({props:{name:"forward",anchor:"transformers.SqueezeBertForMaskedLM.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L668",parametersDescription:[{anchor:"transformers.SqueezeBertForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertTokenizer">SqueezeBertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),De=new $n({props:{$$slots:{default:[Rm]},$$scope:{ctx:H}}}),Kt=new D({props:{code:`from transformers import SqueezeBertTokenizer, SqueezeBertForMaskedLM
import torch

tokenizer = SqueezeBertTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForMaskedLM.from_pretrained("squeezebert/squeezebert-uncased")

inputs = tokenizer("The capital of France is [MASK].", return_tensors="pt")
labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]

outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SqueezeBertTokenizer, SqueezeBertForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = SqueezeBertTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),Ht=new te({}),Qt=new R({props:{name:"class transformers.SqueezeBertForSequenceClassification",anchor:"transformers.SqueezeBertForSequenceClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L735",parametersDescription:[{anchor:"transformers.SqueezeBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Zt=new D({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),es=new D({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),ts=new R({props:{name:"forward",anchor:"transformers.SqueezeBertForSequenceClassification.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L748",parametersDescription:[{anchor:"transformers.SqueezeBertForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertTokenizer">SqueezeBertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),We=new $n({props:{$$slots:{default:[Wm]},$$scope:{ctx:H}}}),ss=new D({props:{code:`import torch
from transformers import SqueezeBertTokenizer, SqueezeBertForSequenceClassification

torch.manual_seed(0)
tokenizer = SqueezeBertTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForSequenceClassification.from_pretrained("squeezebert/squeezebert-uncased", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([1]).unsqueeze(0)  # Batch size 1
outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits
list(logits.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SqueezeBertTokenizer, SqueezeBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = SqueezeBertTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>, num_labels=<span class="hljs-number">2</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>]).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
`}}),ns=new D({props:{code:`import torch
from transformers import SqueezeBertTokenizer, SqueezeBertForSequenceClassification

torch.manual_seed(0)
tokenizer = SqueezeBertTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForSequenceClassification.from_pretrained("squeezebert/squeezebert-uncased", problem_type="multi_label_classification", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([[1, 1]], dtype=torch.float)  # need dtype=float for BCEWithLogitsLoss
outputs = model(**inputs, labels=labels)
loss = outputs.loss
list(logits.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SqueezeBertTokenizer, SqueezeBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = SqueezeBertTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>, num_labels=<span class="hljs-number">2</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>]], dtype=torch.<span class="hljs-built_in">float</span>)  <span class="hljs-comment"># need dtype=float for BCEWithLogitsLoss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
`}}),os=new te({}),rs=new R({props:{name:"class transformers.SqueezeBertForMultipleChoice",anchor:"transformers.SqueezeBertForMultipleChoice",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L835",parametersDescription:[{anchor:"transformers.SqueezeBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),hs=new D({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),us=new D({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),ms=new R({props:{name:"forward",anchor:"transformers.SqueezeBertForMultipleChoice.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L846",parametersDescription:[{anchor:"transformers.SqueezeBertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertTokenizer">SqueezeBertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <em>num_choices</em> is the size of the second dimension of the input tensors. (see
<em>input_ids</em> above)`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ke=new $n({props:{$$slots:{default:[Om]},$$scope:{ctx:H}}}),fs=new D({props:{code:`from transformers import SqueezeBertTokenizer, SqueezeBertForMultipleChoice
import torch

tokenizer = SqueezeBertTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForMultipleChoice.from_pretrained("squeezebert/squeezebert-uncased")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."
labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="pt", padding=True)
outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SqueezeBertTokenizer, SqueezeBertForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = SqueezeBertTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),gs=new te({}),_s=new R({props:{name:"class transformers.SqueezeBertForTokenClassification",anchor:"transformers.SqueezeBertForTokenClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L929",parametersDescription:[{anchor:"transformers.SqueezeBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),ys=new D({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),Ts=new D({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),Ss=new R({props:{name:"forward",anchor:"transformers.SqueezeBertForTokenClassification.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L941",parametersDescription:[{anchor:"transformers.SqueezeBertForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertTokenizer">SqueezeBertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qe=new $n({props:{$$slots:{default:[Km]},$$scope:{ctx:H}}}),Bs=new D({props:{code:`from transformers import SqueezeBertTokenizer, SqueezeBertForTokenClassification
import torch

tokenizer = SqueezeBertTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForTokenClassification.from_pretrained("squeezebert/squeezebert-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([1] * inputs["input_ids"].size(1)).unsqueeze(0)  # Batch size 1

outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SqueezeBertTokenizer, SqueezeBertForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = SqueezeBertTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>] * inputs[<span class="hljs-string">&quot;input_ids&quot;</span>].size(<span class="hljs-number">1</span>)).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),$s=new te({}),Es=new R({props:{name:"class transformers.SqueezeBertForQuestionAnswering",anchor:"transformers.SqueezeBertForQuestionAnswering",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L1008",parametersDescription:[{anchor:"transformers.SqueezeBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),As=new D({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),Ls=new D({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),Ns=new R({props:{name:"forward",anchor:"transformers.SqueezeBertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"start_positions",val:" = None"},{name:"end_positions",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/squeezebert/modeling_squeezebert.py#L1019",parametersDescription:[{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertTokenizer">SqueezeBertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new $n({props:{$$slots:{default:[Hm]},$$scope:{ctx:H}}}),Is=new D({props:{code:`from transformers import SqueezeBertTokenizer, SqueezeBertForQuestionAnswering
import torch

torch.manual_seed(0)
tokenizer = SqueezeBertTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForQuestionAnswering.from_pretrained("squeezebert/squeezebert-uncased")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="pt")
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])

outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
loss = outputs.loss
round(loss.item(), 2)


start_scores = outputs.start_logits
list(start_scores.shape)


end_scores = outputs.end_logits
list(end_scores.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SqueezeBertTokenizer, SqueezeBertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = SqueezeBertTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_positions = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>end_positions = torch.tensor([<span class="hljs-number">3</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(start_scores.shape)


<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(end_scores.shape)
`}}),{c(){h=r("meta"),y=l(),q=r("h1"),w=r("a"),T=r("span"),m(v.$$.fragment),k=l(),F=r("span"),za=n("SqueezeBERT"),nr=l(),ce=r("h2"),Ee=r("a"),En=r("span"),m(Xe.$$.fragment),ba=l(),jn=r("span"),qa=n("Overview"),or=l(),se=r("p"),ka=n("The SqueezeBERT model was proposed in "),Ye=r("a"),va=n("SqueezeBERT: What can computer vision teach NLP about efficient neural networks?"),wa=n(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, Kurt W. Keutzer. It\u2019s a
bidirectional transformer similar to the BERT model. The key difference between the BERT architecture and the
SqueezeBERT architecture is that SqueezeBERT uses `),Ze=r("a"),ya=n("grouped convolutions"),Ta=n(`
instead of fully-connected layers for the Q, K, V and FFN layers.`),rr=l(),Ws=r("p"),Sa=n("The abstract from the paper is the following:"),ar=l(),Os=r("p"),Mn=r("em"),Ba=n(`Humans read and write hundreds of billions of messages every day. Further, due to the availability of large datasets,
large computing systems, and better neural network models, natural language processing (NLP) technology has made
significant strides in understanding, proofreading, and organizing these messages. Thus, there is a significant
opportunity to deploy NLP in myriad applications to help web users, social networks, and businesses. In particular, we
consider smartphones and other mobile devices as crucial platforms for deploying NLP models at scale. However, today\u2019s
highly-accurate NLP neural network models such as BERT and RoBERTa are extremely computationally expensive, with
BERT-base taking 1.7 seconds to classify a text snippet on a Pixel 3 smartphone. In this work, we observe that methods
such as grouped convolutions have yielded significant speedups for computer vision networks, but many of these
techniques have not been adopted by NLP neural network designers. We demonstrate how to replace several operations in
self-attention layers with grouped convolutions, and we use this technique in a novel network architecture called
SqueezeBERT, which runs 4.3x faster than BERT-base on the Pixel 3 while achieving competitive accuracy on the GLUE test
set. The SqueezeBERT code will be released.`),ir=l(),Ks=r("p"),$a=n("Tips:"),lr=l(),ne=r("ul"),Fn=r("li"),Ea=n(`SqueezeBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right
rather than the left.`),ja=l(),Cn=r("li"),Ma=n(`SqueezeBERT is similar to BERT and therefore relies on the masked language modeling (MLM) objective. It is therefore
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation. Models trained
with a causal language modeling (CLM) objective are better in that regard.`),Fa=l(),et=r("li"),Ca=n(`For best results when finetuning on sequence classification tasks, it is recommended to start with the
`),Pn=r("em"),Pa=n("squeezebert/squeezebert-mnli-headless"),xa=n(" checkpoint."),dr=l(),je=r("p"),Aa=n("This model was contributed by "),tt=r("a"),La=n("forresti"),Na=n("."),cr=l(),pe=r("h2"),Me=r("a"),xn=r("span"),m(st.$$.fragment),Ia=l(),An=r("span"),Da=n("SqueezeBertConfig"),pr=l(),K=r("div"),m(nt.$$.fragment),Ra=l(),ot=r("p"),Wa=n("This is the configuration class to store the configuration of a "),Hs=r("a"),Oa=n("SqueezeBertModel"),Ka=n(`. It is used to instantiate a
SqueezeBERT model according to the specified arguments, defining the model architecture.`),Ha=l(),he=r("p"),Qa=n("Configuration objects inherit from "),Qs=r("a"),Ua=n("PretrainedConfig"),Va=n(` and can be used to control the model outputs. Read the
documentation from `),Us=r("a"),Ga=n("PretrainedConfig"),Ja=n(" for more information."),Xa=l(),Ln=r("p"),Ya=n("Examples:"),Za=l(),m(rt.$$.fragment),ei=l(),Nn=r("p"),ti=n(`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),hr=l(),ue=r("h2"),Fe=r("a"),In=r("span"),m(at.$$.fragment),si=l(),Dn=r("span"),ni=n("SqueezeBertTokenizer"),ur=l(),C=r("div"),m(it.$$.fragment),oi=l(),Rn=r("p"),ri=n("Constructs a SqueezeBert tokenizer."),ai=l(),Ce=r("p"),Vs=r("a"),ii=n("SqueezeBertTokenizer"),li=n(" is identical to "),Gs=r("a"),di=n("BertTokenizer"),ci=n(" and runs end-to-end tokenization: punctuation splitting"),pi=l(),Wn=r("ul"),On=r("li"),hi=n("wordpiece."),ui=l(),lt=r("p"),mi=n("Refer to superclass "),Js=r("a"),fi=n("BertTokenizer"),gi=n(" for usage examples and documentation concerning parameters."),_i=l(),oe=r("div"),m(dt.$$.fragment),zi=l(),Kn=r("p"),bi=n(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),qi=l(),ct=r("ul"),Xs=r("li"),ki=n("single sequence: "),Hn=r("code"),vi=n("[CLS] X [SEP]"),wi=l(),Ys=r("li"),yi=n("pair of sequences: "),Qn=r("code"),Ti=n("[CLS] A [SEP] B [SEP]"),Si=l(),Pe=r("div"),m(pt.$$.fragment),Bi=l(),ht=r("p"),$i=n(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Un=r("code"),Ei=n("prepare_for_model"),ji=n(" method."),Mi=l(),Z=r("div"),m(ut.$$.fragment),Fi=l(),Vn=r("p"),Ci=n(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence
pair mask has the following format:`),Pi=l(),m(mt.$$.fragment),xi=l(),me=r("p"),Ai=n("If "),Gn=r("code"),Li=n("token_ids_1"),Ni=n(" is "),Jn=r("code"),Ii=n("None"),Di=n(", this method only returns the first portion of the mask (0s)."),Ri=l(),Zs=r("div"),m(ft.$$.fragment),mr=l(),fe=r("h2"),xe=r("a"),Xn=r("span"),m(gt.$$.fragment),Wi=l(),Yn=r("span"),Oi=n("SqueezeBertTokenizerFast"),fr=l(),Y=r("div"),m(_t.$$.fragment),Ki=l(),zt=r("p"),Hi=n("Constructs a \u201CFast\u201D SqueezeBert tokenizer (backed by HuggingFace\u2019s "),Zn=r("em"),Qi=n("tokenizers"),Ui=n(" library)."),Vi=l(),Ae=r("p"),en=r("a"),Gi=n("SqueezeBertTokenizerFast"),Ji=n(" is identical to "),tn=r("a"),Xi=n("BertTokenizerFast"),Yi=n(` and runs end-to-end tokenization: punctuation
splitting + wordpiece.`),Zi=l(),bt=r("p"),el=n("Refer to superclass "),sn=r("a"),tl=n("BertTokenizerFast"),sl=n(" for usage examples and documentation concerning parameters."),gr=l(),ge=r("h2"),Le=r("a"),eo=r("span"),m(qt.$$.fragment),nl=l(),to=r("span"),ol=n("SqueezeBertModel"),_r=l(),S=r("div"),m(kt.$$.fragment),rl=l(),so=r("p"),al=n("The bare SqueezeBERT Model transformer outputting raw hidden-states without any specific head on top."),il=l(),vt=r("p"),ll=n("The SqueezeBERT model was proposed in "),wt=r("a"),dl=n(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),cl=n(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),pl=l(),yt=r("p"),hl=n("This model inherits from "),nn=r("a"),ul=n("PreTrainedModel"),ml=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),fl=l(),Tt=r("p"),gl=n("This model is also a PyTorch "),St=r("a"),_l=n("torch.nn.Module"),zl=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bl=l(),Bt=r("p"),ql=n(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),no=r("em"),kl=n("squeezebert/squeezebert-mnli-headless"),vl=n(" checkpoint as a starting point."),wl=l(),oo=r("p"),yl=n("Hierarchy:"),Tl=l(),m($t.$$.fragment),Sl=l(),ro=r("p"),Bl=n("Data layouts:"),$l=l(),m(Et.$$.fragment),El=l(),Q=r("div"),m(jt.$$.fragment),jl=l(),_e=r("p"),Ml=n("The "),on=r("a"),Fl=n("SqueezeBertModel"),Cl=n(" forward method, overrides the "),ao=r("code"),Pl=n("__call__"),xl=n(" special method."),Al=l(),m(Ne.$$.fragment),Ll=l(),io=r("p"),Nl=n("Example:"),Il=l(),m(Mt.$$.fragment),zr=l(),ze=r("h2"),Ie=r("a"),lo=r("span"),m(Ft.$$.fragment),Dl=l(),co=r("span"),Rl=n("SqueezeBertForMaskedLM"),br=l(),B=r("div"),m(Ct.$$.fragment),Wl=l(),Pt=r("p"),Ol=n("SqueezeBERT Model with a "),po=r("code"),Kl=n("language modeling"),Hl=n(" head on top."),Ql=l(),xt=r("p"),Ul=n("The SqueezeBERT model was proposed in "),At=r("a"),Vl=n(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Gl=n(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Jl=l(),Lt=r("p"),Xl=n("This model inherits from "),rn=r("a"),Yl=n("PreTrainedModel"),Zl=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ed=l(),Nt=r("p"),td=n("This model is also a PyTorch "),It=r("a"),sd=n("torch.nn.Module"),nd=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),od=l(),Dt=r("p"),rd=n(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),ho=r("em"),ad=n("squeezebert/squeezebert-mnli-headless"),id=n(" checkpoint as a starting point."),ld=l(),uo=r("p"),dd=n("Hierarchy:"),cd=l(),m(Rt.$$.fragment),pd=l(),mo=r("p"),hd=n("Data layouts:"),ud=l(),m(Wt.$$.fragment),md=l(),U=r("div"),m(Ot.$$.fragment),fd=l(),be=r("p"),gd=n("The "),an=r("a"),_d=n("SqueezeBertForMaskedLM"),zd=n(" forward method, overrides the "),fo=r("code"),bd=n("__call__"),qd=n(" special method."),kd=l(),m(De.$$.fragment),vd=l(),go=r("p"),wd=n("Example:"),yd=l(),m(Kt.$$.fragment),qr=l(),qe=r("h2"),Re=r("a"),_o=r("span"),m(Ht.$$.fragment),Td=l(),zo=r("span"),Sd=n("SqueezeBertForSequenceClassification"),kr=l(),$=r("div"),m(Qt.$$.fragment),Bd=l(),bo=r("p"),$d=n(`SqueezeBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Ed=l(),Ut=r("p"),jd=n("The SqueezeBERT model was proposed in "),Vt=r("a"),Md=n(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Fd=n(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Cd=l(),Gt=r("p"),Pd=n("This model inherits from "),ln=r("a"),xd=n("PreTrainedModel"),Ad=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ld=l(),Jt=r("p"),Nd=n("This model is also a PyTorch "),Xt=r("a"),Id=n("torch.nn.Module"),Dd=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rd=l(),Yt=r("p"),Wd=n(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),qo=r("em"),Od=n("squeezebert/squeezebert-mnli-headless"),Kd=n(" checkpoint as a starting point."),Hd=l(),ko=r("p"),Qd=n("Hierarchy:"),Ud=l(),m(Zt.$$.fragment),Vd=l(),vo=r("p"),Gd=n("Data layouts:"),Jd=l(),m(es.$$.fragment),Xd=l(),W=r("div"),m(ts.$$.fragment),Yd=l(),ke=r("p"),Zd=n("The "),dn=r("a"),ec=n("SqueezeBertForSequenceClassification"),tc=n(" forward method, overrides the "),wo=r("code"),sc=n("__call__"),nc=n(" special method."),oc=l(),m(We.$$.fragment),rc=l(),yo=r("p"),ac=n("Example of single-label classification:"),ic=l(),m(ss.$$.fragment),lc=l(),To=r("p"),dc=n("Example of multi-label classification:"),cc=l(),m(ns.$$.fragment),vr=l(),ve=r("h2"),Oe=r("a"),So=r("span"),m(os.$$.fragment),pc=l(),Bo=r("span"),hc=n("SqueezeBertForMultipleChoice"),wr=l(),E=r("div"),m(rs.$$.fragment),uc=l(),$o=r("p"),mc=n(`SqueezeBERT Model with a multiple choice classification head on top (a linear layer on top of the pooled output and
a softmax) e.g. for RocStories/SWAG tasks.`),fc=l(),as=r("p"),gc=n("The SqueezeBERT model was proposed in "),is=r("a"),_c=n(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),zc=n(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),bc=l(),ls=r("p"),qc=n("This model inherits from "),cn=r("a"),kc=n("PreTrainedModel"),vc=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),wc=l(),ds=r("p"),yc=n("This model is also a PyTorch "),cs=r("a"),Tc=n("torch.nn.Module"),Sc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Bc=l(),ps=r("p"),$c=n(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Eo=r("em"),Ec=n("squeezebert/squeezebert-mnli-headless"),jc=n(" checkpoint as a starting point."),Mc=l(),jo=r("p"),Fc=n("Hierarchy:"),Cc=l(),m(hs.$$.fragment),Pc=l(),Mo=r("p"),xc=n("Data layouts:"),Ac=l(),m(us.$$.fragment),Lc=l(),V=r("div"),m(ms.$$.fragment),Nc=l(),we=r("p"),Ic=n("The "),pn=r("a"),Dc=n("SqueezeBertForMultipleChoice"),Rc=n(" forward method, overrides the "),Fo=r("code"),Wc=n("__call__"),Oc=n(" special method."),Kc=l(),m(Ke.$$.fragment),Hc=l(),Co=r("p"),Qc=n("Example:"),Uc=l(),m(fs.$$.fragment),yr=l(),ye=r("h2"),He=r("a"),Po=r("span"),m(gs.$$.fragment),Vc=l(),xo=r("span"),Gc=n("SqueezeBertForTokenClassification"),Tr=l(),j=r("div"),m(_s.$$.fragment),Jc=l(),Ao=r("p"),Xc=n(`SqueezeBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),Yc=l(),zs=r("p"),Zc=n("The SqueezeBERT model was proposed in "),bs=r("a"),ep=n(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),tp=n(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),sp=l(),qs=r("p"),np=n("This model inherits from "),hn=r("a"),op=n("PreTrainedModel"),rp=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ap=l(),ks=r("p"),ip=n("This model is also a PyTorch "),vs=r("a"),lp=n("torch.nn.Module"),dp=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),cp=l(),ws=r("p"),pp=n(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Lo=r("em"),hp=n("squeezebert/squeezebert-mnli-headless"),up=n(" checkpoint as a starting point."),mp=l(),No=r("p"),fp=n("Hierarchy:"),gp=l(),m(ys.$$.fragment),_p=l(),Io=r("p"),zp=n("Data layouts:"),bp=l(),m(Ts.$$.fragment),qp=l(),G=r("div"),m(Ss.$$.fragment),kp=l(),Te=r("p"),vp=n("The "),un=r("a"),wp=n("SqueezeBertForTokenClassification"),yp=n(" forward method, overrides the "),Do=r("code"),Tp=n("__call__"),Sp=n(" special method."),Bp=l(),m(Qe.$$.fragment),$p=l(),Ro=r("p"),Ep=n("Example:"),jp=l(),m(Bs.$$.fragment),Sr=l(),Se=r("h2"),Ue=r("a"),Wo=r("span"),m($s.$$.fragment),Mp=l(),Oo=r("span"),Fp=n("SqueezeBertForQuestionAnswering"),Br=l(),M=r("div"),m(Es.$$.fragment),Cp=l(),Be=r("p"),Pp=n(`SqueezeBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),Ko=r("code"),xp=n("span start logits"),Ap=n(" and "),Ho=r("code"),Lp=n("span end logits"),Np=n(")."),Ip=l(),js=r("p"),Dp=n("The SqueezeBERT model was proposed in "),Ms=r("a"),Rp=n(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Wp=n(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Op=l(),Fs=r("p"),Kp=n("This model inherits from "),mn=r("a"),Hp=n("PreTrainedModel"),Qp=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Up=l(),Cs=r("p"),Vp=n("This model is also a PyTorch "),Ps=r("a"),Gp=n("torch.nn.Module"),Jp=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xp=l(),xs=r("p"),Yp=n(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Qo=r("em"),Zp=n("squeezebert/squeezebert-mnli-headless"),eh=n(" checkpoint as a starting point."),th=l(),Uo=r("p"),sh=n("Hierarchy:"),nh=l(),m(As.$$.fragment),oh=l(),Vo=r("p"),rh=n("Data layouts:"),ah=l(),m(Ls.$$.fragment),ih=l(),J=r("div"),m(Ns.$$.fragment),lh=l(),$e=r("p"),dh=n("The "),fn=r("a"),ch=n("SqueezeBertForQuestionAnswering"),ph=n(" forward method, overrides the "),Go=r("code"),hh=n("__call__"),uh=n(" special method."),mh=l(),m(Ve.$$.fragment),fh=l(),Jo=r("p"),gh=n("Example:"),_h=l(),m(Is.$$.fragment),this.h()},l(t){const p=Im('[data-svelte="svelte-1phssyn"]',document.head);h=a(p,"META",{name:!0,content:!0}),p.forEach(s),y=d(t),q=a(t,"H1",{class:!0});var Ds=i(q);w=a(Ds,"A",{id:!0,class:!0,href:!0});var Xo=i(w);T=a(Xo,"SPAN",{});var Yo=i(T);f(v.$$.fragment,Yo),Yo.forEach(s),Xo.forEach(s),k=d(Ds),F=a(Ds,"SPAN",{});var Zo=i(F);za=o(Zo,"SqueezeBERT"),Zo.forEach(s),Ds.forEach(s),nr=d(t),ce=a(t,"H2",{class:!0});var Rs=i(ce);Ee=a(Rs,"A",{id:!0,class:!0,href:!0});var er=i(Ee);En=a(er,"SPAN",{});var qh=i(En);f(Xe.$$.fragment,qh),qh.forEach(s),er.forEach(s),ba=d(Rs),jn=a(Rs,"SPAN",{});var kh=i(jn);qa=o(kh,"Overview"),kh.forEach(s),Rs.forEach(s),or=d(t),se=a(t,"P",{});var gn=i(se);ka=o(gn,"The SqueezeBERT model was proposed in "),Ye=a(gn,"A",{href:!0,rel:!0});var vh=i(Ye);va=o(vh,"SqueezeBERT: What can computer vision teach NLP about efficient neural networks?"),vh.forEach(s),wa=o(gn,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, Kurt W. Keutzer. It\u2019s a
bidirectional transformer similar to the BERT model. The key difference between the BERT architecture and the
SqueezeBERT architecture is that SqueezeBERT uses `),Ze=a(gn,"A",{href:!0,rel:!0});var wh=i(Ze);ya=o(wh,"grouped convolutions"),wh.forEach(s),Ta=o(gn,`
instead of fully-connected layers for the Q, K, V and FFN layers.`),gn.forEach(s),rr=d(t),Ws=a(t,"P",{});var yh=i(Ws);Sa=o(yh,"The abstract from the paper is the following:"),yh.forEach(s),ar=d(t),Os=a(t,"P",{});var Th=i(Os);Mn=a(Th,"EM",{});var Sh=i(Mn);Ba=o(Sh,`Humans read and write hundreds of billions of messages every day. Further, due to the availability of large datasets,
large computing systems, and better neural network models, natural language processing (NLP) technology has made
significant strides in understanding, proofreading, and organizing these messages. Thus, there is a significant
opportunity to deploy NLP in myriad applications to help web users, social networks, and businesses. In particular, we
consider smartphones and other mobile devices as crucial platforms for deploying NLP models at scale. However, today\u2019s
highly-accurate NLP neural network models such as BERT and RoBERTa are extremely computationally expensive, with
BERT-base taking 1.7 seconds to classify a text snippet on a Pixel 3 smartphone. In this work, we observe that methods
such as grouped convolutions have yielded significant speedups for computer vision networks, but many of these
techniques have not been adopted by NLP neural network designers. We demonstrate how to replace several operations in
self-attention layers with grouped convolutions, and we use this technique in a novel network architecture called
SqueezeBERT, which runs 4.3x faster than BERT-base on the Pixel 3 while achieving competitive accuracy on the GLUE test
set. The SqueezeBERT code will be released.`),Sh.forEach(s),Th.forEach(s),ir=d(t),Ks=a(t,"P",{});var Bh=i(Ks);$a=o(Bh,"Tips:"),Bh.forEach(s),lr=d(t),ne=a(t,"UL",{});var _n=i(ne);Fn=a(_n,"LI",{});var $h=i(Fn);Ea=o($h,`SqueezeBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right
rather than the left.`),$h.forEach(s),ja=d(_n),Cn=a(_n,"LI",{});var Eh=i(Cn);Ma=o(Eh,`SqueezeBERT is similar to BERT and therefore relies on the masked language modeling (MLM) objective. It is therefore
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation. Models trained
with a causal language modeling (CLM) objective are better in that regard.`),Eh.forEach(s),Fa=d(_n),et=a(_n,"LI",{});var Er=i(et);Ca=o(Er,`For best results when finetuning on sequence classification tasks, it is recommended to start with the
`),Pn=a(Er,"EM",{});var jh=i(Pn);Pa=o(jh,"squeezebert/squeezebert-mnli-headless"),jh.forEach(s),xa=o(Er," checkpoint."),Er.forEach(s),_n.forEach(s),dr=d(t),je=a(t,"P",{});var jr=i(je);Aa=o(jr,"This model was contributed by "),tt=a(jr,"A",{href:!0,rel:!0});var Mh=i(tt);La=o(Mh,"forresti"),Mh.forEach(s),Na=o(jr,"."),jr.forEach(s),cr=d(t),pe=a(t,"H2",{class:!0});var Mr=i(pe);Me=a(Mr,"A",{id:!0,class:!0,href:!0});var Fh=i(Me);xn=a(Fh,"SPAN",{});var Ch=i(xn);f(st.$$.fragment,Ch),Ch.forEach(s),Fh.forEach(s),Ia=d(Mr),An=a(Mr,"SPAN",{});var Ph=i(An);Da=o(Ph,"SqueezeBertConfig"),Ph.forEach(s),Mr.forEach(s),pr=d(t),K=a(t,"DIV",{class:!0});var ee=i(K);f(nt.$$.fragment,ee),Ra=d(ee),ot=a(ee,"P",{});var Fr=i(ot);Wa=o(Fr,"This is the configuration class to store the configuration of a "),Hs=a(Fr,"A",{href:!0});var xh=i(Hs);Oa=o(xh,"SqueezeBertModel"),xh.forEach(s),Ka=o(Fr,`. It is used to instantiate a
SqueezeBERT model according to the specified arguments, defining the model architecture.`),Fr.forEach(s),Ha=d(ee),he=a(ee,"P",{});var zn=i(he);Qa=o(zn,"Configuration objects inherit from "),Qs=a(zn,"A",{href:!0});var Ah=i(Qs);Ua=o(Ah,"PretrainedConfig"),Ah.forEach(s),Va=o(zn,` and can be used to control the model outputs. Read the
documentation from `),Us=a(zn,"A",{href:!0});var Lh=i(Us);Ga=o(Lh,"PretrainedConfig"),Lh.forEach(s),Ja=o(zn," for more information."),zn.forEach(s),Xa=d(ee),Ln=a(ee,"P",{});var Nh=i(Ln);Ya=o(Nh,"Examples:"),Nh.forEach(s),Za=d(ee),f(rt.$$.fragment,ee),ei=d(ee),Nn=a(ee,"P",{});var Ih=i(Nn);ti=o(Ih,`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),Ih.forEach(s),ee.forEach(s),hr=d(t),ue=a(t,"H2",{class:!0});var Cr=i(ue);Fe=a(Cr,"A",{id:!0,class:!0,href:!0});var Dh=i(Fe);In=a(Dh,"SPAN",{});var Rh=i(In);f(at.$$.fragment,Rh),Rh.forEach(s),Dh.forEach(s),si=d(Cr),Dn=a(Cr,"SPAN",{});var Wh=i(Dn);ni=o(Wh,"SqueezeBertTokenizer"),Wh.forEach(s),Cr.forEach(s),ur=d(t),C=a(t,"DIV",{class:!0});var O=i(C);f(it.$$.fragment,O),oi=d(O),Rn=a(O,"P",{});var Oh=i(Rn);ri=o(Oh,"Constructs a SqueezeBert tokenizer."),Oh.forEach(s),ai=d(O),Ce=a(O,"P",{});var tr=i(Ce);Vs=a(tr,"A",{href:!0});var Kh=i(Vs);ii=o(Kh,"SqueezeBertTokenizer"),Kh.forEach(s),li=o(tr," is identical to "),Gs=a(tr,"A",{href:!0});var Hh=i(Gs);di=o(Hh,"BertTokenizer"),Hh.forEach(s),ci=o(tr," and runs end-to-end tokenization: punctuation splitting"),tr.forEach(s),pi=d(O),Wn=a(O,"UL",{});var Qh=i(Wn);On=a(Qh,"LI",{});var Uh=i(On);hi=o(Uh,"wordpiece."),Uh.forEach(s),Qh.forEach(s),ui=d(O),lt=a(O,"P",{});var Pr=i(lt);mi=o(Pr,"Refer to superclass "),Js=a(Pr,"A",{href:!0});var Vh=i(Js);fi=o(Vh,"BertTokenizer"),Vh.forEach(s),gi=o(Pr," for usage examples and documentation concerning parameters."),Pr.forEach(s),_i=d(O),oe=a(O,"DIV",{class:!0});var bn=i(oe);f(dt.$$.fragment,bn),zi=d(bn),Kn=a(bn,"P",{});var Gh=i(Kn);bi=o(Gh,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),Gh.forEach(s),qi=d(bn),ct=a(bn,"UL",{});var xr=i(ct);Xs=a(xr,"LI",{});var zh=i(Xs);ki=o(zh,"single sequence: "),Hn=a(zh,"CODE",{});var Jh=i(Hn);vi=o(Jh,"[CLS] X [SEP]"),Jh.forEach(s),zh.forEach(s),wi=d(xr),Ys=a(xr,"LI",{});var bh=i(Ys);yi=o(bh,"pair of sequences: "),Qn=a(bh,"CODE",{});var Xh=i(Qn);Ti=o(Xh,"[CLS] A [SEP] B [SEP]"),Xh.forEach(s),bh.forEach(s),xr.forEach(s),bn.forEach(s),Si=d(O),Pe=a(O,"DIV",{class:!0});var Ar=i(Pe);f(pt.$$.fragment,Ar),Bi=d(Ar),ht=a(Ar,"P",{});var Lr=i(ht);$i=o(Lr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Un=a(Lr,"CODE",{});var Yh=i(Un);Ei=o(Yh,"prepare_for_model"),Yh.forEach(s),ji=o(Lr," method."),Lr.forEach(s),Ar.forEach(s),Mi=d(O),Z=a(O,"DIV",{class:!0});var Ge=i(Z);f(ut.$$.fragment,Ge),Fi=d(Ge),Vn=a(Ge,"P",{});var Zh=i(Vn);Ci=o(Zh,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence
pair mask has the following format:`),Zh.forEach(s),Pi=d(Ge),f(mt.$$.fragment,Ge),xi=d(Ge),me=a(Ge,"P",{});var qn=i(me);Ai=o(qn,"If "),Gn=a(qn,"CODE",{});var eu=i(Gn);Li=o(eu,"token_ids_1"),eu.forEach(s),Ni=o(qn," is "),Jn=a(qn,"CODE",{});var tu=i(Jn);Ii=o(tu,"None"),tu.forEach(s),Di=o(qn,", this method only returns the first portion of the mask (0s)."),qn.forEach(s),Ge.forEach(s),Ri=d(O),Zs=a(O,"DIV",{class:!0});var su=i(Zs);f(ft.$$.fragment,su),su.forEach(s),O.forEach(s),mr=d(t),fe=a(t,"H2",{class:!0});var Nr=i(fe);xe=a(Nr,"A",{id:!0,class:!0,href:!0});var nu=i(xe);Xn=a(nu,"SPAN",{});var ou=i(Xn);f(gt.$$.fragment,ou),ou.forEach(s),nu.forEach(s),Wi=d(Nr),Yn=a(Nr,"SPAN",{});var ru=i(Yn);Oi=o(ru,"SqueezeBertTokenizerFast"),ru.forEach(s),Nr.forEach(s),fr=d(t),Y=a(t,"DIV",{class:!0});var Je=i(Y);f(_t.$$.fragment,Je),Ki=d(Je),zt=a(Je,"P",{});var Ir=i(zt);Hi=o(Ir,"Constructs a \u201CFast\u201D SqueezeBert tokenizer (backed by HuggingFace\u2019s "),Zn=a(Ir,"EM",{});var au=i(Zn);Qi=o(au,"tokenizers"),au.forEach(s),Ui=o(Ir," library)."),Ir.forEach(s),Vi=d(Je),Ae=a(Je,"P",{});var sr=i(Ae);en=a(sr,"A",{href:!0});var iu=i(en);Gi=o(iu,"SqueezeBertTokenizerFast"),iu.forEach(s),Ji=o(sr," is identical to "),tn=a(sr,"A",{href:!0});var lu=i(tn);Xi=o(lu,"BertTokenizerFast"),lu.forEach(s),Yi=o(sr,` and runs end-to-end tokenization: punctuation
splitting + wordpiece.`),sr.forEach(s),Zi=d(Je),bt=a(Je,"P",{});var Dr=i(bt);el=o(Dr,"Refer to superclass "),sn=a(Dr,"A",{href:!0});var du=i(sn);tl=o(du,"BertTokenizerFast"),du.forEach(s),sl=o(Dr," for usage examples and documentation concerning parameters."),Dr.forEach(s),Je.forEach(s),gr=d(t),ge=a(t,"H2",{class:!0});var Rr=i(ge);Le=a(Rr,"A",{id:!0,class:!0,href:!0});var cu=i(Le);eo=a(cu,"SPAN",{});var pu=i(eo);f(qt.$$.fragment,pu),pu.forEach(s),cu.forEach(s),nl=d(Rr),to=a(Rr,"SPAN",{});var hu=i(to);ol=o(hu,"SqueezeBertModel"),hu.forEach(s),Rr.forEach(s),_r=d(t),S=a(t,"DIV",{class:!0});var P=i(S);f(kt.$$.fragment,P),rl=d(P),so=a(P,"P",{});var uu=i(so);al=o(uu,"The bare SqueezeBERT Model transformer outputting raw hidden-states without any specific head on top."),uu.forEach(s),il=d(P),vt=a(P,"P",{});var Wr=i(vt);ll=o(Wr,"The SqueezeBERT model was proposed in "),wt=a(Wr,"A",{href:!0,rel:!0});var mu=i(wt);dl=o(mu,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),mu.forEach(s),cl=o(Wr,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Wr.forEach(s),pl=d(P),yt=a(P,"P",{});var Or=i(yt);hl=o(Or,"This model inherits from "),nn=a(Or,"A",{href:!0});var fu=i(nn);ul=o(fu,"PreTrainedModel"),fu.forEach(s),ml=o(Or,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Or.forEach(s),fl=d(P),Tt=a(P,"P",{});var Kr=i(Tt);gl=o(Kr,"This model is also a PyTorch "),St=a(Kr,"A",{href:!0,rel:!0});var gu=i(St);_l=o(gu,"torch.nn.Module"),gu.forEach(s),zl=o(Kr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kr.forEach(s),bl=d(P),Bt=a(P,"P",{});var Hr=i(Bt);ql=o(Hr,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),no=a(Hr,"EM",{});var _u=i(no);kl=o(_u,"squeezebert/squeezebert-mnli-headless"),_u.forEach(s),vl=o(Hr," checkpoint as a starting point."),Hr.forEach(s),wl=d(P),oo=a(P,"P",{});var zu=i(oo);yl=o(zu,"Hierarchy:"),zu.forEach(s),Tl=d(P),f($t.$$.fragment,P),Sl=d(P),ro=a(P,"P",{});var bu=i(ro);Bl=o(bu,"Data layouts:"),bu.forEach(s),$l=d(P),f(Et.$$.fragment,P),El=d(P),Q=a(P,"DIV",{class:!0});var re=i(Q);f(jt.$$.fragment,re),jl=d(re),_e=a(re,"P",{});var kn=i(_e);Ml=o(kn,"The "),on=a(kn,"A",{href:!0});var qu=i(on);Fl=o(qu,"SqueezeBertModel"),qu.forEach(s),Cl=o(kn," forward method, overrides the "),ao=a(kn,"CODE",{});var ku=i(ao);Pl=o(ku,"__call__"),ku.forEach(s),xl=o(kn," special method."),kn.forEach(s),Al=d(re),f(Ne.$$.fragment,re),Ll=d(re),io=a(re,"P",{});var vu=i(io);Nl=o(vu,"Example:"),vu.forEach(s),Il=d(re),f(Mt.$$.fragment,re),re.forEach(s),P.forEach(s),zr=d(t),ze=a(t,"H2",{class:!0});var Qr=i(ze);Ie=a(Qr,"A",{id:!0,class:!0,href:!0});var wu=i(Ie);lo=a(wu,"SPAN",{});var yu=i(lo);f(Ft.$$.fragment,yu),yu.forEach(s),wu.forEach(s),Dl=d(Qr),co=a(Qr,"SPAN",{});var Tu=i(co);Rl=o(Tu,"SqueezeBertForMaskedLM"),Tu.forEach(s),Qr.forEach(s),br=d(t),B=a(t,"DIV",{class:!0});var x=i(B);f(Ct.$$.fragment,x),Wl=d(x),Pt=a(x,"P",{});var Ur=i(Pt);Ol=o(Ur,"SqueezeBERT Model with a "),po=a(Ur,"CODE",{});var Su=i(po);Kl=o(Su,"language modeling"),Su.forEach(s),Hl=o(Ur," head on top."),Ur.forEach(s),Ql=d(x),xt=a(x,"P",{});var Vr=i(xt);Ul=o(Vr,"The SqueezeBERT model was proposed in "),At=a(Vr,"A",{href:!0,rel:!0});var Bu=i(At);Vl=o(Bu,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Bu.forEach(s),Gl=o(Vr,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Vr.forEach(s),Jl=d(x),Lt=a(x,"P",{});var Gr=i(Lt);Xl=o(Gr,"This model inherits from "),rn=a(Gr,"A",{href:!0});var $u=i(rn);Yl=o($u,"PreTrainedModel"),$u.forEach(s),Zl=o(Gr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Gr.forEach(s),ed=d(x),Nt=a(x,"P",{});var Jr=i(Nt);td=o(Jr,"This model is also a PyTorch "),It=a(Jr,"A",{href:!0,rel:!0});var Eu=i(It);sd=o(Eu,"torch.nn.Module"),Eu.forEach(s),nd=o(Jr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jr.forEach(s),od=d(x),Dt=a(x,"P",{});var Xr=i(Dt);rd=o(Xr,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),ho=a(Xr,"EM",{});var ju=i(ho);ad=o(ju,"squeezebert/squeezebert-mnli-headless"),ju.forEach(s),id=o(Xr," checkpoint as a starting point."),Xr.forEach(s),ld=d(x),uo=a(x,"P",{});var Mu=i(uo);dd=o(Mu,"Hierarchy:"),Mu.forEach(s),cd=d(x),f(Rt.$$.fragment,x),pd=d(x),mo=a(x,"P",{});var Fu=i(mo);hd=o(Fu,"Data layouts:"),Fu.forEach(s),ud=d(x),f(Wt.$$.fragment,x),md=d(x),U=a(x,"DIV",{class:!0});var ae=i(U);f(Ot.$$.fragment,ae),fd=d(ae),be=a(ae,"P",{});var vn=i(be);gd=o(vn,"The "),an=a(vn,"A",{href:!0});var Cu=i(an);_d=o(Cu,"SqueezeBertForMaskedLM"),Cu.forEach(s),zd=o(vn," forward method, overrides the "),fo=a(vn,"CODE",{});var Pu=i(fo);bd=o(Pu,"__call__"),Pu.forEach(s),qd=o(vn," special method."),vn.forEach(s),kd=d(ae),f(De.$$.fragment,ae),vd=d(ae),go=a(ae,"P",{});var xu=i(go);wd=o(xu,"Example:"),xu.forEach(s),yd=d(ae),f(Kt.$$.fragment,ae),ae.forEach(s),x.forEach(s),qr=d(t),qe=a(t,"H2",{class:!0});var Yr=i(qe);Re=a(Yr,"A",{id:!0,class:!0,href:!0});var Au=i(Re);_o=a(Au,"SPAN",{});var Lu=i(_o);f(Ht.$$.fragment,Lu),Lu.forEach(s),Au.forEach(s),Td=d(Yr),zo=a(Yr,"SPAN",{});var Nu=i(zo);Sd=o(Nu,"SqueezeBertForSequenceClassification"),Nu.forEach(s),Yr.forEach(s),kr=d(t),$=a(t,"DIV",{class:!0});var A=i($);f(Qt.$$.fragment,A),Bd=d(A),bo=a(A,"P",{});var Iu=i(bo);$d=o(Iu,`SqueezeBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Iu.forEach(s),Ed=d(A),Ut=a(A,"P",{});var Zr=i(Ut);jd=o(Zr,"The SqueezeBERT model was proposed in "),Vt=a(Zr,"A",{href:!0,rel:!0});var Du=i(Vt);Md=o(Du,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Du.forEach(s),Fd=o(Zr,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Zr.forEach(s),Cd=d(A),Gt=a(A,"P",{});var ea=i(Gt);Pd=o(ea,"This model inherits from "),ln=a(ea,"A",{href:!0});var Ru=i(ln);xd=o(Ru,"PreTrainedModel"),Ru.forEach(s),Ad=o(ea,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ea.forEach(s),Ld=d(A),Jt=a(A,"P",{});var ta=i(Jt);Nd=o(ta,"This model is also a PyTorch "),Xt=a(ta,"A",{href:!0,rel:!0});var Wu=i(Xt);Id=o(Wu,"torch.nn.Module"),Wu.forEach(s),Dd=o(ta,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ta.forEach(s),Rd=d(A),Yt=a(A,"P",{});var sa=i(Yt);Wd=o(sa,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),qo=a(sa,"EM",{});var Ou=i(qo);Od=o(Ou,"squeezebert/squeezebert-mnli-headless"),Ou.forEach(s),Kd=o(sa," checkpoint as a starting point."),sa.forEach(s),Hd=d(A),ko=a(A,"P",{});var Ku=i(ko);Qd=o(Ku,"Hierarchy:"),Ku.forEach(s),Ud=d(A),f(Zt.$$.fragment,A),Vd=d(A),vo=a(A,"P",{});var Hu=i(vo);Gd=o(Hu,"Data layouts:"),Hu.forEach(s),Jd=d(A),f(es.$$.fragment,A),Xd=d(A),W=a(A,"DIV",{class:!0});var X=i(W);f(ts.$$.fragment,X),Yd=d(X),ke=a(X,"P",{});var wn=i(ke);Zd=o(wn,"The "),dn=a(wn,"A",{href:!0});var Qu=i(dn);ec=o(Qu,"SqueezeBertForSequenceClassification"),Qu.forEach(s),tc=o(wn," forward method, overrides the "),wo=a(wn,"CODE",{});var Uu=i(wo);sc=o(Uu,"__call__"),Uu.forEach(s),nc=o(wn," special method."),wn.forEach(s),oc=d(X),f(We.$$.fragment,X),rc=d(X),yo=a(X,"P",{});var Vu=i(yo);ac=o(Vu,"Example of single-label classification:"),Vu.forEach(s),ic=d(X),f(ss.$$.fragment,X),lc=d(X),To=a(X,"P",{});var Gu=i(To);dc=o(Gu,"Example of multi-label classification:"),Gu.forEach(s),cc=d(X),f(ns.$$.fragment,X),X.forEach(s),A.forEach(s),vr=d(t),ve=a(t,"H2",{class:!0});var na=i(ve);Oe=a(na,"A",{id:!0,class:!0,href:!0});var Ju=i(Oe);So=a(Ju,"SPAN",{});var Xu=i(So);f(os.$$.fragment,Xu),Xu.forEach(s),Ju.forEach(s),pc=d(na),Bo=a(na,"SPAN",{});var Yu=i(Bo);hc=o(Yu,"SqueezeBertForMultipleChoice"),Yu.forEach(s),na.forEach(s),wr=d(t),E=a(t,"DIV",{class:!0});var L=i(E);f(rs.$$.fragment,L),uc=d(L),$o=a(L,"P",{});var Zu=i($o);mc=o(Zu,`SqueezeBERT Model with a multiple choice classification head on top (a linear layer on top of the pooled output and
a softmax) e.g. for RocStories/SWAG tasks.`),Zu.forEach(s),fc=d(L),as=a(L,"P",{});var oa=i(as);gc=o(oa,"The SqueezeBERT model was proposed in "),is=a(oa,"A",{href:!0,rel:!0});var em=i(is);_c=o(em,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),em.forEach(s),zc=o(oa,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),oa.forEach(s),bc=d(L),ls=a(L,"P",{});var ra=i(ls);qc=o(ra,"This model inherits from "),cn=a(ra,"A",{href:!0});var tm=i(cn);kc=o(tm,"PreTrainedModel"),tm.forEach(s),vc=o(ra,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ra.forEach(s),wc=d(L),ds=a(L,"P",{});var aa=i(ds);yc=o(aa,"This model is also a PyTorch "),cs=a(aa,"A",{href:!0,rel:!0});var sm=i(cs);Tc=o(sm,"torch.nn.Module"),sm.forEach(s),Sc=o(aa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),aa.forEach(s),Bc=d(L),ps=a(L,"P",{});var ia=i(ps);$c=o(ia,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Eo=a(ia,"EM",{});var nm=i(Eo);Ec=o(nm,"squeezebert/squeezebert-mnli-headless"),nm.forEach(s),jc=o(ia," checkpoint as a starting point."),ia.forEach(s),Mc=d(L),jo=a(L,"P",{});var om=i(jo);Fc=o(om,"Hierarchy:"),om.forEach(s),Cc=d(L),f(hs.$$.fragment,L),Pc=d(L),Mo=a(L,"P",{});var rm=i(Mo);xc=o(rm,"Data layouts:"),rm.forEach(s),Ac=d(L),f(us.$$.fragment,L),Lc=d(L),V=a(L,"DIV",{class:!0});var ie=i(V);f(ms.$$.fragment,ie),Nc=d(ie),we=a(ie,"P",{});var yn=i(we);Ic=o(yn,"The "),pn=a(yn,"A",{href:!0});var am=i(pn);Dc=o(am,"SqueezeBertForMultipleChoice"),am.forEach(s),Rc=o(yn," forward method, overrides the "),Fo=a(yn,"CODE",{});var im=i(Fo);Wc=o(im,"__call__"),im.forEach(s),Oc=o(yn," special method."),yn.forEach(s),Kc=d(ie),f(Ke.$$.fragment,ie),Hc=d(ie),Co=a(ie,"P",{});var lm=i(Co);Qc=o(lm,"Example:"),lm.forEach(s),Uc=d(ie),f(fs.$$.fragment,ie),ie.forEach(s),L.forEach(s),yr=d(t),ye=a(t,"H2",{class:!0});var la=i(ye);He=a(la,"A",{id:!0,class:!0,href:!0});var dm=i(He);Po=a(dm,"SPAN",{});var cm=i(Po);f(gs.$$.fragment,cm),cm.forEach(s),dm.forEach(s),Vc=d(la),xo=a(la,"SPAN",{});var pm=i(xo);Gc=o(pm,"SqueezeBertForTokenClassification"),pm.forEach(s),la.forEach(s),Tr=d(t),j=a(t,"DIV",{class:!0});var N=i(j);f(_s.$$.fragment,N),Jc=d(N),Ao=a(N,"P",{});var hm=i(Ao);Xc=o(hm,`SqueezeBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),hm.forEach(s),Yc=d(N),zs=a(N,"P",{});var da=i(zs);Zc=o(da,"The SqueezeBERT model was proposed in "),bs=a(da,"A",{href:!0,rel:!0});var um=i(bs);ep=o(um,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),um.forEach(s),tp=o(da,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),da.forEach(s),sp=d(N),qs=a(N,"P",{});var ca=i(qs);np=o(ca,"This model inherits from "),hn=a(ca,"A",{href:!0});var mm=i(hn);op=o(mm,"PreTrainedModel"),mm.forEach(s),rp=o(ca,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ca.forEach(s),ap=d(N),ks=a(N,"P",{});var pa=i(ks);ip=o(pa,"This model is also a PyTorch "),vs=a(pa,"A",{href:!0,rel:!0});var fm=i(vs);lp=o(fm,"torch.nn.Module"),fm.forEach(s),dp=o(pa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pa.forEach(s),cp=d(N),ws=a(N,"P",{});var ha=i(ws);pp=o(ha,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Lo=a(ha,"EM",{});var gm=i(Lo);hp=o(gm,"squeezebert/squeezebert-mnli-headless"),gm.forEach(s),up=o(ha," checkpoint as a starting point."),ha.forEach(s),mp=d(N),No=a(N,"P",{});var _m=i(No);fp=o(_m,"Hierarchy:"),_m.forEach(s),gp=d(N),f(ys.$$.fragment,N),_p=d(N),Io=a(N,"P",{});var zm=i(Io);zp=o(zm,"Data layouts:"),zm.forEach(s),bp=d(N),f(Ts.$$.fragment,N),qp=d(N),G=a(N,"DIV",{class:!0});var le=i(G);f(Ss.$$.fragment,le),kp=d(le),Te=a(le,"P",{});var Tn=i(Te);vp=o(Tn,"The "),un=a(Tn,"A",{href:!0});var bm=i(un);wp=o(bm,"SqueezeBertForTokenClassification"),bm.forEach(s),yp=o(Tn," forward method, overrides the "),Do=a(Tn,"CODE",{});var qm=i(Do);Tp=o(qm,"__call__"),qm.forEach(s),Sp=o(Tn," special method."),Tn.forEach(s),Bp=d(le),f(Qe.$$.fragment,le),$p=d(le),Ro=a(le,"P",{});var km=i(Ro);Ep=o(km,"Example:"),km.forEach(s),jp=d(le),f(Bs.$$.fragment,le),le.forEach(s),N.forEach(s),Sr=d(t),Se=a(t,"H2",{class:!0});var ua=i(Se);Ue=a(ua,"A",{id:!0,class:!0,href:!0});var vm=i(Ue);Wo=a(vm,"SPAN",{});var wm=i(Wo);f($s.$$.fragment,wm),wm.forEach(s),vm.forEach(s),Mp=d(ua),Oo=a(ua,"SPAN",{});var ym=i(Oo);Fp=o(ym,"SqueezeBertForQuestionAnswering"),ym.forEach(s),ua.forEach(s),Br=d(t),M=a(t,"DIV",{class:!0});var I=i(M);f(Es.$$.fragment,I),Cp=d(I),Be=a(I,"P",{});var Sn=i(Be);Pp=o(Sn,`SqueezeBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),Ko=a(Sn,"CODE",{});var Tm=i(Ko);xp=o(Tm,"span start logits"),Tm.forEach(s),Ap=o(Sn," and "),Ho=a(Sn,"CODE",{});var Sm=i(Ho);Lp=o(Sm,"span end logits"),Sm.forEach(s),Np=o(Sn,")."),Sn.forEach(s),Ip=d(I),js=a(I,"P",{});var ma=i(js);Dp=o(ma,"The SqueezeBERT model was proposed in "),Ms=a(ma,"A",{href:!0,rel:!0});var Bm=i(Ms);Rp=o(Bm,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Bm.forEach(s),Wp=o(ma,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),ma.forEach(s),Op=d(I),Fs=a(I,"P",{});var fa=i(Fs);Kp=o(fa,"This model inherits from "),mn=a(fa,"A",{href:!0});var $m=i(mn);Hp=o($m,"PreTrainedModel"),$m.forEach(s),Qp=o(fa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),fa.forEach(s),Up=d(I),Cs=a(I,"P",{});var ga=i(Cs);Vp=o(ga,"This model is also a PyTorch "),Ps=a(ga,"A",{href:!0,rel:!0});var Em=i(Ps);Gp=o(Em,"torch.nn.Module"),Em.forEach(s),Jp=o(ga,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ga.forEach(s),Xp=d(I),xs=a(I,"P",{});var _a=i(xs);Yp=o(_a,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Qo=a(_a,"EM",{});var jm=i(Qo);Zp=o(jm,"squeezebert/squeezebert-mnli-headless"),jm.forEach(s),eh=o(_a," checkpoint as a starting point."),_a.forEach(s),th=d(I),Uo=a(I,"P",{});var Mm=i(Uo);sh=o(Mm,"Hierarchy:"),Mm.forEach(s),nh=d(I),f(As.$$.fragment,I),oh=d(I),Vo=a(I,"P",{});var Fm=i(Vo);rh=o(Fm,"Data layouts:"),Fm.forEach(s),ah=d(I),f(Ls.$$.fragment,I),ih=d(I),J=a(I,"DIV",{class:!0});var de=i(J);f(Ns.$$.fragment,de),lh=d(de),$e=a(de,"P",{});var Bn=i($e);dh=o(Bn,"The "),fn=a(Bn,"A",{href:!0});var Cm=i(fn);ch=o(Cm,"SqueezeBertForQuestionAnswering"),Cm.forEach(s),ph=o(Bn," forward method, overrides the "),Go=a(Bn,"CODE",{});var Pm=i(Go);hh=o(Pm,"__call__"),Pm.forEach(s),uh=o(Bn," special method."),Bn.forEach(s),mh=d(de),f(Ve.$$.fragment,de),fh=d(de),Jo=a(de,"P",{});var xm=i(Jo);gh=o(xm,"Example:"),xm.forEach(s),_h=d(de),f(Is.$$.fragment,de),de.forEach(s),I.forEach(s),this.h()},h(){c(h,"name","hf:doc:metadata"),c(h,"content",JSON.stringify(Um)),c(w,"id","squeezebert"),c(w,"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"),c(w,"href","#squeezebert"),c(q,"class","relative group"),c(Ee,"id","overview"),c(Ee,"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"),c(Ee,"href","#overview"),c(ce,"class","relative group"),c(Ye,"href","https://arxiv.org/abs/2006.11316"),c(Ye,"rel","nofollow"),c(Ze,"href","https://blog.yani.io/filter-group-tutorial"),c(Ze,"rel","nofollow"),c(tt,"href","https://huggingface.co/forresti"),c(tt,"rel","nofollow"),c(Me,"id","transformers.SqueezeBertConfig"),c(Me,"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"),c(Me,"href","#transformers.SqueezeBertConfig"),c(pe,"class","relative group"),c(Hs,"href","/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertModel"),c(Qs,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),c(Us,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),c(K,"class","docstring"),c(Fe,"id","transformers.SqueezeBertTokenizer"),c(Fe,"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"),c(Fe,"href","#transformers.SqueezeBertTokenizer"),c(ue,"class","relative group"),c(Vs,"href","/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertTokenizer"),c(Gs,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer"),c(Js,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer"),c(oe,"class","docstring"),c(Pe,"class","docstring"),c(Z,"class","docstring"),c(Zs,"class","docstring"),c(C,"class","docstring"),c(xe,"id","transformers.SqueezeBertTokenizerFast"),c(xe,"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"),c(xe,"href","#transformers.SqueezeBertTokenizerFast"),c(fe,"class","relative group"),c(en,"href","/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertTokenizerFast"),c(tn,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizerFast"),c(sn,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizerFast"),c(Y,"class","docstring"),c(Le,"id","transformers.SqueezeBertModel"),c(Le,"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"),c(Le,"href","#transformers.SqueezeBertModel"),c(ge,"class","relative group"),c(wt,"href","https://arxiv.org/abs/2006.11316"),c(wt,"rel","nofollow"),c(nn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(St,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(St,"rel","nofollow"),c(on,"href","/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertModel"),c(Q,"class","docstring"),c(S,"class","docstring"),c(Ie,"id","transformers.SqueezeBertForMaskedLM"),c(Ie,"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"),c(Ie,"href","#transformers.SqueezeBertForMaskedLM"),c(ze,"class","relative group"),c(At,"href","https://arxiv.org/abs/2006.11316"),c(At,"rel","nofollow"),c(rn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(It,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(It,"rel","nofollow"),c(an,"href","/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertForMaskedLM"),c(U,"class","docstring"),c(B,"class","docstring"),c(Re,"id","transformers.SqueezeBertForSequenceClassification"),c(Re,"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"),c(Re,"href","#transformers.SqueezeBertForSequenceClassification"),c(qe,"class","relative group"),c(Vt,"href","https://arxiv.org/abs/2006.11316"),c(Vt,"rel","nofollow"),c(ln,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(Xt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Xt,"rel","nofollow"),c(dn,"href","/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertForSequenceClassification"),c(W,"class","docstring"),c($,"class","docstring"),c(Oe,"id","transformers.SqueezeBertForMultipleChoice"),c(Oe,"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"),c(Oe,"href","#transformers.SqueezeBertForMultipleChoice"),c(ve,"class","relative group"),c(is,"href","https://arxiv.org/abs/2006.11316"),c(is,"rel","nofollow"),c(cn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(cs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(cs,"rel","nofollow"),c(pn,"href","/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertForMultipleChoice"),c(V,"class","docstring"),c(E,"class","docstring"),c(He,"id","transformers.SqueezeBertForTokenClassification"),c(He,"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"),c(He,"href","#transformers.SqueezeBertForTokenClassification"),c(ye,"class","relative group"),c(bs,"href","https://arxiv.org/abs/2006.11316"),c(bs,"rel","nofollow"),c(hn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(vs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(vs,"rel","nofollow"),c(un,"href","/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertForTokenClassification"),c(G,"class","docstring"),c(j,"class","docstring"),c(Ue,"id","transformers.SqueezeBertForQuestionAnswering"),c(Ue,"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"),c(Ue,"href","#transformers.SqueezeBertForQuestionAnswering"),c(Se,"class","relative group"),c(Ms,"href","https://arxiv.org/abs/2006.11316"),c(Ms,"rel","nofollow"),c(mn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),c(Ps,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ps,"rel","nofollow"),c(fn,"href","/docs/transformers/pr_15839/en/model_doc/squeezebert#transformers.SqueezeBertForQuestionAnswering"),c(J,"class","docstring"),c(M,"class","docstring")},m(t,p){e(document.head,h),u(t,y,p),u(t,q,p),e(q,w),e(w,T),g(v,T,null),e(q,k),e(q,F),e(F,za),u(t,nr,p),u(t,ce,p),e(ce,Ee),e(Ee,En),g(Xe,En,null),e(ce,ba),e(ce,jn),e(jn,qa),u(t,or,p),u(t,se,p),e(se,ka),e(se,Ye),e(Ye,va),e(se,wa),e(se,Ze),e(Ze,ya),e(se,Ta),u(t,rr,p),u(t,Ws,p),e(Ws,Sa),u(t,ar,p),u(t,Os,p),e(Os,Mn),e(Mn,Ba),u(t,ir,p),u(t,Ks,p),e(Ks,$a),u(t,lr,p),u(t,ne,p),e(ne,Fn),e(Fn,Ea),e(ne,ja),e(ne,Cn),e(Cn,Ma),e(ne,Fa),e(ne,et),e(et,Ca),e(et,Pn),e(Pn,Pa),e(et,xa),u(t,dr,p),u(t,je,p),e(je,Aa),e(je,tt),e(tt,La),e(je,Na),u(t,cr,p),u(t,pe,p),e(pe,Me),e(Me,xn),g(st,xn,null),e(pe,Ia),e(pe,An),e(An,Da),u(t,pr,p),u(t,K,p),g(nt,K,null),e(K,Ra),e(K,ot),e(ot,Wa),e(ot,Hs),e(Hs,Oa),e(ot,Ka),e(K,Ha),e(K,he),e(he,Qa),e(he,Qs),e(Qs,Ua),e(he,Va),e(he,Us),e(Us,Ga),e(he,Ja),e(K,Xa),e(K,Ln),e(Ln,Ya),e(K,Za),g(rt,K,null),e(K,ei),e(K,Nn),e(Nn,ti),u(t,hr,p),u(t,ue,p),e(ue,Fe),e(Fe,In),g(at,In,null),e(ue,si),e(ue,Dn),e(Dn,ni),u(t,ur,p),u(t,C,p),g(it,C,null),e(C,oi),e(C,Rn),e(Rn,ri),e(C,ai),e(C,Ce),e(Ce,Vs),e(Vs,ii),e(Ce,li),e(Ce,Gs),e(Gs,di),e(Ce,ci),e(C,pi),e(C,Wn),e(Wn,On),e(On,hi),e(C,ui),e(C,lt),e(lt,mi),e(lt,Js),e(Js,fi),e(lt,gi),e(C,_i),e(C,oe),g(dt,oe,null),e(oe,zi),e(oe,Kn),e(Kn,bi),e(oe,qi),e(oe,ct),e(ct,Xs),e(Xs,ki),e(Xs,Hn),e(Hn,vi),e(ct,wi),e(ct,Ys),e(Ys,yi),e(Ys,Qn),e(Qn,Ti),e(C,Si),e(C,Pe),g(pt,Pe,null),e(Pe,Bi),e(Pe,ht),e(ht,$i),e(ht,Un),e(Un,Ei),e(ht,ji),e(C,Mi),e(C,Z),g(ut,Z,null),e(Z,Fi),e(Z,Vn),e(Vn,Ci),e(Z,Pi),g(mt,Z,null),e(Z,xi),e(Z,me),e(me,Ai),e(me,Gn),e(Gn,Li),e(me,Ni),e(me,Jn),e(Jn,Ii),e(me,Di),e(C,Ri),e(C,Zs),g(ft,Zs,null),u(t,mr,p),u(t,fe,p),e(fe,xe),e(xe,Xn),g(gt,Xn,null),e(fe,Wi),e(fe,Yn),e(Yn,Oi),u(t,fr,p),u(t,Y,p),g(_t,Y,null),e(Y,Ki),e(Y,zt),e(zt,Hi),e(zt,Zn),e(Zn,Qi),e(zt,Ui),e(Y,Vi),e(Y,Ae),e(Ae,en),e(en,Gi),e(Ae,Ji),e(Ae,tn),e(tn,Xi),e(Ae,Yi),e(Y,Zi),e(Y,bt),e(bt,el),e(bt,sn),e(sn,tl),e(bt,sl),u(t,gr,p),u(t,ge,p),e(ge,Le),e(Le,eo),g(qt,eo,null),e(ge,nl),e(ge,to),e(to,ol),u(t,_r,p),u(t,S,p),g(kt,S,null),e(S,rl),e(S,so),e(so,al),e(S,il),e(S,vt),e(vt,ll),e(vt,wt),e(wt,dl),e(vt,cl),e(S,pl),e(S,yt),e(yt,hl),e(yt,nn),e(nn,ul),e(yt,ml),e(S,fl),e(S,Tt),e(Tt,gl),e(Tt,St),e(St,_l),e(Tt,zl),e(S,bl),e(S,Bt),e(Bt,ql),e(Bt,no),e(no,kl),e(Bt,vl),e(S,wl),e(S,oo),e(oo,yl),e(S,Tl),g($t,S,null),e(S,Sl),e(S,ro),e(ro,Bl),e(S,$l),g(Et,S,null),e(S,El),e(S,Q),g(jt,Q,null),e(Q,jl),e(Q,_e),e(_e,Ml),e(_e,on),e(on,Fl),e(_e,Cl),e(_e,ao),e(ao,Pl),e(_e,xl),e(Q,Al),g(Ne,Q,null),e(Q,Ll),e(Q,io),e(io,Nl),e(Q,Il),g(Mt,Q,null),u(t,zr,p),u(t,ze,p),e(ze,Ie),e(Ie,lo),g(Ft,lo,null),e(ze,Dl),e(ze,co),e(co,Rl),u(t,br,p),u(t,B,p),g(Ct,B,null),e(B,Wl),e(B,Pt),e(Pt,Ol),e(Pt,po),e(po,Kl),e(Pt,Hl),e(B,Ql),e(B,xt),e(xt,Ul),e(xt,At),e(At,Vl),e(xt,Gl),e(B,Jl),e(B,Lt),e(Lt,Xl),e(Lt,rn),e(rn,Yl),e(Lt,Zl),e(B,ed),e(B,Nt),e(Nt,td),e(Nt,It),e(It,sd),e(Nt,nd),e(B,od),e(B,Dt),e(Dt,rd),e(Dt,ho),e(ho,ad),e(Dt,id),e(B,ld),e(B,uo),e(uo,dd),e(B,cd),g(Rt,B,null),e(B,pd),e(B,mo),e(mo,hd),e(B,ud),g(Wt,B,null),e(B,md),e(B,U),g(Ot,U,null),e(U,fd),e(U,be),e(be,gd),e(be,an),e(an,_d),e(be,zd),e(be,fo),e(fo,bd),e(be,qd),e(U,kd),g(De,U,null),e(U,vd),e(U,go),e(go,wd),e(U,yd),g(Kt,U,null),u(t,qr,p),u(t,qe,p),e(qe,Re),e(Re,_o),g(Ht,_o,null),e(qe,Td),e(qe,zo),e(zo,Sd),u(t,kr,p),u(t,$,p),g(Qt,$,null),e($,Bd),e($,bo),e(bo,$d),e($,Ed),e($,Ut),e(Ut,jd),e(Ut,Vt),e(Vt,Md),e(Ut,Fd),e($,Cd),e($,Gt),e(Gt,Pd),e(Gt,ln),e(ln,xd),e(Gt,Ad),e($,Ld),e($,Jt),e(Jt,Nd),e(Jt,Xt),e(Xt,Id),e(Jt,Dd),e($,Rd),e($,Yt),e(Yt,Wd),e(Yt,qo),e(qo,Od),e(Yt,Kd),e($,Hd),e($,ko),e(ko,Qd),e($,Ud),g(Zt,$,null),e($,Vd),e($,vo),e(vo,Gd),e($,Jd),g(es,$,null),e($,Xd),e($,W),g(ts,W,null),e(W,Yd),e(W,ke),e(ke,Zd),e(ke,dn),e(dn,ec),e(ke,tc),e(ke,wo),e(wo,sc),e(ke,nc),e(W,oc),g(We,W,null),e(W,rc),e(W,yo),e(yo,ac),e(W,ic),g(ss,W,null),e(W,lc),e(W,To),e(To,dc),e(W,cc),g(ns,W,null),u(t,vr,p),u(t,ve,p),e(ve,Oe),e(Oe,So),g(os,So,null),e(ve,pc),e(ve,Bo),e(Bo,hc),u(t,wr,p),u(t,E,p),g(rs,E,null),e(E,uc),e(E,$o),e($o,mc),e(E,fc),e(E,as),e(as,gc),e(as,is),e(is,_c),e(as,zc),e(E,bc),e(E,ls),e(ls,qc),e(ls,cn),e(cn,kc),e(ls,vc),e(E,wc),e(E,ds),e(ds,yc),e(ds,cs),e(cs,Tc),e(ds,Sc),e(E,Bc),e(E,ps),e(ps,$c),e(ps,Eo),e(Eo,Ec),e(ps,jc),e(E,Mc),e(E,jo),e(jo,Fc),e(E,Cc),g(hs,E,null),e(E,Pc),e(E,Mo),e(Mo,xc),e(E,Ac),g(us,E,null),e(E,Lc),e(E,V),g(ms,V,null),e(V,Nc),e(V,we),e(we,Ic),e(we,pn),e(pn,Dc),e(we,Rc),e(we,Fo),e(Fo,Wc),e(we,Oc),e(V,Kc),g(Ke,V,null),e(V,Hc),e(V,Co),e(Co,Qc),e(V,Uc),g(fs,V,null),u(t,yr,p),u(t,ye,p),e(ye,He),e(He,Po),g(gs,Po,null),e(ye,Vc),e(ye,xo),e(xo,Gc),u(t,Tr,p),u(t,j,p),g(_s,j,null),e(j,Jc),e(j,Ao),e(Ao,Xc),e(j,Yc),e(j,zs),e(zs,Zc),e(zs,bs),e(bs,ep),e(zs,tp),e(j,sp),e(j,qs),e(qs,np),e(qs,hn),e(hn,op),e(qs,rp),e(j,ap),e(j,ks),e(ks,ip),e(ks,vs),e(vs,lp),e(ks,dp),e(j,cp),e(j,ws),e(ws,pp),e(ws,Lo),e(Lo,hp),e(ws,up),e(j,mp),e(j,No),e(No,fp),e(j,gp),g(ys,j,null),e(j,_p),e(j,Io),e(Io,zp),e(j,bp),g(Ts,j,null),e(j,qp),e(j,G),g(Ss,G,null),e(G,kp),e(G,Te),e(Te,vp),e(Te,un),e(un,wp),e(Te,yp),e(Te,Do),e(Do,Tp),e(Te,Sp),e(G,Bp),g(Qe,G,null),e(G,$p),e(G,Ro),e(Ro,Ep),e(G,jp),g(Bs,G,null),u(t,Sr,p),u(t,Se,p),e(Se,Ue),e(Ue,Wo),g($s,Wo,null),e(Se,Mp),e(Se,Oo),e(Oo,Fp),u(t,Br,p),u(t,M,p),g(Es,M,null),e(M,Cp),e(M,Be),e(Be,Pp),e(Be,Ko),e(Ko,xp),e(Be,Ap),e(Be,Ho),e(Ho,Lp),e(Be,Np),e(M,Ip),e(M,js),e(js,Dp),e(js,Ms),e(Ms,Rp),e(js,Wp),e(M,Op),e(M,Fs),e(Fs,Kp),e(Fs,mn),e(mn,Hp),e(Fs,Qp),e(M,Up),e(M,Cs),e(Cs,Vp),e(Cs,Ps),e(Ps,Gp),e(Cs,Jp),e(M,Xp),e(M,xs),e(xs,Yp),e(xs,Qo),e(Qo,Zp),e(xs,eh),e(M,th),e(M,Uo),e(Uo,sh),e(M,nh),g(As,M,null),e(M,oh),e(M,Vo),e(Vo,rh),e(M,ah),g(Ls,M,null),e(M,ih),e(M,J),g(Ns,J,null),e(J,lh),e(J,$e),e($e,dh),e($e,fn),e(fn,ch),e($e,ph),e($e,Go),e(Go,hh),e($e,uh),e(J,mh),g(Ve,J,null),e(J,fh),e(J,Jo),e(Jo,gh),e(J,_h),g(Is,J,null),$r=!0},p(t,[p]){const Ds={};p&2&&(Ds.$$scope={dirty:p,ctx:t}),Ne.$set(Ds);const Xo={};p&2&&(Xo.$$scope={dirty:p,ctx:t}),De.$set(Xo);const Yo={};p&2&&(Yo.$$scope={dirty:p,ctx:t}),We.$set(Yo);const Zo={};p&2&&(Zo.$$scope={dirty:p,ctx:t}),Ke.$set(Zo);const Rs={};p&2&&(Rs.$$scope={dirty:p,ctx:t}),Qe.$set(Rs);const er={};p&2&&(er.$$scope={dirty:p,ctx:t}),Ve.$set(er)},i(t){$r||(_(v.$$.fragment,t),_(Xe.$$.fragment,t),_(st.$$.fragment,t),_(nt.$$.fragment,t),_(rt.$$.fragment,t),_(at.$$.fragment,t),_(it.$$.fragment,t),_(dt.$$.fragment,t),_(pt.$$.fragment,t),_(ut.$$.fragment,t),_(mt.$$.fragment,t),_(ft.$$.fragment,t),_(gt.$$.fragment,t),_(_t.$$.fragment,t),_(qt.$$.fragment,t),_(kt.$$.fragment,t),_($t.$$.fragment,t),_(Et.$$.fragment,t),_(jt.$$.fragment,t),_(Ne.$$.fragment,t),_(Mt.$$.fragment,t),_(Ft.$$.fragment,t),_(Ct.$$.fragment,t),_(Rt.$$.fragment,t),_(Wt.$$.fragment,t),_(Ot.$$.fragment,t),_(De.$$.fragment,t),_(Kt.$$.fragment,t),_(Ht.$$.fragment,t),_(Qt.$$.fragment,t),_(Zt.$$.fragment,t),_(es.$$.fragment,t),_(ts.$$.fragment,t),_(We.$$.fragment,t),_(ss.$$.fragment,t),_(ns.$$.fragment,t),_(os.$$.fragment,t),_(rs.$$.fragment,t),_(hs.$$.fragment,t),_(us.$$.fragment,t),_(ms.$$.fragment,t),_(Ke.$$.fragment,t),_(fs.$$.fragment,t),_(gs.$$.fragment,t),_(_s.$$.fragment,t),_(ys.$$.fragment,t),_(Ts.$$.fragment,t),_(Ss.$$.fragment,t),_(Qe.$$.fragment,t),_(Bs.$$.fragment,t),_($s.$$.fragment,t),_(Es.$$.fragment,t),_(As.$$.fragment,t),_(Ls.$$.fragment,t),_(Ns.$$.fragment,t),_(Ve.$$.fragment,t),_(Is.$$.fragment,t),$r=!0)},o(t){z(v.$$.fragment,t),z(Xe.$$.fragment,t),z(st.$$.fragment,t),z(nt.$$.fragment,t),z(rt.$$.fragment,t),z(at.$$.fragment,t),z(it.$$.fragment,t),z(dt.$$.fragment,t),z(pt.$$.fragment,t),z(ut.$$.fragment,t),z(mt.$$.fragment,t),z(ft.$$.fragment,t),z(gt.$$.fragment,t),z(_t.$$.fragment,t),z(qt.$$.fragment,t),z(kt.$$.fragment,t),z($t.$$.fragment,t),z(Et.$$.fragment,t),z(jt.$$.fragment,t),z(Ne.$$.fragment,t),z(Mt.$$.fragment,t),z(Ft.$$.fragment,t),z(Ct.$$.fragment,t),z(Rt.$$.fragment,t),z(Wt.$$.fragment,t),z(Ot.$$.fragment,t),z(De.$$.fragment,t),z(Kt.$$.fragment,t),z(Ht.$$.fragment,t),z(Qt.$$.fragment,t),z(Zt.$$.fragment,t),z(es.$$.fragment,t),z(ts.$$.fragment,t),z(We.$$.fragment,t),z(ss.$$.fragment,t),z(ns.$$.fragment,t),z(os.$$.fragment,t),z(rs.$$.fragment,t),z(hs.$$.fragment,t),z(us.$$.fragment,t),z(ms.$$.fragment,t),z(Ke.$$.fragment,t),z(fs.$$.fragment,t),z(gs.$$.fragment,t),z(_s.$$.fragment,t),z(ys.$$.fragment,t),z(Ts.$$.fragment,t),z(Ss.$$.fragment,t),z(Qe.$$.fragment,t),z(Bs.$$.fragment,t),z($s.$$.fragment,t),z(Es.$$.fragment,t),z(As.$$.fragment,t),z(Ls.$$.fragment,t),z(Ns.$$.fragment,t),z(Ve.$$.fragment,t),z(Is.$$.fragment,t),$r=!1},d(t){s(h),t&&s(y),t&&s(q),b(v),t&&s(nr),t&&s(ce),b(Xe),t&&s(or),t&&s(se),t&&s(rr),t&&s(Ws),t&&s(ar),t&&s(Os),t&&s(ir),t&&s(Ks),t&&s(lr),t&&s(ne),t&&s(dr),t&&s(je),t&&s(cr),t&&s(pe),b(st),t&&s(pr),t&&s(K),b(nt),b(rt),t&&s(hr),t&&s(ue),b(at),t&&s(ur),t&&s(C),b(it),b(dt),b(pt),b(ut),b(mt),b(ft),t&&s(mr),t&&s(fe),b(gt),t&&s(fr),t&&s(Y),b(_t),t&&s(gr),t&&s(ge),b(qt),t&&s(_r),t&&s(S),b(kt),b($t),b(Et),b(jt),b(Ne),b(Mt),t&&s(zr),t&&s(ze),b(Ft),t&&s(br),t&&s(B),b(Ct),b(Rt),b(Wt),b(Ot),b(De),b(Kt),t&&s(qr),t&&s(qe),b(Ht),t&&s(kr),t&&s($),b(Qt),b(Zt),b(es),b(ts),b(We),b(ss),b(ns),t&&s(vr),t&&s(ve),b(os),t&&s(wr),t&&s(E),b(rs),b(hs),b(us),b(ms),b(Ke),b(fs),t&&s(yr),t&&s(ye),b(gs),t&&s(Tr),t&&s(j),b(_s),b(ys),b(Ts),b(Ss),b(Qe),b(Bs),t&&s(Sr),t&&s(Se),b($s),t&&s(Br),t&&s(M),b(Es),b(As),b(Ls),b(Ns),b(Ve),b(Is)}}}const Um={local:"squeezebert",sections:[{local:"overview",title:"Overview"},{local:"transformers.SqueezeBertConfig",title:"SqueezeBertConfig"},{local:"transformers.SqueezeBertTokenizer",title:"SqueezeBertTokenizer"},{local:"transformers.SqueezeBertTokenizerFast",title:"SqueezeBertTokenizerFast"},{local:"transformers.SqueezeBertModel",title:"SqueezeBertModel"},{local:"transformers.SqueezeBertForMaskedLM",title:"SqueezeBertForMaskedLM"},{local:"transformers.SqueezeBertForSequenceClassification",title:"SqueezeBertForSequenceClassification"},{local:"transformers.SqueezeBertForMultipleChoice",title:"SqueezeBertForMultipleChoice"},{local:"transformers.SqueezeBertForTokenClassification",title:"SqueezeBertForTokenClassification"},{local:"transformers.SqueezeBertForQuestionAnswering",title:"SqueezeBertForQuestionAnswering"}],title:"SqueezeBERT"};function Vm(H,h,y){let{fw:q}=h;return H.$$set=w=>{"fw"in w&&y(0,q=w.fw)},[q]}class tf extends Am{constructor(h){super();Lm(this,h,Vm,Qm,Nm,{fw:0})}}export{tf as default,Um as metadata};
