import{S as Gk,i as jk,s as Hk,e as o,k as c,w as f,t as a,M as Rk,c as n,d as r,m as l,a as s,x as g,h as i,b as d,G as t,g as p,y as h,q as u,o as _,B as b,v as Uk,L as Kk}from"../../chunks/vendor-hf-doc-builder.js";import{D as v}from"../../chunks/Docstring-hf-doc-builder.js";import{C as $1}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ce}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Yk}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Xk(Sd){let w,Ue;return w=new $1({props:{code:`completed = False
while not completed:
    _, completed = constraint.update(constraint.advance())`,highlighted:`completed = <span class="hljs-literal">False</span>
<span class="hljs-keyword">while</span> <span class="hljs-keyword">not</span> completed:
    _, completed = constraint.update(constraint.advance())`}}),{c(){f(w.$$.fragment)},l(k){g(w.$$.fragment,k)},m(k,Ne){h(w,k,Ne),Ue=!0},p:Kk,i(k){Ue||(u(w.$$.fragment,k),Ue=!0)},o(k){_(w.$$.fragment,k),Ue=!1},d(k){b(w,k)}}}function Jk(Sd){let w,Ue,k,Ne,$c,ir,sf,Tc,af,zd,y,cf,Jn,lf,df,Qn,mf,pf,Zn,ff,gf,es,hf,uf,ts,_f,bf,rs,vf,$f,os,Tf,yf,ns,kf,xf,Od,ss,Lf,qd,Ke,bt,yc,cr,wf,kc,Ef,Bd,V,Pf,as,Ff,Df,is,Sf,zf,cs,Of,qf,Id,ls,Bf,Ad,lr,Cd,We,If,xc,Af,Cf,ds,Nf,Wf,Nd,M,ms,Lc,Vf,Mf,Gf,ps,wc,jf,Hf,Rf,fs,Ec,Uf,Kf,Yf,gs,Pc,Xf,Jf,Wd,x,Qf,Fc,Zf,eg,Dc,tg,rg,Sc,og,ng,zc,sg,ag,Oc,ig,cg,qc,lg,dg,Vd,S,mg,Bc,pg,fg,Ic,gg,hg,Ac,ug,_g,Cc,bg,vg,Md,z,$g,Nc,Tg,yg,Wc,kg,xg,Vc,Lg,wg,Mc,Eg,Pg,Gd,dr,jd,vt,Fg,Gc,Dg,Sg,Hd,O,zg,jc,Og,qg,Hc,Bg,Ig,Rc,Ag,Cg,Uc,Ng,Wg,Rd,hs,Vg,Ud,Ye,$t,Kc,mr,Mg,Yc,Gg,Kd,Xe,pr,jg,Xc,Hg,Yd,Je,fr,Rg,Jc,Ug,Xd,R,gr,Kg,Qc,Yg,Xg,Tt,hr,Jg,Zc,Qg,Jd,Qe,yt,el,ur,Zg,tl,eh,Qd,Ze,_r,th,rl,rh,Zd,et,br,oh,ol,nh,em,U,vr,sh,nl,ah,ih,kt,$r,ch,sl,lh,tm,tt,xt,al,Tr,dh,il,mh,rm,rt,yr,ph,cl,fh,om,ot,kr,gh,ll,hh,nm,nt,Lt,dl,xr,uh,ml,_h,sm,st,Lr,bh,pl,vh,am,at,wr,$h,fl,Th,im,it,wt,gl,Er,yh,hl,kh,cm,Et,xh,us,Lh,wh,lm,K,Pr,Eh,ul,Ph,Fh,Pt,Fr,Dh,_l,Sh,dm,Y,Dr,zh,E,Oh,_s,qh,Bh,bs,Ih,Ah,bl,Ch,Nh,vl,$l,Wh,Vh,vs,Mh,Gh,$s,jh,Hh,Rh,Ts,Sr,mm,X,zr,Uh,Tl,Kh,Yh,Ft,Or,Xh,yl,Jh,pm,J,qr,Qh,ys,ks,Zh,eu,tu,xs,Br,fm,Q,Ir,ru,Ls,ws,ou,nu,su,Es,Ar,gm,Z,Cr,au,Ps,Fs,iu,cu,lu,Ds,Nr,hm,ee,Wr,du,Ss,zs,mu,pu,fu,Os,Vr,um,te,Mr,gu,qs,Bs,hu,uu,_u,Is,Gr,_m,re,jr,bu,As,Cs,vu,$u,Tu,Ns,Hr,bm,oe,Rr,yu,Dt,Ws,ku,xu,Ur,Lu,wu,Eu,Vs,Kr,vm,ne,Yr,Pu,St,Ms,Fu,Du,Xr,Su,zu,Ou,Gs,Jr,$m,se,Qr,qu,js,Hs,Bu,Iu,Au,Rs,Zr,Tm,ae,eo,Cu,zt,Us,Nu,Wu,to,Vu,Mu,Gu,Ks,ro,ym,ie,oo,ju,Ve,Ys,Hu,Ru,Xs,Uu,Ku,no,Yu,Xu,Ju,Js,so,km,ce,ao,Qu,Qs,Zs,Zu,e_,t_,ea,io,xm,le,co,r_,Ot,ta,o_,n_,kl,s_,a_,i_,ra,lo,Lm,de,mo,c_,G,oa,l_,d_,xl,m_,p_,Ll,f_,g_,wl,h_,u_,__,na,po,wm,me,fo,b_,El,v_,$_,qt,go,T_,Pl,y_,Em,pe,ho,k_,A,x_,sa,L_,w_,Fl,E_,P_,Dl,Sl,F_,D_,aa,S_,z_,O_,ia,uo,Pm,fe,_o,q_,zl,B_,I_,Bt,bo,A_,Ol,C_,Fm,ge,vo,N_,ca,la,W_,V_,M_,da,$o,Dm,he,To,G_,ma,pa,j_,H_,R_,fa,yo,Sm,ue,ko,U_,ga,ha,K_,Y_,X_,ua,xo,zm,_e,Lo,J_,_a,ba,Q_,Z_,eb,va,wo,Om,be,Eo,tb,$a,Ta,rb,ob,nb,ya,Po,qm,ve,Fo,sb,It,ka,ab,ib,Do,cb,lb,db,xa,So,Bm,$e,zo,mb,La,wa,pb,fb,gb,Ea,Oo,Im,Te,qo,hb,Pa,Fa,ub,_b,bb,Da,Bo,Am,ye,Io,vb,At,Sa,$b,Tb,ql,yb,kb,xb,za,Ao,Cm,ke,Co,Lb,Bl,wb,Eb,Ct,No,Pb,Il,Fb,Nm,xe,Wo,Db,P,Sb,Oa,zb,Ob,qa,qb,Bb,Al,Ib,Ab,Cl,Nl,Cb,Nb,Ba,Wb,Vb,Ia,Mb,Gb,jb,Aa,Vo,Wm,Le,Mo,Hb,Wl,Rb,Ub,Nt,Go,Kb,Vl,Yb,Vm,we,jo,Xb,Ca,Na,Jb,Qb,Zb,Wa,Ho,Mm,Ee,Ro,ev,Va,Ma,tv,rv,ov,Ga,Uo,Gm,Pe,Ko,nv,ja,Ha,sv,av,iv,Ra,Yo,jm,Fe,Xo,cv,Ua,Ka,lv,dv,mv,Ya,Jo,Hm,De,Qo,pv,Wt,Xa,fv,gv,Ml,hv,uv,_v,Ja,Zo,Rm,Se,en,bv,Qa,Za,vv,$v,Tv,ei,tn,Um,ct,Vt,Gl,rn,yv,jl,kv,Km,Mt,xv,ti,Lv,wv,Ym,ze,on,Ev,Hl,Pv,Fv,ri,nn,Xm,lt,sn,Dv,oi,an,Jm,Oe,cn,Sv,ln,zv,Rl,Ov,qv,Bv,ni,dn,Qm,qe,mn,Iv,pn,Av,Ul,Cv,Nv,Wv,si,fn,Zm,dt,Gt,Kl,gn,Vv,Yl,Mv,ep,jt,Gv,ai,jv,Hv,tp,$,hn,Rv,Xl,Uv,Kv,Jl,Yv,Xv,Ht,Jv,Ql,Qv,Zv,Rt,un,e$,Zl,t$,r$,Ut,_n,o$,ed,n$,s$,Kt,bn,a$,td,i$,c$,Yt,vn,l$,$n,d$,rd,m$,p$,f$,Xt,Tn,g$,od,h$,u$,Jt,yn,_$,nd,b$,v$,Me,kn,$$,xn,T$,sd,y$,k$,x$,ad,L$,rp,mt,Ln,w$,ii,ci,E$,P$,op,pt,wn,F$,En,D$,li,S$,z$,np,C,Pn,O$,id,q$,B$,D,Fn,I$,cd,A$,C$,ft,N$,ld,W$,V$,dd,M$,G$,j$,md,pd,H$,R$,Be,U$,fd,K$,Y$,gd,X$,J$,hd,Q$,Z$,eT,ud,tT,rT,Qt,Dn,oT,_d,nT,sp,gt,Zt,bd,Sn,sT,vd,aT,ap,N,zn,iT,ht,cT,di,lT,dT,mi,mT,pT,fT,pi,On,gT,fi,qn,ip,F,Bn,hT,gi,hi,uT,_T,bT,In,vT,An,$T,TT,yT,ui,kT,Cn,xT,LT,_i,Nn,wT,bi,Wn,cp,W,Vn,ET,vi,$i,PT,FT,DT,Ti,Mn,ST,yi,Gn,lp,ut,er,$d,jn,zT,Td,OT,dp,Ie,Hn,qT,yd,BT,IT,ki,AT,Rn,CT,mp,Ae,Un,NT,kd,WT,VT,xi,MT,Kn,GT,pp;return ir=new Ce({}),cr=new Ce({}),lr=new $1({props:{code:`from transformers import GPT2Tokenizer, GPT2LMHeadModel

tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
model = GPT2LMHeadModel.from_pretrained("gpt2")

inputs = tokenizer("Hello, my dog is cute and ", return_tensors="pt")
generation_output = model.generate(**inputs, return_dict_in_generate=True, output_scores=True)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPT2Tokenizer, GPT2LMHeadModel

tokenizer = GPT2Tokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
model = GPT2LMHeadModel.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)

inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute and &quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
generation_output = model.generate(**inputs, return_dict_in_generate=<span class="hljs-literal">True</span>, output_scores=<span class="hljs-literal">True</span>)`}}),dr=new $1({props:{code:"generation_output[:2]",highlighted:'generation_output[:<span class="hljs-number">2</span>]'}}),mr=new Ce({}),pr=new v({props:{name:"class transformers.generation.GreedySearchDecoderOnlyOutput",anchor:"transformers.generation.GreedySearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L79"}}),fr=new v({props:{name:"class transformers.generation.GreedySearchEncoderDecoderOutput",anchor:"transformers.generation.GreedySearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
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>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L175"}}),gr=new v({props:{name:"class transformers.generation.FlaxGreedySearchOutput",anchor:"transformers.generation.FlaxGreedySearchOutput",parameters:[{name:"sequences",val:": ndarray = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxGreedySearchOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L53"}}),hr=new v({props:{name:"replace",anchor:"transformers.generation.FlaxGreedySearchOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L108"}}),ur=new Ce({}),_r=new v({props:{name:"class transformers.generation.SampleDecoderOnlyOutput",anchor:"transformers.generation.SampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.SampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(num_return_sequences*batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(num_return_sequences*batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L217"}}),br=new v({props:{name:"class transformers.generation.SampleEncoderDecoderOutput",anchor:"transformers.generation.SampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.SampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape
<code>(batch_size*num_return_sequences, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
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*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L246"}}),vr=new v({props:{name:"class transformers.generation.FlaxSampleOutput",anchor:"transformers.generation.FlaxSampleOutput",parameters:[{name:"sequences",val:": ndarray = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxSampleOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L67"}}),$r=new v({props:{name:"replace",anchor:"transformers.generation.FlaxSampleOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L108"}}),Tr=new Ce({}),yr=new v({props:{name:"class transformers.generation.BeamSearchDecoderOnlyOutput",anchor:"transformers.generation.BeamSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tuple(tuple(torch.LongTensor))</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, input_ids.shape[-1])</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L289"}}),kr=new v({props:{name:"class transformers.generation.BeamSearchEncoderDecoderOutput",anchor:"transformers.generation.BeamSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tuple(tuple(torch.LongTensor))</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, max_length-1)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.attentions",description:"<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;",name:"attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
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*num_beams*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L324"}}),xr=new Ce({}),Lr=new v({props:{name:"class transformers.generation.BeamSampleDecoderOnlyOutput",anchor:"transformers.generation.BeamSampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tuple(tuple(torch.LongTensor))</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, input_ids.shape[-1])</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L375"}}),wr=new v({props:{name:"class transformers.generation.BeamSampleEncoderDecoderOutput",anchor:"transformers.generation.BeamSampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_beams, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, max_length-1)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
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*num_beams, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L410"}}),Er=new Ce({}),Pr=new v({props:{name:"class transformers.LogitsProcessor",anchor:"transformers.LogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L51"}}),Fr=new v({props:{name:"__call__",anchor:"transformers.LogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitsProcessor.__call__.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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.LogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search
kwargs &#x2014;
Additional logits processor specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L54",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Dr=new v({props:{name:"class transformers.LogitsProcessorList",anchor:"transformers.LogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L73"}}),Sr=new v({props:{name:"__call__",anchor:"transformers.LogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LogitsProcessorList.__call__.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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.LogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search
kwargs &#x2014;
Additional logits processor specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L80",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),zr=new v({props:{name:"class transformers.LogitsWarper",anchor:"transformers.LogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L62"}}),Or=new v({props:{name:"__call__",anchor:"transformers.LogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitsWarper.__call__.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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.LogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search
kwargs &#x2014;
Additional logits processor specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L65",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),qr=new v({props:{name:"class transformers.MinLengthLogitsProcessor",anchor:"transformers.MinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.MinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.MinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L96"}}),Br=new v({props:{name:"__call__",anchor:"transformers.MinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L119"}}),Ir=new v({props:{name:"class transformers.MinNewTokensLengthLogitsProcessor",anchor:"transformers.MinNewTokensLengthLogitsProcessor",parameters:[{name:"prompt_length_to_skip",val:": int"},{name:"min_new_tokens",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.MinNewTokensLengthLogitsProcessor.prompt_length_to_skip",description:`<strong>prompt_length_to_skip</strong> (<code>int</code>) &#x2014;
The input tokens length.`,name:"prompt_length_to_skip"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.min_new_tokens",description:`<strong>min_new_tokens</strong> (<code>int</code>) &#x2014;
The minimum <em>new</em> tokens length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_new_tokens"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L127"}}),Ar=new v({props:{name:"__call__",anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L153"}}),Cr=new v({props:{name:"class transformers.TemperatureLogitsWarper",anchor:"transformers.TemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.TemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
The value used to module the logits distribution.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L161"}}),Nr=new v({props:{name:"__call__",anchor:"transformers.TemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L176"}}),Wr=new v({props:{name:"class transformers.RepetitionPenaltyLogitsProcessor",anchor:"transformers.RepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"}],parametersDescription:[{anchor:"transformers.RepetitionPenaltyLogitsProcessor.repetition_penalty",description:`<strong>repetition_penalty</strong> (<code>float</code>) &#x2014;
The parameter for repetition penalty. 1.0 means no penalty. See <a href="https://arxiv.org/pdf/1909.05858.pdf" rel="nofollow">this
paper</a> for more details.`,name:"repetition_penalty"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L181"}}),Vr=new v({props:{name:"__call__",anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L197"}}),Mr=new v({props:{name:"class transformers.TopPLogitsWarper",anchor:"transformers.TopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.TopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L235"}}),Gr=new v({props:{name:"__call__",anchor:"transformers.TopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L258"}}),jr=new v({props:{name:"class transformers.TopKLogitsWarper",anchor:"transformers.TopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.TopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L274"}}),Hr=new v({props:{name:"__call__",anchor:"transformers.TopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L294"}}),Rr=new v({props:{name:"class transformers.TypicalLogitsWarper",anchor:"transformers.TypicalLogitsWarper",parameters:[{name:"mass",val:": float = 0.9"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TypicalLogitsWarper.mass",description:`<strong>mass</strong> (<code>float</code>) &#x2014;
Value of typical_p between 0 and 1 inclusive, defaults to 0.9.`,name:"mass"},{anchor:"transformers.TypicalLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TypicalLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L302"}}),Kr=new v({props:{name:"__call__",anchor:"transformers.TypicalLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L325"}}),Yr=new v({props:{name:"class transformers.NoRepeatNGramLogitsProcessor",anchor:"transformers.NoRepeatNGramLogitsProcessor",parameters:[{name:"ngram_size",val:": int"}],parametersDescription:[{anchor:"transformers.NoRepeatNGramLogitsProcessor.ngram_size",description:`<strong>ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur once.`,name:"ngram_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L469"}}),Jr=new v({props:{name:"__call__",anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L484"}}),Qr=new v({props:{name:"class transformers.NoBadWordsLogitsProcessor",anchor:"transformers.NoBadWordsLogitsProcessor",parameters:[{name:"bad_words_ids",val:": typing.List[typing.List[int]]"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.NoBadWordsLogitsProcessor.bad_words_ids",description:`<strong>bad_words_ids</strong> (<code>List[List[int]]</code>) &#x2014;
List of list of token ids that are not allowed to be generated. In order to get the token ids of the words
that should not appear in the generated text, use <code>tokenizer(bad_words, add_prefix_space=True, add_special_tokens=False).input_ids</code>.`,name:"bad_words_ids"},{anchor:"transformers.NoBadWordsLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L536"}}),Zr=new v({props:{name:"__call__",anchor:"transformers.NoBadWordsLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L584"}}),eo=new v({props:{name:"class transformers.PrefixConstrainedLogitsProcessor",anchor:"transformers.PrefixConstrainedLogitsProcessor",parameters:[{name:"prefix_allowed_tokens_fn",val:": typing.Callable[[int, torch.Tensor], typing.List[int]]"},{name:"num_beams",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L670"}}),ro=new v({props:{name:"__call__",anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L687"}}),oo=new v({props:{name:"class transformers.HammingDiversityLogitsProcessor",anchor:"transformers.HammingDiversityLogitsProcessor",parameters:[{name:"diversity_penalty",val:": float"},{name:"num_beams",val:": int"},{name:"num_beam_groups",val:": int"}],parametersDescription:[{anchor:"transformers.HammingDiversityLogitsProcessor.diversity_penalty",description:`<strong>diversity_penalty</strong> (<code>float</code>) &#x2014;
This value is subtracted from a beam&#x2019;s score if it generates a token same as any beam from other group at a
particular time. Note that <code>diversity_penalty</code> is only effective if <code>group beam search</code> is enabled.`,name:"diversity_penalty"},{anchor:"transformers.HammingDiversityLogitsProcessor.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams used for group beam search. See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more
details.`,name:"num_beams"},{anchor:"transformers.HammingDiversityLogitsProcessor.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L696"}}),so=new v({props:{name:"__call__",anchor:"transformers.HammingDiversityLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"current_tokens",val:": LongTensor"},{name:"beam_group_idx",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L727"}}),ao=new v({props:{name:"class transformers.ForcedBOSTokenLogitsProcessor",anchor:"transformers.ForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.ForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L756"}}),io=new v({props:{name:"__call__",anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L768"}}),co=new v({props:{name:"class transformers.ForcedEOSTokenLogitsProcessor",anchor:"transformers.ForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.ForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.ForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Optionally, use a
list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L777"}}),lo=new v({props:{name:"__call__",anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L795"}}),mo=new v({props:{name:"class transformers.InfNanRemoveLogitsProcessor",anchor:"transformers.InfNanRemoveLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L805"}}),po=new v({props:{name:"__call__",anchor:"transformers.InfNanRemoveLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L812"}}),fo=new v({props:{name:"class transformers.TFLogitsProcessor",anchor:"transformers.TFLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L53"}}),go=new v({props:{name:"__call__",anchor:"transformers.TFLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],parametersDescription:[{anchor:"transformers.TFLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.TFLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsProcessor.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.
kwargs &#x2014;
Additional logits processor specific kwargs.`,name:"cur_len"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L56",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ho=new v({props:{name:"class transformers.TFLogitsProcessorList",anchor:"transformers.TFLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L75"}}),uo=new v({props:{name:"__call__",anchor:"transformers.TFLogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.TFLogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsProcessorList.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.
kwargs &#x2014;
Additional logits processor specific kwargs.`,name:"cur_len"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L82",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),_o=new v({props:{name:"class transformers.TFLogitsWarper",anchor:"transformers.TFLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L64"}}),bo=new v({props:{name:"__call__",anchor:"transformers.TFLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],parametersDescription:[{anchor:"transformers.TFLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.TFLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsWarper.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.
kwargs &#x2014;
Additional logits processor specific kwargs.`,name:"cur_len"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L67",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),vo=new v({props:{name:"class transformers.TFTemperatureLogitsWarper",anchor:"transformers.TFTemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.TFTemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
The value used to module the logits distribution.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L98"}}),$o=new v({props:{name:"__call__",anchor:"transformers.TFTemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L113"}}),To=new v({props:{name:"class transformers.TFTopPLogitsWarper",anchor:"transformers.TFTopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TFTopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.TFTopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TFTopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L146"}}),yo=new v({props:{name:"__call__",anchor:"transformers.TFTopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L168"}}),ko=new v({props:{name:"class transformers.TFTopKLogitsWarper",anchor:"transformers.TFTopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TFTopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.TFTopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TFTopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L118"}}),xo=new v({props:{name:"__call__",anchor:"transformers.TFTopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L138"}}),Lo=new v({props:{name:"class transformers.TFMinLengthLogitsProcessor",anchor:"transformers.TFMinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFMinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.TFMinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L200"}}),wo=new v({props:{name:"__call__",anchor:"transformers.TFMinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L226"}}),Eo=new v({props:{name:"class transformers.TFNoBadWordsLogitsProcessor",anchor:"transformers.TFNoBadWordsLogitsProcessor",parameters:[{name:"bad_words_ids",val:": typing.List[typing.List[int]]"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFNoBadWordsLogitsProcessor.bad_words_ids",description:`<strong>bad_words_ids</strong> (<code>List[List[int]]</code>) &#x2014;
List of list of token ids that are not allowed to be generated. In order to get the tokens of the words
that should not appear in the generated text, use <code>tokenizer(bad_word, add_prefix_space=True).input_ids</code>.`,name:"bad_words_ids"},{anchor:"transformers.TFNoBadWordsLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L286"}}),Po=new v({props:{name:"__call__",anchor:"transformers.TFNoBadWordsLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L363"}}),Fo=new v({props:{name:"class transformers.TFNoRepeatNGramLogitsProcessor",anchor:"transformers.TFNoRepeatNGramLogitsProcessor",parameters:[{name:"ngram_size",val:": int"}],parametersDescription:[{anchor:"transformers.TFNoRepeatNGramLogitsProcessor.ngram_size",description:`<strong>ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur once.`,name:"ngram_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L384"}}),So=new v({props:{name:"__call__",anchor:"transformers.TFNoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L423"}}),zo=new v({props:{name:"class transformers.TFRepetitionPenaltyLogitsProcessor",anchor:"transformers.TFRepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"}],parametersDescription:[{anchor:"transformers.TFRepetitionPenaltyLogitsProcessor.repetition_penalty",description:`<strong>repetition_penalty</strong> (<code>float</code>) &#x2014;
The parameter for repetition penalty. 1.0 means no penalty. See <a href="https://arxiv.org/pdf/1909.05858.pdf" rel="nofollow">this
paper</a> for more details.`,name:"repetition_penalty"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L236"}}),Oo=new v({props:{name:"__call__",anchor:"transformers.TFRepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L278"}}),qo=new v({props:{name:"class transformers.TFForcedBOSTokenLogitsProcessor",anchor:"transformers.TFForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L445"}}),Bo=new v({props:{name:"__call__",anchor:"transformers.TFForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L459"}}),Io=new v({props:{name:"class transformers.TFForcedEOSTokenLogitsProcessor",anchor:"transformers.TFForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.TFForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L475"}}),Ao=new v({props:{name:"__call__",anchor:"transformers.TFForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L492"}}),Co=new v({props:{name:"class transformers.FlaxLogitsProcessor",anchor:"transformers.FlaxLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L50"}}),No=new v({props:{name:"__call__",anchor:"transformers.FlaxLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"}],parametersDescription:[{anchor:"transformers.FlaxLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.FlaxLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search
kwargs &#x2014;
Additional logits processor specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L53",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Wo=new v({props:{name:"class transformers.FlaxLogitsProcessorList",anchor:"transformers.FlaxLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L72"}}),Vo=new v({props:{name:"__call__",anchor:"transformers.FlaxLogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"},{name:"cur_len",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxLogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.FlaxLogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search
kwargs &#x2014;
Additional logits processor specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L79",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Mo=new v({props:{name:"class transformers.FlaxLogitsWarper",anchor:"transformers.FlaxLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L61"}}),Go=new v({props:{name:"__call__",anchor:"transformers.FlaxLogitsWarper.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"}],parametersDescription:[{anchor:"transformers.FlaxLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.FlaxLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search
kwargs &#x2014;
Additional logits processor specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L64",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),jo=new v({props:{name:"class transformers.FlaxTemperatureLogitsWarper",anchor:"transformers.FlaxTemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.FlaxTemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
The value used to module the logits distribution.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L95"}}),Ho=new v({props:{name:"__call__",anchor:"transformers.FlaxTemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L110"}}),Ro=new v({props:{name:"class transformers.FlaxTopPLogitsWarper",anchor:"transformers.FlaxTopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.FlaxTopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.FlaxTopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.FlaxTopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L115"}}),Uo=new v({props:{name:"__call__",anchor:"transformers.FlaxTopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L137"}}),Ko=new v({props:{name:"class transformers.FlaxTopKLogitsWarper",anchor:"transformers.FlaxTopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.FlaxTopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.FlaxTopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.FlaxTopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L157"}}),Yo=new v({props:{name:"__call__",anchor:"transformers.FlaxTopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L177"}}),Xo=new v({props:{name:"class transformers.FlaxForcedBOSTokenLogitsProcessor",anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L192"}}),Jo=new v({props:{name:"__call__",anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L204"}}),Qo=new v({props:{name:"class transformers.FlaxForcedEOSTokenLogitsProcessor",anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L214"}}),Zo=new v({props:{name:"__call__",anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L229"}}),en=new v({props:{name:"class transformers.FlaxMinLengthLogitsProcessor",anchor:"transformers.FlaxMinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxMinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.FlaxMinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L239"}}),tn=new v({props:{name:"__call__",anchor:"transformers.FlaxMinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L260"}}),rn=new Ce({}),on=new v({props:{name:"class transformers.StoppingCriteria",anchor:"transformers.StoppingCriteria",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L33"}}),nn=new v({props:{name:"__call__",anchor:"transformers.StoppingCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.StoppingCriteria.__call__.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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.StoppingCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.
kwargs &#x2014;
Additional stopping criteria specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L36",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),sn=new v({props:{name:"class transformers.StoppingCriteriaList",anchor:"transformers.StoppingCriteriaList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L110"}}),an=new v({props:{name:"__call__",anchor:"transformers.StoppingCriteriaList.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.StoppingCriteriaList.__call__.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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.StoppingCriteriaList.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.
kwargs &#x2014;
Additional stopping criteria specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L111",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),cn=new v({props:{name:"class transformers.MaxLengthCriteria",anchor:"transformers.MaxLengthCriteria",parameters:[{name:"max_length",val:": int"}],parametersDescription:[{anchor:"transformers.MaxLengthCriteria.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length that the output sequence can have in number of tokens.`,name:"max_length"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L41"}}),dn=new v({props:{name:"__call__",anchor:"transformers.MaxLengthCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaxLengthCriteria.__call__.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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.MaxLengthCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.
kwargs &#x2014;
Additional stopping criteria specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L54",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),mn=new v({props:{name:"class transformers.MaxTimeCriteria",anchor:"transformers.MaxTimeCriteria",parameters:[{name:"max_time",val:": float"},{name:"initial_timestamp",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"transformers.MaxTimeCriteria.max_time",description:`<strong>max_time</strong> (<code>float</code>) &#x2014;
The maximum allowed time in seconds for the generation.`,name:"max_time"},{anchor:"transformers.MaxTimeCriteria.initial_time",description:`<strong>initial_time</strong> (<code>float</code>, <em>optional</em>, defaults to <code>time.time()</code>) &#x2014;
The start of the generation allowed time.`,name:"initial_time"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L88"}}),fn=new v({props:{name:"__call__",anchor:"transformers.MaxTimeCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaxTimeCriteria.__call__.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/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.MaxTimeCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.
kwargs &#x2014;
Additional stopping criteria specific kwargs.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L105",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),gn=new Ce({}),hn=new v({props:{name:"class transformers.Constraint",anchor:"transformers.Constraint",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L5"}}),Ht=new Yk({props:{anchor:"transformers.Constraint.example",$$slots:{default:[Xk]},$$scope:{ctx:Sd}}}),un=new v({props:{name:"advance",anchor:"transformers.Constraint.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L48",returnDescription:`
<p>Must be a tensor of a list of indexable tokens, not some integer.</p>
`,returnType:`
<p>token_ids(<code>torch.tensor</code>)</p>
`}}),_n=new v({props:{name:"copy",anchor:"transformers.Constraint.copy",parameters:[{name:"stateful",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L113",returnDescription:`
<p>The same constraint as the one being called from.</p>
`,returnType:`
<p>constraint(<code>Constraint</code>)</p>
`}}),bn=new v({props:{name:"does_advance",anchor:"transformers.Constraint.does_advance",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L60"}}),vn=new v({props:{name:"remaining",anchor:"transformers.Constraint.remaining",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L104"}}),Tn=new v({props:{name:"reset",anchor:"transformers.Constraint.reset",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L94"}}),yn=new v({props:{name:"test",anchor:"transformers.Constraint.test",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L24"}}),kn=new v({props:{name:"update",anchor:"transformers.Constraint.update",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L69",returnDescription:`
<p>Whether this constraint has become one step closer to being fulfuilled.
completed(<code>bool</code>):
Whether this constraint has been completely fulfilled by this token being generated.
reset (<code>bool</code>):
Whether this constraint has reset its progress by this token being generated.</p>
`,returnType:`
<p>stepped(<code>bool</code>)</p>
`}}),Ln=new v({props:{name:"class transformers.PhrasalConstraint",anchor:"transformers.PhrasalConstraint",parameters:[{name:"token_ids",val:": typing.List[int]"}],parametersDescription:[{anchor:"transformers.PhrasalConstraint.token_ids",description:`<strong>token_ids</strong> (<code>List[int]</code>) &#x2014;
The id of the token that must be generated by the output.`,name:"token_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L129"}}),wn=new v({props:{name:"class transformers.DisjunctiveConstraint",anchor:"transformers.DisjunctiveConstraint",parameters:[{name:"nested_token_ids",val:": typing.List[typing.List[int]]"}],parametersDescription:[{anchor:"transformers.DisjunctiveConstraint.nested_token_ids",description:"<strong>nested_token_ids</strong> (<code>List[List[int]]</code>) &#x2014; a list of words, where each word is a list of ids. This constraint",name:"nested_token_ids"},{anchor:"transformers.DisjunctiveConstraint.is",description:"<strong>is</strong> fulfilled by generating just one from the list of words. &#x2014;",name:"is"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L261"}}),Pn=new v({props:{name:"class transformers.ConstraintListState",anchor:"transformers.ConstraintListState",parameters:[{name:"constraints",val:": typing.List[transformers.generation.beam_constraints.Constraint]"}],parametersDescription:[{anchor:"transformers.ConstraintListState.constraints",description:`<strong>constraints</strong> (<code>List[Constraint]</code>) &#x2014;
A list of <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Constraint">Constraint</a> objects that must be fulfilled by the beam scorer.`,name:"constraints"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L350"}}),Fn=new v({props:{name:"advance",anchor:"transformers.ConstraintListState.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L382"}}),Dn=new v({props:{name:"reset",anchor:"transformers.ConstraintListState.reset",parameters:[{name:"token_ids",val:": typing.Optional[typing.List[int]]"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L417"}}),Sn=new Ce({}),zn=new v({props:{name:"class transformers.BeamScorer",anchor:"transformers.BeamScorer",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L88"}}),On=new v({props:{name:"process",anchor:"transformers.BeamScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeamScorer.process.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.BeamScorer.process.next_scores",description:`<strong>next_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Current scores of the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_scores"},{anchor:"transformers.BeamScorer.process.next_tokens",description:`<strong>next_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
<code>input_ids</code> of the tokens corresponding to the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_tokens"},{anchor:"transformers.BeamScorer.process.next_indices",description:`<strong>next_indices</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Beam indices indicating to which beam hypothesis the <code>next_tokens</code> correspond.`,name:"next_indices"},{anchor:"transformers.BeamScorer.process.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.BeamScorer.process.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L94",returnDescription:`
<p>A dictionary composed of the fields as defined above:</p>
<ul>
<li><strong>next_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Updated scores of all
non-finished beams.</li>
<li><strong>next_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Next tokens to be added
to the non-finished beam_hypotheses.</li>
<li><strong>next_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Beam indices
indicating to which beam the next tokens shall be added.</li>
</ul>
`,returnType:`
<p><code>UserDict</code></p>
`}}),qn=new v({props:{name:"finalize",anchor:"transformers.BeamScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeamScorer.finalize.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.BeamScorer.finalize.final_beam_scores",description:`<strong>final_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The final scores of all non-finished beams.`,name:"final_beam_scores"},{anchor:"transformers.BeamScorer.finalize.final_beam_tokens",description:`<strong>final_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The last tokens to be added to the non-finished beam_hypotheses.`,name:"final_beam_tokens"},{anchor:"transformers.BeamScorer.finalize.final_beam_indices",description:`<strong>final_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The beam indices indicating to which beam the <code>final_beam_tokens</code> shall be added.`,name:"final_beam_indices"},{anchor:"transformers.BeamScorer.finalize.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.BeamScorer.finalize.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L106",returnDescription:`
<p>The generated sequences.
The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter if all batches finished early
due to the <code>eos_token_id</code>.</p>
`,returnType:`
<p><code>torch.LongTensor</code> of shape <code>(batch_size * num_return_sequences, sequence_length)</code></p>
`}}),Bn=new v({props:{name:"class transformers.BeamSearchScorer",anchor:"transformers.BeamSearchScorer",parameters:[{name:"batch_size",val:": int"},{name:"num_beams",val:": int"},{name:"device",val:": device"},{name:"length_penalty",val:": typing.Optional[float] = 1.0"},{name:"do_early_stopping",val:": typing.Optional[bool] = False"},{name:"num_beam_hyps_to_keep",val:": typing.Optional[int] = 1"},{name:"num_beam_groups",val:": typing.Optional[int] = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeamSearchScorer.batch_size",description:`<strong>batch_size</strong> (<code>int</code>) &#x2014;
Batch Size of <code>input_ids</code> for which standard beam search decoding is run in parallel.`,name:"batch_size"},{anchor:"transformers.BeamSearchScorer.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.BeamSearchScorer.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams for beam search.`,name:"num_beams"},{anchor:"transformers.BeamSearchScorer.device",description:`<strong>device</strong> (<code>torch.device</code>) &#x2014;
Defines the device type (<em>e.g.</em>, <code>&quot;cpu&quot;</code> or <code>&quot;cuda&quot;</code>) on which this instance of <code>BeamSearchScorer</code> will be
allocated.`,name:"device"},{anchor:"transformers.BeamSearchScorer.length_penalty",description:`<strong>length_penalty</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to
the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log
likelihood of the sequence (i.e. negative), <code>length_penalty</code> &gt; 0.0 promotes longer sequences, while
<code>length_penalty</code> &lt; 0.0 encourages shorter sequences.`,name:"length_penalty"},{anchor:"transformers.BeamSearchScorer.do_early_stopping",description:`<strong>do_early_stopping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to stop the beam search when at least <code>num_beams</code> sentences are finished per batch or not.`,name:"do_early_stopping"},{anchor:"transformers.BeamSearchScorer.num_beam_hyps_to_keep",description:`<strong>num_beam_hyps_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of beam hypotheses that shall be returned upon calling
<code>~transformer.BeamSearchScorer.finalize</code>.`,name:"num_beam_hyps_to_keep"},{anchor:"transformers.BeamSearchScorer.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L120"}}),Nn=new v({props:{name:"process",anchor:"transformers.BeamSearchScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L208"}}),Wn=new v({props:{name:"finalize",anchor:"transformers.BeamSearchScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"final_beam_scores",val:": FloatTensor"},{name:"final_beam_tokens",val:": LongTensor"},{name:"final_beam_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L305"}}),Vn=new v({props:{name:"class transformers.ConstrainedBeamSearchScorer",anchor:"transformers.ConstrainedBeamSearchScorer",parameters:[{name:"batch_size",val:": int"},{name:"num_beams",val:": int"},{name:"constraints",val:": typing.List[transformers.generation.beam_constraints.Constraint]"},{name:"device",val:": device"},{name:"length_penalty",val:": typing.Optional[float] = 1.0"},{name:"do_early_stopping",val:": typing.Optional[bool] = False"},{name:"num_beam_hyps_to_keep",val:": typing.Optional[int] = 1"},{name:"num_beam_groups",val:": typing.Optional[int] = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ConstrainedBeamSearchScorer.batch_size",description:`<strong>batch_size</strong> (<code>int</code>) &#x2014;
Batch Size of <code>input_ids</code> for which standard beam search decoding is run in parallel.`,name:"batch_size"},{anchor:"transformers.ConstrainedBeamSearchScorer.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams for beam search.`,name:"num_beams"},{anchor:"transformers.ConstrainedBeamSearchScorer.constraints",description:`<strong>constraints</strong> (<code>List[Constraint]</code>) &#x2014;
A list of positive constraints represented as <code>Constraint</code> objects that must be fulfilled in the generation
output. For more information, the documentation of <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Constraint">Constraint</a> should be read.`,name:"constraints"},{anchor:"transformers.ConstrainedBeamSearchScorer.device",description:`<strong>device</strong> (<code>torch.device</code>) &#x2014;
Defines the device type (<em>e.g.</em>, <code>&quot;cpu&quot;</code> or <code>&quot;cuda&quot;</code>) on which this instance of <code>BeamSearchScorer</code> will be
allocated.`,name:"device"},{anchor:"transformers.ConstrainedBeamSearchScorer.length_penalty",description:`<strong>length_penalty</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to
the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log
likelihood of the sequence (i.e. negative), <code>length_penalty</code> &gt; 0.0 promotes longer sequences, while
<code>length_penalty</code> &lt; 0.0 encourages shorter sequences.`,name:"length_penalty"},{anchor:"transformers.ConstrainedBeamSearchScorer.do_early_stopping",description:`<strong>do_early_stopping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to stop the beam search when at least <code>num_beams</code> sentences are finished per batch or not.`,name:"do_early_stopping"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beam_hyps_to_keep",description:`<strong>num_beam_hyps_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of beam hypotheses that shall be returned upon calling
<code>~transformer.BeamSearchScorer.finalize</code>.`,name:"num_beam_hyps_to_keep"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L397"}}),Mn=new v({props:{name:"process",anchor:"transformers.ConstrainedBeamSearchScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"scores_for_all_vocab",val:": FloatTensor"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"}],parametersDescription:[{anchor:"transformers.ConstrainedBeamSearchScorer.process.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.ConstrainedBeamSearchScorer.process.next_scores",description:`<strong>next_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Current scores of the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_scores"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.next_tokens",description:`<strong>next_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
<code>input_ids</code> of the tokens corresponding to the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_tokens"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.next_indices",description:`<strong>next_indices</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Beam indices indicating to which beam hypothesis the <code>next_tokens</code> correspond.`,name:"next_indices"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.scores_for_all_vocab",description:`<strong>scores_for_all_vocab</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
The scores of all tokens in the vocabulary for each of the beam hypotheses.`,name:"scores_for_all_vocab"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L493",returnDescription:`
<p>A dictionary composed of the fields as defined above:</p>
<ul>
<li>
<p><strong>next_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Updated scores of
all
non-finished beams.</p>
</li>
<li>
<p><strong>next_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Next tokens to be
added
to the non-finished beam_hypotheses.</p>
</li>
<li>
<p><strong>next_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Beam indices
indicating to which beam the next tokens shall be added.</p>
</li>
</ul>
`,returnType:`
<p><code>UserDict</code></p>
`}}),Gn=new v({props:{name:"finalize",anchor:"transformers.ConstrainedBeamSearchScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"final_beam_scores",val:": FloatTensor"},{name:"final_beam_tokens",val:": LongTensor"},{name:"final_beam_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L778"}}),jn=new Ce({}),Hn=new v({props:{name:"transformers.top_k_top_p_filtering",anchor:"transformers.top_k_top_p_filtering",parameters:[{name:"logits",val:": FloatTensor"},{name:"top_k",val:": int = 0"},{name:"top_p",val:": float = 1.0"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.top_k_top_p_filtering.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If &gt; 0, only keep the top k tokens with highest probability (top-k filtering)`,name:"top_k"},{anchor:"transformers.top_k_top_p_filtering.top_p",description:`<strong>top_p</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
If &lt; 1.0, only keep the top tokens with cumulative probability &gt;= top_p (nucleus filtering). Nucleus
filtering is described in Holtzman et al. (<a href="http://arxiv.org/abs/1904.09751" rel="nofollow">http://arxiv.org/abs/1904.09751</a>)`,name:"top_p"},{anchor:"transformers.top_k_top_p_filtering.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimumber of tokens we keep per batch example in the output.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L3885"}}),Un=new v({props:{name:"transformers.tf_top_k_top_p_filtering",anchor:"transformers.tf_top_k_top_p_filtering",parameters:[{name:"logits",val:""},{name:"top_k",val:" = 0"},{name:"top_p",val:" = 1.0"},{name:"filter_value",val:" = -inf"},{name:"min_tokens_to_keep",val:" = 1"}],parametersDescription:[{anchor:"transformers.tf_top_k_top_p_filtering.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If &gt; 0, only keep the top k tokens with highest probability (top-k filtering)`,name:"top_k"},{anchor:"transformers.tf_top_k_top_p_filtering.top_p",description:`<strong>top_p</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
If &lt; 1.0, only keep the top tokens with cumulative probability &gt;= top_p (nucleus filtering). Nucleus
filtering is described in Holtzman et al. (<a href="http://arxiv.org/abs/1904.09751" rel="nofollow">http://arxiv.org/abs/1904.09751</a>)`,name:"top_p"},{anchor:"transformers.tf_top_k_top_p_filtering.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimumber of tokens we keep per batch example in the output.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L2683"}}),{c(){w=o("meta"),Ue=c(),k=o("h1"),Ne=o("a"),$c=o("span"),f(ir.$$.fragment),sf=c(),Tc=o("span"),af=a("Utilities for Generation"),zd=c(),y=o("p"),cf=a("This page lists all the utility functions used by "),Jn=o("a"),lf=a("generate()"),df=a(`,
`),Qn=o("a"),mf=a("greedy_search()"),pf=a(`,
`),Zn=o("a"),ff=a("contrastive_search()"),gf=a(`,
`),es=o("a"),hf=a("sample()"),uf=a(`,
`),ts=o("a"),_f=a("beam_search()"),bf=a(`,
`),rs=o("a"),vf=a("beam_sample()"),$f=a(`,
`),os=o("a"),Tf=a("group_beam_search()"),yf=a(`, and
`),ns=o("a"),kf=a("constrained_beam_search()"),xf=a("."),Od=c(),ss=o("p"),Lf=a("Most of those are only useful if you are studying the code of the generate methods in the library."),qd=c(),Ke=o("h2"),bt=o("a"),yc=o("span"),f(cr.$$.fragment),wf=c(),kc=o("span"),Ef=a("Generate Outputs"),Bd=c(),V=o("p"),Pf=a("The output of "),as=o("a"),Ff=a("generate()"),Df=a(` is an instance of a subclass of
`),is=o("a"),Sf=a("ModelOutput"),zf=a(`. This output is a data structure containing all the information returned
by `),cs=o("a"),Of=a("generate()"),qf=a(", but that can also be used as tuple or dictionary."),Id=c(),ls=o("p"),Bf=a("Here\u2019s an example:"),Ad=c(),f(lr.$$.fragment),Cd=c(),We=o("p"),If=a("The "),xc=o("code"),Af=a("generation_output"),Cf=a(" object is a "),ds=o("a"),Nf=a("GreedySearchDecoderOnlyOutput"),Wf=a(`, as we can
see in the documentation of that class below, it means it has the following attributes:`),Nd=c(),M=o("ul"),ms=o("li"),Lc=o("code"),Vf=a("sequences"),Mf=a(": the generated sequences of tokens"),Gf=c(),ps=o("li"),wc=o("code"),jf=a("scores"),Hf=a(" (optional): the prediction scores of the language modelling head, for each generation step"),Rf=c(),fs=o("li"),Ec=o("code"),Uf=a("hidden_states"),Kf=a(" (optional): the hidden states of the model, for each generation step"),Yf=c(),gs=o("li"),Pc=o("code"),Xf=a("attentions"),Jf=a(" (optional): the attention weights of the model, for each generation step"),Wd=c(),x=o("p"),Qf=a("Here we have the "),Fc=o("code"),Zf=a("scores"),eg=a(" since we passed along "),Dc=o("code"),tg=a("output_scores=True"),rg=a(", but we don\u2019t have "),Sc=o("code"),og=a("hidden_states"),ng=a(` and
`),zc=o("code"),sg=a("attentions"),ag=a(" because we didn\u2019t pass "),Oc=o("code"),ig=a("output_hidden_states=True"),cg=a(" or "),qc=o("code"),lg=a("output_attentions=True"),dg=a("."),Vd=c(),S=o("p"),mg=a(`You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you
will get `),Bc=o("code"),pg=a("None"),fg=a(". Here for instance "),Ic=o("code"),gg=a("generation_output.scores"),hg=a(` are all the generated prediction scores of the
language modeling head, and `),Ac=o("code"),ug=a("generation_output.attentions"),_g=a(" is "),Cc=o("code"),bg=a("None"),vg=a("."),Md=c(),z=o("p"),$g=a("When using our "),Nc=o("code"),Tg=a("generation_output"),yg=a(" object as a tuple, it only keeps the attributes that don\u2019t have "),Wc=o("code"),kg=a("None"),xg=a(` values.
Here, for instance, it has two elements, `),Vc=o("code"),Lg=a("loss"),wg=a(" then "),Mc=o("code"),Eg=a("logits"),Pg=a(", so"),Gd=c(),f(dr.$$.fragment),jd=c(),vt=o("p"),Fg=a("will return the tuple "),Gc=o("code"),Dg=a("(generation_output.sequences, generation_output.scores)"),Sg=a(" for instance."),Hd=c(),O=o("p"),zg=a("When using our "),jc=o("code"),Og=a("generation_output"),qg=a(" object as a dictionary, it only keeps the attributes that don\u2019t have "),Hc=o("code"),Bg=a("None"),Ig=a(`
values. Here, for instance, it has two keys that are `),Rc=o("code"),Ag=a("sequences"),Cg=a(" and "),Uc=o("code"),Ng=a("scores"),Wg=a("."),Rd=c(),hs=o("p"),Vg=a("We document here all output types."),Ud=c(),Ye=o("h3"),$t=o("a"),Kc=o("span"),f(mr.$$.fragment),Mg=c(),Yc=o("span"),Gg=a("GreedySearchOutput"),Kd=c(),Xe=o("div"),f(pr.$$.fragment),jg=c(),Xc=o("p"),Hg=a("Base class for outputs of decoder-only generation models using greedy search."),Yd=c(),Je=o("div"),f(fr.$$.fragment),Rg=c(),Jc=o("p"),Ug=a(`Base class for outputs of encoder-decoder generation models using greedy search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),Xd=c(),R=o("div"),f(gr.$$.fragment),Kg=c(),Qc=o("p"),Yg=a("Flax Base class for outputs of decoder-only generation models using greedy search."),Xg=c(),Tt=o("div"),f(hr.$$.fragment),Jg=c(),Zc=o("p"),Qg=a("\u201CReturns a new object replacing the specified fields with new values."),Jd=c(),Qe=o("h3"),yt=o("a"),el=o("span"),f(ur.$$.fragment),Zg=c(),tl=o("span"),eh=a("SampleOutput"),Qd=c(),Ze=o("div"),f(_r.$$.fragment),th=c(),rl=o("p"),rh=a("Base class for outputs of decoder-only generation models using sampling."),Zd=c(),et=o("div"),f(br.$$.fragment),oh=c(),ol=o("p"),nh=a(`Base class for outputs of encoder-decoder generation models using sampling. Hidden states and attention weights of
the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),em=c(),U=o("div"),f(vr.$$.fragment),sh=c(),nl=o("p"),ah=a("Flax Base class for outputs of decoder-only generation models using sampling."),ih=c(),kt=o("div"),f($r.$$.fragment),ch=c(),sl=o("p"),lh=a("\u201CReturns a new object replacing the specified fields with new values."),tm=c(),tt=o("h3"),xt=o("a"),al=o("span"),f(Tr.$$.fragment),dh=c(),il=o("span"),mh=a("BeamSearchOutput"),rm=c(),rt=o("div"),f(yr.$$.fragment),ph=c(),cl=o("p"),fh=a("Base class for outputs of decoder-only generation models using beam search."),om=c(),ot=o("div"),f(kr.$$.fragment),gh=c(),ll=o("p"),hh=a(`Base class for outputs of encoder-decoder generation models using beam search. Hidden states and attention weights
of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),nm=c(),nt=o("h3"),Lt=o("a"),dl=o("span"),f(xr.$$.fragment),uh=c(),ml=o("span"),_h=a("BeamSampleOutput"),sm=c(),st=o("div"),f(Lr.$$.fragment),bh=c(),pl=o("p"),vh=a("Base class for outputs of decoder-only generation models using beam sample."),am=c(),at=o("div"),f(wr.$$.fragment),$h=c(),fl=o("p"),Th=a(`Base class for outputs of encoder-decoder generation models using beam sampling. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),im=c(),it=o("h2"),wt=o("a"),gl=o("span"),f(Er.$$.fragment),yh=c(),hl=o("span"),kh=a("LogitsProcessor"),cm=c(),Et=o("p"),xh=a("A "),us=o("a"),Lh=a("LogitsProcessor"),wh=a(` can be used to modify the prediction scores of a language model head for
generation.`),lm=c(),K=o("div"),f(Pr.$$.fragment),Eh=c(),ul=o("p"),Ph=a("Abstract base class for all logit processors that can be applied during generation."),Fh=c(),Pt=o("div"),f(Fr.$$.fragment),Dh=c(),_l=o("p"),Sh=a("Torch method for processing logits."),dm=c(),Y=o("div"),f(Dr.$$.fragment),zh=c(),E=o("p"),Oh=a("This class can be used to create a list of "),_s=o("a"),qh=a("LogitsProcessor"),Bh=a(" or "),bs=o("a"),Ih=a("LogitsWarper"),Ah=a(` to subsequently process a
`),bl=o("code"),Ch=a("scores"),Nh=a(" input tensor. This class inherits from list and adds a specific "),vl=o("em"),$l=o("strong"),Wh=a("call"),Vh=a(` method to apply each
`),vs=o("a"),Mh=a("LogitsProcessor"),Gh=a(" or "),$s=o("a"),jh=a("LogitsWarper"),Hh=a(" to the inputs."),Rh=c(),Ts=o("div"),f(Sr.$$.fragment),mm=c(),X=o("div"),f(zr.$$.fragment),Uh=c(),Tl=o("p"),Kh=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),Yh=c(),Ft=o("div"),f(Or.$$.fragment),Xh=c(),yl=o("p"),Jh=a("Torch method for warping logits."),pm=c(),J=o("div"),f(qr.$$.fragment),Qh=c(),ys=o("p"),ks=o("a"),Zh=a("LogitsProcessor"),eu=a(" enforcing a min-length by setting EOS probability to 0."),tu=c(),xs=o("div"),f(Br.$$.fragment),fm=c(),Q=o("div"),f(Ir.$$.fragment),ru=c(),Ls=o("p"),ws=o("a"),ou=a("LogitsProcessor"),nu=a(" enforcing a min-length of new tokens by setting EOS (End-Of-Sequence) token probability to 0."),su=c(),Es=o("div"),f(Ar.$$.fragment),gm=c(),Z=o("div"),f(Cr.$$.fragment),au=c(),Ps=o("p"),Fs=o("a"),iu=a("LogitsWarper"),cu=a(" for temperature (exponential scaling output probability distribution)."),lu=c(),Ds=o("div"),f(Nr.$$.fragment),hm=c(),ee=o("div"),f(Wr.$$.fragment),du=c(),Ss=o("p"),zs=o("a"),mu=a("LogitsProcessor"),pu=a(" enforcing an exponential penalty on repeated sequences."),fu=c(),Os=o("div"),f(Vr.$$.fragment),um=c(),te=o("div"),f(Mr.$$.fragment),gu=c(),qs=o("p"),Bs=o("a"),hu=a("LogitsWarper"),uu=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),_u=c(),Is=o("div"),f(Gr.$$.fragment),_m=c(),re=o("div"),f(jr.$$.fragment),bu=c(),As=o("p"),Cs=o("a"),vu=a("LogitsWarper"),$u=a(" that performs top-k, i.e. restricting to the k highest probability elements."),Tu=c(),Ns=o("div"),f(Hr.$$.fragment),bm=c(),oe=o("div"),f(Rr.$$.fragment),yu=c(),Dt=o("p"),Ws=o("a"),ku=a("LogitsWarper"),xu=a(" that performs typical decoding. See "),Ur=o("a"),Lu=a(`Typical Decoding for Natural Language
Generation`),wu=a(" for more information."),Eu=c(),Vs=o("div"),f(Kr.$$.fragment),vm=c(),ne=o("div"),f(Yr.$$.fragment),Pu=c(),St=o("p"),Ms=o("a"),Fu=a("LogitsProcessor"),Du=a(` that enforces no repetition of n-grams. See
`),Xr=o("a"),Su=a("Fairseq"),zu=a("."),Ou=c(),Gs=o("div"),f(Jr.$$.fragment),$m=c(),se=o("div"),f(Qr.$$.fragment),qu=c(),js=o("p"),Hs=o("a"),Bu=a("LogitsProcessor"),Iu=a(" that enforces that specified sequences will never be sampled."),Au=c(),Rs=o("div"),f(Zr.$$.fragment),Tm=c(),ae=o("div"),f(eo.$$.fragment),Cu=c(),zt=o("p"),Us=o("a"),Nu=a("LogitsProcessor"),Wu=a(` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),to=o("a"),Vu=a("Autoregressive Entity Retrieval"),Mu=a(" for more information."),Gu=c(),Ks=o("div"),f(ro.$$.fragment),ym=c(),ie=o("div"),f(oo.$$.fragment),ju=c(),Ve=o("p"),Ys=o("a"),Hu=a("LogitsProcessor"),Ru=a(` that enforces diverse beam search. Note that this logits processor is only effective for
`),Xs=o("a"),Uu=a("PreTrainedModel.group_beam_search()"),Ku=a(". See "),no=o("a"),Yu=a(`Diverse Beam Search: Decoding Diverse Solutions from Neural Sequence
Models`),Xu=a(" for more details."),Ju=c(),Js=o("div"),f(so.$$.fragment),km=c(),ce=o("div"),f(ao.$$.fragment),Qu=c(),Qs=o("p"),Zs=o("a"),Zu=a("LogitsProcessor"),e_=a(" that enforces the specified token as the first generated token."),t_=c(),ea=o("div"),f(io.$$.fragment),xm=c(),le=o("div"),f(co.$$.fragment),r_=c(),Ot=o("p"),ta=o("a"),o_=a("LogitsProcessor"),n_=a(" that enforces the specified token as the last generated token when "),kl=o("code"),s_=a("max_length"),a_=a(" is reached."),i_=c(),ra=o("div"),f(lo.$$.fragment),Lm=c(),de=o("div"),f(mo.$$.fragment),c_=c(),G=o("p"),oa=o("a"),l_=a("LogitsProcessor"),d_=a(" that removes all "),xl=o("code"),m_=a("nan"),p_=a(" and "),Ll=o("code"),f_=a("inf"),g_=a(` values to avoid the generation method to fail. Note that using
the logits processor should only be used if necessary since it can slow down the generation method. `),wl=o("code"),h_=a("max_length"),u_=a(` is
reached.`),__=c(),na=o("div"),f(po.$$.fragment),wm=c(),me=o("div"),f(fo.$$.fragment),b_=c(),El=o("p"),v_=a("Abstract base class for all logit processors that can be applied during generation."),$_=c(),qt=o("div"),f(go.$$.fragment),T_=c(),Pl=o("p"),y_=a("TF method for processing logits."),Em=c(),pe=o("div"),f(ho.$$.fragment),k_=c(),A=o("p"),x_=a("This class can be used to create a list of "),sa=o("a"),L_=a("TFLogitsProcessor"),w_=a(" to subsequently process a "),Fl=o("code"),E_=a("scores"),P_=a(` input tensor.
This class inherits from list and adds a specific `),Dl=o("em"),Sl=o("strong"),F_=a("call"),D_=a(" method to apply each "),aa=o("a"),S_=a("TFLogitsProcessor"),z_=a(` to the
inputs.`),O_=c(),ia=o("div"),f(uo.$$.fragment),Pm=c(),fe=o("div"),f(_o.$$.fragment),q_=c(),zl=o("p"),B_=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),I_=c(),Bt=o("div"),f(bo.$$.fragment),A_=c(),Ol=o("p"),C_=a("TF method for warping logits."),Fm=c(),ge=o("div"),f(vo.$$.fragment),N_=c(),ca=o("p"),la=o("a"),W_=a("TFLogitsWarper"),V_=a(" for temperature (exponential scaling output probability distribution)."),M_=c(),da=o("div"),f($o.$$.fragment),Dm=c(),he=o("div"),f(To.$$.fragment),G_=c(),ma=o("p"),pa=o("a"),j_=a("TFLogitsWarper"),H_=a(" that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),R_=c(),fa=o("div"),f(yo.$$.fragment),Sm=c(),ue=o("div"),f(ko.$$.fragment),U_=c(),ga=o("p"),ha=o("a"),K_=a("TFLogitsWarper"),Y_=a(" that performs top-k, i.e. restricting to the k highest probability elements."),X_=c(),ua=o("div"),f(xo.$$.fragment),zm=c(),_e=o("div"),f(Lo.$$.fragment),J_=c(),_a=o("p"),ba=o("a"),Q_=a("TFLogitsProcessor"),Z_=a(" enforcing a min-length by setting EOS probability to 0."),eb=c(),va=o("div"),f(wo.$$.fragment),Om=c(),be=o("div"),f(Eo.$$.fragment),tb=c(),$a=o("p"),Ta=o("a"),rb=a("TFLogitsProcessor"),ob=a(" that enforces that specified sequences will never be sampled."),nb=c(),ya=o("div"),f(Po.$$.fragment),qm=c(),ve=o("div"),f(Fo.$$.fragment),sb=c(),It=o("p"),ka=o("a"),ab=a("TFLogitsProcessor"),ib=a(` that enforces no repetition of n-grams. See
`),Do=o("a"),cb=a("Fairseq"),lb=a("."),db=c(),xa=o("div"),f(So.$$.fragment),Bm=c(),$e=o("div"),f(zo.$$.fragment),mb=c(),La=o("p"),wa=o("a"),pb=a("TFLogitsProcessor"),fb=a(" enforcing an exponential penalty on repeated sequences."),gb=c(),Ea=o("div"),f(Oo.$$.fragment),Im=c(),Te=o("div"),f(qo.$$.fragment),hb=c(),Pa=o("p"),Fa=o("a"),ub=a("TFLogitsProcessor"),_b=a(" that enforces the specified token as the first generated token."),bb=c(),Da=o("div"),f(Bo.$$.fragment),Am=c(),ye=o("div"),f(Io.$$.fragment),vb=c(),At=o("p"),Sa=o("a"),$b=a("TFLogitsProcessor"),Tb=a(" that enforces the specified token as the last generated token when "),ql=o("code"),yb=a("max_length"),kb=a(" is reached."),xb=c(),za=o("div"),f(Ao.$$.fragment),Cm=c(),ke=o("div"),f(Co.$$.fragment),Lb=c(),Bl=o("p"),wb=a("Abstract base class for all logit processors that can be applied during generation."),Eb=c(),Ct=o("div"),f(No.$$.fragment),Pb=c(),Il=o("p"),Fb=a("Flax method for processing logits."),Nm=c(),xe=o("div"),f(Wo.$$.fragment),Db=c(),P=o("p"),Sb=a("This class can be used to create a list of "),Oa=o("a"),zb=a("FlaxLogitsProcessor"),Ob=a(" or "),qa=o("a"),qb=a("FlaxLogitsWarper"),Bb=a(` to subsequently process
a `),Al=o("code"),Ib=a("scores"),Ab=a(" input tensor. This class inherits from list and adds a specific "),Cl=o("em"),Nl=o("strong"),Cb=a("call"),Nb=a(` method to apply each
`),Ba=o("a"),Wb=a("FlaxLogitsProcessor"),Vb=a(" or "),Ia=o("a"),Mb=a("FlaxLogitsWarper"),Gb=a(" to the inputs."),jb=c(),Aa=o("div"),f(Vo.$$.fragment),Wm=c(),Le=o("div"),f(Mo.$$.fragment),Hb=c(),Wl=o("p"),Rb=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),Ub=c(),Nt=o("div"),f(Go.$$.fragment),Kb=c(),Vl=o("p"),Yb=a("Flax method for warping logits."),Vm=c(),we=o("div"),f(jo.$$.fragment),Xb=c(),Ca=o("p"),Na=o("a"),Jb=a("FlaxLogitsWarper"),Qb=a(" for temperature (exponential scaling output probability distribution)."),Zb=c(),Wa=o("div"),f(Ho.$$.fragment),Mm=c(),Ee=o("div"),f(Ro.$$.fragment),ev=c(),Va=o("p"),Ma=o("a"),tv=a("FlaxLogitsWarper"),rv=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),ov=c(),Ga=o("div"),f(Uo.$$.fragment),Gm=c(),Pe=o("div"),f(Ko.$$.fragment),nv=c(),ja=o("p"),Ha=o("a"),sv=a("FlaxLogitsWarper"),av=a(" that performs top-k, i.e. restricting to the k highest probability elements."),iv=c(),Ra=o("div"),f(Yo.$$.fragment),jm=c(),Fe=o("div"),f(Xo.$$.fragment),cv=c(),Ua=o("p"),Ka=o("a"),lv=a("FlaxLogitsProcessor"),dv=a(" that enforces the specified token as the first generated token."),mv=c(),Ya=o("div"),f(Jo.$$.fragment),Hm=c(),De=o("div"),f(Qo.$$.fragment),pv=c(),Wt=o("p"),Xa=o("a"),fv=a("FlaxLogitsProcessor"),gv=a(" that enforces the specified token as the last generated token when "),Ml=o("code"),hv=a("max_length"),uv=a(" is reached."),_v=c(),Ja=o("div"),f(Zo.$$.fragment),Rm=c(),Se=o("div"),f(en.$$.fragment),bv=c(),Qa=o("p"),Za=o("a"),vv=a("FlaxLogitsProcessor"),$v=a(" enforcing a min-length by setting EOS probability to 0."),Tv=c(),ei=o("div"),f(tn.$$.fragment),Um=c(),ct=o("h2"),Vt=o("a"),Gl=o("span"),f(rn.$$.fragment),yv=c(),jl=o("span"),kv=a("StoppingCriteria"),Km=c(),Mt=o("p"),xv=a("A "),ti=o("a"),Lv=a("StoppingCriteria"),wv=a(" can be used to change when to stop generation (other than EOS token)."),Ym=c(),ze=o("div"),f(on.$$.fragment),Ev=c(),Hl=o("p"),Pv=a("Abstract base class for all stopping criteria that can be applied during generation."),Fv=c(),ri=o("div"),f(nn.$$.fragment),Xm=c(),lt=o("div"),f(sn.$$.fragment),Dv=c(),oi=o("div"),f(an.$$.fragment),Jm=c(),Oe=o("div"),f(cn.$$.fragment),Sv=c(),ln=o("p"),zv=a("This class can be used to stop generation whenever the full generated number of tokens exceeds "),Rl=o("code"),Ov=a("max_length"),qv=a(`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),Bv=c(),ni=o("div"),f(dn.$$.fragment),Qm=c(),qe=o("div"),f(mn.$$.fragment),Iv=c(),pn=o("p"),Av=a(`This class can be used to stop generation whenever the full generation exceeds some amount of time. By default, the
time will start being counted when you initialize this function. You can override this by passing an
`),Ul=o("code"),Cv=a("initial_time"),Nv=a("."),Wv=c(),si=o("div"),f(fn.$$.fragment),Zm=c(),dt=o("h2"),Gt=o("a"),Kl=o("span"),f(gn.$$.fragment),Vv=c(),Yl=o("span"),Mv=a("Constraints"),ep=c(),jt=o("p"),Gv=a("A "),ai=o("a"),jv=a("Constraint"),Hv=a(" can be used to force the generation to include specific tokens or sequences in the output."),tp=c(),$=o("div"),f(hn.$$.fragment),Rv=c(),Xl=o("p"),Uv=a(`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),Kv=c(),Jl=o("p"),Yv=a("All classes that inherit Constraint must follow the requirement that"),Xv=c(),f(Ht.$$.fragment),Jv=c(),Ql=o("p"),Qv=a("will always terminate (halt)."),Zv=c(),Rt=o("div"),f(un.$$.fragment),e$=c(),Zl=o("p"),t$=a("When called, returns the token that would take this constraint one step closer to being fulfilled."),r$=c(),Ut=o("div"),f(_n.$$.fragment),o$=c(),ed=o("p"),n$=a("Creates a new instance of this constraint."),s$=c(),Kt=o("div"),f(bn.$$.fragment),a$=c(),td=o("p"),i$=a("Reads in a token and returns whether it creates progress."),c$=c(),Yt=o("div"),f(vn.$$.fragment),l$=c(),$n=o("p"),d$=a("Returns the number of remaining steps of "),rd=o("code"),m$=a("advance()"),p$=a(" in order to complete this constraint."),f$=c(),Xt=o("div"),f(Tn.$$.fragment),g$=c(),od=o("p"),h$=a(`Resets the state of this constraint to its initialization. We would call this in cases where the fulfillment of
a constraint is abrupted by an unwanted token.`),u$=c(),Jt=o("div"),f(yn.$$.fragment),_$=c(),nd=o("p"),b$=a("Tests whether this constraint has been properly defined."),v$=c(),Me=o("div"),f(kn.$$.fragment),$$=c(),xn=o("p"),T$=a(`Reads in a token and returns booleans that indicate the progress made by it. This function will update the
state of this object unlikes `),sd=o("code"),y$=a("does_advance(self, token_id: int)"),k$=a("."),x$=c(),ad=o("p"),L$=a(`This isn\u2019t to test whether a certain token will advance the progress; it\u2019s to update its state as if it has
been generated. This becomes important if token_id != desired token (refer to else statement in
PhrasalConstraint)`),rp=c(),mt=o("div"),f(Ln.$$.fragment),w$=c(),ii=o("p"),ci=o("a"),E$=a("Constraint"),P$=a(" enforcing that an ordered sequence of tokens is included in the output."),op=c(),pt=o("div"),f(wn.$$.fragment),F$=c(),En=o("p"),D$=a("A special "),li=o("a"),S$=a("Constraint"),z$=a(" that is fulfilled by fulfilling just one of several constraints."),np=c(),C=o("div"),f(Pn.$$.fragment),O$=c(),id=o("p"),q$=a("A class for beam scorers to track its progress through a list of constraints."),B$=c(),D=o("div"),f(Fn.$$.fragment),I$=c(),cd=o("p"),A$=a(`The list of tokens to generate such that we can make progress.
By \u201Clist\u201D we don\u2019t mean the list of token that will fully fulfill a constraint.`),C$=c(),ft=o("p"),N$=a("Given constraints "),ld=o("code"),W$=a("c_i = {t_ij | j == # of tokens}"),V$=a(`, If we\u2019re not in the middle of progressing through a
specific constraint `),dd=o("code"),M$=a("c_i"),G$=a(", we return:"),j$=c(),md=o("p"),pd=o("code"),H$=a("[t_k1 for k in indices of unfulfilled constraints]"),R$=c(),Be=o("p"),U$=a(`If we are in the middle of a constraint, then we return:
`),fd=o("code"),K$=a("[t_ij]"),Y$=a(", where "),gd=o("code"),X$=a("i"),J$=a(" is the index of the inprogress constraint, "),hd=o("code"),Q$=a("j"),Z$=a(" is the next step for the constraint."),eT=c(),ud=o("p"),tT=a(`Though we don\u2019t care which constraint is fulfilled first, if we are in the progress of fulfilling a constraint,
that\u2019s the only one we\u2019ll return.`),rT=c(),Qt=o("div"),f(Dn.$$.fragment),oT=c(),_d=o("p"),nT=a("token_ids: the tokens generated thus far to reset the state of the progress through constraints."),sp=c(),gt=o("h2"),Zt=o("a"),bd=o("span"),f(Sn.$$.fragment),sT=c(),vd=o("span"),aT=a("BeamSearch"),ap=c(),N=o("div"),f(zn.$$.fragment),iT=c(),ht=o("p"),cT=a("Abstract base class for all beam scorers that are used for "),di=o("a"),lT=a("beam_search()"),dT=a(` and
`),mi=o("a"),mT=a("beam_sample()"),pT=a("."),fT=c(),pi=o("div"),f(On.$$.fragment),gT=c(),fi=o("div"),f(qn.$$.fragment),ip=c(),F=o("div"),f(Bn.$$.fragment),hT=c(),gi=o("p"),hi=o("a"),uT=a("BeamScorer"),_T=a(" implementing standard beam search decoding."),bT=c(),In=o("p"),vT=a("Adapted in part from "),An=o("a"),$T=a(`Facebook\u2019s XLM beam search
code`),TT=a("."),yT=c(),ui=o("p"),kT=a("Reference for the diverse beam search algorithm and implementation "),Cn=o("a"),xT=a(`Ashwin Kalyan\u2019s DBS
implementation`),LT=c(),_i=o("div"),f(Nn.$$.fragment),wT=c(),bi=o("div"),f(Wn.$$.fragment),cp=c(),W=o("div"),f(Vn.$$.fragment),ET=c(),vi=o("p"),$i=o("a"),PT=a("BeamScorer"),FT=a(" implementing constrained beam search decoding."),DT=c(),Ti=o("div"),f(Mn.$$.fragment),ST=c(),yi=o("div"),f(Gn.$$.fragment),lp=c(),ut=o("h2"),er=o("a"),$d=o("span"),f(jn.$$.fragment),zT=c(),Td=o("span"),OT=a("Utilities"),dp=c(),Ie=o("div"),f(Hn.$$.fragment),qT=c(),yd=o("p"),BT=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),IT=c(),ki=o("p"),AT=a("From: "),Rn=o("a"),CT=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),mp=c(),Ae=o("div"),f(Un.$$.fragment),NT=c(),kd=o("p"),WT=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),VT=c(),xi=o("p"),MT=a("From: "),Kn=o("a"),GT=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),this.h()},l(e){const m=Rk('[data-svelte="svelte-1phssyn"]',document.head);w=n(m,"META",{name:!0,content:!0}),m.forEach(r),Ue=l(e),k=n(e,"H1",{class:!0});var Yn=s(k);Ne=n(Yn,"A",{id:!0,class:!0,href:!0});var T1=s(Ne);$c=n(T1,"SPAN",{});var y1=s($c);g(ir.$$.fragment,y1),y1.forEach(r),T1.forEach(r),sf=l(Yn),Tc=n(Yn,"SPAN",{});var k1=s(Tc);af=i(k1,"Utilities for Generation"),k1.forEach(r),Yn.forEach(r),zd=l(e),y=n(e,"P",{});var L=s(y);cf=i(L,"This page lists all the utility functions used by "),Jn=n(L,"A",{href:!0});var x1=s(Jn);lf=i(x1,"generate()"),x1.forEach(r),df=i(L,`,
`),Qn=n(L,"A",{href:!0});var L1=s(Qn);mf=i(L1,"greedy_search()"),L1.forEach(r),pf=i(L,`,
`),Zn=n(L,"A",{href:!0});var w1=s(Zn);ff=i(w1,"contrastive_search()"),w1.forEach(r),gf=i(L,`,
`),es=n(L,"A",{href:!0});var E1=s(es);hf=i(E1,"sample()"),E1.forEach(r),uf=i(L,`,
`),ts=n(L,"A",{href:!0});var P1=s(ts);_f=i(P1,"beam_search()"),P1.forEach(r),bf=i(L,`,
`),rs=n(L,"A",{href:!0});var F1=s(rs);vf=i(F1,"beam_sample()"),F1.forEach(r),$f=i(L,`,
`),os=n(L,"A",{href:!0});var D1=s(os);Tf=i(D1,"group_beam_search()"),D1.forEach(r),yf=i(L,`, and
`),ns=n(L,"A",{href:!0});var S1=s(ns);kf=i(S1,"constrained_beam_search()"),S1.forEach(r),xf=i(L,"."),L.forEach(r),Od=l(e),ss=n(e,"P",{});var z1=s(ss);Lf=i(z1,"Most of those are only useful if you are studying the code of the generate methods in the library."),z1.forEach(r),qd=l(e),Ke=n(e,"H2",{class:!0});var fp=s(Ke);bt=n(fp,"A",{id:!0,class:!0,href:!0});var O1=s(bt);yc=n(O1,"SPAN",{});var q1=s(yc);g(cr.$$.fragment,q1),q1.forEach(r),O1.forEach(r),wf=l(fp),kc=n(fp,"SPAN",{});var B1=s(kc);Ef=i(B1,"Generate Outputs"),B1.forEach(r),fp.forEach(r),Bd=l(e),V=n(e,"P",{});var tr=s(V);Pf=i(tr,"The output of "),as=n(tr,"A",{href:!0});var I1=s(as);Ff=i(I1,"generate()"),I1.forEach(r),Df=i(tr,` is an instance of a subclass of
`),is=n(tr,"A",{href:!0});var A1=s(is);Sf=i(A1,"ModelOutput"),A1.forEach(r),zf=i(tr,`. This output is a data structure containing all the information returned
by `),cs=n(tr,"A",{href:!0});var C1=s(cs);Of=i(C1,"generate()"),C1.forEach(r),qf=i(tr,", but that can also be used as tuple or dictionary."),tr.forEach(r),Id=l(e),ls=n(e,"P",{});var N1=s(ls);Bf=i(N1,"Here\u2019s an example:"),N1.forEach(r),Ad=l(e),g(lr.$$.fragment,e),Cd=l(e),We=n(e,"P",{});var Li=s(We);If=i(Li,"The "),xc=n(Li,"CODE",{});var W1=s(xc);Af=i(W1,"generation_output"),W1.forEach(r),Cf=i(Li," object is a "),ds=n(Li,"A",{href:!0});var V1=s(ds);Nf=i(V1,"GreedySearchDecoderOnlyOutput"),V1.forEach(r),Wf=i(Li,`, as we can
see in the documentation of that class below, it means it has the following attributes:`),Li.forEach(r),Nd=l(e),M=n(e,"UL",{});var rr=s(M);ms=n(rr,"LI",{});var jT=s(ms);Lc=n(jT,"CODE",{});var M1=s(Lc);Vf=i(M1,"sequences"),M1.forEach(r),Mf=i(jT,": the generated sequences of tokens"),jT.forEach(r),Gf=l(rr),ps=n(rr,"LI",{});var HT=s(ps);wc=n(HT,"CODE",{});var G1=s(wc);jf=i(G1,"scores"),G1.forEach(r),Hf=i(HT," (optional): the prediction scores of the language modelling head, for each generation step"),HT.forEach(r),Rf=l(rr),fs=n(rr,"LI",{});var RT=s(fs);Ec=n(RT,"CODE",{});var j1=s(Ec);Uf=i(j1,"hidden_states"),j1.forEach(r),Kf=i(RT," (optional): the hidden states of the model, for each generation step"),RT.forEach(r),Yf=l(rr),gs=n(rr,"LI",{});var UT=s(gs);Pc=n(UT,"CODE",{});var H1=s(Pc);Xf=i(H1,"attentions"),H1.forEach(r),Jf=i(UT," (optional): the attention weights of the model, for each generation step"),UT.forEach(r),rr.forEach(r),Wd=l(e),x=n(e,"P",{});var q=s(x);Qf=i(q,"Here we have the "),Fc=n(q,"CODE",{});var R1=s(Fc);Zf=i(R1,"scores"),R1.forEach(r),eg=i(q," since we passed along "),Dc=n(q,"CODE",{});var U1=s(Dc);tg=i(U1,"output_scores=True"),U1.forEach(r),rg=i(q,", but we don\u2019t have "),Sc=n(q,"CODE",{});var K1=s(Sc);og=i(K1,"hidden_states"),K1.forEach(r),ng=i(q,` and
`),zc=n(q,"CODE",{});var Y1=s(zc);sg=i(Y1,"attentions"),Y1.forEach(r),ag=i(q," because we didn\u2019t pass "),Oc=n(q,"CODE",{});var X1=s(Oc);ig=i(X1,"output_hidden_states=True"),X1.forEach(r),cg=i(q," or "),qc=n(q,"CODE",{});var J1=s(qc);lg=i(J1,"output_attentions=True"),J1.forEach(r),dg=i(q,"."),q.forEach(r),Vd=l(e),S=n(e,"P",{});var Ge=s(S);mg=i(Ge,`You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you
will get `),Bc=n(Ge,"CODE",{});var Q1=s(Bc);pg=i(Q1,"None"),Q1.forEach(r),fg=i(Ge,". Here for instance "),Ic=n(Ge,"CODE",{});var Z1=s(Ic);gg=i(Z1,"generation_output.scores"),Z1.forEach(r),hg=i(Ge,` are all the generated prediction scores of the
language modeling head, and `),Ac=n(Ge,"CODE",{});var e2=s(Ac);ug=i(e2,"generation_output.attentions"),e2.forEach(r),_g=i(Ge," is "),Cc=n(Ge,"CODE",{});var t2=s(Cc);bg=i(t2,"None"),t2.forEach(r),vg=i(Ge,"."),Ge.forEach(r),Md=l(e),z=n(e,"P",{});var je=s(z);$g=i(je,"When using our "),Nc=n(je,"CODE",{});var r2=s(Nc);Tg=i(r2,"generation_output"),r2.forEach(r),yg=i(je," object as a tuple, it only keeps the attributes that don\u2019t have "),Wc=n(je,"CODE",{});var o2=s(Wc);kg=i(o2,"None"),o2.forEach(r),xg=i(je,` values.
Here, for instance, it has two elements, `),Vc=n(je,"CODE",{});var n2=s(Vc);Lg=i(n2,"loss"),n2.forEach(r),wg=i(je," then "),Mc=n(je,"CODE",{});var s2=s(Mc);Eg=i(s2,"logits"),s2.forEach(r),Pg=i(je,", so"),je.forEach(r),Gd=l(e),g(dr.$$.fragment,e),jd=l(e),vt=n(e,"P",{});var gp=s(vt);Fg=i(gp,"will return the tuple "),Gc=n(gp,"CODE",{});var a2=s(Gc);Dg=i(a2,"(generation_output.sequences, generation_output.scores)"),a2.forEach(r),Sg=i(gp," for instance."),gp.forEach(r),Hd=l(e),O=n(e,"P",{});var He=s(O);zg=i(He,"When using our "),jc=n(He,"CODE",{});var i2=s(jc);Og=i(i2,"generation_output"),i2.forEach(r),qg=i(He," object as a dictionary, it only keeps the attributes that don\u2019t have "),Hc=n(He,"CODE",{});var c2=s(Hc);Bg=i(c2,"None"),c2.forEach(r),Ig=i(He,`
values. Here, for instance, it has two keys that are `),Rc=n(He,"CODE",{});var l2=s(Rc);Ag=i(l2,"sequences"),l2.forEach(r),Cg=i(He," and "),Uc=n(He,"CODE",{});var d2=s(Uc);Ng=i(d2,"scores"),d2.forEach(r),Wg=i(He,"."),He.forEach(r),Rd=l(e),hs=n(e,"P",{});var m2=s(hs);Vg=i(m2,"We document here all output types."),m2.forEach(r),Ud=l(e),Ye=n(e,"H3",{class:!0});var hp=s(Ye);$t=n(hp,"A",{id:!0,class:!0,href:!0});var p2=s($t);Kc=n(p2,"SPAN",{});var f2=s(Kc);g(mr.$$.fragment,f2),f2.forEach(r),p2.forEach(r),Mg=l(hp),Yc=n(hp,"SPAN",{});var g2=s(Yc);Gg=i(g2,"GreedySearchOutput"),g2.forEach(r),hp.forEach(r),Kd=l(e),Xe=n(e,"DIV",{class:!0});var up=s(Xe);g(pr.$$.fragment,up),jg=l(up),Xc=n(up,"P",{});var h2=s(Xc);Hg=i(h2,"Base class for outputs of decoder-only generation models using greedy search."),h2.forEach(r),up.forEach(r),Yd=l(e),Je=n(e,"DIV",{class:!0});var _p=s(Je);g(fr.$$.fragment,_p),Rg=l(_p),Jc=n(_p,"P",{});var u2=s(Jc);Ug=i(u2,`Base class for outputs of encoder-decoder generation models using greedy search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),u2.forEach(r),_p.forEach(r),Xd=l(e),R=n(e,"DIV",{class:!0});var wi=s(R);g(gr.$$.fragment,wi),Kg=l(wi),Qc=n(wi,"P",{});var _2=s(Qc);Yg=i(_2,"Flax Base class for outputs of decoder-only generation models using greedy search."),_2.forEach(r),Xg=l(wi),Tt=n(wi,"DIV",{class:!0});var bp=s(Tt);g(hr.$$.fragment,bp),Jg=l(bp),Zc=n(bp,"P",{});var b2=s(Zc);Qg=i(b2,"\u201CReturns a new object replacing the specified fields with new values."),b2.forEach(r),bp.forEach(r),wi.forEach(r),Jd=l(e),Qe=n(e,"H3",{class:!0});var vp=s(Qe);yt=n(vp,"A",{id:!0,class:!0,href:!0});var v2=s(yt);el=n(v2,"SPAN",{});var $2=s(el);g(ur.$$.fragment,$2),$2.forEach(r),v2.forEach(r),Zg=l(vp),tl=n(vp,"SPAN",{});var T2=s(tl);eh=i(T2,"SampleOutput"),T2.forEach(r),vp.forEach(r),Qd=l(e),Ze=n(e,"DIV",{class:!0});var $p=s(Ze);g(_r.$$.fragment,$p),th=l($p),rl=n($p,"P",{});var y2=s(rl);rh=i(y2,"Base class for outputs of decoder-only generation models using sampling."),y2.forEach(r),$p.forEach(r),Zd=l(e),et=n(e,"DIV",{class:!0});var Tp=s(et);g(br.$$.fragment,Tp),oh=l(Tp),ol=n(Tp,"P",{});var k2=s(ol);nh=i(k2,`Base class for outputs of encoder-decoder generation models using sampling. Hidden states and attention weights of
the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),k2.forEach(r),Tp.forEach(r),em=l(e),U=n(e,"DIV",{class:!0});var Ei=s(U);g(vr.$$.fragment,Ei),sh=l(Ei),nl=n(Ei,"P",{});var x2=s(nl);ah=i(x2,"Flax Base class for outputs of decoder-only generation models using sampling."),x2.forEach(r),ih=l(Ei),kt=n(Ei,"DIV",{class:!0});var yp=s(kt);g($r.$$.fragment,yp),ch=l(yp),sl=n(yp,"P",{});var L2=s(sl);lh=i(L2,"\u201CReturns a new object replacing the specified fields with new values."),L2.forEach(r),yp.forEach(r),Ei.forEach(r),tm=l(e),tt=n(e,"H3",{class:!0});var kp=s(tt);xt=n(kp,"A",{id:!0,class:!0,href:!0});var w2=s(xt);al=n(w2,"SPAN",{});var E2=s(al);g(Tr.$$.fragment,E2),E2.forEach(r),w2.forEach(r),dh=l(kp),il=n(kp,"SPAN",{});var P2=s(il);mh=i(P2,"BeamSearchOutput"),P2.forEach(r),kp.forEach(r),rm=l(e),rt=n(e,"DIV",{class:!0});var xp=s(rt);g(yr.$$.fragment,xp),ph=l(xp),cl=n(xp,"P",{});var F2=s(cl);fh=i(F2,"Base class for outputs of decoder-only generation models using beam search."),F2.forEach(r),xp.forEach(r),om=l(e),ot=n(e,"DIV",{class:!0});var Lp=s(ot);g(kr.$$.fragment,Lp),gh=l(Lp),ll=n(Lp,"P",{});var D2=s(ll);hh=i(D2,`Base class for outputs of encoder-decoder generation models using beam search. Hidden states and attention weights
of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),D2.forEach(r),Lp.forEach(r),nm=l(e),nt=n(e,"H3",{class:!0});var wp=s(nt);Lt=n(wp,"A",{id:!0,class:!0,href:!0});var S2=s(Lt);dl=n(S2,"SPAN",{});var z2=s(dl);g(xr.$$.fragment,z2),z2.forEach(r),S2.forEach(r),uh=l(wp),ml=n(wp,"SPAN",{});var O2=s(ml);_h=i(O2,"BeamSampleOutput"),O2.forEach(r),wp.forEach(r),sm=l(e),st=n(e,"DIV",{class:!0});var Ep=s(st);g(Lr.$$.fragment,Ep),bh=l(Ep),pl=n(Ep,"P",{});var q2=s(pl);vh=i(q2,"Base class for outputs of decoder-only generation models using beam sample."),q2.forEach(r),Ep.forEach(r),am=l(e),at=n(e,"DIV",{class:!0});var Pp=s(at);g(wr.$$.fragment,Pp),$h=l(Pp),fl=n(Pp,"P",{});var B2=s(fl);Th=i(B2,`Base class for outputs of encoder-decoder generation models using beam sampling. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),B2.forEach(r),Pp.forEach(r),im=l(e),it=n(e,"H2",{class:!0});var Fp=s(it);wt=n(Fp,"A",{id:!0,class:!0,href:!0});var I2=s(wt);gl=n(I2,"SPAN",{});var A2=s(gl);g(Er.$$.fragment,A2),A2.forEach(r),I2.forEach(r),yh=l(Fp),hl=n(Fp,"SPAN",{});var C2=s(hl);kh=i(C2,"LogitsProcessor"),C2.forEach(r),Fp.forEach(r),cm=l(e),Et=n(e,"P",{});var Dp=s(Et);xh=i(Dp,"A "),us=n(Dp,"A",{href:!0});var N2=s(us);Lh=i(N2,"LogitsProcessor"),N2.forEach(r),wh=i(Dp,` can be used to modify the prediction scores of a language model head for
generation.`),Dp.forEach(r),lm=l(e),K=n(e,"DIV",{class:!0});var Pi=s(K);g(Pr.$$.fragment,Pi),Eh=l(Pi),ul=n(Pi,"P",{});var W2=s(ul);Ph=i(W2,"Abstract base class for all logit processors that can be applied during generation."),W2.forEach(r),Fh=l(Pi),Pt=n(Pi,"DIV",{class:!0});var Sp=s(Pt);g(Fr.$$.fragment,Sp),Dh=l(Sp),_l=n(Sp,"P",{});var V2=s(_l);Sh=i(V2,"Torch method for processing logits."),V2.forEach(r),Sp.forEach(r),Pi.forEach(r),dm=l(e),Y=n(e,"DIV",{class:!0});var Fi=s(Y);g(Dr.$$.fragment,Fi),zh=l(Fi),E=n(Fi,"P",{});var B=s(E);Oh=i(B,"This class can be used to create a list of "),_s=n(B,"A",{href:!0});var M2=s(_s);qh=i(M2,"LogitsProcessor"),M2.forEach(r),Bh=i(B," or "),bs=n(B,"A",{href:!0});var G2=s(bs);Ih=i(G2,"LogitsWarper"),G2.forEach(r),Ah=i(B,` to subsequently process a
`),bl=n(B,"CODE",{});var j2=s(bl);Ch=i(j2,"scores"),j2.forEach(r),Nh=i(B," input tensor. This class inherits from list and adds a specific "),vl=n(B,"EM",{});var H2=s(vl);$l=n(H2,"STRONG",{});var R2=s($l);Wh=i(R2,"call"),R2.forEach(r),H2.forEach(r),Vh=i(B,` method to apply each
`),vs=n(B,"A",{href:!0});var U2=s(vs);Mh=i(U2,"LogitsProcessor"),U2.forEach(r),Gh=i(B," or "),$s=n(B,"A",{href:!0});var K2=s($s);jh=i(K2,"LogitsWarper"),K2.forEach(r),Hh=i(B," to the inputs."),B.forEach(r),Rh=l(Fi),Ts=n(Fi,"DIV",{class:!0});var Y2=s(Ts);g(Sr.$$.fragment,Y2),Y2.forEach(r),Fi.forEach(r),mm=l(e),X=n(e,"DIV",{class:!0});var Di=s(X);g(zr.$$.fragment,Di),Uh=l(Di),Tl=n(Di,"P",{});var X2=s(Tl);Kh=i(X2,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),X2.forEach(r),Yh=l(Di),Ft=n(Di,"DIV",{class:!0});var zp=s(Ft);g(Or.$$.fragment,zp),Xh=l(zp),yl=n(zp,"P",{});var J2=s(yl);Jh=i(J2,"Torch method for warping logits."),J2.forEach(r),zp.forEach(r),Di.forEach(r),pm=l(e),J=n(e,"DIV",{class:!0});var Si=s(J);g(qr.$$.fragment,Si),Qh=l(Si),ys=n(Si,"P",{});var KT=s(ys);ks=n(KT,"A",{href:!0});var Q2=s(ks);Zh=i(Q2,"LogitsProcessor"),Q2.forEach(r),eu=i(KT," enforcing a min-length by setting EOS probability to 0."),KT.forEach(r),tu=l(Si),xs=n(Si,"DIV",{class:!0});var Z2=s(xs);g(Br.$$.fragment,Z2),Z2.forEach(r),Si.forEach(r),fm=l(e),Q=n(e,"DIV",{class:!0});var zi=s(Q);g(Ir.$$.fragment,zi),ru=l(zi),Ls=n(zi,"P",{});var YT=s(Ls);ws=n(YT,"A",{href:!0});var ey=s(ws);ou=i(ey,"LogitsProcessor"),ey.forEach(r),nu=i(YT," enforcing a min-length of new tokens by setting EOS (End-Of-Sequence) token probability to 0."),YT.forEach(r),su=l(zi),Es=n(zi,"DIV",{class:!0});var ty=s(Es);g(Ar.$$.fragment,ty),ty.forEach(r),zi.forEach(r),gm=l(e),Z=n(e,"DIV",{class:!0});var Oi=s(Z);g(Cr.$$.fragment,Oi),au=l(Oi),Ps=n(Oi,"P",{});var XT=s(Ps);Fs=n(XT,"A",{href:!0});var ry=s(Fs);iu=i(ry,"LogitsWarper"),ry.forEach(r),cu=i(XT," for temperature (exponential scaling output probability distribution)."),XT.forEach(r),lu=l(Oi),Ds=n(Oi,"DIV",{class:!0});var oy=s(Ds);g(Nr.$$.fragment,oy),oy.forEach(r),Oi.forEach(r),hm=l(e),ee=n(e,"DIV",{class:!0});var qi=s(ee);g(Wr.$$.fragment,qi),du=l(qi),Ss=n(qi,"P",{});var JT=s(Ss);zs=n(JT,"A",{href:!0});var ny=s(zs);mu=i(ny,"LogitsProcessor"),ny.forEach(r),pu=i(JT," enforcing an exponential penalty on repeated sequences."),JT.forEach(r),fu=l(qi),Os=n(qi,"DIV",{class:!0});var sy=s(Os);g(Vr.$$.fragment,sy),sy.forEach(r),qi.forEach(r),um=l(e),te=n(e,"DIV",{class:!0});var Bi=s(te);g(Mr.$$.fragment,Bi),gu=l(Bi),qs=n(Bi,"P",{});var QT=s(qs);Bs=n(QT,"A",{href:!0});var ay=s(Bs);hu=i(ay,"LogitsWarper"),ay.forEach(r),uu=i(QT," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),QT.forEach(r),_u=l(Bi),Is=n(Bi,"DIV",{class:!0});var iy=s(Is);g(Gr.$$.fragment,iy),iy.forEach(r),Bi.forEach(r),_m=l(e),re=n(e,"DIV",{class:!0});var Ii=s(re);g(jr.$$.fragment,Ii),bu=l(Ii),As=n(Ii,"P",{});var ZT=s(As);Cs=n(ZT,"A",{href:!0});var cy=s(Cs);vu=i(cy,"LogitsWarper"),cy.forEach(r),$u=i(ZT," that performs top-k, i.e. restricting to the k highest probability elements."),ZT.forEach(r),Tu=l(Ii),Ns=n(Ii,"DIV",{class:!0});var ly=s(Ns);g(Hr.$$.fragment,ly),ly.forEach(r),Ii.forEach(r),bm=l(e),oe=n(e,"DIV",{class:!0});var Ai=s(oe);g(Rr.$$.fragment,Ai),yu=l(Ai),Dt=n(Ai,"P",{});var xd=s(Dt);Ws=n(xd,"A",{href:!0});var dy=s(Ws);ku=i(dy,"LogitsWarper"),dy.forEach(r),xu=i(xd," that performs typical decoding. See "),Ur=n(xd,"A",{href:!0,rel:!0});var my=s(Ur);Lu=i(my,`Typical Decoding for Natural Language
Generation`),my.forEach(r),wu=i(xd," for more information."),xd.forEach(r),Eu=l(Ai),Vs=n(Ai,"DIV",{class:!0});var py=s(Vs);g(Kr.$$.fragment,py),py.forEach(r),Ai.forEach(r),vm=l(e),ne=n(e,"DIV",{class:!0});var Ci=s(ne);g(Yr.$$.fragment,Ci),Pu=l(Ci),St=n(Ci,"P",{});var Ld=s(St);Ms=n(Ld,"A",{href:!0});var fy=s(Ms);Fu=i(fy,"LogitsProcessor"),fy.forEach(r),Du=i(Ld,` that enforces no repetition of n-grams. See
`),Xr=n(Ld,"A",{href:!0,rel:!0});var gy=s(Xr);Su=i(gy,"Fairseq"),gy.forEach(r),zu=i(Ld,"."),Ld.forEach(r),Ou=l(Ci),Gs=n(Ci,"DIV",{class:!0});var hy=s(Gs);g(Jr.$$.fragment,hy),hy.forEach(r),Ci.forEach(r),$m=l(e),se=n(e,"DIV",{class:!0});var Ni=s(se);g(Qr.$$.fragment,Ni),qu=l(Ni),js=n(Ni,"P",{});var e1=s(js);Hs=n(e1,"A",{href:!0});var uy=s(Hs);Bu=i(uy,"LogitsProcessor"),uy.forEach(r),Iu=i(e1," that enforces that specified sequences will never be sampled."),e1.forEach(r),Au=l(Ni),Rs=n(Ni,"DIV",{class:!0});var _y=s(Rs);g(Zr.$$.fragment,_y),_y.forEach(r),Ni.forEach(r),Tm=l(e),ae=n(e,"DIV",{class:!0});var Wi=s(ae);g(eo.$$.fragment,Wi),Cu=l(Wi),zt=n(Wi,"P",{});var wd=s(zt);Us=n(wd,"A",{href:!0});var by=s(Us);Nu=i(by,"LogitsProcessor"),by.forEach(r),Wu=i(wd,` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),to=n(wd,"A",{href:!0,rel:!0});var vy=s(to);Vu=i(vy,"Autoregressive Entity Retrieval"),vy.forEach(r),Mu=i(wd," for more information."),wd.forEach(r),Gu=l(Wi),Ks=n(Wi,"DIV",{class:!0});var $y=s(Ks);g(ro.$$.fragment,$y),$y.forEach(r),Wi.forEach(r),ym=l(e),ie=n(e,"DIV",{class:!0});var Vi=s(ie);g(oo.$$.fragment,Vi),ju=l(Vi),Ve=n(Vi,"P",{});var Xn=s(Ve);Ys=n(Xn,"A",{href:!0});var Ty=s(Ys);Hu=i(Ty,"LogitsProcessor"),Ty.forEach(r),Ru=i(Xn,` that enforces diverse beam search. Note that this logits processor is only effective for
`),Xs=n(Xn,"A",{href:!0});var yy=s(Xs);Uu=i(yy,"PreTrainedModel.group_beam_search()"),yy.forEach(r),Ku=i(Xn,". See "),no=n(Xn,"A",{href:!0,rel:!0});var ky=s(no);Yu=i(ky,`Diverse Beam Search: Decoding Diverse Solutions from Neural Sequence
Models`),ky.forEach(r),Xu=i(Xn," for more details."),Xn.forEach(r),Ju=l(Vi),Js=n(Vi,"DIV",{class:!0});var xy=s(Js);g(so.$$.fragment,xy),xy.forEach(r),Vi.forEach(r),km=l(e),ce=n(e,"DIV",{class:!0});var Mi=s(ce);g(ao.$$.fragment,Mi),Qu=l(Mi),Qs=n(Mi,"P",{});var t1=s(Qs);Zs=n(t1,"A",{href:!0});var Ly=s(Zs);Zu=i(Ly,"LogitsProcessor"),Ly.forEach(r),e_=i(t1," that enforces the specified token as the first generated token."),t1.forEach(r),t_=l(Mi),ea=n(Mi,"DIV",{class:!0});var wy=s(ea);g(io.$$.fragment,wy),wy.forEach(r),Mi.forEach(r),xm=l(e),le=n(e,"DIV",{class:!0});var Gi=s(le);g(co.$$.fragment,Gi),r_=l(Gi),Ot=n(Gi,"P",{});var Ed=s(Ot);ta=n(Ed,"A",{href:!0});var Ey=s(ta);o_=i(Ey,"LogitsProcessor"),Ey.forEach(r),n_=i(Ed," that enforces the specified token as the last generated token when "),kl=n(Ed,"CODE",{});var Py=s(kl);s_=i(Py,"max_length"),Py.forEach(r),a_=i(Ed," is reached."),Ed.forEach(r),i_=l(Gi),ra=n(Gi,"DIV",{class:!0});var Fy=s(ra);g(lo.$$.fragment,Fy),Fy.forEach(r),Gi.forEach(r),Lm=l(e),de=n(e,"DIV",{class:!0});var ji=s(de);g(mo.$$.fragment,ji),c_=l(ji),G=n(ji,"P",{});var _t=s(G);oa=n(_t,"A",{href:!0});var Dy=s(oa);l_=i(Dy,"LogitsProcessor"),Dy.forEach(r),d_=i(_t," that removes all "),xl=n(_t,"CODE",{});var Sy=s(xl);m_=i(Sy,"nan"),Sy.forEach(r),p_=i(_t," and "),Ll=n(_t,"CODE",{});var zy=s(Ll);f_=i(zy,"inf"),zy.forEach(r),g_=i(_t,` values to avoid the generation method to fail. Note that using
the logits processor should only be used if necessary since it can slow down the generation method. `),wl=n(_t,"CODE",{});var Oy=s(wl);h_=i(Oy,"max_length"),Oy.forEach(r),u_=i(_t,` is
reached.`),_t.forEach(r),__=l(ji),na=n(ji,"DIV",{class:!0});var qy=s(na);g(po.$$.fragment,qy),qy.forEach(r),ji.forEach(r),wm=l(e),me=n(e,"DIV",{class:!0});var Hi=s(me);g(fo.$$.fragment,Hi),b_=l(Hi),El=n(Hi,"P",{});var By=s(El);v_=i(By,"Abstract base class for all logit processors that can be applied during generation."),By.forEach(r),$_=l(Hi),qt=n(Hi,"DIV",{class:!0});var Op=s(qt);g(go.$$.fragment,Op),T_=l(Op),Pl=n(Op,"P",{});var Iy=s(Pl);y_=i(Iy,"TF method for processing logits."),Iy.forEach(r),Op.forEach(r),Hi.forEach(r),Em=l(e),pe=n(e,"DIV",{class:!0});var Ri=s(pe);g(ho.$$.fragment,Ri),k_=l(Ri),A=n(Ri,"P",{});var Re=s(A);x_=i(Re,"This class can be used to create a list of "),sa=n(Re,"A",{href:!0});var Ay=s(sa);L_=i(Ay,"TFLogitsProcessor"),Ay.forEach(r),w_=i(Re," to subsequently process a "),Fl=n(Re,"CODE",{});var Cy=s(Fl);E_=i(Cy,"scores"),Cy.forEach(r),P_=i(Re,` input tensor.
This class inherits from list and adds a specific `),Dl=n(Re,"EM",{});var Ny=s(Dl);Sl=n(Ny,"STRONG",{});var Wy=s(Sl);F_=i(Wy,"call"),Wy.forEach(r),Ny.forEach(r),D_=i(Re," method to apply each "),aa=n(Re,"A",{href:!0});var Vy=s(aa);S_=i(Vy,"TFLogitsProcessor"),Vy.forEach(r),z_=i(Re,` to the
inputs.`),Re.forEach(r),O_=l(Ri),ia=n(Ri,"DIV",{class:!0});var My=s(ia);g(uo.$$.fragment,My),My.forEach(r),Ri.forEach(r),Pm=l(e),fe=n(e,"DIV",{class:!0});var Ui=s(fe);g(_o.$$.fragment,Ui),q_=l(Ui),zl=n(Ui,"P",{});var Gy=s(zl);B_=i(Gy,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),Gy.forEach(r),I_=l(Ui),Bt=n(Ui,"DIV",{class:!0});var qp=s(Bt);g(bo.$$.fragment,qp),A_=l(qp),Ol=n(qp,"P",{});var jy=s(Ol);C_=i(jy,"TF method for warping logits."),jy.forEach(r),qp.forEach(r),Ui.forEach(r),Fm=l(e),ge=n(e,"DIV",{class:!0});var Ki=s(ge);g(vo.$$.fragment,Ki),N_=l(Ki),ca=n(Ki,"P",{});var r1=s(ca);la=n(r1,"A",{href:!0});var Hy=s(la);W_=i(Hy,"TFLogitsWarper"),Hy.forEach(r),V_=i(r1," for temperature (exponential scaling output probability distribution)."),r1.forEach(r),M_=l(Ki),da=n(Ki,"DIV",{class:!0});var Ry=s(da);g($o.$$.fragment,Ry),Ry.forEach(r),Ki.forEach(r),Dm=l(e),he=n(e,"DIV",{class:!0});var Yi=s(he);g(To.$$.fragment,Yi),G_=l(Yi),ma=n(Yi,"P",{});var o1=s(ma);pa=n(o1,"A",{href:!0});var Uy=s(pa);j_=i(Uy,"TFLogitsWarper"),Uy.forEach(r),H_=i(o1," that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),o1.forEach(r),R_=l(Yi),fa=n(Yi,"DIV",{class:!0});var Ky=s(fa);g(yo.$$.fragment,Ky),Ky.forEach(r),Yi.forEach(r),Sm=l(e),ue=n(e,"DIV",{class:!0});var Xi=s(ue);g(ko.$$.fragment,Xi),U_=l(Xi),ga=n(Xi,"P",{});var n1=s(ga);ha=n(n1,"A",{href:!0});var Yy=s(ha);K_=i(Yy,"TFLogitsWarper"),Yy.forEach(r),Y_=i(n1," that performs top-k, i.e. restricting to the k highest probability elements."),n1.forEach(r),X_=l(Xi),ua=n(Xi,"DIV",{class:!0});var Xy=s(ua);g(xo.$$.fragment,Xy),Xy.forEach(r),Xi.forEach(r),zm=l(e),_e=n(e,"DIV",{class:!0});var Ji=s(_e);g(Lo.$$.fragment,Ji),J_=l(Ji),_a=n(Ji,"P",{});var s1=s(_a);ba=n(s1,"A",{href:!0});var Jy=s(ba);Q_=i(Jy,"TFLogitsProcessor"),Jy.forEach(r),Z_=i(s1," enforcing a min-length by setting EOS probability to 0."),s1.forEach(r),eb=l(Ji),va=n(Ji,"DIV",{class:!0});var Qy=s(va);g(wo.$$.fragment,Qy),Qy.forEach(r),Ji.forEach(r),Om=l(e),be=n(e,"DIV",{class:!0});var Qi=s(be);g(Eo.$$.fragment,Qi),tb=l(Qi),$a=n(Qi,"P",{});var a1=s($a);Ta=n(a1,"A",{href:!0});var Zy=s(Ta);rb=i(Zy,"TFLogitsProcessor"),Zy.forEach(r),ob=i(a1," that enforces that specified sequences will never be sampled."),a1.forEach(r),nb=l(Qi),ya=n(Qi,"DIV",{class:!0});var e0=s(ya);g(Po.$$.fragment,e0),e0.forEach(r),Qi.forEach(r),qm=l(e),ve=n(e,"DIV",{class:!0});var Zi=s(ve);g(Fo.$$.fragment,Zi),sb=l(Zi),It=n(Zi,"P",{});var Pd=s(It);ka=n(Pd,"A",{href:!0});var t0=s(ka);ab=i(t0,"TFLogitsProcessor"),t0.forEach(r),ib=i(Pd,` that enforces no repetition of n-grams. See
`),Do=n(Pd,"A",{href:!0,rel:!0});var r0=s(Do);cb=i(r0,"Fairseq"),r0.forEach(r),lb=i(Pd,"."),Pd.forEach(r),db=l(Zi),xa=n(Zi,"DIV",{class:!0});var o0=s(xa);g(So.$$.fragment,o0),o0.forEach(r),Zi.forEach(r),Bm=l(e),$e=n(e,"DIV",{class:!0});var ec=s($e);g(zo.$$.fragment,ec),mb=l(ec),La=n(ec,"P",{});var i1=s(La);wa=n(i1,"A",{href:!0});var n0=s(wa);pb=i(n0,"TFLogitsProcessor"),n0.forEach(r),fb=i(i1," enforcing an exponential penalty on repeated sequences."),i1.forEach(r),gb=l(ec),Ea=n(ec,"DIV",{class:!0});var s0=s(Ea);g(Oo.$$.fragment,s0),s0.forEach(r),ec.forEach(r),Im=l(e),Te=n(e,"DIV",{class:!0});var tc=s(Te);g(qo.$$.fragment,tc),hb=l(tc),Pa=n(tc,"P",{});var c1=s(Pa);Fa=n(c1,"A",{href:!0});var a0=s(Fa);ub=i(a0,"TFLogitsProcessor"),a0.forEach(r),_b=i(c1," that enforces the specified token as the first generated token."),c1.forEach(r),bb=l(tc),Da=n(tc,"DIV",{class:!0});var i0=s(Da);g(Bo.$$.fragment,i0),i0.forEach(r),tc.forEach(r),Am=l(e),ye=n(e,"DIV",{class:!0});var rc=s(ye);g(Io.$$.fragment,rc),vb=l(rc),At=n(rc,"P",{});var Fd=s(At);Sa=n(Fd,"A",{href:!0});var c0=s(Sa);$b=i(c0,"TFLogitsProcessor"),c0.forEach(r),Tb=i(Fd," that enforces the specified token as the last generated token when "),ql=n(Fd,"CODE",{});var l0=s(ql);yb=i(l0,"max_length"),l0.forEach(r),kb=i(Fd," is reached."),Fd.forEach(r),xb=l(rc),za=n(rc,"DIV",{class:!0});var d0=s(za);g(Ao.$$.fragment,d0),d0.forEach(r),rc.forEach(r),Cm=l(e),ke=n(e,"DIV",{class:!0});var oc=s(ke);g(Co.$$.fragment,oc),Lb=l(oc),Bl=n(oc,"P",{});var m0=s(Bl);wb=i(m0,"Abstract base class for all logit processors that can be applied during generation."),m0.forEach(r),Eb=l(oc),Ct=n(oc,"DIV",{class:!0});var Bp=s(Ct);g(No.$$.fragment,Bp),Pb=l(Bp),Il=n(Bp,"P",{});var p0=s(Il);Fb=i(p0,"Flax method for processing logits."),p0.forEach(r),Bp.forEach(r),oc.forEach(r),Nm=l(e),xe=n(e,"DIV",{class:!0});var nc=s(xe);g(Wo.$$.fragment,nc),Db=l(nc),P=n(nc,"P",{});var I=s(P);Sb=i(I,"This class can be used to create a list of "),Oa=n(I,"A",{href:!0});var f0=s(Oa);zb=i(f0,"FlaxLogitsProcessor"),f0.forEach(r),Ob=i(I," or "),qa=n(I,"A",{href:!0});var g0=s(qa);qb=i(g0,"FlaxLogitsWarper"),g0.forEach(r),Bb=i(I,` to subsequently process
a `),Al=n(I,"CODE",{});var h0=s(Al);Ib=i(h0,"scores"),h0.forEach(r),Ab=i(I," input tensor. This class inherits from list and adds a specific "),Cl=n(I,"EM",{});var u0=s(Cl);Nl=n(u0,"STRONG",{});var _0=s(Nl);Cb=i(_0,"call"),_0.forEach(r),u0.forEach(r),Nb=i(I,` method to apply each
`),Ba=n(I,"A",{href:!0});var b0=s(Ba);Wb=i(b0,"FlaxLogitsProcessor"),b0.forEach(r),Vb=i(I," or "),Ia=n(I,"A",{href:!0});var v0=s(Ia);Mb=i(v0,"FlaxLogitsWarper"),v0.forEach(r),Gb=i(I," to the inputs."),I.forEach(r),jb=l(nc),Aa=n(nc,"DIV",{class:!0});var $0=s(Aa);g(Vo.$$.fragment,$0),$0.forEach(r),nc.forEach(r),Wm=l(e),Le=n(e,"DIV",{class:!0});var sc=s(Le);g(Mo.$$.fragment,sc),Hb=l(sc),Wl=n(sc,"P",{});var T0=s(Wl);Rb=i(T0,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),T0.forEach(r),Ub=l(sc),Nt=n(sc,"DIV",{class:!0});var Ip=s(Nt);g(Go.$$.fragment,Ip),Kb=l(Ip),Vl=n(Ip,"P",{});var y0=s(Vl);Yb=i(y0,"Flax method for warping logits."),y0.forEach(r),Ip.forEach(r),sc.forEach(r),Vm=l(e),we=n(e,"DIV",{class:!0});var ac=s(we);g(jo.$$.fragment,ac),Xb=l(ac),Ca=n(ac,"P",{});var l1=s(Ca);Na=n(l1,"A",{href:!0});var k0=s(Na);Jb=i(k0,"FlaxLogitsWarper"),k0.forEach(r),Qb=i(l1," for temperature (exponential scaling output probability distribution)."),l1.forEach(r),Zb=l(ac),Wa=n(ac,"DIV",{class:!0});var x0=s(Wa);g(Ho.$$.fragment,x0),x0.forEach(r),ac.forEach(r),Mm=l(e),Ee=n(e,"DIV",{class:!0});var ic=s(Ee);g(Ro.$$.fragment,ic),ev=l(ic),Va=n(ic,"P",{});var d1=s(Va);Ma=n(d1,"A",{href:!0});var L0=s(Ma);tv=i(L0,"FlaxLogitsWarper"),L0.forEach(r),rv=i(d1," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),d1.forEach(r),ov=l(ic),Ga=n(ic,"DIV",{class:!0});var w0=s(Ga);g(Uo.$$.fragment,w0),w0.forEach(r),ic.forEach(r),Gm=l(e),Pe=n(e,"DIV",{class:!0});var cc=s(Pe);g(Ko.$$.fragment,cc),nv=l(cc),ja=n(cc,"P",{});var m1=s(ja);Ha=n(m1,"A",{href:!0});var E0=s(Ha);sv=i(E0,"FlaxLogitsWarper"),E0.forEach(r),av=i(m1," that performs top-k, i.e. restricting to the k highest probability elements."),m1.forEach(r),iv=l(cc),Ra=n(cc,"DIV",{class:!0});var P0=s(Ra);g(Yo.$$.fragment,P0),P0.forEach(r),cc.forEach(r),jm=l(e),Fe=n(e,"DIV",{class:!0});var lc=s(Fe);g(Xo.$$.fragment,lc),cv=l(lc),Ua=n(lc,"P",{});var p1=s(Ua);Ka=n(p1,"A",{href:!0});var F0=s(Ka);lv=i(F0,"FlaxLogitsProcessor"),F0.forEach(r),dv=i(p1," that enforces the specified token as the first generated token."),p1.forEach(r),mv=l(lc),Ya=n(lc,"DIV",{class:!0});var D0=s(Ya);g(Jo.$$.fragment,D0),D0.forEach(r),lc.forEach(r),Hm=l(e),De=n(e,"DIV",{class:!0});var dc=s(De);g(Qo.$$.fragment,dc),pv=l(dc),Wt=n(dc,"P",{});var Dd=s(Wt);Xa=n(Dd,"A",{href:!0});var S0=s(Xa);fv=i(S0,"FlaxLogitsProcessor"),S0.forEach(r),gv=i(Dd," that enforces the specified token as the last generated token when "),Ml=n(Dd,"CODE",{});var z0=s(Ml);hv=i(z0,"max_length"),z0.forEach(r),uv=i(Dd," is reached."),Dd.forEach(r),_v=l(dc),Ja=n(dc,"DIV",{class:!0});var O0=s(Ja);g(Zo.$$.fragment,O0),O0.forEach(r),dc.forEach(r),Rm=l(e),Se=n(e,"DIV",{class:!0});var mc=s(Se);g(en.$$.fragment,mc),bv=l(mc),Qa=n(mc,"P",{});var f1=s(Qa);Za=n(f1,"A",{href:!0});var q0=s(Za);vv=i(q0,"FlaxLogitsProcessor"),q0.forEach(r),$v=i(f1," enforcing a min-length by setting EOS probability to 0."),f1.forEach(r),Tv=l(mc),ei=n(mc,"DIV",{class:!0});var B0=s(ei);g(tn.$$.fragment,B0),B0.forEach(r),mc.forEach(r),Um=l(e),ct=n(e,"H2",{class:!0});var Ap=s(ct);Vt=n(Ap,"A",{id:!0,class:!0,href:!0});var I0=s(Vt);Gl=n(I0,"SPAN",{});var A0=s(Gl);g(rn.$$.fragment,A0),A0.forEach(r),I0.forEach(r),yv=l(Ap),jl=n(Ap,"SPAN",{});var C0=s(jl);kv=i(C0,"StoppingCriteria"),C0.forEach(r),Ap.forEach(r),Km=l(e),Mt=n(e,"P",{});var Cp=s(Mt);xv=i(Cp,"A "),ti=n(Cp,"A",{href:!0});var N0=s(ti);Lv=i(N0,"StoppingCriteria"),N0.forEach(r),wv=i(Cp," can be used to change when to stop generation (other than EOS token)."),Cp.forEach(r),Ym=l(e),ze=n(e,"DIV",{class:!0});var pc=s(ze);g(on.$$.fragment,pc),Ev=l(pc),Hl=n(pc,"P",{});var W0=s(Hl);Pv=i(W0,"Abstract base class for all stopping criteria that can be applied during generation."),W0.forEach(r),Fv=l(pc),ri=n(pc,"DIV",{class:!0});var V0=s(ri);g(nn.$$.fragment,V0),V0.forEach(r),pc.forEach(r),Xm=l(e),lt=n(e,"DIV",{class:!0});var Np=s(lt);g(sn.$$.fragment,Np),Dv=l(Np),oi=n(Np,"DIV",{class:!0});var M0=s(oi);g(an.$$.fragment,M0),M0.forEach(r),Np.forEach(r),Jm=l(e),Oe=n(e,"DIV",{class:!0});var fc=s(Oe);g(cn.$$.fragment,fc),Sv=l(fc),ln=n(fc,"P",{});var Wp=s(ln);zv=i(Wp,"This class can be used to stop generation whenever the full generated number of tokens exceeds "),Rl=n(Wp,"CODE",{});var G0=s(Rl);Ov=i(G0,"max_length"),G0.forEach(r),qv=i(Wp,`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),Wp.forEach(r),Bv=l(fc),ni=n(fc,"DIV",{class:!0});var j0=s(ni);g(dn.$$.fragment,j0),j0.forEach(r),fc.forEach(r),Qm=l(e),qe=n(e,"DIV",{class:!0});var gc=s(qe);g(mn.$$.fragment,gc),Iv=l(gc),pn=n(gc,"P",{});var Vp=s(pn);Av=i(Vp,`This class can be used to stop generation whenever the full generation exceeds some amount of time. By default, the
time will start being counted when you initialize this function. You can override this by passing an
`),Ul=n(Vp,"CODE",{});var H0=s(Ul);Cv=i(H0,"initial_time"),H0.forEach(r),Nv=i(Vp,"."),Vp.forEach(r),Wv=l(gc),si=n(gc,"DIV",{class:!0});var R0=s(si);g(fn.$$.fragment,R0),R0.forEach(r),gc.forEach(r),Zm=l(e),dt=n(e,"H2",{class:!0});var Mp=s(dt);Gt=n(Mp,"A",{id:!0,class:!0,href:!0});var U0=s(Gt);Kl=n(U0,"SPAN",{});var K0=s(Kl);g(gn.$$.fragment,K0),K0.forEach(r),U0.forEach(r),Vv=l(Mp),Yl=n(Mp,"SPAN",{});var Y0=s(Yl);Mv=i(Y0,"Constraints"),Y0.forEach(r),Mp.forEach(r),ep=l(e),jt=n(e,"P",{});var Gp=s(jt);Gv=i(Gp,"A "),ai=n(Gp,"A",{href:!0});var X0=s(ai);jv=i(X0,"Constraint"),X0.forEach(r),Hv=i(Gp," can be used to force the generation to include specific tokens or sequences in the output."),Gp.forEach(r),tp=l(e),$=n(e,"DIV",{class:!0});var T=s($);g(hn.$$.fragment,T),Rv=l(T),Xl=n(T,"P",{});var J0=s(Xl);Uv=i(J0,`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),J0.forEach(r),Kv=l(T),Jl=n(T,"P",{});var Q0=s(Jl);Yv=i(Q0,"All classes that inherit Constraint must follow the requirement that"),Q0.forEach(r),Xv=l(T),g(Ht.$$.fragment,T),Jv=l(T),Ql=n(T,"P",{});var Z0=s(Ql);Qv=i(Z0,"will always terminate (halt)."),Z0.forEach(r),Zv=l(T),Rt=n(T,"DIV",{class:!0});var jp=s(Rt);g(un.$$.fragment,jp),e$=l(jp),Zl=n(jp,"P",{});var ek=s(Zl);t$=i(ek,"When called, returns the token that would take this constraint one step closer to being fulfilled."),ek.forEach(r),jp.forEach(r),r$=l(T),Ut=n(T,"DIV",{class:!0});var Hp=s(Ut);g(_n.$$.fragment,Hp),o$=l(Hp),ed=n(Hp,"P",{});var tk=s(ed);n$=i(tk,"Creates a new instance of this constraint."),tk.forEach(r),Hp.forEach(r),s$=l(T),Kt=n(T,"DIV",{class:!0});var Rp=s(Kt);g(bn.$$.fragment,Rp),a$=l(Rp),td=n(Rp,"P",{});var rk=s(td);i$=i(rk,"Reads in a token and returns whether it creates progress."),rk.forEach(r),Rp.forEach(r),c$=l(T),Yt=n(T,"DIV",{class:!0});var Up=s(Yt);g(vn.$$.fragment,Up),l$=l(Up),$n=n(Up,"P",{});var Kp=s($n);d$=i(Kp,"Returns the number of remaining steps of "),rd=n(Kp,"CODE",{});var ok=s(rd);m$=i(ok,"advance()"),ok.forEach(r),p$=i(Kp," in order to complete this constraint."),Kp.forEach(r),Up.forEach(r),f$=l(T),Xt=n(T,"DIV",{class:!0});var Yp=s(Xt);g(Tn.$$.fragment,Yp),g$=l(Yp),od=n(Yp,"P",{});var nk=s(od);h$=i(nk,`Resets the state of this constraint to its initialization. We would call this in cases where the fulfillment of
a constraint is abrupted by an unwanted token.`),nk.forEach(r),Yp.forEach(r),u$=l(T),Jt=n(T,"DIV",{class:!0});var Xp=s(Jt);g(yn.$$.fragment,Xp),_$=l(Xp),nd=n(Xp,"P",{});var sk=s(nd);b$=i(sk,"Tests whether this constraint has been properly defined."),sk.forEach(r),Xp.forEach(r),v$=l(T),Me=n(T,"DIV",{class:!0});var hc=s(Me);g(kn.$$.fragment,hc),$$=l(hc),xn=n(hc,"P",{});var Jp=s(xn);T$=i(Jp,`Reads in a token and returns booleans that indicate the progress made by it. This function will update the
state of this object unlikes `),sd=n(Jp,"CODE",{});var ak=s(sd);y$=i(ak,"does_advance(self, token_id: int)"),ak.forEach(r),k$=i(Jp,"."),Jp.forEach(r),x$=l(hc),ad=n(hc,"P",{});var ik=s(ad);L$=i(ik,`This isn\u2019t to test whether a certain token will advance the progress; it\u2019s to update its state as if it has
been generated. This becomes important if token_id != desired token (refer to else statement in
PhrasalConstraint)`),ik.forEach(r),hc.forEach(r),T.forEach(r),rp=l(e),mt=n(e,"DIV",{class:!0});var Qp=s(mt);g(Ln.$$.fragment,Qp),w$=l(Qp),ii=n(Qp,"P",{});var g1=s(ii);ci=n(g1,"A",{href:!0});var ck=s(ci);E$=i(ck,"Constraint"),ck.forEach(r),P$=i(g1," enforcing that an ordered sequence of tokens is included in the output."),g1.forEach(r),Qp.forEach(r),op=l(e),pt=n(e,"DIV",{class:!0});var Zp=s(pt);g(wn.$$.fragment,Zp),F$=l(Zp),En=n(Zp,"P",{});var ef=s(En);D$=i(ef,"A special "),li=n(ef,"A",{href:!0});var lk=s(li);S$=i(lk,"Constraint"),lk.forEach(r),z$=i(ef," that is fulfilled by fulfilling just one of several constraints."),ef.forEach(r),Zp.forEach(r),np=l(e),C=n(e,"DIV",{class:!0});var or=s(C);g(Pn.$$.fragment,or),O$=l(or),id=n(or,"P",{});var dk=s(id);q$=i(dk,"A class for beam scorers to track its progress through a list of constraints."),dk.forEach(r),B$=l(or),D=n(or,"DIV",{class:!0});var j=s(D);g(Fn.$$.fragment,j),I$=l(j),cd=n(j,"P",{});var mk=s(cd);A$=i(mk,`The list of tokens to generate such that we can make progress.
By \u201Clist\u201D we don\u2019t mean the list of token that will fully fulfill a constraint.`),mk.forEach(r),C$=l(j),ft=n(j,"P",{});var uc=s(ft);N$=i(uc,"Given constraints "),ld=n(uc,"CODE",{});var pk=s(ld);W$=i(pk,"c_i = {t_ij | j == # of tokens}"),pk.forEach(r),V$=i(uc,`, If we\u2019re not in the middle of progressing through a
specific constraint `),dd=n(uc,"CODE",{});var fk=s(dd);M$=i(fk,"c_i"),fk.forEach(r),G$=i(uc,", we return:"),uc.forEach(r),j$=l(j),md=n(j,"P",{});var gk=s(md);pd=n(gk,"CODE",{});var hk=s(pd);H$=i(hk,"[t_k1 for k in indices of unfulfilled constraints]"),hk.forEach(r),gk.forEach(r),R$=l(j),Be=n(j,"P",{});var nr=s(Be);U$=i(nr,`If we are in the middle of a constraint, then we return:
`),fd=n(nr,"CODE",{});var uk=s(fd);K$=i(uk,"[t_ij]"),uk.forEach(r),Y$=i(nr,", where "),gd=n(nr,"CODE",{});var _k=s(gd);X$=i(_k,"i"),_k.forEach(r),J$=i(nr," is the index of the inprogress constraint, "),hd=n(nr,"CODE",{});var bk=s(hd);Q$=i(bk,"j"),bk.forEach(r),Z$=i(nr," is the next step for the constraint."),nr.forEach(r),eT=l(j),ud=n(j,"P",{});var vk=s(ud);tT=i(vk,`Though we don\u2019t care which constraint is fulfilled first, if we are in the progress of fulfilling a constraint,
that\u2019s the only one we\u2019ll return.`),vk.forEach(r),j.forEach(r),rT=l(or),Qt=n(or,"DIV",{class:!0});var tf=s(Qt);g(Dn.$$.fragment,tf),oT=l(tf),_d=n(tf,"P",{});var $k=s(_d);nT=i($k,"token_ids: the tokens generated thus far to reset the state of the progress through constraints."),$k.forEach(r),tf.forEach(r),or.forEach(r),sp=l(e),gt=n(e,"H2",{class:!0});var rf=s(gt);Zt=n(rf,"A",{id:!0,class:!0,href:!0});var Tk=s(Zt);bd=n(Tk,"SPAN",{});var yk=s(bd);g(Sn.$$.fragment,yk),yk.forEach(r),Tk.forEach(r),sT=l(rf),vd=n(rf,"SPAN",{});var kk=s(vd);aT=i(kk,"BeamSearch"),kk.forEach(r),rf.forEach(r),ap=l(e),N=n(e,"DIV",{class:!0});var sr=s(N);g(zn.$$.fragment,sr),iT=l(sr),ht=n(sr,"P",{});var _c=s(ht);cT=i(_c,"Abstract base class for all beam scorers that are used for "),di=n(_c,"A",{href:!0});var xk=s(di);lT=i(xk,"beam_search()"),xk.forEach(r),dT=i(_c,` and
`),mi=n(_c,"A",{href:!0});var Lk=s(mi);mT=i(Lk,"beam_sample()"),Lk.forEach(r),pT=i(_c,"."),_c.forEach(r),fT=l(sr),pi=n(sr,"DIV",{class:!0});var wk=s(pi);g(On.$$.fragment,wk),wk.forEach(r),gT=l(sr),fi=n(sr,"DIV",{class:!0});var Ek=s(fi);g(qn.$$.fragment,Ek),Ek.forEach(r),sr.forEach(r),ip=l(e),F=n(e,"DIV",{class:!0});var H=s(F);g(Bn.$$.fragment,H),hT=l(H),gi=n(H,"P",{});var h1=s(gi);hi=n(h1,"A",{href:!0});var Pk=s(hi);uT=i(Pk,"BeamScorer"),Pk.forEach(r),_T=i(h1," implementing standard beam search decoding."),h1.forEach(r),bT=l(H),In=n(H,"P",{});var of=s(In);vT=i(of,"Adapted in part from "),An=n(of,"A",{href:!0,rel:!0});var Fk=s(An);$T=i(Fk,`Facebook\u2019s XLM beam search
code`),Fk.forEach(r),TT=i(of,"."),of.forEach(r),yT=l(H),ui=n(H,"P",{});var u1=s(ui);kT=i(u1,"Reference for the diverse beam search algorithm and implementation "),Cn=n(u1,"A",{href:!0,rel:!0});var Dk=s(Cn);xT=i(Dk,`Ashwin Kalyan\u2019s DBS
implementation`),Dk.forEach(r),u1.forEach(r),LT=l(H),_i=n(H,"DIV",{class:!0});var Sk=s(_i);g(Nn.$$.fragment,Sk),Sk.forEach(r),wT=l(H),bi=n(H,"DIV",{class:!0});var zk=s(bi);g(Wn.$$.fragment,zk),zk.forEach(r),H.forEach(r),cp=l(e),W=n(e,"DIV",{class:!0});var ar=s(W);g(Vn.$$.fragment,ar),ET=l(ar),vi=n(ar,"P",{});var _1=s(vi);$i=n(_1,"A",{href:!0});var Ok=s($i);PT=i(Ok,"BeamScorer"),Ok.forEach(r),FT=i(_1," implementing constrained beam search decoding."),_1.forEach(r),DT=l(ar),Ti=n(ar,"DIV",{class:!0});var qk=s(Ti);g(Mn.$$.fragment,qk),qk.forEach(r),ST=l(ar),yi=n(ar,"DIV",{class:!0});var Bk=s(yi);g(Gn.$$.fragment,Bk),Bk.forEach(r),ar.forEach(r),lp=l(e),ut=n(e,"H2",{class:!0});var nf=s(ut);er=n(nf,"A",{id:!0,class:!0,href:!0});var Ik=s(er);$d=n(Ik,"SPAN",{});var Ak=s($d);g(jn.$$.fragment,Ak),Ak.forEach(r),Ik.forEach(r),zT=l(nf),Td=n(nf,"SPAN",{});var Ck=s(Td);OT=i(Ck,"Utilities"),Ck.forEach(r),nf.forEach(r),dp=l(e),Ie=n(e,"DIV",{class:!0});var bc=s(Ie);g(Hn.$$.fragment,bc),qT=l(bc),yd=n(bc,"P",{});var Nk=s(yd);BT=i(Nk,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),Nk.forEach(r),IT=l(bc),ki=n(bc,"P",{});var b1=s(ki);AT=i(b1,"From: "),Rn=n(b1,"A",{href:!0,rel:!0});var Wk=s(Rn);CT=i(Wk,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),Wk.forEach(r),b1.forEach(r),bc.forEach(r),mp=l(e),Ae=n(e,"DIV",{class:!0});var vc=s(Ae);g(Un.$$.fragment,vc),NT=l(vc),kd=n(vc,"P",{});var Vk=s(kd);WT=i(Vk,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),Vk.forEach(r),VT=l(vc),xi=n(vc,"P",{});var v1=s(xi);MT=i(v1,"From: "),Kn=n(v1,"A",{href:!0,rel:!0});var Mk=s(Kn);GT=i(Mk,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),Mk.forEach(r),v1.forEach(r),vc.forEach(r),this.h()},h(){d(w,"name","hf:doc:metadata"),d(w,"content",JSON.stringify(Qk)),d(Ne,"id","utilities-for-generation"),d(Ne,"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"),d(Ne,"href","#utilities-for-generation"),d(k,"class","relative group"),d(Jn,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(Qn,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.greedy_search"),d(Zn,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.contrastive_search"),d(es,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.sample"),d(ts,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(rs,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_sample"),d(os,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(ns,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.constrained_beam_search"),d(bt,"id","generate-outputs"),d(bt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(bt,"href","#generate-outputs"),d(Ke,"class","relative group"),d(as,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(is,"href","/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput"),d(cs,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(ds,"href","/docs/transformers/main/en/internal/generation_utils#transformers.generation.GreedySearchDecoderOnlyOutput"),d($t,"id","transformers.generation.GreedySearchDecoderOnlyOutput"),d($t,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d($t,"href","#transformers.generation.GreedySearchDecoderOnlyOutput"),d(Ye,"class","relative group"),d(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(yt,"id","transformers.generation.SampleDecoderOnlyOutput"),d(yt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(yt,"href","#transformers.generation.SampleDecoderOnlyOutput"),d(Qe,"class","relative group"),d(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xt,"id","transformers.generation.BeamSearchDecoderOnlyOutput"),d(xt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(xt,"href","#transformers.generation.BeamSearchDecoderOnlyOutput"),d(tt,"class","relative group"),d(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Lt,"id","transformers.generation.BeamSampleDecoderOnlyOutput"),d(Lt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Lt,"href","#transformers.generation.BeamSampleDecoderOnlyOutput"),d(nt,"class","relative group"),d(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wt,"id","transformers.LogitsProcessor"),d(wt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(wt,"href","#transformers.LogitsProcessor"),d(it,"class","relative group"),d(us,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_s,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(bs,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(vs,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d($s,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Ts,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ks,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(xs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ws,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Es,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Fs,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Ds,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(zs,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Os,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Bs,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Is,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Cs,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Ns,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ws,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Ur,"href","https://arxiv.org/abs/2202.00666"),d(Ur,"rel","nofollow"),d(Vs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ms,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Xr,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(Xr,"rel","nofollow"),d(Gs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Hs,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Rs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Us,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(to,"href","https://arxiv.org/abs/2010.00904"),d(to,"rel","nofollow"),d(Ks,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ys,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Xs,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(no,"href","https://arxiv.org/pdf/1610.02424.pdf"),d(no,"rel","nofollow"),d(Js,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Zs,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ea,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ta,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ra,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(na,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(sa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(aa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(ia,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(la,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(da,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(fa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ha,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(ua,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ba,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(va,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ta,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(ya,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ka,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Do,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(Do,"rel","nofollow"),d(xa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Ea,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Fa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Da,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Sa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(za,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Oa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(qa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Ba,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(Ia,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Na,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Wa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ma,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Ga,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ha,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Ra,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ka,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(Ya,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(Ja,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Za,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(ei,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Vt,"id","transformers.StoppingCriteria"),d(Vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Vt,"href","#transformers.StoppingCriteria"),d(ct,"class","relative group"),d(ti,"href","/docs/transformers/main/en/internal/generation_utils#transformers.StoppingCriteria"),d(ri,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ni,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(si,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Gt,"id","transformers.Constraint"),d(Gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Gt,"href","#transformers.Constraint"),d(dt,"class","relative group"),d(ai,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ci,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(li,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Zt,"id","transformers.BeamScorer"),d(Zt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Zt,"href","#transformers.BeamScorer"),d(gt,"class","relative group"),d(di,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(mi,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_sample"),d(pi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(fi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(hi,"href","/docs/transformers/main/en/internal/generation_utils#transformers.BeamScorer"),d(An,"href","https://github.com/facebookresearch/XLM/blob/9e6f6814d17be4fe5b15f2e6c43eb2b2d76daeb4/src/model/transformer.py#L529"),d(An,"rel","nofollow"),d(Cn,"href","https://github.com/ashwinkalyan/dbs/blob/master/dbs/beam_utils.lua"),d(Cn,"rel","nofollow"),d(_i,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($i,"href","/docs/transformers/main/en/internal/generation_utils#transformers.BeamScorer"),d(Ti,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(yi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(er,"id","transformers.top_k_top_p_filtering"),d(er,"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"),d(er,"href","#transformers.top_k_top_p_filtering"),d(ut,"class","relative group"),d(Rn,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(Rn,"rel","nofollow"),d(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Kn,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(Kn,"rel","nofollow"),d(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,m){t(document.head,w),p(e,Ue,m),p(e,k,m),t(k,Ne),t(Ne,$c),h(ir,$c,null),t(k,sf),t(k,Tc),t(Tc,af),p(e,zd,m),p(e,y,m),t(y,cf),t(y,Jn),t(Jn,lf),t(y,df),t(y,Qn),t(Qn,mf),t(y,pf),t(y,Zn),t(Zn,ff),t(y,gf),t(y,es),t(es,hf),t(y,uf),t(y,ts),t(ts,_f),t(y,bf),t(y,rs),t(rs,vf),t(y,$f),t(y,os),t(os,Tf),t(y,yf),t(y,ns),t(ns,kf),t(y,xf),p(e,Od,m),p(e,ss,m),t(ss,Lf),p(e,qd,m),p(e,Ke,m),t(Ke,bt),t(bt,yc),h(cr,yc,null),t(Ke,wf),t(Ke,kc),t(kc,Ef),p(e,Bd,m),p(e,V,m),t(V,Pf),t(V,as),t(as,Ff),t(V,Df),t(V,is),t(is,Sf),t(V,zf),t(V,cs),t(cs,Of),t(V,qf),p(e,Id,m),p(e,ls,m),t(ls,Bf),p(e,Ad,m),h(lr,e,m),p(e,Cd,m),p(e,We,m),t(We,If),t(We,xc),t(xc,Af),t(We,Cf),t(We,ds),t(ds,Nf),t(We,Wf),p(e,Nd,m),p(e,M,m),t(M,ms),t(ms,Lc),t(Lc,Vf),t(ms,Mf),t(M,Gf),t(M,ps),t(ps,wc),t(wc,jf),t(ps,Hf),t(M,Rf),t(M,fs),t(fs,Ec),t(Ec,Uf),t(fs,Kf),t(M,Yf),t(M,gs),t(gs,Pc),t(Pc,Xf),t(gs,Jf),p(e,Wd,m),p(e,x,m),t(x,Qf),t(x,Fc),t(Fc,Zf),t(x,eg),t(x,Dc),t(Dc,tg),t(x,rg),t(x,Sc),t(Sc,og),t(x,ng),t(x,zc),t(zc,sg),t(x,ag),t(x,Oc),t(Oc,ig),t(x,cg),t(x,qc),t(qc,lg),t(x,dg),p(e,Vd,m),p(e,S,m),t(S,mg),t(S,Bc),t(Bc,pg),t(S,fg),t(S,Ic),t(Ic,gg),t(S,hg),t(S,Ac),t(Ac,ug),t(S,_g),t(S,Cc),t(Cc,bg),t(S,vg),p(e,Md,m),p(e,z,m),t(z,$g),t(z,Nc),t(Nc,Tg),t(z,yg),t(z,Wc),t(Wc,kg),t(z,xg),t(z,Vc),t(Vc,Lg),t(z,wg),t(z,Mc),t(Mc,Eg),t(z,Pg),p(e,Gd,m),h(dr,e,m),p(e,jd,m),p(e,vt,m),t(vt,Fg),t(vt,Gc),t(Gc,Dg),t(vt,Sg),p(e,Hd,m),p(e,O,m),t(O,zg),t(O,jc),t(jc,Og),t(O,qg),t(O,Hc),t(Hc,Bg),t(O,Ig),t(O,Rc),t(Rc,Ag),t(O,Cg),t(O,Uc),t(Uc,Ng),t(O,Wg),p(e,Rd,m),p(e,hs,m),t(hs,Vg),p(e,Ud,m),p(e,Ye,m),t(Ye,$t),t($t,Kc),h(mr,Kc,null),t(Ye,Mg),t(Ye,Yc),t(Yc,Gg),p(e,Kd,m),p(e,Xe,m),h(pr,Xe,null),t(Xe,jg),t(Xe,Xc),t(Xc,Hg),p(e,Yd,m),p(e,Je,m),h(fr,Je,null),t(Je,Rg),t(Je,Jc),t(Jc,Ug),p(e,Xd,m),p(e,R,m),h(gr,R,null),t(R,Kg),t(R,Qc),t(Qc,Yg),t(R,Xg),t(R,Tt),h(hr,Tt,null),t(Tt,Jg),t(Tt,Zc),t(Zc,Qg),p(e,Jd,m),p(e,Qe,m),t(Qe,yt),t(yt,el),h(ur,el,null),t(Qe,Zg),t(Qe,tl),t(tl,eh),p(e,Qd,m),p(e,Ze,m),h(_r,Ze,null),t(Ze,th),t(Ze,rl),t(rl,rh),p(e,Zd,m),p(e,et,m),h(br,et,null),t(et,oh),t(et,ol),t(ol,nh),p(e,em,m),p(e,U,m),h(vr,U,null),t(U,sh),t(U,nl),t(nl,ah),t(U,ih),t(U,kt),h($r,kt,null),t(kt,ch),t(kt,sl),t(sl,lh),p(e,tm,m),p(e,tt,m),t(tt,xt),t(xt,al),h(Tr,al,null),t(tt,dh),t(tt,il),t(il,mh),p(e,rm,m),p(e,rt,m),h(yr,rt,null),t(rt,ph),t(rt,cl),t(cl,fh),p(e,om,m),p(e,ot,m),h(kr,ot,null),t(ot,gh),t(ot,ll),t(ll,hh),p(e,nm,m),p(e,nt,m),t(nt,Lt),t(Lt,dl),h(xr,dl,null),t(nt,uh),t(nt,ml),t(ml,_h),p(e,sm,m),p(e,st,m),h(Lr,st,null),t(st,bh),t(st,pl),t(pl,vh),p(e,am,m),p(e,at,m),h(wr,at,null),t(at,$h),t(at,fl),t(fl,Th),p(e,im,m),p(e,it,m),t(it,wt),t(wt,gl),h(Er,gl,null),t(it,yh),t(it,hl),t(hl,kh),p(e,cm,m),p(e,Et,m),t(Et,xh),t(Et,us),t(us,Lh),t(Et,wh),p(e,lm,m),p(e,K,m),h(Pr,K,null),t(K,Eh),t(K,ul),t(ul,Ph),t(K,Fh),t(K,Pt),h(Fr,Pt,null),t(Pt,Dh),t(Pt,_l),t(_l,Sh),p(e,dm,m),p(e,Y,m),h(Dr,Y,null),t(Y,zh),t(Y,E),t(E,Oh),t(E,_s),t(_s,qh),t(E,Bh),t(E,bs),t(bs,Ih),t(E,Ah),t(E,bl),t(bl,Ch),t(E,Nh),t(E,vl),t(vl,$l),t($l,Wh),t(E,Vh),t(E,vs),t(vs,Mh),t(E,Gh),t(E,$s),t($s,jh),t(E,Hh),t(Y,Rh),t(Y,Ts),h(Sr,Ts,null),p(e,mm,m),p(e,X,m),h(zr,X,null),t(X,Uh),t(X,Tl),t(Tl,Kh),t(X,Yh),t(X,Ft),h(Or,Ft,null),t(Ft,Xh),t(Ft,yl),t(yl,Jh),p(e,pm,m),p(e,J,m),h(qr,J,null),t(J,Qh),t(J,ys),t(ys,ks),t(ks,Zh),t(ys,eu),t(J,tu),t(J,xs),h(Br,xs,null),p(e,fm,m),p(e,Q,m),h(Ir,Q,null),t(Q,ru),t(Q,Ls),t(Ls,ws),t(ws,ou),t(Ls,nu),t(Q,su),t(Q,Es),h(Ar,Es,null),p(e,gm,m),p(e,Z,m),h(Cr,Z,null),t(Z,au),t(Z,Ps),t(Ps,Fs),t(Fs,iu),t(Ps,cu),t(Z,lu),t(Z,Ds),h(Nr,Ds,null),p(e,hm,m),p(e,ee,m),h(Wr,ee,null),t(ee,du),t(ee,Ss),t(Ss,zs),t(zs,mu),t(Ss,pu),t(ee,fu),t(ee,Os),h(Vr,Os,null),p(e,um,m),p(e,te,m),h(Mr,te,null),t(te,gu),t(te,qs),t(qs,Bs),t(Bs,hu),t(qs,uu),t(te,_u),t(te,Is),h(Gr,Is,null),p(e,_m,m),p(e,re,m),h(jr,re,null),t(re,bu),t(re,As),t(As,Cs),t(Cs,vu),t(As,$u),t(re,Tu),t(re,Ns),h(Hr,Ns,null),p(e,bm,m),p(e,oe,m),h(Rr,oe,null),t(oe,yu),t(oe,Dt),t(Dt,Ws),t(Ws,ku),t(Dt,xu),t(Dt,Ur),t(Ur,Lu),t(Dt,wu),t(oe,Eu),t(oe,Vs),h(Kr,Vs,null),p(e,vm,m),p(e,ne,m),h(Yr,ne,null),t(ne,Pu),t(ne,St),t(St,Ms),t(Ms,Fu),t(St,Du),t(St,Xr),t(Xr,Su),t(St,zu),t(ne,Ou),t(ne,Gs),h(Jr,Gs,null),p(e,$m,m),p(e,se,m),h(Qr,se,null),t(se,qu),t(se,js),t(js,Hs),t(Hs,Bu),t(js,Iu),t(se,Au),t(se,Rs),h(Zr,Rs,null),p(e,Tm,m),p(e,ae,m),h(eo,ae,null),t(ae,Cu),t(ae,zt),t(zt,Us),t(Us,Nu),t(zt,Wu),t(zt,to),t(to,Vu),t(zt,Mu),t(ae,Gu),t(ae,Ks),h(ro,Ks,null),p(e,ym,m),p(e,ie,m),h(oo,ie,null),t(ie,ju),t(ie,Ve),t(Ve,Ys),t(Ys,Hu),t(Ve,Ru),t(Ve,Xs),t(Xs,Uu),t(Ve,Ku),t(Ve,no),t(no,Yu),t(Ve,Xu),t(ie,Ju),t(ie,Js),h(so,Js,null),p(e,km,m),p(e,ce,m),h(ao,ce,null),t(ce,Qu),t(ce,Qs),t(Qs,Zs),t(Zs,Zu),t(Qs,e_),t(ce,t_),t(ce,ea),h(io,ea,null),p(e,xm,m),p(e,le,m),h(co,le,null),t(le,r_),t(le,Ot),t(Ot,ta),t(ta,o_),t(Ot,n_),t(Ot,kl),t(kl,s_),t(Ot,a_),t(le,i_),t(le,ra),h(lo,ra,null),p(e,Lm,m),p(e,de,m),h(mo,de,null),t(de,c_),t(de,G),t(G,oa),t(oa,l_),t(G,d_),t(G,xl),t(xl,m_),t(G,p_),t(G,Ll),t(Ll,f_),t(G,g_),t(G,wl),t(wl,h_),t(G,u_),t(de,__),t(de,na),h(po,na,null),p(e,wm,m),p(e,me,m),h(fo,me,null),t(me,b_),t(me,El),t(El,v_),t(me,$_),t(me,qt),h(go,qt,null),t(qt,T_),t(qt,Pl),t(Pl,y_),p(e,Em,m),p(e,pe,m),h(ho,pe,null),t(pe,k_),t(pe,A),t(A,x_),t(A,sa),t(sa,L_),t(A,w_),t(A,Fl),t(Fl,E_),t(A,P_),t(A,Dl),t(Dl,Sl),t(Sl,F_),t(A,D_),t(A,aa),t(aa,S_),t(A,z_),t(pe,O_),t(pe,ia),h(uo,ia,null),p(e,Pm,m),p(e,fe,m),h(_o,fe,null),t(fe,q_),t(fe,zl),t(zl,B_),t(fe,I_),t(fe,Bt),h(bo,Bt,null),t(Bt,A_),t(Bt,Ol),t(Ol,C_),p(e,Fm,m),p(e,ge,m),h(vo,ge,null),t(ge,N_),t(ge,ca),t(ca,la),t(la,W_),t(ca,V_),t(ge,M_),t(ge,da),h($o,da,null),p(e,Dm,m),p(e,he,m),h(To,he,null),t(he,G_),t(he,ma),t(ma,pa),t(pa,j_),t(ma,H_),t(he,R_),t(he,fa),h(yo,fa,null),p(e,Sm,m),p(e,ue,m),h(ko,ue,null),t(ue,U_),t(ue,ga),t(ga,ha),t(ha,K_),t(ga,Y_),t(ue,X_),t(ue,ua),h(xo,ua,null),p(e,zm,m),p(e,_e,m),h(Lo,_e,null),t(_e,J_),t(_e,_a),t(_a,ba),t(ba,Q_),t(_a,Z_),t(_e,eb),t(_e,va),h(wo,va,null),p(e,Om,m),p(e,be,m),h(Eo,be,null),t(be,tb),t(be,$a),t($a,Ta),t(Ta,rb),t($a,ob),t(be,nb),t(be,ya),h(Po,ya,null),p(e,qm,m),p(e,ve,m),h(Fo,ve,null),t(ve,sb),t(ve,It),t(It,ka),t(ka,ab),t(It,ib),t(It,Do),t(Do,cb),t(It,lb),t(ve,db),t(ve,xa),h(So,xa,null),p(e,Bm,m),p(e,$e,m),h(zo,$e,null),t($e,mb),t($e,La),t(La,wa),t(wa,pb),t(La,fb),t($e,gb),t($e,Ea),h(Oo,Ea,null),p(e,Im,m),p(e,Te,m),h(qo,Te,null),t(Te,hb),t(Te,Pa),t(Pa,Fa),t(Fa,ub),t(Pa,_b),t(Te,bb),t(Te,Da),h(Bo,Da,null),p(e,Am,m),p(e,ye,m),h(Io,ye,null),t(ye,vb),t(ye,At),t(At,Sa),t(Sa,$b),t(At,Tb),t(At,ql),t(ql,yb),t(At,kb),t(ye,xb),t(ye,za),h(Ao,za,null),p(e,Cm,m),p(e,ke,m),h(Co,ke,null),t(ke,Lb),t(ke,Bl),t(Bl,wb),t(ke,Eb),t(ke,Ct),h(No,Ct,null),t(Ct,Pb),t(Ct,Il),t(Il,Fb),p(e,Nm,m),p(e,xe,m),h(Wo,xe,null),t(xe,Db),t(xe,P),t(P,Sb),t(P,Oa),t(Oa,zb),t(P,Ob),t(P,qa),t(qa,qb),t(P,Bb),t(P,Al),t(Al,Ib),t(P,Ab),t(P,Cl),t(Cl,Nl),t(Nl,Cb),t(P,Nb),t(P,Ba),t(Ba,Wb),t(P,Vb),t(P,Ia),t(Ia,Mb),t(P,Gb),t(xe,jb),t(xe,Aa),h(Vo,Aa,null),p(e,Wm,m),p(e,Le,m),h(Mo,Le,null),t(Le,Hb),t(Le,Wl),t(Wl,Rb),t(Le,Ub),t(Le,Nt),h(Go,Nt,null),t(Nt,Kb),t(Nt,Vl),t(Vl,Yb),p(e,Vm,m),p(e,we,m),h(jo,we,null),t(we,Xb),t(we,Ca),t(Ca,Na),t(Na,Jb),t(Ca,Qb),t(we,Zb),t(we,Wa),h(Ho,Wa,null),p(e,Mm,m),p(e,Ee,m),h(Ro,Ee,null),t(Ee,ev),t(Ee,Va),t(Va,Ma),t(Ma,tv),t(Va,rv),t(Ee,ov),t(Ee,Ga),h(Uo,Ga,null),p(e,Gm,m),p(e,Pe,m),h(Ko,Pe,null),t(Pe,nv),t(Pe,ja),t(ja,Ha),t(Ha,sv),t(ja,av),t(Pe,iv),t(Pe,Ra),h(Yo,Ra,null),p(e,jm,m),p(e,Fe,m),h(Xo,Fe,null),t(Fe,cv),t(Fe,Ua),t(Ua,Ka),t(Ka,lv),t(Ua,dv),t(Fe,mv),t(Fe,Ya),h(Jo,Ya,null),p(e,Hm,m),p(e,De,m),h(Qo,De,null),t(De,pv),t(De,Wt),t(Wt,Xa),t(Xa,fv),t(Wt,gv),t(Wt,Ml),t(Ml,hv),t(Wt,uv),t(De,_v),t(De,Ja),h(Zo,Ja,null),p(e,Rm,m),p(e,Se,m),h(en,Se,null),t(Se,bv),t(Se,Qa),t(Qa,Za),t(Za,vv),t(Qa,$v),t(Se,Tv),t(Se,ei),h(tn,ei,null),p(e,Um,m),p(e,ct,m),t(ct,Vt),t(Vt,Gl),h(rn,Gl,null),t(ct,yv),t(ct,jl),t(jl,kv),p(e,Km,m),p(e,Mt,m),t(Mt,xv),t(Mt,ti),t(ti,Lv),t(Mt,wv),p(e,Ym,m),p(e,ze,m),h(on,ze,null),t(ze,Ev),t(ze,Hl),t(Hl,Pv),t(ze,Fv),t(ze,ri),h(nn,ri,null),p(e,Xm,m),p(e,lt,m),h(sn,lt,null),t(lt,Dv),t(lt,oi),h(an,oi,null),p(e,Jm,m),p(e,Oe,m),h(cn,Oe,null),t(Oe,Sv),t(Oe,ln),t(ln,zv),t(ln,Rl),t(Rl,Ov),t(ln,qv),t(Oe,Bv),t(Oe,ni),h(dn,ni,null),p(e,Qm,m),p(e,qe,m),h(mn,qe,null),t(qe,Iv),t(qe,pn),t(pn,Av),t(pn,Ul),t(Ul,Cv),t(pn,Nv),t(qe,Wv),t(qe,si),h(fn,si,null),p(e,Zm,m),p(e,dt,m),t(dt,Gt),t(Gt,Kl),h(gn,Kl,null),t(dt,Vv),t(dt,Yl),t(Yl,Mv),p(e,ep,m),p(e,jt,m),t(jt,Gv),t(jt,ai),t(ai,jv),t(jt,Hv),p(e,tp,m),p(e,$,m),h(hn,$,null),t($,Rv),t($,Xl),t(Xl,Uv),t($,Kv),t($,Jl),t(Jl,Yv),t($,Xv),h(Ht,$,null),t($,Jv),t($,Ql),t(Ql,Qv),t($,Zv),t($,Rt),h(un,Rt,null),t(Rt,e$),t(Rt,Zl),t(Zl,t$),t($,r$),t($,Ut),h(_n,Ut,null),t(Ut,o$),t(Ut,ed),t(ed,n$),t($,s$),t($,Kt),h(bn,Kt,null),t(Kt,a$),t(Kt,td),t(td,i$),t($,c$),t($,Yt),h(vn,Yt,null),t(Yt,l$),t(Yt,$n),t($n,d$),t($n,rd),t(rd,m$),t($n,p$),t($,f$),t($,Xt),h(Tn,Xt,null),t(Xt,g$),t(Xt,od),t(od,h$),t($,u$),t($,Jt),h(yn,Jt,null),t(Jt,_$),t(Jt,nd),t(nd,b$),t($,v$),t($,Me),h(kn,Me,null),t(Me,$$),t(Me,xn),t(xn,T$),t(xn,sd),t(sd,y$),t(xn,k$),t(Me,x$),t(Me,ad),t(ad,L$),p(e,rp,m),p(e,mt,m),h(Ln,mt,null),t(mt,w$),t(mt,ii),t(ii,ci),t(ci,E$),t(ii,P$),p(e,op,m),p(e,pt,m),h(wn,pt,null),t(pt,F$),t(pt,En),t(En,D$),t(En,li),t(li,S$),t(En,z$),p(e,np,m),p(e,C,m),h(Pn,C,null),t(C,O$),t(C,id),t(id,q$),t(C,B$),t(C,D),h(Fn,D,null),t(D,I$),t(D,cd),t(cd,A$),t(D,C$),t(D,ft),t(ft,N$),t(ft,ld),t(ld,W$),t(ft,V$),t(ft,dd),t(dd,M$),t(ft,G$),t(D,j$),t(D,md),t(md,pd),t(pd,H$),t(D,R$),t(D,Be),t(Be,U$),t(Be,fd),t(fd,K$),t(Be,Y$),t(Be,gd),t(gd,X$),t(Be,J$),t(Be,hd),t(hd,Q$),t(Be,Z$),t(D,eT),t(D,ud),t(ud,tT),t(C,rT),t(C,Qt),h(Dn,Qt,null),t(Qt,oT),t(Qt,_d),t(_d,nT),p(e,sp,m),p(e,gt,m),t(gt,Zt),t(Zt,bd),h(Sn,bd,null),t(gt,sT),t(gt,vd),t(vd,aT),p(e,ap,m),p(e,N,m),h(zn,N,null),t(N,iT),t(N,ht),t(ht,cT),t(ht,di),t(di,lT),t(ht,dT),t(ht,mi),t(mi,mT),t(ht,pT),t(N,fT),t(N,pi),h(On,pi,null),t(N,gT),t(N,fi),h(qn,fi,null),p(e,ip,m),p(e,F,m),h(Bn,F,null),t(F,hT),t(F,gi),t(gi,hi),t(hi,uT),t(gi,_T),t(F,bT),t(F,In),t(In,vT),t(In,An),t(An,$T),t(In,TT),t(F,yT),t(F,ui),t(ui,kT),t(ui,Cn),t(Cn,xT),t(F,LT),t(F,_i),h(Nn,_i,null),t(F,wT),t(F,bi),h(Wn,bi,null),p(e,cp,m),p(e,W,m),h(Vn,W,null),t(W,ET),t(W,vi),t(vi,$i),t($i,PT),t(vi,FT),t(W,DT),t(W,Ti),h(Mn,Ti,null),t(W,ST),t(W,yi),h(Gn,yi,null),p(e,lp,m),p(e,ut,m),t(ut,er),t(er,$d),h(jn,$d,null),t(ut,zT),t(ut,Td),t(Td,OT),p(e,dp,m),p(e,Ie,m),h(Hn,Ie,null),t(Ie,qT),t(Ie,yd),t(yd,BT),t(Ie,IT),t(Ie,ki),t(ki,AT),t(ki,Rn),t(Rn,CT),p(e,mp,m),p(e,Ae,m),h(Un,Ae,null),t(Ae,NT),t(Ae,kd),t(kd,WT),t(Ae,VT),t(Ae,xi),t(xi,MT),t(xi,Kn),t(Kn,GT),pp=!0},p(e,[m]){const Yn={};m&2&&(Yn.$$scope={dirty:m,ctx:e}),Ht.$set(Yn)},i(e){pp||(u(ir.$$.fragment,e),u(cr.$$.fragment,e),u(lr.$$.fragment,e),u(dr.$$.fragment,e),u(mr.$$.fragment,e),u(pr.$$.fragment,e),u(fr.$$.fragment,e),u(gr.$$.fragment,e),u(hr.$$.fragment,e),u(ur.$$.fragment,e),u(_r.$$.fragment,e),u(br.$$.fragment,e),u(vr.$$.fragment,e),u($r.$$.fragment,e),u(Tr.$$.fragment,e),u(yr.$$.fragment,e),u(kr.$$.fragment,e),u(xr.$$.fragment,e),u(Lr.$$.fragment,e),u(wr.$$.fragment,e),u(Er.$$.fragment,e),u(Pr.$$.fragment,e),u(Fr.$$.fragment,e),u(Dr.$$.fragment,e),u(Sr.$$.fragment,e),u(zr.$$.fragment,e),u(Or.$$.fragment,e),u(qr.$$.fragment,e),u(Br.$$.fragment,e),u(Ir.$$.fragment,e),u(Ar.$$.fragment,e),u(Cr.$$.fragment,e),u(Nr.$$.fragment,e),u(Wr.$$.fragment,e),u(Vr.$$.fragment,e),u(Mr.$$.fragment,e),u(Gr.$$.fragment,e),u(jr.$$.fragment,e),u(Hr.$$.fragment,e),u(Rr.$$.fragment,e),u(Kr.$$.fragment,e),u(Yr.$$.fragment,e),u(Jr.$$.fragment,e),u(Qr.$$.fragment,e),u(Zr.$$.fragment,e),u(eo.$$.fragment,e),u(ro.$$.fragment,e),u(oo.$$.fragment,e),u(so.$$.fragment,e),u(ao.$$.fragment,e),u(io.$$.fragment,e),u(co.$$.fragment,e),u(lo.$$.fragment,e),u(mo.$$.fragment,e),u(po.$$.fragment,e),u(fo.$$.fragment,e),u(go.$$.fragment,e),u(ho.$$.fragment,e),u(uo.$$.fragment,e),u(_o.$$.fragment,e),u(bo.$$.fragment,e),u(vo.$$.fragment,e),u($o.$$.fragment,e),u(To.$$.fragment,e),u(yo.$$.fragment,e),u(ko.$$.fragment,e),u(xo.$$.fragment,e),u(Lo.$$.fragment,e),u(wo.$$.fragment,e),u(Eo.$$.fragment,e),u(Po.$$.fragment,e),u(Fo.$$.fragment,e),u(So.$$.fragment,e),u(zo.$$.fragment,e),u(Oo.$$.fragment,e),u(qo.$$.fragment,e),u(Bo.$$.fragment,e),u(Io.$$.fragment,e),u(Ao.$$.fragment,e),u(Co.$$.fragment,e),u(No.$$.fragment,e),u(Wo.$$.fragment,e),u(Vo.$$.fragment,e),u(Mo.$$.fragment,e),u(Go.$$.fragment,e),u(jo.$$.fragment,e),u(Ho.$$.fragment,e),u(Ro.$$.fragment,e),u(Uo.$$.fragment,e),u(Ko.$$.fragment,e),u(Yo.$$.fragment,e),u(Xo.$$.fragment,e),u(Jo.$$.fragment,e),u(Qo.$$.fragment,e),u(Zo.$$.fragment,e),u(en.$$.fragment,e),u(tn.$$.fragment,e),u(rn.$$.fragment,e),u(on.$$.fragment,e),u(nn.$$.fragment,e),u(sn.$$.fragment,e),u(an.$$.fragment,e),u(cn.$$.fragment,e),u(dn.$$.fragment,e),u(mn.$$.fragment,e),u(fn.$$.fragment,e),u(gn.$$.fragment,e),u(hn.$$.fragment,e),u(Ht.$$.fragment,e),u(un.$$.fragment,e),u(_n.$$.fragment,e),u(bn.$$.fragment,e),u(vn.$$.fragment,e),u(Tn.$$.fragment,e),u(yn.$$.fragment,e),u(kn.$$.fragment,e),u(Ln.$$.fragment,e),u(wn.$$.fragment,e),u(Pn.$$.fragment,e),u(Fn.$$.fragment,e),u(Dn.$$.fragment,e),u(Sn.$$.fragment,e),u(zn.$$.fragment,e),u(On.$$.fragment,e),u(qn.$$.fragment,e),u(Bn.$$.fragment,e),u(Nn.$$.fragment,e),u(Wn.$$.fragment,e),u(Vn.$$.fragment,e),u(Mn.$$.fragment,e),u(Gn.$$.fragment,e),u(jn.$$.fragment,e),u(Hn.$$.fragment,e),u(Un.$$.fragment,e),pp=!0)},o(e){_(ir.$$.fragment,e),_(cr.$$.fragment,e),_(lr.$$.fragment,e),_(dr.$$.fragment,e),_(mr.$$.fragment,e),_(pr.$$.fragment,e),_(fr.$$.fragment,e),_(gr.$$.fragment,e),_(hr.$$.fragment,e),_(ur.$$.fragment,e),_(_r.$$.fragment,e),_(br.$$.fragment,e),_(vr.$$.fragment,e),_($r.$$.fragment,e),_(Tr.$$.fragment,e),_(yr.$$.fragment,e),_(kr.$$.fragment,e),_(xr.$$.fragment,e),_(Lr.$$.fragment,e),_(wr.$$.fragment,e),_(Er.$$.fragment,e),_(Pr.$$.fragment,e),_(Fr.$$.fragment,e),_(Dr.$$.fragment,e),_(Sr.$$.fragment,e),_(zr.$$.fragment,e),_(Or.$$.fragment,e),_(qr.$$.fragment,e),_(Br.$$.fragment,e),_(Ir.$$.fragment,e),_(Ar.$$.fragment,e),_(Cr.$$.fragment,e),_(Nr.$$.fragment,e),_(Wr.$$.fragment,e),_(Vr.$$.fragment,e),_(Mr.$$.fragment,e),_(Gr.$$.fragment,e),_(jr.$$.fragment,e),_(Hr.$$.fragment,e),_(Rr.$$.fragment,e),_(Kr.$$.fragment,e),_(Yr.$$.fragment,e),_(Jr.$$.fragment,e),_(Qr.$$.fragment,e),_(Zr.$$.fragment,e),_(eo.$$.fragment,e),_(ro.$$.fragment,e),_(oo.$$.fragment,e),_(so.$$.fragment,e),_(ao.$$.fragment,e),_(io.$$.fragment,e),_(co.$$.fragment,e),_(lo.$$.fragment,e),_(mo.$$.fragment,e),_(po.$$.fragment,e),_(fo.$$.fragment,e),_(go.$$.fragment,e),_(ho.$$.fragment,e),_(uo.$$.fragment,e),_(_o.$$.fragment,e),_(bo.$$.fragment,e),_(vo.$$.fragment,e),_($o.$$.fragment,e),_(To.$$.fragment,e),_(yo.$$.fragment,e),_(ko.$$.fragment,e),_(xo.$$.fragment,e),_(Lo.$$.fragment,e),_(wo.$$.fragment,e),_(Eo.$$.fragment,e),_(Po.$$.fragment,e),_(Fo.$$.fragment,e),_(So.$$.fragment,e),_(zo.$$.fragment,e),_(Oo.$$.fragment,e),_(qo.$$.fragment,e),_(Bo.$$.fragment,e),_(Io.$$.fragment,e),_(Ao.$$.fragment,e),_(Co.$$.fragment,e),_(No.$$.fragment,e),_(Wo.$$.fragment,e),_(Vo.$$.fragment,e),_(Mo.$$.fragment,e),_(Go.$$.fragment,e),_(jo.$$.fragment,e),_(Ho.$$.fragment,e),_(Ro.$$.fragment,e),_(Uo.$$.fragment,e),_(Ko.$$.fragment,e),_(Yo.$$.fragment,e),_(Xo.$$.fragment,e),_(Jo.$$.fragment,e),_(Qo.$$.fragment,e),_(Zo.$$.fragment,e),_(en.$$.fragment,e),_(tn.$$.fragment,e),_(rn.$$.fragment,e),_(on.$$.fragment,e),_(nn.$$.fragment,e),_(sn.$$.fragment,e),_(an.$$.fragment,e),_(cn.$$.fragment,e),_(dn.$$.fragment,e),_(mn.$$.fragment,e),_(fn.$$.fragment,e),_(gn.$$.fragment,e),_(hn.$$.fragment,e),_(Ht.$$.fragment,e),_(un.$$.fragment,e),_(_n.$$.fragment,e),_(bn.$$.fragment,e),_(vn.$$.fragment,e),_(Tn.$$.fragment,e),_(yn.$$.fragment,e),_(kn.$$.fragment,e),_(Ln.$$.fragment,e),_(wn.$$.fragment,e),_(Pn.$$.fragment,e),_(Fn.$$.fragment,e),_(Dn.$$.fragment,e),_(Sn.$$.fragment,e),_(zn.$$.fragment,e),_(On.$$.fragment,e),_(qn.$$.fragment,e),_(Bn.$$.fragment,e),_(Nn.$$.fragment,e),_(Wn.$$.fragment,e),_(Vn.$$.fragment,e),_(Mn.$$.fragment,e),_(Gn.$$.fragment,e),_(jn.$$.fragment,e),_(Hn.$$.fragment,e),_(Un.$$.fragment,e),pp=!1},d(e){r(w),e&&r(Ue),e&&r(k),b(ir),e&&r(zd),e&&r(y),e&&r(Od),e&&r(ss),e&&r(qd),e&&r(Ke),b(cr),e&&r(Bd),e&&r(V),e&&r(Id),e&&r(ls),e&&r(Ad),b(lr,e),e&&r(Cd),e&&r(We),e&&r(Nd),e&&r(M),e&&r(Wd),e&&r(x),e&&r(Vd),e&&r(S),e&&r(Md),e&&r(z),e&&r(Gd),b(dr,e),e&&r(jd),e&&r(vt),e&&r(Hd),e&&r(O),e&&r(Rd),e&&r(hs),e&&r(Ud),e&&r(Ye),b(mr),e&&r(Kd),e&&r(Xe),b(pr),e&&r(Yd),e&&r(Je),b(fr),e&&r(Xd),e&&r(R),b(gr),b(hr),e&&r(Jd),e&&r(Qe),b(ur),e&&r(Qd),e&&r(Ze),b(_r),e&&r(Zd),e&&r(et),b(br),e&&r(em),e&&r(U),b(vr),b($r),e&&r(tm),e&&r(tt),b(Tr),e&&r(rm),e&&r(rt),b(yr),e&&r(om),e&&r(ot),b(kr),e&&r(nm),e&&r(nt),b(xr),e&&r(sm),e&&r(st),b(Lr),e&&r(am),e&&r(at),b(wr),e&&r(im),e&&r(it),b(Er),e&&r(cm),e&&r(Et),e&&r(lm),e&&r(K),b(Pr),b(Fr),e&&r(dm),e&&r(Y),b(Dr),b(Sr),e&&r(mm),e&&r(X),b(zr),b(Or),e&&r(pm),e&&r(J),b(qr),b(Br),e&&r(fm),e&&r(Q),b(Ir),b(Ar),e&&r(gm),e&&r(Z),b(Cr),b(Nr),e&&r(hm),e&&r(ee),b(Wr),b(Vr),e&&r(um),e&&r(te),b(Mr),b(Gr),e&&r(_m),e&&r(re),b(jr),b(Hr),e&&r(bm),e&&r(oe),b(Rr),b(Kr),e&&r(vm),e&&r(ne),b(Yr),b(Jr),e&&r($m),e&&r(se),b(Qr),b(Zr),e&&r(Tm),e&&r(ae),b(eo),b(ro),e&&r(ym),e&&r(ie),b(oo),b(so),e&&r(km),e&&r(ce),b(ao),b(io),e&&r(xm),e&&r(le),b(co),b(lo),e&&r(Lm),e&&r(de),b(mo),b(po),e&&r(wm),e&&r(me),b(fo),b(go),e&&r(Em),e&&r(pe),b(ho),b(uo),e&&r(Pm),e&&r(fe),b(_o),b(bo),e&&r(Fm),e&&r(ge),b(vo),b($o),e&&r(Dm),e&&r(he),b(To),b(yo),e&&r(Sm),e&&r(ue),b(ko),b(xo),e&&r(zm),e&&r(_e),b(Lo),b(wo),e&&r(Om),e&&r(be),b(Eo),b(Po),e&&r(qm),e&&r(ve),b(Fo),b(So),e&&r(Bm),e&&r($e),b(zo),b(Oo),e&&r(Im),e&&r(Te),b(qo),b(Bo),e&&r(Am),e&&r(ye),b(Io),b(Ao),e&&r(Cm),e&&r(ke),b(Co),b(No),e&&r(Nm),e&&r(xe),b(Wo),b(Vo),e&&r(Wm),e&&r(Le),b(Mo),b(Go),e&&r(Vm),e&&r(we),b(jo),b(Ho),e&&r(Mm),e&&r(Ee),b(Ro),b(Uo),e&&r(Gm),e&&r(Pe),b(Ko),b(Yo),e&&r(jm),e&&r(Fe),b(Xo),b(Jo),e&&r(Hm),e&&r(De),b(Qo),b(Zo),e&&r(Rm),e&&r(Se),b(en),b(tn),e&&r(Um),e&&r(ct),b(rn),e&&r(Km),e&&r(Mt),e&&r(Ym),e&&r(ze),b(on),b(nn),e&&r(Xm),e&&r(lt),b(sn),b(an),e&&r(Jm),e&&r(Oe),b(cn),b(dn),e&&r(Qm),e&&r(qe),b(mn),b(fn),e&&r(Zm),e&&r(dt),b(gn),e&&r(ep),e&&r(jt),e&&r(tp),e&&r($),b(hn),b(Ht),b(un),b(_n),b(bn),b(vn),b(Tn),b(yn),b(kn),e&&r(rp),e&&r(mt),b(Ln),e&&r(op),e&&r(pt),b(wn),e&&r(np),e&&r(C),b(Pn),b(Fn),b(Dn),e&&r(sp),e&&r(gt),b(Sn),e&&r(ap),e&&r(N),b(zn),b(On),b(qn),e&&r(ip),e&&r(F),b(Bn),b(Nn),b(Wn),e&&r(cp),e&&r(W),b(Vn),b(Mn),b(Gn),e&&r(lp),e&&r(ut),b(jn),e&&r(dp),e&&r(Ie),b(Hn),e&&r(mp),e&&r(Ae),b(Un)}}}const Qk={local:"utilities-for-generation",sections:[{local:"generate-outputs",sections:[{local:"transformers.generation.GreedySearchDecoderOnlyOutput",title:"GreedySearchOutput"},{local:"transformers.generation.SampleDecoderOnlyOutput",title:"SampleOutput"},{local:"transformers.generation.BeamSearchDecoderOnlyOutput",title:"BeamSearchOutput"},{local:"transformers.generation.BeamSampleDecoderOnlyOutput",title:"BeamSampleOutput"}],title:"Generate Outputs"},{local:"transformers.LogitsProcessor",title:"LogitsProcessor"},{local:"transformers.StoppingCriteria",title:"StoppingCriteria"},{local:"transformers.Constraint",title:"Constraints"},{local:"transformers.BeamScorer",title:"BeamSearch"},{local:"transformers.top_k_top_p_filtering",title:"Utilities"}],title:"Utilities for Generation"};function Zk(Sd){return Uk(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class s4 extends Gk{constructor(w){super();jk(this,w,Zk,Jk,Hk,{})}}export{s4 as default,Qk as metadata};
