Buckets:
| import{s as Zs,o as Ss,n as ee}from"../chunks/scheduler.9991993c.js";import{S as Vs,i as Es,g as r,s as n,r as u,A as Rs,h as s,f as i,c as o,j as y,u as h,x as c,k as v,y as e,a as x,v as f,d as g,t as _,w as k}from"../chunks/index.ed60ef0f.js";import{T as Pn}from"../chunks/Tip.8eaeb7b5.js";import{D as w}from"../chunks/Docstring.8997e4b8.js";import{C as Kn}from"../chunks/CodeBlock.d4c22193.js";import{E as On}from"../chunks/ExampleCodeBlock.08669100.js";import{H as Qn,E as As}from"../chunks/index.d7a0d314.js";function Gs(B){let a,z="This method is deprecated, <code>__call__</code> should be used instead.";return{c(){a=r("p"),a.innerHTML=z},l(m){a=s(m,"P",{"data-svelte-h":!0}),c(a)!=="svelte-1phrc72"&&(a.innerHTML=z)},m(m,T){x(m,a,T)},p:ee,d(m){m&&i(a)}}}function Hs(B){let a,z="This method is deprecated, <code>__call__</code> should be used instead.";return{c(){a=r("p"),a.innerHTML=z},l(m){a=s(m,"P",{"data-svelte-h":!0}),c(a)!=="svelte-1phrc72"&&(a.innerHTML=z)},m(m,T){x(m,a,T)},p:ee,d(m){m&&i(a)}}}function Xs(B){let a,z="Passing <code>token=True</code> is required when you want to use a private model.";return{c(){a=r("p"),a.innerHTML=z},l(m){a=s(m,"P",{"data-svelte-h":!0}),c(a)!=="svelte-15auxyb"&&(a.innerHTML=z)},m(m,T){x(m,a,T)},p:ee,d(m){m&&i(a)}}}function Ys(B){let a,z="Examples:",m,T,$;return T=new Kn({props:{code:"JTIzJTIwV2UlMjBjYW4ndCUyMGluc3RhbnRpYXRlJTIwZGlyZWN0bHklMjB0aGUlMjBiYXNlJTIwY2xhc3MlMjAqUHJlVHJhaW5lZFRva2VuaXplckJhc2UqJTIwc28lMjBsZXQncyUyMHNob3clMjBvdXIlMjBleGFtcGxlcyUyMG9uJTIwYSUyMGRlcml2ZWQlMjBjbGFzcyUzQSUyMEJlcnRUb2tlbml6ZXIlMEElMjMlMjBEb3dubG9hZCUyMHZvY2FidWxhcnklMjBmcm9tJTIwaHVnZ2luZ2ZhY2UuY28lMjBhbmQlMjBjYWNoZS4lMEF0b2tlbml6ZXIlMjAlM0QlMjBCZXJ0VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUtYmVydCUyRmJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQSUwQSUyMyUyMERvd25sb2FkJTIwdm9jYWJ1bGFyeSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMCh1c2VyLXVwbG9hZGVkKSUyMGFuZCUyMGNhY2hlLiUwQXRva2VuaXplciUyMCUzRCUyMEJlcnRUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRibWR6JTJGYmVydC1iYXNlLWdlcm1hbi1jYXNlZCUyMiklMEElMEElMjMlMjBJZiUyMHZvY2FidWxhcnklMjBmaWxlcyUyMGFyZSUyMGluJTIwYSUyMGRpcmVjdG9yeSUyMChlLmcuJTIwdG9rZW5pemVyJTIwd2FzJTIwc2F2ZWQlMjB1c2luZyUyMCpzYXZlX3ByZXRyYWluZWQoJy4lMkZ0ZXN0JTJGc2F2ZWRfbW9kZWwlMkYnKSopJTBBdG9rZW5pemVyJTIwJTNEJTIwQmVydFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnRlc3QlMkZzYXZlZF9tb2RlbCUyRiUyMiklMEElMEElMjMlMjBJZiUyMHRoZSUyMHRva2VuaXplciUyMHVzZXMlMjBhJTIwc2luZ2xlJTIwdm9jYWJ1bGFyeSUyMGZpbGUlMkMlMjB5b3UlMjBjYW4lMjBwb2ludCUyMGRpcmVjdGx5JTIwdG8lMjB0aGlzJTIwZmlsZSUwQXRva2VuaXplciUyMCUzRCUyMEJlcnRUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMi4lMkZ0ZXN0JTJGc2F2ZWRfbW9kZWwlMkZteV92b2NhYi50eHQlMjIpJTBBJTBBJTIzJTIwWW91JTIwY2FuJTIwbGluayUyMHRva2VucyUyMHRvJTIwc3BlY2lhbCUyMHZvY2FidWxhcnklMjB3aGVuJTIwaW5zdGFudGlhdGluZyUwQXRva2VuaXplciUyMCUzRCUyMEJlcnRUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMjB1bmtfdG9rZW4lM0QlMjIlM0N1bmslM0UlMjIpJTBBJTIzJTIwWW91JTIwc2hvdWxkJTIwYmUlMjBzdXJlJTIwJyUzQ3VuayUzRSclMjBpcyUyMGluJTIwdGhlJTIwdm9jYWJ1bGFyeSUyMHdoZW4lMjBkb2luZyUyMHRoYXQuJTBBJTIzJTIwT3RoZXJ3aXNlJTIwdXNlJTIwdG9rZW5pemVyLmFkZF9zcGVjaWFsX3Rva2VucyglN0IndW5rX3Rva2VuJyUzQSUyMCclM0N1bmslM0UnJTdEKSUyMGluc3RlYWQpJTBBYXNzZXJ0JTIwdG9rZW5pemVyLnVua190b2tlbiUyMCUzRCUzRCUyMCUyMiUzQ3VuayUzRSUyMg==",highlighted:`<span class="hljs-comment"># We can't instantiate directly the base class *PreTrainedTokenizerBase* so let'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">"google-bert/bert-base-uncased"</span>) | |
| <span class="hljs-comment"># Download vocabulary from huggingface.co (user-uploaded) and cache.</span> | |
| tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">"dbmdz/bert-base-german-cased"</span>) | |
| <span class="hljs-comment"># If vocabulary files are in a directory (e.g. tokenizer was saved using *save_pretrained('./test/saved_model/')*)</span> | |
| tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">"./test/saved_model/"</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">"./test/saved_model/my_vocab.txt"</span>) | |
| <span class="hljs-comment"># You can link tokens to special vocabulary when instantiating</span> | |
| tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">"google-bert/bert-base-uncased"</span>, unk_token=<span class="hljs-string">"<unk>"</span>) | |
| <span class="hljs-comment"># You should be sure '<unk>' is in the vocabulary when doing that.</span> | |
| <span class="hljs-comment"># Otherwise use tokenizer.add_special_tokens({'unk_token': '<unk>'}) instead)</span> | |
| <span class="hljs-keyword">assert</span> tokenizer.unk_token == <span class="hljs-string">"<unk>"</span>`,wrap:!1}}),{c(){a=r("p"),a.textContent=z,m=n(),u(T.$$.fragment)},l(p){a=s(p,"P",{"data-svelte-h":!0}),c(a)!=="svelte-kvfsh7"&&(a.textContent=z),m=o(p),h(T.$$.fragment,p)},m(p,P){x(p,a,P),x(p,m,P),f(T,p,P),$=!0},p:ee,i(p){$||(g(T.$$.fragment,p),$=!0)},o(p){_(T.$$.fragment,p),$=!1},d(p){p&&(i(a),i(m)),k(T,p)}}}function Os(B){let a,z=`If the <code>encoded_inputs</code> 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 <code>return_tensors</code>. In the case of | |
| PyTorch tensors, you will lose the specific device of your tensors however.`;return{c(){a=r("p"),a.innerHTML=z},l(m){a=s(m,"P",{"data-svelte-h":!0}),c(a)!=="svelte-ppz3re"&&(a.innerHTML=z)},m(m,T){x(m,a,T)},p:ee,d(m){m&&i(a)}}}function Qs(B){let a,z="Examples:",m,T,$;return T=new Kn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUtYmVydCUyRmJlcnQtYmFzZS1jYXNlZCUyMiklMEElMEElMjMlMjBQdXNoJTIwdGhlJTIwdG9rZW5pemVyJTIwdG8lMjB5b3VyJTIwbmFtZXNwYWNlJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtYmVydCUyMi4lMEF0b2tlbml6ZXIucHVzaF90b19odWIoJTIybXktZmluZXR1bmVkLWJlcnQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMHRva2VuaXplciUyMHRvJTIwYW4lMjBvcmdhbml6YXRpb24lMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyLiUwQXRva2VuaXplci5wdXNoX3RvX2h1YiglMjJodWdnaW5nZmFjZSUyRm15LWZpbmV0dW5lZC1iZXJ0JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer | |
| tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"google-bert/bert-base-cased"</span>) | |
| <span class="hljs-comment"># Push the tokenizer to your namespace with the name "my-finetuned-bert".</span> | |
| tokenizer.push_to_hub(<span class="hljs-string">"my-finetuned-bert"</span>) | |
| <span class="hljs-comment"># Push the tokenizer to an organization with the name "my-finetuned-bert".</span> | |
| tokenizer.push_to_hub(<span class="hljs-string">"huggingface/my-finetuned-bert"</span>)`,wrap:!1}}),{c(){a=r("p"),a.textContent=z,m=n(),u(T.$$.fragment)},l(p){a=s(p,"P",{"data-svelte-h":!0}),c(a)!=="svelte-kvfsh7"&&(a.textContent=z),m=o(p),h(T.$$.fragment,p)},m(p,P){x(p,a,P),x(p,m,P),f(T,p,P),$=!0},p:ee,i(p){$||(g(T.$$.fragment,p),$=!0)},o(p){_(T.$$.fragment,p),$=!1},d(p){p&&(i(a),i(m)),k(T,p)}}}function Ks(B){let a,z="This API is experimental and may have some slight breaking changes in the next releases.";return{c(){a=r("p"),a.textContent=z},l(m){a=s(m,"P",{"data-svelte-h":!0}),c(a)!=="svelte-15rpg4"&&(a.textContent=z)},m(m,T){x(m,a,T)},p:ee,d(m){m&&i(a)}}}function ea(B){let a,z="Examples:",m,T,$;return T=new Kn({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMGFkZCUyMGElMjBuZXclMjBjbGFzc2lmaWNhdGlvbiUyMHRva2VuJTIwdG8lMjBHUFQtMiUwQXRva2VuaXplciUyMCUzRCUyMEdQVDJUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haS1jb21tdW5pdHklMkZncHQyJTIyKSUwQW1vZGVsJTIwJTNEJTIwR1BUMk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWktY29tbXVuaXR5JTJGZ3B0MiUyMiklMEElMEFzcGVjaWFsX3Rva2Vuc19kaWN0JTIwJTNEJTIwJTdCJTIyY2xzX3Rva2VuJTIyJTNBJTIwJTIyJTNDQ0xTJTNFJTIyJTdEJTBBJTBBbnVtX2FkZGVkX3Rva3MlMjAlM0QlMjB0b2tlbml6ZXIuYWRkX3NwZWNpYWxfdG9rZW5zKHNwZWNpYWxfdG9rZW5zX2RpY3QpJTBBcHJpbnQoJTIyV2UlMjBoYXZlJTIwYWRkZWQlMjIlMkMlMjBudW1fYWRkZWRfdG9rcyUyQyUyMCUyMnRva2VucyUyMiklMEElMjMlMjBOb3RpY2UlM0ElMjByZXNpemVfdG9rZW5fZW1iZWRkaW5ncyUyMGV4cGVjdCUyMHRvJTIwcmVjZWl2ZSUyMHRoZSUyMGZ1bGwlMjBzaXplJTIwb2YlMjB0aGUlMjBuZXclMjB2b2NhYnVsYXJ5JTJDJTIwaS5lLiUyQyUyMHRoZSUyMGxlbmd0aCUyMG9mJTIwdGhlJTIwdG9rZW5pemVyLiUwQW1vZGVsLnJlc2l6ZV90b2tlbl9lbWJlZGRpbmdzKGxlbih0b2tlbml6ZXIpKSUwQSUwQWFzc2VydCUyMHRva2VuaXplci5jbHNfdG9rZW4lMjAlM0QlM0QlMjAlMjIlM0NDTFMlM0UlMjI=",highlighted:`<span class="hljs-comment"># Let's see how to add a new classification token to GPT-2</span> | |
| tokenizer = GPT2Tokenizer.from_pretrained(<span class="hljs-string">"openai-community/gpt2"</span>) | |
| model = GPT2Model.from_pretrained(<span class="hljs-string">"openai-community/gpt2"</span>) | |
| special_tokens_dict = {<span class="hljs-string">"cls_token"</span>: <span class="hljs-string">"<CLS>"</span>} | |
| num_added_toks = tokenizer.add_special_tokens(special_tokens_dict) | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">"We have added"</span>, num_added_toks, <span class="hljs-string">"tokens"</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">"<CLS>"</span>`,wrap:!1}}),{c(){a=r("p"),a.textContent=z,m=n(),u(T.$$.fragment)},l(p){a=s(p,"P",{"data-svelte-h":!0}),c(a)!=="svelte-kvfsh7"&&(a.textContent=z),m=o(p),h(T.$$.fragment,p)},m(p,P){x(p,a,P),x(p,m,P),f(T,p,P),$=!0},p:ee,i(p){$||(g(T.$$.fragment,p),$=!0)},o(p){_(T.$$.fragment,p),$=!1},d(p){p&&(i(a),i(m)),k(T,p)}}}function ta(B){let a,z="Examples:",m,T,$;return T=new Kn({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMGluY3JlYXNlJTIwdGhlJTIwdm9jYWJ1bGFyeSUyMG9mJTIwQmVydCUyMG1vZGVsJTIwYW5kJTIwdG9rZW5pemVyJTBBdG9rZW5pemVyJTIwJTNEJTIwQmVydFRva2VuaXplckZhc3QuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBbnVtX2FkZGVkX3Rva3MlMjAlM0QlMjB0b2tlbml6ZXIuYWRkX3Rva2VucyglNUIlMjJuZXdfdG9rMSUyMiUyQyUyMCUyMm15X25ldy10b2syJTIyJTVEKSUwQXByaW50KCUyMldlJTIwaGF2ZSUyMGFkZGVkJTIyJTJDJTIwbnVtX2FkZGVkX3Rva3MlMkMlMjAlMjJ0b2tlbnMlMjIpJTBBJTIzJTIwTm90aWNlJTNBJTIwcmVzaXplX3Rva2VuX2VtYmVkZGluZ3MlMjBleHBlY3QlMjB0byUyMHJlY2VpdmUlMjB0aGUlMjBmdWxsJTIwc2l6ZSUyMG9mJTIwdGhlJTIwbmV3JTIwdm9jYWJ1bGFyeSUyQyUyMGkuZS4lMkMlMjB0aGUlMjBsZW5ndGglMjBvZiUyMHRoZSUyMHRva2VuaXplci4lMEFtb2RlbC5yZXNpemVfdG9rZW5fZW1iZWRkaW5ncyhsZW4odG9rZW5pemVyKSk=",highlighted:`<span class="hljs-comment"># Let's see how to increase the vocabulary of Bert model and tokenizer</span> | |
| tokenizer = BertTokenizerFast.from_pretrained(<span class="hljs-string">"google-bert/bert-base-uncased"</span>) | |
| model = BertModel.from_pretrained(<span class="hljs-string">"google-bert/bert-base-uncased"</span>) | |
| num_added_toks = tokenizer.add_tokens([<span class="hljs-string">"new_tok1"</span>, <span class="hljs-string">"my_new-tok2"</span>]) | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">"We have added"</span>, num_added_toks, <span class="hljs-string">"tokens"</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))`,wrap:!1}}),{c(){a=r("p"),a.textContent=z,m=n(),u(T.$$.fragment)},l(p){a=s(p,"P",{"data-svelte-h":!0}),c(a)!=="svelte-kvfsh7"&&(a.textContent=z),m=o(p),h(T.$$.fragment,p)},m(p,P){x(p,a,P),x(p,m,P),f(T,p,P),$=!0},p:ee,i(p){$||(g(T.$$.fragment,p),$=!0)},o(p){_(T.$$.fragment,p),$=!1},d(p){p&&(i(a),i(m)),k(T,p)}}}function na(B){let a,z,m,T,$,p,P,Jr=`并保留格式:此页面列出了tokenizers使用的所有实用函数,主要是类 | |
| <code>~tokenization_utils_base.PreTrained TokenizerBase</code> 实现了常用方法之间的 | |
| <code>PreTrained Tokenizer</code> 和 <code>PreTrained TokenizerFast</code> 以及混合类 | |
| <code>~tokenization_utils_base.SpecialTokens Mixin</code>。`,Bn,$e,Dr="其中大多数只有在您研究库中tokenizers的代码时才有用。",Mn,Pe,qn,d,Be,eo,_t,Zr='Base class for <a href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> and <a href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>.',to,kt,Sr="Handles shared (mostly boiler plate) methods for those two classes.",no,bt,Vr="Class attributes (overridden by derived classes)",oo,Tt,Er=`<li><strong>vocab_files_names</strong> (<code>Dict[str, str]</code>) — A dictionary with, as keys, the <code>__init__</code> keyword name of each | |
| vocabulary file required by the model, and as associated values, the filename for saving the associated file | |
| (string).</li> <li><strong>pretrained_vocab_files_map</strong> (<code>Dict[str, Dict[str, str]]</code>) — A dictionary of dictionaries, with the | |
| high-level keys being the <code>__init__</code> keyword name of each vocabulary file required by the model, the | |
| low-level being the <code>short-cut-names</code> of the pretrained models with, as associated values, the <code>url</code> to the | |
| associated pretrained vocabulary file.</li> <li><strong>model_input_names</strong> (<code>List[str]</code>) — A list of inputs expected in the forward pass of the model.</li> <li><strong>padding_side</strong> (<code>str</code>) — The default value for the side on which the model should have padding applied. | |
| Should be <code>'right'</code> or <code>'left'</code>.</li> <li><strong>truncation_side</strong> (<code>str</code>) — The default value for the side on which the model should have truncation | |
| applied. Should be <code>'right'</code> or <code>'left'</code>.</li>`,ro,te,Me,so,yt,Rr=`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of | |
| sequences.`,ao,ne,qe,io,vt,Ar=`Converts a list of dictionaries with <code>"role"</code> and <code>"content"</code> keys to a list of token | |
| ids. This method is intended for use with chat models, and will read the tokenizer’s chat_template attribute to | |
| determine the format and control tokens to use when converting.`,lo,oe,Le,co,xt,Gr=`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.`,po,re,Ie,mo,wt,Hr="Convert a list of lists of token ids into a list of strings by calling decode.",uo,j,Ce,ho,zt,Xr="Tokenize and prepare for the model a list of sequences or a list of pairs of sequences.",fo,se,go,U,We,_o,$t,Yr=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and | |
| adding special tokens.`,ko,Pt,Or="This implementation does not add special tokens and this method should be overridden in a subclass.",bo,ae,Ne,To,Bt,Qr="Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms.",yo,ie,je,vo,Mt,Kr=`Converts a sequence of tokens in a single string. The most simple way to do it is <code>" ".join(tokens)</code> but we | |
| often want to remove sub-word tokenization artifacts at the same time.`,xo,F,Ue,wo,qt,es=`Create the token type IDs corresponding to the sequences passed. <a href="../glossary#token-type-ids">What are token type | |
| IDs?</a>`,zo,Lt,ts="Should be overridden in a subclass if the model has a special way of building those.",$o,J,Fe,Po,It,ns=`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special | |
| tokens and clean up tokenization spaces.`,Bo,Ct,os="Similar to doing <code>self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))</code>.",Mo,D,Je,qo,Wt,rs="Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary.",Lo,Nt,ss="Same as doing <code>self.convert_tokens_to_ids(self.tokenize(text))</code>.",Io,Z,De,Co,jt,as="Tokenize and prepare for the model a sequence or a pair of sequences.",Wo,de,No,W,Ze,jo,Ut,is=`Instantiate a <a href="/docs/transformers/pr_37396/zh/internal/tokenization_utils#transformers.PreTrainedTokenizerBase">PreTrainedTokenizerBase</a> (or a derived class) from a predefined | |
| tokenizer.`,Uo,le,Fo,ce,Jo,pe,Se,Do,Ft,ds=`Retrieve the chat template string used for tokenizing chat messages. This template is used | |
| internally by the <code>apply_chat_template</code> method and can also be used externally to retrieve the model’s chat | |
| template for better generation tracking.`,Zo,me,Ve,So,Jt,ls=`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding | |
| special tokens using the tokenizer <code>prepare_for_model</code> or <code>encode_plus</code> methods.`,Vo,S,Ee,Eo,Dt,cs="Returns the vocabulary as a dictionary of token to index.",Ro,Zt,ps=`<code>tokenizer.get_vocab()[token]</code> is equivalent to <code>tokenizer.convert_tokens_to_ids(token)</code> when <code>token</code> is in the | |
| vocab.`,Ao,I,Re,Go,St,ms=`Pad a single encoded input or a batch of encoded inputs up to predefined length or to the max sequence length | |
| in the batch.`,Ho,Vt,us=`Padding side (left/right) padding token ids are defined at the tokenizer level (with <code>self.padding_side</code>, | |
| <code>self.pad_token_id</code> and <code>self.pad_token_type_id</code>).`,Xo,Et,hs=`Please note that with a fast tokenizer, using the <code>__call__</code> method is faster than using a method to encode the | |
| text followed by a call to the <code>pad</code> method to get a padded encoding.`,Yo,ue,Oo,he,Ae,Qo,Rt,fs=`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 <em>pair_ids</em> | |
| different than <code>None</code> and <em>truncation_strategy = longest_first</em> or <code>True</code>, it is not possible to return | |
| overflowing tokens. Such a combination of arguments will raise an error.`,Ko,fe,Ge,er,At,gs="Prepare model inputs for translation. For best performance, translate one sentence at a time.",tr,V,He,nr,Gt,_s="Upload the tokenizer files to the 🤗 Model Hub.",or,ge,rr,E,Xe,sr,Ht,ks=`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 <code>AutoTokenizer</code>.`,ar,_e,ir,ke,Ye,dr,Xt,bs=`Writes chat templates out to the save directory if we’re using the new format, and removes them from | |
| the tokenizer config if present. If we’re using the legacy format, it doesn’t write any files, and instead | |
| writes the templates to the tokenizer config in the correct format.`,lr,N,Oe,cr,Yt,Ts="Save the full tokenizer state.",pr,Ot,ys=`This method make sure the full tokenizer can then be re-loaded using the | |
| <code>~tokenization_utils_base.PreTrainedTokenizer.from_pretrained</code> class method..`,mr,Qt,vs=`Warning,None This won’t save modifications you may have applied to the tokenizer after the instantiation (for | |
| instance, modifying <code>tokenizer.do_lower_case</code> after creation).`,ur,R,Qe,hr,Kt,xs="Save only the vocabulary of the tokenizer (vocabulary + added tokens).",fr,en,ws=`This method won’t save the configuration and special token mappings of the tokenizer. Use | |
| <code>_save_pretrained()</code> to save the whole state of the tokenizer.`,gr,be,Ke,_r,tn,zs="Converts a string into a sequence of tokens, replacing unknown tokens with the <code>unk_token</code>.",kr,Te,et,br,nn,$s="Truncates a sequence pair in-place following the strategy.",Ln,tt,In,L,nt,Tr,on,Ps=`A mixin derived by <a href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> and <a href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> 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.`,yr,M,ot,vr,rn,Bs=`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).`,xr,sn,Ms=`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.`,wr,an,qs='In order to do that, please use the <a href="/docs/transformers/pr_37396/zh/main_classes/model#transformers.PreTrainedModel.resize_token_embeddings">resize_token_embeddings()</a> method.',zr,dn,Ls="Using <code>add_special_tokens</code> will ensure your special tokens can be used in several ways:",$r,ln,Is=`<li>Special tokens can be skipped when decoding using <code>skip_special_tokens = True</code>.</li> <li>Special tokens are carefully handled by the tokenizer (they are never split), similar to <code>AddedTokens</code>.</li> <li>You can easily refer to special tokens using tokenizer class attributes like <code>tokenizer.cls_token</code>. This | |
| makes it easy to develop model-agnostic training and fine-tuning scripts.</li>`,Pr,cn,Cs=`When possible, special tokens are already registered for provided pretrained models (for instance | |
| <code>BertTokenizer</code> <code>cls_token</code> is already registered to be :obj<em>’[CLS]’</em> and XLM’s one is also registered to be | |
| <code>'</s>'</code>).`,Br,ye,Mr,C,rt,qr,pn,Ws=`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 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.`,Lr,mn,Ns=`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.`,Ir,un,js='In order to do that, please use the <a href="/docs/transformers/pr_37396/zh/main_classes/model#transformers.PreTrainedModel.resize_token_embeddings">resize_token_embeddings()</a> method.',Cr,ve,Wr,xe,st,Nr,hn,Us=`The <code>sanitize_special_tokens</code> is now deprecated kept for backward compatibility and will be removed in | |
| transformers v5.`,Cn,at,Wn,X,it,jr,fn,Fs=`Possible values for the <code>truncation</code> argument in <a href="/docs/transformers/pr_37396/zh/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizerBase.<strong>call</strong>()</a>. Useful for tab-completion in | |
| an IDE.`,Nn,Y,dt,Ur,gn,Js="Character span in the original string.",jn,O,lt,Fr,_n,Ds="Token span in an encoded string (list of tokens).",Un,ct,Fn,$n,Jn;return $=new Qn({props:{title:"Tokenizers的工具",local:"tokenizers的工具",headingTag:"h1"}}),Pe=new Qn({props:{title:"PreTrainedTokenizerBase",local:"transformers.PreTrainedTokenizerBase",headingTag:"h2"}}),Be=new w({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>) — | |
| The maximum length (in number of tokens) for the inputs to the transformer model. When the tokenizer is | |
| loaded with <a href="/docs/transformers/pr_37396/zh/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>) — | |
| The side on which the model should have padding applied. Should be selected between [‘right’, ‘left’]. | |
| 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>) — | |
| The side on which the model should have truncation applied. Should be selected between [‘right’, ‘left’]. | |
| Default value is picked from the class attribute of the same name.`,name:"truncation_side"},{anchor:"transformers.PreTrainedTokenizerBase.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) — | |
| A Jinja template string that will be used to format lists of chat messages. See | |
| <a href="https://huggingface.co/docs/transformers/chat_templating" rel="nofollow">https://huggingface.co/docs/transformers/chat_templating</a> for a full description.`,name:"chat_template"},{anchor:"transformers.PreTrainedTokenizerBase.model_input_names",description:`<strong>model_input_names</strong> (<code>List[string]</code>, <em>optional</em>) — | |
| The list of inputs accepted by the forward pass of the model (like <code>"token_type_ids"</code> or | |
| <code>"attention_mask"</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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| A tuple or a list of additional special tokens. Add them here to ensure they are skipped when decoding with | |
| <code>skip_special_tokens</code> is set to True. If they are not part of the vocabulary, they will be added at the end | |
| of the vocabulary.`,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>) — | |
| Whether or not the model should cleanup the spaces that were added when splitting the input text during the | |
| tokenization process.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerBase.split_special_tokens",description:`<strong>split_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not the special tokens should be split during the tokenization process. Passing will affect the | |
| internal state of the tokenizer. The default behavior is to not split special tokens. This means that if | |
| <code><s></code> is the <code>bos_token</code>, then <code>tokenizer.tokenize("<s>") = ['<s></code>]. Otherwise, if | |
| <code>split_special_tokens=True</code>, then <code>tokenizer.tokenize("<s>")</code> will be give <code>['<','s', '>']</code>.`,name:"split_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L1386"}}),Me=new w({props:{name:"__call__",anchor:"transformers.PreTrainedTokenizerBase.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = 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]], NoneType] = 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, NoneType] = 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:"padding_side",val:": typing.Optional[str] = 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| Whether or not to add special tokens when encoding the sequences. This will use the underlying | |
| <code>PretrainedTokenizerBase.build_inputs_with_special_tokens</code> function, which defines which tokens are | |
| automatically added to the input ids. This is useful if you want to add <code>bos</code> or <code>eos</code> tokens | |
| automatically.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizerBase.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_37396/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls padding. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest'</code>: Pad to the longest sequence in the batch (or no padding if only a single | |
| sequence if provided).</li> | |
| <li><code>'max_length'</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>'do_not_pad'</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/pr_37396/zh/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls truncation. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest_first'</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>'only_first'</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>'only_second'</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>'do_not_truncate'</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>) — | |
| 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) — | |
| 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>) — | |
| 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>) — | |
| 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>>= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.__call__.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) — | |
| The side on which the model should have padding applied. Should be selected between [‘right’, ‘left’]. | |
| Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizerBase.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_37396/zh/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) — | |
| If set, will return tensors instead of list of python integers. Acceptable values are:</p> | |
| <ul> | |
| <li><code>'tf'</code>: Return TensorFlow <code>tf.constant</code> objects.</li> | |
| <li><code>'pt'</code>: Return PyTorch <code>torch.Tensor</code> objects.</li> | |
| <li><code>'np'</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>) — | |
| Whether to return token type IDs. If left to the default, will return the token type IDs according to | |
| the specific tokenizer’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>) — | |
| Whether to return the attention mask. If left to the default, will return the attention mask according | |
| to the specific tokenizer’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>) — | |
| 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>) — | |
| 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>) — | |
| 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/pr_37396/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using | |
| Python’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>) — | |
| 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>) — | |
| Whether or not to print more information and warnings.`,name:"verbose"},{anchor:"transformers.PreTrainedTokenizerBase.__call__.*kwargs",description:"*<strong>*kwargs</strong> — passed to the <code>self.tokenize()</code> method",name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L2882",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a> with the following fields:</p> | |
| <ul> | |
| <li> | |
| <p><strong>input_ids</strong> — 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> — List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or | |
| if <em>“token_type_ids”</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> — List of indices specifying which tokens should be attended to by the model (when | |
| <code>return_attention_mask=True</code> or if <em>“attention_mask”</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> — 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> — 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> — 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> — The length of the inputs (when <code>return_length=True</code>)</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a></p> | |
| `}}),qe=new w({props:{name:"apply_chat_template",anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template",parameters:[{name:"conversation",val:": typing.Union[typing.List[typing.Dict[str, str]], typing.List[typing.List[typing.Dict[str, str]]]]"},{name:"tools",val:": typing.Optional[typing.List[typing.Union[typing.Dict, typing.Callable]]] = None"},{name:"documents",val:": typing.Optional[typing.List[typing.Dict[str, str]]] = None"},{name:"chat_template",val:": typing.Optional[str] = None"},{name:"add_generation_prompt",val:": bool = False"},{name:"continue_final_message",val:": bool = False"},{name:"tokenize",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": bool = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_dict",val:": bool = False"},{name:"return_assistant_tokens_mask",val:": bool = False"},{name:"tokenizer_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.conversation",description:`<strong>conversation</strong> (Union[List[Dict[str, str]], List[List[Dict[str, str]]]]) — A list of dicts | |
| with “role” and “content” keys, representing the chat history so far.`,name:"conversation"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.tools",description:`<strong>tools</strong> (<code>List[Dict]</code>, <em>optional</em>) — | |
| A list of tools (callable functions) that will be accessible to the model. If the template does not | |
| support function calling, this argument will have no effect. Each tool should be passed as a JSON Schema, | |
| giving the name, description and argument types for the tool. See our | |
| <a href="https://huggingface.co/docs/transformers/main/en/chat_templating#automated-function-conversion-for-tool-use" rel="nofollow">chat templating guide</a> | |
| for more information.`,name:"tools"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.documents",description:`<strong>documents</strong> (<code>List[Dict[str, str]]</code>, <em>optional</em>) — | |
| A list of dicts representing documents that will be accessible to the model if it is performing RAG | |
| (retrieval-augmented generation). If the template does not support RAG, this argument will have no | |
| effect. We recommend that each document should be a dict containing “title” and “text” keys. Please | |
| see the RAG section of the <a href="https://huggingface.co/docs/transformers/main/en/chat_templating#arguments-for-RAG" rel="nofollow">chat templating guide</a> | |
| for examples of passing documents with chat templates.`,name:"documents"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) — | |
| A Jinja template to use for this conversion. It is usually not necessary to pass anything to this | |
| argument, as the model’s template will be used by default.`,name:"chat_template"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.add_generation_prompt",description:`<strong>add_generation_prompt</strong> (bool, <em>optional</em>) — | |
| If this is set, a prompt with the token(s) that indicate | |
| the start of an assistant message will be appended to the formatted output. This is useful when you want to generate a response from the model. | |
| Note that this argument will be passed to the chat template, and so it must be supported in the | |
| template for this argument to have any effect.`,name:"add_generation_prompt"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.continue_final_message",description:`<strong>continue_final_message</strong> (bool, <em>optional</em>) — | |
| If this is set, the chat will be formatted so that the final | |
| message in the chat is open-ended, without any EOS tokens. The model will continue this message | |
| rather than starting a new one. This allows you to “prefill” part of | |
| the model’s response for it. Cannot be used at the same time as <code>add_generation_prompt</code>.`,name:"continue_final_message"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.tokenize",description:`<strong>tokenize</strong> (<code>bool</code>, defaults to <code>True</code>) — | |
| Whether to tokenize the output. If <code>False</code>, the output will be a string.`,name:"tokenize"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_37396/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Select a strategy to pad the returned sequences (according to the model’s padding side and padding | |
| index) among:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest'</code>: Pad to the longest sequence in the batch (or no padding if only a single | |
| sequence if provided).</li> | |
| <li><code>'max_length'</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>'do_not_pad'</code> (default): No padding (i.e., can output a batch with sequences of different | |
| lengths).</li> | |
| </ul>`,name:"padding"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.truncation",description:`<strong>truncation</strong> (<code>bool</code>, defaults to <code>False</code>) — | |
| Whether to truncate sequences at the maximum length. Has no effect if tokenize is <code>False</code>.`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) — | |
| Maximum length (in tokens) to use for padding or truncation. Has no effect if tokenize is <code>False</code>. If | |
| not specified, the tokenizer’s <code>max_length</code> attribute will be used as a default.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_37396/zh/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) — | |
| If set, will return tensors of a particular framework. Has no effect if tokenize is <code>False</code>. Acceptable | |
| values are:</p> | |
| <ul> | |
| <li><code>'tf'</code>: Return TensorFlow <code>tf.Tensor</code> objects.</li> | |
| <li><code>'pt'</code>: Return PyTorch <code>torch.Tensor</code> objects.</li> | |
| <li><code>'np'</code>: Return NumPy <code>np.ndarray</code> objects.</li> | |
| <li><code>'jax'</code>: Return JAX <code>jnp.ndarray</code> objects.</li> | |
| </ul>`,name:"return_tensors"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>False</code>) — | |
| Whether to return a dictionary with named outputs. Has no effect if tokenize is <code>False</code>.`,name:"return_dict"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.tokenizer_kwargs",description:"<strong>tokenizer_kwargs</strong> (<code>Dict[str -- Any]</code>, <em>optional</em>): Additional kwargs to pass to the tokenizer.",name:"tokenizer_kwargs"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.return_assistant_tokens_mask",description:`<strong>return_assistant_tokens_mask</strong> (<code>bool</code>, defaults to <code>False</code>) — | |
| Whether to return a mask of the assistant generated tokens. For tokens generated by the assistant, | |
| the mask will contain 1. For user and system tokens, the mask will contain 0. | |
| This functionality is only available for chat templates that support it via the <code>{% generation %}</code> keyword.`,name:"return_assistant_tokens_mask"},{anchor:"transformers.PreTrainedTokenizerBase.apply_chat_template.*kwargs",description:"*<strong>*kwargs</strong> — Additional kwargs to pass to the template renderer. Will be accessible by the chat template.",name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L1530",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A list of token ids representing the tokenized chat so far, including control tokens. This | |
| output is ready to pass to the model, either directly or via methods like <code>generate()</code>. If <code>return_dict</code> is | |
| set, will return a dict of tokenizer outputs instead.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Union[List[int], Dict]</code></p> | |
| `}}),Le=new w({props:{name:"as_target_tokenizer",anchor:"transformers.PreTrainedTokenizerBase.as_target_tokenizer",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L4046"}}),Ie=new w({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:": typing.Optional[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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3878",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The list of decoded sentences.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[str]</code></p> | |
| `}}),Ce=new w({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, NoneType] = 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:"padding_side",val:": typing.Optional[str] = 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:"split_special_tokens",val:": bool = False"},{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>) — | |
| 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>) — | |
| Whether or not to add special tokens when encoding the sequences. This will use the underlying | |
| <code>PretrainedTokenizerBase.build_inputs_with_special_tokens</code> function, which defines which tokens are | |
| automatically added to the input ids. This is useful if you want to add <code>bos</code> or <code>eos</code> tokens | |
| automatically.`,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/pr_37396/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls padding. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest'</code>: Pad to the longest sequence in the batch (or no padding if only a single | |
| sequence if provided).</li> | |
| <li><code>'max_length'</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>'do_not_pad'</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/pr_37396/zh/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls truncation. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest_first'</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>'only_first'</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>'only_second'</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>'do_not_truncate'</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>) — | |
| 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) — | |
| 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>) — | |
| 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>) — | |
| 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>>= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.batch_encode_plus.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) — | |
| The side on which the model should have padding applied. Should be selected between [‘right’, ‘left’]. | |
| Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizerBase.batch_encode_plus.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_37396/zh/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) — | |
| If set, will return tensors instead of list of python integers. Acceptable values are:</p> | |
| <ul> | |
| <li><code>'tf'</code>: Return TensorFlow <code>tf.constant</code> objects.</li> | |
| <li><code>'pt'</code>: Return PyTorch <code>torch.Tensor</code> objects.</li> | |
| <li><code>'np'</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>) — | |
| Whether to return token type IDs. If left to the default, will return the token type IDs according to | |
| the specific tokenizer’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>) — | |
| Whether to return the attention mask. If left to the default, will return the attention mask according | |
| to the specific tokenizer’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>) — | |
| 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>) — | |
| 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>) — | |
| 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/pr_37396/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using | |
| Python’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>) — | |
| 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>) — | |
| Whether or not to print more information and warnings.`,name:"verbose"},{anchor:"transformers.PreTrainedTokenizerBase.batch_encode_plus.*kwargs",description:"*<strong>*kwargs</strong> — passed to the <code>self.tokenize()</code> method",name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3193",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a> with the following fields:</p> | |
| <ul> | |
| <li> | |
| <p><strong>input_ids</strong> — 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> — List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or | |
| if <em>“token_type_ids”</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> — List of indices specifying which tokens should be attended to by the model (when | |
| <code>return_attention_mask=True</code> or if <em>“attention_mask”</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> — 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> — 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> — 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> — The length of the inputs (when <code>return_length=True</code>)</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a></p> | |
| `}}),se=new Pn({props:{warning:!0,$$slots:{default:[Gs]},$$scope:{ctx:B}}}),We=new w({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>) — 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>) — The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3501",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The model input with special tokens.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[int]</code></p> | |
| `}}),Ne=new w({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>) — The text to clean up.",name:"out_string"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3989",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The cleaned-up string.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>str</code></p> | |
| `}}),je=new w({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>) — The token to join in a string.",name:"tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3865",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The joined tokens.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>str</code></p> | |
| `}}),Ue=new w({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>) — 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>) — The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3481",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The token type ids.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[int]</code></p> | |
| `}}),Fe=new w({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:": typing.Optional[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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3912",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The decoded sentence.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>str</code></p> | |
| `}}),Je=new w({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, NoneType] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"padding_side",val:": typing.Optional[str] = None"},{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>) — | |
| 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>) — | |
| 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>) — | |
| Whether or not to add special tokens when encoding the sequences. This will use the underlying | |
| <code>PretrainedTokenizerBase.build_inputs_with_special_tokens</code> function, which defines which tokens are | |
| automatically added to the input ids. This is useful if you want to add <code>bos</code> or <code>eos</code> tokens | |
| automatically.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizerBase.encode.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_37396/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls padding. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest'</code>: Pad to the longest sequence in the batch (or no padding if only a single | |
| sequence if provided).</li> | |
| <li><code>'max_length'</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>'do_not_pad'</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/pr_37396/zh/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls truncation. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest_first'</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>'only_first'</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>'only_second'</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>'do_not_truncate'</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>) — | |
| 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) — | |
| 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>) — | |
| 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>) — | |
| 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>>= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.encode.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) — | |
| The side on which the model should have padding applied. Should be selected between [‘right’, ‘left’]. | |
| Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizerBase.encode.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_37396/zh/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) — | |
| If set, will return tensors instead of list of python integers. Acceptable values are:</p> | |
| <ul> | |
| <li><code>'tf'</code>: Return TensorFlow <code>tf.constant</code> objects.</li> | |
| <li><code>'pt'</code>: Return PyTorch <code>torch.Tensor</code> objects.</li> | |
| <li><code>'np'</code>: Return Numpy <code>np.ndarray</code> objects.</li> | |
| </ul>`,name:"return_tensors"},{anchor:"transformers.PreTrainedTokenizerBase.encode.*kwargs",description:"*<strong>*kwargs</strong> — Passed along to the <code>.tokenize()</code> method.",name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L2688",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The tokenized ids of the text.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[int]</code>, <code>torch.Tensor</code>, <code>tf.Tensor</code> or <code>np.ndarray</code></p> | |
| `}}),De=new w({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, NoneType] = 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:"padding_side",val:": typing.Optional[str] = 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 (for non-fast tokenizers) <code>List[int]</code>) — | |
| 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>) — | |
| 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>) — | |
| Whether or not to add special tokens when encoding the sequences. This will use the underlying | |
| <code>PretrainedTokenizerBase.build_inputs_with_special_tokens</code> function, which defines which tokens are | |
| automatically added to the input ids. This is useful if you want to add <code>bos</code> or <code>eos</code> tokens | |
| automatically.`,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/pr_37396/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls padding. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest'</code>: Pad to the longest sequence in the batch (or no padding if only a single | |
| sequence if provided).</li> | |
| <li><code>'max_length'</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>'do_not_pad'</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/pr_37396/zh/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls truncation. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest_first'</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>'only_first'</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>'only_second'</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>'do_not_truncate'</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>) — | |
| 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) — | |
| 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>) — | |
| 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>) — | |
| 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>>= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.encode_plus.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) — | |
| The side on which the model should have padding applied. Should be selected between [‘right’, ‘left’]. | |
| Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizerBase.encode_plus.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_37396/zh/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) — | |
| If set, will return tensors instead of list of python integers. Acceptable values are:</p> | |
| <ul> | |
| <li><code>'tf'</code>: Return TensorFlow <code>tf.constant</code> objects.</li> | |
| <li><code>'pt'</code>: Return PyTorch <code>torch.Tensor</code> objects.</li> | |
| <li><code>'np'</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>) — | |
| Whether to return token type IDs. If left to the default, will return the token type IDs according to | |
| the specific tokenizer’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>) — | |
| Whether to return the attention mask. If left to the default, will return the attention mask according | |
| to the specific tokenizer’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>) — | |
| 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>) — | |
| 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>) — | |
| 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/pr_37396/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using | |
| Python’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>) — | |
| 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>) — | |
| Whether or not to print more information and warnings.`,name:"verbose"},{anchor:"transformers.PreTrainedTokenizerBase.encode_plus.*kwargs",description:"*<strong>*kwargs</strong> — passed to the <code>self.tokenize()</code> method",name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3092",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a> with the following fields:</p> | |
| <ul> | |
| <li> | |
| <p><strong>input_ids</strong> — 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> — List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or | |
| if <em>“token_type_ids”</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> — List of indices specifying which tokens should be attended to by the model (when | |
| <code>return_attention_mask=True</code> or if <em>“attention_mask”</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> — 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> — 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> — 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> — The length of the inputs (when <code>return_length=True</code>)</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a></p> | |
| `}}),de=new Pn({props:{warning:!0,$$slots:{default:[Hs]},$$scope:{ctx:B}}}),Ze=new w({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:"trust_remote_code",val:" = False"},{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>) — | |
| 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.</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/pr_37396/zh/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>) — | |
| 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>) — | |
| 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> — | |
| Deprecated and ignored. All downloads are now resumed by default when possible. | |
| Will be removed in v5 of Transformers.`,name:"resume_download"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}</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>) — | |
| 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>) — | |
| 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>"main"</code>) — | |
| 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>) — | |
| 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>) — | |
| Will be passed along to the Tokenizer <code>__init__</code> method.`,name:"inputs"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.trust_remote_code",description:`<strong>trust_remote_code</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to allow for custom models defined on the Hub in their own modeling files. This option | |
| should only be set to <code>True</code> for repositories you trust and in which you have read the code, as it will | |
| execute code present on the Hub on your local machine.`,name:"trust_remote_code"},{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) — | |
| 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/vr_37396/src/transformers/tokenization_utils_base.py#L1834"}}),le=new Pn({props:{$$slots:{default:[Xs]},$$scope:{ctx:B}}}),ce=new On({props:{anchor:"transformers.PreTrainedTokenizerBase.from_pretrained.example",$$slots:{default:[Ys]},$$scope:{ctx:B}}}),Se=new w({props:{name:"get_chat_template",anchor:"transformers.PreTrainedTokenizerBase.get_chat_template",parameters:[{name:"chat_template",val:": typing.Optional[str] = None"},{name:"tools",val:": typing.Optional[typing.List[typing.Dict]] = None"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.get_chat_template.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) — | |
| A Jinja template or the name of a template to use for this conversion. | |
| It is usually not necessary to pass anything to this argument, | |
| as the model’s template will be used by default.`,name:"chat_template"},{anchor:"transformers.PreTrainedTokenizerBase.get_chat_template.tools",description:`<strong>tools</strong> (<code>List[Dict]</code>, <em>optional</em>) — | |
| A list of tools (callable functions) that will be accessible to the model. If the template does not | |
| support function calling, this argument will have no effect. Each tool should be passed as a JSON Schema, | |
| giving the name, description and argument types for the tool. See our | |
| <a href="https://huggingface.co/docs/transformers/main/en/chat_templating#automated-function-conversion-for-tool-use" rel="nofollow">chat templating guide</a> | |
| for more information.`,name:"tools"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L1780",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The chat template string.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>str</code></p> | |
| `}}),Ve=new w({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>) — | |
| 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>) — | |
| 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>) — | |
| 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/vr_37396/src/transformers/tokenization_utils_base.py#L3958",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>1 for a special token, 0 for a sequence token.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A list of integers in the range [0, 1]</p> | |
| `}}),Ee=new w({props:{name:"get_vocab",anchor:"transformers.PreTrainedTokenizerBase.get_vocab",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L1518",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The vocabulary.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Dict[str, int]</code></p> | |
| `}}),Re=new w({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:"padding_side",val:": typing.Optional[str] = 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/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding">BatchEncoding</a>, list of <a href="/docs/transformers/pr_37396/zh/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>) — | |
| Tokenized inputs. Can represent one input (<a href="/docs/transformers/pr_37396/zh/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/pr_37396/zh/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/pr_37396/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>True</code>) — | |
| Select a strategy to pad the returned sequences (according to the model’s padding side and padding | |
| index) among:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest'</code> (default): Pad to the longest sequence in the batch (or no padding if only a single | |
| sequence if provided).</li> | |
| <li><code>'max_length'</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>'do_not_pad'</code>: 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>) — | |
| 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>) — | |
| 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>>= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.pad.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) — | |
| The side on which the model should have padding applied. Should be selected between [‘right’, ‘left’]. | |
| Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizerBase.pad.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether to return the attention mask. If left to the default, will return the attention mask according | |
| to the specific tokenizer’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/pr_37396/zh/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) — | |
| If set, will return tensors instead of list of python integers. Acceptable values are:</p> | |
| <ul> | |
| <li><code>'tf'</code>: Return TensorFlow <code>tf.constant</code> objects.</li> | |
| <li><code>'pt'</code>: Return PyTorch <code>torch.Tensor</code> objects.</li> | |
| <li><code>'np'</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>) — | |
| Whether or not to print more information and warnings.`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3302"}}),ue=new Pn({props:{$$slots:{default:[Os]},$$scope:{ctx:B}}}),Ae=new w({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, NoneType] = 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:"padding_side",val:": typing.Optional[str] = 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>) — | |
| 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>) — | |
| 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>) — | |
| Whether or not to add special tokens when encoding the sequences. This will use the underlying | |
| <code>PretrainedTokenizerBase.build_inputs_with_special_tokens</code> function, which defines which tokens are | |
| automatically added to the input ids. This is useful if you want to add <code>bos</code> or <code>eos</code> tokens | |
| automatically.`,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/pr_37396/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls padding. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest'</code>: Pad to the longest sequence in the batch (or no padding if only a single | |
| sequence if provided).</li> | |
| <li><code>'max_length'</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>'do_not_pad'</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/pr_37396/zh/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls truncation. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest_first'</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>'only_first'</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>'only_second'</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>'do_not_truncate'</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>) — | |
| 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) — | |
| 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>) — | |
| 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>) — | |
| 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>>= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.prepare_for_model.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) — | |
| The side on which the model should have padding applied. Should be selected between [‘right’, ‘left’]. | |
| Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizerBase.prepare_for_model.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_37396/zh/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) — | |
| If set, will return tensors instead of list of python integers. Acceptable values are:</p> | |
| <ul> | |
| <li><code>'tf'</code>: Return TensorFlow <code>tf.constant</code> objects.</li> | |
| <li><code>'pt'</code>: Return PyTorch <code>torch.Tensor</code> objects.</li> | |
| <li><code>'np'</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>) — | |
| Whether to return token type IDs. If left to the default, will return the token type IDs according to | |
| the specific tokenizer’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>) — | |
| Whether to return the attention mask. If left to the default, will return the attention mask according | |
| to the specific tokenizer’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>) — | |
| 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>) — | |
| 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>) — | |
| 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/pr_37396/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using | |
| Python’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>) — | |
| 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>) — | |
| Whether or not to print more information and warnings.`,name:"verbose"},{anchor:"transformers.PreTrainedTokenizerBase.prepare_for_model.*kwargs",description:"*<strong>*kwargs</strong> — passed to the <code>self.tokenize()</code> method",name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L3521",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a> with the following fields:</p> | |
| <ul> | |
| <li> | |
| <p><strong>input_ids</strong> — 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> — List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or | |
| if <em>“token_type_ids”</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> — List of indices specifying which tokens should be attended to by the model (when | |
| <code>return_attention_mask=True</code> or if <em>“attention_mask”</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> — 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> — 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> — 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> — The length of the inputs (when <code>return_length=True</code>)</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a></p> | |
| `}}),Ge=new w({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:": typing.Optional[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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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/pr_37396/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) — | |
| Activates and controls padding. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest'</code>: Pad to the longest sequence in the batch (or no padding if only a single | |
| sequence if provided).</li> | |
| <li><code>'max_length'</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>'do_not_pad'</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/pr_37396/zh/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) — | |
| If set, will return tensors instead of list of python integers. Acceptable values are:</p> | |
| <ul> | |
| <li><code>'tf'</code>: Return TensorFlow <code>tf.constant</code> objects.</li> | |
| <li><code>'pt'</code>: Return PyTorch <code>torch.Tensor</code> objects.</li> | |
| <li><code>'np'</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/pr_37396/zh/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>True</code>) — | |
| Activates and controls truncation. Accepts the following values:</p> | |
| <ul> | |
| <li><code>True</code> or <code>'longest_first'</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>'only_first'</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>'only_second'</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>'do_not_truncate'</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_seq2seq_batch.*kwargs",description:`*<strong>*kwargs</strong> — | |
| Additional keyword arguments passed along to <code>self.__call__</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L4089",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a> with the following fields:</p> | |
| <ul> | |
| <li><strong>input_ids</strong> — List of token ids to be fed to the encoder.</li> | |
| <li><strong>attention_mask</strong> — List of indices specifying which tokens should be attended to by the model.</li> | |
| <li><strong>labels</strong> — 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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_37396/zh/main_classes/tokenizer#transformers.BatchEncoding" | |
| >BatchEncoding</a></p> | |
| `}}),He=new w({props:{name:"push_to_hub",anchor:"transformers.PreTrainedTokenizerBase.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '5GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = True"},{name:"revision",val:": typing.Optional[str] = None"},{name:"commit_description",val:": typing.Optional[str] = None"},{name:"tags",val:": typing.Optional[list[str]] = None"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) — | |
| 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>) — | |
| 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>) — | |
| Message to commit while pushing. Will default to <code>"Upload tokenizer"</code>.`,name:"commit_message"},{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether to make the repo private. If <code>None</code> (default), the repo will be public unless the organization’s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) — | |
| The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated | |
| when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code> | |
| is not specified.`,name:"token"},{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>"5GB"</code>) — | |
| 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>"5MB"</code>). We default it to <code>"5GB"</code> so that users can easily load models on free-tier | |
| Google Colab instances without any CPU OOM issues.`,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>) — | |
| 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>True</code>) — | |
| Whether or not to convert the model weights in safetensors format for safer serialization.`,name:"safe_serialization"},{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) — | |
| Branch to push the uploaded files to.`,name:"revision"},{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.commit_description",description:`<strong>commit_description</strong> (<code>str</code>, <em>optional</em>) — | |
| The description of the commit that will be created`,name:"commit_description"},{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.tags",description:`<strong>tags</strong> (<code>List[str]</code>, <em>optional</em>) — | |
| List of tags to push on the Hub.`,name:"tags"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/utils/hub.py#L838"}}),ge=new On({props:{anchor:"transformers.PreTrainedTokenizerBase.push_to_hub.example",$$slots:{default:[Qs]},$$scope:{ctx:B}}}),Xe=new w({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>"AutoTokenizer"</code>) — | |
| The auto class to register this new tokenizer with.`,name:"auto_class"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L4063"}}),_e=new Pn({props:{warning:!0,$$slots:{default:[Ks]},$$scope:{ctx:B}}}),Ye=new w({props:{name:"save_chat_templates",anchor:"transformers.PreTrainedTokenizerBase.save_chat_templates",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"tokenizer_config",val:": dict"},{name:"filename_prefix",val:": typing.Optional[str]"},{name:"save_jinja_files",val:": bool"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L2391"}}),Oe=new w({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>) — 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>) — | |
| 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 | |
| “slow” tokenizers (not powered by the <em>tokenizers</em> library), so the tokenizer will not be able to be | |
| loaded in the corresponding “slow” tokenizer.</p> | |
| <p>If <code>True</code>, will save the tokenizer in legacy format. If the “slow” tokenizer doesn’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>) — | |
| 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>) — | |
| 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>) — | |
| Additional key word arguments passed along to the <a href="/docs/transformers/pr_37396/zh/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L2446",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The files saved.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A tuple of <code>str</code></p> | |
| `}}),Qe=new w({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>) — | |
| 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>) — | |
| An optional prefix to add to the named of the saved files.`,name:"filename_prefix"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L2650",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Paths to the files saved.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Tuple(str)</code></p> | |
| `}}),Ke=new w({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>) — | |
| The sequence to be encoded.`,name:"text"},{anchor:"transformers.PreTrainedTokenizerBase.tokenize.pair",description:`<strong>pair</strong> (<code>str</code>, <em>optional</em>) — | |
| 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>) — | |
| 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>) — | |
| Will be passed to the underlying model specific encode method. See details in | |
| <a href="/docs/transformers/pr_37396/zh/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"><strong>call</strong>()</a>`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L2668",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The list of tokens.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>List[str]</code></p> | |
| `}}),et=new w({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>) — | |
| 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>) — | |
| 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) — | |
| 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/pr_37396/zh/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>'longest_first'</code>) — | |
| The strategy to follow for truncation. Can be:</p> | |
| <ul> | |
| <li><code>'longest_first'</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>'only_first'</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>'only_second'</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>'do_not_truncate'</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) — | |
| 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/vr_37396/src/transformers/tokenization_utils_base.py#L3659",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Tuple[List[int], List[int], List[int]]</code></p> | |
| `}}),tt=new Qn({props:{title:"SpecialTokensMixin",local:"transformers.SpecialTokensMixin",headingTag:"h2"}}),nt=new w({props:{name:"class transformers.SpecialTokensMixin",anchor:"transformers.SpecialTokensMixin",parameters:[{name:"verbose",val:" = False"},{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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| A tuple or a list of additional tokens, which will be marked as <code>special</code>, meaning that they will be | |
| skipped when decoding if <code>skip_special_tokens</code> is set to <code>True</code>.`,name:"additional_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L832"}}),ot=new w({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>) — | |
| 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>) — | |
| If <code>True</code>, the existing list of additional special tokens will be replaced by the list provided in | |
| <code>special_tokens_dict</code>. Otherwise, <code>self._special_tokens_map["additional_special_tokens"]</code> is just extended. In the former | |
| case, the tokens will NOT be removed from the tokenizer’s full vocabulary - they are only being flagged | |
| as non-special tokens. Remember, this only affects which tokens are skipped during decoding, not the | |
| <code>added_tokens_encoder</code> and <code>added_tokens_decoder</code>. This means that the previous | |
| <code>additional_special_tokens</code> are still added tokens, and will not be split by the model.`,name:"replace_additional_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L904",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Number of tokens added to the vocabulary.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>int</code></p> | |
| `}}),ye=new On({props:{anchor:"transformers.SpecialTokensMixin.add_special_tokens.example",$$slots:{default:[ea]},$$scope:{ctx:B}}}),rt=new w({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>) — | |
| 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>) — | |
| 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/vr_37396/src/transformers/tokenization_utils_base.py#L1006",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Number of tokens added to the vocabulary.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>int</code></p> | |
| `}}),ve=new On({props:{anchor:"transformers.SpecialTokensMixin.add_tokens.example",$$slots:{default:[ta]},$$scope:{ctx:B}}}),st=new w({props:{name:"sanitize_special_tokens",anchor:"transformers.SpecialTokensMixin.sanitize_special_tokens",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L896"}}),at=new Qn({props:{title:"Enums和namedtuples(命名元组)",local:"transformers.tokenization_utils_base.TruncationStrategy",headingTag:"h2"}}),it=new w({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/vr_37396/src/transformers/tokenization_utils_base.py#L158"}}),dt=new w({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>) — Index of the first character in the original string.",name:"start"},{anchor:"transformers.CharSpan.end",description:"<strong>end</strong> (<code>int</code>) — Index of the character following the last character in the original string.",name:"end"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L170"}}),lt=new w({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>) — Index of the first token in the span.",name:"start"},{anchor:"transformers.TokenSpan.end",description:"<strong>end</strong> (<code>int</code>) — Index of the token following the last token in the span.",name:"end"}],source:"https://github.com/huggingface/transformers/blob/vr_37396/src/transformers/tokenization_utils_base.py#L183"}}),ct=new As({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/zh/internal/tokenization_utils.md"}}),{c(){a=r("meta"),z=n(),m=r("p"),T=n(),u($.$$.fragment),p=n(),P=r("p"),P.innerHTML=Jr,Bn=n(),$e=r("p"),$e.textContent=Dr,Mn=n(),u(Pe.$$.fragment),qn=n(),d=r("div"),u(Be.$$.fragment),eo=n(),_t=r("p"),_t.innerHTML=Zr,to=n(),kt=r("p"),kt.textContent=Sr,no=n(),bt=r("p"),bt.textContent=Vr,oo=n(),Tt=r("ul"),Tt.innerHTML=Er,ro=n(),te=r("div"),u(Me.$$.fragment),so=n(),yt=r("p"),yt.textContent=Rr,ao=n(),ne=r("div"),u(qe.$$.fragment),io=n(),vt=r("p"),vt.innerHTML=Ar,lo=n(),oe=r("div"),u(Le.$$.fragment),co=n(),xt=r("p"),xt.textContent=Gr,po=n(),re=r("div"),u(Ie.$$.fragment),mo=n(),wt=r("p"),wt.textContent=Hr,uo=n(),j=r("div"),u(Ce.$$.fragment),ho=n(),zt=r("p"),zt.textContent=Xr,fo=n(),u(se.$$.fragment),go=n(),U=r("div"),u(We.$$.fragment),_o=n(),$t=r("p"),$t.textContent=Yr,ko=n(),Pt=r("p"),Pt.textContent=Or,bo=n(),ae=r("div"),u(Ne.$$.fragment),To=n(),Bt=r("p"),Bt.textContent=Qr,yo=n(),ie=r("div"),u(je.$$.fragment),vo=n(),Mt=r("p"),Mt.innerHTML=Kr,xo=n(),F=r("div"),u(Ue.$$.fragment),wo=n(),qt=r("p"),qt.innerHTML=es,zo=n(),Lt=r("p"),Lt.textContent=ts,$o=n(),J=r("div"),u(Fe.$$.fragment),Po=n(),It=r("p"),It.textContent=ns,Bo=n(),Ct=r("p"),Ct.innerHTML=os,Mo=n(),D=r("div"),u(Je.$$.fragment),qo=n(),Wt=r("p"),Wt.textContent=rs,Lo=n(),Nt=r("p"),Nt.innerHTML=ss,Io=n(),Z=r("div"),u(De.$$.fragment),Co=n(),jt=r("p"),jt.textContent=as,Wo=n(),u(de.$$.fragment),No=n(),W=r("div"),u(Ze.$$.fragment),jo=n(),Ut=r("p"),Ut.innerHTML=is,Uo=n(),u(le.$$.fragment),Fo=n(),u(ce.$$.fragment),Jo=n(),pe=r("div"),u(Se.$$.fragment),Do=n(),Ft=r("p"),Ft.innerHTML=ds,Zo=n(),me=r("div"),u(Ve.$$.fragment),So=n(),Jt=r("p"),Jt.innerHTML=ls,Vo=n(),S=r("div"),u(Ee.$$.fragment),Eo=n(),Dt=r("p"),Dt.textContent=cs,Ro=n(),Zt=r("p"),Zt.innerHTML=ps,Ao=n(),I=r("div"),u(Re.$$.fragment),Go=n(),St=r("p"),St.textContent=ms,Ho=n(),Vt=r("p"),Vt.innerHTML=us,Xo=n(),Et=r("p"),Et.innerHTML=hs,Yo=n(),u(ue.$$.fragment),Oo=n(),he=r("div"),u(Ae.$$.fragment),Qo=n(),Rt=r("p"),Rt.innerHTML=fs,Ko=n(),fe=r("div"),u(Ge.$$.fragment),er=n(),At=r("p"),At.textContent=gs,tr=n(),V=r("div"),u(He.$$.fragment),nr=n(),Gt=r("p"),Gt.textContent=_s,or=n(),u(ge.$$.fragment),rr=n(),E=r("div"),u(Xe.$$.fragment),sr=n(),Ht=r("p"),Ht.innerHTML=ks,ar=n(),u(_e.$$.fragment),ir=n(),ke=r("div"),u(Ye.$$.fragment),dr=n(),Xt=r("p"),Xt.textContent=bs,lr=n(),N=r("div"),u(Oe.$$.fragment),cr=n(),Yt=r("p"),Yt.textContent=Ts,pr=n(),Ot=r("p"),Ot.innerHTML=ys,mr=n(),Qt=r("p"),Qt.innerHTML=vs,ur=n(),R=r("div"),u(Qe.$$.fragment),hr=n(),Kt=r("p"),Kt.textContent=xs,fr=n(),en=r("p"),en.innerHTML=ws,gr=n(),be=r("div"),u(Ke.$$.fragment),_r=n(),tn=r("p"),tn.innerHTML=zs,kr=n(),Te=r("div"),u(et.$$.fragment),br=n(),nn=r("p"),nn.textContent=$s,Ln=n(),u(tt.$$.fragment),In=n(),L=r("div"),u(nt.$$.fragment),Tr=n(),on=r("p"),on.innerHTML=Ps,yr=n(),M=r("div"),u(ot.$$.fragment),vr=n(),rn=r("p"),rn.textContent=Bs,xr=n(),sn=r("p"),sn.textContent=Ms,wr=n(),an=r("p"),an.innerHTML=qs,zr=n(),dn=r("p"),dn.innerHTML=Ls,$r=n(),ln=r("ul"),ln.innerHTML=Is,Pr=n(),cn=r("p"),cn.innerHTML=Cs,Br=n(),u(ye.$$.fragment),Mr=n(),C=r("div"),u(rt.$$.fragment),qr=n(),pn=r("p"),pn.textContent=Ws,Lr=n(),mn=r("p"),mn.textContent=Ns,Ir=n(),un=r("p"),un.innerHTML=js,Cr=n(),u(ve.$$.fragment),Wr=n(),xe=r("div"),u(st.$$.fragment),Nr=n(),hn=r("p"),hn.innerHTML=Us,Cn=n(),u(at.$$.fragment),Wn=n(),X=r("div"),u(it.$$.fragment),jr=n(),fn=r("p"),fn.innerHTML=Fs,Nn=n(),Y=r("div"),u(dt.$$.fragment),Ur=n(),gn=r("p"),gn.textContent=Js,jn=n(),O=r("div"),u(lt.$$.fragment),Fr=n(),_n=r("p"),_n.textContent=Ds,Un=n(),u(ct.$$.fragment),Fn=n(),$n=r("p"),this.h()},l(t){const b=Rs("svelte-u9bgzb",document.head);a=s(b,"META",{name:!0,content:!0}),b.forEach(i),z=o(t),m=s(t,"P",{}),y(m).forEach(i),T=o(t),h($.$$.fragment,t),p=o(t),P=s(t,"P",{"data-svelte-h":!0}),c(P)!=="svelte-1dlyz1e"&&(P.innerHTML=Jr),Bn=o(t),$e=s(t,"P",{"data-svelte-h":!0}),c($e)!=="svelte-1x75m6n"&&($e.textContent=Dr),Mn=o(t),h(Pe.$$.fragment,t),qn=o(t),d=s(t,"DIV",{class:!0});var l=y(d);h(Be.$$.fragment,l),eo=o(l),_t=s(l,"P",{"data-svelte-h":!0}),c(_t)!=="svelte-higdzb"&&(_t.innerHTML=Zr),to=o(l),kt=s(l,"P",{"data-svelte-h":!0}),c(kt)!=="svelte-2oj7z8"&&(kt.textContent=Sr),no=o(l),bt=s(l,"P",{"data-svelte-h":!0}),c(bt)!=="svelte-1ixo79u"&&(bt.textContent=Vr),oo=o(l),Tt=s(l,"UL",{"data-svelte-h":!0}),c(Tt)!=="svelte-1y0k6z5"&&(Tt.innerHTML=Er),ro=o(l),te=s(l,"DIV",{class:!0});var pt=y(te);h(Me.$$.fragment,pt),so=o(pt),yt=s(pt,"P",{"data-svelte-h":!0}),c(yt)!=="svelte-kpxj0c"&&(yt.textContent=Rr),pt.forEach(i),ao=o(l),ne=s(l,"DIV",{class:!0});var mt=y(ne);h(qe.$$.fragment,mt),io=o(mt),vt=s(mt,"P",{"data-svelte-h":!0}),c(vt)!=="svelte-j87b6t"&&(vt.innerHTML=Ar),mt.forEach(i),lo=o(l),oe=s(l,"DIV",{class:!0});var ut=y(oe);h(Le.$$.fragment,ut),co=o(ut),xt=s(ut,"P",{"data-svelte-h":!0}),c(xt)!=="svelte-hxrl9"&&(xt.textContent=Gr),ut.forEach(i),po=o(l),re=s(l,"DIV",{class:!0});var ht=y(re);h(Ie.$$.fragment,ht),mo=o(ht),wt=s(ht,"P",{"data-svelte-h":!0}),c(wt)!=="svelte-1deng2j"&&(wt.textContent=Hr),ht.forEach(i),uo=o(l),j=s(l,"DIV",{class:!0});var Q=y(j);h(Ce.$$.fragment,Q),ho=o(Q),zt=s(Q,"P",{"data-svelte-h":!0}),c(zt)!=="svelte-6p21pf"&&(zt.textContent=Xr),fo=o(Q),h(se.$$.fragment,Q),Q.forEach(i),go=o(l),U=s(l,"DIV",{class:!0});var K=y(U);h(We.$$.fragment,K),_o=o(K),$t=s(K,"P",{"data-svelte-h":!0}),c($t)!=="svelte-xip562"&&($t.textContent=Yr),ko=o(K),Pt=s(K,"P",{"data-svelte-h":!0}),c(Pt)!=="svelte-1yvfiyo"&&(Pt.textContent=Or),K.forEach(i),bo=o(l),ae=s(l,"DIV",{class:!0});var ft=y(ae);h(Ne.$$.fragment,ft),To=o(ft),Bt=s(ft,"P",{"data-svelte-h":!0}),c(Bt)!=="svelte-6a62nd"&&(Bt.textContent=Qr),ft.forEach(i),yo=o(l),ie=s(l,"DIV",{class:!0});var gt=y(ie);h(je.$$.fragment,gt),vo=o(gt),Mt=s(gt,"P",{"data-svelte-h":!0}),c(Mt)!=="svelte-sfkaj8"&&(Mt.innerHTML=Kr),gt.forEach(i),xo=o(l),F=s(l,"DIV",{class:!0});var kn=y(F);h(Ue.$$.fragment,kn),wo=o(kn),qt=s(kn,"P",{"data-svelte-h":!0}),c(qt)!=="svelte-zj1vf1"&&(qt.innerHTML=es),zo=o(kn),Lt=s(kn,"P",{"data-svelte-h":!0}),c(Lt)!=="svelte-9vptpw"&&(Lt.textContent=ts),kn.forEach(i),$o=o(l),J=s(l,"DIV",{class:!0});var bn=y(J);h(Fe.$$.fragment,bn),Po=o(bn),It=s(bn,"P",{"data-svelte-h":!0}),c(It)!=="svelte-vbfkpu"&&(It.textContent=ns),Bo=o(bn),Ct=s(bn,"P",{"data-svelte-h":!0}),c(Ct)!=="svelte-125uxon"&&(Ct.innerHTML=os),bn.forEach(i),Mo=o(l),D=s(l,"DIV",{class:!0});var Tn=y(D);h(Je.$$.fragment,Tn),qo=o(Tn),Wt=s(Tn,"P",{"data-svelte-h":!0}),c(Wt)!=="svelte-12b8hzo"&&(Wt.textContent=rs),Lo=o(Tn),Nt=s(Tn,"P",{"data-svelte-h":!0}),c(Nt)!=="svelte-1kyhveh"&&(Nt.innerHTML=ss),Tn.forEach(i),Io=o(l),Z=s(l,"DIV",{class:!0});var yn=y(Z);h(De.$$.fragment,yn),Co=o(yn),jt=s(yn,"P",{"data-svelte-h":!0}),c(jt)!=="svelte-ma945j"&&(jt.textContent=as),Wo=o(yn),h(de.$$.fragment,yn),yn.forEach(i),No=o(l),W=s(l,"DIV",{class:!0});var we=y(W);h(Ze.$$.fragment,we),jo=o(we),Ut=s(we,"P",{"data-svelte-h":!0}),c(Ut)!=="svelte-19sa19n"&&(Ut.innerHTML=is),Uo=o(we),h(le.$$.fragment,we),Fo=o(we),h(ce.$$.fragment,we),we.forEach(i),Jo=o(l),pe=s(l,"DIV",{class:!0});var Dn=y(pe);h(Se.$$.fragment,Dn),Do=o(Dn),Ft=s(Dn,"P",{"data-svelte-h":!0}),c(Ft)!=="svelte-1hrpjri"&&(Ft.innerHTML=ds),Dn.forEach(i),Zo=o(l),me=s(l,"DIV",{class:!0});var Zn=y(me);h(Ve.$$.fragment,Zn),So=o(Zn),Jt=s(Zn,"P",{"data-svelte-h":!0}),c(Jt)!=="svelte-1wmjg8a"&&(Jt.innerHTML=ls),Zn.forEach(i),Vo=o(l),S=s(l,"DIV",{class:!0});var vn=y(S);h(Ee.$$.fragment,vn),Eo=o(vn),Dt=s(vn,"P",{"data-svelte-h":!0}),c(Dt)!=="svelte-1gbatu6"&&(Dt.textContent=cs),Ro=o(vn),Zt=s(vn,"P",{"data-svelte-h":!0}),c(Zt)!=="svelte-907bv"&&(Zt.innerHTML=ps),vn.forEach(i),Ao=o(l),I=s(l,"DIV",{class:!0});var A=y(I);h(Re.$$.fragment,A),Go=o(A),St=s(A,"P",{"data-svelte-h":!0}),c(St)!=="svelte-1n892mi"&&(St.textContent=ms),Ho=o(A),Vt=s(A,"P",{"data-svelte-h":!0}),c(Vt)!=="svelte-1xir9yc"&&(Vt.innerHTML=us),Xo=o(A),Et=s(A,"P",{"data-svelte-h":!0}),c(Et)!=="svelte-28v9x1"&&(Et.innerHTML=hs),Yo=o(A),h(ue.$$.fragment,A),A.forEach(i),Oo=o(l),he=s(l,"DIV",{class:!0});var Sn=y(he);h(Ae.$$.fragment,Sn),Qo=o(Sn),Rt=s(Sn,"P",{"data-svelte-h":!0}),c(Rt)!=="svelte-cwdwvn"&&(Rt.innerHTML=fs),Sn.forEach(i),Ko=o(l),fe=s(l,"DIV",{class:!0});var Vn=y(fe);h(Ge.$$.fragment,Vn),er=o(Vn),At=s(Vn,"P",{"data-svelte-h":!0}),c(At)!=="svelte-dtuae6"&&(At.textContent=gs),Vn.forEach(i),tr=o(l),V=s(l,"DIV",{class:!0});var xn=y(V);h(He.$$.fragment,xn),nr=o(xn),Gt=s(xn,"P",{"data-svelte-h":!0}),c(Gt)!=="svelte-tpmkl3"&&(Gt.textContent=_s),or=o(xn),h(ge.$$.fragment,xn),xn.forEach(i),rr=o(l),E=s(l,"DIV",{class:!0});var wn=y(E);h(Xe.$$.fragment,wn),sr=o(wn),Ht=s(wn,"P",{"data-svelte-h":!0}),c(Ht)!=="svelte-189h5u2"&&(Ht.innerHTML=ks),ar=o(wn),h(_e.$$.fragment,wn),wn.forEach(i),ir=o(l),ke=s(l,"DIV",{class:!0});var En=y(ke);h(Ye.$$.fragment,En),dr=o(En),Xt=s(En,"P",{"data-svelte-h":!0}),c(Xt)!=="svelte-zk9lwo"&&(Xt.textContent=bs),En.forEach(i),lr=o(l),N=s(l,"DIV",{class:!0});var ze=y(N);h(Oe.$$.fragment,ze),cr=o(ze),Yt=s(ze,"P",{"data-svelte-h":!0}),c(Yt)!=="svelte-u73u19"&&(Yt.textContent=Ts),pr=o(ze),Ot=s(ze,"P",{"data-svelte-h":!0}),c(Ot)!=="svelte-p0dt88"&&(Ot.innerHTML=ys),mr=o(ze),Qt=s(ze,"P",{"data-svelte-h":!0}),c(Qt)!=="svelte-1qee1z"&&(Qt.innerHTML=vs),ze.forEach(i),ur=o(l),R=s(l,"DIV",{class:!0});var zn=y(R);h(Qe.$$.fragment,zn),hr=o(zn),Kt=s(zn,"P",{"data-svelte-h":!0}),c(Kt)!=="svelte-rx0wq1"&&(Kt.textContent=xs),fr=o(zn),en=s(zn,"P",{"data-svelte-h":!0}),c(en)!=="svelte-c9295b"&&(en.innerHTML=ws),zn.forEach(i),gr=o(l),be=s(l,"DIV",{class:!0});var Rn=y(be);h(Ke.$$.fragment,Rn),_r=o(Rn),tn=s(Rn,"P",{"data-svelte-h":!0}),c(tn)!=="svelte-ikoqgw"&&(tn.innerHTML=zs),Rn.forEach(i),kr=o(l),Te=s(l,"DIV",{class:!0});var An=y(Te);h(et.$$.fragment,An),br=o(An),nn=s(An,"P",{"data-svelte-h":!0}),c(nn)!=="svelte-fkofn"&&(nn.textContent=$s),An.forEach(i),l.forEach(i),Ln=o(t),h(tt.$$.fragment,t),In=o(t),L=s(t,"DIV",{class:!0});var G=y(L);h(nt.$$.fragment,G),Tr=o(G),on=s(G,"P",{"data-svelte-h":!0}),c(on)!=="svelte-hx2kej"&&(on.innerHTML=Ps),yr=o(G),M=s(G,"DIV",{class:!0});var q=y(M);h(ot.$$.fragment,q),vr=o(q),rn=s(q,"P",{"data-svelte-h":!0}),c(rn)!=="svelte-1j8s0i5"&&(rn.textContent=Bs),xr=o(q),sn=s(q,"P",{"data-svelte-h":!0}),c(sn)!=="svelte-1w3ayx9"&&(sn.textContent=Ms),wr=o(q),an=s(q,"P",{"data-svelte-h":!0}),c(an)!=="svelte-4w2tko"&&(an.innerHTML=qs),zr=o(q),dn=s(q,"P",{"data-svelte-h":!0}),c(dn)!=="svelte-5hxtpc"&&(dn.innerHTML=Ls),$r=o(q),ln=s(q,"UL",{"data-svelte-h":!0}),c(ln)!=="svelte-1pes0uj"&&(ln.innerHTML=Is),Pr=o(q),cn=s(q,"P",{"data-svelte-h":!0}),c(cn)!=="svelte-1butrf6"&&(cn.innerHTML=Cs),Br=o(q),h(ye.$$.fragment,q),q.forEach(i),Mr=o(G),C=s(G,"DIV",{class:!0});var H=y(C);h(rt.$$.fragment,H),qr=o(H),pn=s(H,"P",{"data-svelte-h":!0}),c(pn)!=="svelte-c27xjk"&&(pn.textContent=Ws),Lr=o(H),mn=s(H,"P",{"data-svelte-h":!0}),c(mn)!=="svelte-j0w5r1"&&(mn.textContent=Ns),Ir=o(H),un=s(H,"P",{"data-svelte-h":!0}),c(un)!=="svelte-4w2tko"&&(un.innerHTML=js),Cr=o(H),h(ve.$$.fragment,H),H.forEach(i),Wr=o(G),xe=s(G,"DIV",{class:!0});var Gn=y(xe);h(st.$$.fragment,Gn),Nr=o(Gn),hn=s(Gn,"P",{"data-svelte-h":!0}),c(hn)!=="svelte-1em0285"&&(hn.innerHTML=Us),Gn.forEach(i),G.forEach(i),Cn=o(t),h(at.$$.fragment,t),Wn=o(t),X=s(t,"DIV",{class:!0});var Hn=y(X);h(it.$$.fragment,Hn),jr=o(Hn),fn=s(Hn,"P",{"data-svelte-h":!0}),c(fn)!=="svelte-12yc322"&&(fn.innerHTML=Fs),Hn.forEach(i),Nn=o(t),Y=s(t,"DIV",{class:!0});var Xn=y(Y);h(dt.$$.fragment,Xn),Ur=o(Xn),gn=s(Xn,"P",{"data-svelte-h":!0}),c(gn)!=="svelte-136gduh"&&(gn.textContent=Js),Xn.forEach(i),jn=o(t),O=s(t,"DIV",{class:!0});var Yn=y(O);h(lt.$$.fragment,Yn),Fr=o(Yn),_n=s(Yn,"P",{"data-svelte-h":!0}),c(_n)!=="svelte-18ocfae"&&(_n.textContent=Ds),Yn.forEach(i),Un=o(t),h(ct.$$.fragment,t),Fn=o(t),$n=s(t,"P",{}),y($n).forEach(i),this.h()},h(){v(a,"name","hf:doc:metadata"),v(a,"content",oa),v(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(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(t,b){e(document.head,a),x(t,z,b),x(t,m,b),x(t,T,b),f($,t,b),x(t,p,b),x(t,P,b),x(t,Bn,b),x(t,$e,b),x(t,Mn,b),f(Pe,t,b),x(t,qn,b),x(t,d,b),f(Be,d,null),e(d,eo),e(d,_t),e(d,to),e(d,kt),e(d,no),e(d,bt),e(d,oo),e(d,Tt),e(d,ro),e(d,te),f(Me,te,null),e(te,so),e(te,yt),e(d,ao),e(d,ne),f(qe,ne,null),e(ne,io),e(ne,vt),e(d,lo),e(d,oe),f(Le,oe,null),e(oe,co),e(oe,xt),e(d,po),e(d,re),f(Ie,re,null),e(re,mo),e(re,wt),e(d,uo),e(d,j),f(Ce,j,null),e(j,ho),e(j,zt),e(j,fo),f(se,j,null),e(d,go),e(d,U),f(We,U,null),e(U,_o),e(U,$t),e(U,ko),e(U,Pt),e(d,bo),e(d,ae),f(Ne,ae,null),e(ae,To),e(ae,Bt),e(d,yo),e(d,ie),f(je,ie,null),e(ie,vo),e(ie,Mt),e(d,xo),e(d,F),f(Ue,F,null),e(F,wo),e(F,qt),e(F,zo),e(F,Lt),e(d,$o),e(d,J),f(Fe,J,null),e(J,Po),e(J,It),e(J,Bo),e(J,Ct),e(d,Mo),e(d,D),f(Je,D,null),e(D,qo),e(D,Wt),e(D,Lo),e(D,Nt),e(d,Io),e(d,Z),f(De,Z,null),e(Z,Co),e(Z,jt),e(Z,Wo),f(de,Z,null),e(d,No),e(d,W),f(Ze,W,null),e(W,jo),e(W,Ut),e(W,Uo),f(le,W,null),e(W,Fo),f(ce,W,null),e(d,Jo),e(d,pe),f(Se,pe,null),e(pe,Do),e(pe,Ft),e(d,Zo),e(d,me),f(Ve,me,null),e(me,So),e(me,Jt),e(d,Vo),e(d,S),f(Ee,S,null),e(S,Eo),e(S,Dt),e(S,Ro),e(S,Zt),e(d,Ao),e(d,I),f(Re,I,null),e(I,Go),e(I,St),e(I,Ho),e(I,Vt),e(I,Xo),e(I,Et),e(I,Yo),f(ue,I,null),e(d,Oo),e(d,he),f(Ae,he,null),e(he,Qo),e(he,Rt),e(d,Ko),e(d,fe),f(Ge,fe,null),e(fe,er),e(fe,At),e(d,tr),e(d,V),f(He,V,null),e(V,nr),e(V,Gt),e(V,or),f(ge,V,null),e(d,rr),e(d,E),f(Xe,E,null),e(E,sr),e(E,Ht),e(E,ar),f(_e,E,null),e(d,ir),e(d,ke),f(Ye,ke,null),e(ke,dr),e(ke,Xt),e(d,lr),e(d,N),f(Oe,N,null),e(N,cr),e(N,Yt),e(N,pr),e(N,Ot),e(N,mr),e(N,Qt),e(d,ur),e(d,R),f(Qe,R,null),e(R,hr),e(R,Kt),e(R,fr),e(R,en),e(d,gr),e(d,be),f(Ke,be,null),e(be,_r),e(be,tn),e(d,kr),e(d,Te),f(et,Te,null),e(Te,br),e(Te,nn),x(t,Ln,b),f(tt,t,b),x(t,In,b),x(t,L,b),f(nt,L,null),e(L,Tr),e(L,on),e(L,yr),e(L,M),f(ot,M,null),e(M,vr),e(M,rn),e(M,xr),e(M,sn),e(M,wr),e(M,an),e(M,zr),e(M,dn),e(M,$r),e(M,ln),e(M,Pr),e(M,cn),e(M,Br),f(ye,M,null),e(L,Mr),e(L,C),f(rt,C,null),e(C,qr),e(C,pn),e(C,Lr),e(C,mn),e(C,Ir),e(C,un),e(C,Cr),f(ve,C,null),e(L,Wr),e(L,xe),f(st,xe,null),e(xe,Nr),e(xe,hn),x(t,Cn,b),f(at,t,b),x(t,Wn,b),x(t,X,b),f(it,X,null),e(X,jr),e(X,fn),x(t,Nn,b),x(t,Y,b),f(dt,Y,null),e(Y,Ur),e(Y,gn),x(t,jn,b),x(t,O,b),f(lt,O,null),e(O,Fr),e(O,_n),x(t,Un,b),f(ct,t,b),x(t,Fn,b),x(t,$n,b),Jn=!0},p(t,[b]){const l={};b&2&&(l.$$scope={dirty:b,ctx:t}),se.$set(l);const pt={};b&2&&(pt.$$scope={dirty:b,ctx:t}),de.$set(pt);const mt={};b&2&&(mt.$$scope={dirty:b,ctx:t}),le.$set(mt);const ut={};b&2&&(ut.$$scope={dirty:b,ctx:t}),ce.$set(ut);const ht={};b&2&&(ht.$$scope={dirty:b,ctx:t}),ue.$set(ht);const Q={};b&2&&(Q.$$scope={dirty:b,ctx:t}),ge.$set(Q);const K={};b&2&&(K.$$scope={dirty:b,ctx:t}),_e.$set(K);const ft={};b&2&&(ft.$$scope={dirty:b,ctx:t}),ye.$set(ft);const gt={};b&2&&(gt.$$scope={dirty:b,ctx:t}),ve.$set(gt)},i(t){Jn||(g($.$$.fragment,t),g(Pe.$$.fragment,t),g(Be.$$.fragment,t),g(Me.$$.fragment,t),g(qe.$$.fragment,t),g(Le.$$.fragment,t),g(Ie.$$.fragment,t),g(Ce.$$.fragment,t),g(se.$$.fragment,t),g(We.$$.fragment,t),g(Ne.$$.fragment,t),g(je.$$.fragment,t),g(Ue.$$.fragment,t),g(Fe.$$.fragment,t),g(Je.$$.fragment,t),g(De.$$.fragment,t),g(de.$$.fragment,t),g(Ze.$$.fragment,t),g(le.$$.fragment,t),g(ce.$$.fragment,t),g(Se.$$.fragment,t),g(Ve.$$.fragment,t),g(Ee.$$.fragment,t),g(Re.$$.fragment,t),g(ue.$$.fragment,t),g(Ae.$$.fragment,t),g(Ge.$$.fragment,t),g(He.$$.fragment,t),g(ge.$$.fragment,t),g(Xe.$$.fragment,t),g(_e.$$.fragment,t),g(Ye.$$.fragment,t),g(Oe.$$.fragment,t),g(Qe.$$.fragment,t),g(Ke.$$.fragment,t),g(et.$$.fragment,t),g(tt.$$.fragment,t),g(nt.$$.fragment,t),g(ot.$$.fragment,t),g(ye.$$.fragment,t),g(rt.$$.fragment,t),g(ve.$$.fragment,t),g(st.$$.fragment,t),g(at.$$.fragment,t),g(it.$$.fragment,t),g(dt.$$.fragment,t),g(lt.$$.fragment,t),g(ct.$$.fragment,t),Jn=!0)},o(t){_($.$$.fragment,t),_(Pe.$$.fragment,t),_(Be.$$.fragment,t),_(Me.$$.fragment,t),_(qe.$$.fragment,t),_(Le.$$.fragment,t),_(Ie.$$.fragment,t),_(Ce.$$.fragment,t),_(se.$$.fragment,t),_(We.$$.fragment,t),_(Ne.$$.fragment,t),_(je.$$.fragment,t),_(Ue.$$.fragment,t),_(Fe.$$.fragment,t),_(Je.$$.fragment,t),_(De.$$.fragment,t),_(de.$$.fragment,t),_(Ze.$$.fragment,t),_(le.$$.fragment,t),_(ce.$$.fragment,t),_(Se.$$.fragment,t),_(Ve.$$.fragment,t),_(Ee.$$.fragment,t),_(Re.$$.fragment,t),_(ue.$$.fragment,t),_(Ae.$$.fragment,t),_(Ge.$$.fragment,t),_(He.$$.fragment,t),_(ge.$$.fragment,t),_(Xe.$$.fragment,t),_(_e.$$.fragment,t),_(Ye.$$.fragment,t),_(Oe.$$.fragment,t),_(Qe.$$.fragment,t),_(Ke.$$.fragment,t),_(et.$$.fragment,t),_(tt.$$.fragment,t),_(nt.$$.fragment,t),_(ot.$$.fragment,t),_(ye.$$.fragment,t),_(rt.$$.fragment,t),_(ve.$$.fragment,t),_(st.$$.fragment,t),_(at.$$.fragment,t),_(it.$$.fragment,t),_(dt.$$.fragment,t),_(lt.$$.fragment,t),_(ct.$$.fragment,t),Jn=!1},d(t){t&&(i(z),i(m),i(T),i(p),i(P),i(Bn),i($e),i(Mn),i(qn),i(d),i(Ln),i(In),i(L),i(Cn),i(Wn),i(X),i(Nn),i(Y),i(jn),i(O),i(Un),i(Fn),i($n)),i(a),k($,t),k(Pe,t),k(Be),k(Me),k(qe),k(Le),k(Ie),k(Ce),k(se),k(We),k(Ne),k(je),k(Ue),k(Fe),k(Je),k(De),k(de),k(Ze),k(le),k(ce),k(Se),k(Ve),k(Ee),k(Re),k(ue),k(Ae),k(Ge),k(He),k(ge),k(Xe),k(_e),k(Ye),k(Oe),k(Qe),k(Ke),k(et),k(tt,t),k(nt),k(ot),k(ye),k(rt),k(ve),k(st),k(at,t),k(it),k(dt),k(lt),k(ct,t)}}}const oa='{"title":"Tokenizers的工具","local":"tokenizers的工具","sections":[{"title":"PreTrainedTokenizerBase","local":"transformers.PreTrainedTokenizerBase","sections":[],"depth":2},{"title":"SpecialTokensMixin","local":"transformers.SpecialTokensMixin","sections":[],"depth":2},{"title":"Enums和namedtuples(命名元组)","local":"transformers.tokenization_utils_base.TruncationStrategy","sections":[],"depth":2}],"depth":1}';function ra(B){return Ss(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ma extends Vs{constructor(a){super(),Es(this,a,ra,na,Zs,{})}}export{ma as component}; | |
Xet Storage Details
- Size:
- 181 kB
- Xet hash:
- c40d6297c789bfe3f523f9804a7b539f2aa8540501385d91d8609be80c179e59
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.