import{S as Vm,i as Rm,s as Gm,e as r,k as d,w as k,t as o,M as Om,c as s,d as t,m as l,a,x as b,h as n,b as m,G as e,g as P,y as v,q as T,o as y,B as w,v as Xm,L as vs}from"../../chunks/vendor-hf-doc-builder.js";import{T as qr}from"../../chunks/Tip-hf-doc-builder.js";import{D as B}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ts}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ks}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as bs}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ym(E){let p,$,f,h,x;return{c(){p=r("p"),$=o("This method is deprecated, "),f=r("code"),h=o("__call__"),x=o(" should be used instead.")},l(c){p=s(c,"P",{});var _=a(p);$=n(_,"This method is deprecated, "),f=s(_,"CODE",{});var M=a(f);h=n(M,"__call__"),M.forEach(t),x=n(_," should be used instead."),_.forEach(t)},m(c,_){P(c,p,_),e(p,$),e(p,f),e(f,h),e(p,x)},d(c){c&&t(p)}}}function Hm(E){let p,$,f,h,x;return{c(){p=r("p"),$=o("This method is deprecated, "),f=r("code"),h=o("__call__"),x=o(" should be used instead.")},l(c){p=s(c,"P",{});var _=a(p);$=n(_,"This method is deprecated, "),f=s(_,"CODE",{});var M=a(f);h=n(M,"__call__"),M.forEach(t),x=n(_," should be used instead."),_.forEach(t)},m(c,_){P(c,p,_),e(p,$),e(p,f),e(f,h),e(p,x)},d(c){c&&t(p)}}}function Qm(E){let p,$,f,h,x;return{c(){p=r("p"),$=o("Passing "),f=r("code"),h=o("token=True"),x=o(" is required when you want to use a private model.")},l(c){p=s(c,"P",{});var _=a(p);$=n(_,"Passing "),f=s(_,"CODE",{});var M=a(f);h=n(M,"token=True"),M.forEach(t),x=n(_," is required when you want to use a private model."),_.forEach(t)},m(c,_){P(c,p,_),e(p,$),e(p,f),e(f,h),e(p,x)},d(c){c&&t(p)}}}function Km(E){let p,$,f,h,x;return h=new Ts({props:{code:"JTIzJTIwV2UlMjBjYW4ndCUyMGluc3RhbnRpYXRlJTIwZGlyZWN0bHklMjB0aGUlMjBiYXNlJTIwY2xhc3MlMjAqUHJlVHJhaW5lZFRva2VuaXplckJhc2UqJTIwc28lMjBsZXQncyUyMHNob3clMjBvdXIlMjBleGFtcGxlcyUyMG9uJTIwYSUyMGRlcml2ZWQlMjBjbGFzcyUzQSUyMEJlcnRUb2tlbml6ZXIlMEElMjMlMjBEb3dubG9hZCUyMHZvY2FidWxhcnklMjBmcm9tJTIwaHVnZ2luZ2ZhY2UuY28lMjBhbmQlMjBjYWNoZS4lMEF0b2tlbml6ZXIlMjAlM0QlMjBCZXJ0VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMEElMjMlMjBEb3dubG9hZCUyMHZvY2FidWxhcnklMjBmcm9tJTIwaHVnZ2luZ2ZhY2UuY28lMjAodXNlci11cGxvYWRlZCklMjBhbmQlMjBjYWNoZS4lMEF0b2tlbml6ZXIlMjAlM0QlMjBCZXJ0VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkYm1keiUyRmJlcnQtYmFzZS1nZXJtYW4tY2FzZWQlMjIpJTBBJTBBJTIzJTIwSWYlMjB2b2NhYnVsYXJ5JTIwZmlsZXMlMjBhcmUlMjBpbiUyMGElMjBkaXJlY3RvcnklMjAoZS5nLiUyMHRva2VuaXplciUyMHdhcyUyMHNhdmVkJTIwdXNpbmclMjAqc2F2ZV9wcmV0cmFpbmVkKCcuJTJGdGVzdCUyRnNhdmVkX21vZGVsJTJGJykqKSUwQXRva2VuaXplciUyMCUzRCUyMEJlcnRUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMi4lMkZ0ZXN0JTJGc2F2ZWRfbW9kZWwlMkYlMjIpJTBBJTBBJTIzJTIwSWYlMjB0aGUlMjB0b2tlbml6ZXIlMjB1c2VzJTIwYSUyMHNpbmdsZSUyMHZvY2FidWxhcnklMjBmaWxlJTJDJTIweW91JTIwY2FuJTIwcG9pbnQlMjBkaXJlY3RseSUyMHRvJTIwdGhpcyUyMGZpbGUlMEF0b2tlbml6ZXIlMjAlM0QlMjBCZXJ0VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjIuJTJGdGVzdCUyRnNhdmVkX21vZGVsJTJGbXlfdm9jYWIudHh0JTIyKSUwQSUwQSUyMyUyMFlvdSUyMGNhbiUyMGxpbmslMjB0b2tlbnMlMjB0byUyMHNwZWNpYWwlMjB2b2NhYnVsYXJ5JTIwd2hlbiUyMGluc3RhbnRpYXRpbmclMEF0b2tlbml6ZXIlMjAlM0QlMjBCZXJ0VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiUyQyUyMHVua190b2tlbiUzRCUyMiUzQ3VuayUzRSUyMiklMEElMjMlMjBZb3UlMjBzaG91bGQlMjBiZSUyMHN1cmUlMjAnJTNDdW5rJTNFJyUyMGlzJTIwaW4lMjB0aGUlMjB2b2NhYnVsYXJ5JTIwd2hlbiUyMGRvaW5nJTIwdGhhdC4lMEElMjMlMjBPdGhlcndpc2UlMjB1c2UlMjB0b2tlbml6ZXIuYWRkX3NwZWNpYWxfdG9rZW5zKCU3Qid1bmtfdG9rZW4nJTNBJTIwJyUzQ3VuayUzRSclN0QpJTIwaW5zdGVhZCklMEFhc3NlcnQlMjB0b2tlbml6ZXIudW5rX3Rva2VuJTIwJTNEJTNEJTIwJTIyJTNDdW5rJTNFJTIy",highlighted:`<span class="hljs-comment"># We can&#x27;t instantiate directly the base class *PreTrainedTokenizerBase* so let&#x27;s show our examples on a derived class: BertTokenizer</span>
<span class="hljs-comment"># Download vocabulary from huggingface.co and cache.</span>
tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

<span class="hljs-comment"># Download vocabulary from huggingface.co (user-uploaded) and cache.</span>
tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;dbmdz/bert-base-german-cased&quot;</span>)

<span class="hljs-comment"># If vocabulary files are in a directory (e.g. tokenizer was saved using *save_pretrained(&#x27;./test/saved_model/&#x27;)*)</span>
tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;./test/saved_model/&quot;</span>)

<span class="hljs-comment"># If the tokenizer uses a single vocabulary file, you can point directly to this file</span>
tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;./test/saved_model/my_vocab.txt&quot;</span>)

<span class="hljs-comment"># You can link tokens to special vocabulary when instantiating</span>
tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>, unk_token=<span class="hljs-string">&quot;&lt;unk&gt;&quot;</span>)
<span class="hljs-comment"># You should be sure &#x27;&lt;unk&gt;&#x27; is in the vocabulary when doing that.</span>
<span class="hljs-comment"># Otherwise use tokenizer.add_special_tokens({&#x27;unk_token&#x27;: &#x27;&lt;unk&gt;&#x27;}) instead)</span>
<span class="hljs-keyword">assert</span> tokenizer.unk_token == <span class="hljs-string">&quot;&lt;unk&gt;&quot;</span>`}}),{c(){p=r("p"),$=o("Examples:"),f=d(),k(h.$$.fragment)},l(c){p=s(c,"P",{});var _=a(p);$=n(_,"Examples:"),_.forEach(t),f=l(c),b(h.$$.fragment,c)},m(c,_){P(c,p,_),e(p,$),P(c,f,_),v(h,c,_),x=!0},p:vs,i(c){x||(T(h.$$.fragment,c),x=!0)},o(c){y(h.$$.fragment,c),x=!1},d(c){c&&t(p),c&&t(f),w(h,c)}}}function eh(E){let p,$,f,h,x,c,_,M;return{c(){p=r("p"),$=o("If the "),f=r("code"),h=o("encoded_inputs"),x=o(` passed are dictionary of numpy arrays, PyTorch tensors or TensorFlow tensors, the
result will use the same type unless you provide a different tensor type with `),c=r("code"),_=o("return_tensors"),M=o(`. In the case of
PyTorch tensors, you will lose the specific device of your tensors however.`)},l(ge){p=s(ge,"P",{});var S=a(p);$=n(S,"If the "),f=s(S,"CODE",{});var I=a(f);h=n(I,"encoded_inputs"),I.forEach(t),x=n(S,` passed are dictionary of numpy arrays, PyTorch tensors or TensorFlow tensors, the
result will use the same type unless you provide a different tensor type with `),c=s(S,"CODE",{});var no=a(c);_=n(no,"return_tensors"),no.forEach(t),M=n(S,`. In the case of
PyTorch tensors, you will lose the specific device of your tensors however.`),S.forEach(t)},m(ge,S){P(ge,p,S),e(p,$),e(p,f),e(f,h),e(p,x),e(p,c),e(c,_),e(p,M)},d(ge){ge&&t(p)}}}function th(E){let p,$,f,h,x;return h=new Ts({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(){p=r("p"),$=o("Examples:"),f=d(),k(h.$$.fragment)},l(c){p=s(c,"P",{});var _=a(p);$=n(_,"Examples:"),_.forEach(t),f=l(c),b(h.$$.fragment,c)},m(c,_){P(c,p,_),e(p,$),P(c,f,_),v(h,c,_),x=!0},p:vs,i(c){x||(T(h.$$.fragment,c),x=!0)},o(c){y(h.$$.fragment,c),x=!1},d(c){c&&t(p),c&&t(f),w(h,c)}}}function oh(E){let p,$;return{c(){p=r("p"),$=o("This API is experimental and may have some slight breaking changes in the next releases.")},l(f){p=s(f,"P",{});var h=a(p);$=n(h,"This API is experimental and may have some slight breaking changes in the next releases."),h.forEach(t)},m(f,h){P(f,p,h),e(p,$)},d(f){f&&t(p)}}}function nh(E){let p,$,f,h,x;return h=new Ts({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMGFkZCUyMGElMjBuZXclMjBjbGFzc2lmaWNhdGlvbiUyMHRva2VuJTIwdG8lMjBHUFQtMiUwQXRva2VuaXplciUyMCUzRCUyMEdQVDJUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBHUFQyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBJTBBc3BlY2lhbF90b2tlbnNfZGljdCUyMCUzRCUyMCU3QiUyMmNsc190b2tlbiUyMiUzQSUyMCUyMiUzQ0NMUyUzRSUyMiU3RCUwQSUwQW51bV9hZGRlZF90b2tzJTIwJTNEJTIwdG9rZW5pemVyLmFkZF9zcGVjaWFsX3Rva2VucyhzcGVjaWFsX3Rva2Vuc19kaWN0KSUwQXByaW50KCUyMldlJTIwaGF2ZSUyMGFkZGVkJTIyJTJDJTIwbnVtX2FkZGVkX3Rva3MlMkMlMjAlMjJ0b2tlbnMlMjIpJTBBJTIzJTIwTm90aWNlJTNBJTIwcmVzaXplX3Rva2VuX2VtYmVkZGluZ3MlMjBleHBlY3QlMjB0byUyMHJlY2VpdmUlMjB0aGUlMjBmdWxsJTIwc2l6ZSUyMG9mJTIwdGhlJTIwbmV3JTIwdm9jYWJ1bGFyeSUyQyUyMGkuZS4lMkMlMjB0aGUlMjBsZW5ndGglMjBvZiUyMHRoZSUyMHRva2VuaXplci4lMEFtb2RlbC5yZXNpemVfdG9rZW5fZW1iZWRkaW5ncyhsZW4odG9rZW5pemVyKSklMEElMEFhc3NlcnQlMjB0b2tlbml6ZXIuY2xzX3Rva2VuJTIwJTNEJTNEJTIwJTIyJTNDQ0xTJTNFJTIy",highlighted:`<span class="hljs-comment"># Let&#x27;s see how to add a new classification token to GPT-2</span>
tokenizer = GPT2Tokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
model = GPT2Model.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)

special_tokens_dict = {<span class="hljs-string">&quot;cls_token&quot;</span>: <span class="hljs-string">&quot;&lt;CLS&gt;&quot;</span>}

num_added_toks = tokenizer.add_special_tokens(special_tokens_dict)
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;We have added&quot;</span>, num_added_toks, <span class="hljs-string">&quot;tokens&quot;</span>)
<span class="hljs-comment"># Notice: resize_token_embeddings expect to receive the full size of the new vocabulary, i.e., the length of the tokenizer.</span>
model.resize_token_embeddings(<span class="hljs-built_in">len</span>(tokenizer))

<span class="hljs-keyword">assert</span> tokenizer.cls_token == <span class="hljs-string">&quot;&lt;CLS&gt;&quot;</span>`}}),{c(){p=r("p"),$=o("Examples:"),f=d(),k(h.$$.fragment)},l(c){p=s(c,"P",{});var _=a(p);$=n(_,"Examples:"),_.forEach(t),f=l(c),b(h.$$.fragment,c)},m(c,_){P(c,p,_),e(p,$),P(c,f,_),v(h,c,_),x=!0},p:vs,i(c){x||(T(h.$$.fragment,c),x=!0)},o(c){y(h.$$.fragment,c),x=!1},d(c){c&&t(p),c&&t(f),w(h,c)}}}function rh(E){let p,$,f,h,x;return h=new Ts({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMGluY3JlYXNlJTIwdGhlJTIwdm9jYWJ1bGFyeSUyMG9mJTIwQmVydCUyMG1vZGVsJTIwYW5kJTIwdG9rZW5pemVyJTBBdG9rZW5pemVyJTIwJTNEJTIwQmVydFRva2VuaXplckZhc3QuZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmVydE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEElMEFudW1fYWRkZWRfdG9rcyUyMCUzRCUyMHRva2VuaXplci5hZGRfdG9rZW5zKCU1QiUyMm5ld190b2sxJTIyJTJDJTIwJTIybXlfbmV3LXRvazIlMjIlNUQpJTBBcHJpbnQoJTIyV2UlMjBoYXZlJTIwYWRkZWQlMjIlMkMlMjBudW1fYWRkZWRfdG9rcyUyQyUyMCUyMnRva2VucyUyMiklMEElMjMlMjBOb3RpY2UlM0ElMjByZXNpemVfdG9rZW5fZW1iZWRkaW5ncyUyMGV4cGVjdCUyMHRvJTIwcmVjZWl2ZSUyMHRoZSUyMGZ1bGwlMjBzaXplJTIwb2YlMjB0aGUlMjBuZXclMjB2b2NhYnVsYXJ5JTJDJTIwaS5lLiUyQyUyMHRoZSUyMGxlbmd0aCUyMG9mJTIwdGhlJTIwdG9rZW5pemVyLiUwQW1vZGVsLnJlc2l6ZV90b2tlbl9lbWJlZGRpbmdzKGxlbih0b2tlbml6ZXIpKQ==",highlighted:`<span class="hljs-comment"># Let&#x27;s see how to increase the vocabulary of Bert model and tokenizer</span>
tokenizer = BertTokenizerFast.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
model = BertModel.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)

num_added_toks = tokenizer.add_tokens([<span class="hljs-string">&quot;new_tok1&quot;</span>, <span class="hljs-string">&quot;my_new-tok2&quot;</span>])
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;We have added&quot;</span>, num_added_toks, <span class="hljs-string">&quot;tokens&quot;</span>)
<span class="hljs-comment"># Notice: resize_token_embeddings expect to receive the full size of the new vocabulary, i.e., the length of the tokenizer.</span>
model.resize_token_embeddings(<span class="hljs-built_in">len</span>(tokenizer))`}}),{c(){p=r("p"),$=o("Examples:"),f=d(),k(h.$$.fragment)},l(c){p=s(c,"P",{});var _=a(p);$=n(_,"Examples:"),_.forEach(t),f=l(c),b(h.$$.fragment,c)},m(c,_){P(c,p,_),e(p,$),P(c,f,_),v(h,c,_),x=!0},p:vs,i(c){x||(T(h.$$.fragment,c),x=!0)},o(c){y(h.$$.fragment,c),x=!1},d(c){c&&t(p),c&&t(f),w(h,c)}}}function sh(E){let p,$,f,h,x,c,_,M,ge,S,I,no,ro,ys,ws,so,zs,xs,ao,$s,Ps,io,Bs,Es,Mr,lo,qs,Ir,ke,Le,jo,at,Ms,Jo,Is,Lr,u,it,Ls,be,Ns,co,Ws,Us,po,Ds,js,Js,Fo,Fs,Ss,So,As,Cs,L,K,Ao,Zs,Vs,Co,Rs,Gs,Zo,Os,Xs,Ys,U,Vo,Hs,Qs,Ro,Ks,ea,Go,ta,oa,Oo,na,ra,Xo,sa,aa,ia,V,Yo,da,la,Ho,ca,pa,Qo,ma,ha,Ko,ua,fa,_a,D,en,ga,ka,tn,ba,va,on,Ta,ya,nn,wa,za,mo,xa,$a,Pa,Ne,rn,Ba,Ea,sn,qa,Ma,Ia,R,an,La,Na,dn,Wa,Ua,ln,Da,ja,cn,Ja,Fa,Sa,G,pn,Aa,Ca,mn,Za,Va,hn,Ra,Ga,un,Oa,Xa,Ya,We,dt,Ha,fn,Qa,Ka,Ue,lt,ei,_n,ti,oi,De,ct,ni,gn,ri,si,ee,pt,ai,kn,ii,di,je,li,te,mt,ci,bn,pi,mi,vn,hi,ui,Je,ht,fi,Tn,_i,gi,Fe,ut,ki,ft,bi,yn,vi,Ti,yi,oe,_t,wi,ho,zi,uo,xi,$i,wn,Pi,Bi,ne,gt,Ei,zn,qi,Mi,kt,Ii,xn,Li,Ni,Wi,re,bt,Ui,$n,Di,ji,vt,Ji,Pn,Fi,Si,Ai,se,Tt,Ci,Bn,Zi,Vi,Se,Ri,O,yt,Gi,wt,Oi,fo,Xi,Yi,Hi,Ae,Qi,Ce,Ki,Ze,zt,ed,ve,td,En,od,nd,qn,rd,sd,ad,ae,xt,id,Mn,dd,ld,ie,In,cd,pd,Ln,md,hd,Nn,ud,fd,_d,j,$t,gd,Wn,kd,bd,Y,vd,Un,Td,yd,Dn,wd,zd,jn,xd,$d,Pd,Te,Bd,Jn,Ed,qd,Fn,Md,Id,Ld,Ve,Nd,Re,Pt,Wd,A,Ud,Sn,Dd,jd,An,Jd,Fd,Cn,Sd,Ad,Zn,Cd,Zd,Vd,Ge,Bt,Rd,Vn,Gd,Od,de,Et,Xd,Rn,Yd,Hd,Oe,Qd,le,qt,Kd,Mt,el,Gn,tl,ol,nl,Xe,rl,X,It,sl,On,al,il,Lt,dl,Xn,ll,cl,pl,Nt,ml,Yn,hl,ul,fl,ce,Wt,_l,Hn,gl,kl,Ut,bl,Qn,vl,Tl,yl,Ye,Dt,wl,jt,zl,Kn,xl,$l,Pl,He,Jt,Bl,er,El,Nr,ye,Qe,tr,Ft,ql,or,Ml,Wr,W,St,Il,we,Ll,_o,Nl,Wl,go,Ul,Dl,jl,q,At,Jl,nr,Fl,Sl,rr,Al,Cl,Ct,Zl,ko,Vl,Rl,Gl,Zt,Ol,sr,Xl,Yl,Hl,Vt,ar,Ql,Kl,Rt,ec,ir,tc,oc,nc,C,rc,bo,sc,ac,dr,ic,dc,lr,lc,cc,cr,pc,mc,hc,Ke,uc,J,Gt,fc,pr,_c,gc,mr,kc,bc,Ot,vc,vo,Tc,yc,wc,et,zc,pe,Xt,xc,ze,$c,hr,Pc,Bc,ur,Ec,qc,Mc,fr,Ic,Ur,xe,tt,_r,Yt,Lc,gr,Nc,Dr,$e,Ht,Wc,Pe,Uc,kr,Dc,jc,ot,Jc,br,Fc,Sc,Ac,jr,Be,Qt,Cc,vr,Zc,Jr,Ee,Kt,Vc,Tr,Rc,Fr;return c=new ks({}),at=new ks({}),it=new B({props:{name:"class transformers.PreTrainedTokenizerBase",anchor:"transformers.PreTrainedTokenizerBase",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.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/v4.32.0/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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.split_special_tokens",description:`<strong>split_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the special tokens should be split during the tokenization process. The default behavior is
to not split special tokens. This means that if <code>&lt;s&gt;</code> is the <code>bos_token</code>, then <code>tokenizer.tokenize(&quot;&lt;s&gt;&quot;) = [&apos;&lt;s&gt;</code>]. Otherwise, if <code>split_special_tokens=True</code>, then <code>tokenizer.tokenize(&quot;&lt;s&gt;&quot;)</code> will be give <code>[&apos;&lt;&apos;, &apos;s&apos;, &apos;&gt;&apos;]</code>. This argument is only supported for <code>slow</code> tokenizers for the moment.`,name:"split_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L1504"}}),dt=new B({props:{name:"__call__",anchor:"transformers.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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/v4.32.0/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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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/v4.32.0/src/transformers/tokenization_utils_base.py#L2528",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),lt=new B({props:{name:"as_target_tokenizer",anchor:"transformers.PreTrainedTokenizerBase.as_target_tokenizer",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3654"}}),ct=new B({props:{name:"batch_decode",anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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/v4.32.0/src/transformers/tokenization_utils_base.py#L3486",returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),pt=new B({props:{name:"batch_encode_plus",anchor:"transformers.PreTrainedTokenizerBase.batch_encode_plus",parameters:[{name:"batch_text_or_text_pairs",val:": typing.Union[typing.List[str], typing.List[typing.Tuple[str, str]], typing.List[typing.List[str]], typing.List[typing.Tuple[typing.List[str], typing.List[str]]], typing.List[typing.List[int]], typing.List[typing.Tuple[typing.List[int], typing.List[int]]]]"},{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.PreTrainedTokenizerBase.batch_encode_plus.batch_text_or_text_pairs",description:`<strong>batch_text_or_text_pairs</strong> (<code>List[str]</code>, <code>List[Tuple[str, str]]</code>, <code>List[List[str]]</code>, <code>List[Tuple[List[str], List[str]]]</code>, and for not-fast tokenizers, also <code>List[List[int]]</code>, <code>List[Tuple[List[int], List[int]]]</code>) &#x2014;
Batch of sequences or pair of sequences to be encoded. This can be a list of
string/string-sequences/int-sequences or a list of pair of string/string-sequences/int-sequence (see
details in <code>encode_plus</code>).`,name:"batch_text_or_text_pairs"},{anchor:"transformers.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.batch_encode_plus.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.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/v4.32.0/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.PreTrainedTokenizerBase.batch_encode_plus.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.PreTrainedTokenizerBase.batch_encode_plus.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/v4.32.0/src/transformers/tokenization_utils_base.py#L2825",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),je=new qr({props:{warning:!0,$$slots:{default:[Ym]},$$scope:{ctx:E}}}),mt=new B({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.PreTrainedTokenizerBase.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.build_inputs_with_special_tokens.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.PreTrainedTokenizerBase.build_inputs_with_special_tokens.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3121",returnDescription:`
<p>The model input with special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ht=new B({props:{name:"clean_up_tokenization",anchor:"transformers.PreTrainedTokenizerBase.clean_up_tokenization",parameters:[{name:"out_string",val:": str"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.clean_up_tokenization.out_string",description:"<strong>out_string</strong> (<code>str</code>) &#x2014; The text to clean up.",name:"out_string"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3597",returnDescription:`
<p>The cleaned-up string.</p>
`,returnType:`
<p><code>str</code></p>
`}}),ut=new B({props:{name:"convert_tokens_to_string",anchor:"transformers.PreTrainedTokenizerBase.convert_tokens_to_string",parameters:[{name:"tokens",val:": typing.List[str]"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.convert_tokens_to_string.tokens",description:"<strong>tokens</strong> (<code>List[str]</code>) &#x2014; The token to join in a string.",name:"tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3473",returnDescription:`
<p>The joined tokens.</p>
`,returnType:`
<p><code>str</code></p>
`}}),_t=new B({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.PreTrainedTokenizerBase.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.create_token_type_ids_from_sequences.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.PreTrainedTokenizerBase.create_token_type_ids_from_sequences.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3101",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),gt=new B({props:{name:"decode",anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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/v4.32.0/src/transformers/tokenization_utils_base.py#L3520",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),bt=new B({props:{name:"encode",anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.encode.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.encode.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.encode.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/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/v4.32.0/src/transformers/tokenization_utils_base.py#L2336",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>
`}}),Tt=new B({props:{name:"encode_plus",anchor:"transformers.PreTrainedTokenizerBase.encode_plus",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:"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.PreTrainedTokenizerBase.encode_plus.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code> or <code>List[int]</code> (the latter only for not-fast tokenizers)) &#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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.encode_plus.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.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/v4.32.0/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.PreTrainedTokenizerBase.encode_plus.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.PreTrainedTokenizerBase.encode_plus.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/v4.32.0/src/transformers/tokenization_utils_base.py#L2729",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Se=new qr({props:{warning:!0,$$slots:{default:[Hm]},$$scope:{ctx:E}}}),yt=new B({props:{name:"from_pretrained",anchor:"transformers.PreTrainedTokenizerBase.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"*init_inputs",val:""},{name:"cache_dir",val:": typing.Union[str, os.PathLike, NoneType] = None"},{name:"force_download",val:": bool = False"},{name:"local_files_only",val:": bool = False"},{name:"token",val:": typing.Union[str, bool, NoneType] = None"},{name:"revision",val:": str = 'main'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a predefined tokenizer hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or namespaced under a
user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>A path to a <em>directory</em> containing vocabulary files required by the tokenizer, for instance saved
using the <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained">save_pretrained()</a> method, e.g.,
<code>./my_model_directory/</code>.</li>
<li>(<strong>Deprecated</strong>, not applicable to all derived classes) A path or url to a single saved vocabulary
file (if and only if the tokenizer only requires a single vocabulary file like Bert or XLNet), e.g.,
<code>./my_model_directory/vocab.txt</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded predefined tokenizer vocabulary files should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download the vocabulary files and override the cached versions if they
exist.`,name:"force_download"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Attempt to resume the download if such a file
exists.`,name:"resume_download"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.token",description:`<strong>token</strong> (<code>str</code> or <em>bool</em>, <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>).`,name:"token"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only rely on local files and not to attempt to download any files.`,name:"local_files_only"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo on huggingface.co (e.g. for
facebook/rag-token-base), specify it here.`,name:"subfolder"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.inputs",description:`<strong>inputs</strong> (additional positional arguments, <em>optional</em>) &#x2014;
Will be passed along to the Tokenizer <code>__init__</code> method.`,name:"inputs"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the Tokenizer <code>__init__</code> method. Can be used to set special tokens like <code>bos_token</code>,
<code>eos_token</code>, <code>unk_token</code>, <code>sep_token</code>, <code>pad_token</code>, <code>cls_token</code>, <code>mask_token</code>,
<code>additional_special_tokens</code>. See parameters in the <code>__init__</code> for more details.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L1630"}}),Ae=new qr({props:{$$slots:{default:[Qm]},$$scope:{ctx:E}}}),Ce=new bs({props:{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.example",$$slots:{default:[Km]},$$scope:{ctx:E}}}),zt=new B({props:{name:"get_special_tokens_mask",anchor:"transformers.PreTrainedTokenizerBase.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids of the first sequence.`,name:"token_ids_0"},{anchor:"transformers.PreTrainedTokenizerBase.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
List of ids of the second sequence.`,name:"token_ids_1"},{anchor:"transformers.PreTrainedTokenizerBase.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3566",returnDescription:`
<p>1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p>A list of integers in the range [0, 1]</p>
`}}),xt=new B({props:{name:"get_vocab",anchor:"transformers.PreTrainedTokenizerBase.get_vocab",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L1618",returnDescription:`
<p>The vocabulary.</p>
`,returnType:`
<p><code>Dict[str, int]</code></p>
`}}),$t=new B({props:{name:"pad",anchor:"transformers.PreTrainedTokenizerBase.pad",parameters:[{name:"encoded_inputs",val:": typing.Union[transformers.tokenization_utils_base.BatchEncoding, typing.List[transformers.tokenization_utils_base.BatchEncoding], typing.Dict[str, typing.List[int]], typing.Dict[str, typing.List[typing.List[int]]], typing.List[typing.Dict[str, typing.List[int]]]]"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = True"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"verbose",val:": bool = True"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.pad.encoded_inputs",description:`<strong>encoded_inputs</strong> (<a href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding">BatchEncoding</a>, list of <a href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding">BatchEncoding</a>, <code>Dict[str, List[int]]</code>, <code>Dict[str, List[List[int]]</code> or <code>List[Dict[str, List[int]]]</code>) &#x2014;
Tokenized inputs. Can represent one input (<a href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding">BatchEncoding</a> or <code>Dict[str, List[int]]</code>) or a batch of
tokenized inputs (list of <a href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding">BatchEncoding</a>, <em>Dict[str, List[List[int]]]</em> or <em>List[Dict[str,
List[int]]]</em>) so you can use this method during preprocessing as well as in a PyTorch Dataloader
collate function.</p>
<p>Instead of <code>List[int]</code> you can have tensors (numpy arrays, PyTorch tensors or TensorFlow tensors), see
the note above for the return type.`,name:"encoded_inputs"},{anchor:"transformers.PreTrainedTokenizerBase.pad.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Select a strategy to pad the returned sequences (according to the model&#x2019;s padding side and padding
index) among:</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.PreTrainedTokenizerBase.pad.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length of the returned list and optionally padding length (see above).`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizerBase.pad.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.</p>
<p>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.PreTrainedTokenizerBase.pad.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.PreTrainedTokenizerBase.pad.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.pad.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.`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L2928"}}),Ve=new qr({props:{$$slots:{default:[eh]},$$scope:{ctx:E}}}),Pt=new B({props:{name:"prepare_for_model",anchor:"transformers.PreTrainedTokenizerBase.prepare_for_model",parameters:[{name:"ids",val:": typing.List[int]"},{name:"pair_ids",val:": typing.Optional[typing.List[int]] = 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:"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:"prepend_batch_axis",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.prepare_for_model.ids",description:`<strong>ids</strong> (<code>List[int]</code>) &#x2014;
Tokenized input ids of the first sequence. Can be obtained from a string by chaining the <code>tokenize</code> and
<code>convert_tokens_to_ids</code> methods.`,name:"ids"},{anchor:"transformers.PreTrainedTokenizerBase.prepare_for_model.pair_ids",description:`<strong>pair_ids</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Tokenized input ids of the second sequence. Can be obtained from a string by chaining the <code>tokenize</code>
and <code>convert_tokens_to_ids</code> methods.`,name:"pair_ids"},{anchor:"transformers.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.prepare_for_model.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.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/v4.32.0/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.PreTrainedTokenizerBase.prepare_for_model.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.PreTrainedTokenizerBase.prepare_for_model.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/v4.32.0/src/transformers/tokenization_utils_base.py#L3141",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Bt=new B({props:{name:"prepare_seq2seq_batch",anchor:"transformers.PreTrainedTokenizerBase.prepare_seq2seq_batch",parameters:[{name:"src_texts",val:": typing.List[str]"},{name:"tgt_texts",val:": typing.Optional[typing.List[str]] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"max_target_length",val:": typing.Optional[int] = None"},{name:"padding",val:": str = 'longest'"},{name:"return_tensors",val:": str = None"},{name:"truncation",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.prepare_seq2seq_batch.src_texts",description:`<strong>src_texts</strong> (<code>List[str]</code>) &#x2014;
List of documents to summarize or source language texts.`,name:"src_texts"},{anchor:"transformers.PreTrainedTokenizerBase.prepare_seq2seq_batch.tgt_texts",description:`<strong>tgt_texts</strong> (<code>list</code>, <em>optional</em>) &#x2014;
List of summaries or target language texts.`,name:"tgt_texts"},{anchor:"transformers.PreTrainedTokenizerBase.prepare_seq2seq_batch.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length for encoder inputs (documents to summarize or source language texts) 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.PreTrainedTokenizerBase.prepare_seq2seq_batch.max_target_length",description:`<strong>max_target_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length of decoder inputs (target language texts or summaries) If left unset or set
to <code>None</code>, this will use the max_length value.`,name:"max_target_length"},{anchor:"transformers.PreTrainedTokenizerBase.prepare_seq2seq_batch.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.prepare_seq2seq_batch.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/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.PreTrainedTokenizerBase.prepare_seq2seq_batch.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>True</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).
**kwargs &#x2014;
Additional keyword arguments passed along to <code>self.__call__</code>.</li>
</ul>`,name:"truncation"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3697",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li><strong>input_ids</strong> \u2014 List of token ids to be fed to the encoder.</li>
<li><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model.</li>
<li><strong>labels</strong> \u2014 List of token ids for tgt_texts.</li>
</ul>
<p>The full set of keys <code>[input_ids, attention_mask, labels]</code>, will only be returned if tgt_texts is passed.
Otherwise, input_ids, attention_mask will be the only keys.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Et=new B({props:{name:"push_to_hub",anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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/v4.32.0/src/transformers/utils/hub.py#L776"}}),Oe=new bs({props:{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.example",$$slots:{default:[th]},$$scope:{ctx:E}}}),qt=new B({props:{name:"register_for_auto_class",anchor:"transformers.PreTrainedTokenizerBase.register_for_auto_class",parameters:[{name:"auto_class",val:" = 'AutoTokenizer'"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.register_for_auto_class.auto_class",description:`<strong>auto_class</strong> (<code>str</code> or <code>type</code>, <em>optional</em>, defaults to <code>&quot;AutoTokenizer&quot;</code>) &#x2014;
The auto class to register this new tokenizer with.`,name:"auto_class"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3671"}}),Xe=new qr({props:{warning:!0,$$slots:{default:[oh]},$$scope:{ctx:E}}}),It=new B({props:{name:"save_pretrained",anchor:"transformers.PreTrainedTokenizerBase.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"legacy_format",val:": typing.Optional[bool] = None"},{name:"filename_prefix",val:": typing.Optional[str] = None"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.save_pretrained.save_directory",description:"<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014; The path to a directory where the tokenizer will be saved.",name:"save_directory"},{anchor:"transformers.PreTrainedTokenizerBase.save_pretrained.legacy_format",description:`<strong>legacy_format</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Only applicable for a fast tokenizer. If unset (default), will save the tokenizer in the unified JSON
format as well as in legacy format if it exists, i.e. with tokenizer specific vocabulary and a separate
added_tokens files.</p>
<p>If <code>False</code>, will only save the tokenizer in the unified JSON format. This format is incompatible with
&#x201C;slow&#x201D; tokenizers (not powered by the <em>tokenizers</em> library), so the tokenizer will not be able to be
loaded in the corresponding &#x201C;slow&#x201D; tokenizer.</p>
<p>If <code>True</code>, will save the tokenizer in legacy format. If the &#x201C;slow&#x201D; tokenizer doesn&#x2019;t exits, a value
error is raised.`,name:"legacy_format"},{anchor:"transformers.PreTrainedTokenizerBase.save_pretrained.filename_prefix",description:`<strong>filename_prefix</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A prefix to add to the names of the files saved by the tokenizer.`,name:"filename_prefix"},{anchor:"transformers.PreTrainedTokenizerBase.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.PreTrainedTokenizerBase.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L2107",returnDescription:`
<p>The files saved.</p>
`,returnType:`
<p>A tuple of <code>str</code></p>
`}}),Wt=new B({props:{name:"save_vocabulary",anchor:"transformers.PreTrainedTokenizerBase.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.save_vocabulary.save_directory",description:`<strong>save_directory</strong> (<code>str</code>) &#x2014;
The directory in which to save the vocabulary.`,name:"save_directory"},{anchor:"transformers.PreTrainedTokenizerBase.save_vocabulary.filename_prefix",description:`<strong>filename_prefix</strong> (<code>str</code>, <em>optional</em>) &#x2014;
An optional prefix to add to the named of the saved files.`,name:"filename_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L2298",returnDescription:`
<p>Paths to the files saved.</p>
`,returnType:`
<p><code>Tuple(str)</code></p>
`}}),Dt=new B({props:{name:"tokenize",anchor:"transformers.PreTrainedTokenizerBase.tokenize",parameters:[{name:"text",val:": str"},{name:"pair",val:": typing.Optional[str] = None"},{name:"add_special_tokens",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.tokenize.text",description:`<strong>text</strong> (<code>str</code>) &#x2014;
The sequence to be encoded.`,name:"text"},{anchor:"transformers.PreTrainedTokenizerBase.tokenize.pair",description:`<strong>pair</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A second sequence to be encoded with the first.`,name:"pair"},{anchor:"transformers.PreTrainedTokenizerBase.tokenize.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add the special tokens associated with the corresponding model.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizerBase.tokenize.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific encode method. See details in
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"><strong>call</strong>()</a>`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L2316",returnDescription:`
<p>The list of tokens.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Jt=new B({props:{name:"truncate_sequences",anchor:"transformers.PreTrainedTokenizerBase.truncate_sequences",parameters:[{name:"ids",val:": typing.List[int]"},{name:"pair_ids",val:": typing.Optional[typing.List[int]] = None"},{name:"num_tokens_to_remove",val:": int = 0"},{name:"truncation_strategy",val:": typing.Union[str, transformers.tokenization_utils_base.TruncationStrategy] = 'longest_first'"},{name:"stride",val:": int = 0"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.truncate_sequences.ids",description:`<strong>ids</strong> (<code>List[int]</code>) &#x2014;
Tokenized input ids of the first sequence. Can be obtained from a string by chaining the <code>tokenize</code> and
<code>convert_tokens_to_ids</code> methods.`,name:"ids"},{anchor:"transformers.PreTrainedTokenizerBase.truncate_sequences.pair_ids",description:`<strong>pair_ids</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Tokenized input ids of the second sequence. Can be obtained from a string by chaining the <code>tokenize</code>
and <code>convert_tokens_to_ids</code> methods.`,name:"pair_ids"},{anchor:"transformers.PreTrainedTokenizerBase.truncate_sequences.num_tokens_to_remove",description:`<strong>num_tokens_to_remove</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of tokens to remove using the truncation strategy.`,name:"num_tokens_to_remove"},{anchor:"transformers.PreTrainedTokenizerBase.truncate_sequences.truncation_strategy",description:`<strong>truncation_strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
The strategy to follow for truncation. Can be:</p>
<ul>
<li><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>&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_strategy"},{anchor:"transformers.PreTrainedTokenizerBase.truncate_sequences.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a positive number, the overflowing tokens returned will contain some tokens from the main
sequence returned. The value of this argument defines the number of additional tokens.`,name:"stride"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3277",returnDescription:`
<p>The truncated <code>ids</code>, the truncated <code>pair_ids</code> and the list of
overflowing tokens. Note: The <em>longest_first</em> strategy returns empty list of overflowing tokens if a pair
of sequences (or a batch of pairs) is provided.</p>
`,returnType:`
<p><code>Tuple[List[int], List[int], List[int]]</code></p>
`}}),Ft=new ks({}),St=new B({props:{name:"class transformers.SpecialTokensMixin",anchor:"transformers.SpecialTokensMixin",parameters:[{name:"verbose",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SpecialTokensMixin.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.`,name:"bos_token"},{anchor:"transformers.SpecialTokensMixin.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.`,name:"eos_token"},{anchor:"transformers.SpecialTokensMixin.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.`,name:"unk_token"},{anchor:"transformers.SpecialTokensMixin.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).`,name:"sep_token"},{anchor:"transformers.SpecialTokensMixin.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.`,name:"pad_token"},{anchor:"transformers.SpecialTokensMixin.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).`,name:"cls_token"},{anchor:"transformers.SpecialTokensMixin.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).`,name:"mask_token"},{anchor:"transformers.SpecialTokensMixin.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.`,name:"additional_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L783"}}),At=new B({props:{name:"add_special_tokens",anchor:"transformers.SpecialTokensMixin.add_special_tokens",parameters:[{name:"special_tokens_dict",val:": typing.Dict[str, typing.Union[str, tokenizers.AddedToken]]"},{name:"replace_additional_special_tokens",val:" = True"}],parametersDescription:[{anchor:"transformers.SpecialTokensMixin.add_special_tokens.special_tokens_dict",description:`<strong>special_tokens_dict</strong> (dictionary <em>str</em> to <em>str</em> or <code>tokenizers.AddedToken</code>) &#x2014;
Keys should be in the list of predefined special attributes: [<code>bos_token</code>, <code>eos_token</code>, <code>unk_token</code>,
<code>sep_token</code>, <code>pad_token</code>, <code>cls_token</code>, <code>mask_token</code>, <code>additional_special_tokens</code>].</p>
<p>Tokens are only added if they are not already in the vocabulary (tested by checking if the tokenizer
assign the index of the <code>unk_token</code> to them).`,name:"special_tokens_dict"},{anchor:"transformers.SpecialTokensMixin.add_special_tokens.replace_additional_special_tokens",description:`<strong>replace_additional_special_tokens</strong> (<code>bool</code>, <em>optional</em>,, defaults to <code>True</code>) &#x2014;
If <code>True</code>, the existing list of additional special tokens will be replaced by the one specified in
<code>special_tokens_dict</code>. Otherwise, <code>self._additional_special_tokens</code> is updated. In the former case, the
tokens will NOT be removed from the tokenizer&#x2019;s full vocabulary - they are only being flagged as
non-special tokens.`,name:"replace_additional_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L863",returnDescription:`
<p>Number of tokens added to the vocabulary.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Ke=new bs({props:{anchor:"transformers.SpecialTokensMixin.add_special_tokens.example",$$slots:{default:[nh]},$$scope:{ctx:E}}}),Gt=new B({props:{name:"add_tokens",anchor:"transformers.SpecialTokensMixin.add_tokens",parameters:[{name:"new_tokens",val:": typing.Union[str, tokenizers.AddedToken, typing.List[typing.Union[str, tokenizers.AddedToken]]]"},{name:"special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.SpecialTokensMixin.add_tokens.new_tokens",description:`<strong>new_tokens</strong> (<code>str</code>, <code>tokenizers.AddedToken</code> or a list of <em>str</em> or <code>tokenizers.AddedToken</code>) &#x2014;
Tokens are only added if they are not already in the vocabulary. <code>tokenizers.AddedToken</code> wraps a string
token to let you personalize its behavior: whether this token should only match against a single word,
whether this token should strip all potential whitespaces on the left side, whether this token should
strip all potential whitespaces on the right side, etc.`,name:"new_tokens"},{anchor:"transformers.SpecialTokensMixin.add_tokens.special_tokens",description:`<strong>special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Can be used to specify if the token is a special token. This mostly change the normalization behavior
(special tokens like CLS or [MASK] are usually not lower-cased for instance).</p>
<p>See details for <code>tokenizers.AddedToken</code> in HuggingFace tokenizers library.`,name:"special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L957",returnDescription:`
<p>Number of tokens added to the vocabulary.</p>
`,returnType:`
<p><code>int</code></p>
`}}),et=new bs({props:{anchor:"transformers.SpecialTokensMixin.add_tokens.example",$$slots:{default:[rh]},$$scope:{ctx:E}}}),Xt=new B({props:{name:"sanitize_special_tokens",anchor:"transformers.SpecialTokensMixin.sanitize_special_tokens",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L851",returnDescription:`
<p>The number of tokens added in the vocabulary during the operation.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Yt=new ks({}),Ht=new B({props:{name:"class transformers.tokenization_utils_base.TruncationStrategy",anchor:"transformers.tokenization_utils_base.TruncationStrategy",parameters:[{name:"value",val:""},{name:"names",val:" = None"},{name:"module",val:" = None"},{name:"qualname",val:" = None"},{name:"type",val:" = None"},{name:"start",val:" = 1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L126"}}),Qt=new B({props:{name:"class transformers.CharSpan",anchor:"transformers.CharSpan",parameters:[{name:"start",val:": int"},{name:"end",val:": int"}],parametersDescription:[{anchor:"transformers.CharSpan.start",description:"<strong>start</strong> (<code>int</code>) &#x2014; Index of the first character in the original string.",name:"start"},{anchor:"transformers.CharSpan.end",description:"<strong>end</strong> (<code>int</code>) &#x2014; Index of the character following the last character in the original string.",name:"end"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L138"}}),Kt=new B({props:{name:"class transformers.TokenSpan",anchor:"transformers.TokenSpan",parameters:[{name:"start",val:": int"},{name:"end",val:": int"}],parametersDescription:[{anchor:"transformers.TokenSpan.start",description:"<strong>start</strong> (<code>int</code>) &#x2014; Index of the first token in the span.",name:"start"},{anchor:"transformers.TokenSpan.end",description:"<strong>end</strong> (<code>int</code>) &#x2014; Index of the token following the last token in the span.",name:"end"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L151"}}),{c(){p=r("meta"),$=d(),f=r("h1"),h=r("a"),x=r("span"),k(c.$$.fragment),_=d(),M=r("span"),ge=o("Utilities for Tokenizers"),S=d(),I=r("p"),no=o(`This page lists all the utility functions used by the tokenizers, mainly the class
`),ro=r("a"),ys=o("PreTrainedTokenizerBase"),ws=o(` that implements the common methods between
`),so=r("a"),zs=o("PreTrainedTokenizer"),xs=o(" and "),ao=r("a"),$s=o("PreTrainedTokenizerFast"),Ps=o(` and the mixin
`),io=r("a"),Bs=o("SpecialTokensMixin"),Es=o("."),Mr=d(),lo=r("p"),qs=o("Most of those are only useful if you are studying the code of the tokenizers in the library."),Ir=d(),ke=r("h2"),Le=r("a"),jo=r("span"),k(at.$$.fragment),Ms=d(),Jo=r("span"),Is=o("PreTrainedTokenizerBase"),Lr=d(),u=r("div"),k(it.$$.fragment),Ls=d(),be=r("p"),Ns=o("Base class for "),co=r("a"),Ws=o("PreTrainedTokenizer"),Us=o(" and "),po=r("a"),Ds=o("PreTrainedTokenizerFast"),js=o("."),Js=d(),Fo=r("p"),Fs=o("Handles shared (mostly boiler plate) methods for those two classes."),Ss=d(),So=r("p"),As=o("Class attributes (overridden by derived classes)"),Cs=d(),L=r("ul"),K=r("li"),Ao=r("strong"),Zs=o("vocab_files_names"),Vs=o(" ("),Co=r("code"),Rs=o("Dict[str, str]"),Gs=o(") \u2014 A dictionary with, as keys, the "),Zo=r("code"),Os=o("__init__"),Xs=o(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Ys=d(),U=r("li"),Vo=r("strong"),Hs=o("pretrained_vocab_files_map"),Qs=o(" ("),Ro=r("code"),Ks=o("Dict[str, Dict[str, str]]"),ea=o(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),Go=r("code"),ta=o("__init__"),oa=o(` keyword name of each vocabulary file required by the model, the
low-level being the `),Oo=r("code"),na=o("short-cut-names"),ra=o(" of the pretrained models with, as associated values, the "),Xo=r("code"),sa=o("url"),aa=o(` to the
associated pretrained vocabulary file.`),ia=d(),V=r("li"),Yo=r("strong"),da=o("max_model_input_sizes"),la=o(" ("),Ho=r("code"),ca=o("Dict[str, Optional[int]]"),pa=o(") \u2014 A dictionary with, as keys, the "),Qo=r("code"),ma=o("short-cut-names"),ha=o(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),Ko=r("code"),ua=o("None"),fa=o(" if the model has no maximum input size."),_a=d(),D=r("li"),en=r("strong"),ga=o("pretrained_init_configuration"),ka=o(" ("),tn=r("code"),ba=o("Dict[str, Dict[str, Any]]"),va=o(`) \u2014 A dictionary with, as keys, the
`),on=r("code"),Ta=o("short-cut-names"),ya=o(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),nn=r("code"),wa=o("__init__"),za=o(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),mo=r("a"),xa=o("from_pretrained()"),$a=o(" method."),Pa=d(),Ne=r("li"),rn=r("strong"),Ba=o("model_input_names"),Ea=o(" ("),sn=r("code"),qa=o("List[str]"),Ma=o(") \u2014 A list of inputs expected in the forward pass of the model."),Ia=d(),R=r("li"),an=r("strong"),La=o("padding_side"),Na=o(" ("),dn=r("code"),Wa=o("str"),Ua=o(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),ln=r("code"),Da=o("'right'"),ja=o(" or "),cn=r("code"),Ja=o("'left'"),Fa=o("."),Sa=d(),G=r("li"),pn=r("strong"),Aa=o("truncation_side"),Ca=o(" ("),mn=r("code"),Za=o("str"),Va=o(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),hn=r("code"),Ra=o("'right'"),Ga=o(" or "),un=r("code"),Oa=o("'left'"),Xa=o("."),Ya=d(),We=r("div"),k(dt.$$.fragment),Ha=d(),fn=r("p"),Qa=o(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Ka=d(),Ue=r("div"),k(lt.$$.fragment),ei=d(),_n=r("p"),ti=o(`Temporarily sets the tokenizer for encoding the targets. Useful for tokenizer associated to
sequence-to-sequence models that need a slightly different processing for the labels.`),oi=d(),De=r("div"),k(ct.$$.fragment),ni=d(),gn=r("p"),ri=o("Convert a list of lists of token ids into a list of strings by calling decode."),si=d(),ee=r("div"),k(pt.$$.fragment),ai=d(),kn=r("p"),ii=o("Tokenize and prepare for the model a list of sequences or a list of pairs of sequences."),di=d(),k(je.$$.fragment),li=d(),te=r("div"),k(mt.$$.fragment),ci=d(),bn=r("p"),pi=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens.`),mi=d(),vn=r("p"),hi=o("This implementation does not add special tokens and this method should be overridden in a subclass."),ui=d(),Je=r("div"),k(ht.$$.fragment),fi=d(),Tn=r("p"),_i=o("Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms."),gi=d(),Fe=r("div"),k(ut.$$.fragment),ki=d(),ft=r("p"),bi=o("Converts a sequence of tokens in a single string. The most simple way to do it is "),yn=r("code"),vi=o('" ".join(tokens)'),Ti=o(` but we
often want to remove sub-word tokenization artifacts at the same time.`),yi=d(),oe=r("div"),k(_t.$$.fragment),wi=d(),ho=r("p"),zi=o("Create the token type IDs corresponding to the sequences passed. "),uo=r("a"),xi=o(`What are token type
IDs?`),$i=d(),wn=r("p"),Pi=o("Should be overridden in a subclass if the model has a special way of building those."),Bi=d(),ne=r("div"),k(gt.$$.fragment),Ei=d(),zn=r("p"),qi=o(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Mi=d(),kt=r("p"),Ii=o("Similar to doing "),xn=r("code"),Li=o("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Ni=o("."),Wi=d(),re=r("div"),k(bt.$$.fragment),Ui=d(),$n=r("p"),Di=o("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),ji=d(),vt=r("p"),Ji=o("Same as doing "),Pn=r("code"),Fi=o("self.convert_tokens_to_ids(self.tokenize(text))"),Si=o("."),Ai=d(),se=r("div"),k(Tt.$$.fragment),Ci=d(),Bn=r("p"),Zi=o("Tokenize and prepare for the model a sequence or a pair of sequences."),Vi=d(),k(Se.$$.fragment),Ri=d(),O=r("div"),k(yt.$$.fragment),Gi=d(),wt=r("p"),Oi=o("Instantiate a "),fo=r("a"),Xi=o("PreTrainedTokenizerBase"),Yi=o(` (or a derived class) from a predefined
tokenizer.`),Hi=d(),k(Ae.$$.fragment),Qi=d(),k(Ce.$$.fragment),Ki=d(),Ze=r("div"),k(zt.$$.fragment),ed=d(),ve=r("p"),td=o(`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),En=r("code"),od=o("prepare_for_model"),nd=o(" or "),qn=r("code"),rd=o("encode_plus"),sd=o(" methods."),ad=d(),ae=r("div"),k(xt.$$.fragment),id=d(),Mn=r("p"),dd=o("Returns the vocabulary as a dictionary of token to index."),ld=d(),ie=r("p"),In=r("code"),cd=o("tokenizer.get_vocab()[token]"),pd=o(" is equivalent to "),Ln=r("code"),md=o("tokenizer.convert_tokens_to_ids(token)"),hd=o(" when "),Nn=r("code"),ud=o("token"),fd=o(` is in the
vocab.`),_d=d(),j=r("div"),k($t.$$.fragment),gd=d(),Wn=r("p"),kd=o(`Pad a single encoded input or a batch of encoded inputs up to predefined length or to the max sequence length
in the batch.`),bd=d(),Y=r("p"),vd=o("Padding side (left/right) padding token ids are defined at the tokenizer level (with "),Un=r("code"),Td=o("self.padding_side"),yd=o(`,
`),Dn=r("code"),wd=o("self.pad_token_id"),zd=o(" and "),jn=r("code"),xd=o("self.pad_token_type_id"),$d=o(")."),Pd=d(),Te=r("p"),Bd=o("Please note that with a fast tokenizer, using the "),Jn=r("code"),Ed=o("__call__"),qd=o(` method is faster than using a method to encode the
text followed by a call to the `),Fn=r("code"),Md=o("pad"),Id=o(" method to get a padded encoding."),Ld=d(),k(Ve.$$.fragment),Nd=d(),Re=r("div"),k(Pt.$$.fragment),Wd=d(),A=r("p"),Ud=o(`Prepares a sequence of input id, or a pair of sequences of inputs ids so that it can be used by the model. It
adds special tokens, truncates sequences if overflowing while taking into account the special tokens and
manages a moving window (with user defined stride) for overflowing tokens. Please Note, for `),Sn=r("em"),Dd=o("pair_ids"),jd=o(`
different than `),An=r("code"),Jd=o("None"),Fd=o(" and "),Cn=r("em"),Sd=o("truncation_strategy = longest_first"),Ad=o(" or "),Zn=r("code"),Cd=o("True"),Zd=o(`, it is not possible to return
overflowing tokens. Such a combination of arguments will raise an error.`),Vd=d(),Ge=r("div"),k(Bt.$$.fragment),Rd=d(),Vn=r("p"),Gd=o("Prepare model inputs for translation. For best performance, translate one sentence at a time."),Od=d(),de=r("div"),k(Et.$$.fragment),Xd=d(),Rn=r("p"),Yd=o("Upload the tokenizer files to the \u{1F917} Model Hub."),Hd=d(),k(Oe.$$.fragment),Qd=d(),le=r("div"),k(qt.$$.fragment),Kd=d(),Mt=r("p"),el=o(`Register this class with a given auto class. This should only be used for custom tokenizers as the ones in the
library are already mapped with `),Gn=r("code"),tl=o("AutoTokenizer"),ol=o("."),nl=d(),k(Xe.$$.fragment),rl=d(),X=r("div"),k(It.$$.fragment),sl=d(),On=r("p"),al=o("Save the full tokenizer state."),il=d(),Lt=r("p"),dl=o(`This method make sure the full tokenizer can then be re-loaded using the
`),Xn=r("code"),ll=o("~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),cl=o(" class method.."),pl=d(),Nt=r("p"),ml=o(`Warning,None This won\u2019t save modifications you may have applied to the tokenizer after the instantiation (for
instance, modifying `),Yn=r("code"),hl=o("tokenizer.do_lower_case"),ul=o(" after creation)."),fl=d(),ce=r("div"),k(Wt.$$.fragment),_l=d(),Hn=r("p"),gl=o("Save only the vocabulary of the tokenizer (vocabulary + added tokens)."),kl=d(),Ut=r("p"),bl=o(`This method won\u2019t save the configuration and special token mappings of the tokenizer. Use
`),Qn=r("code"),vl=o("_save_pretrained()"),Tl=o(" to save the whole state of the tokenizer."),yl=d(),Ye=r("div"),k(Dt.$$.fragment),wl=d(),jt=r("p"),zl=o("Converts a string in a sequence of tokens, replacing unknown tokens with the "),Kn=r("code"),xl=o("unk_token"),$l=o("."),Pl=d(),He=r("div"),k(Jt.$$.fragment),Bl=d(),er=r("p"),El=o("Truncates a sequence pair in-place following the strategy."),Nr=d(),ye=r("h2"),Qe=r("a"),tr=r("span"),k(Ft.$$.fragment),ql=d(),or=r("span"),Ml=o("SpecialTokensMixin"),Wr=d(),W=r("div"),k(St.$$.fragment),Il=d(),we=r("p"),Ll=o("A mixin derived by "),_o=r("a"),Nl=o("PreTrainedTokenizer"),Wl=o(" and "),go=r("a"),Ul=o("PreTrainedTokenizerFast"),Dl=o(` to handle specific behaviors related to
special tokens. In particular, this class hold the attributes which can be used to directly access these special
tokens in a model-independent manner and allow to set and update the special tokens.`),jl=d(),q=r("div"),k(At.$$.fragment),Jl=d(),nr=r("p"),Fl=o(`Add a dictionary of special tokens (eos, pad, cls, etc.) to the encoder and link them to class attributes. If
special tokens are NOT in the vocabulary, they are added to it (indexed starting from the last index of the
current vocabulary).`),Sl=d(),rr=r("p"),Al=o(`Note,None When adding new tokens to the vocabulary, you should make sure to also resize the token embedding
matrix of the model so that its embedding matrix matches the tokenizer.`),Cl=d(),Ct=r("p"),Zl=o("In order to do that, please use the "),ko=r("a"),Vl=o("resize_token_embeddings()"),Rl=o(" method."),Gl=d(),Zt=r("p"),Ol=o("Using "),sr=r("code"),Xl=o("add_special_tokens"),Yl=o(" will ensure your special tokens can be used in several ways:"),Hl=d(),Vt=r("ul"),ar=r("li"),Ql=o("Special tokens are carefully handled by the tokenizer (they are never split)."),Kl=d(),Rt=r("li"),ec=o("You can easily refer to special tokens using tokenizer class attributes like "),ir=r("code"),tc=o("tokenizer.cls_token"),oc=o(`. This
makes it easy to develop model-agnostic training and fine-tuning scripts.`),nc=d(),C=r("p"),rc=o(`When possible, special tokens are already registered for provided pretrained models (for instance
`),bo=r("a"),sc=o("BertTokenizer"),ac=d(),dr=r("code"),ic=o("cls_token"),dc=o(" is already registered to be :obj"),lr=r("em"),lc=o("\u2019[CLS]\u2019"),cc=o(` and XLM\u2019s one is also registered to be
`),cr=r("code"),pc=o("'</s>'"),mc=o(")."),hc=d(),k(Ke.$$.fragment),uc=d(),J=r("div"),k(Gt.$$.fragment),fc=d(),pr=r("p"),_c=o(`Add a list of new tokens to the tokenizer class. If the new tokens are not in the vocabulary, they are added to
it with indices starting from length of the current vocabulary and and will be isolated before the tokenization
algorithm is applied. Added tokens and tokens from the vocabulary of the tokenization algorithm are therefore
not treated in the same way.`),gc=d(),mr=r("p"),kc=o(`Note, when adding new tokens to the vocabulary, you should make sure to also resize the token embedding matrix
of the model so that its embedding matrix matches the tokenizer.`),bc=d(),Ot=r("p"),vc=o("In order to do that, please use the "),vo=r("a"),Tc=o("resize_token_embeddings()"),yc=o(" method."),wc=d(),k(et.$$.fragment),zc=d(),pe=r("div"),k(Xt.$$.fragment),xc=d(),ze=r("p"),$c=o("Make sure that all the special tokens attributes of the tokenizer ("),hr=r("code"),Pc=o("tokenizer.mask_token"),Bc=o(`,
`),ur=r("code"),Ec=o("tokenizer.cls_token"),qc=o(", etc.) are in the vocabulary."),Mc=d(),fr=r("p"),Ic=o("Add the missing ones to the vocabulary if needed."),Ur=d(),xe=r("h2"),tt=r("a"),_r=r("span"),k(Yt.$$.fragment),Lc=d(),gr=r("span"),Nc=o("Enums and namedtuples"),Dr=d(),$e=r("div"),k(Ht.$$.fragment),Wc=d(),Pe=r("p"),Uc=o("Possible values for the "),kr=r("code"),Dc=o("truncation"),jc=o(" argument in "),ot=r("a"),Jc=o("PreTrainedTokenizerBase."),br=r("strong"),Fc=o("call"),Sc=o("()"),Ac=o(`. Useful for tab-completion in
an IDE.`),jr=d(),Be=r("div"),k(Qt.$$.fragment),Cc=d(),vr=r("p"),Zc=o("Character span in the original string."),Jr=d(),Ee=r("div"),k(Kt.$$.fragment),Vc=d(),Tr=r("p"),Rc=o("Token span in an encoded string (list of tokens)."),this.h()},l(i){const z=Om('[data-svelte="svelte-1phssyn"]',document.head);p=s(z,"META",{name:!0,content:!0}),z.forEach(t),$=l(i),f=s(i,"H1",{class:!0});var eo=a(f);h=s(eo,"A",{id:!0,class:!0,href:!0});var yr=a(h);x=s(yr,"SPAN",{});var wr=a(x);b(c.$$.fragment,wr),wr.forEach(t),yr.forEach(t),_=l(eo),M=s(eo,"SPAN",{});var zr=a(M);ge=n(zr,"Utilities for Tokenizers"),zr.forEach(t),eo.forEach(t),S=l(i),I=s(i,"P",{});var Z=a(I);no=n(Z,`This page lists all the utility functions used by the tokenizers, mainly the class
`),ro=s(Z,"A",{href:!0});var xr=a(ro);ys=n(xr,"PreTrainedTokenizerBase"),xr.forEach(t),ws=n(Z,` that implements the common methods between
`),so=s(Z,"A",{href:!0});var $r=a(so);zs=n($r,"PreTrainedTokenizer"),$r.forEach(t),xs=n(Z," and "),ao=s(Z,"A",{href:!0});var Pr=a(ao);$s=n(Pr,"PreTrainedTokenizerFast"),Pr.forEach(t),Ps=n(Z,` and the mixin
`),io=s(Z,"A",{href:!0});var Br=a(io);Bs=n(Br,"SpecialTokensMixin"),Br.forEach(t),Es=n(Z,"."),Z.forEach(t),Mr=l(i),lo=s(i,"P",{});var Oc=a(lo);qs=n(Oc,"Most of those are only useful if you are studying the code of the tokenizers in the library."),Oc.forEach(t),Ir=l(i),ke=s(i,"H2",{class:!0});var Sr=a(ke);Le=s(Sr,"A",{id:!0,class:!0,href:!0});var Xc=a(Le);jo=s(Xc,"SPAN",{});var Yc=a(jo);b(at.$$.fragment,Yc),Yc.forEach(t),Xc.forEach(t),Ms=l(Sr),Jo=s(Sr,"SPAN",{});var Hc=a(Jo);Is=n(Hc,"PreTrainedTokenizerBase"),Hc.forEach(t),Sr.forEach(t),Lr=l(i),u=s(i,"DIV",{class:!0});var g=a(u);b(it.$$.fragment,g),Ls=l(g),be=s(g,"P",{});var To=a(be);Ns=n(To,"Base class for "),co=s(To,"A",{href:!0});var Qc=a(co);Ws=n(Qc,"PreTrainedTokenizer"),Qc.forEach(t),Us=n(To," and "),po=s(To,"A",{href:!0});var Kc=a(po);Ds=n(Kc,"PreTrainedTokenizerFast"),Kc.forEach(t),js=n(To,"."),To.forEach(t),Js=l(g),Fo=s(g,"P",{});var ep=a(Fo);Fs=n(ep,"Handles shared (mostly boiler plate) methods for those two classes."),ep.forEach(t),Ss=l(g),So=s(g,"P",{});var tp=a(So);As=n(tp,"Class attributes (overridden by derived classes)"),tp.forEach(t),Cs=l(g),L=s(g,"UL",{});var F=a(L);K=s(F,"LI",{});var to=a(K);Ao=s(to,"STRONG",{});var op=a(Ao);Zs=n(op,"vocab_files_names"),op.forEach(t),Vs=n(to," ("),Co=s(to,"CODE",{});var np=a(Co);Rs=n(np,"Dict[str, str]"),np.forEach(t),Gs=n(to,") \u2014 A dictionary with, as keys, the "),Zo=s(to,"CODE",{});var rp=a(Zo);Os=n(rp,"__init__"),rp.forEach(t),Xs=n(to,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),to.forEach(t),Ys=l(F),U=s(F,"LI",{});var H=a(U);Vo=s(H,"STRONG",{});var sp=a(Vo);Hs=n(sp,"pretrained_vocab_files_map"),sp.forEach(t),Qs=n(H," ("),Ro=s(H,"CODE",{});var ap=a(Ro);Ks=n(ap,"Dict[str, Dict[str, str]]"),ap.forEach(t),ea=n(H,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),Go=s(H,"CODE",{});var ip=a(Go);ta=n(ip,"__init__"),ip.forEach(t),oa=n(H,` keyword name of each vocabulary file required by the model, the
low-level being the `),Oo=s(H,"CODE",{});var dp=a(Oo);na=n(dp,"short-cut-names"),dp.forEach(t),ra=n(H," of the pretrained models with, as associated values, the "),Xo=s(H,"CODE",{});var lp=a(Xo);sa=n(lp,"url"),lp.forEach(t),aa=n(H,` to the
associated pretrained vocabulary file.`),H.forEach(t),ia=l(F),V=s(F,"LI",{});var qe=a(V);Yo=s(qe,"STRONG",{});var cp=a(Yo);da=n(cp,"max_model_input_sizes"),cp.forEach(t),la=n(qe," ("),Ho=s(qe,"CODE",{});var pp=a(Ho);ca=n(pp,"Dict[str, Optional[int]]"),pp.forEach(t),pa=n(qe,") \u2014 A dictionary with, as keys, the "),Qo=s(qe,"CODE",{});var mp=a(Qo);ma=n(mp,"short-cut-names"),mp.forEach(t),ha=n(qe,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),Ko=s(qe,"CODE",{});var hp=a(Ko);ua=n(hp,"None"),hp.forEach(t),fa=n(qe," if the model has no maximum input size."),qe.forEach(t),_a=l(F),D=s(F,"LI",{});var Q=a(D);en=s(Q,"STRONG",{});var up=a(en);ga=n(up,"pretrained_init_configuration"),up.forEach(t),ka=n(Q," ("),tn=s(Q,"CODE",{});var fp=a(tn);ba=n(fp,"Dict[str, Dict[str, Any]]"),fp.forEach(t),va=n(Q,`) \u2014 A dictionary with, as keys, the
`),on=s(Q,"CODE",{});var _p=a(on);Ta=n(_p,"short-cut-names"),_p.forEach(t),ya=n(Q,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),nn=s(Q,"CODE",{});var gp=a(nn);wa=n(gp,"__init__"),gp.forEach(t),za=n(Q,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),mo=s(Q,"A",{href:!0});var kp=a(mo);xa=n(kp,"from_pretrained()"),kp.forEach(t),$a=n(Q," method."),Q.forEach(t),Pa=l(F),Ne=s(F,"LI",{});var Er=a(Ne);rn=s(Er,"STRONG",{});var bp=a(rn);Ba=n(bp,"model_input_names"),bp.forEach(t),Ea=n(Er," ("),sn=s(Er,"CODE",{});var vp=a(sn);qa=n(vp,"List[str]"),vp.forEach(t),Ma=n(Er,") \u2014 A list of inputs expected in the forward pass of the model."),Er.forEach(t),Ia=l(F),R=s(F,"LI",{});var Me=a(R);an=s(Me,"STRONG",{});var Tp=a(an);La=n(Tp,"padding_side"),Tp.forEach(t),Na=n(Me," ("),dn=s(Me,"CODE",{});var yp=a(dn);Wa=n(yp,"str"),yp.forEach(t),Ua=n(Me,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),ln=s(Me,"CODE",{});var wp=a(ln);Da=n(wp,"'right'"),wp.forEach(t),ja=n(Me," or "),cn=s(Me,"CODE",{});var zp=a(cn);Ja=n(zp,"'left'"),zp.forEach(t),Fa=n(Me,"."),Me.forEach(t),Sa=l(F),G=s(F,"LI",{});var Ie=a(G);pn=s(Ie,"STRONG",{});var xp=a(pn);Aa=n(xp,"truncation_side"),xp.forEach(t),Ca=n(Ie," ("),mn=s(Ie,"CODE",{});var $p=a(mn);Za=n($p,"str"),$p.forEach(t),Va=n(Ie,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),hn=s(Ie,"CODE",{});var Pp=a(hn);Ra=n(Pp,"'right'"),Pp.forEach(t),Ga=n(Ie," or "),un=s(Ie,"CODE",{});var Bp=a(un);Oa=n(Bp,"'left'"),Bp.forEach(t),Xa=n(Ie,"."),Ie.forEach(t),F.forEach(t),Ya=l(g),We=s(g,"DIV",{class:!0});var Ar=a(We);b(dt.$$.fragment,Ar),Ha=l(Ar),fn=s(Ar,"P",{});var Ep=a(fn);Qa=n(Ep,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Ep.forEach(t),Ar.forEach(t),Ka=l(g),Ue=s(g,"DIV",{class:!0});var Cr=a(Ue);b(lt.$$.fragment,Cr),ei=l(Cr),_n=s(Cr,"P",{});var qp=a(_n);ti=n(qp,`Temporarily sets the tokenizer for encoding the targets. Useful for tokenizer associated to
sequence-to-sequence models that need a slightly different processing for the labels.`),qp.forEach(t),Cr.forEach(t),oi=l(g),De=s(g,"DIV",{class:!0});var Zr=a(De);b(ct.$$.fragment,Zr),ni=l(Zr),gn=s(Zr,"P",{});var Mp=a(gn);ri=n(Mp,"Convert a list of lists of token ids into a list of strings by calling decode."),Mp.forEach(t),Zr.forEach(t),si=l(g),ee=s(g,"DIV",{class:!0});var yo=a(ee);b(pt.$$.fragment,yo),ai=l(yo),kn=s(yo,"P",{});var Ip=a(kn);ii=n(Ip,"Tokenize and prepare for the model a list of sequences or a list of pairs of sequences."),Ip.forEach(t),di=l(yo),b(je.$$.fragment,yo),yo.forEach(t),li=l(g),te=s(g,"DIV",{class:!0});var wo=a(te);b(mt.$$.fragment,wo),ci=l(wo),bn=s(wo,"P",{});var Lp=a(bn);pi=n(Lp,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens.`),Lp.forEach(t),mi=l(wo),vn=s(wo,"P",{});var Np=a(vn);hi=n(Np,"This implementation does not add special tokens and this method should be overridden in a subclass."),Np.forEach(t),wo.forEach(t),ui=l(g),Je=s(g,"DIV",{class:!0});var Vr=a(Je);b(ht.$$.fragment,Vr),fi=l(Vr),Tn=s(Vr,"P",{});var Wp=a(Tn);_i=n(Wp,"Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms."),Wp.forEach(t),Vr.forEach(t),gi=l(g),Fe=s(g,"DIV",{class:!0});var Rr=a(Fe);b(ut.$$.fragment,Rr),ki=l(Rr),ft=s(Rr,"P",{});var Gr=a(ft);bi=n(Gr,"Converts a sequence of tokens in a single string. The most simple way to do it is "),yn=s(Gr,"CODE",{});var Up=a(yn);vi=n(Up,'" ".join(tokens)'),Up.forEach(t),Ti=n(Gr,` but we
often want to remove sub-word tokenization artifacts at the same time.`),Gr.forEach(t),Rr.forEach(t),yi=l(g),oe=s(g,"DIV",{class:!0});var zo=a(oe);b(_t.$$.fragment,zo),wi=l(zo),ho=s(zo,"P",{});var Gc=a(ho);zi=n(Gc,"Create the token type IDs corresponding to the sequences passed. "),uo=s(Gc,"A",{href:!0});var Dp=a(uo);xi=n(Dp,`What are token type
IDs?`),Dp.forEach(t),Gc.forEach(t),$i=l(zo),wn=s(zo,"P",{});var jp=a(wn);Pi=n(jp,"Should be overridden in a subclass if the model has a special way of building those."),jp.forEach(t),zo.forEach(t),Bi=l(g),ne=s(g,"DIV",{class:!0});var xo=a(ne);b(gt.$$.fragment,xo),Ei=l(xo),zn=s(xo,"P",{});var Jp=a(zn);qi=n(Jp,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Jp.forEach(t),Mi=l(xo),kt=s(xo,"P",{});var Or=a(kt);Ii=n(Or,"Similar to doing "),xn=s(Or,"CODE",{});var Fp=a(xn);Li=n(Fp,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Fp.forEach(t),Ni=n(Or,"."),Or.forEach(t),xo.forEach(t),Wi=l(g),re=s(g,"DIV",{class:!0});var $o=a(re);b(bt.$$.fragment,$o),Ui=l($o),$n=s($o,"P",{});var Sp=a($n);Di=n(Sp,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Sp.forEach(t),ji=l($o),vt=s($o,"P",{});var Xr=a(vt);Ji=n(Xr,"Same as doing "),Pn=s(Xr,"CODE",{});var Ap=a(Pn);Fi=n(Ap,"self.convert_tokens_to_ids(self.tokenize(text))"),Ap.forEach(t),Si=n(Xr,"."),Xr.forEach(t),$o.forEach(t),Ai=l(g),se=s(g,"DIV",{class:!0});var Po=a(se);b(Tt.$$.fragment,Po),Ci=l(Po),Bn=s(Po,"P",{});var Cp=a(Bn);Zi=n(Cp,"Tokenize and prepare for the model a sequence or a pair of sequences."),Cp.forEach(t),Vi=l(Po),b(Se.$$.fragment,Po),Po.forEach(t),Ri=l(g),O=s(g,"DIV",{class:!0});var nt=a(O);b(yt.$$.fragment,nt),Gi=l(nt),wt=s(nt,"P",{});var Yr=a(wt);Oi=n(Yr,"Instantiate a "),fo=s(Yr,"A",{href:!0});var Zp=a(fo);Xi=n(Zp,"PreTrainedTokenizerBase"),Zp.forEach(t),Yi=n(Yr,` (or a derived class) from a predefined
tokenizer.`),Yr.forEach(t),Hi=l(nt),b(Ae.$$.fragment,nt),Qi=l(nt),b(Ce.$$.fragment,nt),nt.forEach(t),Ki=l(g),Ze=s(g,"DIV",{class:!0});var Hr=a(Ze);b(zt.$$.fragment,Hr),ed=l(Hr),ve=s(Hr,"P",{});var Bo=a(ve);td=n(Bo,`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),En=s(Bo,"CODE",{});var Vp=a(En);od=n(Vp,"prepare_for_model"),Vp.forEach(t),nd=n(Bo," or "),qn=s(Bo,"CODE",{});var Rp=a(qn);rd=n(Rp,"encode_plus"),Rp.forEach(t),sd=n(Bo," methods."),Bo.forEach(t),Hr.forEach(t),ad=l(g),ae=s(g,"DIV",{class:!0});var Eo=a(ae);b(xt.$$.fragment,Eo),id=l(Eo),Mn=s(Eo,"P",{});var Gp=a(Mn);dd=n(Gp,"Returns the vocabulary as a dictionary of token to index."),Gp.forEach(t),ld=l(Eo),ie=s(Eo,"P",{});var oo=a(ie);In=s(oo,"CODE",{});var Op=a(In);cd=n(Op,"tokenizer.get_vocab()[token]"),Op.forEach(t),pd=n(oo," is equivalent to "),Ln=s(oo,"CODE",{});var Xp=a(Ln);md=n(Xp,"tokenizer.convert_tokens_to_ids(token)"),Xp.forEach(t),hd=n(oo," when "),Nn=s(oo,"CODE",{});var Yp=a(Nn);ud=n(Yp,"token"),Yp.forEach(t),fd=n(oo,` is in the
vocab.`),oo.forEach(t),Eo.forEach(t),_d=l(g),j=s(g,"DIV",{class:!0});var me=a(j);b($t.$$.fragment,me),gd=l(me),Wn=s(me,"P",{});var Hp=a(Wn);kd=n(Hp,`Pad a single encoded input or a batch of encoded inputs up to predefined length or to the max sequence length
in the batch.`),Hp.forEach(t),bd=l(me),Y=s(me,"P",{});var rt=a(Y);vd=n(rt,"Padding side (left/right) padding token ids are defined at the tokenizer level (with "),Un=s(rt,"CODE",{});var Qp=a(Un);Td=n(Qp,"self.padding_side"),Qp.forEach(t),yd=n(rt,`,
`),Dn=s(rt,"CODE",{});var Kp=a(Dn);wd=n(Kp,"self.pad_token_id"),Kp.forEach(t),zd=n(rt," and "),jn=s(rt,"CODE",{});var em=a(jn);xd=n(em,"self.pad_token_type_id"),em.forEach(t),$d=n(rt,")."),rt.forEach(t),Pd=l(me),Te=s(me,"P",{});var qo=a(Te);Bd=n(qo,"Please note that with a fast tokenizer, using the "),Jn=s(qo,"CODE",{});var tm=a(Jn);Ed=n(tm,"__call__"),tm.forEach(t),qd=n(qo,` method is faster than using a method to encode the
text followed by a call to the `),Fn=s(qo,"CODE",{});var om=a(Fn);Md=n(om,"pad"),om.forEach(t),Id=n(qo," method to get a padded encoding."),qo.forEach(t),Ld=l(me),b(Ve.$$.fragment,me),me.forEach(t),Nd=l(g),Re=s(g,"DIV",{class:!0});var Qr=a(Re);b(Pt.$$.fragment,Qr),Wd=l(Qr),A=s(Qr,"P",{});var he=a(A);Ud=n(he,`Prepares a sequence of input id, or a pair of sequences of inputs ids so that it can be used by the model. It
adds special tokens, truncates sequences if overflowing while taking into account the special tokens and
manages a moving window (with user defined stride) for overflowing tokens. Please Note, for `),Sn=s(he,"EM",{});var nm=a(Sn);Dd=n(nm,"pair_ids"),nm.forEach(t),jd=n(he,`
different than `),An=s(he,"CODE",{});var rm=a(An);Jd=n(rm,"None"),rm.forEach(t),Fd=n(he," and "),Cn=s(he,"EM",{});var sm=a(Cn);Sd=n(sm,"truncation_strategy = longest_first"),sm.forEach(t),Ad=n(he," or "),Zn=s(he,"CODE",{});var am=a(Zn);Cd=n(am,"True"),am.forEach(t),Zd=n(he,`, it is not possible to return
overflowing tokens. Such a combination of arguments will raise an error.`),he.forEach(t),Qr.forEach(t),Vd=l(g),Ge=s(g,"DIV",{class:!0});var Kr=a(Ge);b(Bt.$$.fragment,Kr),Rd=l(Kr),Vn=s(Kr,"P",{});var im=a(Vn);Gd=n(im,"Prepare model inputs for translation. For best performance, translate one sentence at a time."),im.forEach(t),Kr.forEach(t),Od=l(g),de=s(g,"DIV",{class:!0});var Mo=a(de);b(Et.$$.fragment,Mo),Xd=l(Mo),Rn=s(Mo,"P",{});var dm=a(Rn);Yd=n(dm,"Upload the tokenizer files to the \u{1F917} Model Hub."),dm.forEach(t),Hd=l(Mo),b(Oe.$$.fragment,Mo),Mo.forEach(t),Qd=l(g),le=s(g,"DIV",{class:!0});var Io=a(le);b(qt.$$.fragment,Io),Kd=l(Io),Mt=s(Io,"P",{});var es=a(Mt);el=n(es,`Register this class with a given auto class. This should only be used for custom tokenizers as the ones in the
library are already mapped with `),Gn=s(es,"CODE",{});var lm=a(Gn);tl=n(lm,"AutoTokenizer"),lm.forEach(t),ol=n(es,"."),es.forEach(t),nl=l(Io),b(Xe.$$.fragment,Io),Io.forEach(t),rl=l(g),X=s(g,"DIV",{class:!0});var st=a(X);b(It.$$.fragment,st),sl=l(st),On=s(st,"P",{});var cm=a(On);al=n(cm,"Save the full tokenizer state."),cm.forEach(t),il=l(st),Lt=s(st,"P",{});var ts=a(Lt);dl=n(ts,`This method make sure the full tokenizer can then be re-loaded using the
`),Xn=s(ts,"CODE",{});var pm=a(Xn);ll=n(pm,"~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),pm.forEach(t),cl=n(ts," class method.."),ts.forEach(t),pl=l(st),Nt=s(st,"P",{});var os=a(Nt);ml=n(os,`Warning,None This won\u2019t save modifications you may have applied to the tokenizer after the instantiation (for
instance, modifying `),Yn=s(os,"CODE",{});var mm=a(Yn);hl=n(mm,"tokenizer.do_lower_case"),mm.forEach(t),ul=n(os," after creation)."),os.forEach(t),st.forEach(t),fl=l(g),ce=s(g,"DIV",{class:!0});var Lo=a(ce);b(Wt.$$.fragment,Lo),_l=l(Lo),Hn=s(Lo,"P",{});var hm=a(Hn);gl=n(hm,"Save only the vocabulary of the tokenizer (vocabulary + added tokens)."),hm.forEach(t),kl=l(Lo),Ut=s(Lo,"P",{});var ns=a(Ut);bl=n(ns,`This method won\u2019t save the configuration and special token mappings of the tokenizer. Use
`),Qn=s(ns,"CODE",{});var um=a(Qn);vl=n(um,"_save_pretrained()"),um.forEach(t),Tl=n(ns," to save the whole state of the tokenizer."),ns.forEach(t),Lo.forEach(t),yl=l(g),Ye=s(g,"DIV",{class:!0});var rs=a(Ye);b(Dt.$$.fragment,rs),wl=l(rs),jt=s(rs,"P",{});var ss=a(jt);zl=n(ss,"Converts a string in a sequence of tokens, replacing unknown tokens with the "),Kn=s(ss,"CODE",{});var fm=a(Kn);xl=n(fm,"unk_token"),fm.forEach(t),$l=n(ss,"."),ss.forEach(t),rs.forEach(t),Pl=l(g),He=s(g,"DIV",{class:!0});var as=a(He);b(Jt.$$.fragment,as),Bl=l(as),er=s(as,"P",{});var _m=a(er);El=n(_m,"Truncates a sequence pair in-place following the strategy."),_m.forEach(t),as.forEach(t),g.forEach(t),Nr=l(i),ye=s(i,"H2",{class:!0});var is=a(ye);Qe=s(is,"A",{id:!0,class:!0,href:!0});var gm=a(Qe);tr=s(gm,"SPAN",{});var km=a(tr);b(Ft.$$.fragment,km),km.forEach(t),gm.forEach(t),ql=l(is),or=s(is,"SPAN",{});var bm=a(or);Ml=n(bm,"SpecialTokensMixin"),bm.forEach(t),is.forEach(t),Wr=l(i),W=s(i,"DIV",{class:!0});var ue=a(W);b(St.$$.fragment,ue),Il=l(ue),we=s(ue,"P",{});var No=a(we);Ll=n(No,"A mixin derived by "),_o=s(No,"A",{href:!0});var vm=a(_o);Nl=n(vm,"PreTrainedTokenizer"),vm.forEach(t),Wl=n(No," and "),go=s(No,"A",{href:!0});var Tm=a(go);Ul=n(Tm,"PreTrainedTokenizerFast"),Tm.forEach(t),Dl=n(No,` to handle specific behaviors related to
special tokens. In particular, this class hold the attributes which can be used to directly access these special
tokens in a model-independent manner and allow to set and update the special tokens.`),No.forEach(t),jl=l(ue),q=s(ue,"DIV",{class:!0});var N=a(q);b(At.$$.fragment,N),Jl=l(N),nr=s(N,"P",{});var ym=a(nr);Fl=n(ym,`Add a dictionary of special tokens (eos, pad, cls, etc.) to the encoder and link them to class attributes. If
special tokens are NOT in the vocabulary, they are added to it (indexed starting from the last index of the
current vocabulary).`),ym.forEach(t),Sl=l(N),rr=s(N,"P",{});var wm=a(rr);Al=n(wm,`Note,None When adding new tokens to the vocabulary, you should make sure to also resize the token embedding
matrix of the model so that its embedding matrix matches the tokenizer.`),wm.forEach(t),Cl=l(N),Ct=s(N,"P",{});var ds=a(Ct);Zl=n(ds,"In order to do that, please use the "),ko=s(ds,"A",{href:!0});var zm=a(ko);Vl=n(zm,"resize_token_embeddings()"),zm.forEach(t),Rl=n(ds," method."),ds.forEach(t),Gl=l(N),Zt=s(N,"P",{});var ls=a(Zt);Ol=n(ls,"Using "),sr=s(ls,"CODE",{});var xm=a(sr);Xl=n(xm,"add_special_tokens"),xm.forEach(t),Yl=n(ls," will ensure your special tokens can be used in several ways:"),ls.forEach(t),Hl=l(N),Vt=s(N,"UL",{});var cs=a(Vt);ar=s(cs,"LI",{});var $m=a(ar);Ql=n($m,"Special tokens are carefully handled by the tokenizer (they are never split)."),$m.forEach(t),Kl=l(cs),Rt=s(cs,"LI",{});var ps=a(Rt);ec=n(ps,"You can easily refer to special tokens using tokenizer class attributes like "),ir=s(ps,"CODE",{});var Pm=a(ir);tc=n(Pm,"tokenizer.cls_token"),Pm.forEach(t),oc=n(ps,`. This
makes it easy to develop model-agnostic training and fine-tuning scripts.`),ps.forEach(t),cs.forEach(t),nc=l(N),C=s(N,"P",{});var fe=a(C);rc=n(fe,`When possible, special tokens are already registered for provided pretrained models (for instance
`),bo=s(fe,"A",{href:!0});var Bm=a(bo);sc=n(Bm,"BertTokenizer"),Bm.forEach(t),ac=l(fe),dr=s(fe,"CODE",{});var Em=a(dr);ic=n(Em,"cls_token"),Em.forEach(t),dc=n(fe," is already registered to be :obj"),lr=s(fe,"EM",{});var qm=a(lr);lc=n(qm,"\u2019[CLS]\u2019"),qm.forEach(t),cc=n(fe,` and XLM\u2019s one is also registered to be
`),cr=s(fe,"CODE",{});var Mm=a(cr);pc=n(Mm,"'</s>'"),Mm.forEach(t),mc=n(fe,")."),fe.forEach(t),hc=l(N),b(Ke.$$.fragment,N),N.forEach(t),uc=l(ue),J=s(ue,"DIV",{class:!0});var _e=a(J);b(Gt.$$.fragment,_e),fc=l(_e),pr=s(_e,"P",{});var Im=a(pr);_c=n(Im,`Add a list of new tokens to the tokenizer class. If the new tokens are not in the vocabulary, they are added to
it with indices starting from length of the current vocabulary and and will be isolated before the tokenization
algorithm is applied. Added tokens and tokens from the vocabulary of the tokenization algorithm are therefore
not treated in the same way.`),Im.forEach(t),gc=l(_e),mr=s(_e,"P",{});var Lm=a(mr);kc=n(Lm,`Note, when adding new tokens to the vocabulary, you should make sure to also resize the token embedding matrix
of the model so that its embedding matrix matches the tokenizer.`),Lm.forEach(t),bc=l(_e),Ot=s(_e,"P",{});var ms=a(Ot);vc=n(ms,"In order to do that, please use the "),vo=s(ms,"A",{href:!0});var Nm=a(vo);Tc=n(Nm,"resize_token_embeddings()"),Nm.forEach(t),yc=n(ms," method."),ms.forEach(t),wc=l(_e),b(et.$$.fragment,_e),_e.forEach(t),zc=l(ue),pe=s(ue,"DIV",{class:!0});var Wo=a(pe);b(Xt.$$.fragment,Wo),xc=l(Wo),ze=s(Wo,"P",{});var Uo=a(ze);$c=n(Uo,"Make sure that all the special tokens attributes of the tokenizer ("),hr=s(Uo,"CODE",{});var Wm=a(hr);Pc=n(Wm,"tokenizer.mask_token"),Wm.forEach(t),Bc=n(Uo,`,
`),ur=s(Uo,"CODE",{});var Um=a(ur);Ec=n(Um,"tokenizer.cls_token"),Um.forEach(t),qc=n(Uo,", etc.) are in the vocabulary."),Uo.forEach(t),Mc=l(Wo),fr=s(Wo,"P",{});var Dm=a(fr);Ic=n(Dm,"Add the missing ones to the vocabulary if needed."),Dm.forEach(t),Wo.forEach(t),ue.forEach(t),Ur=l(i),xe=s(i,"H2",{class:!0});var hs=a(xe);tt=s(hs,"A",{id:!0,class:!0,href:!0});var jm=a(tt);_r=s(jm,"SPAN",{});var Jm=a(_r);b(Yt.$$.fragment,Jm),Jm.forEach(t),jm.forEach(t),Lc=l(hs),gr=s(hs,"SPAN",{});var Fm=a(gr);Nc=n(Fm,"Enums and namedtuples"),Fm.forEach(t),hs.forEach(t),Dr=l(i),$e=s(i,"DIV",{class:!0});var us=a($e);b(Ht.$$.fragment,us),Wc=l(us),Pe=s(us,"P",{});var Do=a(Pe);Uc=n(Do,"Possible values for the "),kr=s(Do,"CODE",{});var Sm=a(kr);Dc=n(Sm,"truncation"),Sm.forEach(t),jc=n(Do," argument in "),ot=s(Do,"A",{href:!0});var fs=a(ot);Jc=n(fs,"PreTrainedTokenizerBase."),br=s(fs,"STRONG",{});var Am=a(br);Fc=n(Am,"call"),Am.forEach(t),Sc=n(fs,"()"),fs.forEach(t),Ac=n(Do,`. Useful for tab-completion in
an IDE.`),Do.forEach(t),us.forEach(t),jr=l(i),Be=s(i,"DIV",{class:!0});var _s=a(Be);b(Qt.$$.fragment,_s),Cc=l(_s),vr=s(_s,"P",{});var Cm=a(vr);Zc=n(Cm,"Character span in the original string."),Cm.forEach(t),_s.forEach(t),Jr=l(i),Ee=s(i,"DIV",{class:!0});var gs=a(Ee);b(Kt.$$.fragment,gs),Vc=l(gs),Tr=s(gs,"P",{});var Zm=a(Tr);Rc=n(Zm,"Token span in an encoded string (list of tokens)."),Zm.forEach(t),gs.forEach(t),this.h()},h(){m(p,"name","hf:doc:metadata"),m(p,"content",JSON.stringify(ah)),m(h,"id","utilities-for-tokenizers"),m(h,"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"),m(h,"href","#utilities-for-tokenizers"),m(f,"class","relative group"),m(ro,"href","/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),m(so,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(ao,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(io,"href","/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.SpecialTokensMixin"),m(Le,"id","transformers.PreTrainedTokenizerBase"),m(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Le,"href","#transformers.PreTrainedTokenizerBase"),m(ke,"class","relative group"),m(co,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(po,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(mo,"href","/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained"),m(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(uo,"href","../glossary#token-type-ids"),m(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(fo,"href","/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),m(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Qe,"id","transformers.SpecialTokensMixin"),m(Qe,"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"),m(Qe,"href","#transformers.SpecialTokensMixin"),m(ye,"class","relative group"),m(_o,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(go,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(ko,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.resize_token_embeddings"),m(bo,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizer"),m(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(vo,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.resize_token_embeddings"),m(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(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(tt,"id","transformers.tokenization_utils_base.TruncationStrategy"),m(tt,"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"),m(tt,"href","#transformers.tokenization_utils_base.TruncationStrategy"),m(xe,"class","relative group"),m(ot,"href","/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),m($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ee,"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,z){e(document.head,p),P(i,$,z),P(i,f,z),e(f,h),e(h,x),v(c,x,null),e(f,_),e(f,M),e(M,ge),P(i,S,z),P(i,I,z),e(I,no),e(I,ro),e(ro,ys),e(I,ws),e(I,so),e(so,zs),e(I,xs),e(I,ao),e(ao,$s),e(I,Ps),e(I,io),e(io,Bs),e(I,Es),P(i,Mr,z),P(i,lo,z),e(lo,qs),P(i,Ir,z),P(i,ke,z),e(ke,Le),e(Le,jo),v(at,jo,null),e(ke,Ms),e(ke,Jo),e(Jo,Is),P(i,Lr,z),P(i,u,z),v(it,u,null),e(u,Ls),e(u,be),e(be,Ns),e(be,co),e(co,Ws),e(be,Us),e(be,po),e(po,Ds),e(be,js),e(u,Js),e(u,Fo),e(Fo,Fs),e(u,Ss),e(u,So),e(So,As),e(u,Cs),e(u,L),e(L,K),e(K,Ao),e(Ao,Zs),e(K,Vs),e(K,Co),e(Co,Rs),e(K,Gs),e(K,Zo),e(Zo,Os),e(K,Xs),e(L,Ys),e(L,U),e(U,Vo),e(Vo,Hs),e(U,Qs),e(U,Ro),e(Ro,Ks),e(U,ea),e(U,Go),e(Go,ta),e(U,oa),e(U,Oo),e(Oo,na),e(U,ra),e(U,Xo),e(Xo,sa),e(U,aa),e(L,ia),e(L,V),e(V,Yo),e(Yo,da),e(V,la),e(V,Ho),e(Ho,ca),e(V,pa),e(V,Qo),e(Qo,ma),e(V,ha),e(V,Ko),e(Ko,ua),e(V,fa),e(L,_a),e(L,D),e(D,en),e(en,ga),e(D,ka),e(D,tn),e(tn,ba),e(D,va),e(D,on),e(on,Ta),e(D,ya),e(D,nn),e(nn,wa),e(D,za),e(D,mo),e(mo,xa),e(D,$a),e(L,Pa),e(L,Ne),e(Ne,rn),e(rn,Ba),e(Ne,Ea),e(Ne,sn),e(sn,qa),e(Ne,Ma),e(L,Ia),e(L,R),e(R,an),e(an,La),e(R,Na),e(R,dn),e(dn,Wa),e(R,Ua),e(R,ln),e(ln,Da),e(R,ja),e(R,cn),e(cn,Ja),e(R,Fa),e(L,Sa),e(L,G),e(G,pn),e(pn,Aa),e(G,Ca),e(G,mn),e(mn,Za),e(G,Va),e(G,hn),e(hn,Ra),e(G,Ga),e(G,un),e(un,Oa),e(G,Xa),e(u,Ya),e(u,We),v(dt,We,null),e(We,Ha),e(We,fn),e(fn,Qa),e(u,Ka),e(u,Ue),v(lt,Ue,null),e(Ue,ei),e(Ue,_n),e(_n,ti),e(u,oi),e(u,De),v(ct,De,null),e(De,ni),e(De,gn),e(gn,ri),e(u,si),e(u,ee),v(pt,ee,null),e(ee,ai),e(ee,kn),e(kn,ii),e(ee,di),v(je,ee,null),e(u,li),e(u,te),v(mt,te,null),e(te,ci),e(te,bn),e(bn,pi),e(te,mi),e(te,vn),e(vn,hi),e(u,ui),e(u,Je),v(ht,Je,null),e(Je,fi),e(Je,Tn),e(Tn,_i),e(u,gi),e(u,Fe),v(ut,Fe,null),e(Fe,ki),e(Fe,ft),e(ft,bi),e(ft,yn),e(yn,vi),e(ft,Ti),e(u,yi),e(u,oe),v(_t,oe,null),e(oe,wi),e(oe,ho),e(ho,zi),e(ho,uo),e(uo,xi),e(oe,$i),e(oe,wn),e(wn,Pi),e(u,Bi),e(u,ne),v(gt,ne,null),e(ne,Ei),e(ne,zn),e(zn,qi),e(ne,Mi),e(ne,kt),e(kt,Ii),e(kt,xn),e(xn,Li),e(kt,Ni),e(u,Wi),e(u,re),v(bt,re,null),e(re,Ui),e(re,$n),e($n,Di),e(re,ji),e(re,vt),e(vt,Ji),e(vt,Pn),e(Pn,Fi),e(vt,Si),e(u,Ai),e(u,se),v(Tt,se,null),e(se,Ci),e(se,Bn),e(Bn,Zi),e(se,Vi),v(Se,se,null),e(u,Ri),e(u,O),v(yt,O,null),e(O,Gi),e(O,wt),e(wt,Oi),e(wt,fo),e(fo,Xi),e(wt,Yi),e(O,Hi),v(Ae,O,null),e(O,Qi),v(Ce,O,null),e(u,Ki),e(u,Ze),v(zt,Ze,null),e(Ze,ed),e(Ze,ve),e(ve,td),e(ve,En),e(En,od),e(ve,nd),e(ve,qn),e(qn,rd),e(ve,sd),e(u,ad),e(u,ae),v(xt,ae,null),e(ae,id),e(ae,Mn),e(Mn,dd),e(ae,ld),e(ae,ie),e(ie,In),e(In,cd),e(ie,pd),e(ie,Ln),e(Ln,md),e(ie,hd),e(ie,Nn),e(Nn,ud),e(ie,fd),e(u,_d),e(u,j),v($t,j,null),e(j,gd),e(j,Wn),e(Wn,kd),e(j,bd),e(j,Y),e(Y,vd),e(Y,Un),e(Un,Td),e(Y,yd),e(Y,Dn),e(Dn,wd),e(Y,zd),e(Y,jn),e(jn,xd),e(Y,$d),e(j,Pd),e(j,Te),e(Te,Bd),e(Te,Jn),e(Jn,Ed),e(Te,qd),e(Te,Fn),e(Fn,Md),e(Te,Id),e(j,Ld),v(Ve,j,null),e(u,Nd),e(u,Re),v(Pt,Re,null),e(Re,Wd),e(Re,A),e(A,Ud),e(A,Sn),e(Sn,Dd),e(A,jd),e(A,An),e(An,Jd),e(A,Fd),e(A,Cn),e(Cn,Sd),e(A,Ad),e(A,Zn),e(Zn,Cd),e(A,Zd),e(u,Vd),e(u,Ge),v(Bt,Ge,null),e(Ge,Rd),e(Ge,Vn),e(Vn,Gd),e(u,Od),e(u,de),v(Et,de,null),e(de,Xd),e(de,Rn),e(Rn,Yd),e(de,Hd),v(Oe,de,null),e(u,Qd),e(u,le),v(qt,le,null),e(le,Kd),e(le,Mt),e(Mt,el),e(Mt,Gn),e(Gn,tl),e(Mt,ol),e(le,nl),v(Xe,le,null),e(u,rl),e(u,X),v(It,X,null),e(X,sl),e(X,On),e(On,al),e(X,il),e(X,Lt),e(Lt,dl),e(Lt,Xn),e(Xn,ll),e(Lt,cl),e(X,pl),e(X,Nt),e(Nt,ml),e(Nt,Yn),e(Yn,hl),e(Nt,ul),e(u,fl),e(u,ce),v(Wt,ce,null),e(ce,_l),e(ce,Hn),e(Hn,gl),e(ce,kl),e(ce,Ut),e(Ut,bl),e(Ut,Qn),e(Qn,vl),e(Ut,Tl),e(u,yl),e(u,Ye),v(Dt,Ye,null),e(Ye,wl),e(Ye,jt),e(jt,zl),e(jt,Kn),e(Kn,xl),e(jt,$l),e(u,Pl),e(u,He),v(Jt,He,null),e(He,Bl),e(He,er),e(er,El),P(i,Nr,z),P(i,ye,z),e(ye,Qe),e(Qe,tr),v(Ft,tr,null),e(ye,ql),e(ye,or),e(or,Ml),P(i,Wr,z),P(i,W,z),v(St,W,null),e(W,Il),e(W,we),e(we,Ll),e(we,_o),e(_o,Nl),e(we,Wl),e(we,go),e(go,Ul),e(we,Dl),e(W,jl),e(W,q),v(At,q,null),e(q,Jl),e(q,nr),e(nr,Fl),e(q,Sl),e(q,rr),e(rr,Al),e(q,Cl),e(q,Ct),e(Ct,Zl),e(Ct,ko),e(ko,Vl),e(Ct,Rl),e(q,Gl),e(q,Zt),e(Zt,Ol),e(Zt,sr),e(sr,Xl),e(Zt,Yl),e(q,Hl),e(q,Vt),e(Vt,ar),e(ar,Ql),e(Vt,Kl),e(Vt,Rt),e(Rt,ec),e(Rt,ir),e(ir,tc),e(Rt,oc),e(q,nc),e(q,C),e(C,rc),e(C,bo),e(bo,sc),e(C,ac),e(C,dr),e(dr,ic),e(C,dc),e(C,lr),e(lr,lc),e(C,cc),e(C,cr),e(cr,pc),e(C,mc),e(q,hc),v(Ke,q,null),e(W,uc),e(W,J),v(Gt,J,null),e(J,fc),e(J,pr),e(pr,_c),e(J,gc),e(J,mr),e(mr,kc),e(J,bc),e(J,Ot),e(Ot,vc),e(Ot,vo),e(vo,Tc),e(Ot,yc),e(J,wc),v(et,J,null),e(W,zc),e(W,pe),v(Xt,pe,null),e(pe,xc),e(pe,ze),e(ze,$c),e(ze,hr),e(hr,Pc),e(ze,Bc),e(ze,ur),e(ur,Ec),e(ze,qc),e(pe,Mc),e(pe,fr),e(fr,Ic),P(i,Ur,z),P(i,xe,z),e(xe,tt),e(tt,_r),v(Yt,_r,null),e(xe,Lc),e(xe,gr),e(gr,Nc),P(i,Dr,z),P(i,$e,z),v(Ht,$e,null),e($e,Wc),e($e,Pe),e(Pe,Uc),e(Pe,kr),e(kr,Dc),e(Pe,jc),e(Pe,ot),e(ot,Jc),e(ot,br),e(br,Fc),e(ot,Sc),e(Pe,Ac),P(i,jr,z),P(i,Be,z),v(Qt,Be,null),e(Be,Cc),e(Be,vr),e(vr,Zc),P(i,Jr,z),P(i,Ee,z),v(Kt,Ee,null),e(Ee,Vc),e(Ee,Tr),e(Tr,Rc),Fr=!0},p(i,[z]){const eo={};z&2&&(eo.$$scope={dirty:z,ctx:i}),je.$set(eo);const yr={};z&2&&(yr.$$scope={dirty:z,ctx:i}),Se.$set(yr);const wr={};z&2&&(wr.$$scope={dirty:z,ctx:i}),Ae.$set(wr);const zr={};z&2&&(zr.$$scope={dirty:z,ctx:i}),Ce.$set(zr);const Z={};z&2&&(Z.$$scope={dirty:z,ctx:i}),Ve.$set(Z);const xr={};z&2&&(xr.$$scope={dirty:z,ctx:i}),Oe.$set(xr);const $r={};z&2&&($r.$$scope={dirty:z,ctx:i}),Xe.$set($r);const Pr={};z&2&&(Pr.$$scope={dirty:z,ctx:i}),Ke.$set(Pr);const Br={};z&2&&(Br.$$scope={dirty:z,ctx:i}),et.$set(Br)},i(i){Fr||(T(c.$$.fragment,i),T(at.$$.fragment,i),T(it.$$.fragment,i),T(dt.$$.fragment,i),T(lt.$$.fragment,i),T(ct.$$.fragment,i),T(pt.$$.fragment,i),T(je.$$.fragment,i),T(mt.$$.fragment,i),T(ht.$$.fragment,i),T(ut.$$.fragment,i),T(_t.$$.fragment,i),T(gt.$$.fragment,i),T(bt.$$.fragment,i),T(Tt.$$.fragment,i),T(Se.$$.fragment,i),T(yt.$$.fragment,i),T(Ae.$$.fragment,i),T(Ce.$$.fragment,i),T(zt.$$.fragment,i),T(xt.$$.fragment,i),T($t.$$.fragment,i),T(Ve.$$.fragment,i),T(Pt.$$.fragment,i),T(Bt.$$.fragment,i),T(Et.$$.fragment,i),T(Oe.$$.fragment,i),T(qt.$$.fragment,i),T(Xe.$$.fragment,i),T(It.$$.fragment,i),T(Wt.$$.fragment,i),T(Dt.$$.fragment,i),T(Jt.$$.fragment,i),T(Ft.$$.fragment,i),T(St.$$.fragment,i),T(At.$$.fragment,i),T(Ke.$$.fragment,i),T(Gt.$$.fragment,i),T(et.$$.fragment,i),T(Xt.$$.fragment,i),T(Yt.$$.fragment,i),T(Ht.$$.fragment,i),T(Qt.$$.fragment,i),T(Kt.$$.fragment,i),Fr=!0)},o(i){y(c.$$.fragment,i),y(at.$$.fragment,i),y(it.$$.fragment,i),y(dt.$$.fragment,i),y(lt.$$.fragment,i),y(ct.$$.fragment,i),y(pt.$$.fragment,i),y(je.$$.fragment,i),y(mt.$$.fragment,i),y(ht.$$.fragment,i),y(ut.$$.fragment,i),y(_t.$$.fragment,i),y(gt.$$.fragment,i),y(bt.$$.fragment,i),y(Tt.$$.fragment,i),y(Se.$$.fragment,i),y(yt.$$.fragment,i),y(Ae.$$.fragment,i),y(Ce.$$.fragment,i),y(zt.$$.fragment,i),y(xt.$$.fragment,i),y($t.$$.fragment,i),y(Ve.$$.fragment,i),y(Pt.$$.fragment,i),y(Bt.$$.fragment,i),y(Et.$$.fragment,i),y(Oe.$$.fragment,i),y(qt.$$.fragment,i),y(Xe.$$.fragment,i),y(It.$$.fragment,i),y(Wt.$$.fragment,i),y(Dt.$$.fragment,i),y(Jt.$$.fragment,i),y(Ft.$$.fragment,i),y(St.$$.fragment,i),y(At.$$.fragment,i),y(Ke.$$.fragment,i),y(Gt.$$.fragment,i),y(et.$$.fragment,i),y(Xt.$$.fragment,i),y(Yt.$$.fragment,i),y(Ht.$$.fragment,i),y(Qt.$$.fragment,i),y(Kt.$$.fragment,i),Fr=!1},d(i){t(p),i&&t($),i&&t(f),w(c),i&&t(S),i&&t(I),i&&t(Mr),i&&t(lo),i&&t(Ir),i&&t(ke),w(at),i&&t(Lr),i&&t(u),w(it),w(dt),w(lt),w(ct),w(pt),w(je),w(mt),w(ht),w(ut),w(_t),w(gt),w(bt),w(Tt),w(Se),w(yt),w(Ae),w(Ce),w(zt),w(xt),w($t),w(Ve),w(Pt),w(Bt),w(Et),w(Oe),w(qt),w(Xe),w(It),w(Wt),w(Dt),w(Jt),i&&t(Nr),i&&t(ye),w(Ft),i&&t(Wr),i&&t(W),w(St),w(At),w(Ke),w(Gt),w(et),w(Xt),i&&t(Ur),i&&t(xe),w(Yt),i&&t(Dr),i&&t($e),w(Ht),i&&t(jr),i&&t(Be),w(Qt),i&&t(Jr),i&&t(Ee),w(Kt)}}}const ah={local:"utilities-for-tokenizers",sections:[{local:"transformers.PreTrainedTokenizerBase",title:"PreTrainedTokenizerBase"},{local:"transformers.SpecialTokensMixin",title:"SpecialTokensMixin"},{local:"transformers.tokenization_utils_base.TruncationStrategy",title:"Enums and namedtuples"}],title:"Utilities for Tokenizers"};function ih(E){return Xm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class uh extends Vm{constructor(p){super();Rm(this,p,ih,sh,Gm,{})}}export{uh as default,ah as metadata};
