import{S as Lv,i as Cv,s as Nv,e as r,k as d,w as h,t as o,M as Av,c as a,d as t,m as c,a as s,x as p,h as n,b as l,G as e,g as $,y as m,q as f,o as u,B as _,v as Wv,L as Iv}from"../../chunks/vendor-hf-doc-builder.js";import{T as qv}from"../../chunks/Tip-hf-doc-builder.js";import{D as v}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Dv}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ed}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Fv}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Sv(pe){let z,I,q,E,B;return E=new Dv({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMHRva2VuaXplciUyMHRvJTIweW91ciUyMG5hbWVzcGFjZSUyMHdpdGglMjB0aGUlMjBuYW1lJTIwJTIybXktZmluZXR1bmVkLWJlcnQlMjIuJTBBdG9rZW5pemVyLnB1c2hfdG9faHViKCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjB0b2tlbml6ZXIlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtYmVydCUyMi4lMEF0b2tlbml6ZXIucHVzaF90b19odWIoJTIyaHVnZ2luZ2ZhY2UlMkZteS1maW5ldHVuZWQtYmVydCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

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

<span class="hljs-comment"># Push the tokenizer to your namespace with the name &quot;my-finetuned-bert&quot;.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

<span class="hljs-comment"># Push the tokenizer to an organization with the name &quot;my-finetuned-bert&quot;.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;huggingface/my-finetuned-bert&quot;</span>)`}}),{c(){z=r("p"),I=o("Examples:"),q=d(),h(E.$$.fragment)},l(T){z=a(T,"P",{});var L=s(z);I=n(L,"Examples:"),L.forEach(t),q=c(T),p(E.$$.fragment,T)},m(T,L){$(T,z,L),e(z,I),$(T,q,L),m(E,T,L),B=!0},p:Iv,i(T){B||(f(E.$$.fragment,T),B=!0)},o(T){u(E.$$.fragment,T),B=!1},d(T){T&&t(z),T&&t(q),_(E,T)}}}function Bv(pe){let z,I;return{c(){z=r("p"),I=o(`This encodes a dummy input and checks the number of added tokens, and is therefore not efficient. Do not put
this inside your training loop.`)},l(q){z=a(q,"P",{});var E=s(z);I=n(E,`This encodes a dummy input and checks the number of added tokens, and is therefore not efficient. Do not put
this inside your training loop.`),E.forEach(t)},m(q,E){$(q,z,E),e(z,I)},d(q){q&&t(z)}}}function Ov(pe){let z,I,q,E,B;return E=new Dv({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMHRva2VuaXplciUyMHRvJTIweW91ciUyMG5hbWVzcGFjZSUyMHdpdGglMjB0aGUlMjBuYW1lJTIwJTIybXktZmluZXR1bmVkLWJlcnQlMjIuJTBBdG9rZW5pemVyLnB1c2hfdG9faHViKCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjB0b2tlbml6ZXIlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtYmVydCUyMi4lMEF0b2tlbml6ZXIucHVzaF90b19odWIoJTIyaHVnZ2luZ2ZhY2UlMkZteS1maW5ldHVuZWQtYmVydCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

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

<span class="hljs-comment"># Push the tokenizer to your namespace with the name &quot;my-finetuned-bert&quot;.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

<span class="hljs-comment"># Push the tokenizer to an organization with the name &quot;my-finetuned-bert&quot;.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;huggingface/my-finetuned-bert&quot;</span>)`}}),{c(){z=r("p"),I=o("Examples:"),q=d(),h(E.$$.fragment)},l(T){z=a(T,"P",{});var L=s(z);I=n(L,"Examples:"),L.forEach(t),q=c(T),p(E.$$.fragment,T)},m(T,L){$(T,z,L),e(z,I),$(T,q,L),m(E,T,L),B=!0},p:Iv,i(T){B||(f(E.$$.fragment,T),B=!0)},o(T){u(E.$$.fragment,T),B=!1},d(T){T&&t(z),T&&t(q),_(E,T)}}}function Uv(pe){let z,I;return{c(){z=r("p"),I=o(`This encodes a dummy input and checks the number of added tokens, and is therefore not efficient. Do not put
this inside your training loop.`)},l(q){z=a(q,"P",{});var E=s(z);I=n(E,`This encodes a dummy input and checks the number of added tokens, and is therefore not efficient. Do not put
this inside your training loop.`),E.forEach(t)},m(q,E){$(q,z,E),e(z,I)},d(q){q&&t(z)}}}function Rv(pe){let z,I,q,E,B,T,L,Vn,td,Qs,Je,od,xt,nd,rd,Ks,Ze,Gn,ad,sd,Hn,id,ei,O,dd,Uo,cd,ld,Ro,hd,pd,Mo,md,fd,jo,ud,_d,ti,Le,Vo,gd,kd,Go,bd,vd,oi,me,Jn,Td,yd,Zn,wd,zd,Xn,xd,ni,F,Ho,Ed,$d,Jo,Pd,qd,Yn,Fd,Id,Qn,Dd,Ld,Kn,Cd,Nd,er,Ad,Wd,tr,Sd,Bd,Et,Od,Ud,ri,Ce,Xe,or,$t,Rd,nr,Md,ai,g,Pt,jd,rr,Vd,Gd,qt,Hd,Zo,Jd,Zd,Xd,ar,Yd,Qd,sr,Kd,ec,ir,tc,oc,C,fe,dr,nc,rc,cr,ac,sc,lr,ic,dc,cc,U,hr,lc,hc,pr,pc,mc,mr,fc,uc,fr,_c,gc,ur,kc,bc,vc,Q,_r,Tc,yc,gr,wc,zc,kr,xc,Ec,br,$c,Pc,qc,R,vr,Fc,Ic,Tr,Dc,Lc,yr,Cc,Nc,wr,Ac,Wc,Xo,Sc,Bc,Oc,Ye,zr,Uc,Rc,xr,Mc,jc,Vc,K,Er,Gc,Hc,$r,Jc,Zc,Pr,Xc,Yc,qr,Qc,Kc,el,ee,Fr,tl,ol,Ir,nl,rl,Dr,al,sl,Lr,il,dl,cl,Qe,Ft,ll,Cr,hl,pl,Ke,It,ml,Nr,fl,ul,ue,Dt,_l,Ar,gl,kl,Lt,bl,Wr,vl,Tl,yl,_e,Ct,wl,Sr,zl,xl,Nt,El,Br,$l,Pl,ql,et,At,Fl,Ne,Il,Or,Dl,Ll,Ur,Cl,Nl,Al,ge,Wt,Wl,Rr,Sl,Bl,tt,Ol,ot,St,Ul,Mr,Rl,Ml,nt,Bt,jl,jr,Vl,Gl,rt,Ot,Hl,Vr,Jl,Zl,ke,Ut,Xl,Gr,Yl,Ql,at,Kl,be,Rt,eh,Hr,th,oh,Ae,nh,Jr,rh,ah,Zr,sh,ih,dh,ve,Mt,ch,Xr,lh,hh,Yr,ph,si,We,st,Qr,jt,mh,Kr,fh,ii,te,uh,Yo,_h,gh,Vt,kh,bh,Qo,vh,Th,di,k,Gt,yh,ea,wh,zh,Ht,xh,Ko,Eh,$h,Ph,ta,qh,Fh,oa,Ih,Dh,na,Lh,Ch,N,Te,ra,Nh,Ah,aa,Wh,Sh,sa,Bh,Oh,Uh,M,ia,Rh,Mh,da,jh,Vh,ca,Gh,Hh,la,Jh,Zh,ha,Xh,Yh,Qh,oe,pa,Kh,ep,ma,tp,op,fa,np,rp,ua,ap,sp,ip,j,_a,dp,cp,ga,lp,hp,ka,pp,mp,ba,fp,up,en,_p,gp,kp,it,va,bp,vp,Ta,Tp,yp,wp,ne,ya,zp,xp,wa,Ep,$p,za,Pp,qp,xa,Fp,Ip,Dp,re,Ea,Lp,Cp,$a,Np,Ap,Pa,Wp,Sp,qa,Bp,Op,Up,dt,Jt,Rp,Fa,Mp,jp,ct,Zt,Vp,Ia,Gp,Hp,ye,Xt,Jp,Da,Zp,Xp,Yt,Yp,La,Qp,Kp,em,we,Qt,tm,Ca,om,nm,Kt,rm,Na,am,sm,im,lt,eo,dm,Se,cm,Aa,lm,hm,Wa,pm,mm,fm,ze,to,um,Sa,_m,gm,ht,km,pt,oo,bm,Ba,vm,Tm,mt,no,ym,Oa,wm,zm,ft,ro,xm,Ua,Em,$m,xe,ao,Pm,Ra,qm,Fm,ut,Im,Ee,so,Dm,Ma,Lm,Cm,ja,Nm,Am,_t,io,Wm,Va,Sm,ci,Be,gt,Ga,co,Bm,Ha,Om,li,x,lo,Um,ie,Rm,ho,Ja,Mm,jm,Vm,tn,Gm,Hm,on,Jm,Zm,Xm,Za,Ym,Qm,V,po,Km,Xa,ef,tf,Ya,of,nf,mo,nn,Qa,rf,af,sf,rn,Ka,df,cf,lf,es,hf,pf,G,fo,mf,ts,ff,uf,os,_f,gf,uo,an,ns,kf,bf,vf,sn,rs,Tf,yf,wf,as,zf,xf,kt,_o,Ef,ss,$f,Pf,$e,go,qf,is,Ff,If,Oe,dn,ds,Df,Lf,Cf,cn,cs,Nf,Af,Wf,ln,ls,Sf,Bf,Of,bt,ko,Uf,bo,Rf,hs,Mf,jf,Vf,W,vo,Gf,ps,Hf,Jf,To,Zf,hn,Xf,Yf,Qf,yo,pn,ms,Kf,eu,tu,mn,fs,ou,nu,ru,us,au,su,wo,fn,_s,iu,du,cu,un,gs,lu,hu,pu,H,zo,mu,Ue,fu,ks,uu,_u,bs,gu,ku,bu,vs,vu,Tu,xo,_n,Ts,yu,wu,zu,gn,ys,xu,Eu,$u,ws,Pu,qu,J,Eo,Fu,zs,Iu,Du,xs,Lu,Cu,$o,kn,Es,Nu,Au,Wu,bn,$s,Su,Bu,Ou,Ps,Uu,Ru,vt,Po,Mu,qs,ju,Vu,Tt,qo,Gu,Fs,Hu,Ju,S,Fo,Zu,Is,Xu,Yu,Ds,Qu,Ku,Io,Ls,e_,t_,Cs,o_,n_,Ns,r_,a_,Do,vn,As,s_,i_,d_,Tn,Ws,c_,l_,h_,D,Lo,p_,Ss,m_,f_,Co,u_,yn,__,g_,k_,No,wn,Bs,b_,v_,T_,zn,Os,y_,w_,z_,Us,x_,E_,Ao,xn,Rs,$_,P_,q_,En,Ms,F_,I_,D_,js,L_,C_,yt,Wo,N_,Vs,A_,hi;return T=new ed({}),$t=new ed({}),Pt=new v({props:{name:"class transformers.PreTrainedTokenizer",anchor:"transformers.PreTrainedTokenizer",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.model_max_length",description:`<strong>model_max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length (in number of tokens) for the inputs to the transformer model. When the tokenizer is
loaded with <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained">from_pretrained()</a>, this will be set to the
value stored for the associated model in <code>max_model_input_sizes</code> (see above). If no value is provided, will
default to VERY_LARGE_INTEGER (<code>int(1e30)</code>).`,name:"model_max_length"},{anchor:"transformers.PreTrainedTokenizer.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have padding applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizer.truncation_side",description:`<strong>truncation_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have truncation applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"truncation_side"},{anchor:"transformers.PreTrainedTokenizer.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A Jinja template string that will be used to format lists of chat messages. See
<a href="https://huggingface.co/docs/transformers/chat_templating" rel="nofollow">https://huggingface.co/docs/transformers/chat_templating</a> for a full description.`,name:"chat_template"},{anchor:"transformers.PreTrainedTokenizer.model_input_names",description:`<strong>model_input_names</strong> (<code>List[string]</code>, <em>optional</em>) &#x2014;
The list of inputs accepted by the forward pass of the model (like <code>&quot;token_type_ids&quot;</code> or
<code>&quot;attention_mask&quot;</code>). Default value is picked from the class attribute of the same name.`,name:"model_input_names"},{anchor:"transformers.PreTrainedTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the beginning of a sentence. Will be associated to <code>self.bos_token</code> and
<code>self.bos_token_id</code>.`,name:"bos_token"},{anchor:"transformers.PreTrainedTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the end of a sentence. Will be associated to <code>self.eos_token</code> and
<code>self.eos_token_id</code>.`,name:"eos_token"},{anchor:"transformers.PreTrainedTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing an out-of-vocabulary token. Will be associated to <code>self.unk_token</code> and
<code>self.unk_token_id</code>.`,name:"unk_token"},{anchor:"transformers.PreTrainedTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token separating two different sentences in the same input (used by BERT for instance). Will be
associated to <code>self.sep_token</code> and <code>self.sep_token_id</code>.`,name:"sep_token"},{anchor:"transformers.PreTrainedTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token used to make arrays of tokens the same size for batching purpose. Will then be ignored by
attention mechanisms or loss computation. Will be associated to <code>self.pad_token</code> and <code>self.pad_token_id</code>.`,name:"pad_token"},{anchor:"transformers.PreTrainedTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the class of the input (used by BERT for instance). Will be associated to
<code>self.cls_token</code> and <code>self.cls_token_id</code>.`,name:"cls_token"},{anchor:"transformers.PreTrainedTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing a masked token (used by masked-language modeling pretraining objectives, like
BERT). Will be associated to <code>self.mask_token</code> and <code>self.mask_token_id</code>.`,name:"mask_token"},{anchor:"transformers.PreTrainedTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (tuple or list of <code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A tuple or a list of additional special tokens. Add them here to ensure they won&#x2019;t be split by the
tokenization process. Will be associated to <code>self.additional_special_tokens</code> and
<code>self.additional_special_tokens_ids</code>.`,name:"additional_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should cleanup the spaces that were added when splitting the input text during the
tokenization process.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizer.split_special_tokens",description:`<strong>split_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the special tokens should be split during the tokenization process. The default behavior is
to not split special tokens. This means that if <code>&lt;s&gt;</code> is the <code>bos_token</code>, then <code>tokenizer.tokenize(&quot;&lt;s&gt;&quot;) = [&apos;&lt;s&gt;</code>]. Otherwise, if <code>split_special_tokens=True</code>, then <code>tokenizer.tokenize(&quot;&lt;s&gt;&quot;)</code> will be give <code>[&apos;&lt;&apos;, &apos;s&apos;, &apos;&gt;&apos;]</code>. This argument is only supported for <code>slow</code> tokenizers for the moment.`,name:"split_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils.py#L333"}}),Ft=new v({props:{name:"__call__",anchor:"transformers.PreTrainedTokenizer.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"text_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.PreTrainedTokenizer.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair"},{anchor:"transformers.PreTrainedTokenizer.__call__.text_target",description:`<strong>text_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_target"},{anchor:"transformers.PreTrainedTokenizer.__call__.text_pair_target",description:`<strong>text_pair_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair_target"},{anchor:"transformers.PreTrainedTokenizer.__call__.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.PreTrainedTokenizer.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizer.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizer.__call__.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizer.__call__.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PreTrainedTokenizer.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return token type IDs. If left to the default, will return the token type IDs according to
the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"return_token_type_ids"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_overflowing_tokens",description:`<strong>return_overflowing_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return overflowing token sequences. If a pair of sequences of input ids (or a batch
of pairs) is provided with <code>truncation_strategy = longest_first</code> or <code>True</code>, an error is raised instead
of returning overflowing tokens.`,name:"return_overflowing_tokens"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_special_tokens_mask",description:`<strong>return_special_tokens_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return special tokens mask information.`,name:"return_special_tokens_mask"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_offsets_mapping",description:`<strong>return_offsets_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return <code>(char_start, char_end)</code> for each token.</p>
<p>This is only available on fast tokenizers inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using
Python&#x2019;s tokenizer, this method will raise <code>NotImplementedError</code>.`,name:"return_offsets_mapping"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_length",description:`<strong>return_length</strong>  (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return the lengths of the encoded inputs.`,name:"return_length"},{anchor:"transformers.PreTrainedTokenizer.__call__.verbose",description:`<strong>verbose</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to print more information and warnings.
**kwargs &#x2014; passed to the <code>self.tokenize()</code> method`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L2644",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li>
<p><strong>input_ids</strong> \u2014 List of token ids to be fed to a model.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
</li>
<li>
<p><strong>token_type_ids</strong> \u2014 List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or
if <em>\u201Ctoken_type_ids\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a></p>
</li>
<li>
<p><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>\u201Cattention_mask\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
</li>
<li>
<p><strong>overflowing_tokens</strong> \u2014 List of overflowing tokens sequences (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>num_truncated_tokens</strong> \u2014 Number of tokens truncated (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>special_tokens_mask</strong> \u2014 List of 0s and 1s, with 1 specifying added special tokens and 0 specifying
regular sequence tokens (when <code>add_special_tokens=True</code> and <code>return_special_tokens_mask=True</code>).</p>
</li>
<li>
<p><strong>length</strong> \u2014 The length of the inputs (when <code>return_length=True</code>)</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),It=new v({props:{name:"batch_decode",anchor:"transformers.PreTrainedTokenizer.batch_decode",parameters:[{name:"sequences",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.batch_decode.sequences",description:`<strong>sequences</strong> (<code>Union[List[int], List[List[int]], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"sequences"},{anchor:"transformers.PreTrainedTokenizer.batch_decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.batch_decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizer.batch_decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L3602",returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Dt=new v({props:{name:"decode",anchor:"transformers.PreTrainedTokenizer.decode",parameters:[{name:"token_ids",val:": typing.Union[int, typing.List[int], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.decode.token_ids",description:`<strong>token_ids</strong> (<code>Union[int, List[int], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"token_ids"},{anchor:"transformers.PreTrainedTokenizer.decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizer.decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L3636",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),Ct=new v({props:{name:"encode",anchor:"transformers.PreTrainedTokenizer.encode",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[int]]"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[int], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.encode.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code> or <code>List[int]</code>) &#x2014;
The first sequence to be encoded. This can be a string, a list of strings (tokenized string using the
<code>tokenize</code> method) or a list of integers (tokenized string ids using the <code>convert_tokens_to_ids</code>
method).`,name:"text"},{anchor:"transformers.PreTrainedTokenizer.encode.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code> or <code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second sequence to be encoded. This can be a string, a list of strings (tokenized string using
the <code>tokenize</code> method) or a list of integers (tokenized string ids using the <code>convert_tokens_to_ids</code>
method).`,name:"text_pair"},{anchor:"transformers.PreTrainedTokenizer.encode.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.encode.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.PreTrainedTokenizer.encode.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizer.encode.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizer.encode.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizer.encode.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PreTrainedTokenizer.encode.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizer.encode.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>
<p>**kwargs &#x2014; Passed along to the <code>.tokenize()</code> method.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L2452",returnDescription:`
<p>The tokenized ids of the text.</p>
`,returnType:`
<p><code>List[int]</code>, <code>torch.Tensor</code>, <code>tf.Tensor</code> or <code>np.ndarray</code></p>
`}}),At=new v({props:{name:"apply_chat_template",anchor:"transformers.PreTrainedTokenizer.apply_chat_template",parameters:[{name:"conversation",val:": typing.Union[typing.List[typing.Dict[str, str]], ForwardRef('Conversation')]"},{name:"chat_template",val:": typing.Optional[str] = None"},{name:"tokenize",val:": bool = True"},{name:"padding",val:": bool = False"},{name:"truncation",val:": bool = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**tokenizer_kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.apply_chat_template.conversation",description:`<strong>conversation</strong> (Union[List[Dict[str, str]], &#x201C;Conversation&#x201D;]) &#x2014; A Conversation object or list of dicts
with &#x201C;role&#x201D; and &#x201C;content&#x201D; keys, representing the chat history so far.`,name:"conversation"},{anchor:"transformers.PreTrainedTokenizer.apply_chat_template.chat_template",description:`<strong>chat_template</strong> (str, <em>optional</em>) &#x2014; A Jinja template to use for this conversion. If
this is not passed, the model&#x2019;s default chat template will be used instead.`,name:"chat_template"},{anchor:"transformers.PreTrainedTokenizer.apply_chat_template.tokenize",description:`<strong>tokenize</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to tokenize the output. If <code>False</code>, the output will be a string.`,name:"tokenize"},{anchor:"transformers.PreTrainedTokenizer.apply_chat_template.padding",description:`<strong>padding</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to pad sequences to the maximum length. Has no effect if tokenize is <code>False</code>.`,name:"padding"},{anchor:"transformers.PreTrainedTokenizer.apply_chat_template.truncation",description:`<strong>truncation</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to truncate sequences at the maximum length. Has no effect if tokenize is <code>False</code>.`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizer.apply_chat_template.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length (in tokens) to use for padding or truncation. Has no effect if tokenize is <code>False</code>. If
not specified, the tokenizer&#x2019;s <code>max_length</code> attribute will be used as a default.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizer.apply_chat_template.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors of a particular framework. Has no effect if tokenize is <code>False</code>. Acceptable
values are:<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.Tensor</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
<li><code>&apos;jax&apos;</code>: Return JAX <code>jnp.ndarray</code> objects.
**tokenizer_kwargs &#x2014; Additional kwargs to pass to the tokenizer.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L1640",returnDescription:`
<p>A list of token ids representing the tokenized chat so far, including control tokens. This
output is ready to pass to the model, either directly or via methods like <code>generate()</code>.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Wt=new v({props:{name:"push_to_hub",anchor:"transformers.PreTrainedTokenizer.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '10GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = False"},{name:"revision",val:": str = None"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your tokenizer to. It should contain your organization name
when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.
Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Will default to <code>&quot;Upload tokenizer&quot;</code>.`,name:"commit_message"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private.`,name:"private"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code>
is not specified.`,name:"token"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;10GB&quot;</code>) &#x2014;
Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard
will then be each of size lower than this size. If expressed as a string, needs to be digits followed
by a unit (like <code>&quot;5MB&quot;</code>).`,name:"max_shard_size"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to convert the model weights in safetensors format for safer serialization.`,name:"safe_serialization"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Branch to push the uploaded files to.`,name:"revision"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/hub.py#L786"}}),tt=new Fv({props:{anchor:"transformers.PreTrainedTokenizer.push_to_hub.example",$$slots:{default:[Sv]},$$scope:{ctx:pe}}}),St=new v({props:{name:"convert_ids_to_tokens",anchor:"transformers.PreTrainedTokenizer.convert_ids_to_tokens",parameters:[{name:"ids",val:": typing.Union[int, typing.List[int]]"},{name:"skip_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.convert_ids_to_tokens.ids",description:`<strong>ids</strong> (<code>int</code> or <code>List[int]</code>) &#x2014;
The token id (or token ids) to convert to tokens.`,name:"ids"},{anchor:"transformers.PreTrainedTokenizer.convert_ids_to_tokens.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils.py#L890",returnDescription:`
<p>The decoded token(s).</p>
`,returnType:`
<p><code>str</code> or <code>List[str]</code></p>
`}}),Bt=new v({props:{name:"convert_tokens_to_ids",anchor:"transformers.PreTrainedTokenizer.convert_tokens_to_ids",parameters:[{name:"tokens",val:": typing.Union[str, typing.List[str]]"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.convert_tokens_to_ids.tokens",description:"<strong>tokens</strong> (<code>str</code> or <code>List[str]</code>) &#x2014; One or several token(s) to convert to token id(s).",name:"tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils.py#L567",returnDescription:`
<p>The token id or list of token ids.</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),Ot=new v({props:{name:"get_added_vocab",anchor:"transformers.PreTrainedTokenizer.get_added_vocab",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils.py#L369",returnDescription:`
<p>The added tokens.</p>
`,returnType:`
<p><code>Dict[str, int]</code></p>
`}}),Ut=new v({props:{name:"num_special_tokens_to_add",anchor:"transformers.PreTrainedTokenizer.num_special_tokens_to_add",parameters:[{name:"pair",val:": bool = False"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.num_special_tokens_to_add.pair",description:`<strong>pair</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the number of added tokens should be computed in the case of a sequence pair or a single
sequence.`,name:"pair"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils.py#L458",returnDescription:`
<p>Number of special tokens added to sequences.</p>
`,returnType:`
<p><code>int</code></p>
`}}),at=new qv({props:{$$slots:{default:[Bv]},$$scope:{ctx:pe}}}),Rt=new v({props:{name:"prepare_for_tokenization",anchor:"transformers.PreTrainedTokenizer.prepare_for_tokenization",parameters:[{name:"text",val:": str"},{name:"is_split_into_words",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.prepare_for_tokenization.text",description:`<strong>text</strong> (<code>str</code>) &#x2014;
The text to prepare.`,name:"text"},{anchor:"transformers.PreTrainedTokenizer.prepare_for_tokenization.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PreTrainedTokenizer.prepare_for_tokenization.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Keyword arguments to use for the tokenization.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils.py#L828",returnDescription:`
<p>The prepared text and the unused kwargs.</p>
`,returnType:`
<p><code>Tuple[str, Dict[str, Any]]</code></p>
`}}),Mt=new v({props:{name:"tokenize",anchor:"transformers.PreTrainedTokenizer.tokenize",parameters:[{name:"text",val:": str"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.tokenize.text",description:`<strong>text</strong> (<code>str</code>) &#x2014;
The sequence to be encoded.`,name:"text"},{anchor:"transformers.PreTrainedTokenizer.tokenize.*kwargs",description:`*<strong>*kwargs</strong> (additional keyword arguments) &#x2014;
Passed along to the model-specific <code>prepare_for_tokenization</code> preprocessing method.`,name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils.py#L481",returnDescription:`
<p>The list of tokens.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),jt=new ed({}),Gt=new v({props:{name:"class transformers.PreTrainedTokenizerFast",anchor:"transformers.PreTrainedTokenizerFast",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.model_max_length",description:`<strong>model_max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length (in number of tokens) for the inputs to the transformer model. When the tokenizer is
loaded with <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained">from_pretrained()</a>, this will be set to the
value stored for the associated model in <code>max_model_input_sizes</code> (see above). If no value is provided, will
default to VERY_LARGE_INTEGER (<code>int(1e30)</code>).`,name:"model_max_length"},{anchor:"transformers.PreTrainedTokenizerFast.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have padding applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizerFast.truncation_side",description:`<strong>truncation_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have truncation applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"truncation_side"},{anchor:"transformers.PreTrainedTokenizerFast.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A Jinja template string that will be used to format lists of chat messages. See
<a href="https://huggingface.co/docs/transformers/chat_templating" rel="nofollow">https://huggingface.co/docs/transformers/chat_templating</a> for a full description.`,name:"chat_template"},{anchor:"transformers.PreTrainedTokenizerFast.model_input_names",description:`<strong>model_input_names</strong> (<code>List[string]</code>, <em>optional</em>) &#x2014;
The list of inputs accepted by the forward pass of the model (like <code>&quot;token_type_ids&quot;</code> or
<code>&quot;attention_mask&quot;</code>). Default value is picked from the class attribute of the same name.`,name:"model_input_names"},{anchor:"transformers.PreTrainedTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the beginning of a sentence. Will be associated to <code>self.bos_token</code> and
<code>self.bos_token_id</code>.`,name:"bos_token"},{anchor:"transformers.PreTrainedTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the end of a sentence. Will be associated to <code>self.eos_token</code> and
<code>self.eos_token_id</code>.`,name:"eos_token"},{anchor:"transformers.PreTrainedTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing an out-of-vocabulary token. Will be associated to <code>self.unk_token</code> and
<code>self.unk_token_id</code>.`,name:"unk_token"},{anchor:"transformers.PreTrainedTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token separating two different sentences in the same input (used by BERT for instance). Will be
associated to <code>self.sep_token</code> and <code>self.sep_token_id</code>.`,name:"sep_token"},{anchor:"transformers.PreTrainedTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token used to make arrays of tokens the same size for batching purpose. Will then be ignored by
attention mechanisms or loss computation. Will be associated to <code>self.pad_token</code> and <code>self.pad_token_id</code>.`,name:"pad_token"},{anchor:"transformers.PreTrainedTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the class of the input (used by BERT for instance). Will be associated to
<code>self.cls_token</code> and <code>self.cls_token_id</code>.`,name:"cls_token"},{anchor:"transformers.PreTrainedTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing a masked token (used by masked-language modeling pretraining objectives, like
BERT). Will be associated to <code>self.mask_token</code> and <code>self.mask_token_id</code>.`,name:"mask_token"},{anchor:"transformers.PreTrainedTokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (tuple or list of <code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A tuple or a list of additional special tokens. Add them here to ensure they won&#x2019;t be split by the
tokenization process. Will be associated to <code>self.additional_special_tokens</code> and
<code>self.additional_special_tokens_ids</code>.`,name:"additional_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should cleanup the spaces that were added when splitting the input text during the
tokenization process.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerFast.split_special_tokens",description:`<strong>split_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the special tokens should be split during the tokenization process. The default behavior is
to not split special tokens. This means that if <code>&lt;s&gt;</code> is the <code>bos_token</code>, then <code>tokenizer.tokenize(&quot;&lt;s&gt;&quot;) = [&apos;&lt;s&gt;</code>]. Otherwise, if <code>split_special_tokens=True</code>, then <code>tokenizer.tokenize(&quot;&lt;s&gt;&quot;)</code> will be give <code>[&apos;&lt;&apos;, &apos;s&apos;, &apos;&gt;&apos;]</code>. This argument is only supported for <code>slow</code> tokenizers for the moment.`,name:"split_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.tokenizer_object",description:`<strong>tokenizer_object</strong> (<a href="https://huggingface.co/docs/tokenizers/main/en/api/tokenizer#tokenizers.Tokenizer" rel="nofollow">tokenizers.Tokenizer</a>) &#x2014;
A <a href="https://huggingface.co/docs/tokenizers/main/en/api/tokenizer#tokenizers.Tokenizer" rel="nofollow">tokenizers.Tokenizer</a> object from &#x1F917; tokenizers to instantiate from. See <a href="../fast_tokenizers">Using tokenizers from &#x1F917;
tokenizers</a> for more information.`,name:"tokenizer_object"},{anchor:"transformers.PreTrainedTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>) &#x2014;
A path to a local JSON file representing a previously serialized <a href="https://huggingface.co/docs/tokenizers/main/en/api/tokenizer#tokenizers.Tokenizer" rel="nofollow">tokenizers.Tokenizer</a> object from &#x1F917;
tokenizers.`,name:"tokenizer_file"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_fast.py#L78"}}),Jt=new v({props:{name:"__call__",anchor:"transformers.PreTrainedTokenizerFast.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"text_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.text_target",description:`<strong>text_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_target"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.text_pair_target",description:`<strong>text_pair_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair_target"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return token type IDs. If left to the default, will return the token type IDs according to
the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"return_token_type_ids"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_overflowing_tokens",description:`<strong>return_overflowing_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return overflowing token sequences. If a pair of sequences of input ids (or a batch
of pairs) is provided with <code>truncation_strategy = longest_first</code> or <code>True</code>, an error is raised instead
of returning overflowing tokens.`,name:"return_overflowing_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_special_tokens_mask",description:`<strong>return_special_tokens_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return special tokens mask information.`,name:"return_special_tokens_mask"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_offsets_mapping",description:`<strong>return_offsets_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return <code>(char_start, char_end)</code> for each token.</p>
<p>This is only available on fast tokenizers inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using
Python&#x2019;s tokenizer, this method will raise <code>NotImplementedError</code>.`,name:"return_offsets_mapping"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_length",description:`<strong>return_length</strong>  (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return the lengths of the encoded inputs.`,name:"return_length"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.verbose",description:`<strong>verbose</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to print more information and warnings.
**kwargs &#x2014; passed to the <code>self.tokenize()</code> method`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L2644",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li>
<p><strong>input_ids</strong> \u2014 List of token ids to be fed to a model.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
</li>
<li>
<p><strong>token_type_ids</strong> \u2014 List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or
if <em>\u201Ctoken_type_ids\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a></p>
</li>
<li>
<p><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>\u201Cattention_mask\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
</li>
<li>
<p><strong>overflowing_tokens</strong> \u2014 List of overflowing tokens sequences (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>num_truncated_tokens</strong> \u2014 Number of tokens truncated (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>special_tokens_mask</strong> \u2014 List of 0s and 1s, with 1 specifying added special tokens and 0 specifying
regular sequence tokens (when <code>add_special_tokens=True</code> and <code>return_special_tokens_mask=True</code>).</p>
</li>
<li>
<p><strong>length</strong> \u2014 The length of the inputs (when <code>return_length=True</code>)</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Zt=new v({props:{name:"batch_decode",anchor:"transformers.PreTrainedTokenizerFast.batch_decode",parameters:[{name:"sequences",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.batch_decode.sequences",description:`<strong>sequences</strong> (<code>Union[List[int], List[List[int]], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"sequences"},{anchor:"transformers.PreTrainedTokenizerFast.batch_decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.batch_decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerFast.batch_decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L3602",returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Xt=new v({props:{name:"decode",anchor:"transformers.PreTrainedTokenizerFast.decode",parameters:[{name:"token_ids",val:": typing.Union[int, typing.List[int], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.decode.token_ids",description:`<strong>token_ids</strong> (<code>Union[int, List[int], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"token_ids"},{anchor:"transformers.PreTrainedTokenizerFast.decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerFast.decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L3636",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),Qt=new v({props:{name:"encode",anchor:"transformers.PreTrainedTokenizerFast.encode",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[int]]"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[int], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.encode.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code> or <code>List[int]</code>) &#x2014;
The first sequence to be encoded. This can be a string, a list of strings (tokenized string using the
<code>tokenize</code> method) or a list of integers (tokenized string ids using the <code>convert_tokens_to_ids</code>
method).`,name:"text"},{anchor:"transformers.PreTrainedTokenizerFast.encode.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code> or <code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second sequence to be encoded. This can be a string, a list of strings (tokenized string using
the <code>tokenize</code> method) or a list of integers (tokenized string ids using the <code>convert_tokens_to_ids</code>
method).`,name:"text_pair"},{anchor:"transformers.PreTrainedTokenizerFast.encode.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.encode.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.PreTrainedTokenizerFast.encode.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizerFast.encode.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizerFast.encode.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizerFast.encode.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PreTrainedTokenizerFast.encode.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerFast.encode.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>
<p>**kwargs &#x2014; Passed along to the <code>.tokenize()</code> method.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L2452",returnDescription:`
<p>The tokenized ids of the text.</p>
`,returnType:`
<p><code>List[int]</code>, <code>torch.Tensor</code>, <code>tf.Tensor</code> or <code>np.ndarray</code></p>
`}}),eo=new v({props:{name:"apply_chat_template",anchor:"transformers.PreTrainedTokenizerFast.apply_chat_template",parameters:[{name:"conversation",val:": typing.Union[typing.List[typing.Dict[str, str]], ForwardRef('Conversation')]"},{name:"chat_template",val:": typing.Optional[str] = None"},{name:"tokenize",val:": bool = True"},{name:"padding",val:": bool = False"},{name:"truncation",val:": bool = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**tokenizer_kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.apply_chat_template.conversation",description:`<strong>conversation</strong> (Union[List[Dict[str, str]], &#x201C;Conversation&#x201D;]) &#x2014; A Conversation object or list of dicts
with &#x201C;role&#x201D; and &#x201C;content&#x201D; keys, representing the chat history so far.`,name:"conversation"},{anchor:"transformers.PreTrainedTokenizerFast.apply_chat_template.chat_template",description:`<strong>chat_template</strong> (str, <em>optional</em>) &#x2014; A Jinja template to use for this conversion. If
this is not passed, the model&#x2019;s default chat template will be used instead.`,name:"chat_template"},{anchor:"transformers.PreTrainedTokenizerFast.apply_chat_template.tokenize",description:`<strong>tokenize</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to tokenize the output. If <code>False</code>, the output will be a string.`,name:"tokenize"},{anchor:"transformers.PreTrainedTokenizerFast.apply_chat_template.padding",description:`<strong>padding</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to pad sequences to the maximum length. Has no effect if tokenize is <code>False</code>.`,name:"padding"},{anchor:"transformers.PreTrainedTokenizerFast.apply_chat_template.truncation",description:`<strong>truncation</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to truncate sequences at the maximum length. Has no effect if tokenize is <code>False</code>.`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizerFast.apply_chat_template.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length (in tokens) to use for padding or truncation. Has no effect if tokenize is <code>False</code>. If
not specified, the tokenizer&#x2019;s <code>max_length</code> attribute will be used as a default.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizerFast.apply_chat_template.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors of a particular framework. Has no effect if tokenize is <code>False</code>. Acceptable
values are:<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.Tensor</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
<li><code>&apos;jax&apos;</code>: Return JAX <code>jnp.ndarray</code> objects.
**tokenizer_kwargs &#x2014; Additional kwargs to pass to the tokenizer.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L1640",returnDescription:`
<p>A list of token ids representing the tokenized chat so far, including control tokens. This
output is ready to pass to the model, either directly or via methods like <code>generate()</code>.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),to=new v({props:{name:"push_to_hub",anchor:"transformers.PreTrainedTokenizerFast.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '10GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = False"},{name:"revision",val:": str = None"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your tokenizer to. It should contain your organization name
when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.
Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Will default to <code>&quot;Upload tokenizer&quot;</code>.`,name:"commit_message"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private.`,name:"private"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code>
is not specified.`,name:"token"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;10GB&quot;</code>) &#x2014;
Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard
will then be each of size lower than this size. If expressed as a string, needs to be digits followed
by a unit (like <code>&quot;5MB&quot;</code>).`,name:"max_shard_size"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to convert the model weights in safetensors format for safer serialization.`,name:"safe_serialization"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Branch to push the uploaded files to.`,name:"revision"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/hub.py#L786"}}),ht=new Fv({props:{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.example",$$slots:{default:[Ov]},$$scope:{ctx:pe}}}),oo=new v({props:{name:"convert_ids_to_tokens",anchor:"transformers.PreTrainedTokenizerFast.convert_ids_to_tokens",parameters:[{name:"ids",val:": typing.Union[int, typing.List[int]]"},{name:"skip_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.convert_ids_to_tokens.ids",description:`<strong>ids</strong> (<code>int</code> or <code>List[int]</code>) &#x2014;
The token id (or token ids) to convert to tokens.`,name:"ids"},{anchor:"transformers.PreTrainedTokenizerFast.convert_ids_to_tokens.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_fast.py#L317",returnDescription:`
<p>The decoded token(s).</p>
`,returnType:`
<p><code>str</code> or <code>List[str]</code></p>
`}}),no=new v({props:{name:"convert_tokens_to_ids",anchor:"transformers.PreTrainedTokenizerFast.convert_tokens_to_ids",parameters:[{name:"tokens",val:": typing.Union[str, typing.List[str]]"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.convert_tokens_to_ids.tokens",description:"<strong>tokens</strong> (<code>str</code> or <code>List[str]</code>) &#x2014; One or several token(s) to convert to token id(s).",name:"tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_fast.py#L262",returnDescription:`
<p>The token id or list of token ids.</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),ro=new v({props:{name:"get_added_vocab",anchor:"transformers.PreTrainedTokenizerFast.get_added_vocab",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_fast.py#L183",returnDescription:`
<p>The added tokens.</p>
`,returnType:`
<p><code>Dict[str, int]</code></p>
`}}),ao=new v({props:{name:"num_special_tokens_to_add",anchor:"transformers.PreTrainedTokenizerFast.num_special_tokens_to_add",parameters:[{name:"pair",val:": bool = False"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.num_special_tokens_to_add.pair",description:`<strong>pair</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the number of added tokens should be computed in the case of a sequence pair or a single
sequence.`,name:"pair"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_fast.py#L296",returnDescription:`
<p>Number of special tokens added to sequences.</p>
`,returnType:`
<p><code>int</code></p>
`}}),ut=new qv({props:{$$slots:{default:[Uv]},$$scope:{ctx:pe}}}),so=new v({props:{name:"set_truncation_and_padding",anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding",parameters:[{name:"padding_strategy",val:": PaddingStrategy"},{name:"truncation_strategy",val:": TruncationStrategy"},{name:"max_length",val:": int"},{name:"stride",val:": int"},{name:"pad_to_multiple_of",val:": typing.Optional[int]"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.padding_strategy",description:`<strong>padding_strategy</strong> (<a href="/docs/transformers/main/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>) &#x2014;
The kind of padding that will be applied to the input`,name:"padding_strategy"},{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.truncation_strategy",description:`<strong>truncation_strategy</strong> (<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>) &#x2014;
The kind of truncation that will be applied to the input`,name:"truncation_strategy"},{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum size of a sequence.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.stride",description:`<strong>stride</strong> (<code>int</code>) &#x2014;
The stride to use when handling overflow.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. This is especially useful to enable
the use of Tensor Cores on NVIDIA hardware with compute capability <code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_fast.py#L346"}}),io=new v({props:{name:"train_new_from_iterator",anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator",parameters:[{name:"text_iterator",val:""},{name:"vocab_size",val:""},{name:"length",val:" = None"},{name:"new_special_tokens",val:" = None"},{name:"special_tokens_map",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.text_iterator",description:`<strong>text_iterator</strong> (generator of <code>List[str]</code>) &#x2014;
The training corpus. Should be a generator of batches of texts, for instance a list of lists of texts
if you have everything in memory.`,name:"text_iterator"},{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>) &#x2014;
The size of the vocabulary you want for your tokenizer.`,name:"vocab_size"},{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.length",description:`<strong>length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The total number of sequences in the iterator. This is used to provide meaningful progress tracking`,name:"length"},{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.new_special_tokens",description:`<strong>new_special_tokens</strong> (list of <code>str</code> or <code>AddedToken</code>, <em>optional</em>) &#x2014;
A list of new special tokens to add to the tokenizer you are training.`,name:"new_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.special_tokens_map",description:`<strong>special_tokens_map</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
If you want to rename some of the special tokens this tokenizer uses, pass along a mapping old special
token name to new special token name in this argument.`,name:"special_tokens_map"},{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments passed along to the trainer from the &#x1F917; Tokenizers library.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_fast.py#L634",returnDescription:`
<p>A new tokenizer of the same type as the original one, trained on
<code>text_iterator</code>.</p>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"
>PreTrainedTokenizerFast</a></p>
`}}),co=new ed({}),lo=new v({props:{name:"class transformers.BatchEncoding",anchor:"transformers.BatchEncoding",parameters:[{name:"data",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"encoding",val:": typing.Union[tokenizers.Encoding, typing.Sequence[tokenizers.Encoding], NoneType] = None"},{name:"tensor_type",val:": typing.Union[NoneType, str, transformers.utils.generic.TensorType] = None"},{name:"prepend_batch_axis",val:": bool = False"},{name:"n_sequences",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BatchEncoding.data",description:`<strong>data</strong> (<code>dict</code>) &#x2014;
Dictionary of lists/arrays/tensors returned by the <code>__call__</code>/<code>encode_plus</code>/<code>batch_encode_plus</code> methods
(&#x2018;input_ids&#x2019;, &#x2018;attention_mask&#x2019;, etc.).`,name:"data"},{anchor:"transformers.BatchEncoding.encoding",description:`<strong>encoding</strong> (<code>tokenizers.Encoding</code> or <code>Sequence[tokenizers.Encoding]</code>, <em>optional</em>) &#x2014;
If the tokenizer is a fast tokenizer which outputs additional information like mapping from word/character
space to token space the <code>tokenizers.Encoding</code> instance or list of instance (for batches) hold this
information.`,name:"encoding"},{anchor:"transformers.BatchEncoding.tensor_type",description:`<strong>tensor_type</strong> (<code>Union[None, str, TensorType]</code>, <em>optional</em>) &#x2014;
You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
initialization.`,name:"tensor_type"},{anchor:"transformers.BatchEncoding.prepend_batch_axis",description:`<strong>prepend_batch_axis</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add a batch axis when converting to tensors (see <code>tensor_type</code> above).`,name:"prepend_batch_axis"},{anchor:"transformers.BatchEncoding.n_sequences",description:`<strong>n_sequences</strong> (<code>Optional[int]</code>, <em>optional</em>) &#x2014;
You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
initialization.`,name:"n_sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L166"}}),po=new v({props:{name:"char_to_token",anchor:"transformers.BatchEncoding.char_to_token",parameters:[{name:"batch_or_char_index",val:": int"},{name:"char_index",val:": typing.Optional[int] = None"},{name:"sequence_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.char_to_token.batch_or_char_index",description:`<strong>batch_or_char_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the word in the sequence`,name:"batch_or_char_index"},{anchor:"transformers.BatchEncoding.char_to_token.char_index",description:`<strong>char_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the word in the
sequence.`,name:"char_index"},{anchor:"transformers.BatchEncoding.char_to_token.sequence_index",description:`<strong>sequence_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If pair of sequences are encoded in the batch this can be used to specify which sequence in the pair (0
or 1) the provided character index belongs to.`,name:"sequence_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L545",returnDescription:`
<p>Index of the token.</p>
`,returnType:`
<p><code>int</code></p>
`}}),fo=new v({props:{name:"char_to_word",anchor:"transformers.BatchEncoding.char_to_word",parameters:[{name:"batch_or_char_index",val:": int"},{name:"char_index",val:": typing.Optional[int] = None"},{name:"sequence_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.char_to_word.batch_or_char_index",description:`<strong>batch_or_char_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the character in the original string.`,name:"batch_or_char_index"},{anchor:"transformers.BatchEncoding.char_to_word.char_index",description:`<strong>char_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the character in the
original string.`,name:"char_index"},{anchor:"transformers.BatchEncoding.char_to_word.sequence_index",description:`<strong>sequence_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If pair of sequences are encoded in the batch this can be used to specify which sequence in the pair (0
or 1) the provided character index belongs to.`,name:"sequence_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L631",returnDescription:`
<p>Index or indices of the associated encoded token(s).</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),_o=new v({props:{name:"convert_to_tensors",anchor:"transformers.BatchEncoding.convert_to_tensors",parameters:[{name:"tensor_type",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"prepend_batch_axis",val:": bool = False"}],parametersDescription:[{anchor:"transformers.BatchEncoding.convert_to_tensors.tensor_type",description:`<strong>tensor_type</strong> (<code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
The type of tensors to use. If <code>str</code>, should be one of the values of the enum <a href="/docs/transformers/main/en/internal/file_utils#transformers.TensorType">TensorType</a>. If
<code>None</code>, no modification is done.`,name:"tensor_type"},{anchor:"transformers.BatchEncoding.convert_to_tensors.prepend_batch_axis",description:`<strong>prepend_batch_axis</strong> (<code>int</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add the batch dimension during the conversion.`,name:"prepend_batch_axis"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L670"}}),go=new v({props:{name:"sequence_ids",anchor:"transformers.BatchEncoding.sequence_ids",parameters:[{name:"batch_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.sequence_ids.batch_index",description:"<strong>batch_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The index to access in the batch.",name:"batch_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L309",returnDescription:`
<p>A list indicating the sequence id corresponding to each token. Special tokens added
by the tokenizer are mapped to <code>None</code> and other tokens are mapped to the index of their corresponding
sequence.</p>
`,returnType:`
<p><code>List[Optional[int]]</code></p>
`}}),ko=new v({props:{name:"to",anchor:"transformers.BatchEncoding.to",parameters:[{name:"device",val:": typing.Union[str, ForwardRef('torch.device')]"}],parametersDescription:[{anchor:"transformers.BatchEncoding.to.device",description:"<strong>device</strong> (<code>str</code> or <code>torch.device</code>) &#x2014; The device to put the tensors on.",name:"device"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L763",returnDescription:`
<p>The same instance after modification.</p>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),vo=new v({props:{name:"token_to_chars",anchor:"transformers.BatchEncoding.token_to_chars",parameters:[{name:"batch_or_token_index",val:": int"},{name:"token_index",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BatchEncoding.token_to_chars.batch_or_token_index",description:`<strong>batch_or_token_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the token in the sequence.`,name:"batch_or_token_index"},{anchor:"transformers.BatchEncoding.token_to_chars.token_index",description:`<strong>token_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the token or tokens in
the sequence.`,name:"token_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L506",returnDescription:`
<p>Span of characters in the original string, or None, if the token
(e.g. <s>, </s>) doesn\u2019t correspond to any chars in the origin string.</p>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/internal/tokenization_utils#transformers.CharSpan"
>CharSpan</a></p>
`}}),zo=new v({props:{name:"token_to_sequence",anchor:"transformers.BatchEncoding.token_to_sequence",parameters:[{name:"batch_or_token_index",val:": int"},{name:"token_index",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BatchEncoding.token_to_sequence.batch_or_token_index",description:`<strong>batch_or_token_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprises one sequence, this can be the index of
the token in the sequence.`,name:"batch_or_token_index"},{anchor:"transformers.BatchEncoding.token_to_sequence.token_index",description:`<strong>token_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the token in the
sequence.`,name:"token_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L376",returnDescription:`
<p>Index of the word in the input sequence.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Eo=new v({props:{name:"token_to_word",anchor:"transformers.BatchEncoding.token_to_word",parameters:[{name:"batch_or_token_index",val:": int"},{name:"token_index",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BatchEncoding.token_to_word.batch_or_token_index",description:`<strong>batch_or_token_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the token in the sequence.`,name:"batch_or_token_index"},{anchor:"transformers.BatchEncoding.token_to_word.token_index",description:`<strong>token_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the token in the
sequence.`,name:"token_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L415",returnDescription:`
<p>Index of the word in the input sequence.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Po=new v({props:{name:"tokens",anchor:"transformers.BatchEncoding.tokens",parameters:[{name:"batch_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.tokens.batch_index",description:"<strong>batch_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The index to access in the batch.",name:"batch_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L291",returnDescription:`
<p>The list of tokens at that index.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),qo=new v({props:{name:"word_ids",anchor:"transformers.BatchEncoding.word_ids",parameters:[{name:"batch_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.word_ids.batch_index",description:"<strong>batch_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The index to access in the batch.",name:"batch_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L357",returnDescription:`
<p>A list indicating the word corresponding to each token. Special tokens added by the
tokenizer are mapped to <code>None</code> and other tokens are mapped to the index of their corresponding word
(several tokens will be mapped to the same word index if they are parts of that word).</p>
`,returnType:`
<p><code>List[Optional[int]]</code></p>
`}}),Fo=new v({props:{name:"word_to_chars",anchor:"transformers.BatchEncoding.word_to_chars",parameters:[{name:"batch_or_word_index",val:": int"},{name:"word_index",val:": typing.Optional[int] = None"},{name:"sequence_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.word_to_chars.batch_or_word_index",description:`<strong>batch_or_word_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the word in the sequence`,name:"batch_or_word_index"},{anchor:"transformers.BatchEncoding.word_to_chars.word_index",description:`<strong>word_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the word in the
sequence.`,name:"word_index"},{anchor:"transformers.BatchEncoding.word_to_chars.sequence_index",description:`<strong>sequence_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If pair of sequences are encoded in the batch this can be used to specify which sequence in the pair (0
or 1) the provided word index belongs to.`,name:"sequence_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L586",returnDescription:`
<p>Span(s) of the associated character or characters in the string. CharSpan
are NamedTuple with:</p>
<ul>
<li>start: index of the first character associated to the token in the original string</li>
<li>end: index of the character following the last character associated to the token in the original
string</li>
</ul>
`,returnType:`
<p><code>CharSpan</code> or <code>List[CharSpan]</code></p>
`}}),Lo=new v({props:{name:"word_to_tokens",anchor:"transformers.BatchEncoding.word_to_tokens",parameters:[{name:"batch_or_word_index",val:": int"},{name:"word_index",val:": typing.Optional[int] = None"},{name:"sequence_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.word_to_tokens.batch_or_word_index",description:`<strong>batch_or_word_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprises one sequence, this can be the index of
the word in the sequence.`,name:"batch_or_word_index"},{anchor:"transformers.BatchEncoding.word_to_tokens.word_index",description:`<strong>word_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the word in the
sequence.`,name:"word_index"},{anchor:"transformers.BatchEncoding.word_to_tokens.sequence_index",description:`<strong>sequence_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If pair of sequences are encoded in the batch this can be used to specify which sequence in the pair (0
or 1) the provided word index belongs to.`,name:"sequence_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L453",returnDescription:`
<p>Span of tokens in the encoded sequence. Returns
<code>None</code> if no tokens correspond to the word. This can happen especially when the token is a special token
that has been used to format the tokenization. For example when we add a class token at the very beginning
of the tokenization.</p>
`,returnType:`
<p>(<a
  href="/docs/transformers/main/en/internal/tokenization_utils#transformers.TokenSpan"
>TokenSpan</a>, <em>optional</em>)</p>
`}}),Wo=new v({props:{name:"words",anchor:"transformers.BatchEncoding.words",parameters:[{name:"batch_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.words.batch_index",description:"<strong>batch_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The index to access in the batch.",name:"batch_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L333",returnDescription:`
<p>A list indicating the word corresponding to each token. Special tokens added by the
tokenizer are mapped to <code>None</code> and other tokens are mapped to the index of their corresponding word
(several tokens will be mapped to the same word index if they are parts of that word).</p>
`,returnType:`
<p><code>List[Optional[int]]</code></p>
`}}),{c(){z=r("meta"),I=d(),q=r("h1"),E=r("a"),B=r("span"),h(T.$$.fragment),L=d(),Vn=r("span"),td=o("Tokenizer"),Qs=d(),Je=r("p"),od=o(`A tokenizer is in charge of preparing the inputs for a model. The library contains tokenizers for all the models. Most
of the tokenizers are available in two flavors: a full python implementation and a \u201CFast\u201D implementation based on the
Rust library `),xt=r("a"),nd=o("\u{1F917} Tokenizers"),rd=o(". The \u201CFast\u201D implementations allows:"),Ks=d(),Ze=r("ol"),Gn=r("li"),ad=o("a significant speed-up in particular when doing batched tokenization and"),sd=d(),Hn=r("li"),id=o(`additional methods to map between the original string (character and words) and the token space (e.g. getting the
index of the token comprising a given character or the span of characters corresponding to a given token).`),ei=d(),O=r("p"),dd=o("The base classes "),Uo=r("a"),cd=o("PreTrainedTokenizer"),ld=o(" and "),Ro=r("a"),hd=o("PreTrainedTokenizerFast"),pd=o(`
implement the common methods for encoding string inputs in model inputs (see below) and instantiating/saving python and
\u201CFast\u201D tokenizers either from a local file or directory or from a pretrained tokenizer provided by the library
(downloaded from HuggingFace\u2019s AWS S3 repository). They both rely on
`),Mo=r("a"),md=o("PreTrainedTokenizerBase"),fd=o(` that contains the common methods, and
`),jo=r("a"),ud=o("SpecialTokensMixin"),_d=o("."),ti=d(),Le=r("p"),Vo=r("a"),gd=o("PreTrainedTokenizer"),kd=o(" and "),Go=r("a"),bd=o("PreTrainedTokenizerFast"),vd=o(` thus implement the main
methods for using all the tokenizers:`),oi=d(),me=r("ul"),Jn=r("li"),Td=o(`Tokenizing (splitting strings in sub-word token strings), converting tokens strings to ids and back, and
encoding/decoding (i.e., tokenizing and converting to integers).`),yd=d(),Zn=r("li"),wd=o("Adding new tokens to the vocabulary in a way that is independent of the underlying structure (BPE, SentencePiece\u2026)."),zd=d(),Xn=r("li"),xd=o(`Managing special tokens (like mask, beginning-of-sentence, etc.): adding them, assigning them to attributes in the
tokenizer for easy access and making sure they are not split during tokenization.`),ni=d(),F=r("p"),Ho=r("a"),Ed=o("BatchEncoding"),$d=o(` holds the output of the
`),Jo=r("a"),Pd=o("PreTrainedTokenizerBase"),qd=o("\u2019s encoding methods ("),Yn=r("code"),Fd=o("__call__"),Id=o(`,
`),Qn=r("code"),Dd=o("encode_plus"),Ld=o(" and "),Kn=r("code"),Cd=o("batch_encode_plus"),Nd=o(`) and is derived from a Python dictionary. When the tokenizer is a pure python
tokenizer, this class behaves just like a standard python dictionary and holds the various model inputs computed by
these methods (`),er=r("code"),Ad=o("input_ids"),Wd=o(", "),tr=r("code"),Sd=o("attention_mask"),Bd=o(`\u2026). When the tokenizer is a \u201CFast\u201D tokenizer (i.e., backed by
HuggingFace `),Et=r("a"),Od=o("tokenizers library"),Ud=o(`), this class provides in addition
several advanced alignment methods which can be used to map between the original string (character and words) and the
token space (e.g., getting the index of the token comprising a given character or the span of characters corresponding
to a given token).`),ri=d(),Ce=r("h2"),Xe=r("a"),or=r("span"),h($t.$$.fragment),Rd=d(),nr=r("span"),Md=o("PreTrainedTokenizer"),ai=d(),g=r("div"),h(Pt.$$.fragment),jd=d(),rr=r("p"),Vd=o("Base class for all slow tokenizers."),Gd=d(),qt=r("p"),Hd=o("Inherits from "),Zo=r("a"),Jd=o("PreTrainedTokenizerBase"),Zd=o("."),Xd=d(),ar=r("p"),Yd=o(`Handle all the shared methods for tokenization and special tokens as well as methods downloading/caching/loading
pretrained tokenizers as well as adding tokens to the vocabulary.`),Qd=d(),sr=r("p"),Kd=o(`This class also contain the added tokens in a unified way on top of all tokenizers so we don\u2019t have to handle the
specific vocabulary augmentation methods of the various underlying dictionary structures (BPE, sentencepiece\u2026).`),ec=d(),ir=r("p"),tc=o("Class attributes (overridden by derived classes)"),oc=d(),C=r("ul"),fe=r("li"),dr=r("strong"),nc=o("vocab_files_names"),rc=o(" ("),cr=r("code"),ac=o("Dict[str, str]"),sc=o(") \u2014 A dictionary with, as keys, the "),lr=r("code"),ic=o("__init__"),dc=o(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),cc=d(),U=r("li"),hr=r("strong"),lc=o("pretrained_vocab_files_map"),hc=o(" ("),pr=r("code"),pc=o("Dict[str, Dict[str, str]]"),mc=o(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),mr=r("code"),fc=o("__init__"),uc=o(` keyword name of each vocabulary file required by the model, the
low-level being the `),fr=r("code"),_c=o("short-cut-names"),gc=o(" of the pretrained models with, as associated values, the "),ur=r("code"),kc=o("url"),bc=o(` to the
associated pretrained vocabulary file.`),vc=d(),Q=r("li"),_r=r("strong"),Tc=o("max_model_input_sizes"),yc=o(" ("),gr=r("code"),wc=o("Dict[str, Optional[int]]"),zc=o(") \u2014 A dictionary with, as keys, the "),kr=r("code"),xc=o("short-cut-names"),Ec=o(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),br=r("code"),$c=o("None"),Pc=o(" if the model has no maximum input size."),qc=d(),R=r("li"),vr=r("strong"),Fc=o("pretrained_init_configuration"),Ic=o(" ("),Tr=r("code"),Dc=o("Dict[str, Dict[str, Any]]"),Lc=o(`) \u2014 A dictionary with, as keys, the
`),yr=r("code"),Cc=o("short-cut-names"),Nc=o(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),wr=r("code"),Ac=o("__init__"),Wc=o(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Xo=r("a"),Sc=o("from_pretrained()"),Bc=o(" method."),Oc=d(),Ye=r("li"),zr=r("strong"),Uc=o("model_input_names"),Rc=o(" ("),xr=r("code"),Mc=o("List[str]"),jc=o(") \u2014 A list of inputs expected in the forward pass of the model."),Vc=d(),K=r("li"),Er=r("strong"),Gc=o("padding_side"),Hc=o(" ("),$r=r("code"),Jc=o("str"),Zc=o(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),Pr=r("code"),Xc=o("'right'"),Yc=o(" or "),qr=r("code"),Qc=o("'left'"),Kc=o("."),el=d(),ee=r("li"),Fr=r("strong"),tl=o("truncation_side"),ol=o(" ("),Ir=r("code"),nl=o("str"),rl=o(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),Dr=r("code"),al=o("'right'"),sl=o(" or "),Lr=r("code"),il=o("'left'"),dl=o("."),cl=d(),Qe=r("div"),h(Ft.$$.fragment),ll=d(),Cr=r("p"),hl=o(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),pl=d(),Ke=r("div"),h(It.$$.fragment),ml=d(),Nr=r("p"),fl=o("Convert a list of lists of token ids into a list of strings by calling decode."),ul=d(),ue=r("div"),h(Dt.$$.fragment),_l=d(),Ar=r("p"),gl=o(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),kl=d(),Lt=r("p"),bl=o("Similar to doing "),Wr=r("code"),vl=o("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Tl=o("."),yl=d(),_e=r("div"),h(Ct.$$.fragment),wl=d(),Sr=r("p"),zl=o("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),xl=d(),Nt=r("p"),El=o("Same as doing "),Br=r("code"),$l=o("self.convert_tokens_to_ids(self.tokenize(text))"),Pl=o("."),ql=d(),et=r("div"),h(At.$$.fragment),Fl=d(),Ne=r("p"),Il=o("Converts a Conversation object or a list of dictionaries with "),Or=r("code"),Dl=o('"role"'),Ll=o(" and "),Ur=r("code"),Cl=o('"content"'),Nl=o(` keys to a list of token
ids. This method is intended for use with chat models, and will read the tokenizer\u2019s chat_template attribute to
determine the format and control tokens to use when converting. When chat_template is None, it will fall back
to the default_chat_template specified at the class level.`),Al=d(),ge=r("div"),h(Wt.$$.fragment),Wl=d(),Rr=r("p"),Sl=o("Upload the tokenizer files to the \u{1F917} Model Hub."),Bl=d(),h(tt.$$.fragment),Ol=d(),ot=r("div"),h(St.$$.fragment),Ul=d(),Mr=r("p"),Rl=o(`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Ml=d(),nt=r("div"),h(Bt.$$.fragment),jl=d(),jr=r("p"),Vl=o(`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Gl=d(),rt=r("div"),h(Ot.$$.fragment),Hl=d(),Vr=r("p"),Jl=o("Returns the added tokens in the vocabulary as a dictionary of token to index."),Zl=d(),ke=r("div"),h(Ut.$$.fragment),Xl=d(),Gr=r("p"),Yl=o("Returns the number of added tokens when encoding a sequence with special tokens."),Ql=d(),h(at.$$.fragment),Kl=d(),be=r("div"),h(Rt.$$.fragment),eh=d(),Hr=r("p"),th=o("Performs any necessary transformations before tokenization."),oh=d(),Ae=r("p"),nh=o("This method should pop the arguments from kwargs and return the remaining "),Jr=r("code"),rh=o("kwargs"),ah=o(` as well. We test the
`),Zr=r("code"),sh=o("kwargs"),ih=o(" at the end of the encoding process to be sure all the arguments have been used."),dh=d(),ve=r("div"),h(Mt.$$.fragment),ch=d(),Xr=r("p"),lh=o("Converts a string in a sequence of tokens, using the tokenizer."),hh=d(),Yr=r("p"),ph=o(`Split in words for word-based vocabulary or sub-words for sub-word-based vocabularies
(BPE/SentencePieces/WordPieces). Takes care of added tokens.`),si=d(),We=r("h2"),st=r("a"),Qr=r("span"),h(jt.$$.fragment),mh=d(),Kr=r("span"),fh=o("PreTrainedTokenizerFast"),ii=d(),te=r("p"),uh=o("The "),Yo=r("a"),_h=o("PreTrainedTokenizerFast"),gh=o(" depend on the "),Vt=r("a"),kh=o("tokenizers"),bh=o(` library. The tokenizers obtained from the \u{1F917} tokenizers library can be
loaded very simply into \u{1F917} transformers. Take a look at the `),Qo=r("a"),vh=o("Using tokenizers from \u{1F917} tokenizers"),Th=o(" page to understand how this is done."),di=d(),k=r("div"),h(Gt.$$.fragment),yh=d(),ea=r("p"),wh=o("Base class for all fast tokenizers (wrapping HuggingFace tokenizers library)."),zh=d(),Ht=r("p"),xh=o("Inherits from "),Ko=r("a"),Eh=o("PreTrainedTokenizerBase"),$h=o("."),Ph=d(),ta=r("p"),qh=o(`Handles all the shared methods for tokenization and special tokens, as well as methods for
downloading/caching/loading pretrained tokenizers, as well as adding tokens to the vocabulary.`),Fh=d(),oa=r("p"),Ih=o(`This class also contains the added tokens in a unified way on top of all tokenizers so we don\u2019t have to handle the
specific vocabulary augmentation methods of the various underlying dictionary structures (BPE, sentencepiece\u2026).`),Dh=d(),na=r("p"),Lh=o("Class attributes (overridden by derived classes)"),Ch=d(),N=r("ul"),Te=r("li"),ra=r("strong"),Nh=o("vocab_files_names"),Ah=o(" ("),aa=r("code"),Wh=o("Dict[str, str]"),Sh=o(") \u2014 A dictionary with, as keys, the "),sa=r("code"),Bh=o("__init__"),Oh=o(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Uh=d(),M=r("li"),ia=r("strong"),Rh=o("pretrained_vocab_files_map"),Mh=o(" ("),da=r("code"),jh=o("Dict[str, Dict[str, str]]"),Vh=o(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),ca=r("code"),Gh=o("__init__"),Hh=o(` keyword name of each vocabulary file required by the model, the
low-level being the `),la=r("code"),Jh=o("short-cut-names"),Zh=o(" of the pretrained models with, as associated values, the "),ha=r("code"),Xh=o("url"),Yh=o(` to the
associated pretrained vocabulary file.`),Qh=d(),oe=r("li"),pa=r("strong"),Kh=o("max_model_input_sizes"),ep=o(" ("),ma=r("code"),tp=o("Dict[str, Optional[int]]"),op=o(") \u2014 A dictionary with, as keys, the "),fa=r("code"),np=o("short-cut-names"),rp=o(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),ua=r("code"),ap=o("None"),sp=o(" if the model has no maximum input size."),ip=d(),j=r("li"),_a=r("strong"),dp=o("pretrained_init_configuration"),cp=o(" ("),ga=r("code"),lp=o("Dict[str, Dict[str, Any]]"),hp=o(`) \u2014 A dictionary with, as keys, the
`),ka=r("code"),pp=o("short-cut-names"),mp=o(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ba=r("code"),fp=o("__init__"),up=o(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),en=r("a"),_p=o("from_pretrained()"),gp=o(" method."),kp=d(),it=r("li"),va=r("strong"),bp=o("model_input_names"),vp=o(" ("),Ta=r("code"),Tp=o("List[str]"),yp=o(") \u2014 A list of inputs expected in the forward pass of the model."),wp=d(),ne=r("li"),ya=r("strong"),zp=o("padding_side"),xp=o(" ("),wa=r("code"),Ep=o("str"),$p=o(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),za=r("code"),Pp=o("'right'"),qp=o(" or "),xa=r("code"),Fp=o("'left'"),Ip=o("."),Dp=d(),re=r("li"),Ea=r("strong"),Lp=o("truncation_side"),Cp=o(" ("),$a=r("code"),Np=o("str"),Ap=o(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),Pa=r("code"),Wp=o("'right'"),Sp=o(" or "),qa=r("code"),Bp=o("'left'"),Op=o("."),Up=d(),dt=r("div"),h(Jt.$$.fragment),Rp=d(),Fa=r("p"),Mp=o(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),jp=d(),ct=r("div"),h(Zt.$$.fragment),Vp=d(),Ia=r("p"),Gp=o("Convert a list of lists of token ids into a list of strings by calling decode."),Hp=d(),ye=r("div"),h(Xt.$$.fragment),Jp=d(),Da=r("p"),Zp=o(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Xp=d(),Yt=r("p"),Yp=o("Similar to doing "),La=r("code"),Qp=o("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Kp=o("."),em=d(),we=r("div"),h(Qt.$$.fragment),tm=d(),Ca=r("p"),om=o("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),nm=d(),Kt=r("p"),rm=o("Same as doing "),Na=r("code"),am=o("self.convert_tokens_to_ids(self.tokenize(text))"),sm=o("."),im=d(),lt=r("div"),h(eo.$$.fragment),dm=d(),Se=r("p"),cm=o("Converts a Conversation object or a list of dictionaries with "),Aa=r("code"),lm=o('"role"'),hm=o(" and "),Wa=r("code"),pm=o('"content"'),mm=o(` keys to a list of token
ids. This method is intended for use with chat models, and will read the tokenizer\u2019s chat_template attribute to
determine the format and control tokens to use when converting. When chat_template is None, it will fall back
to the default_chat_template specified at the class level.`),fm=d(),ze=r("div"),h(to.$$.fragment),um=d(),Sa=r("p"),_m=o("Upload the tokenizer files to the \u{1F917} Model Hub."),gm=d(),h(ht.$$.fragment),km=d(),pt=r("div"),h(oo.$$.fragment),bm=d(),Ba=r("p"),vm=o(`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Tm=d(),mt=r("div"),h(no.$$.fragment),ym=d(),Oa=r("p"),wm=o(`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),zm=d(),ft=r("div"),h(ro.$$.fragment),xm=d(),Ua=r("p"),Em=o("Returns the added tokens in the vocabulary as a dictionary of token to index."),$m=d(),xe=r("div"),h(ao.$$.fragment),Pm=d(),Ra=r("p"),qm=o("Returns the number of added tokens when encoding a sequence with special tokens."),Fm=d(),h(ut.$$.fragment),Im=d(),Ee=r("div"),h(so.$$.fragment),Dm=d(),Ma=r("p"),Lm=o(`Define the truncation and the padding strategies for fast tokenizers (provided by HuggingFace tokenizers
library) and restore the tokenizer settings afterwards.`),Cm=d(),ja=r("p"),Nm=o(`The provided tokenizer has no padding / truncation strategy before the managed section. If your tokenizer set a
padding / truncation strategy before, then it will be reset to no padding / truncation when exiting the managed
section.`),Am=d(),_t=r("div"),h(io.$$.fragment),Wm=d(),Va=r("p"),Sm=o(`Trains a tokenizer on a new corpus with the same defaults (in terms of special tokens or tokenization pipeline)
as the current one.`),ci=d(),Be=r("h2"),gt=r("a"),Ga=r("span"),h(co.$$.fragment),Bm=d(),Ha=r("span"),Om=o("BatchEncoding"),li=d(),x=r("div"),h(lo.$$.fragment),Um=d(),ie=r("p"),Rm=o("Holds the output of the "),ho=r("a"),Ja=r("strong"),Mm=o("call"),jm=o("()"),Vm=o(`,
`),tn=r("a"),Gm=o("encode_plus()"),Hm=o(` and
`),on=r("a"),Jm=o("batch_encode_plus()"),Zm=o(" methods (tokens, attention_masks, etc)."),Xm=d(),Za=r("p"),Ym=o(`This class is derived from a python dictionary and can be used as a dictionary. In addition, this class exposes
utility methods to map from word/character space to token space.`),Qm=d(),V=r("div"),h(po.$$.fragment),Km=d(),Xa=r("p"),ef=o(`Get the index of the token in the encoded output comprising a character in the original string for a sequence
of the batch.`),tf=d(),Ya=r("p"),of=o("Can be called as:"),nf=d(),mo=r("ul"),nn=r("li"),Qa=r("code"),rf=o("self.char_to_token(char_index)"),af=o(" if batch size is 1"),sf=d(),rn=r("li"),Ka=r("code"),df=o("self.char_to_token(batch_index, char_index)"),cf=o(" if batch size is greater or equal to 1"),lf=d(),es=r("p"),hf=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),pf=d(),G=r("div"),h(fo.$$.fragment),mf=d(),ts=r("p"),ff=o(`Get the word in the original string corresponding to a character in the original string of a sequence of the
batch.`),uf=d(),os=r("p"),_f=o("Can be called as:"),gf=d(),uo=r("ul"),an=r("li"),ns=r("code"),kf=o("self.char_to_word(char_index)"),bf=o(" if batch size is 1"),vf=d(),sn=r("li"),rs=r("code"),Tf=o("self.char_to_word(batch_index, char_index)"),yf=o(" if batch size is greater than 1"),wf=d(),as=r("p"),zf=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),xf=d(),kt=r("div"),h(_o.$$.fragment),Ef=d(),ss=r("p"),$f=o("Convert the inner content to tensors."),Pf=d(),$e=r("div"),h(go.$$.fragment),qf=d(),is=r("p"),Ff=o("Return a list mapping the tokens to the id of their original sentences:"),If=d(),Oe=r("ul"),dn=r("li"),ds=r("code"),Df=o("None"),Lf=o(" for special tokens added around or between sequences,"),Cf=d(),cn=r("li"),cs=r("code"),Nf=o("0"),Af=o(" for tokens corresponding to words in the first sequence,"),Wf=d(),ln=r("li"),ls=r("code"),Sf=o("1"),Bf=o(` for tokens corresponding to words in the second sequence when a pair of sequences was jointly
encoded.`),Of=d(),bt=r("div"),h(ko.$$.fragment),Uf=d(),bo=r("p"),Rf=o("Send all values to device by calling "),hs=r("code"),Mf=o("v.to(device)"),jf=o(" (PyTorch only)."),Vf=d(),W=r("div"),h(vo.$$.fragment),Gf=d(),ps=r("p"),Hf=o("Get the character span corresponding to an encoded token in a sequence of the batch."),Jf=d(),To=r("p"),Zf=o("Character spans are returned as a "),hn=r("a"),Xf=o("CharSpan"),Yf=o(" with:"),Qf=d(),yo=r("ul"),pn=r("li"),ms=r("strong"),Kf=o("start"),eu=o(" \u2014 Index of the first character in the original string associated to the token."),tu=d(),mn=r("li"),fs=r("strong"),ou=o("end"),nu=o(` \u2014 Index of the character following the last character in the original string associated to the
token.`),ru=d(),us=r("p"),au=o("Can be called as:"),su=d(),wo=r("ul"),fn=r("li"),_s=r("code"),iu=o("self.token_to_chars(token_index)"),du=o(" if batch size is 1"),cu=d(),un=r("li"),gs=r("code"),lu=o("self.token_to_chars(batch_index, token_index)"),hu=o(" if batch size is greater or equal to 1"),pu=d(),H=r("div"),h(zo.$$.fragment),mu=d(),Ue=r("p"),fu=o("Get the index of the sequence represented by the given token. In the general use case, this method returns "),ks=r("code"),uu=o("0"),_u=o(`
for a single sequence or the first sequence of a pair, and `),bs=r("code"),gu=o("1"),ku=o(" for the second sequence of a pair"),bu=d(),vs=r("p"),vu=o("Can be called as:"),Tu=d(),xo=r("ul"),_n=r("li"),Ts=r("code"),yu=o("self.token_to_sequence(token_index)"),wu=o(" if batch size is 1"),zu=d(),gn=r("li"),ys=r("code"),xu=o("self.token_to_sequence(batch_index, token_index)"),Eu=o(" if batch size is greater than 1"),$u=d(),ws=r("p"),Pu=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e.,
words are defined by the user). In this case it allows to easily associate encoded tokens with provided
tokenized words.`),qu=d(),J=r("div"),h(Eo.$$.fragment),Fu=d(),zs=r("p"),Iu=o("Get the index of the word corresponding (i.e. comprising) to an encoded token in a sequence of the batch."),Du=d(),xs=r("p"),Lu=o("Can be called as:"),Cu=d(),$o=r("ul"),kn=r("li"),Es=r("code"),Nu=o("self.token_to_word(token_index)"),Au=o(" if batch size is 1"),Wu=d(),bn=r("li"),$s=r("code"),Su=o("self.token_to_word(batch_index, token_index)"),Bu=o(" if batch size is greater than 1"),Ou=d(),Ps=r("p"),Uu=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e.,
words are defined by the user). In this case it allows to easily associate encoded tokens with provided
tokenized words.`),Ru=d(),vt=r("div"),h(Po.$$.fragment),Mu=d(),qs=r("p"),ju=o(`Return the list of tokens (sub-parts of the input strings after word/subword splitting and before conversion to
integer indices) at a given batch index (only works for the output of a fast tokenizer).`),Vu=d(),Tt=r("div"),h(qo.$$.fragment),Gu=d(),Fs=r("p"),Hu=o("Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),Ju=d(),S=r("div"),h(Fo.$$.fragment),Zu=d(),Is=r("p"),Xu=o("Get the character span in the original string corresponding to given word in a sequence of the batch."),Yu=d(),Ds=r("p"),Qu=o("Character spans are returned as a CharSpan NamedTuple with:"),Ku=d(),Io=r("ul"),Ls=r("li"),e_=o("start: index of the first character in the original string"),t_=d(),Cs=r("li"),o_=o("end: index of the character following the last character in the original string"),n_=d(),Ns=r("p"),r_=o("Can be called as:"),a_=d(),Do=r("ul"),vn=r("li"),As=r("code"),s_=o("self.word_to_chars(word_index)"),i_=o(" if batch size is 1"),d_=d(),Tn=r("li"),Ws=r("code"),c_=o("self.word_to_chars(batch_index, word_index)"),l_=o(" if batch size is greater or equal to 1"),h_=d(),D=r("div"),h(Lo.$$.fragment),p_=d(),Ss=r("p"),m_=o("Get the encoded token span corresponding to a word in a sequence of the batch."),f_=d(),Co=r("p"),u_=o("Token spans are returned as a "),yn=r("a"),__=o("TokenSpan"),g_=o(" with:"),k_=d(),No=r("ul"),wn=r("li"),Bs=r("strong"),b_=o("start"),v_=o(" \u2014 Index of the first token."),T_=d(),zn=r("li"),Os=r("strong"),y_=o("end"),w_=o(" \u2014 Index of the token following the last token."),z_=d(),Us=r("p"),x_=o("Can be called as:"),E_=d(),Ao=r("ul"),xn=r("li"),Rs=r("code"),$_=o("self.word_to_tokens(word_index, sequence_index: int = 0)"),P_=o(" if batch size is 1"),q_=d(),En=r("li"),Ms=r("code"),F_=o("self.word_to_tokens(batch_index, word_index, sequence_index: int = 0)"),I_=o(` if batch size is greater or equal to
1`),D_=d(),js=r("p"),L_=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),C_=d(),yt=r("div"),h(Wo.$$.fragment),N_=d(),Vs=r("p"),A_=o("Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),this.h()},l(i){const b=Av('[data-svelte="svelte-1phssyn"]',document.head);z=a(b,"META",{name:!0,content:!0}),b.forEach(t),I=c(i),q=a(i,"H1",{class:!0});var So=s(q);E=a(So,"A",{id:!0,class:!0,href:!0});var Gs=s(E);B=a(Gs,"SPAN",{});var Hs=s(B);p(T.$$.fragment,Hs),Hs.forEach(t),Gs.forEach(t),L=c(So),Vn=a(So,"SPAN",{});var Js=s(Vn);td=n(Js,"Tokenizer"),Js.forEach(t),So.forEach(t),Qs=c(i),Je=a(i,"P",{});var pi=s(Je);od=n(pi,`A tokenizer is in charge of preparing the inputs for a model. The library contains tokenizers for all the models. Most
of the tokenizers are available in two flavors: a full python implementation and a \u201CFast\u201D implementation based on the
Rust library `),xt=a(pi,"A",{href:!0,rel:!0});var ag=s(xt);nd=n(ag,"\u{1F917} Tokenizers"),ag.forEach(t),rd=n(pi,". The \u201CFast\u201D implementations allows:"),pi.forEach(t),Ks=c(i),Ze=a(i,"OL",{});var mi=s(Ze);Gn=a(mi,"LI",{});var sg=s(Gn);ad=n(sg,"a significant speed-up in particular when doing batched tokenization and"),sg.forEach(t),sd=c(mi),Hn=a(mi,"LI",{});var ig=s(Hn);id=n(ig,`additional methods to map between the original string (character and words) and the token space (e.g. getting the
index of the token comprising a given character or the span of characters corresponding to a given token).`),ig.forEach(t),mi.forEach(t),ei=c(i),O=a(i,"P",{});var Pe=s(O);dd=n(Pe,"The base classes "),Uo=a(Pe,"A",{href:!0});var dg=s(Uo);cd=n(dg,"PreTrainedTokenizer"),dg.forEach(t),ld=n(Pe," and "),Ro=a(Pe,"A",{href:!0});var cg=s(Ro);hd=n(cg,"PreTrainedTokenizerFast"),cg.forEach(t),pd=n(Pe,`
implement the common methods for encoding string inputs in model inputs (see below) and instantiating/saving python and
\u201CFast\u201D tokenizers either from a local file or directory or from a pretrained tokenizer provided by the library
(downloaded from HuggingFace\u2019s AWS S3 repository). They both rely on
`),Mo=a(Pe,"A",{href:!0});var lg=s(Mo);md=n(lg,"PreTrainedTokenizerBase"),lg.forEach(t),fd=n(Pe,` that contains the common methods, and
`),jo=a(Pe,"A",{href:!0});var hg=s(jo);ud=n(hg,"SpecialTokensMixin"),hg.forEach(t),_d=n(Pe,"."),Pe.forEach(t),ti=c(i),Le=a(i,"P",{});var Zs=s(Le);Vo=a(Zs,"A",{href:!0});var pg=s(Vo);gd=n(pg,"PreTrainedTokenizer"),pg.forEach(t),kd=n(Zs," and "),Go=a(Zs,"A",{href:!0});var mg=s(Go);bd=n(mg,"PreTrainedTokenizerFast"),mg.forEach(t),vd=n(Zs,` thus implement the main
methods for using all the tokenizers:`),Zs.forEach(t),oi=c(i),me=a(i,"UL",{});var $n=s(me);Jn=a($n,"LI",{});var fg=s(Jn);Td=n(fg,`Tokenizing (splitting strings in sub-word token strings), converting tokens strings to ids and back, and
encoding/decoding (i.e., tokenizing and converting to integers).`),fg.forEach(t),yd=c($n),Zn=a($n,"LI",{});var ug=s(Zn);wd=n(ug,"Adding new tokens to the vocabulary in a way that is independent of the underlying structure (BPE, SentencePiece\u2026)."),ug.forEach(t),zd=c($n),Xn=a($n,"LI",{});var _g=s(Xn);xd=n(_g,`Managing special tokens (like mask, beginning-of-sentence, etc.): adding them, assigning them to attributes in the
tokenizer for easy access and making sure they are not split during tokenization.`),_g.forEach(t),$n.forEach(t),ni=c(i),F=a(i,"P",{});var A=s(F);Ho=a(A,"A",{href:!0});var gg=s(Ho);Ed=n(gg,"BatchEncoding"),gg.forEach(t),$d=n(A,` holds the output of the
`),Jo=a(A,"A",{href:!0});var kg=s(Jo);Pd=n(kg,"PreTrainedTokenizerBase"),kg.forEach(t),qd=n(A,"\u2019s encoding methods ("),Yn=a(A,"CODE",{});var bg=s(Yn);Fd=n(bg,"__call__"),bg.forEach(t),Id=n(A,`,
`),Qn=a(A,"CODE",{});var vg=s(Qn);Dd=n(vg,"encode_plus"),vg.forEach(t),Ld=n(A," and "),Kn=a(A,"CODE",{});var Tg=s(Kn);Cd=n(Tg,"batch_encode_plus"),Tg.forEach(t),Nd=n(A,`) and is derived from a Python dictionary. When the tokenizer is a pure python
tokenizer, this class behaves just like a standard python dictionary and holds the various model inputs computed by
these methods (`),er=a(A,"CODE",{});var yg=s(er);Ad=n(yg,"input_ids"),yg.forEach(t),Wd=n(A,", "),tr=a(A,"CODE",{});var wg=s(tr);Sd=n(wg,"attention_mask"),wg.forEach(t),Bd=n(A,`\u2026). When the tokenizer is a \u201CFast\u201D tokenizer (i.e., backed by
HuggingFace `),Et=a(A,"A",{href:!0,rel:!0});var zg=s(Et);Od=n(zg,"tokenizers library"),zg.forEach(t),Ud=n(A,`), this class provides in addition
several advanced alignment methods which can be used to map between the original string (character and words) and the
token space (e.g., getting the index of the token comprising a given character or the span of characters corresponding
to a given token).`),A.forEach(t),ri=c(i),Ce=a(i,"H2",{class:!0});var fi=s(Ce);Xe=a(fi,"A",{id:!0,class:!0,href:!0});var xg=s(Xe);or=a(xg,"SPAN",{});var Eg=s(or);p($t.$$.fragment,Eg),Eg.forEach(t),xg.forEach(t),Rd=c(fi),nr=a(fi,"SPAN",{});var $g=s(nr);Md=n($g,"PreTrainedTokenizer"),$g.forEach(t),fi.forEach(t),ai=c(i),g=a(i,"DIV",{class:!0});var y=s(g);p(Pt.$$.fragment,y),jd=c(y),rr=a(y,"P",{});var Pg=s(rr);Vd=n(Pg,"Base class for all slow tokenizers."),Pg.forEach(t),Gd=c(y),qt=a(y,"P",{});var ui=s(qt);Hd=n(ui,"Inherits from "),Zo=a(ui,"A",{href:!0});var qg=s(Zo);Jd=n(qg,"PreTrainedTokenizerBase"),qg.forEach(t),Zd=n(ui,"."),ui.forEach(t),Xd=c(y),ar=a(y,"P",{});var Fg=s(ar);Yd=n(Fg,`Handle all the shared methods for tokenization and special tokens as well as methods downloading/caching/loading
pretrained tokenizers as well as adding tokens to the vocabulary.`),Fg.forEach(t),Qd=c(y),sr=a(y,"P",{});var Ig=s(sr);Kd=n(Ig,`This class also contain the added tokens in a unified way on top of all tokenizers so we don\u2019t have to handle the
specific vocabulary augmentation methods of the various underlying dictionary structures (BPE, sentencepiece\u2026).`),Ig.forEach(t),ec=c(y),ir=a(y,"P",{});var Dg=s(ir);tc=n(Dg,"Class attributes (overridden by derived classes)"),Dg.forEach(t),oc=c(y),C=a(y,"UL",{});var Z=s(C);fe=a(Z,"LI",{});var Bo=s(fe);dr=a(Bo,"STRONG",{});var Lg=s(dr);nc=n(Lg,"vocab_files_names"),Lg.forEach(t),rc=n(Bo," ("),cr=a(Bo,"CODE",{});var Cg=s(cr);ac=n(Cg,"Dict[str, str]"),Cg.forEach(t),sc=n(Bo,") \u2014 A dictionary with, as keys, the "),lr=a(Bo,"CODE",{});var Ng=s(lr);ic=n(Ng,"__init__"),Ng.forEach(t),dc=n(Bo,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Bo.forEach(t),cc=c(Z),U=a(Z,"LI",{});var de=s(U);hr=a(de,"STRONG",{});var Ag=s(hr);lc=n(Ag,"pretrained_vocab_files_map"),Ag.forEach(t),hc=n(de," ("),pr=a(de,"CODE",{});var Wg=s(pr);pc=n(Wg,"Dict[str, Dict[str, str]]"),Wg.forEach(t),mc=n(de,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),mr=a(de,"CODE",{});var Sg=s(mr);fc=n(Sg,"__init__"),Sg.forEach(t),uc=n(de,` keyword name of each vocabulary file required by the model, the
low-level being the `),fr=a(de,"CODE",{});var Bg=s(fr);_c=n(Bg,"short-cut-names"),Bg.forEach(t),gc=n(de," of the pretrained models with, as associated values, the "),ur=a(de,"CODE",{});var Og=s(ur);kc=n(Og,"url"),Og.forEach(t),bc=n(de,` to the
associated pretrained vocabulary file.`),de.forEach(t),vc=c(Z),Q=a(Z,"LI",{});var Re=s(Q);_r=a(Re,"STRONG",{});var Ug=s(_r);Tc=n(Ug,"max_model_input_sizes"),Ug.forEach(t),yc=n(Re," ("),gr=a(Re,"CODE",{});var Rg=s(gr);wc=n(Rg,"Dict[str, Optional[int]]"),Rg.forEach(t),zc=n(Re,") \u2014 A dictionary with, as keys, the "),kr=a(Re,"CODE",{});var Mg=s(kr);xc=n(Mg,"short-cut-names"),Mg.forEach(t),Ec=n(Re,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),br=a(Re,"CODE",{});var jg=s(br);$c=n(jg,"None"),jg.forEach(t),Pc=n(Re," if the model has no maximum input size."),Re.forEach(t),qc=c(Z),R=a(Z,"LI",{});var ce=s(R);vr=a(ce,"STRONG",{});var Vg=s(vr);Fc=n(Vg,"pretrained_init_configuration"),Vg.forEach(t),Ic=n(ce," ("),Tr=a(ce,"CODE",{});var Gg=s(Tr);Dc=n(Gg,"Dict[str, Dict[str, Any]]"),Gg.forEach(t),Lc=n(ce,`) \u2014 A dictionary with, as keys, the
`),yr=a(ce,"CODE",{});var Hg=s(yr);Cc=n(Hg,"short-cut-names"),Hg.forEach(t),Nc=n(ce,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),wr=a(ce,"CODE",{});var Jg=s(wr);Ac=n(Jg,"__init__"),Jg.forEach(t),Wc=n(ce,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Xo=a(ce,"A",{href:!0});var Zg=s(Xo);Sc=n(Zg,"from_pretrained()"),Zg.forEach(t),Bc=n(ce," method."),ce.forEach(t),Oc=c(Z),Ye=a(Z,"LI",{});var Xs=s(Ye);zr=a(Xs,"STRONG",{});var Xg=s(zr);Uc=n(Xg,"model_input_names"),Xg.forEach(t),Rc=n(Xs," ("),xr=a(Xs,"CODE",{});var Yg=s(xr);Mc=n(Yg,"List[str]"),Yg.forEach(t),jc=n(Xs,") \u2014 A list of inputs expected in the forward pass of the model."),Xs.forEach(t),Vc=c(Z),K=a(Z,"LI",{});var Me=s(K);Er=a(Me,"STRONG",{});var Qg=s(Er);Gc=n(Qg,"padding_side"),Qg.forEach(t),Hc=n(Me," ("),$r=a(Me,"CODE",{});var Kg=s($r);Jc=n(Kg,"str"),Kg.forEach(t),Zc=n(Me,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),Pr=a(Me,"CODE",{});var ek=s(Pr);Xc=n(ek,"'right'"),ek.forEach(t),Yc=n(Me," or "),qr=a(Me,"CODE",{});var tk=s(qr);Qc=n(tk,"'left'"),tk.forEach(t),Kc=n(Me,"."),Me.forEach(t),el=c(Z),ee=a(Z,"LI",{});var je=s(ee);Fr=a(je,"STRONG",{});var ok=s(Fr);tl=n(ok,"truncation_side"),ok.forEach(t),ol=n(je," ("),Ir=a(je,"CODE",{});var nk=s(Ir);nl=n(nk,"str"),nk.forEach(t),rl=n(je,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),Dr=a(je,"CODE",{});var rk=s(Dr);al=n(rk,"'right'"),rk.forEach(t),sl=n(je," or "),Lr=a(je,"CODE",{});var ak=s(Lr);il=n(ak,"'left'"),ak.forEach(t),dl=n(je,"."),je.forEach(t),Z.forEach(t),cl=c(y),Qe=a(y,"DIV",{class:!0});var _i=s(Qe);p(Ft.$$.fragment,_i),ll=c(_i),Cr=a(_i,"P",{});var sk=s(Cr);hl=n(sk,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),sk.forEach(t),_i.forEach(t),pl=c(y),Ke=a(y,"DIV",{class:!0});var gi=s(Ke);p(It.$$.fragment,gi),ml=c(gi),Nr=a(gi,"P",{});var ik=s(Nr);fl=n(ik,"Convert a list of lists of token ids into a list of strings by calling decode."),ik.forEach(t),gi.forEach(t),ul=c(y),ue=a(y,"DIV",{class:!0});var Pn=s(ue);p(Dt.$$.fragment,Pn),_l=c(Pn),Ar=a(Pn,"P",{});var dk=s(Ar);gl=n(dk,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),dk.forEach(t),kl=c(Pn),Lt=a(Pn,"P",{});var ki=s(Lt);bl=n(ki,"Similar to doing "),Wr=a(ki,"CODE",{});var ck=s(Wr);vl=n(ck,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),ck.forEach(t),Tl=n(ki,"."),ki.forEach(t),Pn.forEach(t),yl=c(y),_e=a(y,"DIV",{class:!0});var qn=s(_e);p(Ct.$$.fragment,qn),wl=c(qn),Sr=a(qn,"P",{});var lk=s(Sr);zl=n(lk,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),lk.forEach(t),xl=c(qn),Nt=a(qn,"P",{});var bi=s(Nt);El=n(bi,"Same as doing "),Br=a(bi,"CODE",{});var hk=s(Br);$l=n(hk,"self.convert_tokens_to_ids(self.tokenize(text))"),hk.forEach(t),Pl=n(bi,"."),bi.forEach(t),qn.forEach(t),ql=c(y),et=a(y,"DIV",{class:!0});var vi=s(et);p(At.$$.fragment,vi),Fl=c(vi),Ne=a(vi,"P",{});var Fn=s(Ne);Il=n(Fn,"Converts a Conversation object or a list of dictionaries with "),Or=a(Fn,"CODE",{});var pk=s(Or);Dl=n(pk,'"role"'),pk.forEach(t),Ll=n(Fn," and "),Ur=a(Fn,"CODE",{});var mk=s(Ur);Cl=n(mk,'"content"'),mk.forEach(t),Nl=n(Fn,` keys to a list of token
ids. This method is intended for use with chat models, and will read the tokenizer\u2019s chat_template attribute to
determine the format and control tokens to use when converting. When chat_template is None, it will fall back
to the default_chat_template specified at the class level.`),Fn.forEach(t),vi.forEach(t),Al=c(y),ge=a(y,"DIV",{class:!0});var In=s(ge);p(Wt.$$.fragment,In),Wl=c(In),Rr=a(In,"P",{});var fk=s(Rr);Sl=n(fk,"Upload the tokenizer files to the \u{1F917} Model Hub."),fk.forEach(t),Bl=c(In),p(tt.$$.fragment,In),In.forEach(t),Ol=c(y),ot=a(y,"DIV",{class:!0});var Ti=s(ot);p(St.$$.fragment,Ti),Ul=c(Ti),Mr=a(Ti,"P",{});var uk=s(Mr);Rl=n(uk,`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),uk.forEach(t),Ti.forEach(t),Ml=c(y),nt=a(y,"DIV",{class:!0});var yi=s(nt);p(Bt.$$.fragment,yi),jl=c(yi),jr=a(yi,"P",{});var _k=s(jr);Vl=n(_k,`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),_k.forEach(t),yi.forEach(t),Gl=c(y),rt=a(y,"DIV",{class:!0});var wi=s(rt);p(Ot.$$.fragment,wi),Hl=c(wi),Vr=a(wi,"P",{});var gk=s(Vr);Jl=n(gk,"Returns the added tokens in the vocabulary as a dictionary of token to index."),gk.forEach(t),wi.forEach(t),Zl=c(y),ke=a(y,"DIV",{class:!0});var Dn=s(ke);p(Ut.$$.fragment,Dn),Xl=c(Dn),Gr=a(Dn,"P",{});var kk=s(Gr);Yl=n(kk,"Returns the number of added tokens when encoding a sequence with special tokens."),kk.forEach(t),Ql=c(Dn),p(at.$$.fragment,Dn),Dn.forEach(t),Kl=c(y),be=a(y,"DIV",{class:!0});var Ln=s(be);p(Rt.$$.fragment,Ln),eh=c(Ln),Hr=a(Ln,"P",{});var bk=s(Hr);th=n(bk,"Performs any necessary transformations before tokenization."),bk.forEach(t),oh=c(Ln),Ae=a(Ln,"P",{});var Cn=s(Ae);nh=n(Cn,"This method should pop the arguments from kwargs and return the remaining "),Jr=a(Cn,"CODE",{});var vk=s(Jr);rh=n(vk,"kwargs"),vk.forEach(t),ah=n(Cn,` as well. We test the
`),Zr=a(Cn,"CODE",{});var Tk=s(Zr);sh=n(Tk,"kwargs"),Tk.forEach(t),ih=n(Cn," at the end of the encoding process to be sure all the arguments have been used."),Cn.forEach(t),Ln.forEach(t),dh=c(y),ve=a(y,"DIV",{class:!0});var Nn=s(ve);p(Mt.$$.fragment,Nn),ch=c(Nn),Xr=a(Nn,"P",{});var yk=s(Xr);lh=n(yk,"Converts a string in a sequence of tokens, using the tokenizer."),yk.forEach(t),hh=c(Nn),Yr=a(Nn,"P",{});var wk=s(Yr);ph=n(wk,`Split in words for word-based vocabulary or sub-words for sub-word-based vocabularies
(BPE/SentencePieces/WordPieces). Takes care of added tokens.`),wk.forEach(t),Nn.forEach(t),y.forEach(t),si=c(i),We=a(i,"H2",{class:!0});var zi=s(We);st=a(zi,"A",{id:!0,class:!0,href:!0});var zk=s(st);Qr=a(zk,"SPAN",{});var xk=s(Qr);p(jt.$$.fragment,xk),xk.forEach(t),zk.forEach(t),mh=c(zi),Kr=a(zi,"SPAN",{});var Ek=s(Kr);fh=n(Ek,"PreTrainedTokenizerFast"),Ek.forEach(t),zi.forEach(t),ii=c(i),te=a(i,"P",{});var wt=s(te);uh=n(wt,"The "),Yo=a(wt,"A",{href:!0});var $k=s(Yo);_h=n($k,"PreTrainedTokenizerFast"),$k.forEach(t),gh=n(wt," depend on the "),Vt=a(wt,"A",{href:!0,rel:!0});var Pk=s(Vt);kh=n(Pk,"tokenizers"),Pk.forEach(t),bh=n(wt,` library. The tokenizers obtained from the \u{1F917} tokenizers library can be
loaded very simply into \u{1F917} transformers. Take a look at the `),Qo=a(wt,"A",{href:!0});var qk=s(Qo);vh=n(qk,"Using tokenizers from \u{1F917} tokenizers"),qk.forEach(t),Th=n(wt," page to understand how this is done."),wt.forEach(t),di=c(i),k=a(i,"DIV",{class:!0});var w=s(k);p(Gt.$$.fragment,w),yh=c(w),ea=a(w,"P",{});var Fk=s(ea);wh=n(Fk,"Base class for all fast tokenizers (wrapping HuggingFace tokenizers library)."),Fk.forEach(t),zh=c(w),Ht=a(w,"P",{});var xi=s(Ht);xh=n(xi,"Inherits from "),Ko=a(xi,"A",{href:!0});var Ik=s(Ko);Eh=n(Ik,"PreTrainedTokenizerBase"),Ik.forEach(t),$h=n(xi,"."),xi.forEach(t),Ph=c(w),ta=a(w,"P",{});var Dk=s(ta);qh=n(Dk,`Handles all the shared methods for tokenization and special tokens, as well as methods for
downloading/caching/loading pretrained tokenizers, as well as adding tokens to the vocabulary.`),Dk.forEach(t),Fh=c(w),oa=a(w,"P",{});var Lk=s(oa);Ih=n(Lk,`This class also contains the added tokens in a unified way on top of all tokenizers so we don\u2019t have to handle the
specific vocabulary augmentation methods of the various underlying dictionary structures (BPE, sentencepiece\u2026).`),Lk.forEach(t),Dh=c(w),na=a(w,"P",{});var Ck=s(na);Lh=n(Ck,"Class attributes (overridden by derived classes)"),Ck.forEach(t),Ch=c(w),N=a(w,"UL",{});var X=s(N);Te=a(X,"LI",{});var Oo=s(Te);ra=a(Oo,"STRONG",{});var Nk=s(ra);Nh=n(Nk,"vocab_files_names"),Nk.forEach(t),Ah=n(Oo," ("),aa=a(Oo,"CODE",{});var Ak=s(aa);Wh=n(Ak,"Dict[str, str]"),Ak.forEach(t),Sh=n(Oo,") \u2014 A dictionary with, as keys, the "),sa=a(Oo,"CODE",{});var Wk=s(sa);Bh=n(Wk,"__init__"),Wk.forEach(t),Oh=n(Oo,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Oo.forEach(t),Uh=c(X),M=a(X,"LI",{});var le=s(M);ia=a(le,"STRONG",{});var Sk=s(ia);Rh=n(Sk,"pretrained_vocab_files_map"),Sk.forEach(t),Mh=n(le," ("),da=a(le,"CODE",{});var Bk=s(da);jh=n(Bk,"Dict[str, Dict[str, str]]"),Bk.forEach(t),Vh=n(le,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),ca=a(le,"CODE",{});var Ok=s(ca);Gh=n(Ok,"__init__"),Ok.forEach(t),Hh=n(le,` keyword name of each vocabulary file required by the model, the
low-level being the `),la=a(le,"CODE",{});var Uk=s(la);Jh=n(Uk,"short-cut-names"),Uk.forEach(t),Zh=n(le," of the pretrained models with, as associated values, the "),ha=a(le,"CODE",{});var Rk=s(ha);Xh=n(Rk,"url"),Rk.forEach(t),Yh=n(le,` to the
associated pretrained vocabulary file.`),le.forEach(t),Qh=c(X),oe=a(X,"LI",{});var Ve=s(oe);pa=a(Ve,"STRONG",{});var Mk=s(pa);Kh=n(Mk,"max_model_input_sizes"),Mk.forEach(t),ep=n(Ve," ("),ma=a(Ve,"CODE",{});var jk=s(ma);tp=n(jk,"Dict[str, Optional[int]]"),jk.forEach(t),op=n(Ve,") \u2014 A dictionary with, as keys, the "),fa=a(Ve,"CODE",{});var Vk=s(fa);np=n(Vk,"short-cut-names"),Vk.forEach(t),rp=n(Ve,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),ua=a(Ve,"CODE",{});var Gk=s(ua);ap=n(Gk,"None"),Gk.forEach(t),sp=n(Ve," if the model has no maximum input size."),Ve.forEach(t),ip=c(X),j=a(X,"LI",{});var he=s(j);_a=a(he,"STRONG",{});var Hk=s(_a);dp=n(Hk,"pretrained_init_configuration"),Hk.forEach(t),cp=n(he," ("),ga=a(he,"CODE",{});var Jk=s(ga);lp=n(Jk,"Dict[str, Dict[str, Any]]"),Jk.forEach(t),hp=n(he,`) \u2014 A dictionary with, as keys, the
`),ka=a(he,"CODE",{});var Zk=s(ka);pp=n(Zk,"short-cut-names"),Zk.forEach(t),mp=n(he,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ba=a(he,"CODE",{});var Xk=s(ba);fp=n(Xk,"__init__"),Xk.forEach(t),up=n(he,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),en=a(he,"A",{href:!0});var Yk=s(en);_p=n(Yk,"from_pretrained()"),Yk.forEach(t),gp=n(he," method."),he.forEach(t),kp=c(X),it=a(X,"LI",{});var Ys=s(it);va=a(Ys,"STRONG",{});var Qk=s(va);bp=n(Qk,"model_input_names"),Qk.forEach(t),vp=n(Ys," ("),Ta=a(Ys,"CODE",{});var Kk=s(Ta);Tp=n(Kk,"List[str]"),Kk.forEach(t),yp=n(Ys,") \u2014 A list of inputs expected in the forward pass of the model."),Ys.forEach(t),wp=c(X),ne=a(X,"LI",{});var Ge=s(ne);ya=a(Ge,"STRONG",{});var eb=s(ya);zp=n(eb,"padding_side"),eb.forEach(t),xp=n(Ge," ("),wa=a(Ge,"CODE",{});var tb=s(wa);Ep=n(tb,"str"),tb.forEach(t),$p=n(Ge,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),za=a(Ge,"CODE",{});var ob=s(za);Pp=n(ob,"'right'"),ob.forEach(t),qp=n(Ge," or "),xa=a(Ge,"CODE",{});var nb=s(xa);Fp=n(nb,"'left'"),nb.forEach(t),Ip=n(Ge,"."),Ge.forEach(t),Dp=c(X),re=a(X,"LI",{});var He=s(re);Ea=a(He,"STRONG",{});var rb=s(Ea);Lp=n(rb,"truncation_side"),rb.forEach(t),Cp=n(He," ("),$a=a(He,"CODE",{});var ab=s($a);Np=n(ab,"str"),ab.forEach(t),Ap=n(He,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),Pa=a(He,"CODE",{});var sb=s(Pa);Wp=n(sb,"'right'"),sb.forEach(t),Sp=n(He," or "),qa=a(He,"CODE",{});var ib=s(qa);Bp=n(ib,"'left'"),ib.forEach(t),Op=n(He,"."),He.forEach(t),X.forEach(t),Up=c(w),dt=a(w,"DIV",{class:!0});var Ei=s(dt);p(Jt.$$.fragment,Ei),Rp=c(Ei),Fa=a(Ei,"P",{});var db=s(Fa);Mp=n(db,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),db.forEach(t),Ei.forEach(t),jp=c(w),ct=a(w,"DIV",{class:!0});var $i=s(ct);p(Zt.$$.fragment,$i),Vp=c($i),Ia=a($i,"P",{});var cb=s(Ia);Gp=n(cb,"Convert a list of lists of token ids into a list of strings by calling decode."),cb.forEach(t),$i.forEach(t),Hp=c(w),ye=a(w,"DIV",{class:!0});var An=s(ye);p(Xt.$$.fragment,An),Jp=c(An),Da=a(An,"P",{});var lb=s(Da);Zp=n(lb,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),lb.forEach(t),Xp=c(An),Yt=a(An,"P",{});var Pi=s(Yt);Yp=n(Pi,"Similar to doing "),La=a(Pi,"CODE",{});var hb=s(La);Qp=n(hb,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),hb.forEach(t),Kp=n(Pi,"."),Pi.forEach(t),An.forEach(t),em=c(w),we=a(w,"DIV",{class:!0});var Wn=s(we);p(Qt.$$.fragment,Wn),tm=c(Wn),Ca=a(Wn,"P",{});var pb=s(Ca);om=n(pb,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),pb.forEach(t),nm=c(Wn),Kt=a(Wn,"P",{});var qi=s(Kt);rm=n(qi,"Same as doing "),Na=a(qi,"CODE",{});var mb=s(Na);am=n(mb,"self.convert_tokens_to_ids(self.tokenize(text))"),mb.forEach(t),sm=n(qi,"."),qi.forEach(t),Wn.forEach(t),im=c(w),lt=a(w,"DIV",{class:!0});var Fi=s(lt);p(eo.$$.fragment,Fi),dm=c(Fi),Se=a(Fi,"P",{});var Sn=s(Se);cm=n(Sn,"Converts a Conversation object or a list of dictionaries with "),Aa=a(Sn,"CODE",{});var fb=s(Aa);lm=n(fb,'"role"'),fb.forEach(t),hm=n(Sn," and "),Wa=a(Sn,"CODE",{});var ub=s(Wa);pm=n(ub,'"content"'),ub.forEach(t),mm=n(Sn,` keys to a list of token
ids. This method is intended for use with chat models, and will read the tokenizer\u2019s chat_template attribute to
determine the format and control tokens to use when converting. When chat_template is None, it will fall back
to the default_chat_template specified at the class level.`),Sn.forEach(t),Fi.forEach(t),fm=c(w),ze=a(w,"DIV",{class:!0});var Bn=s(ze);p(to.$$.fragment,Bn),um=c(Bn),Sa=a(Bn,"P",{});var _b=s(Sa);_m=n(_b,"Upload the tokenizer files to the \u{1F917} Model Hub."),_b.forEach(t),gm=c(Bn),p(ht.$$.fragment,Bn),Bn.forEach(t),km=c(w),pt=a(w,"DIV",{class:!0});var Ii=s(pt);p(oo.$$.fragment,Ii),bm=c(Ii),Ba=a(Ii,"P",{});var gb=s(Ba);vm=n(gb,`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),gb.forEach(t),Ii.forEach(t),Tm=c(w),mt=a(w,"DIV",{class:!0});var Di=s(mt);p(no.$$.fragment,Di),ym=c(Di),Oa=a(Di,"P",{});var kb=s(Oa);wm=n(kb,`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),kb.forEach(t),Di.forEach(t),zm=c(w),ft=a(w,"DIV",{class:!0});var Li=s(ft);p(ro.$$.fragment,Li),xm=c(Li),Ua=a(Li,"P",{});var bb=s(Ua);Em=n(bb,"Returns the added tokens in the vocabulary as a dictionary of token to index."),bb.forEach(t),Li.forEach(t),$m=c(w),xe=a(w,"DIV",{class:!0});var On=s(xe);p(ao.$$.fragment,On),Pm=c(On),Ra=a(On,"P",{});var vb=s(Ra);qm=n(vb,"Returns the number of added tokens when encoding a sequence with special tokens."),vb.forEach(t),Fm=c(On),p(ut.$$.fragment,On),On.forEach(t),Im=c(w),Ee=a(w,"DIV",{class:!0});var Un=s(Ee);p(so.$$.fragment,Un),Dm=c(Un),Ma=a(Un,"P",{});var Tb=s(Ma);Lm=n(Tb,`Define the truncation and the padding strategies for fast tokenizers (provided by HuggingFace tokenizers
library) and restore the tokenizer settings afterwards.`),Tb.forEach(t),Cm=c(Un),ja=a(Un,"P",{});var yb=s(ja);Nm=n(yb,`The provided tokenizer has no padding / truncation strategy before the managed section. If your tokenizer set a
padding / truncation strategy before, then it will be reset to no padding / truncation when exiting the managed
section.`),yb.forEach(t),Un.forEach(t),Am=c(w),_t=a(w,"DIV",{class:!0});var Ci=s(_t);p(io.$$.fragment,Ci),Wm=c(Ci),Va=a(Ci,"P",{});var wb=s(Va);Sm=n(wb,`Trains a tokenizer on a new corpus with the same defaults (in terms of special tokens or tokenization pipeline)
as the current one.`),wb.forEach(t),Ci.forEach(t),w.forEach(t),ci=c(i),Be=a(i,"H2",{class:!0});var Ni=s(Be);gt=a(Ni,"A",{id:!0,class:!0,href:!0});var zb=s(gt);Ga=a(zb,"SPAN",{});var xb=s(Ga);p(co.$$.fragment,xb),xb.forEach(t),zb.forEach(t),Bm=c(Ni),Ha=a(Ni,"SPAN",{});var Eb=s(Ha);Om=n(Eb,"BatchEncoding"),Eb.forEach(t),Ni.forEach(t),li=c(i),x=a(i,"DIV",{class:!0});var P=s(x);p(lo.$$.fragment,P),Um=c(P),ie=a(P,"P",{});var zt=s(ie);Rm=n(zt,"Holds the output of the "),ho=a(zt,"A",{href:!0});var W_=s(ho);Ja=a(W_,"STRONG",{});var $b=s(Ja);Mm=n($b,"call"),$b.forEach(t),jm=n(W_,"()"),W_.forEach(t),Vm=n(zt,`,
`),tn=a(zt,"A",{href:!0});var Pb=s(tn);Gm=n(Pb,"encode_plus()"),Pb.forEach(t),Hm=n(zt,` and
`),on=a(zt,"A",{href:!0});var qb=s(on);Jm=n(qb,"batch_encode_plus()"),qb.forEach(t),Zm=n(zt," methods (tokens, attention_masks, etc)."),zt.forEach(t),Xm=c(P),Za=a(P,"P",{});var Fb=s(Za);Ym=n(Fb,`This class is derived from a python dictionary and can be used as a dictionary. In addition, this class exposes
utility methods to map from word/character space to token space.`),Fb.forEach(t),Qm=c(P),V=a(P,"DIV",{class:!0});var qe=s(V);p(po.$$.fragment,qe),Km=c(qe),Xa=a(qe,"P",{});var Ib=s(Xa);ef=n(Ib,`Get the index of the token in the encoded output comprising a character in the original string for a sequence
of the batch.`),Ib.forEach(t),tf=c(qe),Ya=a(qe,"P",{});var Db=s(Ya);of=n(Db,"Can be called as:"),Db.forEach(t),nf=c(qe),mo=a(qe,"UL",{});var Ai=s(mo);nn=a(Ai,"LI",{});var S_=s(nn);Qa=a(S_,"CODE",{});var Lb=s(Qa);rf=n(Lb,"self.char_to_token(char_index)"),Lb.forEach(t),af=n(S_," if batch size is 1"),S_.forEach(t),sf=c(Ai),rn=a(Ai,"LI",{});var B_=s(rn);Ka=a(B_,"CODE",{});var Cb=s(Ka);df=n(Cb,"self.char_to_token(batch_index, char_index)"),Cb.forEach(t),cf=n(B_," if batch size is greater or equal to 1"),B_.forEach(t),Ai.forEach(t),lf=c(qe),es=a(qe,"P",{});var Nb=s(es);hf=n(Nb,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),Nb.forEach(t),qe.forEach(t),pf=c(P),G=a(P,"DIV",{class:!0});var Fe=s(G);p(fo.$$.fragment,Fe),mf=c(Fe),ts=a(Fe,"P",{});var Ab=s(ts);ff=n(Ab,`Get the word in the original string corresponding to a character in the original string of a sequence of the
batch.`),Ab.forEach(t),uf=c(Fe),os=a(Fe,"P",{});var Wb=s(os);_f=n(Wb,"Can be called as:"),Wb.forEach(t),gf=c(Fe),uo=a(Fe,"UL",{});var Wi=s(uo);an=a(Wi,"LI",{});var O_=s(an);ns=a(O_,"CODE",{});var Sb=s(ns);kf=n(Sb,"self.char_to_word(char_index)"),Sb.forEach(t),bf=n(O_," if batch size is 1"),O_.forEach(t),vf=c(Wi),sn=a(Wi,"LI",{});var U_=s(sn);rs=a(U_,"CODE",{});var Bb=s(rs);Tf=n(Bb,"self.char_to_word(batch_index, char_index)"),Bb.forEach(t),yf=n(U_," if batch size is greater than 1"),U_.forEach(t),Wi.forEach(t),wf=c(Fe),as=a(Fe,"P",{});var Ob=s(as);zf=n(Ob,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),Ob.forEach(t),Fe.forEach(t),xf=c(P),kt=a(P,"DIV",{class:!0});var Si=s(kt);p(_o.$$.fragment,Si),Ef=c(Si),ss=a(Si,"P",{});var Ub=s(ss);$f=n(Ub,"Convert the inner content to tensors."),Ub.forEach(t),Si.forEach(t),Pf=c(P),$e=a(P,"DIV",{class:!0});var Rn=s($e);p(go.$$.fragment,Rn),qf=c(Rn),is=a(Rn,"P",{});var Rb=s(is);Ff=n(Rb,"Return a list mapping the tokens to the id of their original sentences:"),Rb.forEach(t),If=c(Rn),Oe=a(Rn,"UL",{});var Mn=s(Oe);dn=a(Mn,"LI",{});var R_=s(dn);ds=a(R_,"CODE",{});var Mb=s(ds);Df=n(Mb,"None"),Mb.forEach(t),Lf=n(R_," for special tokens added around or between sequences,"),R_.forEach(t),Cf=c(Mn),cn=a(Mn,"LI",{});var M_=s(cn);cs=a(M_,"CODE",{});var jb=s(cs);Nf=n(jb,"0"),jb.forEach(t),Af=n(M_," for tokens corresponding to words in the first sequence,"),M_.forEach(t),Wf=c(Mn),ln=a(Mn,"LI",{});var j_=s(ln);ls=a(j_,"CODE",{});var Vb=s(ls);Sf=n(Vb,"1"),Vb.forEach(t),Bf=n(j_,` for tokens corresponding to words in the second sequence when a pair of sequences was jointly
encoded.`),j_.forEach(t),Mn.forEach(t),Rn.forEach(t),Of=c(P),bt=a(P,"DIV",{class:!0});var Bi=s(bt);p(ko.$$.fragment,Bi),Uf=c(Bi),bo=a(Bi,"P",{});var Oi=s(bo);Rf=n(Oi,"Send all values to device by calling "),hs=a(Oi,"CODE",{});var Gb=s(hs);Mf=n(Gb,"v.to(device)"),Gb.forEach(t),jf=n(Oi," (PyTorch only)."),Oi.forEach(t),Bi.forEach(t),Vf=c(P),W=a(P,"DIV",{class:!0});var ae=s(W);p(vo.$$.fragment,ae),Gf=c(ae),ps=a(ae,"P",{});var Hb=s(ps);Hf=n(Hb,"Get the character span corresponding to an encoded token in a sequence of the batch."),Hb.forEach(t),Jf=c(ae),To=a(ae,"P",{});var Ui=s(To);Zf=n(Ui,"Character spans are returned as a "),hn=a(Ui,"A",{href:!0});var Jb=s(hn);Xf=n(Jb,"CharSpan"),Jb.forEach(t),Yf=n(Ui," with:"),Ui.forEach(t),Qf=c(ae),yo=a(ae,"UL",{});var Ri=s(yo);pn=a(Ri,"LI",{});var V_=s(pn);ms=a(V_,"STRONG",{});var Zb=s(ms);Kf=n(Zb,"start"),Zb.forEach(t),eu=n(V_," \u2014 Index of the first character in the original string associated to the token."),V_.forEach(t),tu=c(Ri),mn=a(Ri,"LI",{});var G_=s(mn);fs=a(G_,"STRONG",{});var Xb=s(fs);ou=n(Xb,"end"),Xb.forEach(t),nu=n(G_,` \u2014 Index of the character following the last character in the original string associated to the
token.`),G_.forEach(t),Ri.forEach(t),ru=c(ae),us=a(ae,"P",{});var Yb=s(us);au=n(Yb,"Can be called as:"),Yb.forEach(t),su=c(ae),wo=a(ae,"UL",{});var Mi=s(wo);fn=a(Mi,"LI",{});var H_=s(fn);_s=a(H_,"CODE",{});var Qb=s(_s);iu=n(Qb,"self.token_to_chars(token_index)"),Qb.forEach(t),du=n(H_," if batch size is 1"),H_.forEach(t),cu=c(Mi),un=a(Mi,"LI",{});var J_=s(un);gs=a(J_,"CODE",{});var Kb=s(gs);lu=n(Kb,"self.token_to_chars(batch_index, token_index)"),Kb.forEach(t),hu=n(J_," if batch size is greater or equal to 1"),J_.forEach(t),Mi.forEach(t),ae.forEach(t),pu=c(P),H=a(P,"DIV",{class:!0});var Ie=s(H);p(zo.$$.fragment,Ie),mu=c(Ie),Ue=a(Ie,"P",{});var jn=s(Ue);fu=n(jn,"Get the index of the sequence represented by the given token. In the general use case, this method returns "),ks=a(jn,"CODE",{});var ev=s(ks);uu=n(ev,"0"),ev.forEach(t),_u=n(jn,`
for a single sequence or the first sequence of a pair, and `),bs=a(jn,"CODE",{});var tv=s(bs);gu=n(tv,"1"),tv.forEach(t),ku=n(jn," for the second sequence of a pair"),jn.forEach(t),bu=c(Ie),vs=a(Ie,"P",{});var ov=s(vs);vu=n(ov,"Can be called as:"),ov.forEach(t),Tu=c(Ie),xo=a(Ie,"UL",{});var ji=s(xo);_n=a(ji,"LI",{});var Z_=s(_n);Ts=a(Z_,"CODE",{});var nv=s(Ts);yu=n(nv,"self.token_to_sequence(token_index)"),nv.forEach(t),wu=n(Z_," if batch size is 1"),Z_.forEach(t),zu=c(ji),gn=a(ji,"LI",{});var X_=s(gn);ys=a(X_,"CODE",{});var rv=s(ys);xu=n(rv,"self.token_to_sequence(batch_index, token_index)"),rv.forEach(t),Eu=n(X_," if batch size is greater than 1"),X_.forEach(t),ji.forEach(t),$u=c(Ie),ws=a(Ie,"P",{});var av=s(ws);Pu=n(av,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e.,
words are defined by the user). In this case it allows to easily associate encoded tokens with provided
tokenized words.`),av.forEach(t),Ie.forEach(t),qu=c(P),J=a(P,"DIV",{class:!0});var De=s(J);p(Eo.$$.fragment,De),Fu=c(De),zs=a(De,"P",{});var sv=s(zs);Iu=n(sv,"Get the index of the word corresponding (i.e. comprising) to an encoded token in a sequence of the batch."),sv.forEach(t),Du=c(De),xs=a(De,"P",{});var iv=s(xs);Lu=n(iv,"Can be called as:"),iv.forEach(t),Cu=c(De),$o=a(De,"UL",{});var Vi=s($o);kn=a(Vi,"LI",{});var Y_=s(kn);Es=a(Y_,"CODE",{});var dv=s(Es);Nu=n(dv,"self.token_to_word(token_index)"),dv.forEach(t),Au=n(Y_," if batch size is 1"),Y_.forEach(t),Wu=c(Vi),bn=a(Vi,"LI",{});var Q_=s(bn);$s=a(Q_,"CODE",{});var cv=s($s);Su=n(cv,"self.token_to_word(batch_index, token_index)"),cv.forEach(t),Bu=n(Q_," if batch size is greater than 1"),Q_.forEach(t),Vi.forEach(t),Ou=c(De),Ps=a(De,"P",{});var lv=s(Ps);Uu=n(lv,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e.,
words are defined by the user). In this case it allows to easily associate encoded tokens with provided
tokenized words.`),lv.forEach(t),De.forEach(t),Ru=c(P),vt=a(P,"DIV",{class:!0});var Gi=s(vt);p(Po.$$.fragment,Gi),Mu=c(Gi),qs=a(Gi,"P",{});var hv=s(qs);ju=n(hv,`Return the list of tokens (sub-parts of the input strings after word/subword splitting and before conversion to
integer indices) at a given batch index (only works for the output of a fast tokenizer).`),hv.forEach(t),Gi.forEach(t),Vu=c(P),Tt=a(P,"DIV",{class:!0});var Hi=s(Tt);p(qo.$$.fragment,Hi),Gu=c(Hi),Fs=a(Hi,"P",{});var pv=s(Fs);Hu=n(pv,"Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),pv.forEach(t),Hi.forEach(t),Ju=c(P),S=a(P,"DIV",{class:!0});var se=s(S);p(Fo.$$.fragment,se),Zu=c(se),Is=a(se,"P",{});var mv=s(Is);Xu=n(mv,"Get the character span in the original string corresponding to given word in a sequence of the batch."),mv.forEach(t),Yu=c(se),Ds=a(se,"P",{});var fv=s(Ds);Qu=n(fv,"Character spans are returned as a CharSpan NamedTuple with:"),fv.forEach(t),Ku=c(se),Io=a(se,"UL",{});var Ji=s(Io);Ls=a(Ji,"LI",{});var uv=s(Ls);e_=n(uv,"start: index of the first character in the original string"),uv.forEach(t),t_=c(Ji),Cs=a(Ji,"LI",{});var _v=s(Cs);o_=n(_v,"end: index of the character following the last character in the original string"),_v.forEach(t),Ji.forEach(t),n_=c(se),Ns=a(se,"P",{});var gv=s(Ns);r_=n(gv,"Can be called as:"),gv.forEach(t),a_=c(se),Do=a(se,"UL",{});var Zi=s(Do);vn=a(Zi,"LI",{});var K_=s(vn);As=a(K_,"CODE",{});var kv=s(As);s_=n(kv,"self.word_to_chars(word_index)"),kv.forEach(t),i_=n(K_," if batch size is 1"),K_.forEach(t),d_=c(Zi),Tn=a(Zi,"LI",{});var eg=s(Tn);Ws=a(eg,"CODE",{});var bv=s(Ws);c_=n(bv,"self.word_to_chars(batch_index, word_index)"),bv.forEach(t),l_=n(eg," if batch size is greater or equal to 1"),eg.forEach(t),Zi.forEach(t),se.forEach(t),h_=c(P),D=a(P,"DIV",{class:!0});var Y=s(D);p(Lo.$$.fragment,Y),p_=c(Y),Ss=a(Y,"P",{});var vv=s(Ss);m_=n(vv,"Get the encoded token span corresponding to a word in a sequence of the batch."),vv.forEach(t),f_=c(Y),Co=a(Y,"P",{});var Xi=s(Co);u_=n(Xi,"Token spans are returned as a "),yn=a(Xi,"A",{href:!0});var Tv=s(yn);__=n(Tv,"TokenSpan"),Tv.forEach(t),g_=n(Xi," with:"),Xi.forEach(t),k_=c(Y),No=a(Y,"UL",{});var Yi=s(No);wn=a(Yi,"LI",{});var tg=s(wn);Bs=a(tg,"STRONG",{});var yv=s(Bs);b_=n(yv,"start"),yv.forEach(t),v_=n(tg," \u2014 Index of the first token."),tg.forEach(t),T_=c(Yi),zn=a(Yi,"LI",{});var og=s(zn);Os=a(og,"STRONG",{});var wv=s(Os);y_=n(wv,"end"),wv.forEach(t),w_=n(og," \u2014 Index of the token following the last token."),og.forEach(t),Yi.forEach(t),z_=c(Y),Us=a(Y,"P",{});var zv=s(Us);x_=n(zv,"Can be called as:"),zv.forEach(t),E_=c(Y),Ao=a(Y,"UL",{});var Qi=s(Ao);xn=a(Qi,"LI",{});var ng=s(xn);Rs=a(ng,"CODE",{});var xv=s(Rs);$_=n(xv,"self.word_to_tokens(word_index, sequence_index: int = 0)"),xv.forEach(t),P_=n(ng," if batch size is 1"),ng.forEach(t),q_=c(Qi),En=a(Qi,"LI",{});var rg=s(En);Ms=a(rg,"CODE",{});var Ev=s(Ms);F_=n(Ev,"self.word_to_tokens(batch_index, word_index, sequence_index: int = 0)"),Ev.forEach(t),I_=n(rg,` if batch size is greater or equal to
1`),rg.forEach(t),Qi.forEach(t),D_=c(Y),js=a(Y,"P",{});var $v=s(js);L_=n($v,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),$v.forEach(t),Y.forEach(t),C_=c(P),yt=a(P,"DIV",{class:!0});var Ki=s(yt);p(Wo.$$.fragment,Ki),N_=c(Ki),Vs=a(Ki,"P",{});var Pv=s(Vs);A_=n(Pv,"Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),Pv.forEach(t),Ki.forEach(t),P.forEach(t),this.h()},h(){l(z,"name","hf:doc:metadata"),l(z,"content",JSON.stringify(Mv)),l(E,"id","tokenizer"),l(E,"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"),l(E,"href","#tokenizer"),l(q,"class","relative group"),l(xt,"href","https://github.com/huggingface/tokenizers"),l(xt,"rel","nofollow"),l(Uo,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(Ro,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Mo,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(jo,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.SpecialTokensMixin"),l(Vo,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(Go,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Ho,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"),l(Jo,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Et,"href","https://github.com/huggingface/tokenizers"),l(Et,"rel","nofollow"),l(Xe,"id","transformers.PreTrainedTokenizer"),l(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Xe,"href","#transformers.PreTrainedTokenizer"),l(Ce,"class","relative group"),l(Zo,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Xo,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained"),l(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(st,"id","transformers.PreTrainedTokenizerFast"),l(st,"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"),l(st,"href","#transformers.PreTrainedTokenizerFast"),l(We,"class","relative group"),l(Yo,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Vt,"href","https://huggingface.co/docs/tokenizers"),l(Vt,"rel","nofollow"),l(Qo,"href","../fast_tokenizers"),l(Ko,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(en,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained"),l(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(gt,"id","transformers.BatchEncoding"),l(gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(gt,"href","#transformers.BatchEncoding"),l(Be,"class","relative group"),l(ho,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__"),l(tn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode_plus"),l(on,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_encode_plus"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(hn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.CharSpan"),l(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(yn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.TokenSpan"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,b){e(document.head,z),$(i,I,b),$(i,q,b),e(q,E),e(E,B),m(T,B,null),e(q,L),e(q,Vn),e(Vn,td),$(i,Qs,b),$(i,Je,b),e(Je,od),e(Je,xt),e(xt,nd),e(Je,rd),$(i,Ks,b),$(i,Ze,b),e(Ze,Gn),e(Gn,ad),e(Ze,sd),e(Ze,Hn),e(Hn,id),$(i,ei,b),$(i,O,b),e(O,dd),e(O,Uo),e(Uo,cd),e(O,ld),e(O,Ro),e(Ro,hd),e(O,pd),e(O,Mo),e(Mo,md),e(O,fd),e(O,jo),e(jo,ud),e(O,_d),$(i,ti,b),$(i,Le,b),e(Le,Vo),e(Vo,gd),e(Le,kd),e(Le,Go),e(Go,bd),e(Le,vd),$(i,oi,b),$(i,me,b),e(me,Jn),e(Jn,Td),e(me,yd),e(me,Zn),e(Zn,wd),e(me,zd),e(me,Xn),e(Xn,xd),$(i,ni,b),$(i,F,b),e(F,Ho),e(Ho,Ed),e(F,$d),e(F,Jo),e(Jo,Pd),e(F,qd),e(F,Yn),e(Yn,Fd),e(F,Id),e(F,Qn),e(Qn,Dd),e(F,Ld),e(F,Kn),e(Kn,Cd),e(F,Nd),e(F,er),e(er,Ad),e(F,Wd),e(F,tr),e(tr,Sd),e(F,Bd),e(F,Et),e(Et,Od),e(F,Ud),$(i,ri,b),$(i,Ce,b),e(Ce,Xe),e(Xe,or),m($t,or,null),e(Ce,Rd),e(Ce,nr),e(nr,Md),$(i,ai,b),$(i,g,b),m(Pt,g,null),e(g,jd),e(g,rr),e(rr,Vd),e(g,Gd),e(g,qt),e(qt,Hd),e(qt,Zo),e(Zo,Jd),e(qt,Zd),e(g,Xd),e(g,ar),e(ar,Yd),e(g,Qd),e(g,sr),e(sr,Kd),e(g,ec),e(g,ir),e(ir,tc),e(g,oc),e(g,C),e(C,fe),e(fe,dr),e(dr,nc),e(fe,rc),e(fe,cr),e(cr,ac),e(fe,sc),e(fe,lr),e(lr,ic),e(fe,dc),e(C,cc),e(C,U),e(U,hr),e(hr,lc),e(U,hc),e(U,pr),e(pr,pc),e(U,mc),e(U,mr),e(mr,fc),e(U,uc),e(U,fr),e(fr,_c),e(U,gc),e(U,ur),e(ur,kc),e(U,bc),e(C,vc),e(C,Q),e(Q,_r),e(_r,Tc),e(Q,yc),e(Q,gr),e(gr,wc),e(Q,zc),e(Q,kr),e(kr,xc),e(Q,Ec),e(Q,br),e(br,$c),e(Q,Pc),e(C,qc),e(C,R),e(R,vr),e(vr,Fc),e(R,Ic),e(R,Tr),e(Tr,Dc),e(R,Lc),e(R,yr),e(yr,Cc),e(R,Nc),e(R,wr),e(wr,Ac),e(R,Wc),e(R,Xo),e(Xo,Sc),e(R,Bc),e(C,Oc),e(C,Ye),e(Ye,zr),e(zr,Uc),e(Ye,Rc),e(Ye,xr),e(xr,Mc),e(Ye,jc),e(C,Vc),e(C,K),e(K,Er),e(Er,Gc),e(K,Hc),e(K,$r),e($r,Jc),e(K,Zc),e(K,Pr),e(Pr,Xc),e(K,Yc),e(K,qr),e(qr,Qc),e(K,Kc),e(C,el),e(C,ee),e(ee,Fr),e(Fr,tl),e(ee,ol),e(ee,Ir),e(Ir,nl),e(ee,rl),e(ee,Dr),e(Dr,al),e(ee,sl),e(ee,Lr),e(Lr,il),e(ee,dl),e(g,cl),e(g,Qe),m(Ft,Qe,null),e(Qe,ll),e(Qe,Cr),e(Cr,hl),e(g,pl),e(g,Ke),m(It,Ke,null),e(Ke,ml),e(Ke,Nr),e(Nr,fl),e(g,ul),e(g,ue),m(Dt,ue,null),e(ue,_l),e(ue,Ar),e(Ar,gl),e(ue,kl),e(ue,Lt),e(Lt,bl),e(Lt,Wr),e(Wr,vl),e(Lt,Tl),e(g,yl),e(g,_e),m(Ct,_e,null),e(_e,wl),e(_e,Sr),e(Sr,zl),e(_e,xl),e(_e,Nt),e(Nt,El),e(Nt,Br),e(Br,$l),e(Nt,Pl),e(g,ql),e(g,et),m(At,et,null),e(et,Fl),e(et,Ne),e(Ne,Il),e(Ne,Or),e(Or,Dl),e(Ne,Ll),e(Ne,Ur),e(Ur,Cl),e(Ne,Nl),e(g,Al),e(g,ge),m(Wt,ge,null),e(ge,Wl),e(ge,Rr),e(Rr,Sl),e(ge,Bl),m(tt,ge,null),e(g,Ol),e(g,ot),m(St,ot,null),e(ot,Ul),e(ot,Mr),e(Mr,Rl),e(g,Ml),e(g,nt),m(Bt,nt,null),e(nt,jl),e(nt,jr),e(jr,Vl),e(g,Gl),e(g,rt),m(Ot,rt,null),e(rt,Hl),e(rt,Vr),e(Vr,Jl),e(g,Zl),e(g,ke),m(Ut,ke,null),e(ke,Xl),e(ke,Gr),e(Gr,Yl),e(ke,Ql),m(at,ke,null),e(g,Kl),e(g,be),m(Rt,be,null),e(be,eh),e(be,Hr),e(Hr,th),e(be,oh),e(be,Ae),e(Ae,nh),e(Ae,Jr),e(Jr,rh),e(Ae,ah),e(Ae,Zr),e(Zr,sh),e(Ae,ih),e(g,dh),e(g,ve),m(Mt,ve,null),e(ve,ch),e(ve,Xr),e(Xr,lh),e(ve,hh),e(ve,Yr),e(Yr,ph),$(i,si,b),$(i,We,b),e(We,st),e(st,Qr),m(jt,Qr,null),e(We,mh),e(We,Kr),e(Kr,fh),$(i,ii,b),$(i,te,b),e(te,uh),e(te,Yo),e(Yo,_h),e(te,gh),e(te,Vt),e(Vt,kh),e(te,bh),e(te,Qo),e(Qo,vh),e(te,Th),$(i,di,b),$(i,k,b),m(Gt,k,null),e(k,yh),e(k,ea),e(ea,wh),e(k,zh),e(k,Ht),e(Ht,xh),e(Ht,Ko),e(Ko,Eh),e(Ht,$h),e(k,Ph),e(k,ta),e(ta,qh),e(k,Fh),e(k,oa),e(oa,Ih),e(k,Dh),e(k,na),e(na,Lh),e(k,Ch),e(k,N),e(N,Te),e(Te,ra),e(ra,Nh),e(Te,Ah),e(Te,aa),e(aa,Wh),e(Te,Sh),e(Te,sa),e(sa,Bh),e(Te,Oh),e(N,Uh),e(N,M),e(M,ia),e(ia,Rh),e(M,Mh),e(M,da),e(da,jh),e(M,Vh),e(M,ca),e(ca,Gh),e(M,Hh),e(M,la),e(la,Jh),e(M,Zh),e(M,ha),e(ha,Xh),e(M,Yh),e(N,Qh),e(N,oe),e(oe,pa),e(pa,Kh),e(oe,ep),e(oe,ma),e(ma,tp),e(oe,op),e(oe,fa),e(fa,np),e(oe,rp),e(oe,ua),e(ua,ap),e(oe,sp),e(N,ip),e(N,j),e(j,_a),e(_a,dp),e(j,cp),e(j,ga),e(ga,lp),e(j,hp),e(j,ka),e(ka,pp),e(j,mp),e(j,ba),e(ba,fp),e(j,up),e(j,en),e(en,_p),e(j,gp),e(N,kp),e(N,it),e(it,va),e(va,bp),e(it,vp),e(it,Ta),e(Ta,Tp),e(it,yp),e(N,wp),e(N,ne),e(ne,ya),e(ya,zp),e(ne,xp),e(ne,wa),e(wa,Ep),e(ne,$p),e(ne,za),e(za,Pp),e(ne,qp),e(ne,xa),e(xa,Fp),e(ne,Ip),e(N,Dp),e(N,re),e(re,Ea),e(Ea,Lp),e(re,Cp),e(re,$a),e($a,Np),e(re,Ap),e(re,Pa),e(Pa,Wp),e(re,Sp),e(re,qa),e(qa,Bp),e(re,Op),e(k,Up),e(k,dt),m(Jt,dt,null),e(dt,Rp),e(dt,Fa),e(Fa,Mp),e(k,jp),e(k,ct),m(Zt,ct,null),e(ct,Vp),e(ct,Ia),e(Ia,Gp),e(k,Hp),e(k,ye),m(Xt,ye,null),e(ye,Jp),e(ye,Da),e(Da,Zp),e(ye,Xp),e(ye,Yt),e(Yt,Yp),e(Yt,La),e(La,Qp),e(Yt,Kp),e(k,em),e(k,we),m(Qt,we,null),e(we,tm),e(we,Ca),e(Ca,om),e(we,nm),e(we,Kt),e(Kt,rm),e(Kt,Na),e(Na,am),e(Kt,sm),e(k,im),e(k,lt),m(eo,lt,null),e(lt,dm),e(lt,Se),e(Se,cm),e(Se,Aa),e(Aa,lm),e(Se,hm),e(Se,Wa),e(Wa,pm),e(Se,mm),e(k,fm),e(k,ze),m(to,ze,null),e(ze,um),e(ze,Sa),e(Sa,_m),e(ze,gm),m(ht,ze,null),e(k,km),e(k,pt),m(oo,pt,null),e(pt,bm),e(pt,Ba),e(Ba,vm),e(k,Tm),e(k,mt),m(no,mt,null),e(mt,ym),e(mt,Oa),e(Oa,wm),e(k,zm),e(k,ft),m(ro,ft,null),e(ft,xm),e(ft,Ua),e(Ua,Em),e(k,$m),e(k,xe),m(ao,xe,null),e(xe,Pm),e(xe,Ra),e(Ra,qm),e(xe,Fm),m(ut,xe,null),e(k,Im),e(k,Ee),m(so,Ee,null),e(Ee,Dm),e(Ee,Ma),e(Ma,Lm),e(Ee,Cm),e(Ee,ja),e(ja,Nm),e(k,Am),e(k,_t),m(io,_t,null),e(_t,Wm),e(_t,Va),e(Va,Sm),$(i,ci,b),$(i,Be,b),e(Be,gt),e(gt,Ga),m(co,Ga,null),e(Be,Bm),e(Be,Ha),e(Ha,Om),$(i,li,b),$(i,x,b),m(lo,x,null),e(x,Um),e(x,ie),e(ie,Rm),e(ie,ho),e(ho,Ja),e(Ja,Mm),e(ho,jm),e(ie,Vm),e(ie,tn),e(tn,Gm),e(ie,Hm),e(ie,on),e(on,Jm),e(ie,Zm),e(x,Xm),e(x,Za),e(Za,Ym),e(x,Qm),e(x,V),m(po,V,null),e(V,Km),e(V,Xa),e(Xa,ef),e(V,tf),e(V,Ya),e(Ya,of),e(V,nf),e(V,mo),e(mo,nn),e(nn,Qa),e(Qa,rf),e(nn,af),e(mo,sf),e(mo,rn),e(rn,Ka),e(Ka,df),e(rn,cf),e(V,lf),e(V,es),e(es,hf),e(x,pf),e(x,G),m(fo,G,null),e(G,mf),e(G,ts),e(ts,ff),e(G,uf),e(G,os),e(os,_f),e(G,gf),e(G,uo),e(uo,an),e(an,ns),e(ns,kf),e(an,bf),e(uo,vf),e(uo,sn),e(sn,rs),e(rs,Tf),e(sn,yf),e(G,wf),e(G,as),e(as,zf),e(x,xf),e(x,kt),m(_o,kt,null),e(kt,Ef),e(kt,ss),e(ss,$f),e(x,Pf),e(x,$e),m(go,$e,null),e($e,qf),e($e,is),e(is,Ff),e($e,If),e($e,Oe),e(Oe,dn),e(dn,ds),e(ds,Df),e(dn,Lf),e(Oe,Cf),e(Oe,cn),e(cn,cs),e(cs,Nf),e(cn,Af),e(Oe,Wf),e(Oe,ln),e(ln,ls),e(ls,Sf),e(ln,Bf),e(x,Of),e(x,bt),m(ko,bt,null),e(bt,Uf),e(bt,bo),e(bo,Rf),e(bo,hs),e(hs,Mf),e(bo,jf),e(x,Vf),e(x,W),m(vo,W,null),e(W,Gf),e(W,ps),e(ps,Hf),e(W,Jf),e(W,To),e(To,Zf),e(To,hn),e(hn,Xf),e(To,Yf),e(W,Qf),e(W,yo),e(yo,pn),e(pn,ms),e(ms,Kf),e(pn,eu),e(yo,tu),e(yo,mn),e(mn,fs),e(fs,ou),e(mn,nu),e(W,ru),e(W,us),e(us,au),e(W,su),e(W,wo),e(wo,fn),e(fn,_s),e(_s,iu),e(fn,du),e(wo,cu),e(wo,un),e(un,gs),e(gs,lu),e(un,hu),e(x,pu),e(x,H),m(zo,H,null),e(H,mu),e(H,Ue),e(Ue,fu),e(Ue,ks),e(ks,uu),e(Ue,_u),e(Ue,bs),e(bs,gu),e(Ue,ku),e(H,bu),e(H,vs),e(vs,vu),e(H,Tu),e(H,xo),e(xo,_n),e(_n,Ts),e(Ts,yu),e(_n,wu),e(xo,zu),e(xo,gn),e(gn,ys),e(ys,xu),e(gn,Eu),e(H,$u),e(H,ws),e(ws,Pu),e(x,qu),e(x,J),m(Eo,J,null),e(J,Fu),e(J,zs),e(zs,Iu),e(J,Du),e(J,xs),e(xs,Lu),e(J,Cu),e(J,$o),e($o,kn),e(kn,Es),e(Es,Nu),e(kn,Au),e($o,Wu),e($o,bn),e(bn,$s),e($s,Su),e(bn,Bu),e(J,Ou),e(J,Ps),e(Ps,Uu),e(x,Ru),e(x,vt),m(Po,vt,null),e(vt,Mu),e(vt,qs),e(qs,ju),e(x,Vu),e(x,Tt),m(qo,Tt,null),e(Tt,Gu),e(Tt,Fs),e(Fs,Hu),e(x,Ju),e(x,S),m(Fo,S,null),e(S,Zu),e(S,Is),e(Is,Xu),e(S,Yu),e(S,Ds),e(Ds,Qu),e(S,Ku),e(S,Io),e(Io,Ls),e(Ls,e_),e(Io,t_),e(Io,Cs),e(Cs,o_),e(S,n_),e(S,Ns),e(Ns,r_),e(S,a_),e(S,Do),e(Do,vn),e(vn,As),e(As,s_),e(vn,i_),e(Do,d_),e(Do,Tn),e(Tn,Ws),e(Ws,c_),e(Tn,l_),e(x,h_),e(x,D),m(Lo,D,null),e(D,p_),e(D,Ss),e(Ss,m_),e(D,f_),e(D,Co),e(Co,u_),e(Co,yn),e(yn,__),e(Co,g_),e(D,k_),e(D,No),e(No,wn),e(wn,Bs),e(Bs,b_),e(wn,v_),e(No,T_),e(No,zn),e(zn,Os),e(Os,y_),e(zn,w_),e(D,z_),e(D,Us),e(Us,x_),e(D,E_),e(D,Ao),e(Ao,xn),e(xn,Rs),e(Rs,$_),e(xn,P_),e(Ao,q_),e(Ao,En),e(En,Ms),e(Ms,F_),e(En,I_),e(D,D_),e(D,js),e(js,L_),e(x,C_),e(x,yt),m(Wo,yt,null),e(yt,N_),e(yt,Vs),e(Vs,A_),hi=!0},p(i,[b]){const So={};b&2&&(So.$$scope={dirty:b,ctx:i}),tt.$set(So);const Gs={};b&2&&(Gs.$$scope={dirty:b,ctx:i}),at.$set(Gs);const Hs={};b&2&&(Hs.$$scope={dirty:b,ctx:i}),ht.$set(Hs);const Js={};b&2&&(Js.$$scope={dirty:b,ctx:i}),ut.$set(Js)},i(i){hi||(f(T.$$.fragment,i),f($t.$$.fragment,i),f(Pt.$$.fragment,i),f(Ft.$$.fragment,i),f(It.$$.fragment,i),f(Dt.$$.fragment,i),f(Ct.$$.fragment,i),f(At.$$.fragment,i),f(Wt.$$.fragment,i),f(tt.$$.fragment,i),f(St.$$.fragment,i),f(Bt.$$.fragment,i),f(Ot.$$.fragment,i),f(Ut.$$.fragment,i),f(at.$$.fragment,i),f(Rt.$$.fragment,i),f(Mt.$$.fragment,i),f(jt.$$.fragment,i),f(Gt.$$.fragment,i),f(Jt.$$.fragment,i),f(Zt.$$.fragment,i),f(Xt.$$.fragment,i),f(Qt.$$.fragment,i),f(eo.$$.fragment,i),f(to.$$.fragment,i),f(ht.$$.fragment,i),f(oo.$$.fragment,i),f(no.$$.fragment,i),f(ro.$$.fragment,i),f(ao.$$.fragment,i),f(ut.$$.fragment,i),f(so.$$.fragment,i),f(io.$$.fragment,i),f(co.$$.fragment,i),f(lo.$$.fragment,i),f(po.$$.fragment,i),f(fo.$$.fragment,i),f(_o.$$.fragment,i),f(go.$$.fragment,i),f(ko.$$.fragment,i),f(vo.$$.fragment,i),f(zo.$$.fragment,i),f(Eo.$$.fragment,i),f(Po.$$.fragment,i),f(qo.$$.fragment,i),f(Fo.$$.fragment,i),f(Lo.$$.fragment,i),f(Wo.$$.fragment,i),hi=!0)},o(i){u(T.$$.fragment,i),u($t.$$.fragment,i),u(Pt.$$.fragment,i),u(Ft.$$.fragment,i),u(It.$$.fragment,i),u(Dt.$$.fragment,i),u(Ct.$$.fragment,i),u(At.$$.fragment,i),u(Wt.$$.fragment,i),u(tt.$$.fragment,i),u(St.$$.fragment,i),u(Bt.$$.fragment,i),u(Ot.$$.fragment,i),u(Ut.$$.fragment,i),u(at.$$.fragment,i),u(Rt.$$.fragment,i),u(Mt.$$.fragment,i),u(jt.$$.fragment,i),u(Gt.$$.fragment,i),u(Jt.$$.fragment,i),u(Zt.$$.fragment,i),u(Xt.$$.fragment,i),u(Qt.$$.fragment,i),u(eo.$$.fragment,i),u(to.$$.fragment,i),u(ht.$$.fragment,i),u(oo.$$.fragment,i),u(no.$$.fragment,i),u(ro.$$.fragment,i),u(ao.$$.fragment,i),u(ut.$$.fragment,i),u(so.$$.fragment,i),u(io.$$.fragment,i),u(co.$$.fragment,i),u(lo.$$.fragment,i),u(po.$$.fragment,i),u(fo.$$.fragment,i),u(_o.$$.fragment,i),u(go.$$.fragment,i),u(ko.$$.fragment,i),u(vo.$$.fragment,i),u(zo.$$.fragment,i),u(Eo.$$.fragment,i),u(Po.$$.fragment,i),u(qo.$$.fragment,i),u(Fo.$$.fragment,i),u(Lo.$$.fragment,i),u(Wo.$$.fragment,i),hi=!1},d(i){t(z),i&&t(I),i&&t(q),_(T),i&&t(Qs),i&&t(Je),i&&t(Ks),i&&t(Ze),i&&t(ei),i&&t(O),i&&t(ti),i&&t(Le),i&&t(oi),i&&t(me),i&&t(ni),i&&t(F),i&&t(ri),i&&t(Ce),_($t),i&&t(ai),i&&t(g),_(Pt),_(Ft),_(It),_(Dt),_(Ct),_(At),_(Wt),_(tt),_(St),_(Bt),_(Ot),_(Ut),_(at),_(Rt),_(Mt),i&&t(si),i&&t(We),_(jt),i&&t(ii),i&&t(te),i&&t(di),i&&t(k),_(Gt),_(Jt),_(Zt),_(Xt),_(Qt),_(eo),_(to),_(ht),_(oo),_(no),_(ro),_(ao),_(ut),_(so),_(io),i&&t(ci),i&&t(Be),_(co),i&&t(li),i&&t(x),_(lo),_(po),_(fo),_(_o),_(go),_(ko),_(vo),_(zo),_(Eo),_(Po),_(qo),_(Fo),_(Lo),_(Wo)}}}const Mv={local:"tokenizer",sections:[{local:"transformers.PreTrainedTokenizer",title:"PreTrainedTokenizer"},{local:"transformers.PreTrainedTokenizerFast",title:"PreTrainedTokenizerFast"},{local:"transformers.BatchEncoding",title:"BatchEncoding"}],title:"Tokenizer"};function jv(pe){return Wv(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yv extends Lv{constructor(z){super();Cv(this,z,jv,Rv,Nv,{})}}export{Yv as default,Mv as metadata};
