import{S as Xm,i as Ym,s as Hm,e as r,k as d,w as k,t as o,M as Qm,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 Km,L as ys}from"../../chunks/vendor-hf-doc-builder.js";import{T as Mr}from"../../chunks/Tip-hf-doc-builder.js";import{D as B}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ws}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as vs}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ts}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function eh(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 th(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 oh(E){let p,$,f,h,x;return{c(){p=r("p"),$=o("Passing "),f=r("code"),h=o("use_auth_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,"use_auth_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 nh(E){let p,$,f,h,x;return h=new ws({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:ys,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,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 ro=a(c);_=n(ro,"return_tensors"),ro.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 sh(E){let p,$,f,h,x;return h=new ws({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:ys,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 ah(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 ih(E){let p,$,f,h,x;return h=new ws({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:ys,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 dh(E){let p,$,f,h,x;return h=new ws({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:ys,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 lh(E){let p,$,f,h,x,c,_,M,ge,S,I,ro,so,zs,xs,ao,$s,Ps,io,Bs,Es,lo,qs,Ms,Ir,co,Is,Lr,ke,Le,Jo,at,Ls,Fo,Ns,Nr,u,it,Ws,be,Us,po,Ds,js,mo,Js,Fs,Ss,So,Cs,As,Co,Zs,Vs,L,K,Ao,Rs,Gs,Zo,Os,Xs,Vo,Ys,Hs,Qs,U,Ro,Ks,ea,Go,ta,oa,Oo,na,ra,Xo,sa,aa,Yo,ia,da,la,V,Ho,ca,pa,Qo,ma,ha,Ko,ua,fa,en,_a,ga,ka,D,tn,ba,va,on,Ta,ya,nn,wa,za,rn,xa,$a,ho,Pa,Ba,Ea,Ne,sn,qa,Ma,an,Ia,La,Na,R,dn,Wa,Ua,ln,Da,ja,cn,Ja,Fa,pn,Sa,Ca,Aa,G,mn,Za,Va,hn,Ra,Ga,un,Oa,Xa,fn,Ya,Ha,Qa,We,dt,Ka,_n,ei,ti,Ue,lt,oi,gn,ni,ri,De,ct,si,kn,ai,ii,ee,pt,di,bn,li,ci,je,pi,te,mt,mi,vn,hi,ui,Tn,fi,_i,Je,ht,gi,yn,ki,bi,Fe,ut,vi,ft,Ti,wn,yi,wi,zi,oe,_t,xi,uo,$i,fo,Pi,Bi,zn,Ei,qi,ne,gt,Mi,xn,Ii,Li,kt,Ni,$n,Wi,Ui,Di,re,bt,ji,Pn,Ji,Fi,vt,Si,Bn,Ci,Ai,Zi,se,Tt,Vi,En,Ri,Gi,Se,Oi,O,yt,Xi,wt,Yi,_o,Hi,Qi,Ki,Ce,ed,Ae,td,Ze,zt,od,ve,nd,qn,rd,sd,Mn,ad,id,dd,ae,xt,ld,In,cd,pd,ie,Ln,md,hd,Nn,ud,fd,Wn,_d,gd,kd,j,$t,bd,Un,vd,Td,Y,yd,Dn,wd,zd,jn,xd,$d,Jn,Pd,Bd,Ed,Te,qd,Fn,Md,Id,Sn,Ld,Nd,Wd,Ve,Ud,Re,Pt,Dd,C,jd,Cn,Jd,Fd,An,Sd,Cd,Zn,Ad,Zd,Vn,Vd,Rd,Gd,Ge,Bt,Od,Rn,Xd,Yd,de,Et,Hd,qt,Qd,Gn,Kd,el,tl,Oe,ol,le,Mt,nl,It,rl,On,sl,al,il,Xe,dl,X,Lt,ll,Xn,cl,pl,Nt,ml,Yn,hl,ul,fl,Wt,_l,Hn,gl,kl,bl,ce,Ut,vl,Qn,Tl,yl,Dt,wl,Kn,zl,xl,$l,Ye,jt,Pl,Jt,Bl,er,El,ql,Ml,He,Ft,Il,tr,Ll,Wr,ye,Qe,or,St,Nl,nr,Wl,Ur,W,Ct,Ul,we,Dl,go,jl,Jl,ko,Fl,Sl,Cl,q,At,Al,rr,Zl,Vl,sr,Rl,Gl,Zt,Ol,bo,Xl,Yl,Hl,Vt,Ql,ar,Kl,ec,tc,Rt,ir,oc,nc,Gt,rc,dr,sc,ac,ic,A,dc,vo,lc,cc,lr,pc,mc,cr,hc,uc,pr,fc,_c,gc,Ke,kc,J,Ot,bc,mr,vc,Tc,hr,yc,wc,Xt,zc,To,xc,$c,Pc,et,Bc,pe,Yt,Ec,ze,qc,ur,Mc,Ic,fr,Lc,Nc,Wc,_r,Uc,Dr,xe,tt,gr,Ht,Dc,kr,jc,jr,$e,Qt,Jc,Pe,Fc,br,Sc,Cc,ot,Ac,vr,Zc,Vc,Rc,Jr,Be,Kt,Gc,Tr,Oc,Fr,Ee,eo,Xc,yr,Yc,Sr;return c=new vs({}),at=new vs({}),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.31.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"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/tokenization_utils_base.py#L1494"}}),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.31.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.31.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.31.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.31.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.31.0/src/transformers/tokenization_utils_base.py#L2503",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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.31.0/src/transformers/tokenization_utils_base.py#L3629"}}),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.31.0/src/transformers/tokenization_utils_base.py#L3461",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.31.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.31.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.31.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.31.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.31.0/src/transformers/tokenization_utils_base.py#L2800",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),je=new Mr({props:{warning:!0,$$slots:{default:[eh]},$$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.31.0/src/transformers/tokenization_utils_base.py#L3096",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.31.0/src/transformers/tokenization_utils_base.py#L3572",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.31.0/src/transformers/tokenization_utils_base.py#L3448",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.31.0/src/transformers/tokenization_utils_base.py#L3076",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.31.0/src/transformers/tokenization_utils_base.py#L3495",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.31.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.31.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.31.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.31.0/src/transformers/tokenization_utils_base.py#L2311",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.31.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.31.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.31.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.31.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.31.0/src/transformers/tokenization_utils_base.py#L2704",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Se=new Mr({props:{warning:!0,$$slots:{default:[th]},$$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[bool, str, 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.31.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.31.0/src/transformers/tokenization_utils_base.py#L1617"}}),Ce=new Mr({props:{$$slots:{default:[oh]},$$scope:{ctx:E}}}),Ae=new Ts({props:{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.example",$$slots:{default:[nh]},$$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.31.0/src/transformers/tokenization_utils_base.py#L3541",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.31.0/src/transformers/tokenization_utils_base.py#L1605",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.31.0/en/main_classes/tokenizer#transformers.BatchEncoding">BatchEncoding</a>, list of <a href="/docs/transformers/v4.31.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.31.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.31.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.31.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.31.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.31.0/src/transformers/tokenization_utils_base.py#L2903"}}),Ve=new Mr({props:{$$slots:{default:[rh]},$$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.31.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.31.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.31.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.31.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.31.0/src/transformers/tokenization_utils_base.py#L3116",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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.31.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.31.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.31.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.31.0/src/transformers/tokenization_utils_base.py#L3672",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.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:"use_auth_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.use_auth_token",description:`<strong>use_auth_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:"use_auth_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.31.0/src/transformers/utils/hub.py#L733"}}),Oe=new Ts({props:{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.example",$$slots:{default:[sh]},$$scope:{ctx:E}}}),Mt=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.31.0/src/transformers/tokenization_utils_base.py#L3646"}}),Xe=new Mr({props:{warning:!0,$$slots:{default:[ah]},$$scope:{ctx:E}}}),Lt=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.31.0/en/internal/image_processing_utils#transformers.ImageProcessingMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/tokenization_utils_base.py#L2094",returnDescription:`
<p>The files saved.</p>
`,returnType:`
<p>A tuple of <code>str</code></p>
`}}),Ut=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.31.0/src/transformers/tokenization_utils_base.py#L2273",returnDescription:`
<p>Paths to the files saved.</p>
`,returnType:`
<p><code>Tuple(str)</code></p>
`}}),jt=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.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__"><strong>call</strong>()</a>`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/tokenization_utils_base.py#L2291",returnDescription:`
<p>The list of tokens.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Ft=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.31.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.31.0/src/transformers/tokenization_utils_base.py#L3252",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>
`}}),St=new vs({}),Ct=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.31.0/src/transformers/tokenization_utils_base.py#L778"}}),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.31.0/src/transformers/tokenization_utils_base.py#L858",returnDescription:`
<p>Number of tokens added to the vocabulary.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Ke=new Ts({props:{anchor:"transformers.SpecialTokensMixin.add_special_tokens.example",$$slots:{default:[ih]},$$scope:{ctx:E}}}),Ot=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.31.0/src/transformers/tokenization_utils_base.py#L952",returnDescription:`
<p>Number of tokens added to the vocabulary.</p>
`,returnType:`
<p><code>int</code></p>
`}}),et=new Ts({props:{anchor:"transformers.SpecialTokensMixin.add_tokens.example",$$slots:{default:[dh]},$$scope:{ctx:E}}}),Yt=new B({props:{name:"sanitize_special_tokens",anchor:"transformers.SpecialTokensMixin.sanitize_special_tokens",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/tokenization_utils_base.py#L846",returnDescription:`
<p>The number of tokens added in the vocabulary during the operation.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Ht=new vs({}),Qt=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.31.0/src/transformers/tokenization_utils_base.py#L126"}}),Kt=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.31.0/src/transformers/tokenization_utils_base.py#L138"}}),eo=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.31.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"),ro=o(`This page lists all the utility functions used by the tokenizers, mainly the class
`),so=r("a"),zs=o("PreTrainedTokenizerBase"),xs=o(` that implements the common methods between
`),ao=r("a"),$s=o("PreTrainedTokenizer"),Ps=o(" and "),io=r("a"),Bs=o("PreTrainedTokenizerFast"),Es=o(` and the mixin
`),lo=r("a"),qs=o("SpecialTokensMixin"),Ms=o("."),Ir=d(),co=r("p"),Is=o("Most of those are only useful if you are studying the code of the tokenizers in the library."),Lr=d(),ke=r("h2"),Le=r("a"),Jo=r("span"),k(at.$$.fragment),Ls=d(),Fo=r("span"),Ns=o("PreTrainedTokenizerBase"),Nr=d(),u=r("div"),k(it.$$.fragment),Ws=d(),be=r("p"),Us=o("Base class for "),po=r("a"),Ds=o("PreTrainedTokenizer"),js=o(" and "),mo=r("a"),Js=o("PreTrainedTokenizerFast"),Fs=o("."),Ss=d(),So=r("p"),Cs=o("Handles shared (mostly boiler plate) methods for those two classes."),As=d(),Co=r("p"),Zs=o("Class attributes (overridden by derived classes)"),Vs=d(),L=r("ul"),K=r("li"),Ao=r("strong"),Rs=o("vocab_files_names"),Gs=o(" ("),Zo=r("code"),Os=o("Dict[str, str]"),Xs=o(") \u2014 A dictionary with, as keys, the "),Vo=r("code"),Ys=o("__init__"),Hs=o(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Qs=d(),U=r("li"),Ro=r("strong"),Ks=o("pretrained_vocab_files_map"),ea=o(" ("),Go=r("code"),ta=o("Dict[str, Dict[str, str]]"),oa=o(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),Oo=r("code"),na=o("__init__"),ra=o(` keyword name of each vocabulary file required by the model, the
low-level being the `),Xo=r("code"),sa=o("short-cut-names"),aa=o(" of the pretrained models with, as associated values, the "),Yo=r("code"),ia=o("url"),da=o(` to the
associated pretrained vocabulary file.`),la=d(),V=r("li"),Ho=r("strong"),ca=o("max_model_input_sizes"),pa=o(" ("),Qo=r("code"),ma=o("Dict[str, Optional[int]]"),ha=o(") \u2014 A dictionary with, as keys, the "),Ko=r("code"),ua=o("short-cut-names"),fa=o(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),en=r("code"),_a=o("None"),ga=o(" if the model has no maximum input size."),ka=d(),D=r("li"),tn=r("strong"),ba=o("pretrained_init_configuration"),va=o(" ("),on=r("code"),Ta=o("Dict[str, Dict[str, Any]]"),ya=o(`) \u2014 A dictionary with, as keys, the
`),nn=r("code"),wa=o("short-cut-names"),za=o(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),rn=r("code"),xa=o("__init__"),$a=o(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),ho=r("a"),Pa=o("from_pretrained()"),Ba=o(" method."),Ea=d(),Ne=r("li"),sn=r("strong"),qa=o("model_input_names"),Ma=o(" ("),an=r("code"),Ia=o("List[str]"),La=o(") \u2014 A list of inputs expected in the forward pass of the model."),Na=d(),R=r("li"),dn=r("strong"),Wa=o("padding_side"),Ua=o(" ("),ln=r("code"),Da=o("str"),ja=o(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),cn=r("code"),Ja=o("'right'"),Fa=o(" or "),pn=r("code"),Sa=o("'left'"),Ca=o("."),Aa=d(),G=r("li"),mn=r("strong"),Za=o("truncation_side"),Va=o(" ("),hn=r("code"),Ra=o("str"),Ga=o(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),un=r("code"),Oa=o("'right'"),Xa=o(" or "),fn=r("code"),Ya=o("'left'"),Ha=o("."),Qa=d(),We=r("div"),k(dt.$$.fragment),Ka=d(),_n=r("p"),ei=o(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),ti=d(),Ue=r("div"),k(lt.$$.fragment),oi=d(),gn=r("p"),ni=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.`),ri=d(),De=r("div"),k(ct.$$.fragment),si=d(),kn=r("p"),ai=o("Convert a list of lists of token ids into a list of strings by calling decode."),ii=d(),ee=r("div"),k(pt.$$.fragment),di=d(),bn=r("p"),li=o("Tokenize and prepare for the model a list of sequences or a list of pairs of sequences."),ci=d(),k(je.$$.fragment),pi=d(),te=r("div"),k(mt.$$.fragment),mi=d(),vn=r("p"),hi=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens.`),ui=d(),Tn=r("p"),fi=o("This implementation does not add special tokens and this method should be overridden in a subclass."),_i=d(),Je=r("div"),k(ht.$$.fragment),gi=d(),yn=r("p"),ki=o("Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms."),bi=d(),Fe=r("div"),k(ut.$$.fragment),vi=d(),ft=r("p"),Ti=o("Converts a sequence of tokens in a single string. The most simple way to do it is "),wn=r("code"),yi=o('" ".join(tokens)'),wi=o(` but we
often want to remove sub-word tokenization artifacts at the same time.`),zi=d(),oe=r("div"),k(_t.$$.fragment),xi=d(),uo=r("p"),$i=o("Create the token type IDs corresponding to the sequences passed. "),fo=r("a"),Pi=o(`What are token type
IDs?`),Bi=d(),zn=r("p"),Ei=o("Should be overridden in a subclass if the model has a special way of building those."),qi=d(),ne=r("div"),k(gt.$$.fragment),Mi=d(),xn=r("p"),Ii=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.`),Li=d(),kt=r("p"),Ni=o("Similar to doing "),$n=r("code"),Wi=o("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Ui=o("."),Di=d(),re=r("div"),k(bt.$$.fragment),ji=d(),Pn=r("p"),Ji=o("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Fi=d(),vt=r("p"),Si=o("Same as doing "),Bn=r("code"),Ci=o("self.convert_tokens_to_ids(self.tokenize(text))"),Ai=o("."),Zi=d(),se=r("div"),k(Tt.$$.fragment),Vi=d(),En=r("p"),Ri=o("Tokenize and prepare for the model a sequence or a pair of sequences."),Gi=d(),k(Se.$$.fragment),Oi=d(),O=r("div"),k(yt.$$.fragment),Xi=d(),wt=r("p"),Yi=o("Instantiate a "),_o=r("a"),Hi=o("PreTrainedTokenizerBase"),Qi=o(` (or a derived class) from a predefined
tokenizer.`),Ki=d(),k(Ce.$$.fragment),ed=d(),k(Ae.$$.fragment),td=d(),Ze=r("div"),k(zt.$$.fragment),od=d(),ve=r("p"),nd=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 `),qn=r("code"),rd=o("prepare_for_model"),sd=o(" or "),Mn=r("code"),ad=o("encode_plus"),id=o(" methods."),dd=d(),ae=r("div"),k(xt.$$.fragment),ld=d(),In=r("p"),cd=o("Returns the vocabulary as a dictionary of token to index."),pd=d(),ie=r("p"),Ln=r("code"),md=o("tokenizer.get_vocab()[token]"),hd=o(" is equivalent to "),Nn=r("code"),ud=o("tokenizer.convert_tokens_to_ids(token)"),fd=o(" when "),Wn=r("code"),_d=o("token"),gd=o(` is in the
vocab.`),kd=d(),j=r("div"),k($t.$$.fragment),bd=d(),Un=r("p"),vd=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.`),Td=d(),Y=r("p"),yd=o("Padding side (left/right) padding token ids are defined at the tokenizer level (with "),Dn=r("code"),wd=o("self.padding_side"),zd=o(`,
`),jn=r("code"),xd=o("self.pad_token_id"),$d=o(" and "),Jn=r("code"),Pd=o("self.pad_token_type_id"),Bd=o(")."),Ed=d(),Te=r("p"),qd=o("Please note that with a fast tokenizer, using the "),Fn=r("code"),Md=o("__call__"),Id=o(` method is faster than using a method to encode the
text followed by a call to the `),Sn=r("code"),Ld=o("pad"),Nd=o(" method to get a padded encoding."),Wd=d(),k(Ve.$$.fragment),Ud=d(),Re=r("div"),k(Pt.$$.fragment),Dd=d(),C=r("p"),jd=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 `),Cn=r("em"),Jd=o("pair_ids"),Fd=o(`
different than `),An=r("code"),Sd=o("None"),Cd=o(" and "),Zn=r("em"),Ad=o("truncation_strategy = longest_first"),Zd=o(" or "),Vn=r("code"),Vd=o("True"),Rd=o(`, it is not possible to return
overflowing tokens. Such a combination of arguments will raise an error.`),Gd=d(),Ge=r("div"),k(Bt.$$.fragment),Od=d(),Rn=r("p"),Xd=o("Prepare model inputs for translation. For best performance, translate one sentence at a time."),Yd=d(),de=r("div"),k(Et.$$.fragment),Hd=d(),qt=r("p"),Qd=o(`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Gn=r("code"),Kd=o("repo_path_or_name"),el=o("."),tl=d(),k(Oe.$$.fragment),ol=d(),le=r("div"),k(Mt.$$.fragment),nl=d(),It=r("p"),rl=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 `),On=r("code"),sl=o("AutoTokenizer"),al=o("."),il=d(),k(Xe.$$.fragment),dl=d(),X=r("div"),k(Lt.$$.fragment),ll=d(),Xn=r("p"),cl=o("Save the full tokenizer state."),pl=d(),Nt=r("p"),ml=o(`This method make sure the full tokenizer can then be re-loaded using the
`),Yn=r("code"),hl=o("~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),ul=o(" class method.."),fl=d(),Wt=r("p"),_l=o(`Warning,None This won\u2019t save modifications you may have applied to the tokenizer after the instantiation (for
instance, modifying `),Hn=r("code"),gl=o("tokenizer.do_lower_case"),kl=o(" after creation)."),bl=d(),ce=r("div"),k(Ut.$$.fragment),vl=d(),Qn=r("p"),Tl=o("Save only the vocabulary of the tokenizer (vocabulary + added tokens)."),yl=d(),Dt=r("p"),wl=o(`This method won\u2019t save the configuration and special token mappings of the tokenizer. Use
`),Kn=r("code"),zl=o("_save_pretrained()"),xl=o(" to save the whole state of the tokenizer."),$l=d(),Ye=r("div"),k(jt.$$.fragment),Pl=d(),Jt=r("p"),Bl=o("Converts a string in a sequence of tokens, replacing unknown tokens with the "),er=r("code"),El=o("unk_token"),ql=o("."),Ml=d(),He=r("div"),k(Ft.$$.fragment),Il=d(),tr=r("p"),Ll=o("Truncates a sequence pair in-place following the strategy."),Wr=d(),ye=r("h2"),Qe=r("a"),or=r("span"),k(St.$$.fragment),Nl=d(),nr=r("span"),Wl=o("SpecialTokensMixin"),Ur=d(),W=r("div"),k(Ct.$$.fragment),Ul=d(),we=r("p"),Dl=o("A mixin derived by "),go=r("a"),jl=o("PreTrainedTokenizer"),Jl=o(" and "),ko=r("a"),Fl=o("PreTrainedTokenizerFast"),Sl=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.`),Cl=d(),q=r("div"),k(At.$$.fragment),Al=d(),rr=r("p"),Zl=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).`),Vl=d(),sr=r("p"),Rl=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.`),Gl=d(),Zt=r("p"),Ol=o("In order to do that, please use the "),bo=r("a"),Xl=o("resize_token_embeddings()"),Yl=o(" method."),Hl=d(),Vt=r("p"),Ql=o("Using "),ar=r("code"),Kl=o("add_special_tokens"),ec=o(" will ensure your special tokens can be used in several ways:"),tc=d(),Rt=r("ul"),ir=r("li"),oc=o("Special tokens are carefully handled by the tokenizer (they are never split)."),nc=d(),Gt=r("li"),rc=o("You can easily refer to special tokens using tokenizer class attributes like "),dr=r("code"),sc=o("tokenizer.cls_token"),ac=o(`. This
makes it easy to develop model-agnostic training and fine-tuning scripts.`),ic=d(),A=r("p"),dc=o(`When possible, special tokens are already registered for provided pretrained models (for instance
`),vo=r("a"),lc=o("BertTokenizer"),cc=d(),lr=r("code"),pc=o("cls_token"),mc=o(" is already registered to be :obj"),cr=r("em"),hc=o("\u2019[CLS]\u2019"),uc=o(` and XLM\u2019s one is also registered to be
`),pr=r("code"),fc=o("'</s>'"),_c=o(")."),gc=d(),k(Ke.$$.fragment),kc=d(),J=r("div"),k(Ot.$$.fragment),bc=d(),mr=r("p"),vc=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.`),Tc=d(),hr=r("p"),yc=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.`),wc=d(),Xt=r("p"),zc=o("In order to do that, please use the "),To=r("a"),xc=o("resize_token_embeddings()"),$c=o(" method."),Pc=d(),k(et.$$.fragment),Bc=d(),pe=r("div"),k(Yt.$$.fragment),Ec=d(),ze=r("p"),qc=o("Make sure that all the special tokens attributes of the tokenizer ("),ur=r("code"),Mc=o("tokenizer.mask_token"),Ic=o(`,
`),fr=r("code"),Lc=o("tokenizer.cls_token"),Nc=o(", etc.) are in the vocabulary."),Wc=d(),_r=r("p"),Uc=o("Add the missing ones to the vocabulary if needed."),Dr=d(),xe=r("h2"),tt=r("a"),gr=r("span"),k(Ht.$$.fragment),Dc=d(),kr=r("span"),jc=o("Enums and namedtuples"),jr=d(),$e=r("div"),k(Qt.$$.fragment),Jc=d(),Pe=r("p"),Fc=o("Possible values for the "),br=r("code"),Sc=o("truncation"),Cc=o(" argument in "),ot=r("a"),Ac=o("PreTrainedTokenizerBase."),vr=r("strong"),Zc=o("call"),Vc=o("()"),Rc=o(`. Useful for tab-completion in
an IDE.`),Jr=d(),Be=r("div"),k(Kt.$$.fragment),Gc=d(),Tr=r("p"),Oc=o("Character span in the original string."),Fr=d(),Ee=r("div"),k(eo.$$.fragment),Xc=d(),yr=r("p"),Yc=o("Token span in an encoded string (list of tokens)."),this.h()},l(i){const z=Qm('[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 to=a(f);h=s(to,"A",{id:!0,class:!0,href:!0});var wr=a(h);x=s(wr,"SPAN",{});var zr=a(x);b(c.$$.fragment,zr),zr.forEach(t),wr.forEach(t),_=l(to),M=s(to,"SPAN",{});var xr=a(M);ge=n(xr,"Utilities for Tokenizers"),xr.forEach(t),to.forEach(t),S=l(i),I=s(i,"P",{});var Z=a(I);ro=n(Z,`This page lists all the utility functions used by the tokenizers, mainly the class
`),so=s(Z,"A",{href:!0});var $r=a(so);zs=n($r,"PreTrainedTokenizerBase"),$r.forEach(t),xs=n(Z,` that implements the common methods between
`),ao=s(Z,"A",{href:!0});var Pr=a(ao);$s=n(Pr,"PreTrainedTokenizer"),Pr.forEach(t),Ps=n(Z," and "),io=s(Z,"A",{href:!0});var Br=a(io);Bs=n(Br,"PreTrainedTokenizerFast"),Br.forEach(t),Es=n(Z,` and the mixin
`),lo=s(Z,"A",{href:!0});var Er=a(lo);qs=n(Er,"SpecialTokensMixin"),Er.forEach(t),Ms=n(Z,"."),Z.forEach(t),Ir=l(i),co=s(i,"P",{});var Qc=a(co);Is=n(Qc,"Most of those are only useful if you are studying the code of the tokenizers in the library."),Qc.forEach(t),Lr=l(i),ke=s(i,"H2",{class:!0});var Cr=a(ke);Le=s(Cr,"A",{id:!0,class:!0,href:!0});var Kc=a(Le);Jo=s(Kc,"SPAN",{});var ep=a(Jo);b(at.$$.fragment,ep),ep.forEach(t),Kc.forEach(t),Ls=l(Cr),Fo=s(Cr,"SPAN",{});var tp=a(Fo);Ns=n(tp,"PreTrainedTokenizerBase"),tp.forEach(t),Cr.forEach(t),Nr=l(i),u=s(i,"DIV",{class:!0});var g=a(u);b(it.$$.fragment,g),Ws=l(g),be=s(g,"P",{});var yo=a(be);Us=n(yo,"Base class for "),po=s(yo,"A",{href:!0});var op=a(po);Ds=n(op,"PreTrainedTokenizer"),op.forEach(t),js=n(yo," and "),mo=s(yo,"A",{href:!0});var np=a(mo);Js=n(np,"PreTrainedTokenizerFast"),np.forEach(t),Fs=n(yo,"."),yo.forEach(t),Ss=l(g),So=s(g,"P",{});var rp=a(So);Cs=n(rp,"Handles shared (mostly boiler plate) methods for those two classes."),rp.forEach(t),As=l(g),Co=s(g,"P",{});var sp=a(Co);Zs=n(sp,"Class attributes (overridden by derived classes)"),sp.forEach(t),Vs=l(g),L=s(g,"UL",{});var F=a(L);K=s(F,"LI",{});var oo=a(K);Ao=s(oo,"STRONG",{});var ap=a(Ao);Rs=n(ap,"vocab_files_names"),ap.forEach(t),Gs=n(oo," ("),Zo=s(oo,"CODE",{});var ip=a(Zo);Os=n(ip,"Dict[str, str]"),ip.forEach(t),Xs=n(oo,") \u2014 A dictionary with, as keys, the "),Vo=s(oo,"CODE",{});var dp=a(Vo);Ys=n(dp,"__init__"),dp.forEach(t),Hs=n(oo,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),oo.forEach(t),Qs=l(F),U=s(F,"LI",{});var H=a(U);Ro=s(H,"STRONG",{});var lp=a(Ro);Ks=n(lp,"pretrained_vocab_files_map"),lp.forEach(t),ea=n(H," ("),Go=s(H,"CODE",{});var cp=a(Go);ta=n(cp,"Dict[str, Dict[str, str]]"),cp.forEach(t),oa=n(H,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),Oo=s(H,"CODE",{});var pp=a(Oo);na=n(pp,"__init__"),pp.forEach(t),ra=n(H,` keyword name of each vocabulary file required by the model, the
low-level being the `),Xo=s(H,"CODE",{});var mp=a(Xo);sa=n(mp,"short-cut-names"),mp.forEach(t),aa=n(H," of the pretrained models with, as associated values, the "),Yo=s(H,"CODE",{});var hp=a(Yo);ia=n(hp,"url"),hp.forEach(t),da=n(H,` to the
associated pretrained vocabulary file.`),H.forEach(t),la=l(F),V=s(F,"LI",{});var qe=a(V);Ho=s(qe,"STRONG",{});var up=a(Ho);ca=n(up,"max_model_input_sizes"),up.forEach(t),pa=n(qe," ("),Qo=s(qe,"CODE",{});var fp=a(Qo);ma=n(fp,"Dict[str, Optional[int]]"),fp.forEach(t),ha=n(qe,") \u2014 A dictionary with, as keys, the "),Ko=s(qe,"CODE",{});var _p=a(Ko);ua=n(_p,"short-cut-names"),_p.forEach(t),fa=n(qe,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),en=s(qe,"CODE",{});var gp=a(en);_a=n(gp,"None"),gp.forEach(t),ga=n(qe," if the model has no maximum input size."),qe.forEach(t),ka=l(F),D=s(F,"LI",{});var Q=a(D);tn=s(Q,"STRONG",{});var kp=a(tn);ba=n(kp,"pretrained_init_configuration"),kp.forEach(t),va=n(Q," ("),on=s(Q,"CODE",{});var bp=a(on);Ta=n(bp,"Dict[str, Dict[str, Any]]"),bp.forEach(t),ya=n(Q,`) \u2014 A dictionary with, as keys, the
`),nn=s(Q,"CODE",{});var vp=a(nn);wa=n(vp,"short-cut-names"),vp.forEach(t),za=n(Q,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),rn=s(Q,"CODE",{});var Tp=a(rn);xa=n(Tp,"__init__"),Tp.forEach(t),$a=n(Q,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),ho=s(Q,"A",{href:!0});var yp=a(ho);Pa=n(yp,"from_pretrained()"),yp.forEach(t),Ba=n(Q," method."),Q.forEach(t),Ea=l(F),Ne=s(F,"LI",{});var qr=a(Ne);sn=s(qr,"STRONG",{});var wp=a(sn);qa=n(wp,"model_input_names"),wp.forEach(t),Ma=n(qr," ("),an=s(qr,"CODE",{});var zp=a(an);Ia=n(zp,"List[str]"),zp.forEach(t),La=n(qr,") \u2014 A list of inputs expected in the forward pass of the model."),qr.forEach(t),Na=l(F),R=s(F,"LI",{});var Me=a(R);dn=s(Me,"STRONG",{});var xp=a(dn);Wa=n(xp,"padding_side"),xp.forEach(t),Ua=n(Me," ("),ln=s(Me,"CODE",{});var $p=a(ln);Da=n($p,"str"),$p.forEach(t),ja=n(Me,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),cn=s(Me,"CODE",{});var Pp=a(cn);Ja=n(Pp,"'right'"),Pp.forEach(t),Fa=n(Me," or "),pn=s(Me,"CODE",{});var Bp=a(pn);Sa=n(Bp,"'left'"),Bp.forEach(t),Ca=n(Me,"."),Me.forEach(t),Aa=l(F),G=s(F,"LI",{});var Ie=a(G);mn=s(Ie,"STRONG",{});var Ep=a(mn);Za=n(Ep,"truncation_side"),Ep.forEach(t),Va=n(Ie," ("),hn=s(Ie,"CODE",{});var qp=a(hn);Ra=n(qp,"str"),qp.forEach(t),Ga=n(Ie,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),un=s(Ie,"CODE",{});var Mp=a(un);Oa=n(Mp,"'right'"),Mp.forEach(t),Xa=n(Ie," or "),fn=s(Ie,"CODE",{});var Ip=a(fn);Ya=n(Ip,"'left'"),Ip.forEach(t),Ha=n(Ie,"."),Ie.forEach(t),F.forEach(t),Qa=l(g),We=s(g,"DIV",{class:!0});var Ar=a(We);b(dt.$$.fragment,Ar),Ka=l(Ar),_n=s(Ar,"P",{});var Lp=a(_n);ei=n(Lp,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Lp.forEach(t),Ar.forEach(t),ti=l(g),Ue=s(g,"DIV",{class:!0});var Zr=a(Ue);b(lt.$$.fragment,Zr),oi=l(Zr),gn=s(Zr,"P",{});var Np=a(gn);ni=n(Np,`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.`),Np.forEach(t),Zr.forEach(t),ri=l(g),De=s(g,"DIV",{class:!0});var Vr=a(De);b(ct.$$.fragment,Vr),si=l(Vr),kn=s(Vr,"P",{});var Wp=a(kn);ai=n(Wp,"Convert a list of lists of token ids into a list of strings by calling decode."),Wp.forEach(t),Vr.forEach(t),ii=l(g),ee=s(g,"DIV",{class:!0});var wo=a(ee);b(pt.$$.fragment,wo),di=l(wo),bn=s(wo,"P",{});var Up=a(bn);li=n(Up,"Tokenize and prepare for the model a list of sequences or a list of pairs of sequences."),Up.forEach(t),ci=l(wo),b(je.$$.fragment,wo),wo.forEach(t),pi=l(g),te=s(g,"DIV",{class:!0});var zo=a(te);b(mt.$$.fragment,zo),mi=l(zo),vn=s(zo,"P",{});var Dp=a(vn);hi=n(Dp,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens.`),Dp.forEach(t),ui=l(zo),Tn=s(zo,"P",{});var jp=a(Tn);fi=n(jp,"This implementation does not add special tokens and this method should be overridden in a subclass."),jp.forEach(t),zo.forEach(t),_i=l(g),Je=s(g,"DIV",{class:!0});var Rr=a(Je);b(ht.$$.fragment,Rr),gi=l(Rr),yn=s(Rr,"P",{});var Jp=a(yn);ki=n(Jp,"Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms."),Jp.forEach(t),Rr.forEach(t),bi=l(g),Fe=s(g,"DIV",{class:!0});var Gr=a(Fe);b(ut.$$.fragment,Gr),vi=l(Gr),ft=s(Gr,"P",{});var Or=a(ft);Ti=n(Or,"Converts a sequence of tokens in a single string. The most simple way to do it is "),wn=s(Or,"CODE",{});var Fp=a(wn);yi=n(Fp,'" ".join(tokens)'),Fp.forEach(t),wi=n(Or,` but we
often want to remove sub-word tokenization artifacts at the same time.`),Or.forEach(t),Gr.forEach(t),zi=l(g),oe=s(g,"DIV",{class:!0});var xo=a(oe);b(_t.$$.fragment,xo),xi=l(xo),uo=s(xo,"P",{});var Hc=a(uo);$i=n(Hc,"Create the token type IDs corresponding to the sequences passed. "),fo=s(Hc,"A",{href:!0});var Sp=a(fo);Pi=n(Sp,`What are token type
IDs?`),Sp.forEach(t),Hc.forEach(t),Bi=l(xo),zn=s(xo,"P",{});var Cp=a(zn);Ei=n(Cp,"Should be overridden in a subclass if the model has a special way of building those."),Cp.forEach(t),xo.forEach(t),qi=l(g),ne=s(g,"DIV",{class:!0});var $o=a(ne);b(gt.$$.fragment,$o),Mi=l($o),xn=s($o,"P",{});var Ap=a(xn);Ii=n(Ap,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Ap.forEach(t),Li=l($o),kt=s($o,"P",{});var Xr=a(kt);Ni=n(Xr,"Similar to doing "),$n=s(Xr,"CODE",{});var Zp=a($n);Wi=n(Zp,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Zp.forEach(t),Ui=n(Xr,"."),Xr.forEach(t),$o.forEach(t),Di=l(g),re=s(g,"DIV",{class:!0});var Po=a(re);b(bt.$$.fragment,Po),ji=l(Po),Pn=s(Po,"P",{});var Vp=a(Pn);Ji=n(Vp,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Vp.forEach(t),Fi=l(Po),vt=s(Po,"P",{});var Yr=a(vt);Si=n(Yr,"Same as doing "),Bn=s(Yr,"CODE",{});var Rp=a(Bn);Ci=n(Rp,"self.convert_tokens_to_ids(self.tokenize(text))"),Rp.forEach(t),Ai=n(Yr,"."),Yr.forEach(t),Po.forEach(t),Zi=l(g),se=s(g,"DIV",{class:!0});var Bo=a(se);b(Tt.$$.fragment,Bo),Vi=l(Bo),En=s(Bo,"P",{});var Gp=a(En);Ri=n(Gp,"Tokenize and prepare for the model a sequence or a pair of sequences."),Gp.forEach(t),Gi=l(Bo),b(Se.$$.fragment,Bo),Bo.forEach(t),Oi=l(g),O=s(g,"DIV",{class:!0});var nt=a(O);b(yt.$$.fragment,nt),Xi=l(nt),wt=s(nt,"P",{});var Hr=a(wt);Yi=n(Hr,"Instantiate a "),_o=s(Hr,"A",{href:!0});var Op=a(_o);Hi=n(Op,"PreTrainedTokenizerBase"),Op.forEach(t),Qi=n(Hr,` (or a derived class) from a predefined
tokenizer.`),Hr.forEach(t),Ki=l(nt),b(Ce.$$.fragment,nt),ed=l(nt),b(Ae.$$.fragment,nt),nt.forEach(t),td=l(g),Ze=s(g,"DIV",{class:!0});var Qr=a(Ze);b(zt.$$.fragment,Qr),od=l(Qr),ve=s(Qr,"P",{});var Eo=a(ve);nd=n(Eo,`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),qn=s(Eo,"CODE",{});var Xp=a(qn);rd=n(Xp,"prepare_for_model"),Xp.forEach(t),sd=n(Eo," or "),Mn=s(Eo,"CODE",{});var Yp=a(Mn);ad=n(Yp,"encode_plus"),Yp.forEach(t),id=n(Eo," methods."),Eo.forEach(t),Qr.forEach(t),dd=l(g),ae=s(g,"DIV",{class:!0});var qo=a(ae);b(xt.$$.fragment,qo),ld=l(qo),In=s(qo,"P",{});var Hp=a(In);cd=n(Hp,"Returns the vocabulary as a dictionary of token to index."),Hp.forEach(t),pd=l(qo),ie=s(qo,"P",{});var no=a(ie);Ln=s(no,"CODE",{});var Qp=a(Ln);md=n(Qp,"tokenizer.get_vocab()[token]"),Qp.forEach(t),hd=n(no," is equivalent to "),Nn=s(no,"CODE",{});var Kp=a(Nn);ud=n(Kp,"tokenizer.convert_tokens_to_ids(token)"),Kp.forEach(t),fd=n(no," when "),Wn=s(no,"CODE",{});var em=a(Wn);_d=n(em,"token"),em.forEach(t),gd=n(no,` is in the
vocab.`),no.forEach(t),qo.forEach(t),kd=l(g),j=s(g,"DIV",{class:!0});var me=a(j);b($t.$$.fragment,me),bd=l(me),Un=s(me,"P",{});var tm=a(Un);vd=n(tm,`Pad a single encoded input or a batch of encoded inputs up to predefined length or to the max sequence length
in the batch.`),tm.forEach(t),Td=l(me),Y=s(me,"P",{});var rt=a(Y);yd=n(rt,"Padding side (left/right) padding token ids are defined at the tokenizer level (with "),Dn=s(rt,"CODE",{});var om=a(Dn);wd=n(om,"self.padding_side"),om.forEach(t),zd=n(rt,`,
`),jn=s(rt,"CODE",{});var nm=a(jn);xd=n(nm,"self.pad_token_id"),nm.forEach(t),$d=n(rt," and "),Jn=s(rt,"CODE",{});var rm=a(Jn);Pd=n(rm,"self.pad_token_type_id"),rm.forEach(t),Bd=n(rt,")."),rt.forEach(t),Ed=l(me),Te=s(me,"P",{});var Mo=a(Te);qd=n(Mo,"Please note that with a fast tokenizer, using the "),Fn=s(Mo,"CODE",{});var sm=a(Fn);Md=n(sm,"__call__"),sm.forEach(t),Id=n(Mo,` method is faster than using a method to encode the
text followed by a call to the `),Sn=s(Mo,"CODE",{});var am=a(Sn);Ld=n(am,"pad"),am.forEach(t),Nd=n(Mo," method to get a padded encoding."),Mo.forEach(t),Wd=l(me),b(Ve.$$.fragment,me),me.forEach(t),Ud=l(g),Re=s(g,"DIV",{class:!0});var Kr=a(Re);b(Pt.$$.fragment,Kr),Dd=l(Kr),C=s(Kr,"P",{});var he=a(C);jd=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 `),Cn=s(he,"EM",{});var im=a(Cn);Jd=n(im,"pair_ids"),im.forEach(t),Fd=n(he,`
different than `),An=s(he,"CODE",{});var dm=a(An);Sd=n(dm,"None"),dm.forEach(t),Cd=n(he," and "),Zn=s(he,"EM",{});var lm=a(Zn);Ad=n(lm,"truncation_strategy = longest_first"),lm.forEach(t),Zd=n(he," or "),Vn=s(he,"CODE",{});var cm=a(Vn);Vd=n(cm,"True"),cm.forEach(t),Rd=n(he,`, it is not possible to return
overflowing tokens. Such a combination of arguments will raise an error.`),he.forEach(t),Kr.forEach(t),Gd=l(g),Ge=s(g,"DIV",{class:!0});var es=a(Ge);b(Bt.$$.fragment,es),Od=l(es),Rn=s(es,"P",{});var pm=a(Rn);Xd=n(pm,"Prepare model inputs for translation. For best performance, translate one sentence at a time."),pm.forEach(t),es.forEach(t),Yd=l(g),de=s(g,"DIV",{class:!0});var Io=a(de);b(Et.$$.fragment,Io),Hd=l(Io),qt=s(Io,"P",{});var ts=a(qt);Qd=n(ts,`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Gn=s(ts,"CODE",{});var mm=a(Gn);Kd=n(mm,"repo_path_or_name"),mm.forEach(t),el=n(ts,"."),ts.forEach(t),tl=l(Io),b(Oe.$$.fragment,Io),Io.forEach(t),ol=l(g),le=s(g,"DIV",{class:!0});var Lo=a(le);b(Mt.$$.fragment,Lo),nl=l(Lo),It=s(Lo,"P",{});var os=a(It);rl=n(os,`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 `),On=s(os,"CODE",{});var hm=a(On);sl=n(hm,"AutoTokenizer"),hm.forEach(t),al=n(os,"."),os.forEach(t),il=l(Lo),b(Xe.$$.fragment,Lo),Lo.forEach(t),dl=l(g),X=s(g,"DIV",{class:!0});var st=a(X);b(Lt.$$.fragment,st),ll=l(st),Xn=s(st,"P",{});var um=a(Xn);cl=n(um,"Save the full tokenizer state."),um.forEach(t),pl=l(st),Nt=s(st,"P",{});var ns=a(Nt);ml=n(ns,`This method make sure the full tokenizer can then be re-loaded using the
`),Yn=s(ns,"CODE",{});var fm=a(Yn);hl=n(fm,"~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),fm.forEach(t),ul=n(ns," class method.."),ns.forEach(t),fl=l(st),Wt=s(st,"P",{});var rs=a(Wt);_l=n(rs,`Warning,None This won\u2019t save modifications you may have applied to the tokenizer after the instantiation (for
instance, modifying `),Hn=s(rs,"CODE",{});var _m=a(Hn);gl=n(_m,"tokenizer.do_lower_case"),_m.forEach(t),kl=n(rs," after creation)."),rs.forEach(t),st.forEach(t),bl=l(g),ce=s(g,"DIV",{class:!0});var No=a(ce);b(Ut.$$.fragment,No),vl=l(No),Qn=s(No,"P",{});var gm=a(Qn);Tl=n(gm,"Save only the vocabulary of the tokenizer (vocabulary + added tokens)."),gm.forEach(t),yl=l(No),Dt=s(No,"P",{});var ss=a(Dt);wl=n(ss,`This method won\u2019t save the configuration and special token mappings of the tokenizer. Use
`),Kn=s(ss,"CODE",{});var km=a(Kn);zl=n(km,"_save_pretrained()"),km.forEach(t),xl=n(ss," to save the whole state of the tokenizer."),ss.forEach(t),No.forEach(t),$l=l(g),Ye=s(g,"DIV",{class:!0});var as=a(Ye);b(jt.$$.fragment,as),Pl=l(as),Jt=s(as,"P",{});var is=a(Jt);Bl=n(is,"Converts a string in a sequence of tokens, replacing unknown tokens with the "),er=s(is,"CODE",{});var bm=a(er);El=n(bm,"unk_token"),bm.forEach(t),ql=n(is,"."),is.forEach(t),as.forEach(t),Ml=l(g),He=s(g,"DIV",{class:!0});var ds=a(He);b(Ft.$$.fragment,ds),Il=l(ds),tr=s(ds,"P",{});var vm=a(tr);Ll=n(vm,"Truncates a sequence pair in-place following the strategy."),vm.forEach(t),ds.forEach(t),g.forEach(t),Wr=l(i),ye=s(i,"H2",{class:!0});var ls=a(ye);Qe=s(ls,"A",{id:!0,class:!0,href:!0});var Tm=a(Qe);or=s(Tm,"SPAN",{});var ym=a(or);b(St.$$.fragment,ym),ym.forEach(t),Tm.forEach(t),Nl=l(ls),nr=s(ls,"SPAN",{});var wm=a(nr);Wl=n(wm,"SpecialTokensMixin"),wm.forEach(t),ls.forEach(t),Ur=l(i),W=s(i,"DIV",{class:!0});var ue=a(W);b(Ct.$$.fragment,ue),Ul=l(ue),we=s(ue,"P",{});var Wo=a(we);Dl=n(Wo,"A mixin derived by "),go=s(Wo,"A",{href:!0});var zm=a(go);jl=n(zm,"PreTrainedTokenizer"),zm.forEach(t),Jl=n(Wo," and "),ko=s(Wo,"A",{href:!0});var xm=a(ko);Fl=n(xm,"PreTrainedTokenizerFast"),xm.forEach(t),Sl=n(Wo,` 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.`),Wo.forEach(t),Cl=l(ue),q=s(ue,"DIV",{class:!0});var N=a(q);b(At.$$.fragment,N),Al=l(N),rr=s(N,"P",{});var $m=a(rr);Zl=n($m,`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).`),$m.forEach(t),Vl=l(N),sr=s(N,"P",{});var Pm=a(sr);Rl=n(Pm,`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.`),Pm.forEach(t),Gl=l(N),Zt=s(N,"P",{});var cs=a(Zt);Ol=n(cs,"In order to do that, please use the "),bo=s(cs,"A",{href:!0});var Bm=a(bo);Xl=n(Bm,"resize_token_embeddings()"),Bm.forEach(t),Yl=n(cs," method."),cs.forEach(t),Hl=l(N),Vt=s(N,"P",{});var ps=a(Vt);Ql=n(ps,"Using "),ar=s(ps,"CODE",{});var Em=a(ar);Kl=n(Em,"add_special_tokens"),Em.forEach(t),ec=n(ps," will ensure your special tokens can be used in several ways:"),ps.forEach(t),tc=l(N),Rt=s(N,"UL",{});var ms=a(Rt);ir=s(ms,"LI",{});var qm=a(ir);oc=n(qm,"Special tokens are carefully handled by the tokenizer (they are never split)."),qm.forEach(t),nc=l(ms),Gt=s(ms,"LI",{});var hs=a(Gt);rc=n(hs,"You can easily refer to special tokens using tokenizer class attributes like "),dr=s(hs,"CODE",{});var Mm=a(dr);sc=n(Mm,"tokenizer.cls_token"),Mm.forEach(t),ac=n(hs,`. This
makes it easy to develop model-agnostic training and fine-tuning scripts.`),hs.forEach(t),ms.forEach(t),ic=l(N),A=s(N,"P",{});var fe=a(A);dc=n(fe,`When possible, special tokens are already registered for provided pretrained models (for instance
`),vo=s(fe,"A",{href:!0});var Im=a(vo);lc=n(Im,"BertTokenizer"),Im.forEach(t),cc=l(fe),lr=s(fe,"CODE",{});var Lm=a(lr);pc=n(Lm,"cls_token"),Lm.forEach(t),mc=n(fe," is already registered to be :obj"),cr=s(fe,"EM",{});var Nm=a(cr);hc=n(Nm,"\u2019[CLS]\u2019"),Nm.forEach(t),uc=n(fe,` and XLM\u2019s one is also registered to be
`),pr=s(fe,"CODE",{});var Wm=a(pr);fc=n(Wm,"'</s>'"),Wm.forEach(t),_c=n(fe,")."),fe.forEach(t),gc=l(N),b(Ke.$$.fragment,N),N.forEach(t),kc=l(ue),J=s(ue,"DIV",{class:!0});var _e=a(J);b(Ot.$$.fragment,_e),bc=l(_e),mr=s(_e,"P",{});var Um=a(mr);vc=n(Um,`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.`),Um.forEach(t),Tc=l(_e),hr=s(_e,"P",{});var Dm=a(hr);yc=n(Dm,`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.`),Dm.forEach(t),wc=l(_e),Xt=s(_e,"P",{});var us=a(Xt);zc=n(us,"In order to do that, please use the "),To=s(us,"A",{href:!0});var jm=a(To);xc=n(jm,"resize_token_embeddings()"),jm.forEach(t),$c=n(us," method."),us.forEach(t),Pc=l(_e),b(et.$$.fragment,_e),_e.forEach(t),Bc=l(ue),pe=s(ue,"DIV",{class:!0});var Uo=a(pe);b(Yt.$$.fragment,Uo),Ec=l(Uo),ze=s(Uo,"P",{});var Do=a(ze);qc=n(Do,"Make sure that all the special tokens attributes of the tokenizer ("),ur=s(Do,"CODE",{});var Jm=a(ur);Mc=n(Jm,"tokenizer.mask_token"),Jm.forEach(t),Ic=n(Do,`,
`),fr=s(Do,"CODE",{});var Fm=a(fr);Lc=n(Fm,"tokenizer.cls_token"),Fm.forEach(t),Nc=n(Do,", etc.) are in the vocabulary."),Do.forEach(t),Wc=l(Uo),_r=s(Uo,"P",{});var Sm=a(_r);Uc=n(Sm,"Add the missing ones to the vocabulary if needed."),Sm.forEach(t),Uo.forEach(t),ue.forEach(t),Dr=l(i),xe=s(i,"H2",{class:!0});var fs=a(xe);tt=s(fs,"A",{id:!0,class:!0,href:!0});var Cm=a(tt);gr=s(Cm,"SPAN",{});var Am=a(gr);b(Ht.$$.fragment,Am),Am.forEach(t),Cm.forEach(t),Dc=l(fs),kr=s(fs,"SPAN",{});var Zm=a(kr);jc=n(Zm,"Enums and namedtuples"),Zm.forEach(t),fs.forEach(t),jr=l(i),$e=s(i,"DIV",{class:!0});var _s=a($e);b(Qt.$$.fragment,_s),Jc=l(_s),Pe=s(_s,"P",{});var jo=a(Pe);Fc=n(jo,"Possible values for the "),br=s(jo,"CODE",{});var Vm=a(br);Sc=n(Vm,"truncation"),Vm.forEach(t),Cc=n(jo," argument in "),ot=s(jo,"A",{href:!0});var gs=a(ot);Ac=n(gs,"PreTrainedTokenizerBase."),vr=s(gs,"STRONG",{});var Rm=a(vr);Zc=n(Rm,"call"),Rm.forEach(t),Vc=n(gs,"()"),gs.forEach(t),Rc=n(jo,`. Useful for tab-completion in
an IDE.`),jo.forEach(t),_s.forEach(t),Jr=l(i),Be=s(i,"DIV",{class:!0});var ks=a(Be);b(Kt.$$.fragment,ks),Gc=l(ks),Tr=s(ks,"P",{});var Gm=a(Tr);Oc=n(Gm,"Character span in the original string."),Gm.forEach(t),ks.forEach(t),Fr=l(i),Ee=s(i,"DIV",{class:!0});var bs=a(Ee);b(eo.$$.fragment,bs),Xc=l(bs),yr=s(bs,"P",{});var Om=a(yr);Yc=n(Om,"Token span in an encoded string (list of tokens)."),Om.forEach(t),bs.forEach(t),this.h()},h(){m(p,"name","hf:doc:metadata"),m(p,"content",JSON.stringify(ch)),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(so,"href","/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),m(ao,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(io,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(lo,"href","/docs/transformers/v4.31.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(po,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(mo,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(ho,"href","/docs/transformers/v4.31.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(fo,"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(_o,"href","/docs/transformers/v4.31.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(go,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(ko,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(bo,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.resize_token_embeddings"),m(vo,"href","/docs/transformers/v4.31.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(To,"href","/docs/transformers/v4.31.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.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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,ro),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),e(I,lo),e(lo,qs),e(I,Ms),P(i,Ir,z),P(i,co,z),e(co,Is),P(i,Lr,z),P(i,ke,z),e(ke,Le),e(Le,Jo),v(at,Jo,null),e(ke,Ls),e(ke,Fo),e(Fo,Ns),P(i,Nr,z),P(i,u,z),v(it,u,null),e(u,Ws),e(u,be),e(be,Us),e(be,po),e(po,Ds),e(be,js),e(be,mo),e(mo,Js),e(be,Fs),e(u,Ss),e(u,So),e(So,Cs),e(u,As),e(u,Co),e(Co,Zs),e(u,Vs),e(u,L),e(L,K),e(K,Ao),e(Ao,Rs),e(K,Gs),e(K,Zo),e(Zo,Os),e(K,Xs),e(K,Vo),e(Vo,Ys),e(K,Hs),e(L,Qs),e(L,U),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(U,Yo),e(Yo,ia),e(U,da),e(L,la),e(L,V),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(V,en),e(en,_a),e(V,ga),e(L,ka),e(L,D),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,rn),e(rn,xa),e(D,$a),e(D,ho),e(ho,Pa),e(D,Ba),e(L,Ea),e(L,Ne),e(Ne,sn),e(sn,qa),e(Ne,Ma),e(Ne,an),e(an,Ia),e(Ne,La),e(L,Na),e(L,R),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(R,pn),e(pn,Sa),e(R,Ca),e(L,Aa),e(L,G),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(G,fn),e(fn,Ya),e(G,Ha),e(u,Qa),e(u,We),v(dt,We,null),e(We,Ka),e(We,_n),e(_n,ei),e(u,ti),e(u,Ue),v(lt,Ue,null),e(Ue,oi),e(Ue,gn),e(gn,ni),e(u,ri),e(u,De),v(ct,De,null),e(De,si),e(De,kn),e(kn,ai),e(u,ii),e(u,ee),v(pt,ee,null),e(ee,di),e(ee,bn),e(bn,li),e(ee,ci),v(je,ee,null),e(u,pi),e(u,te),v(mt,te,null),e(te,mi),e(te,vn),e(vn,hi),e(te,ui),e(te,Tn),e(Tn,fi),e(u,_i),e(u,Je),v(ht,Je,null),e(Je,gi),e(Je,yn),e(yn,ki),e(u,bi),e(u,Fe),v(ut,Fe,null),e(Fe,vi),e(Fe,ft),e(ft,Ti),e(ft,wn),e(wn,yi),e(ft,wi),e(u,zi),e(u,oe),v(_t,oe,null),e(oe,xi),e(oe,uo),e(uo,$i),e(uo,fo),e(fo,Pi),e(oe,Bi),e(oe,zn),e(zn,Ei),e(u,qi),e(u,ne),v(gt,ne,null),e(ne,Mi),e(ne,xn),e(xn,Ii),e(ne,Li),e(ne,kt),e(kt,Ni),e(kt,$n),e($n,Wi),e(kt,Ui),e(u,Di),e(u,re),v(bt,re,null),e(re,ji),e(re,Pn),e(Pn,Ji),e(re,Fi),e(re,vt),e(vt,Si),e(vt,Bn),e(Bn,Ci),e(vt,Ai),e(u,Zi),e(u,se),v(Tt,se,null),e(se,Vi),e(se,En),e(En,Ri),e(se,Gi),v(Se,se,null),e(u,Oi),e(u,O),v(yt,O,null),e(O,Xi),e(O,wt),e(wt,Yi),e(wt,_o),e(_o,Hi),e(wt,Qi),e(O,Ki),v(Ce,O,null),e(O,ed),v(Ae,O,null),e(u,td),e(u,Ze),v(zt,Ze,null),e(Ze,od),e(Ze,ve),e(ve,nd),e(ve,qn),e(qn,rd),e(ve,sd),e(ve,Mn),e(Mn,ad),e(ve,id),e(u,dd),e(u,ae),v(xt,ae,null),e(ae,ld),e(ae,In),e(In,cd),e(ae,pd),e(ae,ie),e(ie,Ln),e(Ln,md),e(ie,hd),e(ie,Nn),e(Nn,ud),e(ie,fd),e(ie,Wn),e(Wn,_d),e(ie,gd),e(u,kd),e(u,j),v($t,j,null),e(j,bd),e(j,Un),e(Un,vd),e(j,Td),e(j,Y),e(Y,yd),e(Y,Dn),e(Dn,wd),e(Y,zd),e(Y,jn),e(jn,xd),e(Y,$d),e(Y,Jn),e(Jn,Pd),e(Y,Bd),e(j,Ed),e(j,Te),e(Te,qd),e(Te,Fn),e(Fn,Md),e(Te,Id),e(Te,Sn),e(Sn,Ld),e(Te,Nd),e(j,Wd),v(Ve,j,null),e(u,Ud),e(u,Re),v(Pt,Re,null),e(Re,Dd),e(Re,C),e(C,jd),e(C,Cn),e(Cn,Jd),e(C,Fd),e(C,An),e(An,Sd),e(C,Cd),e(C,Zn),e(Zn,Ad),e(C,Zd),e(C,Vn),e(Vn,Vd),e(C,Rd),e(u,Gd),e(u,Ge),v(Bt,Ge,null),e(Ge,Od),e(Ge,Rn),e(Rn,Xd),e(u,Yd),e(u,de),v(Et,de,null),e(de,Hd),e(de,qt),e(qt,Qd),e(qt,Gn),e(Gn,Kd),e(qt,el),e(de,tl),v(Oe,de,null),e(u,ol),e(u,le),v(Mt,le,null),e(le,nl),e(le,It),e(It,rl),e(It,On),e(On,sl),e(It,al),e(le,il),v(Xe,le,null),e(u,dl),e(u,X),v(Lt,X,null),e(X,ll),e(X,Xn),e(Xn,cl),e(X,pl),e(X,Nt),e(Nt,ml),e(Nt,Yn),e(Yn,hl),e(Nt,ul),e(X,fl),e(X,Wt),e(Wt,_l),e(Wt,Hn),e(Hn,gl),e(Wt,kl),e(u,bl),e(u,ce),v(Ut,ce,null),e(ce,vl),e(ce,Qn),e(Qn,Tl),e(ce,yl),e(ce,Dt),e(Dt,wl),e(Dt,Kn),e(Kn,zl),e(Dt,xl),e(u,$l),e(u,Ye),v(jt,Ye,null),e(Ye,Pl),e(Ye,Jt),e(Jt,Bl),e(Jt,er),e(er,El),e(Jt,ql),e(u,Ml),e(u,He),v(Ft,He,null),e(He,Il),e(He,tr),e(tr,Ll),P(i,Wr,z),P(i,ye,z),e(ye,Qe),e(Qe,or),v(St,or,null),e(ye,Nl),e(ye,nr),e(nr,Wl),P(i,Ur,z),P(i,W,z),v(Ct,W,null),e(W,Ul),e(W,we),e(we,Dl),e(we,go),e(go,jl),e(we,Jl),e(we,ko),e(ko,Fl),e(we,Sl),e(W,Cl),e(W,q),v(At,q,null),e(q,Al),e(q,rr),e(rr,Zl),e(q,Vl),e(q,sr),e(sr,Rl),e(q,Gl),e(q,Zt),e(Zt,Ol),e(Zt,bo),e(bo,Xl),e(Zt,Yl),e(q,Hl),e(q,Vt),e(Vt,Ql),e(Vt,ar),e(ar,Kl),e(Vt,ec),e(q,tc),e(q,Rt),e(Rt,ir),e(ir,oc),e(Rt,nc),e(Rt,Gt),e(Gt,rc),e(Gt,dr),e(dr,sc),e(Gt,ac),e(q,ic),e(q,A),e(A,dc),e(A,vo),e(vo,lc),e(A,cc),e(A,lr),e(lr,pc),e(A,mc),e(A,cr),e(cr,hc),e(A,uc),e(A,pr),e(pr,fc),e(A,_c),e(q,gc),v(Ke,q,null),e(W,kc),e(W,J),v(Ot,J,null),e(J,bc),e(J,mr),e(mr,vc),e(J,Tc),e(J,hr),e(hr,yc),e(J,wc),e(J,Xt),e(Xt,zc),e(Xt,To),e(To,xc),e(Xt,$c),e(J,Pc),v(et,J,null),e(W,Bc),e(W,pe),v(Yt,pe,null),e(pe,Ec),e(pe,ze),e(ze,qc),e(ze,ur),e(ur,Mc),e(ze,Ic),e(ze,fr),e(fr,Lc),e(ze,Nc),e(pe,Wc),e(pe,_r),e(_r,Uc),P(i,Dr,z),P(i,xe,z),e(xe,tt),e(tt,gr),v(Ht,gr,null),e(xe,Dc),e(xe,kr),e(kr,jc),P(i,jr,z),P(i,$e,z),v(Qt,$e,null),e($e,Jc),e($e,Pe),e(Pe,Fc),e(Pe,br),e(br,Sc),e(Pe,Cc),e(Pe,ot),e(ot,Ac),e(ot,vr),e(vr,Zc),e(ot,Vc),e(Pe,Rc),P(i,Jr,z),P(i,Be,z),v(Kt,Be,null),e(Be,Gc),e(Be,Tr),e(Tr,Oc),P(i,Fr,z),P(i,Ee,z),v(eo,Ee,null),e(Ee,Xc),e(Ee,yr),e(yr,Yc),Sr=!0},p(i,[z]){const to={};z&2&&(to.$$scope={dirty:z,ctx:i}),je.$set(to);const wr={};z&2&&(wr.$$scope={dirty:z,ctx:i}),Se.$set(wr);const zr={};z&2&&(zr.$$scope={dirty:z,ctx:i}),Ce.$set(zr);const xr={};z&2&&(xr.$$scope={dirty:z,ctx:i}),Ae.$set(xr);const Z={};z&2&&(Z.$$scope={dirty:z,ctx:i}),Ve.$set(Z);const $r={};z&2&&($r.$$scope={dirty:z,ctx:i}),Oe.$set($r);const Pr={};z&2&&(Pr.$$scope={dirty:z,ctx:i}),Xe.$set(Pr);const Br={};z&2&&(Br.$$scope={dirty:z,ctx:i}),Ke.$set(Br);const Er={};z&2&&(Er.$$scope={dirty:z,ctx:i}),et.$set(Er)},i(i){Sr||(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(Ce.$$.fragment,i),T(Ae.$$.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(Mt.$$.fragment,i),T(Xe.$$.fragment,i),T(Lt.$$.fragment,i),T(Ut.$$.fragment,i),T(jt.$$.fragment,i),T(Ft.$$.fragment,i),T(St.$$.fragment,i),T(Ct.$$.fragment,i),T(At.$$.fragment,i),T(Ke.$$.fragment,i),T(Ot.$$.fragment,i),T(et.$$.fragment,i),T(Yt.$$.fragment,i),T(Ht.$$.fragment,i),T(Qt.$$.fragment,i),T(Kt.$$.fragment,i),T(eo.$$.fragment,i),Sr=!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(Ce.$$.fragment,i),y(Ae.$$.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(Mt.$$.fragment,i),y(Xe.$$.fragment,i),y(Lt.$$.fragment,i),y(Ut.$$.fragment,i),y(jt.$$.fragment,i),y(Ft.$$.fragment,i),y(St.$$.fragment,i),y(Ct.$$.fragment,i),y(At.$$.fragment,i),y(Ke.$$.fragment,i),y(Ot.$$.fragment,i),y(et.$$.fragment,i),y(Yt.$$.fragment,i),y(Ht.$$.fragment,i),y(Qt.$$.fragment,i),y(Kt.$$.fragment,i),y(eo.$$.fragment,i),Sr=!1},d(i){t(p),i&&t($),i&&t(f),w(c),i&&t(S),i&&t(I),i&&t(Ir),i&&t(co),i&&t(Lr),i&&t(ke),w(at),i&&t(Nr),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(Ce),w(Ae),w(zt),w(xt),w($t),w(Ve),w(Pt),w(Bt),w(Et),w(Oe),w(Mt),w(Xe),w(Lt),w(Ut),w(jt),w(Ft),i&&t(Wr),i&&t(ye),w(St),i&&t(Ur),i&&t(W),w(Ct),w(At),w(Ke),w(Ot),w(et),w(Yt),i&&t(Dr),i&&t(xe),w(Ht),i&&t(jr),i&&t($e),w(Qt),i&&t(Jr),i&&t(Be),w(Kt),i&&t(Fr),i&&t(Ee),w(eo)}}}const ch={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 ph(E){return Km(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class kh extends Xm{constructor(p){super();Ym(this,p,ph,lh,Hm,{})}}export{kh as default,ch as metadata};
