import{S as tv,i as nv,s as ov,e as r,k as d,w as h,t as n,M as rv,c as a,d as t,m as c,a as s,x as p,h as o,b as l,G as e,g as $,y as m,q as f,o as u,B as _,v as av,L as Kb}from"../../chunks/vendor-hf-doc-builder.js";import{T as Yb}from"../../chunks/Tip-hf-doc-builder.js";import{D as T}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ev}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Oi}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Qb}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function sv(pe){let y,F,q,E,W;return E=new ev({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(){y=r("p"),F=n("Examples:"),q=d(),h(E.$$.fragment)},l(v){y=a(v,"P",{});var D=s(y);F=o(D,"Examples:"),D.forEach(t),q=c(v),p(E.$$.fragment,v)},m(v,D){$(v,y,D),e(y,F),$(v,q,D),m(E,v,D),W=!0},p:Kb,i(v){W||(f(E.$$.fragment,v),W=!0)},o(v){u(E.$$.fragment,v),W=!1},d(v){v&&t(y),v&&t(q),_(E,v)}}}function iv(pe){let y,F;return{c(){y=r("p"),F=n(`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){y=a(q,"P",{});var E=s(y);F=o(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,y,E),e(y,F)},d(q){q&&t(y)}}}function dv(pe){let y,F,q,E,W;return E=new ev({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(){y=r("p"),F=n("Examples:"),q=d(),h(E.$$.fragment)},l(v){y=a(v,"P",{});var D=s(y);F=o(D,"Examples:"),D.forEach(t),q=c(v),p(E.$$.fragment,v)},m(v,D){$(v,y,D),e(y,F),$(v,q,D),m(E,v,D),W=!0},p:Kb,i(v){W||(f(E.$$.fragment,v),W=!0)},o(v){u(E.$$.fragment,v),W=!1},d(v){v&&t(y),v&&t(q),_(E,v)}}}function cv(pe){let y,F;return{c(){y=r("p"),F=n(`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){y=a(q,"P",{});var E=s(y);F=o(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,y,E),e(y,F)},d(q){q&&t(y)}}}function lv(pe){let y,F,q,E,W,v,D,So,Ui,Os,je,Ri,Tt,Mi,Vi,Us,He,Bo,Gi,ji,Wo,Hi,Rs,O,Zi,Cn,Ji,Xi,An,Yi,Qi,Sn,Ki,ed,Bn,td,nd,Ms,De,Wn,od,rd,On,ad,sd,Vs,me,Oo,id,dd,Uo,cd,ld,Ro,hd,Gs,I,Un,pd,md,Rn,fd,ud,Mo,_d,gd,Vo,kd,bd,Go,vd,Td,jo,yd,wd,Ho,zd,xd,yt,Ed,$d,js,Ne,Ze,Zo,wt,Pd,Jo,qd,Hs,g,zt,Id,Xo,Fd,Ld,xt,Dd,Mn,Nd,Cd,Ad,Yo,Sd,Bd,Qo,Wd,Od,Ko,Ud,Rd,N,fe,er,Md,Vd,tr,Gd,jd,nr,Hd,Zd,Jd,U,or,Xd,Yd,rr,Qd,Kd,ar,ec,tc,sr,nc,oc,ir,rc,ac,sc,Q,dr,ic,dc,cr,cc,lc,lr,hc,pc,hr,mc,fc,uc,R,pr,_c,gc,mr,kc,bc,fr,vc,Tc,ur,yc,wc,Vn,zc,xc,Ec,Je,_r,$c,Pc,gr,qc,Ic,Fc,K,kr,Lc,Dc,br,Nc,Cc,vr,Ac,Sc,Tr,Bc,Wc,Oc,ee,yr,Uc,Rc,wr,Mc,Vc,zr,Gc,jc,xr,Hc,Zc,Jc,Xe,Et,Xc,Er,Yc,Qc,Ye,$t,Kc,$r,el,tl,ue,Pt,nl,Pr,ol,rl,qt,al,qr,sl,il,dl,_e,It,cl,Ir,ll,hl,Ft,pl,Fr,ml,fl,ul,ge,Lt,_l,Lr,gl,kl,Qe,bl,Ke,Dt,vl,Dr,Tl,yl,et,Nt,wl,Nr,zl,xl,tt,Ct,El,Cr,$l,Pl,ke,At,ql,Ar,Il,Fl,nt,Ll,be,St,Dl,Sr,Nl,Cl,Ce,Al,Br,Sl,Bl,Wr,Wl,Ol,Ul,ve,Bt,Rl,Or,Ml,Vl,Ur,Gl,Zs,Ae,ot,Rr,Wt,jl,Mr,Hl,Js,te,Zl,Gn,Jl,Xl,Ot,Yl,Ql,jn,Kl,eh,Xs,k,Ut,th,Vr,nh,oh,Rt,rh,Hn,ah,sh,ih,Gr,dh,ch,jr,lh,hh,Hr,ph,mh,C,Te,Zr,fh,uh,Jr,_h,gh,Xr,kh,bh,vh,M,Yr,Th,yh,Qr,wh,zh,Kr,xh,Eh,ea,$h,Ph,ta,qh,Ih,Fh,ne,na,Lh,Dh,oa,Nh,Ch,ra,Ah,Sh,aa,Bh,Wh,Oh,V,sa,Uh,Rh,ia,Mh,Vh,da,Gh,jh,ca,Hh,Zh,Zn,Jh,Xh,Yh,rt,la,Qh,Kh,ha,ep,tp,np,oe,pa,op,rp,ma,ap,sp,fa,ip,dp,ua,cp,lp,hp,re,_a,pp,mp,ga,fp,up,ka,_p,gp,ba,kp,bp,vp,at,Mt,Tp,va,yp,wp,st,Vt,zp,Ta,xp,Ep,ye,Gt,$p,ya,Pp,qp,jt,Ip,wa,Fp,Lp,Dp,we,Ht,Np,za,Cp,Ap,Zt,Sp,xa,Bp,Wp,Op,ze,Jt,Up,Ea,Rp,Mp,it,Vp,dt,Xt,Gp,$a,jp,Hp,ct,Yt,Zp,Pa,Jp,Xp,lt,Qt,Yp,qa,Qp,Kp,xe,Kt,em,Ia,tm,nm,ht,om,Ee,en,rm,Fa,am,sm,La,im,dm,pt,tn,cm,Da,lm,Ys,Se,mt,Na,nn,hm,Ca,pm,Qs,w,on,mm,ie,fm,rn,Aa,um,_m,gm,Jn,km,bm,Xn,vm,Tm,ym,Sa,wm,zm,G,an,xm,Ba,Em,$m,Wa,Pm,qm,sn,Yn,Oa,Im,Fm,Lm,Qn,Ua,Dm,Nm,Cm,Ra,Am,Sm,j,dn,Bm,Ma,Wm,Om,Va,Um,Rm,cn,Kn,Ga,Mm,Vm,Gm,eo,ja,jm,Hm,Zm,Ha,Jm,Xm,ft,ln,Ym,Za,Qm,Km,$e,hn,ef,Ja,tf,nf,Be,to,Xa,of,rf,af,no,Ya,sf,df,cf,oo,Qa,lf,hf,pf,ut,pn,mf,mn,ff,Ka,uf,_f,gf,S,fn,kf,es,bf,vf,un,Tf,ro,yf,wf,zf,_n,ao,ts,xf,Ef,$f,so,ns,Pf,qf,If,os,Ff,Lf,gn,io,rs,Df,Nf,Cf,co,as,Af,Sf,Bf,H,kn,Wf,We,Of,ss,Uf,Rf,is,Mf,Vf,Gf,ds,jf,Hf,bn,lo,cs,Zf,Jf,Xf,ho,ls,Yf,Qf,Kf,hs,eu,tu,Z,vn,nu,ps,ou,ru,ms,au,su,Tn,po,fs,iu,du,cu,mo,us,lu,hu,pu,_s,mu,fu,_t,yn,uu,gs,_u,gu,gt,wn,ku,ks,bu,vu,B,zn,Tu,bs,yu,wu,vs,zu,xu,xn,Ts,Eu,$u,ys,Pu,qu,ws,Iu,Fu,En,fo,zs,Lu,Du,Nu,uo,xs,Cu,Au,Su,L,$n,Bu,Es,Wu,Ou,Pn,Uu,_o,Ru,Mu,Vu,qn,go,$s,Gu,ju,Hu,ko,Ps,Zu,Ju,Xu,qs,Yu,Qu,In,bo,Is,Ku,e_,t_,vo,Fs,n_,o_,r_,Ls,a_,s_,kt,Fn,i_,Ds,d_,Ks;return v=new Oi({}),wt=new Oi({}),zt=new T({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.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils.py#L333"}}),Et=new T({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#L2520",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>
`}}),$t=new T({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#L3478",returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Pt=new T({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#L3512",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),It=new T({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#L2328",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>
`}}),Lt=new T({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:"**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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/hub.py#L776"}}),Qe=new Qb({props:{anchor:"transformers.PreTrainedTokenizer.push_to_hub.example",$$slots:{default:[sv]},$$scope:{ctx:pe}}}),Dt=new T({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#L883",returnDescription:`
<p>The decoded token(s).</p>
`,returnType:`
<p><code>str</code> or <code>List[str]</code></p>
`}}),Nt=new T({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#L560",returnDescription:`
<p>The token id or list of token ids.</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),Ct=new T({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>
`}}),At=new T({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>
`}}),nt=new Yb({props:{$$slots:{default:[iv]},$$scope:{ctx:pe}}}),St=new T({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#L821",returnDescription:`
<p>The prepared text and the unused kwargs.</p>
`,returnType:`
<p><code>Tuple[str, Dict[str, Any]]</code></p>
`}}),Bt=new T({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>
`}}),Wt=new Oi({}),Ut=new T({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.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.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"}}),Mt=new T({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#L2520",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>
`}}),Vt=new T({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#L3478",returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Gt=new T({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#L3512",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),Ht=new T({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#L2328",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>
`}}),Jt=new T({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:"**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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/hub.py#L776"}}),it=new Qb({props:{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.example",$$slots:{default:[dv]},$$scope:{ctx:pe}}}),Xt=new T({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#L310",returnDescription:`
<p>The decoded token(s).</p>
`,returnType:`
<p><code>str</code> or <code>List[str]</code></p>
`}}),Yt=new T({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#L255",returnDescription:`
<p>The token id or list of token ids.</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),Qt=new T({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#L176",returnDescription:`
<p>The added tokens.</p>
`,returnType:`
<p><code>Dict[str, int]</code></p>
`}}),Kt=new T({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#L289",returnDescription:`
<p>Number of special tokens added to sequences.</p>
`,returnType:`
<p><code>int</code></p>
`}}),ht=new Yb({props:{$$slots:{default:[cv]},$$scope:{ctx:pe}}}),en=new T({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#L339"}}),tn=new T({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#L627",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>
`}}),nn=new Oi({}),on=new T({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#L164"}}),an=new T({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#L543",returnDescription:`
<p>Index of the token.</p>
`,returnType:`
<p><code>int</code></p>
`}}),dn=new T({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#L629",returnDescription:`
<p>Index or indices of the associated encoded token(s).</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),ln=new T({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#L668"}}),hn=new T({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#L307",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>
`}}),pn=new T({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#L761",returnDescription:`
<p>The same instance after modification.</p>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),fn=new T({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#L504",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>
`}}),kn=new T({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#L374",returnDescription:`
<p>Index of the word in the input sequence.</p>
`,returnType:`
<p><code>int</code></p>
`}}),vn=new T({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#L413",returnDescription:`
<p>Index of the word in the input sequence.</p>
`,returnType:`
<p><code>int</code></p>
`}}),yn=new T({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#L289",returnDescription:`
<p>The list of tokens at that index.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),wn=new T({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#L355",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>
`}}),zn=new T({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#L584",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>
`}}),$n=new T({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#L451",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>
`}}),Fn=new T({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#L331",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(){y=r("meta"),F=d(),q=r("h1"),E=r("a"),W=r("span"),h(v.$$.fragment),D=d(),So=r("span"),Ui=n("Tokenizer"),Os=d(),je=r("p"),Ri=n(`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 `),Tt=r("a"),Mi=n("\u{1F917} Tokenizers"),Vi=n(". The \u201CFast\u201D implementations allows:"),Us=d(),He=r("ol"),Bo=r("li"),Gi=n("a significant speed-up in particular when doing batched tokenization and"),ji=d(),Wo=r("li"),Hi=n(`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).`),Rs=d(),O=r("p"),Zi=n("The base classes "),Cn=r("a"),Ji=n("PreTrainedTokenizer"),Xi=n(" and "),An=r("a"),Yi=n("PreTrainedTokenizerFast"),Qi=n(`
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
`),Sn=r("a"),Ki=n("PreTrainedTokenizerBase"),ed=n(` that contains the common methods, and
`),Bn=r("a"),td=n("SpecialTokensMixin"),nd=n("."),Ms=d(),De=r("p"),Wn=r("a"),od=n("PreTrainedTokenizer"),rd=n(" and "),On=r("a"),ad=n("PreTrainedTokenizerFast"),sd=n(` thus implement the main
methods for using all the tokenizers:`),Vs=d(),me=r("ul"),Oo=r("li"),id=n(`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).`),dd=d(),Uo=r("li"),cd=n("Adding new tokens to the vocabulary in a way that is independent of the underlying structure (BPE, SentencePiece\u2026)."),ld=d(),Ro=r("li"),hd=n(`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.`),Gs=d(),I=r("p"),Un=r("a"),pd=n("BatchEncoding"),md=n(` holds the output of the
`),Rn=r("a"),fd=n("PreTrainedTokenizerBase"),ud=n("\u2019s encoding methods ("),Mo=r("code"),_d=n("__call__"),gd=n(`,
`),Vo=r("code"),kd=n("encode_plus"),bd=n(" and "),Go=r("code"),vd=n("batch_encode_plus"),Td=n(`) 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 (`),jo=r("code"),yd=n("input_ids"),wd=n(", "),Ho=r("code"),zd=n("attention_mask"),xd=n(`\u2026). When the tokenizer is a \u201CFast\u201D tokenizer (i.e., backed by
HuggingFace `),yt=r("a"),Ed=n("tokenizers library"),$d=n(`), 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).`),js=d(),Ne=r("h2"),Ze=r("a"),Zo=r("span"),h(wt.$$.fragment),Pd=d(),Jo=r("span"),qd=n("PreTrainedTokenizer"),Hs=d(),g=r("div"),h(zt.$$.fragment),Id=d(),Xo=r("p"),Fd=n("Base class for all slow tokenizers."),Ld=d(),xt=r("p"),Dd=n("Inherits from "),Mn=r("a"),Nd=n("PreTrainedTokenizerBase"),Cd=n("."),Ad=d(),Yo=r("p"),Sd=n(`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.`),Bd=d(),Qo=r("p"),Wd=n(`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).`),Od=d(),Ko=r("p"),Ud=n("Class attributes (overridden by derived classes)"),Rd=d(),N=r("ul"),fe=r("li"),er=r("strong"),Md=n("vocab_files_names"),Vd=n(" ("),tr=r("code"),Gd=n("Dict[str, str]"),jd=n(") \u2014 A dictionary with, as keys, the "),nr=r("code"),Hd=n("__init__"),Zd=n(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Jd=d(),U=r("li"),or=r("strong"),Xd=n("pretrained_vocab_files_map"),Yd=n(" ("),rr=r("code"),Qd=n("Dict[str, Dict[str, str]]"),Kd=n(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),ar=r("code"),ec=n("__init__"),tc=n(` keyword name of each vocabulary file required by the model, the
low-level being the `),sr=r("code"),nc=n("short-cut-names"),oc=n(" of the pretrained models with, as associated values, the "),ir=r("code"),rc=n("url"),ac=n(` to the
associated pretrained vocabulary file.`),sc=d(),Q=r("li"),dr=r("strong"),ic=n("max_model_input_sizes"),dc=n(" ("),cr=r("code"),cc=n("Dict[str, Optional[int]]"),lc=n(") \u2014 A dictionary with, as keys, the "),lr=r("code"),hc=n("short-cut-names"),pc=n(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),hr=r("code"),mc=n("None"),fc=n(" if the model has no maximum input size."),uc=d(),R=r("li"),pr=r("strong"),_c=n("pretrained_init_configuration"),gc=n(" ("),mr=r("code"),kc=n("Dict[str, Dict[str, Any]]"),bc=n(`) \u2014 A dictionary with, as keys, the
`),fr=r("code"),vc=n("short-cut-names"),Tc=n(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ur=r("code"),yc=n("__init__"),wc=n(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Vn=r("a"),zc=n("from_pretrained()"),xc=n(" method."),Ec=d(),Je=r("li"),_r=r("strong"),$c=n("model_input_names"),Pc=n(" ("),gr=r("code"),qc=n("List[str]"),Ic=n(") \u2014 A list of inputs expected in the forward pass of the model."),Fc=d(),K=r("li"),kr=r("strong"),Lc=n("padding_side"),Dc=n(" ("),br=r("code"),Nc=n("str"),Cc=n(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),vr=r("code"),Ac=n("'right'"),Sc=n(" or "),Tr=r("code"),Bc=n("'left'"),Wc=n("."),Oc=d(),ee=r("li"),yr=r("strong"),Uc=n("truncation_side"),Rc=n(" ("),wr=r("code"),Mc=n("str"),Vc=n(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),zr=r("code"),Gc=n("'right'"),jc=n(" or "),xr=r("code"),Hc=n("'left'"),Zc=n("."),Jc=d(),Xe=r("div"),h(Et.$$.fragment),Xc=d(),Er=r("p"),Yc=n(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Qc=d(),Ye=r("div"),h($t.$$.fragment),Kc=d(),$r=r("p"),el=n("Convert a list of lists of token ids into a list of strings by calling decode."),tl=d(),ue=r("div"),h(Pt.$$.fragment),nl=d(),Pr=r("p"),ol=n(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),rl=d(),qt=r("p"),al=n("Similar to doing "),qr=r("code"),sl=n("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),il=n("."),dl=d(),_e=r("div"),h(It.$$.fragment),cl=d(),Ir=r("p"),ll=n("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),hl=d(),Ft=r("p"),pl=n("Same as doing "),Fr=r("code"),ml=n("self.convert_tokens_to_ids(self.tokenize(text))"),fl=n("."),ul=d(),ge=r("div"),h(Lt.$$.fragment),_l=d(),Lr=r("p"),gl=n("Upload the tokenizer files to the \u{1F917} Model Hub."),kl=d(),h(Qe.$$.fragment),bl=d(),Ke=r("div"),h(Dt.$$.fragment),vl=d(),Dr=r("p"),Tl=n(`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),yl=d(),et=r("div"),h(Nt.$$.fragment),wl=d(),Nr=r("p"),zl=n(`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),xl=d(),tt=r("div"),h(Ct.$$.fragment),El=d(),Cr=r("p"),$l=n("Returns the added tokens in the vocabulary as a dictionary of token to index."),Pl=d(),ke=r("div"),h(At.$$.fragment),ql=d(),Ar=r("p"),Il=n("Returns the number of added tokens when encoding a sequence with special tokens."),Fl=d(),h(nt.$$.fragment),Ll=d(),be=r("div"),h(St.$$.fragment),Dl=d(),Sr=r("p"),Nl=n("Performs any necessary transformations before tokenization."),Cl=d(),Ce=r("p"),Al=n("This method should pop the arguments from kwargs and return the remaining "),Br=r("code"),Sl=n("kwargs"),Bl=n(` as well. We test the
`),Wr=r("code"),Wl=n("kwargs"),Ol=n(" at the end of the encoding process to be sure all the arguments have been used."),Ul=d(),ve=r("div"),h(Bt.$$.fragment),Rl=d(),Or=r("p"),Ml=n("Converts a string in a sequence of tokens, using the tokenizer."),Vl=d(),Ur=r("p"),Gl=n(`Split in words for word-based vocabulary or sub-words for sub-word-based vocabularies
(BPE/SentencePieces/WordPieces). Takes care of added tokens.`),Zs=d(),Ae=r("h2"),ot=r("a"),Rr=r("span"),h(Wt.$$.fragment),jl=d(),Mr=r("span"),Hl=n("PreTrainedTokenizerFast"),Js=d(),te=r("p"),Zl=n("The "),Gn=r("a"),Jl=n("PreTrainedTokenizerFast"),Xl=n(" depend on the "),Ot=r("a"),Yl=n("tokenizers"),Ql=n(` library. The tokenizers obtained from the \u{1F917} tokenizers library can be
loaded very simply into \u{1F917} transformers. Take a look at the `),jn=r("a"),Kl=n("Using tokenizers from \u{1F917} tokenizers"),eh=n(" page to understand how this is done."),Xs=d(),k=r("div"),h(Ut.$$.fragment),th=d(),Vr=r("p"),nh=n("Base class for all fast tokenizers (wrapping HuggingFace tokenizers library)."),oh=d(),Rt=r("p"),rh=n("Inherits from "),Hn=r("a"),ah=n("PreTrainedTokenizerBase"),sh=n("."),ih=d(),Gr=r("p"),dh=n(`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.`),ch=d(),jr=r("p"),lh=n(`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).`),hh=d(),Hr=r("p"),ph=n("Class attributes (overridden by derived classes)"),mh=d(),C=r("ul"),Te=r("li"),Zr=r("strong"),fh=n("vocab_files_names"),uh=n(" ("),Jr=r("code"),_h=n("Dict[str, str]"),gh=n(") \u2014 A dictionary with, as keys, the "),Xr=r("code"),kh=n("__init__"),bh=n(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),vh=d(),M=r("li"),Yr=r("strong"),Th=n("pretrained_vocab_files_map"),yh=n(" ("),Qr=r("code"),wh=n("Dict[str, Dict[str, str]]"),zh=n(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),Kr=r("code"),xh=n("__init__"),Eh=n(` keyword name of each vocabulary file required by the model, the
low-level being the `),ea=r("code"),$h=n("short-cut-names"),Ph=n(" of the pretrained models with, as associated values, the "),ta=r("code"),qh=n("url"),Ih=n(` to the
associated pretrained vocabulary file.`),Fh=d(),ne=r("li"),na=r("strong"),Lh=n("max_model_input_sizes"),Dh=n(" ("),oa=r("code"),Nh=n("Dict[str, Optional[int]]"),Ch=n(") \u2014 A dictionary with, as keys, the "),ra=r("code"),Ah=n("short-cut-names"),Sh=n(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),aa=r("code"),Bh=n("None"),Wh=n(" if the model has no maximum input size."),Oh=d(),V=r("li"),sa=r("strong"),Uh=n("pretrained_init_configuration"),Rh=n(" ("),ia=r("code"),Mh=n("Dict[str, Dict[str, Any]]"),Vh=n(`) \u2014 A dictionary with, as keys, the
`),da=r("code"),Gh=n("short-cut-names"),jh=n(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ca=r("code"),Hh=n("__init__"),Zh=n(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Zn=r("a"),Jh=n("from_pretrained()"),Xh=n(" method."),Yh=d(),rt=r("li"),la=r("strong"),Qh=n("model_input_names"),Kh=n(" ("),ha=r("code"),ep=n("List[str]"),tp=n(") \u2014 A list of inputs expected in the forward pass of the model."),np=d(),oe=r("li"),pa=r("strong"),op=n("padding_side"),rp=n(" ("),ma=r("code"),ap=n("str"),sp=n(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),fa=r("code"),ip=n("'right'"),dp=n(" or "),ua=r("code"),cp=n("'left'"),lp=n("."),hp=d(),re=r("li"),_a=r("strong"),pp=n("truncation_side"),mp=n(" ("),ga=r("code"),fp=n("str"),up=n(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),ka=r("code"),_p=n("'right'"),gp=n(" or "),ba=r("code"),kp=n("'left'"),bp=n("."),vp=d(),at=r("div"),h(Mt.$$.fragment),Tp=d(),va=r("p"),yp=n(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),wp=d(),st=r("div"),h(Vt.$$.fragment),zp=d(),Ta=r("p"),xp=n("Convert a list of lists of token ids into a list of strings by calling decode."),Ep=d(),ye=r("div"),h(Gt.$$.fragment),$p=d(),ya=r("p"),Pp=n(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),qp=d(),jt=r("p"),Ip=n("Similar to doing "),wa=r("code"),Fp=n("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Lp=n("."),Dp=d(),we=r("div"),h(Ht.$$.fragment),Np=d(),za=r("p"),Cp=n("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Ap=d(),Zt=r("p"),Sp=n("Same as doing "),xa=r("code"),Bp=n("self.convert_tokens_to_ids(self.tokenize(text))"),Wp=n("."),Op=d(),ze=r("div"),h(Jt.$$.fragment),Up=d(),Ea=r("p"),Rp=n("Upload the tokenizer files to the \u{1F917} Model Hub."),Mp=d(),h(it.$$.fragment),Vp=d(),dt=r("div"),h(Xt.$$.fragment),Gp=d(),$a=r("p"),jp=n(`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Hp=d(),ct=r("div"),h(Yt.$$.fragment),Zp=d(),Pa=r("p"),Jp=n(`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Xp=d(),lt=r("div"),h(Qt.$$.fragment),Yp=d(),qa=r("p"),Qp=n("Returns the added tokens in the vocabulary as a dictionary of token to index."),Kp=d(),xe=r("div"),h(Kt.$$.fragment),em=d(),Ia=r("p"),tm=n("Returns the number of added tokens when encoding a sequence with special tokens."),nm=d(),h(ht.$$.fragment),om=d(),Ee=r("div"),h(en.$$.fragment),rm=d(),Fa=r("p"),am=n(`Define the truncation and the padding strategies for fast tokenizers (provided by HuggingFace tokenizers
library) and restore the tokenizer settings afterwards.`),sm=d(),La=r("p"),im=n(`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.`),dm=d(),pt=r("div"),h(tn.$$.fragment),cm=d(),Da=r("p"),lm=n(`Trains a tokenizer on a new corpus with the same defaults (in terms of special tokens or tokenization pipeline)
as the current one.`),Ys=d(),Se=r("h2"),mt=r("a"),Na=r("span"),h(nn.$$.fragment),hm=d(),Ca=r("span"),pm=n("BatchEncoding"),Qs=d(),w=r("div"),h(on.$$.fragment),mm=d(),ie=r("p"),fm=n("Holds the output of the "),rn=r("a"),Aa=r("strong"),um=n("call"),_m=n("()"),gm=n(`,
`),Jn=r("a"),km=n("encode_plus()"),bm=n(` and
`),Xn=r("a"),vm=n("batch_encode_plus()"),Tm=n(" methods (tokens, attention_masks, etc)."),ym=d(),Sa=r("p"),wm=n(`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.`),zm=d(),G=r("div"),h(an.$$.fragment),xm=d(),Ba=r("p"),Em=n(`Get the index of the token in the encoded output comprising a character in the original string for a sequence
of the batch.`),$m=d(),Wa=r("p"),Pm=n("Can be called as:"),qm=d(),sn=r("ul"),Yn=r("li"),Oa=r("code"),Im=n("self.char_to_token(char_index)"),Fm=n(" if batch size is 1"),Lm=d(),Qn=r("li"),Ua=r("code"),Dm=n("self.char_to_token(batch_index, char_index)"),Nm=n(" if batch size is greater or equal to 1"),Cm=d(),Ra=r("p"),Am=n(`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.`),Sm=d(),j=r("div"),h(dn.$$.fragment),Bm=d(),Ma=r("p"),Wm=n(`Get the word in the original string corresponding to a character in the original string of a sequence of the
batch.`),Om=d(),Va=r("p"),Um=n("Can be called as:"),Rm=d(),cn=r("ul"),Kn=r("li"),Ga=r("code"),Mm=n("self.char_to_word(char_index)"),Vm=n(" if batch size is 1"),Gm=d(),eo=r("li"),ja=r("code"),jm=n("self.char_to_word(batch_index, char_index)"),Hm=n(" if batch size is greater than 1"),Zm=d(),Ha=r("p"),Jm=n(`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.`),Xm=d(),ft=r("div"),h(ln.$$.fragment),Ym=d(),Za=r("p"),Qm=n("Convert the inner content to tensors."),Km=d(),$e=r("div"),h(hn.$$.fragment),ef=d(),Ja=r("p"),tf=n("Return a list mapping the tokens to the id of their original sentences:"),nf=d(),Be=r("ul"),to=r("li"),Xa=r("code"),of=n("None"),rf=n(" for special tokens added around or between sequences,"),af=d(),no=r("li"),Ya=r("code"),sf=n("0"),df=n(" for tokens corresponding to words in the first sequence,"),cf=d(),oo=r("li"),Qa=r("code"),lf=n("1"),hf=n(` for tokens corresponding to words in the second sequence when a pair of sequences was jointly
encoded.`),pf=d(),ut=r("div"),h(pn.$$.fragment),mf=d(),mn=r("p"),ff=n("Send all values to device by calling "),Ka=r("code"),uf=n("v.to(device)"),_f=n(" (PyTorch only)."),gf=d(),S=r("div"),h(fn.$$.fragment),kf=d(),es=r("p"),bf=n("Get the character span corresponding to an encoded token in a sequence of the batch."),vf=d(),un=r("p"),Tf=n("Character spans are returned as a "),ro=r("a"),yf=n("CharSpan"),wf=n(" with:"),zf=d(),_n=r("ul"),ao=r("li"),ts=r("strong"),xf=n("start"),Ef=n(" \u2014 Index of the first character in the original string associated to the token."),$f=d(),so=r("li"),ns=r("strong"),Pf=n("end"),qf=n(` \u2014 Index of the character following the last character in the original string associated to the
token.`),If=d(),os=r("p"),Ff=n("Can be called as:"),Lf=d(),gn=r("ul"),io=r("li"),rs=r("code"),Df=n("self.token_to_chars(token_index)"),Nf=n(" if batch size is 1"),Cf=d(),co=r("li"),as=r("code"),Af=n("self.token_to_chars(batch_index, token_index)"),Sf=n(" if batch size is greater or equal to 1"),Bf=d(),H=r("div"),h(kn.$$.fragment),Wf=d(),We=r("p"),Of=n("Get the index of the sequence represented by the given token. In the general use case, this method returns "),ss=r("code"),Uf=n("0"),Rf=n(`
for a single sequence or the first sequence of a pair, and `),is=r("code"),Mf=n("1"),Vf=n(" for the second sequence of a pair"),Gf=d(),ds=r("p"),jf=n("Can be called as:"),Hf=d(),bn=r("ul"),lo=r("li"),cs=r("code"),Zf=n("self.token_to_sequence(token_index)"),Jf=n(" if batch size is 1"),Xf=d(),ho=r("li"),ls=r("code"),Yf=n("self.token_to_sequence(batch_index, token_index)"),Qf=n(" if batch size is greater than 1"),Kf=d(),hs=r("p"),eu=n(`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.`),tu=d(),Z=r("div"),h(vn.$$.fragment),nu=d(),ps=r("p"),ou=n("Get the index of the word corresponding (i.e. comprising) to an encoded token in a sequence of the batch."),ru=d(),ms=r("p"),au=n("Can be called as:"),su=d(),Tn=r("ul"),po=r("li"),fs=r("code"),iu=n("self.token_to_word(token_index)"),du=n(" if batch size is 1"),cu=d(),mo=r("li"),us=r("code"),lu=n("self.token_to_word(batch_index, token_index)"),hu=n(" if batch size is greater than 1"),pu=d(),_s=r("p"),mu=n(`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.`),fu=d(),_t=r("div"),h(yn.$$.fragment),uu=d(),gs=r("p"),_u=n(`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).`),gu=d(),gt=r("div"),h(wn.$$.fragment),ku=d(),ks=r("p"),bu=n("Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),vu=d(),B=r("div"),h(zn.$$.fragment),Tu=d(),bs=r("p"),yu=n("Get the character span in the original string corresponding to given word in a sequence of the batch."),wu=d(),vs=r("p"),zu=n("Character spans are returned as a CharSpan NamedTuple with:"),xu=d(),xn=r("ul"),Ts=r("li"),Eu=n("start: index of the first character in the original string"),$u=d(),ys=r("li"),Pu=n("end: index of the character following the last character in the original string"),qu=d(),ws=r("p"),Iu=n("Can be called as:"),Fu=d(),En=r("ul"),fo=r("li"),zs=r("code"),Lu=n("self.word_to_chars(word_index)"),Du=n(" if batch size is 1"),Nu=d(),uo=r("li"),xs=r("code"),Cu=n("self.word_to_chars(batch_index, word_index)"),Au=n(" if batch size is greater or equal to 1"),Su=d(),L=r("div"),h($n.$$.fragment),Bu=d(),Es=r("p"),Wu=n("Get the encoded token span corresponding to a word in a sequence of the batch."),Ou=d(),Pn=r("p"),Uu=n("Token spans are returned as a "),_o=r("a"),Ru=n("TokenSpan"),Mu=n(" with:"),Vu=d(),qn=r("ul"),go=r("li"),$s=r("strong"),Gu=n("start"),ju=n(" \u2014 Index of the first token."),Hu=d(),ko=r("li"),Ps=r("strong"),Zu=n("end"),Ju=n(" \u2014 Index of the token following the last token."),Xu=d(),qs=r("p"),Yu=n("Can be called as:"),Qu=d(),In=r("ul"),bo=r("li"),Is=r("code"),Ku=n("self.word_to_tokens(word_index, sequence_index: int = 0)"),e_=n(" if batch size is 1"),t_=d(),vo=r("li"),Fs=r("code"),n_=n("self.word_to_tokens(batch_index, word_index, sequence_index: int = 0)"),o_=n(` if batch size is greater or equal to
1`),r_=d(),Ls=r("p"),a_=n(`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.`),s_=d(),kt=r("div"),h(Fn.$$.fragment),i_=d(),Ds=r("p"),d_=n("Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),this.h()},l(i){const b=rv('[data-svelte="svelte-1phssyn"]',document.head);y=a(b,"META",{name:!0,content:!0}),b.forEach(t),F=c(i),q=a(i,"H1",{class:!0});var Ln=s(q);E=a(Ln,"A",{id:!0,class:!0,href:!0});var Ns=s(E);W=a(Ns,"SPAN",{});var Cs=s(W);p(v.$$.fragment,Cs),Cs.forEach(t),Ns.forEach(t),D=c(Ln),So=a(Ln,"SPAN",{});var As=s(So);Ui=o(As,"Tokenizer"),As.forEach(t),Ln.forEach(t),Os=c(i),je=a(i,"P",{});var ei=s(je);Ri=o(ei,`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 `),Tt=a(ei,"A",{href:!0,rel:!0});var F_=s(Tt);Mi=o(F_,"\u{1F917} Tokenizers"),F_.forEach(t),Vi=o(ei,". The \u201CFast\u201D implementations allows:"),ei.forEach(t),Us=c(i),He=a(i,"OL",{});var ti=s(He);Bo=a(ti,"LI",{});var L_=s(Bo);Gi=o(L_,"a significant speed-up in particular when doing batched tokenization and"),L_.forEach(t),ji=c(ti),Wo=a(ti,"LI",{});var D_=s(Wo);Hi=o(D_,`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).`),D_.forEach(t),ti.forEach(t),Rs=c(i),O=a(i,"P",{});var Pe=s(O);Zi=o(Pe,"The base classes "),Cn=a(Pe,"A",{href:!0});var N_=s(Cn);Ji=o(N_,"PreTrainedTokenizer"),N_.forEach(t),Xi=o(Pe," and "),An=a(Pe,"A",{href:!0});var C_=s(An);Yi=o(C_,"PreTrainedTokenizerFast"),C_.forEach(t),Qi=o(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
`),Sn=a(Pe,"A",{href:!0});var A_=s(Sn);Ki=o(A_,"PreTrainedTokenizerBase"),A_.forEach(t),ed=o(Pe,` that contains the common methods, and
`),Bn=a(Pe,"A",{href:!0});var S_=s(Bn);td=o(S_,"SpecialTokensMixin"),S_.forEach(t),nd=o(Pe,"."),Pe.forEach(t),Ms=c(i),De=a(i,"P",{});var Ss=s(De);Wn=a(Ss,"A",{href:!0});var B_=s(Wn);od=o(B_,"PreTrainedTokenizer"),B_.forEach(t),rd=o(Ss," and "),On=a(Ss,"A",{href:!0});var W_=s(On);ad=o(W_,"PreTrainedTokenizerFast"),W_.forEach(t),sd=o(Ss,` thus implement the main
methods for using all the tokenizers:`),Ss.forEach(t),Vs=c(i),me=a(i,"UL",{});var To=s(me);Oo=a(To,"LI",{});var O_=s(Oo);id=o(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).`),O_.forEach(t),dd=c(To),Uo=a(To,"LI",{});var U_=s(Uo);cd=o(U_,"Adding new tokens to the vocabulary in a way that is independent of the underlying structure (BPE, SentencePiece\u2026)."),U_.forEach(t),ld=c(To),Ro=a(To,"LI",{});var R_=s(Ro);hd=o(R_,`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.`),R_.forEach(t),To.forEach(t),Gs=c(i),I=a(i,"P",{});var A=s(I);Un=a(A,"A",{href:!0});var M_=s(Un);pd=o(M_,"BatchEncoding"),M_.forEach(t),md=o(A,` holds the output of the
`),Rn=a(A,"A",{href:!0});var V_=s(Rn);fd=o(V_,"PreTrainedTokenizerBase"),V_.forEach(t),ud=o(A,"\u2019s encoding methods ("),Mo=a(A,"CODE",{});var G_=s(Mo);_d=o(G_,"__call__"),G_.forEach(t),gd=o(A,`,
`),Vo=a(A,"CODE",{});var j_=s(Vo);kd=o(j_,"encode_plus"),j_.forEach(t),bd=o(A," and "),Go=a(A,"CODE",{});var H_=s(Go);vd=o(H_,"batch_encode_plus"),H_.forEach(t),Td=o(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 (`),jo=a(A,"CODE",{});var Z_=s(jo);yd=o(Z_,"input_ids"),Z_.forEach(t),wd=o(A,", "),Ho=a(A,"CODE",{});var J_=s(Ho);zd=o(J_,"attention_mask"),J_.forEach(t),xd=o(A,`\u2026). When the tokenizer is a \u201CFast\u201D tokenizer (i.e., backed by
HuggingFace `),yt=a(A,"A",{href:!0,rel:!0});var X_=s(yt);Ed=o(X_,"tokenizers library"),X_.forEach(t),$d=o(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),js=c(i),Ne=a(i,"H2",{class:!0});var ni=s(Ne);Ze=a(ni,"A",{id:!0,class:!0,href:!0});var Y_=s(Ze);Zo=a(Y_,"SPAN",{});var Q_=s(Zo);p(wt.$$.fragment,Q_),Q_.forEach(t),Y_.forEach(t),Pd=c(ni),Jo=a(ni,"SPAN",{});var K_=s(Jo);qd=o(K_,"PreTrainedTokenizer"),K_.forEach(t),ni.forEach(t),Hs=c(i),g=a(i,"DIV",{class:!0});var z=s(g);p(zt.$$.fragment,z),Id=c(z),Xo=a(z,"P",{});var eg=s(Xo);Fd=o(eg,"Base class for all slow tokenizers."),eg.forEach(t),Ld=c(z),xt=a(z,"P",{});var oi=s(xt);Dd=o(oi,"Inherits from "),Mn=a(oi,"A",{href:!0});var tg=s(Mn);Nd=o(tg,"PreTrainedTokenizerBase"),tg.forEach(t),Cd=o(oi,"."),oi.forEach(t),Ad=c(z),Yo=a(z,"P",{});var ng=s(Yo);Sd=o(ng,`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.`),ng.forEach(t),Bd=c(z),Qo=a(z,"P",{});var og=s(Qo);Wd=o(og,`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).`),og.forEach(t),Od=c(z),Ko=a(z,"P",{});var rg=s(Ko);Ud=o(rg,"Class attributes (overridden by derived classes)"),rg.forEach(t),Rd=c(z),N=a(z,"UL",{});var J=s(N);fe=a(J,"LI",{});var Dn=s(fe);er=a(Dn,"STRONG",{});var ag=s(er);Md=o(ag,"vocab_files_names"),ag.forEach(t),Vd=o(Dn," ("),tr=a(Dn,"CODE",{});var sg=s(tr);Gd=o(sg,"Dict[str, str]"),sg.forEach(t),jd=o(Dn,") \u2014 A dictionary with, as keys, the "),nr=a(Dn,"CODE",{});var ig=s(nr);Hd=o(ig,"__init__"),ig.forEach(t),Zd=o(Dn,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Dn.forEach(t),Jd=c(J),U=a(J,"LI",{});var de=s(U);or=a(de,"STRONG",{});var dg=s(or);Xd=o(dg,"pretrained_vocab_files_map"),dg.forEach(t),Yd=o(de," ("),rr=a(de,"CODE",{});var cg=s(rr);Qd=o(cg,"Dict[str, Dict[str, str]]"),cg.forEach(t),Kd=o(de,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),ar=a(de,"CODE",{});var lg=s(ar);ec=o(lg,"__init__"),lg.forEach(t),tc=o(de,` keyword name of each vocabulary file required by the model, the
low-level being the `),sr=a(de,"CODE",{});var hg=s(sr);nc=o(hg,"short-cut-names"),hg.forEach(t),oc=o(de," of the pretrained models with, as associated values, the "),ir=a(de,"CODE",{});var pg=s(ir);rc=o(pg,"url"),pg.forEach(t),ac=o(de,` to the
associated pretrained vocabulary file.`),de.forEach(t),sc=c(J),Q=a(J,"LI",{});var Oe=s(Q);dr=a(Oe,"STRONG",{});var mg=s(dr);ic=o(mg,"max_model_input_sizes"),mg.forEach(t),dc=o(Oe," ("),cr=a(Oe,"CODE",{});var fg=s(cr);cc=o(fg,"Dict[str, Optional[int]]"),fg.forEach(t),lc=o(Oe,") \u2014 A dictionary with, as keys, the "),lr=a(Oe,"CODE",{});var ug=s(lr);hc=o(ug,"short-cut-names"),ug.forEach(t),pc=o(Oe,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),hr=a(Oe,"CODE",{});var _g=s(hr);mc=o(_g,"None"),_g.forEach(t),fc=o(Oe," if the model has no maximum input size."),Oe.forEach(t),uc=c(J),R=a(J,"LI",{});var ce=s(R);pr=a(ce,"STRONG",{});var gg=s(pr);_c=o(gg,"pretrained_init_configuration"),gg.forEach(t),gc=o(ce," ("),mr=a(ce,"CODE",{});var kg=s(mr);kc=o(kg,"Dict[str, Dict[str, Any]]"),kg.forEach(t),bc=o(ce,`) \u2014 A dictionary with, as keys, the
`),fr=a(ce,"CODE",{});var bg=s(fr);vc=o(bg,"short-cut-names"),bg.forEach(t),Tc=o(ce,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ur=a(ce,"CODE",{});var vg=s(ur);yc=o(vg,"__init__"),vg.forEach(t),wc=o(ce,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Vn=a(ce,"A",{href:!0});var Tg=s(Vn);zc=o(Tg,"from_pretrained()"),Tg.forEach(t),xc=o(ce," method."),ce.forEach(t),Ec=c(J),Je=a(J,"LI",{});var Bs=s(Je);_r=a(Bs,"STRONG",{});var yg=s(_r);$c=o(yg,"model_input_names"),yg.forEach(t),Pc=o(Bs," ("),gr=a(Bs,"CODE",{});var wg=s(gr);qc=o(wg,"List[str]"),wg.forEach(t),Ic=o(Bs,") \u2014 A list of inputs expected in the forward pass of the model."),Bs.forEach(t),Fc=c(J),K=a(J,"LI",{});var Ue=s(K);kr=a(Ue,"STRONG",{});var zg=s(kr);Lc=o(zg,"padding_side"),zg.forEach(t),Dc=o(Ue," ("),br=a(Ue,"CODE",{});var xg=s(br);Nc=o(xg,"str"),xg.forEach(t),Cc=o(Ue,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),vr=a(Ue,"CODE",{});var Eg=s(vr);Ac=o(Eg,"'right'"),Eg.forEach(t),Sc=o(Ue," or "),Tr=a(Ue,"CODE",{});var $g=s(Tr);Bc=o($g,"'left'"),$g.forEach(t),Wc=o(Ue,"."),Ue.forEach(t),Oc=c(J),ee=a(J,"LI",{});var Re=s(ee);yr=a(Re,"STRONG",{});var Pg=s(yr);Uc=o(Pg,"truncation_side"),Pg.forEach(t),Rc=o(Re," ("),wr=a(Re,"CODE",{});var qg=s(wr);Mc=o(qg,"str"),qg.forEach(t),Vc=o(Re,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),zr=a(Re,"CODE",{});var Ig=s(zr);Gc=o(Ig,"'right'"),Ig.forEach(t),jc=o(Re," or "),xr=a(Re,"CODE",{});var Fg=s(xr);Hc=o(Fg,"'left'"),Fg.forEach(t),Zc=o(Re,"."),Re.forEach(t),J.forEach(t),Jc=c(z),Xe=a(z,"DIV",{class:!0});var ri=s(Xe);p(Et.$$.fragment,ri),Xc=c(ri),Er=a(ri,"P",{});var Lg=s(Er);Yc=o(Lg,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Lg.forEach(t),ri.forEach(t),Qc=c(z),Ye=a(z,"DIV",{class:!0});var ai=s(Ye);p($t.$$.fragment,ai),Kc=c(ai),$r=a(ai,"P",{});var Dg=s($r);el=o(Dg,"Convert a list of lists of token ids into a list of strings by calling decode."),Dg.forEach(t),ai.forEach(t),tl=c(z),ue=a(z,"DIV",{class:!0});var yo=s(ue);p(Pt.$$.fragment,yo),nl=c(yo),Pr=a(yo,"P",{});var Ng=s(Pr);ol=o(Ng,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Ng.forEach(t),rl=c(yo),qt=a(yo,"P",{});var si=s(qt);al=o(si,"Similar to doing "),qr=a(si,"CODE",{});var Cg=s(qr);sl=o(Cg,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Cg.forEach(t),il=o(si,"."),si.forEach(t),yo.forEach(t),dl=c(z),_e=a(z,"DIV",{class:!0});var wo=s(_e);p(It.$$.fragment,wo),cl=c(wo),Ir=a(wo,"P",{});var Ag=s(Ir);ll=o(Ag,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Ag.forEach(t),hl=c(wo),Ft=a(wo,"P",{});var ii=s(Ft);pl=o(ii,"Same as doing "),Fr=a(ii,"CODE",{});var Sg=s(Fr);ml=o(Sg,"self.convert_tokens_to_ids(self.tokenize(text))"),Sg.forEach(t),fl=o(ii,"."),ii.forEach(t),wo.forEach(t),ul=c(z),ge=a(z,"DIV",{class:!0});var zo=s(ge);p(Lt.$$.fragment,zo),_l=c(zo),Lr=a(zo,"P",{});var Bg=s(Lr);gl=o(Bg,"Upload the tokenizer files to the \u{1F917} Model Hub."),Bg.forEach(t),kl=c(zo),p(Qe.$$.fragment,zo),zo.forEach(t),bl=c(z),Ke=a(z,"DIV",{class:!0});var di=s(Ke);p(Dt.$$.fragment,di),vl=c(di),Dr=a(di,"P",{});var Wg=s(Dr);Tl=o(Wg,`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Wg.forEach(t),di.forEach(t),yl=c(z),et=a(z,"DIV",{class:!0});var ci=s(et);p(Nt.$$.fragment,ci),wl=c(ci),Nr=a(ci,"P",{});var Og=s(Nr);zl=o(Og,`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Og.forEach(t),ci.forEach(t),xl=c(z),tt=a(z,"DIV",{class:!0});var li=s(tt);p(Ct.$$.fragment,li),El=c(li),Cr=a(li,"P",{});var Ug=s(Cr);$l=o(Ug,"Returns the added tokens in the vocabulary as a dictionary of token to index."),Ug.forEach(t),li.forEach(t),Pl=c(z),ke=a(z,"DIV",{class:!0});var xo=s(ke);p(At.$$.fragment,xo),ql=c(xo),Ar=a(xo,"P",{});var Rg=s(Ar);Il=o(Rg,"Returns the number of added tokens when encoding a sequence with special tokens."),Rg.forEach(t),Fl=c(xo),p(nt.$$.fragment,xo),xo.forEach(t),Ll=c(z),be=a(z,"DIV",{class:!0});var Eo=s(be);p(St.$$.fragment,Eo),Dl=c(Eo),Sr=a(Eo,"P",{});var Mg=s(Sr);Nl=o(Mg,"Performs any necessary transformations before tokenization."),Mg.forEach(t),Cl=c(Eo),Ce=a(Eo,"P",{});var $o=s(Ce);Al=o($o,"This method should pop the arguments from kwargs and return the remaining "),Br=a($o,"CODE",{});var Vg=s(Br);Sl=o(Vg,"kwargs"),Vg.forEach(t),Bl=o($o,` as well. We test the
`),Wr=a($o,"CODE",{});var Gg=s(Wr);Wl=o(Gg,"kwargs"),Gg.forEach(t),Ol=o($o," at the end of the encoding process to be sure all the arguments have been used."),$o.forEach(t),Eo.forEach(t),Ul=c(z),ve=a(z,"DIV",{class:!0});var Po=s(ve);p(Bt.$$.fragment,Po),Rl=c(Po),Or=a(Po,"P",{});var jg=s(Or);Ml=o(jg,"Converts a string in a sequence of tokens, using the tokenizer."),jg.forEach(t),Vl=c(Po),Ur=a(Po,"P",{});var Hg=s(Ur);Gl=o(Hg,`Split in words for word-based vocabulary or sub-words for sub-word-based vocabularies
(BPE/SentencePieces/WordPieces). Takes care of added tokens.`),Hg.forEach(t),Po.forEach(t),z.forEach(t),Zs=c(i),Ae=a(i,"H2",{class:!0});var hi=s(Ae);ot=a(hi,"A",{id:!0,class:!0,href:!0});var Zg=s(ot);Rr=a(Zg,"SPAN",{});var Jg=s(Rr);p(Wt.$$.fragment,Jg),Jg.forEach(t),Zg.forEach(t),jl=c(hi),Mr=a(hi,"SPAN",{});var Xg=s(Mr);Hl=o(Xg,"PreTrainedTokenizerFast"),Xg.forEach(t),hi.forEach(t),Js=c(i),te=a(i,"P",{});var bt=s(te);Zl=o(bt,"The "),Gn=a(bt,"A",{href:!0});var Yg=s(Gn);Jl=o(Yg,"PreTrainedTokenizerFast"),Yg.forEach(t),Xl=o(bt," depend on the "),Ot=a(bt,"A",{href:!0,rel:!0});var Qg=s(Ot);Yl=o(Qg,"tokenizers"),Qg.forEach(t),Ql=o(bt,` library. The tokenizers obtained from the \u{1F917} tokenizers library can be
loaded very simply into \u{1F917} transformers. Take a look at the `),jn=a(bt,"A",{href:!0});var Kg=s(jn);Kl=o(Kg,"Using tokenizers from \u{1F917} tokenizers"),Kg.forEach(t),eh=o(bt," page to understand how this is done."),bt.forEach(t),Xs=c(i),k=a(i,"DIV",{class:!0});var x=s(k);p(Ut.$$.fragment,x),th=c(x),Vr=a(x,"P",{});var ek=s(Vr);nh=o(ek,"Base class for all fast tokenizers (wrapping HuggingFace tokenizers library)."),ek.forEach(t),oh=c(x),Rt=a(x,"P",{});var pi=s(Rt);rh=o(pi,"Inherits from "),Hn=a(pi,"A",{href:!0});var tk=s(Hn);ah=o(tk,"PreTrainedTokenizerBase"),tk.forEach(t),sh=o(pi,"."),pi.forEach(t),ih=c(x),Gr=a(x,"P",{});var nk=s(Gr);dh=o(nk,`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.`),nk.forEach(t),ch=c(x),jr=a(x,"P",{});var ok=s(jr);lh=o(ok,`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).`),ok.forEach(t),hh=c(x),Hr=a(x,"P",{});var rk=s(Hr);ph=o(rk,"Class attributes (overridden by derived classes)"),rk.forEach(t),mh=c(x),C=a(x,"UL",{});var X=s(C);Te=a(X,"LI",{});var Nn=s(Te);Zr=a(Nn,"STRONG",{});var ak=s(Zr);fh=o(ak,"vocab_files_names"),ak.forEach(t),uh=o(Nn," ("),Jr=a(Nn,"CODE",{});var sk=s(Jr);_h=o(sk,"Dict[str, str]"),sk.forEach(t),gh=o(Nn,") \u2014 A dictionary with, as keys, the "),Xr=a(Nn,"CODE",{});var ik=s(Xr);kh=o(ik,"__init__"),ik.forEach(t),bh=o(Nn,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Nn.forEach(t),vh=c(X),M=a(X,"LI",{});var le=s(M);Yr=a(le,"STRONG",{});var dk=s(Yr);Th=o(dk,"pretrained_vocab_files_map"),dk.forEach(t),yh=o(le," ("),Qr=a(le,"CODE",{});var ck=s(Qr);wh=o(ck,"Dict[str, Dict[str, str]]"),ck.forEach(t),zh=o(le,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),Kr=a(le,"CODE",{});var lk=s(Kr);xh=o(lk,"__init__"),lk.forEach(t),Eh=o(le,` keyword name of each vocabulary file required by the model, the
low-level being the `),ea=a(le,"CODE",{});var hk=s(ea);$h=o(hk,"short-cut-names"),hk.forEach(t),Ph=o(le," of the pretrained models with, as associated values, the "),ta=a(le,"CODE",{});var pk=s(ta);qh=o(pk,"url"),pk.forEach(t),Ih=o(le,` to the
associated pretrained vocabulary file.`),le.forEach(t),Fh=c(X),ne=a(X,"LI",{});var Me=s(ne);na=a(Me,"STRONG",{});var mk=s(na);Lh=o(mk,"max_model_input_sizes"),mk.forEach(t),Dh=o(Me," ("),oa=a(Me,"CODE",{});var fk=s(oa);Nh=o(fk,"Dict[str, Optional[int]]"),fk.forEach(t),Ch=o(Me,") \u2014 A dictionary with, as keys, the "),ra=a(Me,"CODE",{});var uk=s(ra);Ah=o(uk,"short-cut-names"),uk.forEach(t),Sh=o(Me,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),aa=a(Me,"CODE",{});var _k=s(aa);Bh=o(_k,"None"),_k.forEach(t),Wh=o(Me," if the model has no maximum input size."),Me.forEach(t),Oh=c(X),V=a(X,"LI",{});var he=s(V);sa=a(he,"STRONG",{});var gk=s(sa);Uh=o(gk,"pretrained_init_configuration"),gk.forEach(t),Rh=o(he," ("),ia=a(he,"CODE",{});var kk=s(ia);Mh=o(kk,"Dict[str, Dict[str, Any]]"),kk.forEach(t),Vh=o(he,`) \u2014 A dictionary with, as keys, the
`),da=a(he,"CODE",{});var bk=s(da);Gh=o(bk,"short-cut-names"),bk.forEach(t),jh=o(he,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ca=a(he,"CODE",{});var vk=s(ca);Hh=o(vk,"__init__"),vk.forEach(t),Zh=o(he,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Zn=a(he,"A",{href:!0});var Tk=s(Zn);Jh=o(Tk,"from_pretrained()"),Tk.forEach(t),Xh=o(he," method."),he.forEach(t),Yh=c(X),rt=a(X,"LI",{});var Ws=s(rt);la=a(Ws,"STRONG",{});var yk=s(la);Qh=o(yk,"model_input_names"),yk.forEach(t),Kh=o(Ws," ("),ha=a(Ws,"CODE",{});var wk=s(ha);ep=o(wk,"List[str]"),wk.forEach(t),tp=o(Ws,") \u2014 A list of inputs expected in the forward pass of the model."),Ws.forEach(t),np=c(X),oe=a(X,"LI",{});var Ve=s(oe);pa=a(Ve,"STRONG",{});var zk=s(pa);op=o(zk,"padding_side"),zk.forEach(t),rp=o(Ve," ("),ma=a(Ve,"CODE",{});var xk=s(ma);ap=o(xk,"str"),xk.forEach(t),sp=o(Ve,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),fa=a(Ve,"CODE",{});var Ek=s(fa);ip=o(Ek,"'right'"),Ek.forEach(t),dp=o(Ve," or "),ua=a(Ve,"CODE",{});var $k=s(ua);cp=o($k,"'left'"),$k.forEach(t),lp=o(Ve,"."),Ve.forEach(t),hp=c(X),re=a(X,"LI",{});var Ge=s(re);_a=a(Ge,"STRONG",{});var Pk=s(_a);pp=o(Pk,"truncation_side"),Pk.forEach(t),mp=o(Ge," ("),ga=a(Ge,"CODE",{});var qk=s(ga);fp=o(qk,"str"),qk.forEach(t),up=o(Ge,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),ka=a(Ge,"CODE",{});var Ik=s(ka);_p=o(Ik,"'right'"),Ik.forEach(t),gp=o(Ge," or "),ba=a(Ge,"CODE",{});var Fk=s(ba);kp=o(Fk,"'left'"),Fk.forEach(t),bp=o(Ge,"."),Ge.forEach(t),X.forEach(t),vp=c(x),at=a(x,"DIV",{class:!0});var mi=s(at);p(Mt.$$.fragment,mi),Tp=c(mi),va=a(mi,"P",{});var Lk=s(va);yp=o(Lk,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Lk.forEach(t),mi.forEach(t),wp=c(x),st=a(x,"DIV",{class:!0});var fi=s(st);p(Vt.$$.fragment,fi),zp=c(fi),Ta=a(fi,"P",{});var Dk=s(Ta);xp=o(Dk,"Convert a list of lists of token ids into a list of strings by calling decode."),Dk.forEach(t),fi.forEach(t),Ep=c(x),ye=a(x,"DIV",{class:!0});var qo=s(ye);p(Gt.$$.fragment,qo),$p=c(qo),ya=a(qo,"P",{});var Nk=s(ya);Pp=o(Nk,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Nk.forEach(t),qp=c(qo),jt=a(qo,"P",{});var ui=s(jt);Ip=o(ui,"Similar to doing "),wa=a(ui,"CODE",{});var Ck=s(wa);Fp=o(Ck,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Ck.forEach(t),Lp=o(ui,"."),ui.forEach(t),qo.forEach(t),Dp=c(x),we=a(x,"DIV",{class:!0});var Io=s(we);p(Ht.$$.fragment,Io),Np=c(Io),za=a(Io,"P",{});var Ak=s(za);Cp=o(Ak,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Ak.forEach(t),Ap=c(Io),Zt=a(Io,"P",{});var _i=s(Zt);Sp=o(_i,"Same as doing "),xa=a(_i,"CODE",{});var Sk=s(xa);Bp=o(Sk,"self.convert_tokens_to_ids(self.tokenize(text))"),Sk.forEach(t),Wp=o(_i,"."),_i.forEach(t),Io.forEach(t),Op=c(x),ze=a(x,"DIV",{class:!0});var Fo=s(ze);p(Jt.$$.fragment,Fo),Up=c(Fo),Ea=a(Fo,"P",{});var Bk=s(Ea);Rp=o(Bk,"Upload the tokenizer files to the \u{1F917} Model Hub."),Bk.forEach(t),Mp=c(Fo),p(it.$$.fragment,Fo),Fo.forEach(t),Vp=c(x),dt=a(x,"DIV",{class:!0});var gi=s(dt);p(Xt.$$.fragment,gi),Gp=c(gi),$a=a(gi,"P",{});var Wk=s($a);jp=o(Wk,`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Wk.forEach(t),gi.forEach(t),Hp=c(x),ct=a(x,"DIV",{class:!0});var ki=s(ct);p(Yt.$$.fragment,ki),Zp=c(ki),Pa=a(ki,"P",{});var Ok=s(Pa);Jp=o(Ok,`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Ok.forEach(t),ki.forEach(t),Xp=c(x),lt=a(x,"DIV",{class:!0});var bi=s(lt);p(Qt.$$.fragment,bi),Yp=c(bi),qa=a(bi,"P",{});var Uk=s(qa);Qp=o(Uk,"Returns the added tokens in the vocabulary as a dictionary of token to index."),Uk.forEach(t),bi.forEach(t),Kp=c(x),xe=a(x,"DIV",{class:!0});var Lo=s(xe);p(Kt.$$.fragment,Lo),em=c(Lo),Ia=a(Lo,"P",{});var Rk=s(Ia);tm=o(Rk,"Returns the number of added tokens when encoding a sequence with special tokens."),Rk.forEach(t),nm=c(Lo),p(ht.$$.fragment,Lo),Lo.forEach(t),om=c(x),Ee=a(x,"DIV",{class:!0});var Do=s(Ee);p(en.$$.fragment,Do),rm=c(Do),Fa=a(Do,"P",{});var Mk=s(Fa);am=o(Mk,`Define the truncation and the padding strategies for fast tokenizers (provided by HuggingFace tokenizers
library) and restore the tokenizer settings afterwards.`),Mk.forEach(t),sm=c(Do),La=a(Do,"P",{});var Vk=s(La);im=o(Vk,`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.`),Vk.forEach(t),Do.forEach(t),dm=c(x),pt=a(x,"DIV",{class:!0});var vi=s(pt);p(tn.$$.fragment,vi),cm=c(vi),Da=a(vi,"P",{});var Gk=s(Da);lm=o(Gk,`Trains a tokenizer on a new corpus with the same defaults (in terms of special tokens or tokenization pipeline)
as the current one.`),Gk.forEach(t),vi.forEach(t),x.forEach(t),Ys=c(i),Se=a(i,"H2",{class:!0});var Ti=s(Se);mt=a(Ti,"A",{id:!0,class:!0,href:!0});var jk=s(mt);Na=a(jk,"SPAN",{});var Hk=s(Na);p(nn.$$.fragment,Hk),Hk.forEach(t),jk.forEach(t),hm=c(Ti),Ca=a(Ti,"SPAN",{});var Zk=s(Ca);pm=o(Zk,"BatchEncoding"),Zk.forEach(t),Ti.forEach(t),Qs=c(i),w=a(i,"DIV",{class:!0});var P=s(w);p(on.$$.fragment,P),mm=c(P),ie=a(P,"P",{});var vt=s(ie);fm=o(vt,"Holds the output of the "),rn=a(vt,"A",{href:!0});var c_=s(rn);Aa=a(c_,"STRONG",{});var Jk=s(Aa);um=o(Jk,"call"),Jk.forEach(t),_m=o(c_,"()"),c_.forEach(t),gm=o(vt,`,
`),Jn=a(vt,"A",{href:!0});var Xk=s(Jn);km=o(Xk,"encode_plus()"),Xk.forEach(t),bm=o(vt,` and
`),Xn=a(vt,"A",{href:!0});var Yk=s(Xn);vm=o(Yk,"batch_encode_plus()"),Yk.forEach(t),Tm=o(vt," methods (tokens, attention_masks, etc)."),vt.forEach(t),ym=c(P),Sa=a(P,"P",{});var Qk=s(Sa);wm=o(Qk,`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.`),Qk.forEach(t),zm=c(P),G=a(P,"DIV",{class:!0});var qe=s(G);p(an.$$.fragment,qe),xm=c(qe),Ba=a(qe,"P",{});var Kk=s(Ba);Em=o(Kk,`Get the index of the token in the encoded output comprising a character in the original string for a sequence
of the batch.`),Kk.forEach(t),$m=c(qe),Wa=a(qe,"P",{});var eb=s(Wa);Pm=o(eb,"Can be called as:"),eb.forEach(t),qm=c(qe),sn=a(qe,"UL",{});var yi=s(sn);Yn=a(yi,"LI",{});var l_=s(Yn);Oa=a(l_,"CODE",{});var tb=s(Oa);Im=o(tb,"self.char_to_token(char_index)"),tb.forEach(t),Fm=o(l_," if batch size is 1"),l_.forEach(t),Lm=c(yi),Qn=a(yi,"LI",{});var h_=s(Qn);Ua=a(h_,"CODE",{});var nb=s(Ua);Dm=o(nb,"self.char_to_token(batch_index, char_index)"),nb.forEach(t),Nm=o(h_," if batch size is greater or equal to 1"),h_.forEach(t),yi.forEach(t),Cm=c(qe),Ra=a(qe,"P",{});var ob=s(Ra);Am=o(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),qe.forEach(t),Sm=c(P),j=a(P,"DIV",{class:!0});var Ie=s(j);p(dn.$$.fragment,Ie),Bm=c(Ie),Ma=a(Ie,"P",{});var rb=s(Ma);Wm=o(rb,`Get the word in the original string corresponding to a character in the original string of a sequence of the
batch.`),rb.forEach(t),Om=c(Ie),Va=a(Ie,"P",{});var ab=s(Va);Um=o(ab,"Can be called as:"),ab.forEach(t),Rm=c(Ie),cn=a(Ie,"UL",{});var wi=s(cn);Kn=a(wi,"LI",{});var p_=s(Kn);Ga=a(p_,"CODE",{});var sb=s(Ga);Mm=o(sb,"self.char_to_word(char_index)"),sb.forEach(t),Vm=o(p_," if batch size is 1"),p_.forEach(t),Gm=c(wi),eo=a(wi,"LI",{});var m_=s(eo);ja=a(m_,"CODE",{});var ib=s(ja);jm=o(ib,"self.char_to_word(batch_index, char_index)"),ib.forEach(t),Hm=o(m_," if batch size is greater than 1"),m_.forEach(t),wi.forEach(t),Zm=c(Ie),Ha=a(Ie,"P",{});var db=s(Ha);Jm=o(db,`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.`),db.forEach(t),Ie.forEach(t),Xm=c(P),ft=a(P,"DIV",{class:!0});var zi=s(ft);p(ln.$$.fragment,zi),Ym=c(zi),Za=a(zi,"P",{});var cb=s(Za);Qm=o(cb,"Convert the inner content to tensors."),cb.forEach(t),zi.forEach(t),Km=c(P),$e=a(P,"DIV",{class:!0});var No=s($e);p(hn.$$.fragment,No),ef=c(No),Ja=a(No,"P",{});var lb=s(Ja);tf=o(lb,"Return a list mapping the tokens to the id of their original sentences:"),lb.forEach(t),nf=c(No),Be=a(No,"UL",{});var Co=s(Be);to=a(Co,"LI",{});var f_=s(to);Xa=a(f_,"CODE",{});var hb=s(Xa);of=o(hb,"None"),hb.forEach(t),rf=o(f_," for special tokens added around or between sequences,"),f_.forEach(t),af=c(Co),no=a(Co,"LI",{});var u_=s(no);Ya=a(u_,"CODE",{});var pb=s(Ya);sf=o(pb,"0"),pb.forEach(t),df=o(u_," for tokens corresponding to words in the first sequence,"),u_.forEach(t),cf=c(Co),oo=a(Co,"LI",{});var __=s(oo);Qa=a(__,"CODE",{});var mb=s(Qa);lf=o(mb,"1"),mb.forEach(t),hf=o(__,` for tokens corresponding to words in the second sequence when a pair of sequences was jointly
encoded.`),__.forEach(t),Co.forEach(t),No.forEach(t),pf=c(P),ut=a(P,"DIV",{class:!0});var xi=s(ut);p(pn.$$.fragment,xi),mf=c(xi),mn=a(xi,"P",{});var Ei=s(mn);ff=o(Ei,"Send all values to device by calling "),Ka=a(Ei,"CODE",{});var fb=s(Ka);uf=o(fb,"v.to(device)"),fb.forEach(t),_f=o(Ei," (PyTorch only)."),Ei.forEach(t),xi.forEach(t),gf=c(P),S=a(P,"DIV",{class:!0});var ae=s(S);p(fn.$$.fragment,ae),kf=c(ae),es=a(ae,"P",{});var ub=s(es);bf=o(ub,"Get the character span corresponding to an encoded token in a sequence of the batch."),ub.forEach(t),vf=c(ae),un=a(ae,"P",{});var $i=s(un);Tf=o($i,"Character spans are returned as a "),ro=a($i,"A",{href:!0});var _b=s(ro);yf=o(_b,"CharSpan"),_b.forEach(t),wf=o($i," with:"),$i.forEach(t),zf=c(ae),_n=a(ae,"UL",{});var Pi=s(_n);ao=a(Pi,"LI",{});var g_=s(ao);ts=a(g_,"STRONG",{});var gb=s(ts);xf=o(gb,"start"),gb.forEach(t),Ef=o(g_," \u2014 Index of the first character in the original string associated to the token."),g_.forEach(t),$f=c(Pi),so=a(Pi,"LI",{});var k_=s(so);ns=a(k_,"STRONG",{});var kb=s(ns);Pf=o(kb,"end"),kb.forEach(t),qf=o(k_,` \u2014 Index of the character following the last character in the original string associated to the
token.`),k_.forEach(t),Pi.forEach(t),If=c(ae),os=a(ae,"P",{});var bb=s(os);Ff=o(bb,"Can be called as:"),bb.forEach(t),Lf=c(ae),gn=a(ae,"UL",{});var qi=s(gn);io=a(qi,"LI",{});var b_=s(io);rs=a(b_,"CODE",{});var vb=s(rs);Df=o(vb,"self.token_to_chars(token_index)"),vb.forEach(t),Nf=o(b_," if batch size is 1"),b_.forEach(t),Cf=c(qi),co=a(qi,"LI",{});var v_=s(co);as=a(v_,"CODE",{});var Tb=s(as);Af=o(Tb,"self.token_to_chars(batch_index, token_index)"),Tb.forEach(t),Sf=o(v_," if batch size is greater or equal to 1"),v_.forEach(t),qi.forEach(t),ae.forEach(t),Bf=c(P),H=a(P,"DIV",{class:!0});var Fe=s(H);p(kn.$$.fragment,Fe),Wf=c(Fe),We=a(Fe,"P",{});var Ao=s(We);Of=o(Ao,"Get the index of the sequence represented by the given token. In the general use case, this method returns "),ss=a(Ao,"CODE",{});var yb=s(ss);Uf=o(yb,"0"),yb.forEach(t),Rf=o(Ao,`
for a single sequence or the first sequence of a pair, and `),is=a(Ao,"CODE",{});var wb=s(is);Mf=o(wb,"1"),wb.forEach(t),Vf=o(Ao," for the second sequence of a pair"),Ao.forEach(t),Gf=c(Fe),ds=a(Fe,"P",{});var zb=s(ds);jf=o(zb,"Can be called as:"),zb.forEach(t),Hf=c(Fe),bn=a(Fe,"UL",{});var Ii=s(bn);lo=a(Ii,"LI",{});var T_=s(lo);cs=a(T_,"CODE",{});var xb=s(cs);Zf=o(xb,"self.token_to_sequence(token_index)"),xb.forEach(t),Jf=o(T_," if batch size is 1"),T_.forEach(t),Xf=c(Ii),ho=a(Ii,"LI",{});var y_=s(ho);ls=a(y_,"CODE",{});var Eb=s(ls);Yf=o(Eb,"self.token_to_sequence(batch_index, token_index)"),Eb.forEach(t),Qf=o(y_," if batch size is greater than 1"),y_.forEach(t),Ii.forEach(t),Kf=c(Fe),hs=a(Fe,"P",{});var $b=s(hs);eu=o($b,`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.`),$b.forEach(t),Fe.forEach(t),tu=c(P),Z=a(P,"DIV",{class:!0});var Le=s(Z);p(vn.$$.fragment,Le),nu=c(Le),ps=a(Le,"P",{});var Pb=s(ps);ou=o(Pb,"Get the index of the word corresponding (i.e. comprising) to an encoded token in a sequence of the batch."),Pb.forEach(t),ru=c(Le),ms=a(Le,"P",{});var qb=s(ms);au=o(qb,"Can be called as:"),qb.forEach(t),su=c(Le),Tn=a(Le,"UL",{});var Fi=s(Tn);po=a(Fi,"LI",{});var w_=s(po);fs=a(w_,"CODE",{});var Ib=s(fs);iu=o(Ib,"self.token_to_word(token_index)"),Ib.forEach(t),du=o(w_," if batch size is 1"),w_.forEach(t),cu=c(Fi),mo=a(Fi,"LI",{});var z_=s(mo);us=a(z_,"CODE",{});var Fb=s(us);lu=o(Fb,"self.token_to_word(batch_index, token_index)"),Fb.forEach(t),hu=o(z_," if batch size is greater than 1"),z_.forEach(t),Fi.forEach(t),pu=c(Le),_s=a(Le,"P",{});var Lb=s(_s);mu=o(Lb,`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.`),Lb.forEach(t),Le.forEach(t),fu=c(P),_t=a(P,"DIV",{class:!0});var Li=s(_t);p(yn.$$.fragment,Li),uu=c(Li),gs=a(Li,"P",{});var Db=s(gs);_u=o(Db,`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).`),Db.forEach(t),Li.forEach(t),gu=c(P),gt=a(P,"DIV",{class:!0});var Di=s(gt);p(wn.$$.fragment,Di),ku=c(Di),ks=a(Di,"P",{});var Nb=s(ks);bu=o(Nb,"Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),Nb.forEach(t),Di.forEach(t),vu=c(P),B=a(P,"DIV",{class:!0});var se=s(B);p(zn.$$.fragment,se),Tu=c(se),bs=a(se,"P",{});var Cb=s(bs);yu=o(Cb,"Get the character span in the original string corresponding to given word in a sequence of the batch."),Cb.forEach(t),wu=c(se),vs=a(se,"P",{});var Ab=s(vs);zu=o(Ab,"Character spans are returned as a CharSpan NamedTuple with:"),Ab.forEach(t),xu=c(se),xn=a(se,"UL",{});var Ni=s(xn);Ts=a(Ni,"LI",{});var Sb=s(Ts);Eu=o(Sb,"start: index of the first character in the original string"),Sb.forEach(t),$u=c(Ni),ys=a(Ni,"LI",{});var Bb=s(ys);Pu=o(Bb,"end: index of the character following the last character in the original string"),Bb.forEach(t),Ni.forEach(t),qu=c(se),ws=a(se,"P",{});var Wb=s(ws);Iu=o(Wb,"Can be called as:"),Wb.forEach(t),Fu=c(se),En=a(se,"UL",{});var Ci=s(En);fo=a(Ci,"LI",{});var x_=s(fo);zs=a(x_,"CODE",{});var Ob=s(zs);Lu=o(Ob,"self.word_to_chars(word_index)"),Ob.forEach(t),Du=o(x_," if batch size is 1"),x_.forEach(t),Nu=c(Ci),uo=a(Ci,"LI",{});var E_=s(uo);xs=a(E_,"CODE",{});var Ub=s(xs);Cu=o(Ub,"self.word_to_chars(batch_index, word_index)"),Ub.forEach(t),Au=o(E_," if batch size is greater or equal to 1"),E_.forEach(t),Ci.forEach(t),se.forEach(t),Su=c(P),L=a(P,"DIV",{class:!0});var Y=s(L);p($n.$$.fragment,Y),Bu=c(Y),Es=a(Y,"P",{});var Rb=s(Es);Wu=o(Rb,"Get the encoded token span corresponding to a word in a sequence of the batch."),Rb.forEach(t),Ou=c(Y),Pn=a(Y,"P",{});var Ai=s(Pn);Uu=o(Ai,"Token spans are returned as a "),_o=a(Ai,"A",{href:!0});var Mb=s(_o);Ru=o(Mb,"TokenSpan"),Mb.forEach(t),Mu=o(Ai," with:"),Ai.forEach(t),Vu=c(Y),qn=a(Y,"UL",{});var Si=s(qn);go=a(Si,"LI",{});var $_=s(go);$s=a($_,"STRONG",{});var Vb=s($s);Gu=o(Vb,"start"),Vb.forEach(t),ju=o($_," \u2014 Index of the first token."),$_.forEach(t),Hu=c(Si),ko=a(Si,"LI",{});var P_=s(ko);Ps=a(P_,"STRONG",{});var Gb=s(Ps);Zu=o(Gb,"end"),Gb.forEach(t),Ju=o(P_," \u2014 Index of the token following the last token."),P_.forEach(t),Si.forEach(t),Xu=c(Y),qs=a(Y,"P",{});var jb=s(qs);Yu=o(jb,"Can be called as:"),jb.forEach(t),Qu=c(Y),In=a(Y,"UL",{});var Bi=s(In);bo=a(Bi,"LI",{});var q_=s(bo);Is=a(q_,"CODE",{});var Hb=s(Is);Ku=o(Hb,"self.word_to_tokens(word_index, sequence_index: int = 0)"),Hb.forEach(t),e_=o(q_," if batch size is 1"),q_.forEach(t),t_=c(Bi),vo=a(Bi,"LI",{});var I_=s(vo);Fs=a(I_,"CODE",{});var Zb=s(Fs);n_=o(Zb,"self.word_to_tokens(batch_index, word_index, sequence_index: int = 0)"),Zb.forEach(t),o_=o(I_,` if batch size is greater or equal to
1`),I_.forEach(t),Bi.forEach(t),r_=c(Y),Ls=a(Y,"P",{});var Jb=s(Ls);a_=o(Jb,`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.`),Jb.forEach(t),Y.forEach(t),s_=c(P),kt=a(P,"DIV",{class:!0});var Wi=s(kt);p(Fn.$$.fragment,Wi),i_=c(Wi),Ds=a(Wi,"P",{});var Xb=s(Ds);d_=o(Xb,"Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),Xb.forEach(t),Wi.forEach(t),P.forEach(t),this.h()},h(){l(y,"name","hf:doc:metadata"),l(y,"content",JSON.stringify(hv)),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(Tt,"href","https://github.com/huggingface/tokenizers"),l(Tt,"rel","nofollow"),l(Cn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(An,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Sn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Bn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.SpecialTokensMixin"),l(Wn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(On,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Un,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"),l(Rn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(yt,"href","https://github.com/huggingface/tokenizers"),l(yt,"rel","nofollow"),l(Ze,"id","transformers.PreTrainedTokenizer"),l(Ze,"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(Ze,"href","#transformers.PreTrainedTokenizer"),l(Ne,"class","relative group"),l(Mn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Vn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained"),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(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(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(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(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(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(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(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(ot,"id","transformers.PreTrainedTokenizerFast"),l(ot,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ot,"href","#transformers.PreTrainedTokenizerFast"),l(Ae,"class","relative group"),l(Gn,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Ot,"href","https://huggingface.co/docs/tokenizers"),l(Ot,"rel","nofollow"),l(jn,"href","../fast_tokenizers"),l(Hn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Zn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained"),l(at,"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,"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(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(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(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(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(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(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(mt,"id","transformers.BatchEncoding"),l(mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(mt,"href","#transformers.BatchEncoding"),l(Se,"class","relative group"),l(rn,"href","/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__"),l(Jn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode_plus"),l(Xn,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_encode_plus"),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(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(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($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(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ro,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.CharSpan"),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(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(Z,"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(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_o,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.TokenSpan"),l(L,"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(w,"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,y),$(i,F,b),$(i,q,b),e(q,E),e(E,W),m(v,W,null),e(q,D),e(q,So),e(So,Ui),$(i,Os,b),$(i,je,b),e(je,Ri),e(je,Tt),e(Tt,Mi),e(je,Vi),$(i,Us,b),$(i,He,b),e(He,Bo),e(Bo,Gi),e(He,ji),e(He,Wo),e(Wo,Hi),$(i,Rs,b),$(i,O,b),e(O,Zi),e(O,Cn),e(Cn,Ji),e(O,Xi),e(O,An),e(An,Yi),e(O,Qi),e(O,Sn),e(Sn,Ki),e(O,ed),e(O,Bn),e(Bn,td),e(O,nd),$(i,Ms,b),$(i,De,b),e(De,Wn),e(Wn,od),e(De,rd),e(De,On),e(On,ad),e(De,sd),$(i,Vs,b),$(i,me,b),e(me,Oo),e(Oo,id),e(me,dd),e(me,Uo),e(Uo,cd),e(me,ld),e(me,Ro),e(Ro,hd),$(i,Gs,b),$(i,I,b),e(I,Un),e(Un,pd),e(I,md),e(I,Rn),e(Rn,fd),e(I,ud),e(I,Mo),e(Mo,_d),e(I,gd),e(I,Vo),e(Vo,kd),e(I,bd),e(I,Go),e(Go,vd),e(I,Td),e(I,jo),e(jo,yd),e(I,wd),e(I,Ho),e(Ho,zd),e(I,xd),e(I,yt),e(yt,Ed),e(I,$d),$(i,js,b),$(i,Ne,b),e(Ne,Ze),e(Ze,Zo),m(wt,Zo,null),e(Ne,Pd),e(Ne,Jo),e(Jo,qd),$(i,Hs,b),$(i,g,b),m(zt,g,null),e(g,Id),e(g,Xo),e(Xo,Fd),e(g,Ld),e(g,xt),e(xt,Dd),e(xt,Mn),e(Mn,Nd),e(xt,Cd),e(g,Ad),e(g,Yo),e(Yo,Sd),e(g,Bd),e(g,Qo),e(Qo,Wd),e(g,Od),e(g,Ko),e(Ko,Ud),e(g,Rd),e(g,N),e(N,fe),e(fe,er),e(er,Md),e(fe,Vd),e(fe,tr),e(tr,Gd),e(fe,jd),e(fe,nr),e(nr,Hd),e(fe,Zd),e(N,Jd),e(N,U),e(U,or),e(or,Xd),e(U,Yd),e(U,rr),e(rr,Qd),e(U,Kd),e(U,ar),e(ar,ec),e(U,tc),e(U,sr),e(sr,nc),e(U,oc),e(U,ir),e(ir,rc),e(U,ac),e(N,sc),e(N,Q),e(Q,dr),e(dr,ic),e(Q,dc),e(Q,cr),e(cr,cc),e(Q,lc),e(Q,lr),e(lr,hc),e(Q,pc),e(Q,hr),e(hr,mc),e(Q,fc),e(N,uc),e(N,R),e(R,pr),e(pr,_c),e(R,gc),e(R,mr),e(mr,kc),e(R,bc),e(R,fr),e(fr,vc),e(R,Tc),e(R,ur),e(ur,yc),e(R,wc),e(R,Vn),e(Vn,zc),e(R,xc),e(N,Ec),e(N,Je),e(Je,_r),e(_r,$c),e(Je,Pc),e(Je,gr),e(gr,qc),e(Je,Ic),e(N,Fc),e(N,K),e(K,kr),e(kr,Lc),e(K,Dc),e(K,br),e(br,Nc),e(K,Cc),e(K,vr),e(vr,Ac),e(K,Sc),e(K,Tr),e(Tr,Bc),e(K,Wc),e(N,Oc),e(N,ee),e(ee,yr),e(yr,Uc),e(ee,Rc),e(ee,wr),e(wr,Mc),e(ee,Vc),e(ee,zr),e(zr,Gc),e(ee,jc),e(ee,xr),e(xr,Hc),e(ee,Zc),e(g,Jc),e(g,Xe),m(Et,Xe,null),e(Xe,Xc),e(Xe,Er),e(Er,Yc),e(g,Qc),e(g,Ye),m($t,Ye,null),e(Ye,Kc),e(Ye,$r),e($r,el),e(g,tl),e(g,ue),m(Pt,ue,null),e(ue,nl),e(ue,Pr),e(Pr,ol),e(ue,rl),e(ue,qt),e(qt,al),e(qt,qr),e(qr,sl),e(qt,il),e(g,dl),e(g,_e),m(It,_e,null),e(_e,cl),e(_e,Ir),e(Ir,ll),e(_e,hl),e(_e,Ft),e(Ft,pl),e(Ft,Fr),e(Fr,ml),e(Ft,fl),e(g,ul),e(g,ge),m(Lt,ge,null),e(ge,_l),e(ge,Lr),e(Lr,gl),e(ge,kl),m(Qe,ge,null),e(g,bl),e(g,Ke),m(Dt,Ke,null),e(Ke,vl),e(Ke,Dr),e(Dr,Tl),e(g,yl),e(g,et),m(Nt,et,null),e(et,wl),e(et,Nr),e(Nr,zl),e(g,xl),e(g,tt),m(Ct,tt,null),e(tt,El),e(tt,Cr),e(Cr,$l),e(g,Pl),e(g,ke),m(At,ke,null),e(ke,ql),e(ke,Ar),e(Ar,Il),e(ke,Fl),m(nt,ke,null),e(g,Ll),e(g,be),m(St,be,null),e(be,Dl),e(be,Sr),e(Sr,Nl),e(be,Cl),e(be,Ce),e(Ce,Al),e(Ce,Br),e(Br,Sl),e(Ce,Bl),e(Ce,Wr),e(Wr,Wl),e(Ce,Ol),e(g,Ul),e(g,ve),m(Bt,ve,null),e(ve,Rl),e(ve,Or),e(Or,Ml),e(ve,Vl),e(ve,Ur),e(Ur,Gl),$(i,Zs,b),$(i,Ae,b),e(Ae,ot),e(ot,Rr),m(Wt,Rr,null),e(Ae,jl),e(Ae,Mr),e(Mr,Hl),$(i,Js,b),$(i,te,b),e(te,Zl),e(te,Gn),e(Gn,Jl),e(te,Xl),e(te,Ot),e(Ot,Yl),e(te,Ql),e(te,jn),e(jn,Kl),e(te,eh),$(i,Xs,b),$(i,k,b),m(Ut,k,null),e(k,th),e(k,Vr),e(Vr,nh),e(k,oh),e(k,Rt),e(Rt,rh),e(Rt,Hn),e(Hn,ah),e(Rt,sh),e(k,ih),e(k,Gr),e(Gr,dh),e(k,ch),e(k,jr),e(jr,lh),e(k,hh),e(k,Hr),e(Hr,ph),e(k,mh),e(k,C),e(C,Te),e(Te,Zr),e(Zr,fh),e(Te,uh),e(Te,Jr),e(Jr,_h),e(Te,gh),e(Te,Xr),e(Xr,kh),e(Te,bh),e(C,vh),e(C,M),e(M,Yr),e(Yr,Th),e(M,yh),e(M,Qr),e(Qr,wh),e(M,zh),e(M,Kr),e(Kr,xh),e(M,Eh),e(M,ea),e(ea,$h),e(M,Ph),e(M,ta),e(ta,qh),e(M,Ih),e(C,Fh),e(C,ne),e(ne,na),e(na,Lh),e(ne,Dh),e(ne,oa),e(oa,Nh),e(ne,Ch),e(ne,ra),e(ra,Ah),e(ne,Sh),e(ne,aa),e(aa,Bh),e(ne,Wh),e(C,Oh),e(C,V),e(V,sa),e(sa,Uh),e(V,Rh),e(V,ia),e(ia,Mh),e(V,Vh),e(V,da),e(da,Gh),e(V,jh),e(V,ca),e(ca,Hh),e(V,Zh),e(V,Zn),e(Zn,Jh),e(V,Xh),e(C,Yh),e(C,rt),e(rt,la),e(la,Qh),e(rt,Kh),e(rt,ha),e(ha,ep),e(rt,tp),e(C,np),e(C,oe),e(oe,pa),e(pa,op),e(oe,rp),e(oe,ma),e(ma,ap),e(oe,sp),e(oe,fa),e(fa,ip),e(oe,dp),e(oe,ua),e(ua,cp),e(oe,lp),e(C,hp),e(C,re),e(re,_a),e(_a,pp),e(re,mp),e(re,ga),e(ga,fp),e(re,up),e(re,ka),e(ka,_p),e(re,gp),e(re,ba),e(ba,kp),e(re,bp),e(k,vp),e(k,at),m(Mt,at,null),e(at,Tp),e(at,va),e(va,yp),e(k,wp),e(k,st),m(Vt,st,null),e(st,zp),e(st,Ta),e(Ta,xp),e(k,Ep),e(k,ye),m(Gt,ye,null),e(ye,$p),e(ye,ya),e(ya,Pp),e(ye,qp),e(ye,jt),e(jt,Ip),e(jt,wa),e(wa,Fp),e(jt,Lp),e(k,Dp),e(k,we),m(Ht,we,null),e(we,Np),e(we,za),e(za,Cp),e(we,Ap),e(we,Zt),e(Zt,Sp),e(Zt,xa),e(xa,Bp),e(Zt,Wp),e(k,Op),e(k,ze),m(Jt,ze,null),e(ze,Up),e(ze,Ea),e(Ea,Rp),e(ze,Mp),m(it,ze,null),e(k,Vp),e(k,dt),m(Xt,dt,null),e(dt,Gp),e(dt,$a),e($a,jp),e(k,Hp),e(k,ct),m(Yt,ct,null),e(ct,Zp),e(ct,Pa),e(Pa,Jp),e(k,Xp),e(k,lt),m(Qt,lt,null),e(lt,Yp),e(lt,qa),e(qa,Qp),e(k,Kp),e(k,xe),m(Kt,xe,null),e(xe,em),e(xe,Ia),e(Ia,tm),e(xe,nm),m(ht,xe,null),e(k,om),e(k,Ee),m(en,Ee,null),e(Ee,rm),e(Ee,Fa),e(Fa,am),e(Ee,sm),e(Ee,La),e(La,im),e(k,dm),e(k,pt),m(tn,pt,null),e(pt,cm),e(pt,Da),e(Da,lm),$(i,Ys,b),$(i,Se,b),e(Se,mt),e(mt,Na),m(nn,Na,null),e(Se,hm),e(Se,Ca),e(Ca,pm),$(i,Qs,b),$(i,w,b),m(on,w,null),e(w,mm),e(w,ie),e(ie,fm),e(ie,rn),e(rn,Aa),e(Aa,um),e(rn,_m),e(ie,gm),e(ie,Jn),e(Jn,km),e(ie,bm),e(ie,Xn),e(Xn,vm),e(ie,Tm),e(w,ym),e(w,Sa),e(Sa,wm),e(w,zm),e(w,G),m(an,G,null),e(G,xm),e(G,Ba),e(Ba,Em),e(G,$m),e(G,Wa),e(Wa,Pm),e(G,qm),e(G,sn),e(sn,Yn),e(Yn,Oa),e(Oa,Im),e(Yn,Fm),e(sn,Lm),e(sn,Qn),e(Qn,Ua),e(Ua,Dm),e(Qn,Nm),e(G,Cm),e(G,Ra),e(Ra,Am),e(w,Sm),e(w,j),m(dn,j,null),e(j,Bm),e(j,Ma),e(Ma,Wm),e(j,Om),e(j,Va),e(Va,Um),e(j,Rm),e(j,cn),e(cn,Kn),e(Kn,Ga),e(Ga,Mm),e(Kn,Vm),e(cn,Gm),e(cn,eo),e(eo,ja),e(ja,jm),e(eo,Hm),e(j,Zm),e(j,Ha),e(Ha,Jm),e(w,Xm),e(w,ft),m(ln,ft,null),e(ft,Ym),e(ft,Za),e(Za,Qm),e(w,Km),e(w,$e),m(hn,$e,null),e($e,ef),e($e,Ja),e(Ja,tf),e($e,nf),e($e,Be),e(Be,to),e(to,Xa),e(Xa,of),e(to,rf),e(Be,af),e(Be,no),e(no,Ya),e(Ya,sf),e(no,df),e(Be,cf),e(Be,oo),e(oo,Qa),e(Qa,lf),e(oo,hf),e(w,pf),e(w,ut),m(pn,ut,null),e(ut,mf),e(ut,mn),e(mn,ff),e(mn,Ka),e(Ka,uf),e(mn,_f),e(w,gf),e(w,S),m(fn,S,null),e(S,kf),e(S,es),e(es,bf),e(S,vf),e(S,un),e(un,Tf),e(un,ro),e(ro,yf),e(un,wf),e(S,zf),e(S,_n),e(_n,ao),e(ao,ts),e(ts,xf),e(ao,Ef),e(_n,$f),e(_n,so),e(so,ns),e(ns,Pf),e(so,qf),e(S,If),e(S,os),e(os,Ff),e(S,Lf),e(S,gn),e(gn,io),e(io,rs),e(rs,Df),e(io,Nf),e(gn,Cf),e(gn,co),e(co,as),e(as,Af),e(co,Sf),e(w,Bf),e(w,H),m(kn,H,null),e(H,Wf),e(H,We),e(We,Of),e(We,ss),e(ss,Uf),e(We,Rf),e(We,is),e(is,Mf),e(We,Vf),e(H,Gf),e(H,ds),e(ds,jf),e(H,Hf),e(H,bn),e(bn,lo),e(lo,cs),e(cs,Zf),e(lo,Jf),e(bn,Xf),e(bn,ho),e(ho,ls),e(ls,Yf),e(ho,Qf),e(H,Kf),e(H,hs),e(hs,eu),e(w,tu),e(w,Z),m(vn,Z,null),e(Z,nu),e(Z,ps),e(ps,ou),e(Z,ru),e(Z,ms),e(ms,au),e(Z,su),e(Z,Tn),e(Tn,po),e(po,fs),e(fs,iu),e(po,du),e(Tn,cu),e(Tn,mo),e(mo,us),e(us,lu),e(mo,hu),e(Z,pu),e(Z,_s),e(_s,mu),e(w,fu),e(w,_t),m(yn,_t,null),e(_t,uu),e(_t,gs),e(gs,_u),e(w,gu),e(w,gt),m(wn,gt,null),e(gt,ku),e(gt,ks),e(ks,bu),e(w,vu),e(w,B),m(zn,B,null),e(B,Tu),e(B,bs),e(bs,yu),e(B,wu),e(B,vs),e(vs,zu),e(B,xu),e(B,xn),e(xn,Ts),e(Ts,Eu),e(xn,$u),e(xn,ys),e(ys,Pu),e(B,qu),e(B,ws),e(ws,Iu),e(B,Fu),e(B,En),e(En,fo),e(fo,zs),e(zs,Lu),e(fo,Du),e(En,Nu),e(En,uo),e(uo,xs),e(xs,Cu),e(uo,Au),e(w,Su),e(w,L),m($n,L,null),e(L,Bu),e(L,Es),e(Es,Wu),e(L,Ou),e(L,Pn),e(Pn,Uu),e(Pn,_o),e(_o,Ru),e(Pn,Mu),e(L,Vu),e(L,qn),e(qn,go),e(go,$s),e($s,Gu),e(go,ju),e(qn,Hu),e(qn,ko),e(ko,Ps),e(Ps,Zu),e(ko,Ju),e(L,Xu),e(L,qs),e(qs,Yu),e(L,Qu),e(L,In),e(In,bo),e(bo,Is),e(Is,Ku),e(bo,e_),e(In,t_),e(In,vo),e(vo,Fs),e(Fs,n_),e(vo,o_),e(L,r_),e(L,Ls),e(Ls,a_),e(w,s_),e(w,kt),m(Fn,kt,null),e(kt,i_),e(kt,Ds),e(Ds,d_),Ks=!0},p(i,[b]){const Ln={};b&2&&(Ln.$$scope={dirty:b,ctx:i}),Qe.$set(Ln);const Ns={};b&2&&(Ns.$$scope={dirty:b,ctx:i}),nt.$set(Ns);const Cs={};b&2&&(Cs.$$scope={dirty:b,ctx:i}),it.$set(Cs);const As={};b&2&&(As.$$scope={dirty:b,ctx:i}),ht.$set(As)},i(i){Ks||(f(v.$$.fragment,i),f(wt.$$.fragment,i),f(zt.$$.fragment,i),f(Et.$$.fragment,i),f($t.$$.fragment,i),f(Pt.$$.fragment,i),f(It.$$.fragment,i),f(Lt.$$.fragment,i),f(Qe.$$.fragment,i),f(Dt.$$.fragment,i),f(Nt.$$.fragment,i),f(Ct.$$.fragment,i),f(At.$$.fragment,i),f(nt.$$.fragment,i),f(St.$$.fragment,i),f(Bt.$$.fragment,i),f(Wt.$$.fragment,i),f(Ut.$$.fragment,i),f(Mt.$$.fragment,i),f(Vt.$$.fragment,i),f(Gt.$$.fragment,i),f(Ht.$$.fragment,i),f(Jt.$$.fragment,i),f(it.$$.fragment,i),f(Xt.$$.fragment,i),f(Yt.$$.fragment,i),f(Qt.$$.fragment,i),f(Kt.$$.fragment,i),f(ht.$$.fragment,i),f(en.$$.fragment,i),f(tn.$$.fragment,i),f(nn.$$.fragment,i),f(on.$$.fragment,i),f(an.$$.fragment,i),f(dn.$$.fragment,i),f(ln.$$.fragment,i),f(hn.$$.fragment,i),f(pn.$$.fragment,i),f(fn.$$.fragment,i),f(kn.$$.fragment,i),f(vn.$$.fragment,i),f(yn.$$.fragment,i),f(wn.$$.fragment,i),f(zn.$$.fragment,i),f($n.$$.fragment,i),f(Fn.$$.fragment,i),Ks=!0)},o(i){u(v.$$.fragment,i),u(wt.$$.fragment,i),u(zt.$$.fragment,i),u(Et.$$.fragment,i),u($t.$$.fragment,i),u(Pt.$$.fragment,i),u(It.$$.fragment,i),u(Lt.$$.fragment,i),u(Qe.$$.fragment,i),u(Dt.$$.fragment,i),u(Nt.$$.fragment,i),u(Ct.$$.fragment,i),u(At.$$.fragment,i),u(nt.$$.fragment,i),u(St.$$.fragment,i),u(Bt.$$.fragment,i),u(Wt.$$.fragment,i),u(Ut.$$.fragment,i),u(Mt.$$.fragment,i),u(Vt.$$.fragment,i),u(Gt.$$.fragment,i),u(Ht.$$.fragment,i),u(Jt.$$.fragment,i),u(it.$$.fragment,i),u(Xt.$$.fragment,i),u(Yt.$$.fragment,i),u(Qt.$$.fragment,i),u(Kt.$$.fragment,i),u(ht.$$.fragment,i),u(en.$$.fragment,i),u(tn.$$.fragment,i),u(nn.$$.fragment,i),u(on.$$.fragment,i),u(an.$$.fragment,i),u(dn.$$.fragment,i),u(ln.$$.fragment,i),u(hn.$$.fragment,i),u(pn.$$.fragment,i),u(fn.$$.fragment,i),u(kn.$$.fragment,i),u(vn.$$.fragment,i),u(yn.$$.fragment,i),u(wn.$$.fragment,i),u(zn.$$.fragment,i),u($n.$$.fragment,i),u(Fn.$$.fragment,i),Ks=!1},d(i){t(y),i&&t(F),i&&t(q),_(v),i&&t(Os),i&&t(je),i&&t(Us),i&&t(He),i&&t(Rs),i&&t(O),i&&t(Ms),i&&t(De),i&&t(Vs),i&&t(me),i&&t(Gs),i&&t(I),i&&t(js),i&&t(Ne),_(wt),i&&t(Hs),i&&t(g),_(zt),_(Et),_($t),_(Pt),_(It),_(Lt),_(Qe),_(Dt),_(Nt),_(Ct),_(At),_(nt),_(St),_(Bt),i&&t(Zs),i&&t(Ae),_(Wt),i&&t(Js),i&&t(te),i&&t(Xs),i&&t(k),_(Ut),_(Mt),_(Vt),_(Gt),_(Ht),_(Jt),_(it),_(Xt),_(Yt),_(Qt),_(Kt),_(ht),_(en),_(tn),i&&t(Ys),i&&t(Se),_(nn),i&&t(Qs),i&&t(w),_(on),_(an),_(dn),_(ln),_(hn),_(pn),_(fn),_(kn),_(vn),_(yn),_(wn),_(zn),_($n),_(Fn)}}}const hv={local:"tokenizer",sections:[{local:"transformers.PreTrainedTokenizer",title:"PreTrainedTokenizer"},{local:"transformers.PreTrainedTokenizerFast",title:"PreTrainedTokenizerFast"},{local:"transformers.BatchEncoding",title:"BatchEncoding"}],title:"Tokenizer"};function pv(pe){return av(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bv extends tv{constructor(y){super();nv(this,y,pv,lv,ov,{})}}export{bv as default,hv as metadata};
