import{S as f0,i as g0,s as h0,e as o,k as c,w as f,t as a,M as u0,c as n,d as t,m as l,a as s,x as g,h as i,b as d,G as r,g as m,y as h,q as u,o as _,B as b,v as _0,L as b0}from"../../chunks/vendor-hf-doc-builder.js";import{D as v}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Y$}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ie}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as v0}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function $0(bd){let w,He;return w=new Y$({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,Ce){h(w,k,Ce),He=!0},p:b0,i(k){He||(u(w.$$.fragment,k),He=!0)},o(k){_(w.$$.fragment,k),He=!1},d(k){b(w,k)}}}function T0(bd){let w,He,k,Ce,cc,st,Rm,lc,Km,vd,y,Um,Rn,Ym,Xm,Kn,Jm,Qm,Un,Zm,ef,Yn,rf,tf,Xn,of,nf,Jn,sf,af,Qn,cf,lf,$d,Zn,df,Td,Re,_r,dc,at,pf,pc,mf,yd,V,ff,es,gf,hf,rs,uf,_f,ts,bf,vf,kd,os,$f,xd,it,wd,We,Tf,mc,yf,kf,ns,xf,wf,Ld,M,ss,fc,Lf,Ef,Pf,as,gc,Ff,Df,Sf,is,hc,zf,Of,qf,cs,uc,Bf,If,Ed,x,Cf,_c,Wf,Af,bc,Nf,Vf,vc,Mf,Gf,$c,jf,Hf,Tc,Rf,Kf,yc,Uf,Yf,Pd,S,Xf,kc,Jf,Qf,xc,Zf,eg,wc,rg,tg,Lc,og,ng,Fd,z,sg,Ec,ag,ig,Pc,cg,lg,Fc,dg,pg,Dc,mg,fg,Dd,ct,Sd,br,gg,Sc,hg,ug,zd,O,_g,zc,bg,vg,Oc,$g,Tg,qc,yg,kg,Bc,xg,wg,Od,ls,Lg,qd,Ke,vr,Ic,lt,Eg,Cc,Pg,Bd,Ue,dt,Fg,Wc,Dg,Id,Ye,pt,Sg,Ac,zg,Cd,R,mt,Og,Nc,qg,Bg,$r,ft,Ig,Vc,Cg,Wd,Xe,Tr,Mc,gt,Wg,Gc,Ag,Ad,Je,ht,Ng,jc,Vg,Nd,Qe,ut,Mg,Hc,Gg,Vd,K,_t,jg,Rc,Hg,Rg,yr,bt,Kg,Kc,Ug,Md,Ze,kr,Uc,vt,Yg,Yc,Xg,Gd,er,$t,Jg,Xc,Qg,jd,rr,Tt,Zg,Jc,eh,Hd,tr,xr,Qc,yt,rh,Zc,th,Rd,or,kt,oh,el,nh,Kd,nr,xt,sh,rl,ah,Ud,sr,wr,tl,wt,ih,ol,ch,Yd,Lr,lh,ds,dh,ph,Xd,U,Lt,mh,nl,fh,gh,Er,Et,hh,sl,uh,Jd,Y,Pt,_h,L,bh,ps,vh,$h,ms,Th,yh,al,kh,xh,il,cl,wh,Lh,fs,Eh,Ph,gs,Fh,Dh,Sh,hs,Ft,Qd,X,Dt,zh,ll,Oh,qh,Pr,St,Bh,dl,Ih,Zd,J,zt,Ch,us,_s,Wh,Ah,Nh,bs,Ot,ep,Q,qt,Vh,vs,$s,Mh,Gh,jh,Ts,Bt,rp,Z,It,Hh,ys,ks,Rh,Kh,Uh,xs,Ct,tp,ee,Wt,Yh,ws,Ls,Xh,Jh,Qh,Es,At,op,re,Nt,Zh,Ps,Fs,eu,ru,tu,Ds,Vt,np,ar,Mt,ou,Ss,Gt,sp,te,jt,nu,Fr,zs,su,au,Ht,iu,cu,lu,Os,Rt,ap,oe,Kt,du,qs,Bs,pu,mu,fu,Is,Ut,ip,ne,Yt,gu,Dr,Cs,hu,uu,Xt,_u,bu,vu,Ws,Jt,cp,se,Qt,$u,Ae,As,Tu,yu,Ns,ku,xu,Zt,wu,Lu,Eu,Vs,eo,lp,ae,ro,Pu,Ms,Gs,Fu,Du,Su,js,to,dp,ie,oo,zu,Sr,Hs,Ou,qu,pl,Bu,Iu,Cu,Rs,no,pp,ce,so,Wu,G,Ks,Au,Nu,ml,Vu,Mu,fl,Gu,ju,gl,Hu,Ru,Ku,Us,ao,mp,le,io,Uu,hl,Yu,Xu,zr,co,Ju,ul,Qu,fp,de,lo,Zu,C,e_,Ys,r_,t_,_l,o_,n_,bl,vl,s_,a_,Xs,i_,c_,l_,Js,po,gp,pe,mo,d_,$l,p_,m_,Or,fo,f_,Tl,g_,hp,me,go,h_,Qs,Zs,u_,__,b_,ea,ho,up,fe,uo,v_,ra,ta,$_,T_,y_,oa,_o,_p,ge,bo,k_,na,sa,x_,w_,L_,aa,vo,bp,he,$o,E_,ia,ca,P_,F_,D_,la,To,vp,ue,yo,S_,da,pa,z_,O_,q_,ma,ko,$p,_e,xo,B_,qr,fa,I_,C_,wo,W_,A_,N_,ga,Lo,Tp,be,Eo,V_,ha,ua,M_,G_,j_,_a,Po,yp,ve,Fo,H_,ba,va,R_,K_,U_,$a,Do,kp,$e,So,Y_,Br,Ta,X_,J_,yl,Q_,Z_,eb,ya,zo,xp,Te,Oo,rb,kl,tb,ob,Ir,qo,nb,xl,sb,wp,ye,Bo,ab,E,ib,ka,cb,lb,xa,db,pb,wl,mb,fb,Ll,El,gb,hb,wa,ub,_b,La,bb,vb,$b,Ea,Io,Lp,ke,Co,Tb,Pl,yb,kb,Cr,Wo,xb,Fl,wb,Ep,xe,Ao,Lb,Pa,Fa,Eb,Pb,Fb,Da,No,Pp,we,Vo,Db,Sa,za,Sb,zb,Ob,Oa,Mo,Fp,Le,Go,qb,qa,Ba,Bb,Ib,Cb,Ia,jo,Dp,Ee,Ho,Wb,Ca,Wa,Ab,Nb,Vb,Aa,Ro,Sp,Pe,Ko,Mb,Wr,Na,Gb,jb,Dl,Hb,Rb,Kb,Va,Uo,zp,Fe,Yo,Ub,Ma,Ga,Yb,Xb,Jb,ja,Xo,Op,ir,Ar,Sl,Jo,Qb,zl,Zb,qp,Nr,ev,Ha,rv,tv,Bp,De,Qo,ov,Ol,nv,sv,Ra,Zo,Ip,cr,en,av,Ka,rn,Cp,Se,tn,iv,on,cv,ql,lv,dv,pv,Ua,nn,Wp,ze,sn,mv,an,fv,Bl,gv,hv,uv,Ya,cn,Ap,lr,Vr,Il,ln,_v,Cl,bv,Np,Mr,vv,Xa,$v,Tv,Vp,$,dn,yv,Wl,kv,xv,Al,wv,Lv,Gr,Ev,Nl,Pv,Fv,jr,pn,Dv,Vl,Sv,zv,Hr,mn,Ov,Ml,qv,Bv,Rr,fn,Iv,Gl,Cv,Wv,Kr,gn,Av,hn,Nv,jl,Vv,Mv,Gv,Ur,un,jv,Hl,Hv,Rv,Yr,_n,Kv,Rl,Uv,Yv,Ne,bn,Xv,vn,Jv,Kl,Qv,Zv,e1,Ul,r1,Mp,dr,$n,t1,Ja,Qa,o1,n1,Gp,pr,Tn,s1,yn,a1,Za,i1,c1,jp,W,kn,l1,Yl,d1,p1,F,xn,m1,Xl,f1,g1,mr,h1,Jl,u1,_1,Ql,b1,v1,$1,Zl,ed,T1,y1,Oe,k1,rd,x1,w1,td,L1,E1,od,P1,F1,D1,nd,S1,z1,Xr,wn,O1,sd,q1,Hp,fr,Jr,ad,Ln,B1,id,I1,Rp,A,En,C1,gr,W1,ei,A1,N1,ri,V1,M1,G1,ti,Pn,j1,oi,Fn,Kp,P,Dn,H1,ni,si,R1,K1,U1,Sn,Y1,zn,X1,J1,Q1,ai,Z1,On,e$,r$,ii,qn,t$,ci,Bn,Up,N,In,o$,li,di,n$,s$,a$,pi,Cn,i$,mi,Wn,Yp,hr,Qr,cd,An,c$,ld,l$,Xp,qe,Nn,d$,dd,p$,m$,fi,f$,Vn,g$,Jp,Be,Mn,h$,pd,u$,_$,gi,b$,Gn,v$,Qp;return st=new Ie({}),at=new Ie({}),it=new Y$({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>)`}}),ct=new Y$({props:{code:"generation_output[:2]",highlighted:'generation_output[:<span class="hljs-number">2</span>]'}}),lt=new Ie({}),dt=new v({props:{name:"class transformers.generation_utils.GreedySearchDecoderOnlyOutput",anchor:"transformers.generation_utils.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_utils.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_utils.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. <code>(max_length-input_ids.shape[-1],)</code>-shaped tuple of <code>torch.FloatTensor</code> with each
tensor of shape <code>(batch_size, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation_utils.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_utils.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/vr_17548/src/transformers/generation_utils.py#L62"}}),pt=new v({props:{name:"class transformers.generation_utils.GreedySearchEncoderDecoderOutput",anchor:"transformers.generation_utils.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_utils.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_utils.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. <code>(max_length-1,)</code>-shaped tuple of <code>torch.FloatTensor</code> with each tensor of shape
<code>(batch_size, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation_utils.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_utils.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_utils.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_utils.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_utils.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/vr_17548/src/transformers/generation_utils.py#L90"}}),mt=new v({props:{name:"class transformers.generation_flax_utils.FlaxGreedySearchOutput",anchor:"transformers.generation_flax_utils.FlaxGreedySearchOutput",parameters:[{name:"sequences",val:": ndarray = None"}],parametersDescription:[{anchor:"transformers.generation_flax_utils.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/vr_17548/src/transformers/generation_flax_utils.py#L44"}}),ft=new v({props:{name:"replace",anchor:"transformers.generation_flax_utils.FlaxGreedySearchOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/flax/struct.py#L120"}}),gt=new Ie({}),ht=new v({props:{name:"class transformers.generation_utils.SampleDecoderOnlyOutput",anchor:"transformers.generation_utils.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_utils.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_utils.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. <code>(max_length-input_ids.shape[-1],)</code>-shaped tuple of <code>torch.FloatTensor</code> with each
tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation_utils.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_utils.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/vr_17548/src/transformers/generation_utils.py#L132"}}),ut=new v({props:{name:"class transformers.generation_utils.SampleEncoderDecoderOutput",anchor:"transformers.generation_utils.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_utils.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_utils.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. <code>(max_length-1,)</code>-shaped tuple of <code>torch.FloatTensor</code> with each tensor of shape
<code>(batch_size*num_return_sequences, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation_utils.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_utils.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_utils.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_utils.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_utils.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/vr_17548/src/transformers/generation_utils.py#L161"}}),_t=new v({props:{name:"class transformers.generation_flax_utils.FlaxSampleOutput",anchor:"transformers.generation_flax_utils.FlaxSampleOutput",parameters:[{name:"sequences",val:": ndarray = None"}],parametersDescription:[{anchor:"transformers.generation_flax_utils.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/vr_17548/src/transformers/generation_flax_utils.py#L58"}}),bt=new v({props:{name:"replace",anchor:"transformers.generation_flax_utils.FlaxSampleOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/flax/struct.py#L120"}}),vt=new Ie({}),$t=new v({props:{name:"class transformers.generation_utils.BeamSearchDecoderOnlyOutput",anchor:"transformers.generation_utils.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_utils.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_utils.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_utils.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.
<code>(max_length-input_ids.shape[-1],)</code>-shaped tuple of <code>torch.FloatTensor</code> with each tensor of shape
<code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation_utils.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_utils.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_utils.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/vr_17548/src/transformers/generation_utils.py#L204"}}),Tt=new v({props:{name:"class transformers.generation_utils.BeamSearchEncoderDecoderOutput",anchor:"transformers.generation_utils.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_utils.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_utils.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_utils.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.
<code>(max_length-1,)</code>-shaped tuple of <code>torch.FloatTensor</code> with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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/vr_17548/src/transformers/generation_utils.py#L239"}}),yt=new Ie({}),kt=new v({props:{name:"class transformers.generation_utils.BeamSampleDecoderOnlyOutput",anchor:"transformers.generation_utils.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_utils.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_utils.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_utils.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.
<code>(max_length-input_ids.shape[-1],)</code>-shaped tuple of <code>torch.FloatTensor</code> with each tensor of shape
<code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation_utils.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_utils.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_utils.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/vr_17548/src/transformers/generation_utils.py#L290"}}),xt=new v({props:{name:"class transformers.generation_utils.BeamSampleEncoderDecoderOutput",anchor:"transformers.generation_utils.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_utils.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_utils.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_utils.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.
<code>(max_length-1,)</code>-shaped tuple of <code>torch.FloatTensor</code> with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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/vr_17548/src/transformers/generation_utils.py#L325"}}),wt=new Ie({}),Lt=new v({props:{name:"class transformers.LogitsProcessor",anchor:"transformers.LogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_logits_process.py#L51"}}),Et=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/pr_17548/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),Pt=new v({props:{name:"class transformers.LogitsProcessorList",anchor:"transformers.LogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_logits_process.py#L73"}}),Ft=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/pr_17548/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),Dt=new v({props:{name:"class transformers.LogitsWarper",anchor:"transformers.LogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_logits_process.py#L62"}}),St=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/pr_17548/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),zt=new v({props:{name:"class transformers.MinLengthLogitsProcessor",anchor:"transformers.MinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": 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>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_logits_process.py#L96"}}),Ot=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/vr_17548/src/transformers/generation_logits_process.py#L117"}}),qt=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/vr_17548/src/transformers/generation_logits_process.py#L124"}}),Bt=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/vr_17548/src/transformers/generation_logits_process.py#L139"}}),It=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/vr_17548/src/transformers/generation_logits_process.py#L144"}}),Ct=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/vr_17548/src/transformers/generation_logits_process.py#L160"}}),Wt=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 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/vr_17548/src/transformers/generation_logits_process.py#L170"}}),At=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/vr_17548/src/transformers/generation_logits_process.py#L193"}}),Nt=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/vr_17548/src/transformers/generation_logits_process.py#L212"}}),Vt=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/vr_17548/src/transformers/generation_logits_process.py#L233"}}),Mt=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"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_logits_process.py#L241"}}),Gt=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/vr_17548/src/transformers/generation_logits_process.py#L251"}}),jt=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/vr_17548/src/transformers/generation_logits_process.py#L312"}}),Rt=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/vr_17548/src/transformers/generation_logits_process.py#L327"}}),Kt=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:": 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>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_logits_process.py#L379"}}),Ut=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/vr_17548/src/transformers/generation_logits_process.py#L421"}}),Yt=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/vr_17548/src/transformers/generation_logits_process.py#L507"}}),Jt=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/vr_17548/src/transformers/generation_logits_process.py#L524"}}),Qt=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/vr_17548/src/transformers/generation_logits_process.py#L533"}}),eo=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/vr_17548/src/transformers/generation_logits_process.py#L564"}}),ro=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/vr_17548/src/transformers/generation_logits_process.py#L593"}}),to=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/vr_17548/src/transformers/generation_logits_process.py#L605"}}),oo=new v({props:{name:"class transformers.ForcedEOSTokenLogitsProcessor",anchor:"transformers.ForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": 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>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/vr_17548/src/transformers/generation_logits_process.py#L614"}}),no=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/vr_17548/src/transformers/generation_logits_process.py#L629"}}),so=new v({props:{name:"class transformers.InfNanRemoveLogitsProcessor",anchor:"transformers.InfNanRemoveLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_logits_process.py#L638"}}),ao=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/vr_17548/src/transformers/generation_logits_process.py#L645"}}),io=new v({props:{name:"class transformers.TFLogitsProcessor",anchor:"transformers.TFLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_tf_logits_process.py#L53"}}),co=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/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),lo=new v({props:{name:"class transformers.TFLogitsProcessorList",anchor:"transformers.TFLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_tf_logits_process.py#L75"}}),po=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/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),mo=new v({props:{name:"class transformers.TFLogitsWarper",anchor:"transformers.TFLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_tf_logits_process.py#L64"}}),fo=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/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),go=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/vr_17548/src/transformers/generation_tf_logits_process.py#L98"}}),ho=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/vr_17548/src/transformers/generation_tf_logits_process.py#L113"}}),uo=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 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/vr_17548/src/transformers/generation_tf_logits_process.py#L147"}}),_o=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/vr_17548/src/transformers/generation_tf_logits_process.py#L169"}}),bo=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/vr_17548/src/transformers/generation_tf_logits_process.py#L118"}}),vo=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/vr_17548/src/transformers/generation_tf_logits_process.py#L139"}}),$o=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/vr_17548/src/transformers/generation_tf_logits_process.py#L201"}}),To=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/vr_17548/src/transformers/generation_tf_logits_process.py#L227"}}),yo=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/vr_17548/src/transformers/generation_tf_logits_process.py#L285"}}),ko=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/vr_17548/src/transformers/generation_tf_logits_process.py#L362"}}),xo=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/vr_17548/src/transformers/generation_tf_logits_process.py#L383"}}),Lo=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/vr_17548/src/transformers/generation_tf_logits_process.py#L422"}}),Eo=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/vr_17548/src/transformers/generation_tf_logits_process.py#L237"}}),Po=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/vr_17548/src/transformers/generation_tf_logits_process.py#L277"}}),Fo=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/vr_17548/src/transformers/generation_tf_logits_process.py#L444"}}),Do=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/vr_17548/src/transformers/generation_tf_logits_process.py#L458"}}),So=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/vr_17548/src/transformers/generation_tf_logits_process.py#L474"}}),zo=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/vr_17548/src/transformers/generation_tf_logits_process.py#L491"}}),Oo=new v({props:{name:"class transformers.FlaxLogitsProcessor",anchor:"transformers.FlaxLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_flax_logits_process.py#L50"}}),qo=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/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),Bo=new v({props:{name:"class transformers.FlaxLogitsProcessorList",anchor:"transformers.FlaxLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_flax_logits_process.py#L72"}}),Io=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/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),Co=new v({props:{name:"class transformers.FlaxLogitsWarper",anchor:"transformers.FlaxLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_flax_logits_process.py#L61"}}),Wo=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/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),Ao=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/vr_17548/src/transformers/generation_flax_logits_process.py#L95"}}),No=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/vr_17548/src/transformers/generation_flax_logits_process.py#L110"}}),Vo=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 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/vr_17548/src/transformers/generation_flax_logits_process.py#L115"}}),Mo=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/vr_17548/src/transformers/generation_flax_logits_process.py#L137"}}),Go=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/vr_17548/src/transformers/generation_flax_logits_process.py#L157"}}),jo=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/vr_17548/src/transformers/generation_flax_logits_process.py#L178"}}),Ho=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/vr_17548/src/transformers/generation_flax_logits_process.py#L193"}}),Ro=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/vr_17548/src/transformers/generation_flax_logits_process.py#L205"}}),Ko=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/vr_17548/src/transformers/generation_flax_logits_process.py#L215"}}),Uo=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/vr_17548/src/transformers/generation_flax_logits_process.py#L230"}}),Yo=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/vr_17548/src/transformers/generation_flax_logits_process.py#L240"}}),Xo=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/vr_17548/src/transformers/generation_flax_logits_process.py#L261"}}),Jo=new Ie({}),Qo=new v({props:{name:"class transformers.StoppingCriteria",anchor:"transformers.StoppingCriteria",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_stopping_criteria.py#L33"}}),Zo=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/pr_17548/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),en=new v({props:{name:"class transformers.StoppingCriteriaList",anchor:"transformers.StoppingCriteriaList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_stopping_criteria.py#L110"}}),rn=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/pr_17548/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),tn=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/vr_17548/src/transformers/generation_stopping_criteria.py#L41"}}),nn=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/pr_17548/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),sn=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/vr_17548/src/transformers/generation_stopping_criteria.py#L88"}}),cn=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/pr_17548/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/vr_17548/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>
`}}),ln=new Ie({}),dn=new v({props:{name:"class transformers.Constraint",anchor:"transformers.Constraint",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_constraints.py#L5"}}),Gr=new v0({props:{anchor:"transformers.Constraint.example",$$slots:{default:[$0]},$$scope:{ctx:bd}}}),pn=new v({props:{name:"advance",anchor:"transformers.Constraint.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/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>
`}}),mn=new v({props:{name:"copy",anchor:"transformers.Constraint.copy",parameters:[{name:"stateful",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/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>
`}}),fn=new v({props:{name:"does_advance",anchor:"transformers.Constraint.does_advance",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_constraints.py#L60"}}),gn=new v({props:{name:"remaining",anchor:"transformers.Constraint.remaining",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_constraints.py#L104"}}),un=new v({props:{name:"reset",anchor:"transformers.Constraint.reset",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_constraints.py#L94"}}),_n=new v({props:{name:"test",anchor:"transformers.Constraint.test",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_constraints.py#L24"}}),bn=new v({props:{name:"update",anchor:"transformers.Constraint.update",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/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>
`}}),$n=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/vr_17548/src/transformers/generation_beam_constraints.py#L129"}}),Tn=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/vr_17548/src/transformers/generation_beam_constraints.py#L261"}}),kn=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/pr_17548/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/vr_17548/src/transformers/generation_beam_constraints.py#L350"}}),xn=new v({props:{name:"advance",anchor:"transformers.ConstraintListState.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_constraints.py#L382"}}),wn=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/vr_17548/src/transformers/generation_beam_constraints.py#L417"}}),Ln=new Ie({}),En=new v({props:{name:"class transformers.BeamScorer",anchor:"transformers.BeamScorer",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_search.py#L88"}}),Pn=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/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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>int</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/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>
`}}),Fn=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/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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>int</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/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>
`}}),Dn=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. 1.0 means no penalty. Set to values &lt; 1.0 in order to encourage the
model to generate shorter sequences, to a value &gt; 1.0 in order to encourage the model to produce longer
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>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/vr_17548/src/transformers/generation_beam_search.py#L120"}}),qn=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.Optional[int] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_search.py#L207"}}),Bn=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.Optional[int] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_search.py#L301"}}),In=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/pr_17548/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. 1.0 means no penalty. Set to values &lt; 1.0 in order to encourage the
model to generate shorter sequences, to a value &gt; 1.0 in order to encourage the model to produce longer
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>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/vr_17548/src/transformers/generation_beam_search.py#L389"}}),Cn=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.Optional[int] = 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/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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>int</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_search.py#L484",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>
`}}),Wn=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.Optional[int] = None"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/generation_beam_search.py#L760"}}),An=new Ie({}),Nn=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/vr_17548/src/transformers/generation_utils.py#L3322"}}),Mn=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/vr_17548/src/transformers/generation_tf_utils.py#L3043"}}),{c(){w=o("meta"),He=c(),k=o("h1"),Ce=o("a"),cc=o("span"),f(st.$$.fragment),Rm=c(),lc=o("span"),Km=a("Utilities for Generation"),vd=c(),y=o("p"),Um=a("This page lists all the utility functions used by "),Rn=o("a"),Ym=a("generate()"),Xm=a(`,
`),Kn=o("a"),Jm=a("greedy_search()"),Qm=a(`,
`),Un=o("a"),Zm=a("sample()"),ef=a(`,
`),Yn=o("a"),rf=a("beam_search()"),tf=a(`,
`),Xn=o("a"),of=a("beam_sample()"),nf=a(`,
`),Jn=o("a"),sf=a("group_beam_search()"),af=a(`, and
`),Qn=o("a"),cf=a("constrained_beam_search()"),lf=a("."),$d=c(),Zn=o("p"),df=a("Most of those are only useful if you are studying the code of the generate methods in the library."),Td=c(),Re=o("h2"),_r=o("a"),dc=o("span"),f(at.$$.fragment),pf=c(),pc=o("span"),mf=a("Generate Outputs"),yd=c(),V=o("p"),ff=a("The output of "),es=o("a"),gf=a("generate()"),hf=a(` is an instance of a subclass of
`),rs=o("a"),uf=a("ModelOutput"),_f=a(`. This output is a data structure containing all the information returned
by `),ts=o("a"),bf=a("generate()"),vf=a(", but that can also be used as tuple or dictionary."),kd=c(),os=o("p"),$f=a("Here\u2019s an example:"),xd=c(),f(it.$$.fragment),wd=c(),We=o("p"),Tf=a("The "),mc=o("code"),yf=a("generation_output"),kf=a(" object is a "),ns=o("a"),xf=a("GreedySearchDecoderOnlyOutput"),wf=a(`, as we can
see in the documentation of that class below, it means it has the following attributes:`),Ld=c(),M=o("ul"),ss=o("li"),fc=o("code"),Lf=a("sequences"),Ef=a(": the generated sequences of tokens"),Pf=c(),as=o("li"),gc=o("code"),Ff=a("scores"),Df=a(" (optional): the prediction scores of the language modelling head, for each generation step"),Sf=c(),is=o("li"),hc=o("code"),zf=a("hidden_states"),Of=a(" (optional): the hidden states of the model, for each generation step"),qf=c(),cs=o("li"),uc=o("code"),Bf=a("attentions"),If=a(" (optional): the attention weights of the model, for each generation step"),Ed=c(),x=o("p"),Cf=a("Here we have the "),_c=o("code"),Wf=a("scores"),Af=a(" since we passed along "),bc=o("code"),Nf=a("output_scores=True"),Vf=a(", but we don\u2019t have "),vc=o("code"),Mf=a("hidden_states"),Gf=a(` and
`),$c=o("code"),jf=a("attentions"),Hf=a(" because we didn\u2019t pass "),Tc=o("code"),Rf=a("output_hidden_states=True"),Kf=a(" or "),yc=o("code"),Uf=a("output_attentions=True"),Yf=a("."),Pd=c(),S=o("p"),Xf=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 `),kc=o("code"),Jf=a("None"),Qf=a(". Here for instance "),xc=o("code"),Zf=a("generation_output.scores"),eg=a(` are all the generated prediction scores of the
language modeling head, and `),wc=o("code"),rg=a("generation_output.attentions"),tg=a(" is "),Lc=o("code"),og=a("None"),ng=a("."),Fd=c(),z=o("p"),sg=a("When using our "),Ec=o("code"),ag=a("generation_output"),ig=a(" object as a tuple, it only keeps the attributes that don\u2019t have "),Pc=o("code"),cg=a("None"),lg=a(` values.
Here, for instance, it has two elements, `),Fc=o("code"),dg=a("loss"),pg=a(" then "),Dc=o("code"),mg=a("logits"),fg=a(", so"),Dd=c(),f(ct.$$.fragment),Sd=c(),br=o("p"),gg=a("will return the tuple "),Sc=o("code"),hg=a("(generation_output.sequences, generation_output.scores)"),ug=a(" for instance."),zd=c(),O=o("p"),_g=a("When using our "),zc=o("code"),bg=a("generation_output"),vg=a(" object as a dictionary, it only keeps the attributes that don\u2019t have "),Oc=o("code"),$g=a("None"),Tg=a(`
values. Here, for instance, it has two keys that are `),qc=o("code"),yg=a("sequences"),kg=a(" and "),Bc=o("code"),xg=a("scores"),wg=a("."),Od=c(),ls=o("p"),Lg=a("We document here all output types."),qd=c(),Ke=o("h3"),vr=o("a"),Ic=o("span"),f(lt.$$.fragment),Eg=c(),Cc=o("span"),Pg=a("GreedySearchOutput"),Bd=c(),Ue=o("div"),f(dt.$$.fragment),Fg=c(),Wc=o("p"),Dg=a("Base class for outputs of decoder-only generation models using greedy search."),Id=c(),Ye=o("div"),f(pt.$$.fragment),Sg=c(),Ac=o("p"),zg=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)`),Cd=c(),R=o("div"),f(mt.$$.fragment),Og=c(),Nc=o("p"),qg=a("Flax Base class for outputs of decoder-only generation models using greedy search."),Bg=c(),$r=o("div"),f(ft.$$.fragment),Ig=c(),Vc=o("p"),Cg=a("\u201CReturns a new object replacing the specified fields with new values."),Wd=c(),Xe=o("h3"),Tr=o("a"),Mc=o("span"),f(gt.$$.fragment),Wg=c(),Gc=o("span"),Ag=a("SampleOutput"),Ad=c(),Je=o("div"),f(ht.$$.fragment),Ng=c(),jc=o("p"),Vg=a("Base class for outputs of decoder-only generation models using sampling."),Nd=c(),Qe=o("div"),f(ut.$$.fragment),Mg=c(),Hc=o("p"),Gg=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)`),Vd=c(),K=o("div"),f(_t.$$.fragment),jg=c(),Rc=o("p"),Hg=a("Flax Base class for outputs of decoder-only generation models using sampling."),Rg=c(),yr=o("div"),f(bt.$$.fragment),Kg=c(),Kc=o("p"),Ug=a("\u201CReturns a new object replacing the specified fields with new values."),Md=c(),Ze=o("h3"),kr=o("a"),Uc=o("span"),f(vt.$$.fragment),Yg=c(),Yc=o("span"),Xg=a("BeamSearchOutput"),Gd=c(),er=o("div"),f($t.$$.fragment),Jg=c(),Xc=o("p"),Qg=a("Base class for outputs of decoder-only generation models using beam search."),jd=c(),rr=o("div"),f(Tt.$$.fragment),Zg=c(),Jc=o("p"),eh=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)`),Hd=c(),tr=o("h3"),xr=o("a"),Qc=o("span"),f(yt.$$.fragment),rh=c(),Zc=o("span"),th=a("BeamSampleOutput"),Rd=c(),or=o("div"),f(kt.$$.fragment),oh=c(),el=o("p"),nh=a("Base class for outputs of decoder-only generation models using beam sample."),Kd=c(),nr=o("div"),f(xt.$$.fragment),sh=c(),rl=o("p"),ah=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)`),Ud=c(),sr=o("h2"),wr=o("a"),tl=o("span"),f(wt.$$.fragment),ih=c(),ol=o("span"),ch=a("LogitsProcessor"),Yd=c(),Lr=o("p"),lh=a("A "),ds=o("a"),dh=a("LogitsProcessor"),ph=a(` can be used to modify the prediction scores of a language model head for
generation.`),Xd=c(),U=o("div"),f(Lt.$$.fragment),mh=c(),nl=o("p"),fh=a("Abstract base class for all logit processors that can be applied during generation."),gh=c(),Er=o("div"),f(Et.$$.fragment),hh=c(),sl=o("p"),uh=a("Torch method for processing logits."),Jd=c(),Y=o("div"),f(Pt.$$.fragment),_h=c(),L=o("p"),bh=a("This class can be used to create a list of "),ps=o("a"),vh=a("LogitsProcessor"),$h=a(" or "),ms=o("a"),Th=a("LogitsWarper"),yh=a(` to subsequently process a
`),al=o("code"),kh=a("scores"),xh=a(" input tensor. This class inherits from list and adds a specific "),il=o("em"),cl=o("strong"),wh=a("call"),Lh=a(` method to apply each
`),fs=o("a"),Eh=a("LogitsProcessor"),Ph=a(" or "),gs=o("a"),Fh=a("LogitsWarper"),Dh=a(" to the inputs."),Sh=c(),hs=o("div"),f(Ft.$$.fragment),Qd=c(),X=o("div"),f(Dt.$$.fragment),zh=c(),ll=o("p"),Oh=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),qh=c(),Pr=o("div"),f(St.$$.fragment),Bh=c(),dl=o("p"),Ih=a("Torch method for warping logits."),Zd=c(),J=o("div"),f(zt.$$.fragment),Ch=c(),us=o("p"),_s=o("a"),Wh=a("LogitsProcessor"),Ah=a(" enforcing a min-length by setting EOS probability to 0."),Nh=c(),bs=o("div"),f(Ot.$$.fragment),ep=c(),Q=o("div"),f(qt.$$.fragment),Vh=c(),vs=o("p"),$s=o("a"),Mh=a("LogitsWarper"),Gh=a(" for temperature (exponential scaling output probability distribution)."),jh=c(),Ts=o("div"),f(Bt.$$.fragment),rp=c(),Z=o("div"),f(It.$$.fragment),Hh=c(),ys=o("p"),ks=o("a"),Rh=a("LogitsProcessor"),Kh=a(" enforcing an exponential penalty on repeated sequences."),Uh=c(),xs=o("div"),f(Ct.$$.fragment),tp=c(),ee=o("div"),f(Wt.$$.fragment),Yh=c(),ws=o("p"),Ls=o("a"),Xh=a("LogitsWarper"),Jh=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),Qh=c(),Es=o("div"),f(At.$$.fragment),op=c(),re=o("div"),f(Nt.$$.fragment),Zh=c(),Ps=o("p"),Fs=o("a"),eu=a("LogitsWarper"),ru=a(" that performs top-k, i.e. restricting to the k highest probability elements."),tu=c(),Ds=o("div"),f(Vt.$$.fragment),np=c(),ar=o("div"),f(Mt.$$.fragment),ou=c(),Ss=o("div"),f(Gt.$$.fragment),sp=c(),te=o("div"),f(jt.$$.fragment),nu=c(),Fr=o("p"),zs=o("a"),su=a("LogitsProcessor"),au=a(` that enforces no repetition of n-grams. See
`),Ht=o("a"),iu=a("Fairseq"),cu=a("."),lu=c(),Os=o("div"),f(Rt.$$.fragment),ap=c(),oe=o("div"),f(Kt.$$.fragment),du=c(),qs=o("p"),Bs=o("a"),pu=a("LogitsProcessor"),mu=a(" that enforces that specified sequences will never be sampled."),fu=c(),Is=o("div"),f(Ut.$$.fragment),ip=c(),ne=o("div"),f(Yt.$$.fragment),gu=c(),Dr=o("p"),Cs=o("a"),hu=a("LogitsProcessor"),uu=a(` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),Xt=o("a"),_u=a("Autoregressive Entity Retrieval"),bu=a(" for more information."),vu=c(),Ws=o("div"),f(Jt.$$.fragment),cp=c(),se=o("div"),f(Qt.$$.fragment),$u=c(),Ae=o("p"),As=o("a"),Tu=a("LogitsProcessor"),yu=a(` that enforces diverse beam search. Note that this logits processor is only effective for
`),Ns=o("a"),ku=a("PreTrainedModel.group_beam_search()"),xu=a(". See "),Zt=o("a"),wu=a(`Diverse Beam Search: Decoding Diverse Solutions from Neural Sequence
Models`),Lu=a(" for more details."),Eu=c(),Vs=o("div"),f(eo.$$.fragment),lp=c(),ae=o("div"),f(ro.$$.fragment),Pu=c(),Ms=o("p"),Gs=o("a"),Fu=a("LogitsProcessor"),Du=a(" that enforces the specified token as the first generated token."),Su=c(),js=o("div"),f(to.$$.fragment),dp=c(),ie=o("div"),f(oo.$$.fragment),zu=c(),Sr=o("p"),Hs=o("a"),Ou=a("LogitsProcessor"),qu=a(" that enforces the specified token as the last generated token when "),pl=o("code"),Bu=a("max_length"),Iu=a(" is reached."),Cu=c(),Rs=o("div"),f(no.$$.fragment),pp=c(),ce=o("div"),f(so.$$.fragment),Wu=c(),G=o("p"),Ks=o("a"),Au=a("LogitsProcessor"),Nu=a(" that removes all "),ml=o("code"),Vu=a("nan"),Mu=a(" and "),fl=o("code"),Gu=a("inf"),ju=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. `),gl=o("code"),Hu=a("max_length"),Ru=a(` is
reached.`),Ku=c(),Us=o("div"),f(ao.$$.fragment),mp=c(),le=o("div"),f(io.$$.fragment),Uu=c(),hl=o("p"),Yu=a("Abstract base class for all logit processors that can be applied during generation."),Xu=c(),zr=o("div"),f(co.$$.fragment),Ju=c(),ul=o("p"),Qu=a("TF method for processing logits."),fp=c(),de=o("div"),f(lo.$$.fragment),Zu=c(),C=o("p"),e_=a("This class can be used to create a list of "),Ys=o("a"),r_=a("TFLogitsProcessor"),t_=a(" to subsequently process a "),_l=o("code"),o_=a("scores"),n_=a(` input tensor.
This class inherits from list and adds a specific `),bl=o("em"),vl=o("strong"),s_=a("call"),a_=a(" method to apply each "),Xs=o("a"),i_=a("TFLogitsProcessor"),c_=a(` to the
inputs.`),l_=c(),Js=o("div"),f(po.$$.fragment),gp=c(),pe=o("div"),f(mo.$$.fragment),d_=c(),$l=o("p"),p_=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),m_=c(),Or=o("div"),f(fo.$$.fragment),f_=c(),Tl=o("p"),g_=a("TF method for warping logits."),hp=c(),me=o("div"),f(go.$$.fragment),h_=c(),Qs=o("p"),Zs=o("a"),u_=a("TFLogitsWarper"),__=a(" for temperature (exponential scaling output probability distribution)."),b_=c(),ea=o("div"),f(ho.$$.fragment),up=c(),fe=o("div"),f(uo.$$.fragment),v_=c(),ra=o("p"),ta=o("a"),$_=a("TFLogitsWarper"),T_=a(" that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),y_=c(),oa=o("div"),f(_o.$$.fragment),_p=c(),ge=o("div"),f(bo.$$.fragment),k_=c(),na=o("p"),sa=o("a"),x_=a("TFLogitsWarper"),w_=a(" that performs top-k, i.e. restricting to the k highest probability elements."),L_=c(),aa=o("div"),f(vo.$$.fragment),bp=c(),he=o("div"),f($o.$$.fragment),E_=c(),ia=o("p"),ca=o("a"),P_=a("TFLogitsProcessor"),F_=a(" enforcing a min-length by setting EOS probability to 0."),D_=c(),la=o("div"),f(To.$$.fragment),vp=c(),ue=o("div"),f(yo.$$.fragment),S_=c(),da=o("p"),pa=o("a"),z_=a("TFLogitsProcessor"),O_=a(" that enforces that specified sequences will never be sampled."),q_=c(),ma=o("div"),f(ko.$$.fragment),$p=c(),_e=o("div"),f(xo.$$.fragment),B_=c(),qr=o("p"),fa=o("a"),I_=a("TFLogitsProcessor"),C_=a(` that enforces no repetition of n-grams. See
`),wo=o("a"),W_=a("Fairseq"),A_=a("."),N_=c(),ga=o("div"),f(Lo.$$.fragment),Tp=c(),be=o("div"),f(Eo.$$.fragment),V_=c(),ha=o("p"),ua=o("a"),M_=a("TFLogitsProcessor"),G_=a(" enforcing an exponential penalty on repeated sequences."),j_=c(),_a=o("div"),f(Po.$$.fragment),yp=c(),ve=o("div"),f(Fo.$$.fragment),H_=c(),ba=o("p"),va=o("a"),R_=a("TFLogitsProcessor"),K_=a(" that enforces the specified token as the first generated token."),U_=c(),$a=o("div"),f(Do.$$.fragment),kp=c(),$e=o("div"),f(So.$$.fragment),Y_=c(),Br=o("p"),Ta=o("a"),X_=a("TFLogitsProcessor"),J_=a(" that enforces the specified token as the last generated token when "),yl=o("code"),Q_=a("max_length"),Z_=a(" is reached."),eb=c(),ya=o("div"),f(zo.$$.fragment),xp=c(),Te=o("div"),f(Oo.$$.fragment),rb=c(),kl=o("p"),tb=a("Abstract base class for all logit processors that can be applied during generation."),ob=c(),Ir=o("div"),f(qo.$$.fragment),nb=c(),xl=o("p"),sb=a("Flax method for processing logits."),wp=c(),ye=o("div"),f(Bo.$$.fragment),ab=c(),E=o("p"),ib=a("This class can be used to create a list of "),ka=o("a"),cb=a("FlaxLogitsProcessor"),lb=a(" or "),xa=o("a"),db=a("FlaxLogitsWarper"),pb=a(` to subsequently process
a `),wl=o("code"),mb=a("scores"),fb=a(" input tensor. This class inherits from list and adds a specific "),Ll=o("em"),El=o("strong"),gb=a("call"),hb=a(` method to apply each
`),wa=o("a"),ub=a("FlaxLogitsProcessor"),_b=a(" or "),La=o("a"),bb=a("FlaxLogitsWarper"),vb=a(" to the inputs."),$b=c(),Ea=o("div"),f(Io.$$.fragment),Lp=c(),ke=o("div"),f(Co.$$.fragment),Tb=c(),Pl=o("p"),yb=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),kb=c(),Cr=o("div"),f(Wo.$$.fragment),xb=c(),Fl=o("p"),wb=a("Flax method for warping logits."),Ep=c(),xe=o("div"),f(Ao.$$.fragment),Lb=c(),Pa=o("p"),Fa=o("a"),Eb=a("FlaxLogitsWarper"),Pb=a(" for temperature (exponential scaling output probability distribution)."),Fb=c(),Da=o("div"),f(No.$$.fragment),Pp=c(),we=o("div"),f(Vo.$$.fragment),Db=c(),Sa=o("p"),za=o("a"),Sb=a("FlaxLogitsWarper"),zb=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),Ob=c(),Oa=o("div"),f(Mo.$$.fragment),Fp=c(),Le=o("div"),f(Go.$$.fragment),qb=c(),qa=o("p"),Ba=o("a"),Bb=a("FlaxLogitsWarper"),Ib=a(" that performs top-k, i.e. restricting to the k highest probability elements."),Cb=c(),Ia=o("div"),f(jo.$$.fragment),Dp=c(),Ee=o("div"),f(Ho.$$.fragment),Wb=c(),Ca=o("p"),Wa=o("a"),Ab=a("FlaxLogitsProcessor"),Nb=a(" that enforces the specified token as the first generated token."),Vb=c(),Aa=o("div"),f(Ro.$$.fragment),Sp=c(),Pe=o("div"),f(Ko.$$.fragment),Mb=c(),Wr=o("p"),Na=o("a"),Gb=a("FlaxLogitsProcessor"),jb=a(" that enforces the specified token as the last generated token when "),Dl=o("code"),Hb=a("max_length"),Rb=a(" is reached."),Kb=c(),Va=o("div"),f(Uo.$$.fragment),zp=c(),Fe=o("div"),f(Yo.$$.fragment),Ub=c(),Ma=o("p"),Ga=o("a"),Yb=a("FlaxLogitsProcessor"),Xb=a(" enforcing a min-length by setting EOS probability to 0."),Jb=c(),ja=o("div"),f(Xo.$$.fragment),Op=c(),ir=o("h2"),Ar=o("a"),Sl=o("span"),f(Jo.$$.fragment),Qb=c(),zl=o("span"),Zb=a("StoppingCriteria"),qp=c(),Nr=o("p"),ev=a("A "),Ha=o("a"),rv=a("StoppingCriteria"),tv=a(" can be used to change when to stop generation (other than EOS token)."),Bp=c(),De=o("div"),f(Qo.$$.fragment),ov=c(),Ol=o("p"),nv=a("Abstract base class for all stopping criteria that can be applied during generation."),sv=c(),Ra=o("div"),f(Zo.$$.fragment),Ip=c(),cr=o("div"),f(en.$$.fragment),av=c(),Ka=o("div"),f(rn.$$.fragment),Cp=c(),Se=o("div"),f(tn.$$.fragment),iv=c(),on=o("p"),cv=a("This class can be used to stop generation whenever the full generated number of tokens exceeds "),ql=o("code"),lv=a("max_length"),dv=a(`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),pv=c(),Ua=o("div"),f(nn.$$.fragment),Wp=c(),ze=o("div"),f(sn.$$.fragment),mv=c(),an=o("p"),fv=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
`),Bl=o("code"),gv=a("initial_time"),hv=a("."),uv=c(),Ya=o("div"),f(cn.$$.fragment),Ap=c(),lr=o("h2"),Vr=o("a"),Il=o("span"),f(ln.$$.fragment),_v=c(),Cl=o("span"),bv=a("Constraints"),Np=c(),Mr=o("p"),vv=a("A "),Xa=o("a"),$v=a("Constraint"),Tv=a(" can be used to force the generation to include specific tokens or sequences in the output."),Vp=c(),$=o("div"),f(dn.$$.fragment),yv=c(),Wl=o("p"),kv=a(`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),xv=c(),Al=o("p"),wv=a("All classes that inherit Constraint must follow the requirement that"),Lv=c(),f(Gr.$$.fragment),Ev=c(),Nl=o("p"),Pv=a("will always terminate (halt)."),Fv=c(),jr=o("div"),f(pn.$$.fragment),Dv=c(),Vl=o("p"),Sv=a("When called, returns the token that would take this constraint one step closer to being fulfilled."),zv=c(),Hr=o("div"),f(mn.$$.fragment),Ov=c(),Ml=o("p"),qv=a("Creates a new instance of this constraint."),Bv=c(),Rr=o("div"),f(fn.$$.fragment),Iv=c(),Gl=o("p"),Cv=a("Reads in a token and returns whether it creates progress."),Wv=c(),Kr=o("div"),f(gn.$$.fragment),Av=c(),hn=o("p"),Nv=a("Returns the number of remaining steps of "),jl=o("code"),Vv=a("advance()"),Mv=a(" in order to complete this constraint."),Gv=c(),Ur=o("div"),f(un.$$.fragment),jv=c(),Hl=o("p"),Hv=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.`),Rv=c(),Yr=o("div"),f(_n.$$.fragment),Kv=c(),Rl=o("p"),Uv=a("Tests whether this constraint has been properly defined."),Yv=c(),Ne=o("div"),f(bn.$$.fragment),Xv=c(),vn=o("p"),Jv=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 `),Kl=o("code"),Qv=a("does_advance(self, token_id: int)"),Zv=a("."),e1=c(),Ul=o("p"),r1=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)`),Mp=c(),dr=o("div"),f($n.$$.fragment),t1=c(),Ja=o("p"),Qa=o("a"),o1=a("Constraint"),n1=a(" enforcing that an ordered sequence of tokens is included in the output."),Gp=c(),pr=o("div"),f(Tn.$$.fragment),s1=c(),yn=o("p"),a1=a("A special "),Za=o("a"),i1=a("Constraint"),c1=a(" that is fulfilled by fulfilling just one of several constraints."),jp=c(),W=o("div"),f(kn.$$.fragment),l1=c(),Yl=o("p"),d1=a("A class for beam scorers to track its progress through a list of constraints."),p1=c(),F=o("div"),f(xn.$$.fragment),m1=c(),Xl=o("p"),f1=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.`),g1=c(),mr=o("p"),h1=a("Given constraints "),Jl=o("code"),u1=a("c_i = {t_ij | j == # of tokens}"),_1=a(`, If we\u2019re not in the middle of progressing through a
specific constraint `),Ql=o("code"),b1=a("c_i"),v1=a(", we return:"),$1=c(),Zl=o("p"),ed=o("code"),T1=a("[t_k1 for k in indices of unfulfilled constraints]"),y1=c(),Oe=o("p"),k1=a(`If we are in the middle of a constraint, then we return:
`),rd=o("code"),x1=a("[t_ij]"),w1=a(", where "),td=o("code"),L1=a("i"),E1=a(" is the index of the inprogress constraint, "),od=o("code"),P1=a("j"),F1=a(" is the next step for the constraint."),D1=c(),nd=o("p"),S1=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.`),z1=c(),Xr=o("div"),f(wn.$$.fragment),O1=c(),sd=o("p"),q1=a("token_ids: the tokens generated thus far to reset the state of the progress through constraints."),Hp=c(),fr=o("h2"),Jr=o("a"),ad=o("span"),f(Ln.$$.fragment),B1=c(),id=o("span"),I1=a("BeamSearch"),Rp=c(),A=o("div"),f(En.$$.fragment),C1=c(),gr=o("p"),W1=a("Abstract base class for all beam scorers that are used for "),ei=o("a"),A1=a("beam_search()"),N1=a(` and
`),ri=o("a"),V1=a("beam_sample()"),M1=a("."),G1=c(),ti=o("div"),f(Pn.$$.fragment),j1=c(),oi=o("div"),f(Fn.$$.fragment),Kp=c(),P=o("div"),f(Dn.$$.fragment),H1=c(),ni=o("p"),si=o("a"),R1=a("BeamScorer"),K1=a(" implementing standard beam search decoding."),U1=c(),Sn=o("p"),Y1=a("Adapted in part from "),zn=o("a"),X1=a(`Facebook\u2019s XLM beam search
code`),J1=a("."),Q1=c(),ai=o("p"),Z1=a("Reference for the diverse beam search algorithm and implementation "),On=o("a"),e$=a(`Ashwin Kalyan\u2019s DBS
implementation`),r$=c(),ii=o("div"),f(qn.$$.fragment),t$=c(),ci=o("div"),f(Bn.$$.fragment),Up=c(),N=o("div"),f(In.$$.fragment),o$=c(),li=o("p"),di=o("a"),n$=a("BeamScorer"),s$=a(" implementing constrained beam search decoding."),a$=c(),pi=o("div"),f(Cn.$$.fragment),i$=c(),mi=o("div"),f(Wn.$$.fragment),Yp=c(),hr=o("h2"),Qr=o("a"),cd=o("span"),f(An.$$.fragment),c$=c(),ld=o("span"),l$=a("Utilities"),Xp=c(),qe=o("div"),f(Nn.$$.fragment),d$=c(),dd=o("p"),p$=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),m$=c(),fi=o("p"),f$=a("From: "),Vn=o("a"),g$=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),Jp=c(),Be=o("div"),f(Mn.$$.fragment),h$=c(),pd=o("p"),u$=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),_$=c(),gi=o("p"),b$=a("From: "),Gn=o("a"),v$=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),this.h()},l(e){const p=u0('[data-svelte="svelte-1phssyn"]',document.head);w=n(p,"META",{name:!0,content:!0}),p.forEach(t),He=l(e),k=n(e,"H1",{class:!0});var jn=s(k);Ce=n(jn,"A",{id:!0,class:!0,href:!0});var X$=s(Ce);cc=n(X$,"SPAN",{});var J$=s(cc);g(st.$$.fragment,J$),J$.forEach(t),X$.forEach(t),Rm=l(jn),lc=n(jn,"SPAN",{});var Q$=s(lc);Km=i(Q$,"Utilities for Generation"),Q$.forEach(t),jn.forEach(t),vd=l(e),y=n(e,"P",{});var D=s(y);Um=i(D,"This page lists all the utility functions used by "),Rn=n(D,"A",{href:!0});var Z$=s(Rn);Ym=i(Z$,"generate()"),Z$.forEach(t),Xm=i(D,`,
`),Kn=n(D,"A",{href:!0});var e2=s(Kn);Jm=i(e2,"greedy_search()"),e2.forEach(t),Qm=i(D,`,
`),Un=n(D,"A",{href:!0});var r2=s(Un);Zm=i(r2,"sample()"),r2.forEach(t),ef=i(D,`,
`),Yn=n(D,"A",{href:!0});var t2=s(Yn);rf=i(t2,"beam_search()"),t2.forEach(t),tf=i(D,`,
`),Xn=n(D,"A",{href:!0});var o2=s(Xn);of=i(o2,"beam_sample()"),o2.forEach(t),nf=i(D,`,
`),Jn=n(D,"A",{href:!0});var n2=s(Jn);sf=i(n2,"group_beam_search()"),n2.forEach(t),af=i(D,`, and
`),Qn=n(D,"A",{href:!0});var s2=s(Qn);cf=i(s2,"constrained_beam_search()"),s2.forEach(t),lf=i(D,"."),D.forEach(t),$d=l(e),Zn=n(e,"P",{});var a2=s(Zn);df=i(a2,"Most of those are only useful if you are studying the code of the generate methods in the library."),a2.forEach(t),Td=l(e),Re=n(e,"H2",{class:!0});var Zp=s(Re);_r=n(Zp,"A",{id:!0,class:!0,href:!0});var i2=s(_r);dc=n(i2,"SPAN",{});var c2=s(dc);g(at.$$.fragment,c2),c2.forEach(t),i2.forEach(t),pf=l(Zp),pc=n(Zp,"SPAN",{});var l2=s(pc);mf=i(l2,"Generate Outputs"),l2.forEach(t),Zp.forEach(t),yd=l(e),V=n(e,"P",{});var Zr=s(V);ff=i(Zr,"The output of "),es=n(Zr,"A",{href:!0});var d2=s(es);gf=i(d2,"generate()"),d2.forEach(t),hf=i(Zr,` is an instance of a subclass of
`),rs=n(Zr,"A",{href:!0});var p2=s(rs);uf=i(p2,"ModelOutput"),p2.forEach(t),_f=i(Zr,`. This output is a data structure containing all the information returned
by `),ts=n(Zr,"A",{href:!0});var m2=s(ts);bf=i(m2,"generate()"),m2.forEach(t),vf=i(Zr,", but that can also be used as tuple or dictionary."),Zr.forEach(t),kd=l(e),os=n(e,"P",{});var f2=s(os);$f=i(f2,"Here\u2019s an example:"),f2.forEach(t),xd=l(e),g(it.$$.fragment,e),wd=l(e),We=n(e,"P",{});var hi=s(We);Tf=i(hi,"The "),mc=n(hi,"CODE",{});var g2=s(mc);yf=i(g2,"generation_output"),g2.forEach(t),kf=i(hi," object is a "),ns=n(hi,"A",{href:!0});var h2=s(ns);xf=i(h2,"GreedySearchDecoderOnlyOutput"),h2.forEach(t),wf=i(hi,`, as we can
see in the documentation of that class below, it means it has the following attributes:`),hi.forEach(t),Ld=l(e),M=n(e,"UL",{});var et=s(M);ss=n(et,"LI",{});var $$=s(ss);fc=n($$,"CODE",{});var u2=s(fc);Lf=i(u2,"sequences"),u2.forEach(t),Ef=i($$,": the generated sequences of tokens"),$$.forEach(t),Pf=l(et),as=n(et,"LI",{});var T$=s(as);gc=n(T$,"CODE",{});var _2=s(gc);Ff=i(_2,"scores"),_2.forEach(t),Df=i(T$," (optional): the prediction scores of the language modelling head, for each generation step"),T$.forEach(t),Sf=l(et),is=n(et,"LI",{});var y$=s(is);hc=n(y$,"CODE",{});var b2=s(hc);zf=i(b2,"hidden_states"),b2.forEach(t),Of=i(y$," (optional): the hidden states of the model, for each generation step"),y$.forEach(t),qf=l(et),cs=n(et,"LI",{});var k$=s(cs);uc=n(k$,"CODE",{});var v2=s(uc);Bf=i(v2,"attentions"),v2.forEach(t),If=i(k$," (optional): the attention weights of the model, for each generation step"),k$.forEach(t),et.forEach(t),Ed=l(e),x=n(e,"P",{});var q=s(x);Cf=i(q,"Here we have the "),_c=n(q,"CODE",{});var $2=s(_c);Wf=i($2,"scores"),$2.forEach(t),Af=i(q," since we passed along "),bc=n(q,"CODE",{});var T2=s(bc);Nf=i(T2,"output_scores=True"),T2.forEach(t),Vf=i(q,", but we don\u2019t have "),vc=n(q,"CODE",{});var y2=s(vc);Mf=i(y2,"hidden_states"),y2.forEach(t),Gf=i(q,` and
`),$c=n(q,"CODE",{});var k2=s($c);jf=i(k2,"attentions"),k2.forEach(t),Hf=i(q," because we didn\u2019t pass "),Tc=n(q,"CODE",{});var x2=s(Tc);Rf=i(x2,"output_hidden_states=True"),x2.forEach(t),Kf=i(q," or "),yc=n(q,"CODE",{});var w2=s(yc);Uf=i(w2,"output_attentions=True"),w2.forEach(t),Yf=i(q,"."),q.forEach(t),Pd=l(e),S=n(e,"P",{});var Ve=s(S);Xf=i(Ve,`You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you
will get `),kc=n(Ve,"CODE",{});var L2=s(kc);Jf=i(L2,"None"),L2.forEach(t),Qf=i(Ve,". Here for instance "),xc=n(Ve,"CODE",{});var E2=s(xc);Zf=i(E2,"generation_output.scores"),E2.forEach(t),eg=i(Ve,` are all the generated prediction scores of the
language modeling head, and `),wc=n(Ve,"CODE",{});var P2=s(wc);rg=i(P2,"generation_output.attentions"),P2.forEach(t),tg=i(Ve," is "),Lc=n(Ve,"CODE",{});var F2=s(Lc);og=i(F2,"None"),F2.forEach(t),ng=i(Ve,"."),Ve.forEach(t),Fd=l(e),z=n(e,"P",{});var Me=s(z);sg=i(Me,"When using our "),Ec=n(Me,"CODE",{});var D2=s(Ec);ag=i(D2,"generation_output"),D2.forEach(t),ig=i(Me," object as a tuple, it only keeps the attributes that don\u2019t have "),Pc=n(Me,"CODE",{});var S2=s(Pc);cg=i(S2,"None"),S2.forEach(t),lg=i(Me,` values.
Here, for instance, it has two elements, `),Fc=n(Me,"CODE",{});var z2=s(Fc);dg=i(z2,"loss"),z2.forEach(t),pg=i(Me," then "),Dc=n(Me,"CODE",{});var O2=s(Dc);mg=i(O2,"logits"),O2.forEach(t),fg=i(Me,", so"),Me.forEach(t),Dd=l(e),g(ct.$$.fragment,e),Sd=l(e),br=n(e,"P",{});var em=s(br);gg=i(em,"will return the tuple "),Sc=n(em,"CODE",{});var q2=s(Sc);hg=i(q2,"(generation_output.sequences, generation_output.scores)"),q2.forEach(t),ug=i(em," for instance."),em.forEach(t),zd=l(e),O=n(e,"P",{});var Ge=s(O);_g=i(Ge,"When using our "),zc=n(Ge,"CODE",{});var B2=s(zc);bg=i(B2,"generation_output"),B2.forEach(t),vg=i(Ge," object as a dictionary, it only keeps the attributes that don\u2019t have "),Oc=n(Ge,"CODE",{});var I2=s(Oc);$g=i(I2,"None"),I2.forEach(t),Tg=i(Ge,`
values. Here, for instance, it has two keys that are `),qc=n(Ge,"CODE",{});var C2=s(qc);yg=i(C2,"sequences"),C2.forEach(t),kg=i(Ge," and "),Bc=n(Ge,"CODE",{});var W2=s(Bc);xg=i(W2,"scores"),W2.forEach(t),wg=i(Ge,"."),Ge.forEach(t),Od=l(e),ls=n(e,"P",{});var A2=s(ls);Lg=i(A2,"We document here all output types."),A2.forEach(t),qd=l(e),Ke=n(e,"H3",{class:!0});var rm=s(Ke);vr=n(rm,"A",{id:!0,class:!0,href:!0});var N2=s(vr);Ic=n(N2,"SPAN",{});var V2=s(Ic);g(lt.$$.fragment,V2),V2.forEach(t),N2.forEach(t),Eg=l(rm),Cc=n(rm,"SPAN",{});var M2=s(Cc);Pg=i(M2,"GreedySearchOutput"),M2.forEach(t),rm.forEach(t),Bd=l(e),Ue=n(e,"DIV",{class:!0});var tm=s(Ue);g(dt.$$.fragment,tm),Fg=l(tm),Wc=n(tm,"P",{});var G2=s(Wc);Dg=i(G2,"Base class for outputs of decoder-only generation models using greedy search."),G2.forEach(t),tm.forEach(t),Id=l(e),Ye=n(e,"DIV",{class:!0});var om=s(Ye);g(pt.$$.fragment,om),Sg=l(om),Ac=n(om,"P",{});var j2=s(Ac);zg=i(j2,`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)`),j2.forEach(t),om.forEach(t),Cd=l(e),R=n(e,"DIV",{class:!0});var ui=s(R);g(mt.$$.fragment,ui),Og=l(ui),Nc=n(ui,"P",{});var H2=s(Nc);qg=i(H2,"Flax Base class for outputs of decoder-only generation models using greedy search."),H2.forEach(t),Bg=l(ui),$r=n(ui,"DIV",{class:!0});var nm=s($r);g(ft.$$.fragment,nm),Ig=l(nm),Vc=n(nm,"P",{});var R2=s(Vc);Cg=i(R2,"\u201CReturns a new object replacing the specified fields with new values."),R2.forEach(t),nm.forEach(t),ui.forEach(t),Wd=l(e),Xe=n(e,"H3",{class:!0});var sm=s(Xe);Tr=n(sm,"A",{id:!0,class:!0,href:!0});var K2=s(Tr);Mc=n(K2,"SPAN",{});var U2=s(Mc);g(gt.$$.fragment,U2),U2.forEach(t),K2.forEach(t),Wg=l(sm),Gc=n(sm,"SPAN",{});var Y2=s(Gc);Ag=i(Y2,"SampleOutput"),Y2.forEach(t),sm.forEach(t),Ad=l(e),Je=n(e,"DIV",{class:!0});var am=s(Je);g(ht.$$.fragment,am),Ng=l(am),jc=n(am,"P",{});var X2=s(jc);Vg=i(X2,"Base class for outputs of decoder-only generation models using sampling."),X2.forEach(t),am.forEach(t),Nd=l(e),Qe=n(e,"DIV",{class:!0});var im=s(Qe);g(ut.$$.fragment,im),Mg=l(im),Hc=n(im,"P",{});var J2=s(Hc);Gg=i(J2,`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)`),J2.forEach(t),im.forEach(t),Vd=l(e),K=n(e,"DIV",{class:!0});var _i=s(K);g(_t.$$.fragment,_i),jg=l(_i),Rc=n(_i,"P",{});var Q2=s(Rc);Hg=i(Q2,"Flax Base class for outputs of decoder-only generation models using sampling."),Q2.forEach(t),Rg=l(_i),yr=n(_i,"DIV",{class:!0});var cm=s(yr);g(bt.$$.fragment,cm),Kg=l(cm),Kc=n(cm,"P",{});var Z2=s(Kc);Ug=i(Z2,"\u201CReturns a new object replacing the specified fields with new values."),Z2.forEach(t),cm.forEach(t),_i.forEach(t),Md=l(e),Ze=n(e,"H3",{class:!0});var lm=s(Ze);kr=n(lm,"A",{id:!0,class:!0,href:!0});var eT=s(kr);Uc=n(eT,"SPAN",{});var rT=s(Uc);g(vt.$$.fragment,rT),rT.forEach(t),eT.forEach(t),Yg=l(lm),Yc=n(lm,"SPAN",{});var tT=s(Yc);Xg=i(tT,"BeamSearchOutput"),tT.forEach(t),lm.forEach(t),Gd=l(e),er=n(e,"DIV",{class:!0});var dm=s(er);g($t.$$.fragment,dm),Jg=l(dm),Xc=n(dm,"P",{});var oT=s(Xc);Qg=i(oT,"Base class for outputs of decoder-only generation models using beam search."),oT.forEach(t),dm.forEach(t),jd=l(e),rr=n(e,"DIV",{class:!0});var pm=s(rr);g(Tt.$$.fragment,pm),Zg=l(pm),Jc=n(pm,"P",{});var nT=s(Jc);eh=i(nT,`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)`),nT.forEach(t),pm.forEach(t),Hd=l(e),tr=n(e,"H3",{class:!0});var mm=s(tr);xr=n(mm,"A",{id:!0,class:!0,href:!0});var sT=s(xr);Qc=n(sT,"SPAN",{});var aT=s(Qc);g(yt.$$.fragment,aT),aT.forEach(t),sT.forEach(t),rh=l(mm),Zc=n(mm,"SPAN",{});var iT=s(Zc);th=i(iT,"BeamSampleOutput"),iT.forEach(t),mm.forEach(t),Rd=l(e),or=n(e,"DIV",{class:!0});var fm=s(or);g(kt.$$.fragment,fm),oh=l(fm),el=n(fm,"P",{});var cT=s(el);nh=i(cT,"Base class for outputs of decoder-only generation models using beam sample."),cT.forEach(t),fm.forEach(t),Kd=l(e),nr=n(e,"DIV",{class:!0});var gm=s(nr);g(xt.$$.fragment,gm),sh=l(gm),rl=n(gm,"P",{});var lT=s(rl);ah=i(lT,`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)`),lT.forEach(t),gm.forEach(t),Ud=l(e),sr=n(e,"H2",{class:!0});var hm=s(sr);wr=n(hm,"A",{id:!0,class:!0,href:!0});var dT=s(wr);tl=n(dT,"SPAN",{});var pT=s(tl);g(wt.$$.fragment,pT),pT.forEach(t),dT.forEach(t),ih=l(hm),ol=n(hm,"SPAN",{});var mT=s(ol);ch=i(mT,"LogitsProcessor"),mT.forEach(t),hm.forEach(t),Yd=l(e),Lr=n(e,"P",{});var um=s(Lr);lh=i(um,"A "),ds=n(um,"A",{href:!0});var fT=s(ds);dh=i(fT,"LogitsProcessor"),fT.forEach(t),ph=i(um,` can be used to modify the prediction scores of a language model head for
generation.`),um.forEach(t),Xd=l(e),U=n(e,"DIV",{class:!0});var bi=s(U);g(Lt.$$.fragment,bi),mh=l(bi),nl=n(bi,"P",{});var gT=s(nl);fh=i(gT,"Abstract base class for all logit processors that can be applied during generation."),gT.forEach(t),gh=l(bi),Er=n(bi,"DIV",{class:!0});var _m=s(Er);g(Et.$$.fragment,_m),hh=l(_m),sl=n(_m,"P",{});var hT=s(sl);uh=i(hT,"Torch method for processing logits."),hT.forEach(t),_m.forEach(t),bi.forEach(t),Jd=l(e),Y=n(e,"DIV",{class:!0});var vi=s(Y);g(Pt.$$.fragment,vi),_h=l(vi),L=n(vi,"P",{});var B=s(L);bh=i(B,"This class can be used to create a list of "),ps=n(B,"A",{href:!0});var uT=s(ps);vh=i(uT,"LogitsProcessor"),uT.forEach(t),$h=i(B," or "),ms=n(B,"A",{href:!0});var _T=s(ms);Th=i(_T,"LogitsWarper"),_T.forEach(t),yh=i(B,` to subsequently process a
`),al=n(B,"CODE",{});var bT=s(al);kh=i(bT,"scores"),bT.forEach(t),xh=i(B," input tensor. This class inherits from list and adds a specific "),il=n(B,"EM",{});var vT=s(il);cl=n(vT,"STRONG",{});var $T=s(cl);wh=i($T,"call"),$T.forEach(t),vT.forEach(t),Lh=i(B,` method to apply each
`),fs=n(B,"A",{href:!0});var TT=s(fs);Eh=i(TT,"LogitsProcessor"),TT.forEach(t),Ph=i(B," or "),gs=n(B,"A",{href:!0});var yT=s(gs);Fh=i(yT,"LogitsWarper"),yT.forEach(t),Dh=i(B," to the inputs."),B.forEach(t),Sh=l(vi),hs=n(vi,"DIV",{class:!0});var kT=s(hs);g(Ft.$$.fragment,kT),kT.forEach(t),vi.forEach(t),Qd=l(e),X=n(e,"DIV",{class:!0});var $i=s(X);g(Dt.$$.fragment,$i),zh=l($i),ll=n($i,"P",{});var xT=s(ll);Oh=i(xT,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),xT.forEach(t),qh=l($i),Pr=n($i,"DIV",{class:!0});var bm=s(Pr);g(St.$$.fragment,bm),Bh=l(bm),dl=n(bm,"P",{});var wT=s(dl);Ih=i(wT,"Torch method for warping logits."),wT.forEach(t),bm.forEach(t),$i.forEach(t),Zd=l(e),J=n(e,"DIV",{class:!0});var Ti=s(J);g(zt.$$.fragment,Ti),Ch=l(Ti),us=n(Ti,"P",{});var x$=s(us);_s=n(x$,"A",{href:!0});var LT=s(_s);Wh=i(LT,"LogitsProcessor"),LT.forEach(t),Ah=i(x$," enforcing a min-length by setting EOS probability to 0."),x$.forEach(t),Nh=l(Ti),bs=n(Ti,"DIV",{class:!0});var ET=s(bs);g(Ot.$$.fragment,ET),ET.forEach(t),Ti.forEach(t),ep=l(e),Q=n(e,"DIV",{class:!0});var yi=s(Q);g(qt.$$.fragment,yi),Vh=l(yi),vs=n(yi,"P",{});var w$=s(vs);$s=n(w$,"A",{href:!0});var PT=s($s);Mh=i(PT,"LogitsWarper"),PT.forEach(t),Gh=i(w$," for temperature (exponential scaling output probability distribution)."),w$.forEach(t),jh=l(yi),Ts=n(yi,"DIV",{class:!0});var FT=s(Ts);g(Bt.$$.fragment,FT),FT.forEach(t),yi.forEach(t),rp=l(e),Z=n(e,"DIV",{class:!0});var ki=s(Z);g(It.$$.fragment,ki),Hh=l(ki),ys=n(ki,"P",{});var L$=s(ys);ks=n(L$,"A",{href:!0});var DT=s(ks);Rh=i(DT,"LogitsProcessor"),DT.forEach(t),Kh=i(L$," enforcing an exponential penalty on repeated sequences."),L$.forEach(t),Uh=l(ki),xs=n(ki,"DIV",{class:!0});var ST=s(xs);g(Ct.$$.fragment,ST),ST.forEach(t),ki.forEach(t),tp=l(e),ee=n(e,"DIV",{class:!0});var xi=s(ee);g(Wt.$$.fragment,xi),Yh=l(xi),ws=n(xi,"P",{});var E$=s(ws);Ls=n(E$,"A",{href:!0});var zT=s(Ls);Xh=i(zT,"LogitsWarper"),zT.forEach(t),Jh=i(E$," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),E$.forEach(t),Qh=l(xi),Es=n(xi,"DIV",{class:!0});var OT=s(Es);g(At.$$.fragment,OT),OT.forEach(t),xi.forEach(t),op=l(e),re=n(e,"DIV",{class:!0});var wi=s(re);g(Nt.$$.fragment,wi),Zh=l(wi),Ps=n(wi,"P",{});var P$=s(Ps);Fs=n(P$,"A",{href:!0});var qT=s(Fs);eu=i(qT,"LogitsWarper"),qT.forEach(t),ru=i(P$," that performs top-k, i.e. restricting to the k highest probability elements."),P$.forEach(t),tu=l(wi),Ds=n(wi,"DIV",{class:!0});var BT=s(Ds);g(Vt.$$.fragment,BT),BT.forEach(t),wi.forEach(t),np=l(e),ar=n(e,"DIV",{class:!0});var vm=s(ar);g(Mt.$$.fragment,vm),ou=l(vm),Ss=n(vm,"DIV",{class:!0});var IT=s(Ss);g(Gt.$$.fragment,IT),IT.forEach(t),vm.forEach(t),sp=l(e),te=n(e,"DIV",{class:!0});var Li=s(te);g(jt.$$.fragment,Li),nu=l(Li),Fr=n(Li,"P",{});var md=s(Fr);zs=n(md,"A",{href:!0});var CT=s(zs);su=i(CT,"LogitsProcessor"),CT.forEach(t),au=i(md,` that enforces no repetition of n-grams. See
`),Ht=n(md,"A",{href:!0,rel:!0});var WT=s(Ht);iu=i(WT,"Fairseq"),WT.forEach(t),cu=i(md,"."),md.forEach(t),lu=l(Li),Os=n(Li,"DIV",{class:!0});var AT=s(Os);g(Rt.$$.fragment,AT),AT.forEach(t),Li.forEach(t),ap=l(e),oe=n(e,"DIV",{class:!0});var Ei=s(oe);g(Kt.$$.fragment,Ei),du=l(Ei),qs=n(Ei,"P",{});var F$=s(qs);Bs=n(F$,"A",{href:!0});var NT=s(Bs);pu=i(NT,"LogitsProcessor"),NT.forEach(t),mu=i(F$," that enforces that specified sequences will never be sampled."),F$.forEach(t),fu=l(Ei),Is=n(Ei,"DIV",{class:!0});var VT=s(Is);g(Ut.$$.fragment,VT),VT.forEach(t),Ei.forEach(t),ip=l(e),ne=n(e,"DIV",{class:!0});var Pi=s(ne);g(Yt.$$.fragment,Pi),gu=l(Pi),Dr=n(Pi,"P",{});var fd=s(Dr);Cs=n(fd,"A",{href:!0});var MT=s(Cs);hu=i(MT,"LogitsProcessor"),MT.forEach(t),uu=i(fd,` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),Xt=n(fd,"A",{href:!0,rel:!0});var GT=s(Xt);_u=i(GT,"Autoregressive Entity Retrieval"),GT.forEach(t),bu=i(fd," for more information."),fd.forEach(t),vu=l(Pi),Ws=n(Pi,"DIV",{class:!0});var jT=s(Ws);g(Jt.$$.fragment,jT),jT.forEach(t),Pi.forEach(t),cp=l(e),se=n(e,"DIV",{class:!0});var Fi=s(se);g(Qt.$$.fragment,Fi),$u=l(Fi),Ae=n(Fi,"P",{});var Hn=s(Ae);As=n(Hn,"A",{href:!0});var HT=s(As);Tu=i(HT,"LogitsProcessor"),HT.forEach(t),yu=i(Hn,` that enforces diverse beam search. Note that this logits processor is only effective for
`),Ns=n(Hn,"A",{href:!0});var RT=s(Ns);ku=i(RT,"PreTrainedModel.group_beam_search()"),RT.forEach(t),xu=i(Hn,". See "),Zt=n(Hn,"A",{href:!0,rel:!0});var KT=s(Zt);wu=i(KT,`Diverse Beam Search: Decoding Diverse Solutions from Neural Sequence
Models`),KT.forEach(t),Lu=i(Hn," for more details."),Hn.forEach(t),Eu=l(Fi),Vs=n(Fi,"DIV",{class:!0});var UT=s(Vs);g(eo.$$.fragment,UT),UT.forEach(t),Fi.forEach(t),lp=l(e),ae=n(e,"DIV",{class:!0});var Di=s(ae);g(ro.$$.fragment,Di),Pu=l(Di),Ms=n(Di,"P",{});var D$=s(Ms);Gs=n(D$,"A",{href:!0});var YT=s(Gs);Fu=i(YT,"LogitsProcessor"),YT.forEach(t),Du=i(D$," that enforces the specified token as the first generated token."),D$.forEach(t),Su=l(Di),js=n(Di,"DIV",{class:!0});var XT=s(js);g(to.$$.fragment,XT),XT.forEach(t),Di.forEach(t),dp=l(e),ie=n(e,"DIV",{class:!0});var Si=s(ie);g(oo.$$.fragment,Si),zu=l(Si),Sr=n(Si,"P",{});var gd=s(Sr);Hs=n(gd,"A",{href:!0});var JT=s(Hs);Ou=i(JT,"LogitsProcessor"),JT.forEach(t),qu=i(gd," that enforces the specified token as the last generated token when "),pl=n(gd,"CODE",{});var QT=s(pl);Bu=i(QT,"max_length"),QT.forEach(t),Iu=i(gd," is reached."),gd.forEach(t),Cu=l(Si),Rs=n(Si,"DIV",{class:!0});var ZT=s(Rs);g(no.$$.fragment,ZT),ZT.forEach(t),Si.forEach(t),pp=l(e),ce=n(e,"DIV",{class:!0});var zi=s(ce);g(so.$$.fragment,zi),Wu=l(zi),G=n(zi,"P",{});var ur=s(G);Ks=n(ur,"A",{href:!0});var e4=s(Ks);Au=i(e4,"LogitsProcessor"),e4.forEach(t),Nu=i(ur," that removes all "),ml=n(ur,"CODE",{});var r4=s(ml);Vu=i(r4,"nan"),r4.forEach(t),Mu=i(ur," and "),fl=n(ur,"CODE",{});var t4=s(fl);Gu=i(t4,"inf"),t4.forEach(t),ju=i(ur,` 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. `),gl=n(ur,"CODE",{});var o4=s(gl);Hu=i(o4,"max_length"),o4.forEach(t),Ru=i(ur,` is
reached.`),ur.forEach(t),Ku=l(zi),Us=n(zi,"DIV",{class:!0});var n4=s(Us);g(ao.$$.fragment,n4),n4.forEach(t),zi.forEach(t),mp=l(e),le=n(e,"DIV",{class:!0});var Oi=s(le);g(io.$$.fragment,Oi),Uu=l(Oi),hl=n(Oi,"P",{});var s4=s(hl);Yu=i(s4,"Abstract base class for all logit processors that can be applied during generation."),s4.forEach(t),Xu=l(Oi),zr=n(Oi,"DIV",{class:!0});var $m=s(zr);g(co.$$.fragment,$m),Ju=l($m),ul=n($m,"P",{});var a4=s(ul);Qu=i(a4,"TF method for processing logits."),a4.forEach(t),$m.forEach(t),Oi.forEach(t),fp=l(e),de=n(e,"DIV",{class:!0});var qi=s(de);g(lo.$$.fragment,qi),Zu=l(qi),C=n(qi,"P",{});var je=s(C);e_=i(je,"This class can be used to create a list of "),Ys=n(je,"A",{href:!0});var i4=s(Ys);r_=i(i4,"TFLogitsProcessor"),i4.forEach(t),t_=i(je," to subsequently process a "),_l=n(je,"CODE",{});var c4=s(_l);o_=i(c4,"scores"),c4.forEach(t),n_=i(je,` input tensor.
This class inherits from list and adds a specific `),bl=n(je,"EM",{});var l4=s(bl);vl=n(l4,"STRONG",{});var d4=s(vl);s_=i(d4,"call"),d4.forEach(t),l4.forEach(t),a_=i(je," method to apply each "),Xs=n(je,"A",{href:!0});var p4=s(Xs);i_=i(p4,"TFLogitsProcessor"),p4.forEach(t),c_=i(je,` to the
inputs.`),je.forEach(t),l_=l(qi),Js=n(qi,"DIV",{class:!0});var m4=s(Js);g(po.$$.fragment,m4),m4.forEach(t),qi.forEach(t),gp=l(e),pe=n(e,"DIV",{class:!0});var Bi=s(pe);g(mo.$$.fragment,Bi),d_=l(Bi),$l=n(Bi,"P",{});var f4=s($l);p_=i(f4,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),f4.forEach(t),m_=l(Bi),Or=n(Bi,"DIV",{class:!0});var Tm=s(Or);g(fo.$$.fragment,Tm),f_=l(Tm),Tl=n(Tm,"P",{});var g4=s(Tl);g_=i(g4,"TF method for warping logits."),g4.forEach(t),Tm.forEach(t),Bi.forEach(t),hp=l(e),me=n(e,"DIV",{class:!0});var Ii=s(me);g(go.$$.fragment,Ii),h_=l(Ii),Qs=n(Ii,"P",{});var S$=s(Qs);Zs=n(S$,"A",{href:!0});var h4=s(Zs);u_=i(h4,"TFLogitsWarper"),h4.forEach(t),__=i(S$," for temperature (exponential scaling output probability distribution)."),S$.forEach(t),b_=l(Ii),ea=n(Ii,"DIV",{class:!0});var u4=s(ea);g(ho.$$.fragment,u4),u4.forEach(t),Ii.forEach(t),up=l(e),fe=n(e,"DIV",{class:!0});var Ci=s(fe);g(uo.$$.fragment,Ci),v_=l(Ci),ra=n(Ci,"P",{});var z$=s(ra);ta=n(z$,"A",{href:!0});var _4=s(ta);$_=i(_4,"TFLogitsWarper"),_4.forEach(t),T_=i(z$," that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),z$.forEach(t),y_=l(Ci),oa=n(Ci,"DIV",{class:!0});var b4=s(oa);g(_o.$$.fragment,b4),b4.forEach(t),Ci.forEach(t),_p=l(e),ge=n(e,"DIV",{class:!0});var Wi=s(ge);g(bo.$$.fragment,Wi),k_=l(Wi),na=n(Wi,"P",{});var O$=s(na);sa=n(O$,"A",{href:!0});var v4=s(sa);x_=i(v4,"TFLogitsWarper"),v4.forEach(t),w_=i(O$," that performs top-k, i.e. restricting to the k highest probability elements."),O$.forEach(t),L_=l(Wi),aa=n(Wi,"DIV",{class:!0});var $4=s(aa);g(vo.$$.fragment,$4),$4.forEach(t),Wi.forEach(t),bp=l(e),he=n(e,"DIV",{class:!0});var Ai=s(he);g($o.$$.fragment,Ai),E_=l(Ai),ia=n(Ai,"P",{});var q$=s(ia);ca=n(q$,"A",{href:!0});var T4=s(ca);P_=i(T4,"TFLogitsProcessor"),T4.forEach(t),F_=i(q$," enforcing a min-length by setting EOS probability to 0."),q$.forEach(t),D_=l(Ai),la=n(Ai,"DIV",{class:!0});var y4=s(la);g(To.$$.fragment,y4),y4.forEach(t),Ai.forEach(t),vp=l(e),ue=n(e,"DIV",{class:!0});var Ni=s(ue);g(yo.$$.fragment,Ni),S_=l(Ni),da=n(Ni,"P",{});var B$=s(da);pa=n(B$,"A",{href:!0});var k4=s(pa);z_=i(k4,"TFLogitsProcessor"),k4.forEach(t),O_=i(B$," that enforces that specified sequences will never be sampled."),B$.forEach(t),q_=l(Ni),ma=n(Ni,"DIV",{class:!0});var x4=s(ma);g(ko.$$.fragment,x4),x4.forEach(t),Ni.forEach(t),$p=l(e),_e=n(e,"DIV",{class:!0});var Vi=s(_e);g(xo.$$.fragment,Vi),B_=l(Vi),qr=n(Vi,"P",{});var hd=s(qr);fa=n(hd,"A",{href:!0});var w4=s(fa);I_=i(w4,"TFLogitsProcessor"),w4.forEach(t),C_=i(hd,` that enforces no repetition of n-grams. See
`),wo=n(hd,"A",{href:!0,rel:!0});var L4=s(wo);W_=i(L4,"Fairseq"),L4.forEach(t),A_=i(hd,"."),hd.forEach(t),N_=l(Vi),ga=n(Vi,"DIV",{class:!0});var E4=s(ga);g(Lo.$$.fragment,E4),E4.forEach(t),Vi.forEach(t),Tp=l(e),be=n(e,"DIV",{class:!0});var Mi=s(be);g(Eo.$$.fragment,Mi),V_=l(Mi),ha=n(Mi,"P",{});var I$=s(ha);ua=n(I$,"A",{href:!0});var P4=s(ua);M_=i(P4,"TFLogitsProcessor"),P4.forEach(t),G_=i(I$," enforcing an exponential penalty on repeated sequences."),I$.forEach(t),j_=l(Mi),_a=n(Mi,"DIV",{class:!0});var F4=s(_a);g(Po.$$.fragment,F4),F4.forEach(t),Mi.forEach(t),yp=l(e),ve=n(e,"DIV",{class:!0});var Gi=s(ve);g(Fo.$$.fragment,Gi),H_=l(Gi),ba=n(Gi,"P",{});var C$=s(ba);va=n(C$,"A",{href:!0});var D4=s(va);R_=i(D4,"TFLogitsProcessor"),D4.forEach(t),K_=i(C$," that enforces the specified token as the first generated token."),C$.forEach(t),U_=l(Gi),$a=n(Gi,"DIV",{class:!0});var S4=s($a);g(Do.$$.fragment,S4),S4.forEach(t),Gi.forEach(t),kp=l(e),$e=n(e,"DIV",{class:!0});var ji=s($e);g(So.$$.fragment,ji),Y_=l(ji),Br=n(ji,"P",{});var ud=s(Br);Ta=n(ud,"A",{href:!0});var z4=s(Ta);X_=i(z4,"TFLogitsProcessor"),z4.forEach(t),J_=i(ud," that enforces the specified token as the last generated token when "),yl=n(ud,"CODE",{});var O4=s(yl);Q_=i(O4,"max_length"),O4.forEach(t),Z_=i(ud," is reached."),ud.forEach(t),eb=l(ji),ya=n(ji,"DIV",{class:!0});var q4=s(ya);g(zo.$$.fragment,q4),q4.forEach(t),ji.forEach(t),xp=l(e),Te=n(e,"DIV",{class:!0});var Hi=s(Te);g(Oo.$$.fragment,Hi),rb=l(Hi),kl=n(Hi,"P",{});var B4=s(kl);tb=i(B4,"Abstract base class for all logit processors that can be applied during generation."),B4.forEach(t),ob=l(Hi),Ir=n(Hi,"DIV",{class:!0});var ym=s(Ir);g(qo.$$.fragment,ym),nb=l(ym),xl=n(ym,"P",{});var I4=s(xl);sb=i(I4,"Flax method for processing logits."),I4.forEach(t),ym.forEach(t),Hi.forEach(t),wp=l(e),ye=n(e,"DIV",{class:!0});var Ri=s(ye);g(Bo.$$.fragment,Ri),ab=l(Ri),E=n(Ri,"P",{});var I=s(E);ib=i(I,"This class can be used to create a list of "),ka=n(I,"A",{href:!0});var C4=s(ka);cb=i(C4,"FlaxLogitsProcessor"),C4.forEach(t),lb=i(I," or "),xa=n(I,"A",{href:!0});var W4=s(xa);db=i(W4,"FlaxLogitsWarper"),W4.forEach(t),pb=i(I,` to subsequently process
a `),wl=n(I,"CODE",{});var A4=s(wl);mb=i(A4,"scores"),A4.forEach(t),fb=i(I," input tensor. This class inherits from list and adds a specific "),Ll=n(I,"EM",{});var N4=s(Ll);El=n(N4,"STRONG",{});var V4=s(El);gb=i(V4,"call"),V4.forEach(t),N4.forEach(t),hb=i(I,` method to apply each
`),wa=n(I,"A",{href:!0});var M4=s(wa);ub=i(M4,"FlaxLogitsProcessor"),M4.forEach(t),_b=i(I," or "),La=n(I,"A",{href:!0});var G4=s(La);bb=i(G4,"FlaxLogitsWarper"),G4.forEach(t),vb=i(I," to the inputs."),I.forEach(t),$b=l(Ri),Ea=n(Ri,"DIV",{class:!0});var j4=s(Ea);g(Io.$$.fragment,j4),j4.forEach(t),Ri.forEach(t),Lp=l(e),ke=n(e,"DIV",{class:!0});var Ki=s(ke);g(Co.$$.fragment,Ki),Tb=l(Ki),Pl=n(Ki,"P",{});var H4=s(Pl);yb=i(H4,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),H4.forEach(t),kb=l(Ki),Cr=n(Ki,"DIV",{class:!0});var km=s(Cr);g(Wo.$$.fragment,km),xb=l(km),Fl=n(km,"P",{});var R4=s(Fl);wb=i(R4,"Flax method for warping logits."),R4.forEach(t),km.forEach(t),Ki.forEach(t),Ep=l(e),xe=n(e,"DIV",{class:!0});var Ui=s(xe);g(Ao.$$.fragment,Ui),Lb=l(Ui),Pa=n(Ui,"P",{});var W$=s(Pa);Fa=n(W$,"A",{href:!0});var K4=s(Fa);Eb=i(K4,"FlaxLogitsWarper"),K4.forEach(t),Pb=i(W$," for temperature (exponential scaling output probability distribution)."),W$.forEach(t),Fb=l(Ui),Da=n(Ui,"DIV",{class:!0});var U4=s(Da);g(No.$$.fragment,U4),U4.forEach(t),Ui.forEach(t),Pp=l(e),we=n(e,"DIV",{class:!0});var Yi=s(we);g(Vo.$$.fragment,Yi),Db=l(Yi),Sa=n(Yi,"P",{});var A$=s(Sa);za=n(A$,"A",{href:!0});var Y4=s(za);Sb=i(Y4,"FlaxLogitsWarper"),Y4.forEach(t),zb=i(A$," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),A$.forEach(t),Ob=l(Yi),Oa=n(Yi,"DIV",{class:!0});var X4=s(Oa);g(Mo.$$.fragment,X4),X4.forEach(t),Yi.forEach(t),Fp=l(e),Le=n(e,"DIV",{class:!0});var Xi=s(Le);g(Go.$$.fragment,Xi),qb=l(Xi),qa=n(Xi,"P",{});var N$=s(qa);Ba=n(N$,"A",{href:!0});var J4=s(Ba);Bb=i(J4,"FlaxLogitsWarper"),J4.forEach(t),Ib=i(N$," that performs top-k, i.e. restricting to the k highest probability elements."),N$.forEach(t),Cb=l(Xi),Ia=n(Xi,"DIV",{class:!0});var Q4=s(Ia);g(jo.$$.fragment,Q4),Q4.forEach(t),Xi.forEach(t),Dp=l(e),Ee=n(e,"DIV",{class:!0});var Ji=s(Ee);g(Ho.$$.fragment,Ji),Wb=l(Ji),Ca=n(Ji,"P",{});var V$=s(Ca);Wa=n(V$,"A",{href:!0});var Z4=s(Wa);Ab=i(Z4,"FlaxLogitsProcessor"),Z4.forEach(t),Nb=i(V$," that enforces the specified token as the first generated token."),V$.forEach(t),Vb=l(Ji),Aa=n(Ji,"DIV",{class:!0});var ey=s(Aa);g(Ro.$$.fragment,ey),ey.forEach(t),Ji.forEach(t),Sp=l(e),Pe=n(e,"DIV",{class:!0});var Qi=s(Pe);g(Ko.$$.fragment,Qi),Mb=l(Qi),Wr=n(Qi,"P",{});var _d=s(Wr);Na=n(_d,"A",{href:!0});var ry=s(Na);Gb=i(ry,"FlaxLogitsProcessor"),ry.forEach(t),jb=i(_d," that enforces the specified token as the last generated token when "),Dl=n(_d,"CODE",{});var ty=s(Dl);Hb=i(ty,"max_length"),ty.forEach(t),Rb=i(_d," is reached."),_d.forEach(t),Kb=l(Qi),Va=n(Qi,"DIV",{class:!0});var oy=s(Va);g(Uo.$$.fragment,oy),oy.forEach(t),Qi.forEach(t),zp=l(e),Fe=n(e,"DIV",{class:!0});var Zi=s(Fe);g(Yo.$$.fragment,Zi),Ub=l(Zi),Ma=n(Zi,"P",{});var M$=s(Ma);Ga=n(M$,"A",{href:!0});var ny=s(Ga);Yb=i(ny,"FlaxLogitsProcessor"),ny.forEach(t),Xb=i(M$," enforcing a min-length by setting EOS probability to 0."),M$.forEach(t),Jb=l(Zi),ja=n(Zi,"DIV",{class:!0});var sy=s(ja);g(Xo.$$.fragment,sy),sy.forEach(t),Zi.forEach(t),Op=l(e),ir=n(e,"H2",{class:!0});var xm=s(ir);Ar=n(xm,"A",{id:!0,class:!0,href:!0});var ay=s(Ar);Sl=n(ay,"SPAN",{});var iy=s(Sl);g(Jo.$$.fragment,iy),iy.forEach(t),ay.forEach(t),Qb=l(xm),zl=n(xm,"SPAN",{});var cy=s(zl);Zb=i(cy,"StoppingCriteria"),cy.forEach(t),xm.forEach(t),qp=l(e),Nr=n(e,"P",{});var wm=s(Nr);ev=i(wm,"A "),Ha=n(wm,"A",{href:!0});var ly=s(Ha);rv=i(ly,"StoppingCriteria"),ly.forEach(t),tv=i(wm," can be used to change when to stop generation (other than EOS token)."),wm.forEach(t),Bp=l(e),De=n(e,"DIV",{class:!0});var ec=s(De);g(Qo.$$.fragment,ec),ov=l(ec),Ol=n(ec,"P",{});var dy=s(Ol);nv=i(dy,"Abstract base class for all stopping criteria that can be applied during generation."),dy.forEach(t),sv=l(ec),Ra=n(ec,"DIV",{class:!0});var py=s(Ra);g(Zo.$$.fragment,py),py.forEach(t),ec.forEach(t),Ip=l(e),cr=n(e,"DIV",{class:!0});var Lm=s(cr);g(en.$$.fragment,Lm),av=l(Lm),Ka=n(Lm,"DIV",{class:!0});var my=s(Ka);g(rn.$$.fragment,my),my.forEach(t),Lm.forEach(t),Cp=l(e),Se=n(e,"DIV",{class:!0});var rc=s(Se);g(tn.$$.fragment,rc),iv=l(rc),on=n(rc,"P",{});var Em=s(on);cv=i(Em,"This class can be used to stop generation whenever the full generated number of tokens exceeds "),ql=n(Em,"CODE",{});var fy=s(ql);lv=i(fy,"max_length"),fy.forEach(t),dv=i(Em,`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),Em.forEach(t),pv=l(rc),Ua=n(rc,"DIV",{class:!0});var gy=s(Ua);g(nn.$$.fragment,gy),gy.forEach(t),rc.forEach(t),Wp=l(e),ze=n(e,"DIV",{class:!0});var tc=s(ze);g(sn.$$.fragment,tc),mv=l(tc),an=n(tc,"P",{});var Pm=s(an);fv=i(Pm,`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
`),Bl=n(Pm,"CODE",{});var hy=s(Bl);gv=i(hy,"initial_time"),hy.forEach(t),hv=i(Pm,"."),Pm.forEach(t),uv=l(tc),Ya=n(tc,"DIV",{class:!0});var uy=s(Ya);g(cn.$$.fragment,uy),uy.forEach(t),tc.forEach(t),Ap=l(e),lr=n(e,"H2",{class:!0});var Fm=s(lr);Vr=n(Fm,"A",{id:!0,class:!0,href:!0});var _y=s(Vr);Il=n(_y,"SPAN",{});var by=s(Il);g(ln.$$.fragment,by),by.forEach(t),_y.forEach(t),_v=l(Fm),Cl=n(Fm,"SPAN",{});var vy=s(Cl);bv=i(vy,"Constraints"),vy.forEach(t),Fm.forEach(t),Np=l(e),Mr=n(e,"P",{});var Dm=s(Mr);vv=i(Dm,"A "),Xa=n(Dm,"A",{href:!0});var $y=s(Xa);$v=i($y,"Constraint"),$y.forEach(t),Tv=i(Dm," can be used to force the generation to include specific tokens or sequences in the output."),Dm.forEach(t),Vp=l(e),$=n(e,"DIV",{class:!0});var T=s($);g(dn.$$.fragment,T),yv=l(T),Wl=n(T,"P",{});var Ty=s(Wl);kv=i(Ty,`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),Ty.forEach(t),xv=l(T),Al=n(T,"P",{});var yy=s(Al);wv=i(yy,"All classes that inherit Constraint must follow the requirement that"),yy.forEach(t),Lv=l(T),g(Gr.$$.fragment,T),Ev=l(T),Nl=n(T,"P",{});var ky=s(Nl);Pv=i(ky,"will always terminate (halt)."),ky.forEach(t),Fv=l(T),jr=n(T,"DIV",{class:!0});var Sm=s(jr);g(pn.$$.fragment,Sm),Dv=l(Sm),Vl=n(Sm,"P",{});var xy=s(Vl);Sv=i(xy,"When called, returns the token that would take this constraint one step closer to being fulfilled."),xy.forEach(t),Sm.forEach(t),zv=l(T),Hr=n(T,"DIV",{class:!0});var zm=s(Hr);g(mn.$$.fragment,zm),Ov=l(zm),Ml=n(zm,"P",{});var wy=s(Ml);qv=i(wy,"Creates a new instance of this constraint."),wy.forEach(t),zm.forEach(t),Bv=l(T),Rr=n(T,"DIV",{class:!0});var Om=s(Rr);g(fn.$$.fragment,Om),Iv=l(Om),Gl=n(Om,"P",{});var Ly=s(Gl);Cv=i(Ly,"Reads in a token and returns whether it creates progress."),Ly.forEach(t),Om.forEach(t),Wv=l(T),Kr=n(T,"DIV",{class:!0});var qm=s(Kr);g(gn.$$.fragment,qm),Av=l(qm),hn=n(qm,"P",{});var Bm=s(hn);Nv=i(Bm,"Returns the number of remaining steps of "),jl=n(Bm,"CODE",{});var Ey=s(jl);Vv=i(Ey,"advance()"),Ey.forEach(t),Mv=i(Bm," in order to complete this constraint."),Bm.forEach(t),qm.forEach(t),Gv=l(T),Ur=n(T,"DIV",{class:!0});var Im=s(Ur);g(un.$$.fragment,Im),jv=l(Im),Hl=n(Im,"P",{});var Py=s(Hl);Hv=i(Py,`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.`),Py.forEach(t),Im.forEach(t),Rv=l(T),Yr=n(T,"DIV",{class:!0});var Cm=s(Yr);g(_n.$$.fragment,Cm),Kv=l(Cm),Rl=n(Cm,"P",{});var Fy=s(Rl);Uv=i(Fy,"Tests whether this constraint has been properly defined."),Fy.forEach(t),Cm.forEach(t),Yv=l(T),Ne=n(T,"DIV",{class:!0});var oc=s(Ne);g(bn.$$.fragment,oc),Xv=l(oc),vn=n(oc,"P",{});var Wm=s(vn);Jv=i(Wm,`Reads in a token and returns booleans that indicate the progress made by it. This function will update the
state of this object unlikes `),Kl=n(Wm,"CODE",{});var Dy=s(Kl);Qv=i(Dy,"does_advance(self, token_id: int)"),Dy.forEach(t),Zv=i(Wm,"."),Wm.forEach(t),e1=l(oc),Ul=n(oc,"P",{});var Sy=s(Ul);r1=i(Sy,`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)`),Sy.forEach(t),oc.forEach(t),T.forEach(t),Mp=l(e),dr=n(e,"DIV",{class:!0});var Am=s(dr);g($n.$$.fragment,Am),t1=l(Am),Ja=n(Am,"P",{});var G$=s(Ja);Qa=n(G$,"A",{href:!0});var zy=s(Qa);o1=i(zy,"Constraint"),zy.forEach(t),n1=i(G$," enforcing that an ordered sequence of tokens is included in the output."),G$.forEach(t),Am.forEach(t),Gp=l(e),pr=n(e,"DIV",{class:!0});var Nm=s(pr);g(Tn.$$.fragment,Nm),s1=l(Nm),yn=n(Nm,"P",{});var Vm=s(yn);a1=i(Vm,"A special "),Za=n(Vm,"A",{href:!0});var Oy=s(Za);i1=i(Oy,"Constraint"),Oy.forEach(t),c1=i(Vm," that is fulfilled by fulfilling just one of several constraints."),Vm.forEach(t),Nm.forEach(t),jp=l(e),W=n(e,"DIV",{class:!0});var rt=s(W);g(kn.$$.fragment,rt),l1=l(rt),Yl=n(rt,"P",{});var qy=s(Yl);d1=i(qy,"A class for beam scorers to track its progress through a list of constraints."),qy.forEach(t),p1=l(rt),F=n(rt,"DIV",{class:!0});var j=s(F);g(xn.$$.fragment,j),m1=l(j),Xl=n(j,"P",{});var By=s(Xl);f1=i(By,`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.`),By.forEach(t),g1=l(j),mr=n(j,"P",{});var nc=s(mr);h1=i(nc,"Given constraints "),Jl=n(nc,"CODE",{});var Iy=s(Jl);u1=i(Iy,"c_i = {t_ij | j == # of tokens}"),Iy.forEach(t),_1=i(nc,`, If we\u2019re not in the middle of progressing through a
specific constraint `),Ql=n(nc,"CODE",{});var Cy=s(Ql);b1=i(Cy,"c_i"),Cy.forEach(t),v1=i(nc,", we return:"),nc.forEach(t),$1=l(j),Zl=n(j,"P",{});var Wy=s(Zl);ed=n(Wy,"CODE",{});var Ay=s(ed);T1=i(Ay,"[t_k1 for k in indices of unfulfilled constraints]"),Ay.forEach(t),Wy.forEach(t),y1=l(j),Oe=n(j,"P",{});var tt=s(Oe);k1=i(tt,`If we are in the middle of a constraint, then we return:
`),rd=n(tt,"CODE",{});var Ny=s(rd);x1=i(Ny,"[t_ij]"),Ny.forEach(t),w1=i(tt,", where "),td=n(tt,"CODE",{});var Vy=s(td);L1=i(Vy,"i"),Vy.forEach(t),E1=i(tt," is the index of the inprogress constraint, "),od=n(tt,"CODE",{});var My=s(od);P1=i(My,"j"),My.forEach(t),F1=i(tt," is the next step for the constraint."),tt.forEach(t),D1=l(j),nd=n(j,"P",{});var Gy=s(nd);S1=i(Gy,`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.`),Gy.forEach(t),j.forEach(t),z1=l(rt),Xr=n(rt,"DIV",{class:!0});var Mm=s(Xr);g(wn.$$.fragment,Mm),O1=l(Mm),sd=n(Mm,"P",{});var jy=s(sd);q1=i(jy,"token_ids: the tokens generated thus far to reset the state of the progress through constraints."),jy.forEach(t),Mm.forEach(t),rt.forEach(t),Hp=l(e),fr=n(e,"H2",{class:!0});var Gm=s(fr);Jr=n(Gm,"A",{id:!0,class:!0,href:!0});var Hy=s(Jr);ad=n(Hy,"SPAN",{});var Ry=s(ad);g(Ln.$$.fragment,Ry),Ry.forEach(t),Hy.forEach(t),B1=l(Gm),id=n(Gm,"SPAN",{});var Ky=s(id);I1=i(Ky,"BeamSearch"),Ky.forEach(t),Gm.forEach(t),Rp=l(e),A=n(e,"DIV",{class:!0});var ot=s(A);g(En.$$.fragment,ot),C1=l(ot),gr=n(ot,"P",{});var sc=s(gr);W1=i(sc,"Abstract base class for all beam scorers that are used for "),ei=n(sc,"A",{href:!0});var Uy=s(ei);A1=i(Uy,"beam_search()"),Uy.forEach(t),N1=i(sc,` and
`),ri=n(sc,"A",{href:!0});var Yy=s(ri);V1=i(Yy,"beam_sample()"),Yy.forEach(t),M1=i(sc,"."),sc.forEach(t),G1=l(ot),ti=n(ot,"DIV",{class:!0});var Xy=s(ti);g(Pn.$$.fragment,Xy),Xy.forEach(t),j1=l(ot),oi=n(ot,"DIV",{class:!0});var Jy=s(oi);g(Fn.$$.fragment,Jy),Jy.forEach(t),ot.forEach(t),Kp=l(e),P=n(e,"DIV",{class:!0});var H=s(P);g(Dn.$$.fragment,H),H1=l(H),ni=n(H,"P",{});var j$=s(ni);si=n(j$,"A",{href:!0});var Qy=s(si);R1=i(Qy,"BeamScorer"),Qy.forEach(t),K1=i(j$," implementing standard beam search decoding."),j$.forEach(t),U1=l(H),Sn=n(H,"P",{});var jm=s(Sn);Y1=i(jm,"Adapted in part from "),zn=n(jm,"A",{href:!0,rel:!0});var Zy=s(zn);X1=i(Zy,`Facebook\u2019s XLM beam search
code`),Zy.forEach(t),J1=i(jm,"."),jm.forEach(t),Q1=l(H),ai=n(H,"P",{});var H$=s(ai);Z1=i(H$,"Reference for the diverse beam search algorithm and implementation "),On=n(H$,"A",{href:!0,rel:!0});var e0=s(On);e$=i(e0,`Ashwin Kalyan\u2019s DBS
implementation`),e0.forEach(t),H$.forEach(t),r$=l(H),ii=n(H,"DIV",{class:!0});var r0=s(ii);g(qn.$$.fragment,r0),r0.forEach(t),t$=l(H),ci=n(H,"DIV",{class:!0});var t0=s(ci);g(Bn.$$.fragment,t0),t0.forEach(t),H.forEach(t),Up=l(e),N=n(e,"DIV",{class:!0});var nt=s(N);g(In.$$.fragment,nt),o$=l(nt),li=n(nt,"P",{});var R$=s(li);di=n(R$,"A",{href:!0});var o0=s(di);n$=i(o0,"BeamScorer"),o0.forEach(t),s$=i(R$," implementing constrained beam search decoding."),R$.forEach(t),a$=l(nt),pi=n(nt,"DIV",{class:!0});var n0=s(pi);g(Cn.$$.fragment,n0),n0.forEach(t),i$=l(nt),mi=n(nt,"DIV",{class:!0});var s0=s(mi);g(Wn.$$.fragment,s0),s0.forEach(t),nt.forEach(t),Yp=l(e),hr=n(e,"H2",{class:!0});var Hm=s(hr);Qr=n(Hm,"A",{id:!0,class:!0,href:!0});var a0=s(Qr);cd=n(a0,"SPAN",{});var i0=s(cd);g(An.$$.fragment,i0),i0.forEach(t),a0.forEach(t),c$=l(Hm),ld=n(Hm,"SPAN",{});var c0=s(ld);l$=i(c0,"Utilities"),c0.forEach(t),Hm.forEach(t),Xp=l(e),qe=n(e,"DIV",{class:!0});var ac=s(qe);g(Nn.$$.fragment,ac),d$=l(ac),dd=n(ac,"P",{});var l0=s(dd);p$=i(l0,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),l0.forEach(t),m$=l(ac),fi=n(ac,"P",{});var K$=s(fi);f$=i(K$,"From: "),Vn=n(K$,"A",{href:!0,rel:!0});var d0=s(Vn);g$=i(d0,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d0.forEach(t),K$.forEach(t),ac.forEach(t),Jp=l(e),Be=n(e,"DIV",{class:!0});var ic=s(Be);g(Mn.$$.fragment,ic),h$=l(ic),pd=n(ic,"P",{});var p0=s(pd);u$=i(p0,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),p0.forEach(t),_$=l(ic),gi=n(ic,"P",{});var U$=s(gi);b$=i(U$,"From: "),Gn=n(U$,"A",{href:!0,rel:!0});var m0=s(Gn);v$=i(m0,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),m0.forEach(t),U$.forEach(t),ic.forEach(t),this.h()},h(){d(w,"name","hf:doc:metadata"),d(w,"content",JSON.stringify(y0)),d(Ce,"id","utilities-for-generation"),d(Ce,"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(Ce,"href","#utilities-for-generation"),d(k,"class","relative group"),d(Rn,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.generate"),d(Kn,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.greedy_search"),d(Un,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.sample"),d(Yn,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.beam_search"),d(Xn,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.beam_sample"),d(Jn,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.group_beam_search"),d(Qn,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.constrained_beam_search"),d(_r,"id","generate-outputs"),d(_r,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(_r,"href","#generate-outputs"),d(Re,"class","relative group"),d(es,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.generate"),d(rs,"href","/docs/transformers/pr_17548/en/main_classes/output#transformers.utils.ModelOutput"),d(ts,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.generate"),d(ns,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.generation_utils.GreedySearchDecoderOnlyOutput"),d(vr,"id","transformers.generation_utils.GreedySearchDecoderOnlyOutput"),d(vr,"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(vr,"href","#transformers.generation_utils.GreedySearchDecoderOnlyOutput"),d(Ke,"class","relative group"),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(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($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(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(Tr,"id","transformers.generation_utils.SampleDecoderOnlyOutput"),d(Tr,"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(Tr,"href","#transformers.generation_utils.SampleDecoderOnlyOutput"),d(Xe,"class","relative group"),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(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(yr,"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(kr,"id","transformers.generation_utils.BeamSearchDecoderOnlyOutput"),d(kr,"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(kr,"href","#transformers.generation_utils.BeamSearchDecoderOnlyOutput"),d(Ze,"class","relative group"),d(er,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(rr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xr,"id","transformers.generation_utils.BeamSampleDecoderOnlyOutput"),d(xr,"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(xr,"href","#transformers.generation_utils.BeamSampleDecoderOnlyOutput"),d(tr,"class","relative group"),d(or,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(nr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wr,"id","transformers.LogitsProcessor"),d(wr,"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(wr,"href","#transformers.LogitsProcessor"),d(sr,"class","relative group"),d(ds,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),d(Er,"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(ps,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),d(ms,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsWarper"),d(fs,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),d(gs,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsWarper"),d(hs,"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(Pr,"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(_s,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),d(bs,"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($s,"href","/docs/transformers/pr_17548/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(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(ks,"href","/docs/transformers/pr_17548/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(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(Ls,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsWarper"),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(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(Fs,"href","/docs/transformers/pr_17548/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(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(Ss,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ar,"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/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),d(Ht,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(Ht,"rel","nofollow"),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(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(Bs,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),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(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(Cs,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),d(Xt,"href","https://arxiv.org/abs/2010.00904"),d(Xt,"rel","nofollow"),d(Ws,"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(As,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),d(Ns,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.group_beam_search"),d(Zt,"href","https://arxiv.org/pdf/1610.02424.pdf"),d(Zt,"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(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(Gs,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),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(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(Hs,"href","/docs/transformers/pr_17548/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(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(Ks,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.LogitsProcessor"),d(Us,"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(zr,"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(Ys,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Xs,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsProcessor"),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(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(Or,"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(Zs,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsWarper"),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(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(ta,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsWarper"),d(oa,"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(sa,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsWarper"),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(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(ca,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(la,"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(pa,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(ma,"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(fa,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(wo,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(wo,"rel","nofollow"),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(_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(ua,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(_a,"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(va,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.TFLogitsProcessor"),d($a,"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(Ta,"href","/docs/transformers/pr_17548/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($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(Ir,"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(ka,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(xa,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(wa,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(La,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.FlaxLogitsWarper"),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(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(Cr,"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(Fa,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.FlaxLogitsWarper"),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(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(za,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Oa,"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(Ba,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.FlaxLogitsWarper"),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(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(Wa,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),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(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(Na,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),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(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(Ga,"href","/docs/transformers/pr_17548/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(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(Ar,"id","transformers.StoppingCriteria"),d(Ar,"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(Ar,"href","#transformers.StoppingCriteria"),d(ir,"class","relative group"),d(Ha,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.StoppingCriteria"),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(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(Ka,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(cr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(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(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(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(Vr,"id","transformers.Constraint"),d(Vr,"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(Vr,"href","#transformers.Constraint"),d(lr,"class","relative group"),d(Xa,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.Constraint"),d(jr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Hr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Rr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Kr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ur,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Yr,"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($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qa,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.Constraint"),d(dr,"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/pr_17548/en/internal/generation_utils#transformers.Constraint"),d(pr,"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(Xr,"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(Jr,"id","transformers.BeamScorer"),d(Jr,"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(Jr,"href","#transformers.BeamScorer"),d(fr,"class","relative group"),d(ei,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.beam_search"),d(ri,"href","/docs/transformers/pr_17548/en/main_classes/text_generation#transformers.generation_utils.GenerationMixin.beam_sample"),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(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(A,"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,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.BeamScorer"),d(zn,"href","https://github.com/facebookresearch/XLM/blob/9e6f6814d17be4fe5b15f2e6c43eb2b2d76daeb4/src/model/transformer.py#L529"),d(zn,"rel","nofollow"),d(On,"href","https://github.com/ashwinkalyan/dbs/blob/master/dbs/beam_utils.lua"),d(On,"rel","nofollow"),d(ii,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(di,"href","/docs/transformers/pr_17548/en/internal/generation_utils#transformers.BeamScorer"),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(mi,"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(Qr,"id","transformers.top_k_top_p_filtering"),d(Qr,"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(Qr,"href","#transformers.top_k_top_p_filtering"),d(hr,"class","relative group"),d(Vn,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(Vn,"rel","nofollow"),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(Gn,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(Gn,"rel","nofollow"),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")},m(e,p){r(document.head,w),m(e,He,p),m(e,k,p),r(k,Ce),r(Ce,cc),h(st,cc,null),r(k,Rm),r(k,lc),r(lc,Km),m(e,vd,p),m(e,y,p),r(y,Um),r(y,Rn),r(Rn,Ym),r(y,Xm),r(y,Kn),r(Kn,Jm),r(y,Qm),r(y,Un),r(Un,Zm),r(y,ef),r(y,Yn),r(Yn,rf),r(y,tf),r(y,Xn),r(Xn,of),r(y,nf),r(y,Jn),r(Jn,sf),r(y,af),r(y,Qn),r(Qn,cf),r(y,lf),m(e,$d,p),m(e,Zn,p),r(Zn,df),m(e,Td,p),m(e,Re,p),r(Re,_r),r(_r,dc),h(at,dc,null),r(Re,pf),r(Re,pc),r(pc,mf),m(e,yd,p),m(e,V,p),r(V,ff),r(V,es),r(es,gf),r(V,hf),r(V,rs),r(rs,uf),r(V,_f),r(V,ts),r(ts,bf),r(V,vf),m(e,kd,p),m(e,os,p),r(os,$f),m(e,xd,p),h(it,e,p),m(e,wd,p),m(e,We,p),r(We,Tf),r(We,mc),r(mc,yf),r(We,kf),r(We,ns),r(ns,xf),r(We,wf),m(e,Ld,p),m(e,M,p),r(M,ss),r(ss,fc),r(fc,Lf),r(ss,Ef),r(M,Pf),r(M,as),r(as,gc),r(gc,Ff),r(as,Df),r(M,Sf),r(M,is),r(is,hc),r(hc,zf),r(is,Of),r(M,qf),r(M,cs),r(cs,uc),r(uc,Bf),r(cs,If),m(e,Ed,p),m(e,x,p),r(x,Cf),r(x,_c),r(_c,Wf),r(x,Af),r(x,bc),r(bc,Nf),r(x,Vf),r(x,vc),r(vc,Mf),r(x,Gf),r(x,$c),r($c,jf),r(x,Hf),r(x,Tc),r(Tc,Rf),r(x,Kf),r(x,yc),r(yc,Uf),r(x,Yf),m(e,Pd,p),m(e,S,p),r(S,Xf),r(S,kc),r(kc,Jf),r(S,Qf),r(S,xc),r(xc,Zf),r(S,eg),r(S,wc),r(wc,rg),r(S,tg),r(S,Lc),r(Lc,og),r(S,ng),m(e,Fd,p),m(e,z,p),r(z,sg),r(z,Ec),r(Ec,ag),r(z,ig),r(z,Pc),r(Pc,cg),r(z,lg),r(z,Fc),r(Fc,dg),r(z,pg),r(z,Dc),r(Dc,mg),r(z,fg),m(e,Dd,p),h(ct,e,p),m(e,Sd,p),m(e,br,p),r(br,gg),r(br,Sc),r(Sc,hg),r(br,ug),m(e,zd,p),m(e,O,p),r(O,_g),r(O,zc),r(zc,bg),r(O,vg),r(O,Oc),r(Oc,$g),r(O,Tg),r(O,qc),r(qc,yg),r(O,kg),r(O,Bc),r(Bc,xg),r(O,wg),m(e,Od,p),m(e,ls,p),r(ls,Lg),m(e,qd,p),m(e,Ke,p),r(Ke,vr),r(vr,Ic),h(lt,Ic,null),r(Ke,Eg),r(Ke,Cc),r(Cc,Pg),m(e,Bd,p),m(e,Ue,p),h(dt,Ue,null),r(Ue,Fg),r(Ue,Wc),r(Wc,Dg),m(e,Id,p),m(e,Ye,p),h(pt,Ye,null),r(Ye,Sg),r(Ye,Ac),r(Ac,zg),m(e,Cd,p),m(e,R,p),h(mt,R,null),r(R,Og),r(R,Nc),r(Nc,qg),r(R,Bg),r(R,$r),h(ft,$r,null),r($r,Ig),r($r,Vc),r(Vc,Cg),m(e,Wd,p),m(e,Xe,p),r(Xe,Tr),r(Tr,Mc),h(gt,Mc,null),r(Xe,Wg),r(Xe,Gc),r(Gc,Ag),m(e,Ad,p),m(e,Je,p),h(ht,Je,null),r(Je,Ng),r(Je,jc),r(jc,Vg),m(e,Nd,p),m(e,Qe,p),h(ut,Qe,null),r(Qe,Mg),r(Qe,Hc),r(Hc,Gg),m(e,Vd,p),m(e,K,p),h(_t,K,null),r(K,jg),r(K,Rc),r(Rc,Hg),r(K,Rg),r(K,yr),h(bt,yr,null),r(yr,Kg),r(yr,Kc),r(Kc,Ug),m(e,Md,p),m(e,Ze,p),r(Ze,kr),r(kr,Uc),h(vt,Uc,null),r(Ze,Yg),r(Ze,Yc),r(Yc,Xg),m(e,Gd,p),m(e,er,p),h($t,er,null),r(er,Jg),r(er,Xc),r(Xc,Qg),m(e,jd,p),m(e,rr,p),h(Tt,rr,null),r(rr,Zg),r(rr,Jc),r(Jc,eh),m(e,Hd,p),m(e,tr,p),r(tr,xr),r(xr,Qc),h(yt,Qc,null),r(tr,rh),r(tr,Zc),r(Zc,th),m(e,Rd,p),m(e,or,p),h(kt,or,null),r(or,oh),r(or,el),r(el,nh),m(e,Kd,p),m(e,nr,p),h(xt,nr,null),r(nr,sh),r(nr,rl),r(rl,ah),m(e,Ud,p),m(e,sr,p),r(sr,wr),r(wr,tl),h(wt,tl,null),r(sr,ih),r(sr,ol),r(ol,ch),m(e,Yd,p),m(e,Lr,p),r(Lr,lh),r(Lr,ds),r(ds,dh),r(Lr,ph),m(e,Xd,p),m(e,U,p),h(Lt,U,null),r(U,mh),r(U,nl),r(nl,fh),r(U,gh),r(U,Er),h(Et,Er,null),r(Er,hh),r(Er,sl),r(sl,uh),m(e,Jd,p),m(e,Y,p),h(Pt,Y,null),r(Y,_h),r(Y,L),r(L,bh),r(L,ps),r(ps,vh),r(L,$h),r(L,ms),r(ms,Th),r(L,yh),r(L,al),r(al,kh),r(L,xh),r(L,il),r(il,cl),r(cl,wh),r(L,Lh),r(L,fs),r(fs,Eh),r(L,Ph),r(L,gs),r(gs,Fh),r(L,Dh),r(Y,Sh),r(Y,hs),h(Ft,hs,null),m(e,Qd,p),m(e,X,p),h(Dt,X,null),r(X,zh),r(X,ll),r(ll,Oh),r(X,qh),r(X,Pr),h(St,Pr,null),r(Pr,Bh),r(Pr,dl),r(dl,Ih),m(e,Zd,p),m(e,J,p),h(zt,J,null),r(J,Ch),r(J,us),r(us,_s),r(_s,Wh),r(us,Ah),r(J,Nh),r(J,bs),h(Ot,bs,null),m(e,ep,p),m(e,Q,p),h(qt,Q,null),r(Q,Vh),r(Q,vs),r(vs,$s),r($s,Mh),r(vs,Gh),r(Q,jh),r(Q,Ts),h(Bt,Ts,null),m(e,rp,p),m(e,Z,p),h(It,Z,null),r(Z,Hh),r(Z,ys),r(ys,ks),r(ks,Rh),r(ys,Kh),r(Z,Uh),r(Z,xs),h(Ct,xs,null),m(e,tp,p),m(e,ee,p),h(Wt,ee,null),r(ee,Yh),r(ee,ws),r(ws,Ls),r(Ls,Xh),r(ws,Jh),r(ee,Qh),r(ee,Es),h(At,Es,null),m(e,op,p),m(e,re,p),h(Nt,re,null),r(re,Zh),r(re,Ps),r(Ps,Fs),r(Fs,eu),r(Ps,ru),r(re,tu),r(re,Ds),h(Vt,Ds,null),m(e,np,p),m(e,ar,p),h(Mt,ar,null),r(ar,ou),r(ar,Ss),h(Gt,Ss,null),m(e,sp,p),m(e,te,p),h(jt,te,null),r(te,nu),r(te,Fr),r(Fr,zs),r(zs,su),r(Fr,au),r(Fr,Ht),r(Ht,iu),r(Fr,cu),r(te,lu),r(te,Os),h(Rt,Os,null),m(e,ap,p),m(e,oe,p),h(Kt,oe,null),r(oe,du),r(oe,qs),r(qs,Bs),r(Bs,pu),r(qs,mu),r(oe,fu),r(oe,Is),h(Ut,Is,null),m(e,ip,p),m(e,ne,p),h(Yt,ne,null),r(ne,gu),r(ne,Dr),r(Dr,Cs),r(Cs,hu),r(Dr,uu),r(Dr,Xt),r(Xt,_u),r(Dr,bu),r(ne,vu),r(ne,Ws),h(Jt,Ws,null),m(e,cp,p),m(e,se,p),h(Qt,se,null),r(se,$u),r(se,Ae),r(Ae,As),r(As,Tu),r(Ae,yu),r(Ae,Ns),r(Ns,ku),r(Ae,xu),r(Ae,Zt),r(Zt,wu),r(Ae,Lu),r(se,Eu),r(se,Vs),h(eo,Vs,null),m(e,lp,p),m(e,ae,p),h(ro,ae,null),r(ae,Pu),r(ae,Ms),r(Ms,Gs),r(Gs,Fu),r(Ms,Du),r(ae,Su),r(ae,js),h(to,js,null),m(e,dp,p),m(e,ie,p),h(oo,ie,null),r(ie,zu),r(ie,Sr),r(Sr,Hs),r(Hs,Ou),r(Sr,qu),r(Sr,pl),r(pl,Bu),r(Sr,Iu),r(ie,Cu),r(ie,Rs),h(no,Rs,null),m(e,pp,p),m(e,ce,p),h(so,ce,null),r(ce,Wu),r(ce,G),r(G,Ks),r(Ks,Au),r(G,Nu),r(G,ml),r(ml,Vu),r(G,Mu),r(G,fl),r(fl,Gu),r(G,ju),r(G,gl),r(gl,Hu),r(G,Ru),r(ce,Ku),r(ce,Us),h(ao,Us,null),m(e,mp,p),m(e,le,p),h(io,le,null),r(le,Uu),r(le,hl),r(hl,Yu),r(le,Xu),r(le,zr),h(co,zr,null),r(zr,Ju),r(zr,ul),r(ul,Qu),m(e,fp,p),m(e,de,p),h(lo,de,null),r(de,Zu),r(de,C),r(C,e_),r(C,Ys),r(Ys,r_),r(C,t_),r(C,_l),r(_l,o_),r(C,n_),r(C,bl),r(bl,vl),r(vl,s_),r(C,a_),r(C,Xs),r(Xs,i_),r(C,c_),r(de,l_),r(de,Js),h(po,Js,null),m(e,gp,p),m(e,pe,p),h(mo,pe,null),r(pe,d_),r(pe,$l),r($l,p_),r(pe,m_),r(pe,Or),h(fo,Or,null),r(Or,f_),r(Or,Tl),r(Tl,g_),m(e,hp,p),m(e,me,p),h(go,me,null),r(me,h_),r(me,Qs),r(Qs,Zs),r(Zs,u_),r(Qs,__),r(me,b_),r(me,ea),h(ho,ea,null),m(e,up,p),m(e,fe,p),h(uo,fe,null),r(fe,v_),r(fe,ra),r(ra,ta),r(ta,$_),r(ra,T_),r(fe,y_),r(fe,oa),h(_o,oa,null),m(e,_p,p),m(e,ge,p),h(bo,ge,null),r(ge,k_),r(ge,na),r(na,sa),r(sa,x_),r(na,w_),r(ge,L_),r(ge,aa),h(vo,aa,null),m(e,bp,p),m(e,he,p),h($o,he,null),r(he,E_),r(he,ia),r(ia,ca),r(ca,P_),r(ia,F_),r(he,D_),r(he,la),h(To,la,null),m(e,vp,p),m(e,ue,p),h(yo,ue,null),r(ue,S_),r(ue,da),r(da,pa),r(pa,z_),r(da,O_),r(ue,q_),r(ue,ma),h(ko,ma,null),m(e,$p,p),m(e,_e,p),h(xo,_e,null),r(_e,B_),r(_e,qr),r(qr,fa),r(fa,I_),r(qr,C_),r(qr,wo),r(wo,W_),r(qr,A_),r(_e,N_),r(_e,ga),h(Lo,ga,null),m(e,Tp,p),m(e,be,p),h(Eo,be,null),r(be,V_),r(be,ha),r(ha,ua),r(ua,M_),r(ha,G_),r(be,j_),r(be,_a),h(Po,_a,null),m(e,yp,p),m(e,ve,p),h(Fo,ve,null),r(ve,H_),r(ve,ba),r(ba,va),r(va,R_),r(ba,K_),r(ve,U_),r(ve,$a),h(Do,$a,null),m(e,kp,p),m(e,$e,p),h(So,$e,null),r($e,Y_),r($e,Br),r(Br,Ta),r(Ta,X_),r(Br,J_),r(Br,yl),r(yl,Q_),r(Br,Z_),r($e,eb),r($e,ya),h(zo,ya,null),m(e,xp,p),m(e,Te,p),h(Oo,Te,null),r(Te,rb),r(Te,kl),r(kl,tb),r(Te,ob),r(Te,Ir),h(qo,Ir,null),r(Ir,nb),r(Ir,xl),r(xl,sb),m(e,wp,p),m(e,ye,p),h(Bo,ye,null),r(ye,ab),r(ye,E),r(E,ib),r(E,ka),r(ka,cb),r(E,lb),r(E,xa),r(xa,db),r(E,pb),r(E,wl),r(wl,mb),r(E,fb),r(E,Ll),r(Ll,El),r(El,gb),r(E,hb),r(E,wa),r(wa,ub),r(E,_b),r(E,La),r(La,bb),r(E,vb),r(ye,$b),r(ye,Ea),h(Io,Ea,null),m(e,Lp,p),m(e,ke,p),h(Co,ke,null),r(ke,Tb),r(ke,Pl),r(Pl,yb),r(ke,kb),r(ke,Cr),h(Wo,Cr,null),r(Cr,xb),r(Cr,Fl),r(Fl,wb),m(e,Ep,p),m(e,xe,p),h(Ao,xe,null),r(xe,Lb),r(xe,Pa),r(Pa,Fa),r(Fa,Eb),r(Pa,Pb),r(xe,Fb),r(xe,Da),h(No,Da,null),m(e,Pp,p),m(e,we,p),h(Vo,we,null),r(we,Db),r(we,Sa),r(Sa,za),r(za,Sb),r(Sa,zb),r(we,Ob),r(we,Oa),h(Mo,Oa,null),m(e,Fp,p),m(e,Le,p),h(Go,Le,null),r(Le,qb),r(Le,qa),r(qa,Ba),r(Ba,Bb),r(qa,Ib),r(Le,Cb),r(Le,Ia),h(jo,Ia,null),m(e,Dp,p),m(e,Ee,p),h(Ho,Ee,null),r(Ee,Wb),r(Ee,Ca),r(Ca,Wa),r(Wa,Ab),r(Ca,Nb),r(Ee,Vb),r(Ee,Aa),h(Ro,Aa,null),m(e,Sp,p),m(e,Pe,p),h(Ko,Pe,null),r(Pe,Mb),r(Pe,Wr),r(Wr,Na),r(Na,Gb),r(Wr,jb),r(Wr,Dl),r(Dl,Hb),r(Wr,Rb),r(Pe,Kb),r(Pe,Va),h(Uo,Va,null),m(e,zp,p),m(e,Fe,p),h(Yo,Fe,null),r(Fe,Ub),r(Fe,Ma),r(Ma,Ga),r(Ga,Yb),r(Ma,Xb),r(Fe,Jb),r(Fe,ja),h(Xo,ja,null),m(e,Op,p),m(e,ir,p),r(ir,Ar),r(Ar,Sl),h(Jo,Sl,null),r(ir,Qb),r(ir,zl),r(zl,Zb),m(e,qp,p),m(e,Nr,p),r(Nr,ev),r(Nr,Ha),r(Ha,rv),r(Nr,tv),m(e,Bp,p),m(e,De,p),h(Qo,De,null),r(De,ov),r(De,Ol),r(Ol,nv),r(De,sv),r(De,Ra),h(Zo,Ra,null),m(e,Ip,p),m(e,cr,p),h(en,cr,null),r(cr,av),r(cr,Ka),h(rn,Ka,null),m(e,Cp,p),m(e,Se,p),h(tn,Se,null),r(Se,iv),r(Se,on),r(on,cv),r(on,ql),r(ql,lv),r(on,dv),r(Se,pv),r(Se,Ua),h(nn,Ua,null),m(e,Wp,p),m(e,ze,p),h(sn,ze,null),r(ze,mv),r(ze,an),r(an,fv),r(an,Bl),r(Bl,gv),r(an,hv),r(ze,uv),r(ze,Ya),h(cn,Ya,null),m(e,Ap,p),m(e,lr,p),r(lr,Vr),r(Vr,Il),h(ln,Il,null),r(lr,_v),r(lr,Cl),r(Cl,bv),m(e,Np,p),m(e,Mr,p),r(Mr,vv),r(Mr,Xa),r(Xa,$v),r(Mr,Tv),m(e,Vp,p),m(e,$,p),h(dn,$,null),r($,yv),r($,Wl),r(Wl,kv),r($,xv),r($,Al),r(Al,wv),r($,Lv),h(Gr,$,null),r($,Ev),r($,Nl),r(Nl,Pv),r($,Fv),r($,jr),h(pn,jr,null),r(jr,Dv),r(jr,Vl),r(Vl,Sv),r($,zv),r($,Hr),h(mn,Hr,null),r(Hr,Ov),r(Hr,Ml),r(Ml,qv),r($,Bv),r($,Rr),h(fn,Rr,null),r(Rr,Iv),r(Rr,Gl),r(Gl,Cv),r($,Wv),r($,Kr),h(gn,Kr,null),r(Kr,Av),r(Kr,hn),r(hn,Nv),r(hn,jl),r(jl,Vv),r(hn,Mv),r($,Gv),r($,Ur),h(un,Ur,null),r(Ur,jv),r(Ur,Hl),r(Hl,Hv),r($,Rv),r($,Yr),h(_n,Yr,null),r(Yr,Kv),r(Yr,Rl),r(Rl,Uv),r($,Yv),r($,Ne),h(bn,Ne,null),r(Ne,Xv),r(Ne,vn),r(vn,Jv),r(vn,Kl),r(Kl,Qv),r(vn,Zv),r(Ne,e1),r(Ne,Ul),r(Ul,r1),m(e,Mp,p),m(e,dr,p),h($n,dr,null),r(dr,t1),r(dr,Ja),r(Ja,Qa),r(Qa,o1),r(Ja,n1),m(e,Gp,p),m(e,pr,p),h(Tn,pr,null),r(pr,s1),r(pr,yn),r(yn,a1),r(yn,Za),r(Za,i1),r(yn,c1),m(e,jp,p),m(e,W,p),h(kn,W,null),r(W,l1),r(W,Yl),r(Yl,d1),r(W,p1),r(W,F),h(xn,F,null),r(F,m1),r(F,Xl),r(Xl,f1),r(F,g1),r(F,mr),r(mr,h1),r(mr,Jl),r(Jl,u1),r(mr,_1),r(mr,Ql),r(Ql,b1),r(mr,v1),r(F,$1),r(F,Zl),r(Zl,ed),r(ed,T1),r(F,y1),r(F,Oe),r(Oe,k1),r(Oe,rd),r(rd,x1),r(Oe,w1),r(Oe,td),r(td,L1),r(Oe,E1),r(Oe,od),r(od,P1),r(Oe,F1),r(F,D1),r(F,nd),r(nd,S1),r(W,z1),r(W,Xr),h(wn,Xr,null),r(Xr,O1),r(Xr,sd),r(sd,q1),m(e,Hp,p),m(e,fr,p),r(fr,Jr),r(Jr,ad),h(Ln,ad,null),r(fr,B1),r(fr,id),r(id,I1),m(e,Rp,p),m(e,A,p),h(En,A,null),r(A,C1),r(A,gr),r(gr,W1),r(gr,ei),r(ei,A1),r(gr,N1),r(gr,ri),r(ri,V1),r(gr,M1),r(A,G1),r(A,ti),h(Pn,ti,null),r(A,j1),r(A,oi),h(Fn,oi,null),m(e,Kp,p),m(e,P,p),h(Dn,P,null),r(P,H1),r(P,ni),r(ni,si),r(si,R1),r(ni,K1),r(P,U1),r(P,Sn),r(Sn,Y1),r(Sn,zn),r(zn,X1),r(Sn,J1),r(P,Q1),r(P,ai),r(ai,Z1),r(ai,On),r(On,e$),r(P,r$),r(P,ii),h(qn,ii,null),r(P,t$),r(P,ci),h(Bn,ci,null),m(e,Up,p),m(e,N,p),h(In,N,null),r(N,o$),r(N,li),r(li,di),r(di,n$),r(li,s$),r(N,a$),r(N,pi),h(Cn,pi,null),r(N,i$),r(N,mi),h(Wn,mi,null),m(e,Yp,p),m(e,hr,p),r(hr,Qr),r(Qr,cd),h(An,cd,null),r(hr,c$),r(hr,ld),r(ld,l$),m(e,Xp,p),m(e,qe,p),h(Nn,qe,null),r(qe,d$),r(qe,dd),r(dd,p$),r(qe,m$),r(qe,fi),r(fi,f$),r(fi,Vn),r(Vn,g$),m(e,Jp,p),m(e,Be,p),h(Mn,Be,null),r(Be,h$),r(Be,pd),r(pd,u$),r(Be,_$),r(Be,gi),r(gi,b$),r(gi,Gn),r(Gn,v$),Qp=!0},p(e,[p]){const jn={};p&2&&(jn.$$scope={dirty:p,ctx:e}),Gr.$set(jn)},i(e){Qp||(u(st.$$.fragment,e),u(at.$$.fragment,e),u(it.$$.fragment,e),u(ct.$$.fragment,e),u(lt.$$.fragment,e),u(dt.$$.fragment,e),u(pt.$$.fragment,e),u(mt.$$.fragment,e),u(ft.$$.fragment,e),u(gt.$$.fragment,e),u(ht.$$.fragment,e),u(ut.$$.fragment,e),u(_t.$$.fragment,e),u(bt.$$.fragment,e),u(vt.$$.fragment,e),u($t.$$.fragment,e),u(Tt.$$.fragment,e),u(yt.$$.fragment,e),u(kt.$$.fragment,e),u(xt.$$.fragment,e),u(wt.$$.fragment,e),u(Lt.$$.fragment,e),u(Et.$$.fragment,e),u(Pt.$$.fragment,e),u(Ft.$$.fragment,e),u(Dt.$$.fragment,e),u(St.$$.fragment,e),u(zt.$$.fragment,e),u(Ot.$$.fragment,e),u(qt.$$.fragment,e),u(Bt.$$.fragment,e),u(It.$$.fragment,e),u(Ct.$$.fragment,e),u(Wt.$$.fragment,e),u(At.$$.fragment,e),u(Nt.$$.fragment,e),u(Vt.$$.fragment,e),u(Mt.$$.fragment,e),u(Gt.$$.fragment,e),u(jt.$$.fragment,e),u(Rt.$$.fragment,e),u(Kt.$$.fragment,e),u(Ut.$$.fragment,e),u(Yt.$$.fragment,e),u(Jt.$$.fragment,e),u(Qt.$$.fragment,e),u(eo.$$.fragment,e),u(ro.$$.fragment,e),u(to.$$.fragment,e),u(oo.$$.fragment,e),u(no.$$.fragment,e),u(so.$$.fragment,e),u(ao.$$.fragment,e),u(io.$$.fragment,e),u(co.$$.fragment,e),u(lo.$$.fragment,e),u(po.$$.fragment,e),u(mo.$$.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(Eo.$$.fragment,e),u(Po.$$.fragment,e),u(Fo.$$.fragment,e),u(Do.$$.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(Co.$$.fragment,e),u(Wo.$$.fragment,e),u(Ao.$$.fragment,e),u(No.$$.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(Ko.$$.fragment,e),u(Uo.$$.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(rn.$$.fragment,e),u(tn.$$.fragment,e),u(nn.$$.fragment,e),u(sn.$$.fragment,e),u(cn.$$.fragment,e),u(ln.$$.fragment,e),u(dn.$$.fragment,e),u(Gr.$$.fragment,e),u(pn.$$.fragment,e),u(mn.$$.fragment,e),u(fn.$$.fragment,e),u(gn.$$.fragment,e),u(un.$$.fragment,e),u(_n.$$.fragment,e),u(bn.$$.fragment,e),u($n.$$.fragment,e),u(Tn.$$.fragment,e),u(kn.$$.fragment,e),u(xn.$$.fragment,e),u(wn.$$.fragment,e),u(Ln.$$.fragment,e),u(En.$$.fragment,e),u(Pn.$$.fragment,e),u(Fn.$$.fragment,e),u(Dn.$$.fragment,e),u(qn.$$.fragment,e),u(Bn.$$.fragment,e),u(In.$$.fragment,e),u(Cn.$$.fragment,e),u(Wn.$$.fragment,e),u(An.$$.fragment,e),u(Nn.$$.fragment,e),u(Mn.$$.fragment,e),Qp=!0)},o(e){_(st.$$.fragment,e),_(at.$$.fragment,e),_(it.$$.fragment,e),_(ct.$$.fragment,e),_(lt.$$.fragment,e),_(dt.$$.fragment,e),_(pt.$$.fragment,e),_(mt.$$.fragment,e),_(ft.$$.fragment,e),_(gt.$$.fragment,e),_(ht.$$.fragment,e),_(ut.$$.fragment,e),_(_t.$$.fragment,e),_(bt.$$.fragment,e),_(vt.$$.fragment,e),_($t.$$.fragment,e),_(Tt.$$.fragment,e),_(yt.$$.fragment,e),_(kt.$$.fragment,e),_(xt.$$.fragment,e),_(wt.$$.fragment,e),_(Lt.$$.fragment,e),_(Et.$$.fragment,e),_(Pt.$$.fragment,e),_(Ft.$$.fragment,e),_(Dt.$$.fragment,e),_(St.$$.fragment,e),_(zt.$$.fragment,e),_(Ot.$$.fragment,e),_(qt.$$.fragment,e),_(Bt.$$.fragment,e),_(It.$$.fragment,e),_(Ct.$$.fragment,e),_(Wt.$$.fragment,e),_(At.$$.fragment,e),_(Nt.$$.fragment,e),_(Vt.$$.fragment,e),_(Mt.$$.fragment,e),_(Gt.$$.fragment,e),_(jt.$$.fragment,e),_(Rt.$$.fragment,e),_(Kt.$$.fragment,e),_(Ut.$$.fragment,e),_(Yt.$$.fragment,e),_(Jt.$$.fragment,e),_(Qt.$$.fragment,e),_(eo.$$.fragment,e),_(ro.$$.fragment,e),_(to.$$.fragment,e),_(oo.$$.fragment,e),_(no.$$.fragment,e),_(so.$$.fragment,e),_(ao.$$.fragment,e),_(io.$$.fragment,e),_(co.$$.fragment,e),_(lo.$$.fragment,e),_(po.$$.fragment,e),_(mo.$$.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),_(Eo.$$.fragment,e),_(Po.$$.fragment,e),_(Fo.$$.fragment,e),_(Do.$$.fragment,e),_(So.$$.fragment,e),_(zo.$$.fragment,e),_(Oo.$$.fragment,e),_(qo.$$.fragment,e),_(Bo.$$.fragment,e),_(Io.$$.fragment,e),_(Co.$$.fragment,e),_(Wo.$$.fragment,e),_(Ao.$$.fragment,e),_(No.$$.fragment,e),_(Vo.$$.fragment,e),_(Mo.$$.fragment,e),_(Go.$$.fragment,e),_(jo.$$.fragment,e),_(Ho.$$.fragment,e),_(Ro.$$.fragment,e),_(Ko.$$.fragment,e),_(Uo.$$.fragment,e),_(Yo.$$.fragment,e),_(Xo.$$.fragment,e),_(Jo.$$.fragment,e),_(Qo.$$.fragment,e),_(Zo.$$.fragment,e),_(en.$$.fragment,e),_(rn.$$.fragment,e),_(tn.$$.fragment,e),_(nn.$$.fragment,e),_(sn.$$.fragment,e),_(cn.$$.fragment,e),_(ln.$$.fragment,e),_(dn.$$.fragment,e),_(Gr.$$.fragment,e),_(pn.$$.fragment,e),_(mn.$$.fragment,e),_(fn.$$.fragment,e),_(gn.$$.fragment,e),_(un.$$.fragment,e),_(_n.$$.fragment,e),_(bn.$$.fragment,e),_($n.$$.fragment,e),_(Tn.$$.fragment,e),_(kn.$$.fragment,e),_(xn.$$.fragment,e),_(wn.$$.fragment,e),_(Ln.$$.fragment,e),_(En.$$.fragment,e),_(Pn.$$.fragment,e),_(Fn.$$.fragment,e),_(Dn.$$.fragment,e),_(qn.$$.fragment,e),_(Bn.$$.fragment,e),_(In.$$.fragment,e),_(Cn.$$.fragment,e),_(Wn.$$.fragment,e),_(An.$$.fragment,e),_(Nn.$$.fragment,e),_(Mn.$$.fragment,e),Qp=!1},d(e){t(w),e&&t(He),e&&t(k),b(st),e&&t(vd),e&&t(y),e&&t($d),e&&t(Zn),e&&t(Td),e&&t(Re),b(at),e&&t(yd),e&&t(V),e&&t(kd),e&&t(os),e&&t(xd),b(it,e),e&&t(wd),e&&t(We),e&&t(Ld),e&&t(M),e&&t(Ed),e&&t(x),e&&t(Pd),e&&t(S),e&&t(Fd),e&&t(z),e&&t(Dd),b(ct,e),e&&t(Sd),e&&t(br),e&&t(zd),e&&t(O),e&&t(Od),e&&t(ls),e&&t(qd),e&&t(Ke),b(lt),e&&t(Bd),e&&t(Ue),b(dt),e&&t(Id),e&&t(Ye),b(pt),e&&t(Cd),e&&t(R),b(mt),b(ft),e&&t(Wd),e&&t(Xe),b(gt),e&&t(Ad),e&&t(Je),b(ht),e&&t(Nd),e&&t(Qe),b(ut),e&&t(Vd),e&&t(K),b(_t),b(bt),e&&t(Md),e&&t(Ze),b(vt),e&&t(Gd),e&&t(er),b($t),e&&t(jd),e&&t(rr),b(Tt),e&&t(Hd),e&&t(tr),b(yt),e&&t(Rd),e&&t(or),b(kt),e&&t(Kd),e&&t(nr),b(xt),e&&t(Ud),e&&t(sr),b(wt),e&&t(Yd),e&&t(Lr),e&&t(Xd),e&&t(U),b(Lt),b(Et),e&&t(Jd),e&&t(Y),b(Pt),b(Ft),e&&t(Qd),e&&t(X),b(Dt),b(St),e&&t(Zd),e&&t(J),b(zt),b(Ot),e&&t(ep),e&&t(Q),b(qt),b(Bt),e&&t(rp),e&&t(Z),b(It),b(Ct),e&&t(tp),e&&t(ee),b(Wt),b(At),e&&t(op),e&&t(re),b(Nt),b(Vt),e&&t(np),e&&t(ar),b(Mt),b(Gt),e&&t(sp),e&&t(te),b(jt),b(Rt),e&&t(ap),e&&t(oe),b(Kt),b(Ut),e&&t(ip),e&&t(ne),b(Yt),b(Jt),e&&t(cp),e&&t(se),b(Qt),b(eo),e&&t(lp),e&&t(ae),b(ro),b(to),e&&t(dp),e&&t(ie),b(oo),b(no),e&&t(pp),e&&t(ce),b(so),b(ao),e&&t(mp),e&&t(le),b(io),b(co),e&&t(fp),e&&t(de),b(lo),b(po),e&&t(gp),e&&t(pe),b(mo),b(fo),e&&t(hp),e&&t(me),b(go),b(ho),e&&t(up),e&&t(fe),b(uo),b(_o),e&&t(_p),e&&t(ge),b(bo),b(vo),e&&t(bp),e&&t(he),b($o),b(To),e&&t(vp),e&&t(ue),b(yo),b(ko),e&&t($p),e&&t(_e),b(xo),b(Lo),e&&t(Tp),e&&t(be),b(Eo),b(Po),e&&t(yp),e&&t(ve),b(Fo),b(Do),e&&t(kp),e&&t($e),b(So),b(zo),e&&t(xp),e&&t(Te),b(Oo),b(qo),e&&t(wp),e&&t(ye),b(Bo),b(Io),e&&t(Lp),e&&t(ke),b(Co),b(Wo),e&&t(Ep),e&&t(xe),b(Ao),b(No),e&&t(Pp),e&&t(we),b(Vo),b(Mo),e&&t(Fp),e&&t(Le),b(Go),b(jo),e&&t(Dp),e&&t(Ee),b(Ho),b(Ro),e&&t(Sp),e&&t(Pe),b(Ko),b(Uo),e&&t(zp),e&&t(Fe),b(Yo),b(Xo),e&&t(Op),e&&t(ir),b(Jo),e&&t(qp),e&&t(Nr),e&&t(Bp),e&&t(De),b(Qo),b(Zo),e&&t(Ip),e&&t(cr),b(en),b(rn),e&&t(Cp),e&&t(Se),b(tn),b(nn),e&&t(Wp),e&&t(ze),b(sn),b(cn),e&&t(Ap),e&&t(lr),b(ln),e&&t(Np),e&&t(Mr),e&&t(Vp),e&&t($),b(dn),b(Gr),b(pn),b(mn),b(fn),b(gn),b(un),b(_n),b(bn),e&&t(Mp),e&&t(dr),b($n),e&&t(Gp),e&&t(pr),b(Tn),e&&t(jp),e&&t(W),b(kn),b(xn),b(wn),e&&t(Hp),e&&t(fr),b(Ln),e&&t(Rp),e&&t(A),b(En),b(Pn),b(Fn),e&&t(Kp),e&&t(P),b(Dn),b(qn),b(Bn),e&&t(Up),e&&t(N),b(In),b(Cn),b(Wn),e&&t(Yp),e&&t(hr),b(An),e&&t(Xp),e&&t(qe),b(Nn),e&&t(Jp),e&&t(Be),b(Mn)}}}const y0={local:"utilities-for-generation",sections:[{local:"generate-outputs",sections:[{local:"transformers.generation_utils.GreedySearchDecoderOnlyOutput",title:"GreedySearchOutput"},{local:"transformers.generation_utils.SampleDecoderOnlyOutput",title:"SampleOutput"},{local:"transformers.generation_utils.BeamSearchDecoderOnlyOutput",title:"BeamSearchOutput"},{local:"transformers.generation_utils.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 k0(bd){return _0(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class F0 extends f0{constructor(w){super();g0(this,w,k0,T0,h0,{})}}export{F0 as default,y0 as metadata};
