import{S as Bm,i as Om,s as Vm,e as a,k as c,w as y,t as n,M as Am,c as r,d as t,m as h,a as d,x as w,h as s,b as m,G as e,g,y as k,q as v,o as M,B as E,v as Rm,L as pt}from"../../chunks/vendor-hf-doc-builder.js";import{T as kt}from"../../chunks/Tip-hf-doc-builder.js";import{D as J}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ut}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as xe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ht}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Pm(F){let l,T,f,u,b;return u=new ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExFRE1vZGVsJTJDJTIwTEVEQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMExFRCUyMGFsbGVuYWklMkZsZWQtYmFzZS0xNjM4NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBMRURDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMExFRE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LEDModel, LEDConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a LED allenai/led-base-16384 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = LEDConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the allenai/led-base-16384 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LEDModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){l=a("p"),T=n("Example:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Example:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function Xm(F){let l,T,f,u,b;return u=new ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExFRFRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMExFRFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYWxsZW5haSUyRmxlZC1iYXNlLTE2Mzg0JTIyKSUwQXRva2VuaXplciglMjJIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUwQXRva2VuaXplciglMjIlMjBIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LEDTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = LEDTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">31414</span>, <span class="hljs-number">232</span>, <span class="hljs-number">2</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">20920</span>, <span class="hljs-number">232</span>, <span class="hljs-number">2</span>]`}}),{c(){l=a("p"),T=n("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function Qm(F){let l,T,f,u,b;return{c(){l=a("p"),T=n("When used with "),f=a("code"),u=n("is_split_into_words=True"),b=n(", this tokenizer will add a space before each word (even the first one).")},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"When used with "),f=r(p,"CODE",{});var L=d(f);u=s(L,"is_split_into_words=True"),L.forEach(t),b=s(p,", this tokenizer will add a space before each word (even the first one)."),p.forEach(t)},m(i,p){g(i,l,p),e(l,T),e(l,f),e(f,u),e(l,b)},d(i){i&&t(l)}}}function Hm(F){let l,T,f,u,b;return u=new ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExFRFRva2VuaXplckZhc3QlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBMRURUb2tlbml6ZXJGYXN0LmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjIpJTBBdG9rZW5pemVyKCUyMkhlbGxvJTIwd29ybGQlMjIpJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTBBJTBBdG9rZW5pemVyKCUyMiUyMEhlbGxvJTIwd29ybGQlMjIpJTVCJTIyaW5wdXRfaWRzJTIyJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LEDTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = LEDTokenizerFast.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">31414</span>, <span class="hljs-number">232</span>, <span class="hljs-number">2</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">20920</span>, <span class="hljs-number">232</span>, <span class="hljs-number">2</span>]`}}),{c(){l=a("p"),T=n("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function Ym(F){let l,T,f,u,b,i,p,L;return{c(){l=a("p"),T=n("When used with "),f=a("code"),u=n("is_split_into_words=True"),b=n(", this tokenizer needs to be instantiated with "),i=a("code"),p=n("add_prefix_space=True"),L=n(".")},l(K){l=r(K,"P",{});var G=d(l);T=s(G,"When used with "),f=r(G,"CODE",{});var S=d(f);u=s(S,"is_split_into_words=True"),S.forEach(t),b=s(G,", this tokenizer needs to be instantiated with "),i=r(G,"CODE",{});var V=d(i);p=s(V,"add_prefix_space=True"),V.forEach(t),L=s(G,"."),G.forEach(t)},m(K,G){g(K,l,G),e(l,T),e(l,f),e(f,u),e(l,b),e(l,i),e(i,p),e(l,L)},d(K){K&&t(l)}}}function Km(F){let l,T,f,u,b;return{c(){l=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var L=d(f);u=s(L,"Module"),L.forEach(t),b=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(i,p){g(i,l,p),e(l,T),e(l,f),e(f,u),e(l,b)},d(i){i&&t(l)}}}function ef(F){let l,T,f,u,b;return u=new ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMRURNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYWxsZW5haSUyRmxlZC1iYXNlLTE2Mzg0JTIyKSUwQW1vZGVsJTIwJTNEJTIwTEVETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmFsbGVuYWklMkZsZWQtYmFzZS0xNjM4NCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LEDModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LEDModel.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){l=a("p"),T=n("Example:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Example:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function tf(F){let l,T,f,u,b;return{c(){l=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var L=d(f);u=s(L,"Module"),L.forEach(t),b=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(i,p){g(i,l,p),e(l,T),e(l,f),e(f,u),e(l,b)},d(i){i&&t(l)}}}function of(F){let l,T,f,u,b;return u=new ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMRURGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjIpJTBBVFhUJTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwJTNDbWFzayUzRSUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBJTBBbW9kZWwlMjAlM0QlMjBMRURGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmFsbGVuYWklMkZsZWQtYmFzZS0xNjM4NCUyMiklMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCVFhUJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEFwcmVkaWN0aW9uJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzKSU1QjAlNUQlMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3Rpb24lMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LEDForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;My friends are &lt;mask&gt; but they eat too many carbs.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = LEDForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction = model.generate(input_ids)[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(prediction, skip_special_tokens=<span class="hljs-literal">True</span>))`}}),{c(){l=a("p"),T=n("Conditional generation example:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Conditional generation example:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function nf(F){let l,T,f,u,b;return u=new ut({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMExFREZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwTEVERm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGbGVkLWxhcmdlLTE2Mzg0LWFyeGl2JTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmFsbGVuYWklMkZsZWQtbGFyZ2UtMTYzODQtYXJ4aXYlMjIpJTBBJTBBQVJUSUNMRV9UT19TVU1NQVJJWkUlMjAlM0QlMjAnJydUcmFuc2Zvcm1lcnMlMjAoVmFzd2FuaSUyMGV0JTIwYWwuJTJDJTIwMjAxNyklMjBoYXZlJTIwYWNoaWV2ZWQlMjBzdGF0ZS1vZi10aGUtYXJ0JTBBJTIwJTIwJTIwJTIwcmVzdWx0cyUyMGluJTIwYSUyMHdpZGUlMjByYW5nZSUyMG9mJTIwbmF0dXJhbCUyMGxhbmd1YWdlJTIwdGFza3MlMjBpbmNsdWRpbmclMjBnZW5lcmF0aXZlJTIwbGFuZ3VhZ2UlMjBtb2RlbGluZyUwQSUyMCUyMCUyMCUyMChEYWklMjBldCUyMGFsLiUyQyUyMDIwMTklM0IlMjBSYWRmb3JkJTIwZXQlMjBhbC4lMkMlMjAyMDE5KSUyMGFuZCUyMGRpc2NyaW1pbmF0aXZlJTIwLi4uJTIwbGFuZ3VhZ2UlMjB1bmRlcnN0YW5kaW5nJTIwKERldmxpbiUyMGV0JTIwYWwuJTJDJTIwMjAxOSkuJTBBJTIwJTIwJTIwJTIwVGhpcyUyMHN1Y2Nlc3MlMjBpcyUyMHBhcnRseSUyMGR1ZSUyMHRvJTIwdGhlJTIwc2VsZi1hdHRlbnRpb24lMjBjb21wb25lbnQlMjB3aGljaCUyMGVuYWJsZXMlMjB0aGUlMjBuZXR3b3JrJTIwdG8lMjBjYXB0dXJlJTIwY29udGV4dHVhbCUwQSUyMCUyMCUyMCUyMGluZm9ybWF0aW9uJTIwZnJvbSUyMHRoZSUyMGVudGlyZSUyMHNlcXVlbmNlLiUyMFdoaWxlJTIwcG93ZXJmdWwlMkMlMjB0aGUlMjBtZW1vcnklMjBhbmQlMjBjb21wdXRhdGlvbmFsJTIwcmVxdWlyZW1lbnRzJTIwb2YlMEElMjAlMjAlMjAlMjBzZWxmLWF0dGVudGlvbiUyMGdyb3clMjBxdWFkcmF0aWNhbGx5JTIwd2l0aCUyMHNlcXVlbmNlJTIwbGVuZ3RoJTJDJTIwbWFraW5nJTIwaXQlMjBpbmZlYXNpYmxlJTIwKG9yJTIwdmVyeSUyMGV4cGVuc2l2ZSklMjB0byUwQSUyMCUyMCUyMCUyMHByb2Nlc3MlMjBsb25nJTIwc2VxdWVuY2VzLiUyMFRvJTIwYWRkcmVzcyUyMHRoaXMlMjBsaW1pdGF0aW9uJTJDJTIwd2UlMjBwcmVzZW50JTIwTG9uZ2Zvcm1lciUyQyUyMGElMjBtb2RpZmllZCUyMFRyYW5zZm9ybWVyJTBBJTIwJTIwJTIwJTIwYXJjaGl0ZWN0dXJlJTIwd2l0aCUyMGElMjBzZWxmLWF0dGVudGlvbiUyMG9wZXJhdGlvbiUyMHRoYXQlMjBzY2FsZXMlMjBsaW5lYXJseSUyMHdpdGglMjB0aGUlMjBzZXF1ZW5jZSUyMGxlbmd0aCUyQyUyMG1ha2luZyUyMGl0JTBBJTIwJTIwJTIwJTIwdmVyc2F0aWxlJTIwZm9yJTIwcHJvY2Vzc2luZyUyMGxvbmclMjBkb2N1bWVudHMlMjAoRmlnJTIwMSkuJTIwVGhpcyUyMGlzJTIwYW4lMjBhZHZhbnRhZ2UlMjBmb3IlMjBuYXR1cmFsJTIwbGFuZ3VhZ2UlMjB0YXNrcyUyMHN1Y2glMjBhcyUwQSUyMCUyMCUyMCUyMGxvbmclMjBkb2N1bWVudCUyMGNsYXNzaWZpY2F0aW9uJTJDJTIwcXVlc3Rpb24lMjBhbnN3ZXJpbmclMjAoUUEpJTJDJTIwYW5kJTIwY29yZWZlcmVuY2UlMjByZXNvbHV0aW9uJTJDJTIwd2hlcmUlMjBleGlzdGluZyUyMGFwcHJvYWNoZXMlMEElMjAlMjAlMjAlMjBwYXJ0aXRpb24lMjBvciUyMHNob3J0ZW4lMjB0aGUlMjBsb25nJTIwY29udGV4dCUyMGludG8lMjBzbWFsbGVyJTIwc2VxdWVuY2VzJTIwdGhhdCUyMGZhbGwlMjB3aXRoaW4lMjB0aGUlMjB0eXBpY2FsJTIwNTEyJTIwdG9rZW4lMjBsaW1pdCUwQSUyMCUyMCUyMCUyMG9mJTIwQkVSVC1zdHlsZSUyMHByZXRyYWluZWQlMjBtb2RlbHMuJTIwU3VjaCUyMHBhcnRpdGlvbmluZyUyMGNvdWxkJTIwcG90ZW50aWFsbHklMjByZXN1bHQlMjBpbiUyMGxvc3MlMjBvZiUyMGltcG9ydGFudCUwQSUyMCUyMCUyMCUyMGNyb3NzLXBhcnRpdGlvbiUyMGluZm9ybWF0aW9uJTJDJTIwYW5kJTIwdG8lMjBtaXRpZ2F0ZSUyMHRoaXMlMjBwcm9ibGVtJTJDJTIwZXhpc3RpbmclMjBtZXRob2RzJTIwb2Z0ZW4lMjByZWx5JTIwb24lMjBjb21wbGV4JTBBJTIwJTIwJTIwJTIwYXJjaGl0ZWN0dXJlcyUyMHRvJTIwYWRkcmVzcyUyMHN1Y2glMjBpbnRlcmFjdGlvbnMuJTIwT24lMjB0aGUlMjBvdGhlciUyMGhhbmQlMkMlMjBvdXIlMjBwcm9wb3NlZCUyMExvbmdmb3JtZXIlMjBpcyUyMGFibGUlMjB0byUyMGJ1aWxkJTBBJTIwJTIwJTIwJTIwY29udGV4dHVhbCUyMHJlcHJlc2VudGF0aW9ucyUyMG9mJTIwdGhlJTIwZW50aXJlJTIwY29udGV4dCUyMHVzaW5nJTIwbXVsdGlwbGUlMjBsYXllcnMlMjBvZiUyMGF0dGVudGlvbiUyQyUyMHJlZHVjaW5nJTIwdGhlJTIwbmVlZCUyMGZvciUwQSUyMCUyMCUyMCUyMHRhc2stc3BlY2lmaWMlMjBhcmNoaXRlY3R1cmVzLicnJyUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplci5lbmNvZGUoQVJUSUNMRV9UT19TVU1NQVJJWkUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdsb2JhbCUyMGF0dGVudGlvbiUyMG9uJTIwdGhlJTIwZmlyc3QlMjB0b2tlbiUyMChjZi4lMjBCZWx0YWd5JTIwZXQlMjBhbC4lMjAyMDIwKSUwQWdsb2JhbF9hdHRlbnRpb25fbWFzayUyMCUzRCUyMHRvcmNoLnplcm9zX2xpa2UoaW5wdXRzKSUwQWdsb2JhbF9hdHRlbnRpb25fbWFzayU1QiUzQSUyQyUyMDAlNUQlMjAlM0QlMjAxJTBBJTBBJTIzJTIwR2VuZXJhdGUlMjBTdW1tYXJ5JTBBc3VtbWFyeV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMlMkMlMjBnbG9iYWxfYXR0ZW50aW9uX21hc2slM0RnbG9iYWxfYXR0ZW50aW9uX21hc2slMkMlMjBudW1fYmVhbXMlM0QzJTJDJTIwbWF4X2xlbmd0aCUzRDMyKSUwQXByaW50KHRva2VuaXplci5kZWNvZGUoc3VtbWFyeV9pZHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNEVHJ1ZSkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LEDForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = LEDForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;allenai/led-large-16384-arxiv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/led-large-16384-arxiv&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = <span class="hljs-string">&#x27;&#x27;&#x27;Transformers (Vaswani et al., 2017) have achieved state-of-the-art
<span class="hljs-meta">... </span>    results in a wide range of natural language tasks including generative language modeling
<span class="hljs-meta">... </span>    (Dai et al., 2019; Radford et al., 2019) and discriminative ... language understanding (Devlin et al., 2019).
<span class="hljs-meta">... </span>    This success is partly due to the self-attention component which enables the network to capture contextual
<span class="hljs-meta">... </span>    information from the entire sequence. While powerful, the memory and computational requirements of
<span class="hljs-meta">... </span>    self-attention grow quadratically with sequence length, making it infeasible (or very expensive) to
<span class="hljs-meta">... </span>    process long sequences. To address this limitation, we present Longformer, a modified Transformer
<span class="hljs-meta">... </span>    architecture with a self-attention operation that scales linearly with the sequence length, making it
<span class="hljs-meta">... </span>    versatile for processing long documents (Fig 1). This is an advantage for natural language tasks such as
<span class="hljs-meta">... </span>    long document classification, question answering (QA), and coreference resolution, where existing approaches
<span class="hljs-meta">... </span>    partition or shorten the long context into smaller sequences that fall within the typical 512 token limit
<span class="hljs-meta">... </span>    of BERT-style pretrained models. Such partitioning could potentially result in loss of important
<span class="hljs-meta">... </span>    cross-partition information, and to mitigate this problem, existing methods often rely on complex
<span class="hljs-meta">... </span>    architectures to address such interactions. On the other hand, our proposed Longformer is able to build
<span class="hljs-meta">... </span>    contextual representations of the entire context using multiple layers of attention, reducing the need for
<span class="hljs-meta">... </span>    task-specific architectures.&#x27;&#x27;&#x27;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer.encode(ARTICLE_TO_SUMMARIZE, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Global attention on the first token (cf. Beltagy et al. 2020)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>global_attention_mask = torch.zeros_like(inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>global_attention_mask[:, <span class="hljs-number">0</span>] = <span class="hljs-number">1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate Summary</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs, global_attention_mask=global_attention_mask, num_beams=<span class="hljs-number">3</span>, max_length=<span class="hljs-number">32</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(summary_ids[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">True</span>))`}}),{c(){l=a("p"),T=n("Summarization example:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Summarization example:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function sf(F){let l,T,f,u,b;return{c(){l=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var L=d(f);u=s(L,"Module"),L.forEach(t),b=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(i,p){g(i,l,p),e(l,T),e(l,f),e(f,u),e(l,b)},d(i){i&&t(l)}}}function af(F){let l,T,f,u,b;return u=new ut({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMExFREZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjIpJTBBbW9kZWwlMjAlM0QlMjBMRURGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMExFREZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmFsbGVuYWklMkZsZWQtYmFzZS0xNjM4NCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LEDForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LEDForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LEDForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){l=a("p"),T=n("Example of single-label classification:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Example of single-label classification:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function rf(F){let l,T,f,u,b;return u=new ut({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMExFREZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjIpJTBBbW9kZWwlMjAlM0QlMjBMRURGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMExFREZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmFsbGVuYWklMkZsZWQtYmFzZS0xNjM4NCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LEDForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LEDForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LEDForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){l=a("p"),T=n("Example of multi-label classification:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Example of multi-label classification:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function df(F){let l,T,f,u,b;return{c(){l=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var L=d(f);u=s(L,"Module"),L.forEach(t),b=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(i,p){g(i,l,p),e(l,T),e(l,f),e(f,u),e(l,b)},d(i){i&&t(l)}}}function lf(F){let l,T,f,u,b;return u=new ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMRURGb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYWxsZW5haSUyRmxlZC1iYXNlLTE2Mzg0JTIyKSUwQW1vZGVsJTIwJTNEJTIwTEVERm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMmFsbGVuYWklMkZsZWQtYmFzZS0xNjM4NCUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwaW5wdXRzLmlucHV0X2lkcyU1QjAlMkMlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfZW5kX2luZGV4JTIwJTJCJTIwMSU1RCUwQSUwQSUyMyUyMHRhcmdldCUyMGlzJTIwJTIybmljZSUyMHB1cHBldCUyMiUwQXRhcmdldF9zdGFydF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNCU1RCklMEF0YXJnZXRfZW5kX2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LEDForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LEDForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){l=a("p"),T=n("Example:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Example:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function cf(F){let l,T,f,u,b,i,p,L,K,G,S,V,re,z,Be,ee,Oe,je,O,Ve,de,ie,Ae,Je,Q,Re,Ue,H,Ee,Pe,_e,j,N,Ce,D,C,be,le,Xe,Te,W,Qe,te,He,Ye,oe,Ke,et,A,tt,ce,ye,qe,Z,we,R,ot,nt;return{c(){l=a("p"),T=n("TensorFlow models and layers in "),f=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),i=c(),p=a("ul"),L=a("li"),K=n("having all inputs as keyword arguments (like PyTorch models), or"),G=c(),S=a("li"),V=n("having all inputs as a list, tuple or dict in the first positional argument."),re=c(),z=a("p"),Be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),ee=a("code"),Oe=n("model.fit()"),je=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),O=a("code"),Ve=n("model.fit()"),de=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=a("code"),Ae=n("fit()"),Je=n(" and "),Q=a("code"),Re=n("predict()"),Ue=n(`, such as when creating your own layers or models with
the Keras `),H=a("code"),Ee=n("Functional"),Pe=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),_e=c(),j=a("ul"),N=a("li"),Ce=n("a single Tensor with "),D=a("code"),C=n("input_ids"),be=n(" only and nothing else: "),le=a("code"),Xe=n("model(input_ids)"),Te=c(),W=a("li"),Qe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=a("code"),He=n("model([input_ids, attention_mask])"),Ye=n(" or "),oe=a("code"),Ke=n("model([input_ids, attention_mask, token_type_ids])"),et=c(),A=a("li"),tt=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ce=a("code"),ye=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe=c(),Z=a("p"),we=n(`Note that when creating models and layers with
`),R=a("a"),ot=n("subclassing"),nt=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(q){l=r(q,"P",{});var $=d(l);T=s($,"TensorFlow models and layers in "),f=r($,"CODE",{});var st=d(f);u=s(st,"transformers"),st.forEach(t),b=s($," accept two formats as input:"),$.forEach(t),i=h(q),p=r(q,"UL",{});var Fe=d(p);L=r(Fe,"LI",{});var vt=d(L);K=s(vt,"having all inputs as keyword arguments (like PyTorch models), or"),vt.forEach(t),G=h(Fe),S=r(Fe,"LI",{});var at=d(S);V=s(at,"having all inputs as a list, tuple or dict in the first positional argument."),at.forEach(t),Fe.forEach(t),re=h(q),z=r(q,"P",{});var x=d(z);Be=s(x,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),ee=r(x,"CODE",{});var Mt=d(ee);Oe=s(Mt,"model.fit()"),Mt.forEach(t),je=s(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),O=r(x,"CODE",{});var Et=d(O);Ve=s(Et,"model.fit()"),Et.forEach(t),de=s(x,` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=r(x,"CODE",{});var P=d(ie);Ae=s(P,"fit()"),P.forEach(t),Je=s(x," and "),Q=r(x,"CODE",{});var qt=d(Q);Re=s(qt,"predict()"),qt.forEach(t),Ue=s(x,`, such as when creating your own layers or models with
the Keras `),H=r(x,"CODE",{});var rt=d(H);Ee=s(rt,"Functional"),rt.forEach(t),Pe=s(x,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),x.forEach(t),_e=h(q),j=r(q,"UL",{});var ne=d(j);N=r(ne,"LI",{});var he=d(N);Ce=s(he,"a single Tensor with "),D=r(he,"CODE",{});var dt=d(D);C=s(dt,"input_ids"),dt.forEach(t),be=s(he," only and nothing else: "),le=r(he,"CODE",{});var Ft=d(le);Xe=s(Ft,"model(input_ids)"),Ft.forEach(t),he.forEach(t),Te=h(ne),W=r(ne,"LI",{});var pe=d(W);Qe=s(pe,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=r(pe,"CODE",{});var Se=d(te);He=s(Se,"model([input_ids, attention_mask])"),Se.forEach(t),Ye=s(pe," or "),oe=r(pe,"CODE",{});var Lt=d(oe);Ke=s(Lt,"model([input_ids, attention_mask, token_type_ids])"),Lt.forEach(t),pe.forEach(t),et=h(ne),A=r(ne,"LI",{});var it=d(A);tt=s(it,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ce=r(it,"CODE",{});var lt=d(ce);ye=s(lt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),lt.forEach(t),it.forEach(t),ne.forEach(t),qe=h(q),Z=r(q,"P",{});var Le=d(Z);we=s(Le,`Note that when creating models and layers with
`),R=r(Le,"A",{href:!0,rel:!0});var zt=d(R);ot=s(zt,"subclassing"),zt.forEach(t),nt=s(Le,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Le.forEach(t),this.h()},h(){m(R,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(R,"rel","nofollow")},m(q,$){g(q,l,$),e(l,T),e(l,f),e(f,u),e(l,b),g(q,i,$),g(q,p,$),e(p,L),e(L,K),e(p,G),e(p,S),e(S,V),g(q,re,$),g(q,z,$),e(z,Be),e(z,ee),e(ee,Oe),e(z,je),e(z,O),e(O,Ve),e(z,de),e(z,ie),e(ie,Ae),e(z,Je),e(z,Q),e(Q,Re),e(z,Ue),e(z,H),e(H,Ee),e(z,Pe),g(q,_e,$),g(q,j,$),e(j,N),e(N,Ce),e(N,D),e(D,C),e(N,be),e(N,le),e(le,Xe),e(j,Te),e(j,W),e(W,Qe),e(W,te),e(te,He),e(W,Ye),e(W,oe),e(oe,Ke),e(j,et),e(j,A),e(A,tt),e(A,ce),e(ce,ye),g(q,qe,$),g(q,Z,$),e(Z,we),e(Z,R),e(R,ot),e(Z,nt)},d(q){q&&t(l),q&&t(i),q&&t(p),q&&t(re),q&&t(z),q&&t(_e),q&&t(j),q&&t(qe),q&&t(Z)}}}function hf(F){let l,T,f,u,b;return{c(){l=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var L=d(f);u=s(L,"Module"),L.forEach(t),b=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(i,p){g(i,l,p),e(l,T),e(l,f),e(f,u),e(l,b)},d(i){i&&t(l)}}}function pf(F){let l,T,f,u,b;return u=new ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkxFRE1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkxFRE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFLEDModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFLEDModel.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){l=a("p"),T=n("Example:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Example:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function uf(F){let l,T,f,u,b,i,p,L,K,G,S,V,re,z,Be,ee,Oe,je,O,Ve,de,ie,Ae,Je,Q,Re,Ue,H,Ee,Pe,_e,j,N,Ce,D,C,be,le,Xe,Te,W,Qe,te,He,Ye,oe,Ke,et,A,tt,ce,ye,qe,Z,we,R,ot,nt;return{c(){l=a("p"),T=n("TensorFlow models and layers in "),f=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),i=c(),p=a("ul"),L=a("li"),K=n("having all inputs as keyword arguments (like PyTorch models), or"),G=c(),S=a("li"),V=n("having all inputs as a list, tuple or dict in the first positional argument."),re=c(),z=a("p"),Be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),ee=a("code"),Oe=n("model.fit()"),je=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),O=a("code"),Ve=n("model.fit()"),de=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=a("code"),Ae=n("fit()"),Je=n(" and "),Q=a("code"),Re=n("predict()"),Ue=n(`, such as when creating your own layers or models with
the Keras `),H=a("code"),Ee=n("Functional"),Pe=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),_e=c(),j=a("ul"),N=a("li"),Ce=n("a single Tensor with "),D=a("code"),C=n("input_ids"),be=n(" only and nothing else: "),le=a("code"),Xe=n("model(input_ids)"),Te=c(),W=a("li"),Qe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=a("code"),He=n("model([input_ids, attention_mask])"),Ye=n(" or "),oe=a("code"),Ke=n("model([input_ids, attention_mask, token_type_ids])"),et=c(),A=a("li"),tt=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ce=a("code"),ye=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),qe=c(),Z=a("p"),we=n(`Note that when creating models and layers with
`),R=a("a"),ot=n("subclassing"),nt=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(q){l=r(q,"P",{});var $=d(l);T=s($,"TensorFlow models and layers in "),f=r($,"CODE",{});var st=d(f);u=s(st,"transformers"),st.forEach(t),b=s($," accept two formats as input:"),$.forEach(t),i=h(q),p=r(q,"UL",{});var Fe=d(p);L=r(Fe,"LI",{});var vt=d(L);K=s(vt,"having all inputs as keyword arguments (like PyTorch models), or"),vt.forEach(t),G=h(Fe),S=r(Fe,"LI",{});var at=d(S);V=s(at,"having all inputs as a list, tuple or dict in the first positional argument."),at.forEach(t),Fe.forEach(t),re=h(q),z=r(q,"P",{});var x=d(z);Be=s(x,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),ee=r(x,"CODE",{});var Mt=d(ee);Oe=s(Mt,"model.fit()"),Mt.forEach(t),je=s(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),O=r(x,"CODE",{});var Et=d(O);Ve=s(Et,"model.fit()"),Et.forEach(t),de=s(x,` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=r(x,"CODE",{});var P=d(ie);Ae=s(P,"fit()"),P.forEach(t),Je=s(x," and "),Q=r(x,"CODE",{});var qt=d(Q);Re=s(qt,"predict()"),qt.forEach(t),Ue=s(x,`, such as when creating your own layers or models with
the Keras `),H=r(x,"CODE",{});var rt=d(H);Ee=s(rt,"Functional"),rt.forEach(t),Pe=s(x,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),x.forEach(t),_e=h(q),j=r(q,"UL",{});var ne=d(j);N=r(ne,"LI",{});var he=d(N);Ce=s(he,"a single Tensor with "),D=r(he,"CODE",{});var dt=d(D);C=s(dt,"input_ids"),dt.forEach(t),be=s(he," only and nothing else: "),le=r(he,"CODE",{});var Ft=d(le);Xe=s(Ft,"model(input_ids)"),Ft.forEach(t),he.forEach(t),Te=h(ne),W=r(ne,"LI",{});var pe=d(W);Qe=s(pe,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=r(pe,"CODE",{});var Se=d(te);He=s(Se,"model([input_ids, attention_mask])"),Se.forEach(t),Ye=s(pe," or "),oe=r(pe,"CODE",{});var Lt=d(oe);Ke=s(Lt,"model([input_ids, attention_mask, token_type_ids])"),Lt.forEach(t),pe.forEach(t),et=h(ne),A=r(ne,"LI",{});var it=d(A);tt=s(it,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ce=r(it,"CODE",{});var lt=d(ce);ye=s(lt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),lt.forEach(t),it.forEach(t),ne.forEach(t),qe=h(q),Z=r(q,"P",{});var Le=d(Z);we=s(Le,`Note that when creating models and layers with
`),R=r(Le,"A",{href:!0,rel:!0});var zt=d(R);ot=s(zt,"subclassing"),zt.forEach(t),nt=s(Le,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Le.forEach(t),this.h()},h(){m(R,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(R,"rel","nofollow")},m(q,$){g(q,l,$),e(l,T),e(l,f),e(f,u),e(l,b),g(q,i,$),g(q,p,$),e(p,L),e(L,K),e(p,G),e(p,S),e(S,V),g(q,re,$),g(q,z,$),e(z,Be),e(z,ee),e(ee,Oe),e(z,je),e(z,O),e(O,Ve),e(z,de),e(z,ie),e(ie,Ae),e(z,Je),e(z,Q),e(Q,Re),e(z,Ue),e(z,H),e(H,Ee),e(z,Pe),g(q,_e,$),g(q,j,$),e(j,N),e(N,Ce),e(N,D),e(D,C),e(N,be),e(N,le),e(le,Xe),e(j,Te),e(j,W),e(W,Qe),e(W,te),e(te,He),e(W,Ye),e(W,oe),e(oe,Ke),e(j,et),e(j,A),e(A,tt),e(A,ce),e(ce,ye),g(q,qe,$),g(q,Z,$),e(Z,we),e(Z,R),e(R,ot),e(Z,nt)},d(q){q&&t(l),q&&t(i),q&&t(p),q&&t(re),q&&t(z),q&&t(_e),q&&t(j),q&&t(qe),q&&t(Z)}}}function mf(F){let l,T,f,u,b;return{c(){l=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),u=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var L=d(f);u=s(L,"Module"),L.forEach(t),b=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(i,p){g(i,l,p),e(l,T),e(l,f),e(f,u),e(l,b)},d(i){i&&t(l)}}}function ff(F){let l,T,f,u,b;return u=new ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkxFREZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBbW5hbWUlMjAlM0QlMjAlMjJhbGxlbmFpJTJGbGVkLWJhc2UtMTYzODQlMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtbmFtZSklMEFUWFQlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjAlM0NtYXNrJTNFJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFtb2RlbCUyMCUzRCUyMFRGTEVERm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZChtbmFtZSklMEFiYXRjaCUyMCUzRCUyMHRva2VuaXplciglNUJUWFQlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyUzRGJhdGNoLmlucHV0X2lkcykubG9naXRzJTBBcHJvYnMlMjAlM0QlMjB0Zi5ubi5zb2Z0bWF4KGxvZ2l0cyU1QjAlNUQpJTBBJTIzJTIwcHJvYnMlNUI1JTVEJTIwaXMlMjBhc3NvY2lhdGVkJTIwd2l0aCUyMHRoZSUyMG1hc2slMjB0b2tlbg==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFLEDForConditionalGeneration
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>mname = <span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(mname)
<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;My friends are &lt;mask&gt; but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFLEDForConditionalGeneration.from_pretrained(mname)
<span class="hljs-meta">&gt;&gt;&gt; </span>batch = tokenizer([TXT], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(inputs=batch.input_ids).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = tf.nn.softmax(logits[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># probs[5] is associated with the mask token</span>`}}),{c(){l=a("p"),T=n("Examples:"),f=c(),y(u.$$.fragment)},l(i){l=r(i,"P",{});var p=d(l);T=s(p,"Examples:"),p.forEach(t),f=h(i),w(u.$$.fragment,i)},m(i,p){g(i,l,p),e(l,T),g(i,f,p),k(u,i,p),b=!0},p:pt,i(i){b||(v(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(l),i&&t(f),E(u,i)}}}function gf(F){let l,T,f,u,b,i,p,L,K,G,S,V,re,z,Be,ee,Oe,je,O,Ve,de,ie,Ae,Je,Q,Re,Ue,H,Ee,Pe,_e,j,N,Ce,D,C,be,le,Xe,Te,W,Qe,te,He,Ye,oe,Ke,et,A,tt,ce,ye,qe,Z,we,R,ot,nt,q,$,st,Fe,vt,at,x,Mt,Et,P,qt,rt,ne,he,dt,Ft,pe,Se,Lt,it,lt,Le,zt,Vd,se,Ad,Ys,Rd,Pd,Ks,Xd,Qd,gs,Hd,Yd,ea,Kd,ei,ta,ti,oi,oa,ni,si,ai,ct,ri,na,di,ii,sa,li,ci,aa,hi,pi,ui,Qo,mi,Ho,fi,gi,_i,Yo,bi,Ko,Ti,yi,wi,ra,ki,Mr,so,vi,en,Mi,Ei,Er,$t,ao,da,tn,qi,ia,Fi,qr,Ie,la,_s,Li,zi,ca,bs,$i,Di,ha,Ts,xi,ji,pa,ys,Ji,Fr,Dt,ro,ua,on,Ui,ma,Ci,Lr,ze,nn,Si,xt,Ii,ws,Gi,Ni,sn,Wi,Zi,Bi,jt,Oi,ks,Vi,Ai,vs,Ri,Pi,Xi,io,zr,Jt,lo,fa,an,Qi,ga,Hi,$r,U,rn,Yi,_a,Ki,el,ba,tl,ol,co,nl,dn,sl,Ta,al,rl,dl,ho,il,ln,ll,Ms,cl,hl,pl,mt,cn,ul,ya,ml,fl,hn,Es,gl,wa,_l,bl,qs,Tl,ka,yl,wl,po,pn,kl,un,vl,va,Ml,El,ql,uo,mn,Fl,Ma,Ll,zl,Fs,fn,Dr,Ut,mo,Ea,gn,$l,qa,Dl,xr,B,_n,xl,bn,jl,Fa,Jl,Ul,Cl,La,Sl,Il,fo,Gl,Tn,Nl,za,Wl,Zl,Bl,go,Ol,yn,Vl,Ls,Al,Rl,Pl,_o,wn,Xl,$a,Ql,jr,Ct,bo,Da,kn,Hl,xa,Yl,Jr,St,vn,Kl,ja,ec,Ur,It,Mn,tc,Ja,oc,Cr,Gt,En,nc,Ua,sc,Sr,Nt,qn,ac,Ca,rc,Ir,Wt,Fn,dc,Sa,ic,Gr,Zt,Ln,lc,Ia,cc,Nr,Bt,zn,hc,Ga,pc,Wr,Ot,$n,uc,Na,mc,Zr,Vt,To,Wa,Dn,fc,Za,gc,Br,$e,xn,_c,jn,bc,zs,Tc,yc,wc,Jn,kc,Un,vc,Mc,Ec,Ge,Cn,qc,At,Fc,$s,Lc,zc,Ba,$c,Dc,xc,yo,jc,wo,Or,Rt,ko,Oa,Sn,Jc,Va,Uc,Vr,De,In,Cc,Gn,Sc,Ds,Ic,Gc,Nc,Nn,Wc,Wn,Zc,Bc,Oc,ke,Zn,Vc,Pt,Ac,xs,Rc,Pc,Aa,Xc,Qc,Hc,vo,Yc,Mo,Kc,Eo,Ar,Xt,qo,Ra,Bn,eh,Pa,th,Rr,ue,On,oh,Xa,nh,sh,Vn,ah,js,rh,dh,ih,An,lh,Rn,ch,hh,ph,ve,Pn,uh,Qt,mh,Js,fh,gh,Qa,_h,bh,Th,Fo,yh,Lo,wh,zo,Pr,Ht,$o,Ha,Xn,kh,Ya,vh,Xr,me,Qn,Mh,Yt,Eh,Ka,qh,Fh,er,Lh,zh,$h,Hn,Dh,Us,xh,jh,Jh,Yn,Uh,Kn,Ch,Sh,Ih,Ne,es,Gh,Kt,Nh,Cs,Wh,Zh,tr,Bh,Oh,Vh,Do,Ah,xo,Qr,eo,jo,or,ts,Rh,nr,Ph,Hr,fe,os,Xh,ns,Qh,Ss,Hh,Yh,Kh,ss,ep,as,tp,op,np,Jo,sp,We,rs,ap,to,rp,Is,dp,ip,sr,lp,cp,hp,Uo,pp,Co,Yr,oo,So,ar,ds,up,rr,mp,Kr,ge,is,fp,ls,gp,Gs,_p,bp,Tp,cs,yp,hs,wp,kp,vp,Io,Mp,Ze,ps,Ep,no,qp,Ns,Fp,Lp,dr,zp,$p,Dp,Go,xp,No,ed;return i=new xe({}),z=new xe({}),tn=new xe({}),on=new xe({}),nn=new J({props:{name:"class transformers.LEDConfig",anchor:"transformers.LEDConfig",parameters:[{name:"vocab_size",val:" = 50265"},{name:"max_encoder_position_embeddings",val:" = 16384"},{name:"max_decoder_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 12"},{name:"encoder_ffn_dim",val:" = 4096"},{name:"encoder_attention_heads",val:" = 16"},{name:"decoder_layers",val:" = 12"},{name:"decoder_ffn_dim",val:" = 4096"},{name:"decoder_attention_heads",val:" = 16"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"use_cache",val:" = True"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'gelu'"},{name:"d_model",val:" = 1024"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"decoder_start_token_id",val:" = 2"},{name:"classifier_dropout",val:" = 0.0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"attention_window",val:": typing.Union[typing.List[int], int] = 512"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LEDConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the LED model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/led#transformers.LEDModel">LEDModel</a> or <a href="/docs/transformers/main/en/model_doc/led#transformers.TFLEDModel">TFLEDModel</a>.`,name:"vocab_size"},{anchor:"transformers.LEDConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.LEDConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.LEDConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.LEDConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.LEDConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.LEDConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.LEDConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.LEDConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.LEDConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.LEDConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.LEDConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.LEDConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for classifier.`,name:"classifier_dropout"},{anchor:"transformers.LEDConfig.max_encoder_position_embeddings",description:`<strong>max_encoder_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 16384) &#x2014;
The maximum sequence length that the encoder might ever be used with.`,name:"max_encoder_position_embeddings"},{anchor:"transformers.LEDConfig.max_decoder_position_embeddings",description:`<strong>max_decoder_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 16384) &#x2014;
The maximum sequence length that the decoder might ever be used with.`,name:"max_decoder_position_embeddings"},{anchor:"transformers.LEDConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.LEDConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.LEDConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.LEDConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models)`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/configuration_led.py#L31"}}),io=new ht({props:{anchor:"transformers.LEDConfig.example",$$slots:{default:[Pm]},$$scope:{ctx:F}}}),an=new xe({}),rn=new J({props:{name:"class transformers.LEDTokenizer",anchor:"transformers.LEDTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"errors",val:" = 'replace'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"add_prefix_space",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LEDTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.LEDTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.LEDTokenizer.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.LEDTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.LEDTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.LEDTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.LEDTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.LEDTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LEDTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.LEDTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.LEDTokenizer.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (BART tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/tokenization_led.py#L93"}}),co=new ht({props:{anchor:"transformers.LEDTokenizer.example",$$slots:{default:[Xm]},$$scope:{ctx:F}}}),ho=new kt({props:{$$slots:{default:[Qm]},$$scope:{ctx:F}}}),cn=new J({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LEDTokenizer.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.LEDTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.LEDTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/tokenization_led.py#L342",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),pn=new J({props:{name:"get_special_tokens_mask",anchor:"transformers.LEDTokenizer.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.LEDTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LEDTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.LEDTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/tokenization_led.py#L368",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),mn=new J({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LEDTokenizer.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.LEDTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LEDTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/tokenization_led.py#L396",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),fn=new J({props:{name:"save_vocabulary",anchor:"transformers.LEDTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/tokenization_led.py#L312"}}),gn=new xe({}),_n=new J({props:{name:"class transformers.LEDTokenizerFast",anchor:"transformers.LEDTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"errors",val:" = 'replace'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"add_prefix_space",val:" = False"},{name:"trim_offsets",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LEDTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.LEDTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.LEDTokenizerFast.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.LEDTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.LEDTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.LEDTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.LEDTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.LEDTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LEDTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.LEDTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.LEDTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (LED tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"},{anchor:"transformers.LEDTokenizerFast.trim_offsets",description:`<strong>trim_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the post processing step should trim offsets to avoid including whitespaces.`,name:"trim_offsets"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/tokenization_led_fast.py#L50"}}),fo=new ht({props:{anchor:"transformers.LEDTokenizerFast.example",$$slots:{default:[Hm]},$$scope:{ctx:F}}}),go=new kt({props:{$$slots:{default:[Ym]},$$scope:{ctx:F}}}),wn=new J({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LEDTokenizerFast.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.LEDTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LEDTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/tokenization_led_fast.py#L273",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),kn=new xe({}),vn=new J({props:{name:"class transformers.models.led.modeling_led.LEDEncoderBaseModelOutput",anchor:"transformers.models.led.modeling_led.LEDEncoderBaseModelOutput",parameters:[{name:"last_hidden_state",val:": FloatTensor"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"global_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.led.modeling_led.LEDEncoderBaseModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.led.modeling_led.LEDEncoderBaseModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.led.modeling_led.LEDEncoderBaseModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x + attention_window + 1)</code>, where <code>x</code> is the number of tokens with global attention mask.</p>
<p>Local attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token in the sequence to every token with
global attention (first <code>x</code> values) and to every token in the attention window (remaining \`attention_window</p>
<ul>
<li>1<code>values). Note that the first</code>x<code>values refer to tokens with fixed positions in the text, but the remaining</code>attention_window + 1<code>values refer to tokens with relative positions: the attention weight of a token to itself is located at index</code>x + attention_window / 2<code>and the</code>attention_window / 2<code>preceding (succeeding) values are the attention weights to the</code>attention_window / 2<code>preceding (succeeding) tokens. If the attention window contains a token with global attention, the attention weight at the corresponding index is set to 0; the value should be accessed from the first</code>x<code>attention weights. If a token has global attention, the attention weights to all other tokens in</code>attentions<code>is set to 0, the values should be accessed from</code>global_attentions\`.</li>
</ul>`,name:"attentions"},{anchor:"transformers.models.led.modeling_led.LEDEncoderBaseModelOutput.global_attentions",description:`<strong>global_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>,
where <code>x</code> is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.`,name:"global_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L1175"}}),Mn=new J({props:{name:"class transformers.models.led.modeling_led.LEDSeq2SeqModelOutput",anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput",parameters:[{name:"last_hidden_state",val:": FloatTensor = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_global_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.`,name:"last_hidden_state"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"decoder_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.`,name:"cross_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"encoder_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqModelOutput.encoder_global_attentions",description:`<strong>encoder_global_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>,
where <code>x</code> is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.`,name:"encoder_global_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L1218"}}),En=new J({props:{name:"class transformers.models.led.modeling_led.LEDSeq2SeqLMOutput",anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_global_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling loss.`,name:"loss"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"logits"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"decoder_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.`,name:"cross_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"encoder_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqLMOutput.encoder_global_attentions",description:`<strong>encoder_global_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>,
where <code>x</code> is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.`,name:"encoder_global_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L1286"}}),qn=new J({props:{name:"class transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput",anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_global_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) &#x2014;
Classification (or regression if config.num_labels==1) loss.`,name:"loss"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) &#x2014;
Classification (or regression if config.num_labels==1) scores (before SoftMax).`,name:"logits"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"decoder_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.`,name:"cross_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"encoder_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqSequenceClassifierOutput.encoder_global_attentions",description:`<strong>encoder_global_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>,
where <code>x</code> is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.`,name:"encoder_global_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L1353"}}),Fn=new J({props:{name:"class transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput",anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_logits",val:": FloatTensor = None"},{name:"end_logits",val:": FloatTensor = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_global_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.`,name:"loss"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.start_logits",description:`<strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Span-start scores (before SoftMax).`,name:"start_logits"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.end_logits",description:`<strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Span-end scores (before SoftMax).`,name:"end_logits"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>torch.FloatTensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"decoder_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.`,name:"cross_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"encoder_attentions"},{anchor:"transformers.models.led.modeling_led.LEDSeq2SeqQuestionAnsweringModelOutput.encoder_global_attentions",description:`<strong>encoder_global_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>,
where <code>x</code> is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.`,name:"encoder_global_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L1420"}}),Ln=new J({props:{name:"class transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput",anchor:"transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput",parameters:[{name:"last_hidden_state",val:": tf.Tensor = None"},{name:"hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"global_attentions",val:": Tuple[tf.Tensor] | None = None"}],parametersDescription:[{anchor:"transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x + attention_window + 1)</code>, where <code>x</code> is the number of tokens with global attention mask.</p>
<p>Local attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token in the sequence to every token with
global attention (first <code>x</code> values) and to every token in the attention window (remaining \`attention_window</p>
<ul>
<li>1<code>values). Note that the first</code>x<code>values refer to tokens with fixed positions in the text, but the remaining</code>attention_window + 1<code>values refer to tokens with relative positions: the attention weight of a token to itself is located at index</code>x + attention_window / 2<code>and the</code>attention_window / 2<code>preceding (succeeding) values are the attention weights to the</code>attention_window / 2<code>preceding (succeeding) tokens. If the attention window contains a token with global attention, the attention weight at the corresponding index is set to 0; the value should be accessed from the first</code>x<code>attention weights. If a token has global attention, the attention weights to all other tokens in</code>attentions<code>is set to 0, the values should be accessed from</code>global_attentions\`.</li>
</ul>`,name:"attentions"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput.global_attentions",description:`<strong>global_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>, where <code>x</code>
is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.`,name:"global_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_tf_led.py#L1340"}}),zn=new J({props:{name:"class transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput",anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput",parameters:[{name:"last_hidden_state",val:": tf.Tensor = None"},{name:"past_key_values",val:": List[tf.Tensor] | None = None"},{name:"decoder_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"decoder_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"cross_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"encoder_last_hidden_state",val:": tf.Tensor | None = None"},{name:"encoder_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"encoder_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"encoder_global_attentions",val:": Tuple[tf.Tensor] | None = None"}],parametersDescription:[{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.`,name:"last_hidden_state"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"decoder_attentions"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.`,name:"cross_attentions"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"encoder_attentions"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput.encoder_global_attentions",description:`<strong>encoder_global_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>, where <code>x</code>
is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.`,name:"encoder_global_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_tf_led.py#L1383"}}),$n=new J({props:{name:"class transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput",anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput",parameters:[{name:"loss",val:": tf.Tensor | None = None"},{name:"logits",val:": tf.Tensor = None"},{name:"past_key_values",val:": List[tf.Tensor] | None = None"},{name:"decoder_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"decoder_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"cross_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"encoder_last_hidden_state",val:": tf.Tensor | None = None"},{name:"encoder_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"encoder_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"encoder_global_attentions",val:": Tuple[tf.Tensor] | None = None"}],parametersDescription:[{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.loss",description:`<strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling loss.`,name:"loss"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.logits",description:`<strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"logits"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.past_key_values",description:`<strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.`,name:"past_key_values"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.`,name:"decoder_hidden_states"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"decoder_attentions"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder&#x2019;s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.`,name:"cross_attentions"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.encoder_last_hidden_state",description:`<strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder of the model.`,name:"encoder_last_hidden_state"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.`,name:"encoder_hidden_states"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.`,name:"encoder_attentions"},{anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput.encoder_global_attentions",description:`<strong>encoder_global_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>, where <code>x</code>
is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.`,name:"encoder_global_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_tf_led.py#L1451"}}),Dn=new xe({}),xn=new J({props:{name:"class transformers.LEDModel",anchor:"transformers.LEDModel",parameters:[{name:"config",val:": LEDConfig"}],parametersDescription:[{anchor:"transformers.LEDModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig">LEDConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L2211"}}),Cn=new J({props:{name:"forward",anchor:"transformers.LEDModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"global_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LEDModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LEDModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LEDModel.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>LedTokenizer</code>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>LED uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.LEDModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read <code>modeling_led._prepare_decoder_inputs</code> and modify
to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more information on the
default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.LEDModel.forward.global_attention_mask",description:`<strong>global_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to decide the attention given on each token, local attention or global attention for the encoder.
Tokens with global attention attends to all other tokens, and all other tokens attend to them. This is
important for task-specific finetuning because it makes the model more flexible at representing the task.
For example, for classification, the <s> token should be given global attention. For QA, all question
tokens should also have global attention. Please refer to the <a href="https://arxiv.org/abs/2004.05150" rel="nofollow">Longformer
paper</a> for more details. Mask values selected in <code>[0, 1]</code>:</s></p>
<ul>
<li>0 for local attention (a sliding window attention),</li>
<li>1 for global attention (tokens that attend to all other tokens, and all other tokens attend to them).</li>
</ul>`,name:"global_attention_mask"},{anchor:"transformers.LEDModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LEDModel.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.LEDModel.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.LEDModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.LEDModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LEDModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LEDModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.LEDModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LEDModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LEDModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LEDModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L2240",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig"
>LEDConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yo=new kt({props:{$$slots:{default:[Km]},$$scope:{ctx:F}}}),wo=new ht({props:{anchor:"transformers.LEDModel.forward.example",$$slots:{default:[ef]},$$scope:{ctx:F}}}),Sn=new xe({}),In=new J({props:{name:"class transformers.LEDForConditionalGeneration",anchor:"transformers.LEDForConditionalGeneration",parameters:[{name:"config",val:": LEDConfig"}],parametersDescription:[{anchor:"transformers.LEDForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig">LEDConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L2335"}}),Zn=new J({props:{name:"forward",anchor:"transformers.LEDForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"global_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LEDForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LEDForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LEDForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>LedTokenizer</code>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>LED uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.LEDForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read <code>modeling_led._prepare_decoder_inputs</code> and modify
to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more information on the
default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.LEDForConditionalGeneration.forward.global_attention_mask",description:`<strong>global_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to decide the attention given on each token, local attention or global attention for the encoder.
Tokens with global attention attends to all other tokens, and all other tokens attend to them. This is
important for task-specific finetuning because it makes the model more flexible at representing the task.
For example, for classification, the <s> token should be given global attention. For QA, all question
tokens should also have global attention. Please refer to the <a href="https://arxiv.org/abs/2004.05150" rel="nofollow">Longformer
paper</a> for more details. Mask values selected in <code>[0, 1]</code>:</s></p>
<ul>
<li>0 for local attention (a sliding window attention),</li>
<li>1 for global attention (tokens that attend to all other tokens, and all other tokens attend to them).</li>
</ul>`,name:"global_attention_mask"},{anchor:"transformers.LEDForConditionalGeneration.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LEDForConditionalGeneration.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.LEDForConditionalGeneration.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.LEDForConditionalGeneration.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.LEDForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LEDForConditionalGeneration.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LEDForConditionalGeneration.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.LEDForConditionalGeneration.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LEDForConditionalGeneration.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LEDForConditionalGeneration.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LEDForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LEDForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L2375",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig"
>LEDConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),vo=new kt({props:{$$slots:{default:[tf]},$$scope:{ctx:F}}}),Mo=new ht({props:{anchor:"transformers.LEDForConditionalGeneration.forward.example",$$slots:{default:[of]},$$scope:{ctx:F}}}),Eo=new ht({props:{anchor:"transformers.LEDForConditionalGeneration.forward.example-2",$$slots:{default:[nf]},$$scope:{ctx:F}}}),Bn=new xe({}),On=new J({props:{name:"class transformers.LEDForSequenceClassification",anchor:"transformers.LEDForSequenceClassification",parameters:[{name:"config",val:": LEDConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LEDForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig">LEDConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L2525"}}),Pn=new J({props:{name:"forward",anchor:"transformers.LEDForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"global_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LEDForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LEDForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LEDForSequenceClassification.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>LedTokenizer</code>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>LED uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.LEDForSequenceClassification.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read <code>modeling_led._prepare_decoder_inputs</code> and modify
to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more information on the
default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.LEDForSequenceClassification.forward.global_attention_mask",description:`<strong>global_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to decide the attention given on each token, local attention or global attention for the encoder.
Tokens with global attention attends to all other tokens, and all other tokens attend to them. This is
important for task-specific finetuning because it makes the model more flexible at representing the task.
For example, for classification, the <s> token should be given global attention. For QA, all question
tokens should also have global attention. Please refer to the <a href="https://arxiv.org/abs/2004.05150" rel="nofollow">Longformer
paper</a> for more details. Mask values selected in <code>[0, 1]</code>:</s></p>
<ul>
<li>0 for local attention (a sliding window attention),</li>
<li>1 for global attention (tokens that attend to all other tokens, and all other tokens attend to them).</li>
</ul>`,name:"global_attention_mask"},{anchor:"transformers.LEDForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LEDForSequenceClassification.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.LEDForSequenceClassification.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.LEDForSequenceClassification.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.LEDForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LEDForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LEDForSequenceClassification.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.LEDForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LEDForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LEDForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LEDForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LEDForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L2547",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig"
>LEDConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fo=new kt({props:{$$slots:{default:[sf]},$$scope:{ctx:F}}}),Lo=new ht({props:{anchor:"transformers.LEDForSequenceClassification.forward.example",$$slots:{default:[af]},$$scope:{ctx:F}}}),zo=new ht({props:{anchor:"transformers.LEDForSequenceClassification.forward.example-2",$$slots:{default:[rf]},$$scope:{ctx:F}}}),Xn=new xe({}),Qn=new J({props:{name:"class transformers.LEDForQuestionAnswering",anchor:"transformers.LEDForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LEDForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig">LEDConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L2661"}}),es=new J({props:{name:"forward",anchor:"transformers.LEDForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"global_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LEDForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LEDForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LEDForQuestionAnswering.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>LedTokenizer</code>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>LED uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.LEDForQuestionAnswering.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read <code>modeling_led._prepare_decoder_inputs</code> and modify
to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more information on the
default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.LEDForQuestionAnswering.forward.global_attention_mask",description:`<strong>global_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to decide the attention given on each token, local attention or global attention for the encoder.
Tokens with global attention attends to all other tokens, and all other tokens attend to them. This is
important for task-specific finetuning because it makes the model more flexible at representing the task.
For example, for classification, the <s> token should be given global attention. For QA, all question
tokens should also have global attention. Please refer to the <a href="https://arxiv.org/abs/2004.05150" rel="nofollow">Longformer
paper</a> for more details. Mask values selected in <code>[0, 1]</code>:</s></p>
<ul>
<li>0 for local attention (a sliding window attention),</li>
<li>1 for global attention (tokens that attend to all other tokens, and all other tokens attend to them).</li>
</ul>`,name:"global_attention_mask"},{anchor:"transformers.LEDForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LEDForQuestionAnswering.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.LEDForQuestionAnswering.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.LEDForQuestionAnswering.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.LEDForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LEDForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LEDForQuestionAnswering.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.LEDForQuestionAnswering.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LEDForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LEDForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LEDForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LEDForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.LEDForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_led.py#L2676",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig"
>LEDConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Do=new kt({props:{$$slots:{default:[df]},$$scope:{ctx:F}}}),xo=new ht({props:{anchor:"transformers.LEDForQuestionAnswering.forward.example",$$slots:{default:[lf]},$$scope:{ctx:F}}}),ts=new xe({}),os=new J({props:{name:"class transformers.TFLEDModel",anchor:"transformers.TFLEDModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLEDModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig">LEDConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_tf_led.py#L2218"}}),Jo=new kt({props:{$$slots:{default:[cf]},$$scope:{ctx:F}}}),rs=new J({props:{name:"call",anchor:"transformers.TFLEDModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"decoder_input_ids",val:": tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"decoder_head_mask",val:": tf.Tensor | None = None"},{name:"encoder_outputs",val:": tf.Tensor | None = None"},{name:"global_attention_mask",val:": tf.Tensor | None = None"},{name:"past_key_values",val:": Tuple[Tuple[tf.Tensor]] | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": tf.Tensor | None = None"},{name:"use_cache",val:": bool | None = None"},{name:"output_attentions",val:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = None"},{name:"training",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLEDModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFLEDModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFLEDModel.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>LedTokenizer</code>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>LED uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.TFLEDModel.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFLEDModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFLEDModel.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.TFLEDModel.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.Tensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFLEDModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFLEDModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFLEDModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFLEDModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFLEDModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLEDModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_tf_led.py#L2230",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/led#transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput"
>transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig"
>LEDConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>encoder_global_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>, where <code>x</code>
is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/led#transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput"
>transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Uo=new kt({props:{$$slots:{default:[hf]},$$scope:{ctx:F}}}),Co=new ht({props:{anchor:"transformers.TFLEDModel.call.example",$$slots:{default:[pf]},$$scope:{ctx:F}}}),ds=new xe({}),is=new J({props:{name:"class transformers.TFLEDForConditionalGeneration",anchor:"transformers.TFLEDForConditionalGeneration",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLEDForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig">LEDConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_tf_led.py#L2322"}}),Io=new kt({props:{$$slots:{default:[uf]},$$scope:{ctx:F}}}),ps=new J({props:{name:"call",anchor:"transformers.TFLEDForConditionalGeneration.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_input_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_outputs",val:": TFLEDEncoderBaseModelOutput | None = None"},{name:"global_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"past_key_values",val:": Tuple[Tuple[Union[np.ndarray, tf.Tensor]]] | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": bool | None = None"},{name:"output_attentions",val:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFLEDForConditionalGeneration.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFLEDForConditionalGeneration.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFLEDForConditionalGeneration.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>LedTokenizer</code>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>LED uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.TFLEDForConditionalGeneration.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFLEDForConditionalGeneration.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFLEDForConditionalGeneration.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.TFLEDForConditionalGeneration.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.Tensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFLEDForConditionalGeneration.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFLEDForConditionalGeneration.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFLEDForConditionalGeneration.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFLEDForConditionalGeneration.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFLEDForConditionalGeneration.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLEDForConditionalGeneration.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/led/modeling_tf_led.py#L2363",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/led#transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput"
>transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/led#transformers.LEDConfig"
>LEDConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>encoder_global_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, x)</code>, where <code>x</code>
is the number of tokens with global attention mask.</p>
<p>Global attentions weights after the attention softmax, used to compute the weighted average in the
self-attention heads. Those are the attention weights from every token with global attention to every token
in the sequence.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/led#transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput"
>transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Go=new kt({props:{$$slots:{default:[mf]},$$scope:{ctx:F}}}),No=new ht({props:{anchor:"transformers.TFLEDForConditionalGeneration.call.example",$$slots:{default:[ff]},$$scope:{ctx:F}}}),{c(){l=a("meta"),T=c(),f=a("h1"),u=a("a"),b=a("span"),y(i.$$.fragment),p=c(),L=a("span"),K=n("LED"),G=c(),S=a("h2"),V=a("a"),re=a("span"),y(z.$$.fragment),Be=c(),ee=a("span"),Oe=n("Overview"),je=c(),O=a("p"),Ve=n("The LED model was proposed in "),de=a("a"),ie=n("Longformer: The Long-Document Transformer"),Ae=n(` by Iz
Beltagy, Matthew E. Peters, Arman Cohan.`),Je=c(),Q=a("p"),Re=n("The abstract from the paper is the following:"),Ue=c(),H=a("p"),Ee=a("em"),Pe=n(`Transformer-based models are unable to process long sequences due to their self-attention operation, which scales
quadratically with the sequence length. To address this limitation, we introduce the Longformer with an attention
mechanism that scales linearly with sequence length, making it easy to process documents of thousands of tokens or
longer. Longformer\u2019s attention mechanism is a drop-in replacement for the standard self-attention and combines a local
windowed attention with a task motivated global attention. Following prior work on long-sequence transformers, we
evaluate Longformer on character-level language modeling and achieve state-of-the-art results on text8 and enwik8. In
contrast to most prior work, we also pretrain Longformer and finetune it on a variety of downstream tasks. Our
pretrained Longformer consistently outperforms RoBERTa on long document tasks and sets new state-of-the-art results on
WikiHop and TriviaQA. We finally introduce the Longformer-Encoder-Decoder (LED), a Longformer variant for supporting
long document generative sequence-to-sequence tasks, and demonstrate its effectiveness on the arXiv summarization
dataset.`),_e=c(),j=a("p"),N=n("Tips:"),Ce=c(),D=a("ul"),C=a("li"),be=a("a"),le=n("LEDForConditionalGeneration"),Xe=n(` is an extension of
`),Te=a("a"),W=n("BartForConditionalGeneration"),Qe=n(" exchanging the traditional "),te=a("em"),He=n("self-attention"),Ye=n(` layer with
`),oe=a("em"),Ke=n("Longformer"),et=n("\u2019s "),A=a("em"),tt=n("chunked self-attention"),ce=n(" layer. "),ye=a("a"),qe=n("LEDTokenizer"),Z=n(` is an alias of
`),we=a("a"),R=n("BartTokenizer"),ot=n("."),nt=c(),q=a("li"),$=n("LED works very well on long-range "),st=a("em"),Fe=n("sequence-to-sequence"),vt=n(" tasks where the "),at=a("code"),x=n("input_ids"),Mt=n(` largely exceed a length of
1024 tokens.`),Et=c(),P=a("li"),qt=n("LED pads the "),rt=a("code"),ne=n("input_ids"),he=n(" to be a multiple of "),dt=a("code"),Ft=n("config.attention_window"),pe=n(` if required. Therefore a small speed-up is
gained, when `),Se=a("a"),Lt=n("LEDTokenizer"),it=n(" is used with the "),lt=a("code"),Le=n("pad_to_multiple_of"),zt=n(" argument."),Vd=c(),se=a("li"),Ad=n("LED makes use of "),Ys=a("em"),Rd=n("global attention"),Pd=n(" by means of the "),Ks=a("code"),Xd=n("global_attention_mask"),Qd=n(` (see
`),gs=a("a"),Hd=n("LongformerModel"),Yd=n("). For summarization, it is advised to put "),ea=a("em"),Kd=n("global attention"),ei=n(` only on the first
`),ta=a("code"),ti=n("<s>"),oi=n(" token. For question answering, it is advised to put "),oa=a("em"),ni=n("global attention"),si=n(" on all tokens of the question."),ai=c(),ct=a("li"),ri=n("To fine-tune LED on all 16384, "),na=a("em"),di=n("gradient checkpointing"),ii=n(` can be enabled in case training leads to out-of-memory (OOM)
errors. This can be done by executing `),sa=a("code"),li=n("model.gradient_checkpointing_enable()"),ci=n(`.
Moreover, the `),aa=a("code"),hi=n("use_cache=False"),pi=n(`
flag can be used to disable the caching mechanism to save memory.`),ui=c(),Qo=a("li"),mi=n("A notebook showing how to evaluate LED, can be accessed "),Ho=a("a"),fi=n("here"),gi=n("."),_i=c(),Yo=a("li"),bi=n("A notebook showing how to fine-tune LED, can be accessed "),Ko=a("a"),Ti=n("here"),yi=n("."),wi=c(),ra=a("li"),ki=n(`LED is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Mr=c(),so=a("p"),vi=n("This model was contributed by "),en=a("a"),Mi=n("patrickvonplaten"),Ei=n("."),Er=c(),$t=a("h2"),ao=a("a"),da=a("span"),y(tn.$$.fragment),qi=c(),ia=a("span"),Fi=n("Documentation resources"),qr=c(),Ie=a("ul"),la=a("li"),_s=a("a"),Li=n("Text classification task guide"),zi=c(),ca=a("li"),bs=a("a"),$i=n("Question answering task guide"),Di=c(),ha=a("li"),Ts=a("a"),xi=n("Translation task guide"),ji=c(),pa=a("li"),ys=a("a"),Ji=n("Summarization task guide"),Fr=c(),Dt=a("h2"),ro=a("a"),ua=a("span"),y(on.$$.fragment),Ui=c(),ma=a("span"),Ci=n("LEDConfig"),Lr=c(),ze=a("div"),y(nn.$$.fragment),Si=c(),xt=a("p"),Ii=n("This is the configuration class to store the configuration of a "),ws=a("a"),Gi=n("LEDModel"),Ni=n(`. It is used to instantiate an LED
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LED
`),sn=a("a"),Wi=n("allenai/led-base-16384"),Zi=n(" architecture."),Bi=c(),jt=a("p"),Oi=n("Configuration objects inherit from "),ks=a("a"),Vi=n("PretrainedConfig"),Ai=n(` and can be used to control the model outputs. Read the
documentation from `),vs=a("a"),Ri=n("PretrainedConfig"),Pi=n(" for more information."),Xi=c(),y(io.$$.fragment),zr=c(),Jt=a("h2"),lo=a("a"),fa=a("span"),y(an.$$.fragment),Qi=c(),ga=a("span"),Hi=n("LEDTokenizer"),$r=c(),U=a("div"),y(rn.$$.fragment),Yi=c(),_a=a("p"),Ki=n("Constructs a LED tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),el=c(),ba=a("p"),tl=n("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),ol=c(),y(co.$$.fragment),nl=c(),dn=a("p"),sl=n("You can get around that behavior by passing "),Ta=a("code"),al=n("add_prefix_space=True"),rl=n(` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),dl=c(),y(ho.$$.fragment),il=c(),ln=a("p"),ll=n("This tokenizer inherits from "),Ms=a("a"),cl=n("PreTrainedTokenizer"),hl=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),pl=c(),mt=a("div"),y(cn.$$.fragment),ul=c(),ya=a("p"),ml=n(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A LED sequence has the following format:`),fl=c(),hn=a("ul"),Es=a("li"),gl=n("single sequence: "),wa=a("code"),_l=n("<s> X </s>"),bl=c(),qs=a("li"),Tl=n("pair of sequences: "),ka=a("code"),yl=n("<s> A </s></s> B </s>"),wl=c(),po=a("div"),y(pn.$$.fragment),kl=c(),un=a("p"),vl=n(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),va=a("code"),Ml=n("prepare_for_model"),El=n(" method."),ql=c(),uo=a("div"),y(mn.$$.fragment),Fl=c(),Ma=a("p"),Ll=n(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. LED does not
make use of token type ids, therefore a list of zeros is returned.`),zl=c(),Fs=a("div"),y(fn.$$.fragment),Dr=c(),Ut=a("h2"),mo=a("a"),Ea=a("span"),y(gn.$$.fragment),$l=c(),qa=a("span"),Dl=n("LEDTokenizerFast"),xr=c(),B=a("div"),y(_n.$$.fragment),xl=c(),bn=a("p"),jl=n("Construct a \u201Cfast\u201D LED tokenizer (backed by HuggingFace\u2019s "),Fa=a("em"),Jl=n("tokenizers"),Ul=n(` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),Cl=c(),La=a("p"),Sl=n("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Il=c(),y(fo.$$.fragment),Gl=c(),Tn=a("p"),Nl=n("You can get around that behavior by passing "),za=a("code"),Wl=n("add_prefix_space=True"),Zl=n(` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),Bl=c(),y(go.$$.fragment),Ol=c(),yn=a("p"),Vl=n("This tokenizer inherits from "),Ls=a("a"),Al=n("PreTrainedTokenizerFast"),Rl=n(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Pl=c(),_o=a("div"),y(wn.$$.fragment),Xl=c(),$a=a("p"),Ql=n(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. LED does not
make use of token type ids, therefore a list of zeros is returned.`),jr=c(),Ct=a("h2"),bo=a("a"),Da=a("span"),y(kn.$$.fragment),Hl=c(),xa=a("span"),Yl=n("LED specific outputs"),Jr=c(),St=a("div"),y(vn.$$.fragment),Kl=c(),ja=a("p"),ec=n("Base class for LEDEncoder\u2019s outputs, with potential hidden states, local and global attentions."),Ur=c(),It=a("div"),y(Mn.$$.fragment),tc=c(),Ja=a("p"),oc=n(`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),Cr=c(),Gt=a("div"),y(En.$$.fragment),nc=c(),Ua=a("p"),sc=n("Base class for sequence-to-sequence language models outputs."),Sr=c(),Nt=a("div"),y(qn.$$.fragment),ac=c(),Ca=a("p"),rc=n("Base class for outputs of sequence-to-sequence sentence classification models."),Ir=c(),Wt=a("div"),y(Fn.$$.fragment),dc=c(),Sa=a("p"),ic=n("Base class for outputs of sequence-to-sequence question answering models."),Gr=c(),Zt=a("div"),y(Ln.$$.fragment),lc=c(),Ia=a("p"),cc=n("Base class for Longformer\u2019s outputs, with potential hidden states, local and global attentions."),Nr=c(),Bt=a("div"),y(zn.$$.fragment),hc=c(),Ga=a("p"),pc=n(`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),Wr=c(),Ot=a("div"),y($n.$$.fragment),uc=c(),Na=a("p"),mc=n("Base class for sequence-to-sequence language models outputs."),Zr=c(),Vt=a("h2"),To=a("a"),Wa=a("span"),y(Dn.$$.fragment),fc=c(),Za=a("span"),gc=n("LEDModel"),Br=c(),$e=a("div"),y(xn.$$.fragment),_c=c(),jn=a("p"),bc=n(`The bare LED Model outputting raw hidden-states without any specific head on top.
This model inherits from `),zs=a("a"),Tc=n("PreTrainedModel"),yc=n(`. See the superclass documentation for the generic methods the library
implements for all its models (such as downloading or saving, resizing the input embeddings, pruning heads etc.)`),wc=c(),Jn=a("p"),kc=n("This model is also a PyTorch "),Un=a("a"),vc=n("torch.nn.Module"),Mc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),Ec=c(),Ge=a("div"),y(Cn.$$.fragment),qc=c(),At=a("p"),Fc=n("The "),$s=a("a"),Lc=n("LEDModel"),zc=n(" forward method, overrides the "),Ba=a("code"),$c=n("__call__"),Dc=n(" special method."),xc=c(),y(yo.$$.fragment),jc=c(),y(wo.$$.fragment),Or=c(),Rt=a("h2"),ko=a("a"),Oa=a("span"),y(Sn.$$.fragment),Jc=c(),Va=a("span"),Uc=n("LEDForConditionalGeneration"),Vr=c(),De=a("div"),y(In.$$.fragment),Cc=c(),Gn=a("p"),Sc=n(`The LED Model with a language modeling head. Can be used for summarization.
This model inherits from `),Ds=a("a"),Ic=n("PreTrainedModel"),Gc=n(`. See the superclass documentation for the generic methods the library
implements for all its models (such as downloading or saving, resizing the input embeddings, pruning heads etc.)`),Nc=c(),Nn=a("p"),Wc=n("This model is also a PyTorch "),Wn=a("a"),Zc=n("torch.nn.Module"),Bc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),Oc=c(),ke=a("div"),y(Zn.$$.fragment),Vc=c(),Pt=a("p"),Ac=n("The "),xs=a("a"),Rc=n("LEDForConditionalGeneration"),Pc=n(" forward method, overrides the "),Aa=a("code"),Xc=n("__call__"),Qc=n(" special method."),Hc=c(),y(vo.$$.fragment),Yc=c(),y(Mo.$$.fragment),Kc=c(),y(Eo.$$.fragment),Ar=c(),Xt=a("h2"),qo=a("a"),Ra=a("span"),y(Bn.$$.fragment),eh=c(),Pa=a("span"),th=n("LEDForSequenceClassification"),Rr=c(),ue=a("div"),y(On.$$.fragment),oh=c(),Xa=a("p"),nh=n(`LED model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),sh=c(),Vn=a("p"),ah=n("This model inherits from "),js=a("a"),rh=n("PreTrainedModel"),dh=n(`. See the superclass documentation for the generic methods the library
implements for all its models (such as downloading or saving, resizing the input embeddings, pruning heads etc.)`),ih=c(),An=a("p"),lh=n("This model is also a PyTorch "),Rn=a("a"),ch=n("torch.nn.Module"),hh=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),ph=c(),ve=a("div"),y(Pn.$$.fragment),uh=c(),Qt=a("p"),mh=n("The "),Js=a("a"),fh=n("LEDForSequenceClassification"),gh=n(" forward method, overrides the "),Qa=a("code"),_h=n("__call__"),bh=n(" special method."),Th=c(),y(Fo.$$.fragment),yh=c(),y(Lo.$$.fragment),wh=c(),y(zo.$$.fragment),Pr=c(),Ht=a("h2"),$o=a("a"),Ha=a("span"),y(Xn.$$.fragment),kh=c(),Ya=a("span"),vh=n("LEDForQuestionAnswering"),Xr=c(),me=a("div"),y(Qn.$$.fragment),Mh=c(),Yt=a("p"),Eh=n(`LED Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layer
on top of the hidden-states output to compute `),Ka=a("code"),qh=n("span start logits"),Fh=n(" and "),er=a("code"),Lh=n("span end logits"),zh=n(")."),$h=c(),Hn=a("p"),Dh=n("This model inherits from "),Us=a("a"),xh=n("PreTrainedModel"),jh=n(`. See the superclass documentation for the generic methods the library
implements for all its models (such as downloading or saving, resizing the input embeddings, pruning heads etc.)`),Jh=c(),Yn=a("p"),Uh=n("This model is also a PyTorch "),Kn=a("a"),Ch=n("torch.nn.Module"),Sh=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),Ih=c(),Ne=a("div"),y(es.$$.fragment),Gh=c(),Kt=a("p"),Nh=n("The "),Cs=a("a"),Wh=n("LEDForQuestionAnswering"),Zh=n(" forward method, overrides the "),tr=a("code"),Bh=n("__call__"),Oh=n(" special method."),Vh=c(),y(Do.$$.fragment),Ah=c(),y(xo.$$.fragment),Qr=c(),eo=a("h2"),jo=a("a"),or=a("span"),y(ts.$$.fragment),Rh=c(),nr=a("span"),Ph=n("TFLEDModel"),Hr=c(),fe=a("div"),y(os.$$.fragment),Xh=c(),ns=a("p"),Qh=n(`The bare LED Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ss=a("a"),Hh=n("TFPreTrainedModel"),Yh=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Kh=c(),ss=a("p"),ep=n("This model is also a "),as=a("a"),tp=n("tf.keras.Model"),op=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),np=c(),y(Jo.$$.fragment),sp=c(),We=a("div"),y(rs.$$.fragment),ap=c(),to=a("p"),rp=n("The "),Is=a("a"),dp=n("TFLEDModel"),ip=n(" forward method, overrides the "),sr=a("code"),lp=n("__call__"),cp=n(" special method."),hp=c(),y(Uo.$$.fragment),pp=c(),y(Co.$$.fragment),Yr=c(),oo=a("h2"),So=a("a"),ar=a("span"),y(ds.$$.fragment),up=c(),rr=a("span"),mp=n("TFLEDForConditionalGeneration"),Kr=c(),ge=a("div"),y(is.$$.fragment),fp=c(),ls=a("p"),gp=n(`The LED Model with a language modeling head. Can be used for summarization.
This model inherits from `),Gs=a("a"),_p=n("TFPreTrainedModel"),bp=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Tp=c(),cs=a("p"),yp=n("This model is also a "),hs=a("a"),wp=n("tf.keras.Model"),kp=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),vp=c(),y(Io.$$.fragment),Mp=c(),Ze=a("div"),y(ps.$$.fragment),Ep=c(),no=a("p"),qp=n("The "),Ns=a("a"),Fp=n("TFLEDForConditionalGeneration"),Lp=n(" forward method, overrides the "),dr=a("code"),zp=n("__call__"),$p=n(" special method."),Dp=c(),y(Go.$$.fragment),xp=c(),y(No.$$.fragment),this.h()},l(o){const _=Am('[data-svelte="svelte-1phssyn"]',document.head);l=r(_,"META",{name:!0,content:!0}),_.forEach(t),T=h(o),f=r(o,"H1",{class:!0});var us=d(f);u=r(us,"A",{id:!0,class:!0,href:!0});var ir=d(u);b=r(ir,"SPAN",{});var lr=d(b);w(i.$$.fragment,lr),lr.forEach(t),ir.forEach(t),p=h(us),L=r(us,"SPAN",{});var cr=d(L);K=s(cr,"LED"),cr.forEach(t),us.forEach(t),G=h(o),S=r(o,"H2",{class:!0});var ms=d(S);V=r(ms,"A",{id:!0,class:!0,href:!0});var hr=d(V);re=r(hr,"SPAN",{});var pr=d(re);w(z.$$.fragment,pr),pr.forEach(t),hr.forEach(t),Be=h(ms),ee=r(ms,"SPAN",{});var ur=d(ee);Oe=s(ur,"Overview"),ur.forEach(t),ms.forEach(t),je=h(o),O=r(o,"P",{});var fs=d(O);Ve=s(fs,"The LED model was proposed in "),de=r(fs,"A",{href:!0,rel:!0});var mr=d(de);ie=s(mr,"Longformer: The Long-Document Transformer"),mr.forEach(t),Ae=s(fs,` by Iz
Beltagy, Matthew E. Peters, Arman Cohan.`),fs.forEach(t),Je=h(o),Q=r(o,"P",{});var fr=d(Q);Re=s(fr,"The abstract from the paper is the following:"),fr.forEach(t),Ue=h(o),H=r(o,"P",{});var gr=d(H);Ee=r(gr,"EM",{});var _r=d(Ee);Pe=s(_r,`Transformer-based models are unable to process long sequences due to their self-attention operation, which scales
quadratically with the sequence length. To address this limitation, we introduce the Longformer with an attention
mechanism that scales linearly with sequence length, making it easy to process documents of thousands of tokens or
longer. Longformer\u2019s attention mechanism is a drop-in replacement for the standard self-attention and combines a local
windowed attention with a task motivated global attention. Following prior work on long-sequence transformers, we
evaluate Longformer on character-level language modeling and achieve state-of-the-art results on text8 and enwik8. In
contrast to most prior work, we also pretrain Longformer and finetune it on a variety of downstream tasks. Our
pretrained Longformer consistently outperforms RoBERTa on long document tasks and sets new state-of-the-art results on
WikiHop and TriviaQA. We finally introduce the Longformer-Encoder-Decoder (LED), a Longformer variant for supporting
long document generative sequence-to-sequence tasks, and demonstrate its effectiveness on the arXiv summarization
dataset.`),_r.forEach(t),gr.forEach(t),_e=h(o),j=r(o,"P",{});var br=d(j);N=s(br,"Tips:"),br.forEach(t),Ce=h(o),D=r(o,"UL",{});var X=d(D);C=r(X,"LI",{});var Y=d(C);be=r(Y,"A",{href:!0});var Tr=d(be);le=s(Tr,"LEDForConditionalGeneration"),Tr.forEach(t),Xe=s(Y,` is an extension of
`),Te=r(Y,"A",{href:!0});var yr=d(Te);W=s(yr,"BartForConditionalGeneration"),yr.forEach(t),Qe=s(Y," exchanging the traditional "),te=r(Y,"EM",{});var wr=d(te);He=s(wr,"self-attention"),wr.forEach(t),Ye=s(Y,` layer with
`),oe=r(Y,"EM",{});var kr=d(oe);Ke=s(kr,"Longformer"),kr.forEach(t),et=s(Y,"\u2019s "),A=r(Y,"EM",{});var vr=d(A);tt=s(vr,"chunked self-attention"),vr.forEach(t),ce=s(Y," layer. "),ye=r(Y,"A",{href:!0});var Up=d(ye);qe=s(Up,"LEDTokenizer"),Up.forEach(t),Z=s(Y,` is an alias of
`),we=r(Y,"A",{href:!0});var Cp=d(we);R=s(Cp,"BartTokenizer"),Cp.forEach(t),ot=s(Y,"."),Y.forEach(t),nt=h(X),q=r(X,"LI",{});var Ws=d(q);$=s(Ws,"LED works very well on long-range "),st=r(Ws,"EM",{});var Sp=d(st);Fe=s(Sp,"sequence-to-sequence"),Sp.forEach(t),vt=s(Ws," tasks where the "),at=r(Ws,"CODE",{});var Ip=d(at);x=s(Ip,"input_ids"),Ip.forEach(t),Mt=s(Ws,` largely exceed a length of
1024 tokens.`),Ws.forEach(t),Et=h(X),P=r(X,"LI",{});var ft=d(P);qt=s(ft,"LED pads the "),rt=r(ft,"CODE",{});var Gp=d(rt);ne=s(Gp,"input_ids"),Gp.forEach(t),he=s(ft," to be a multiple of "),dt=r(ft,"CODE",{});var Np=d(dt);Ft=s(Np,"config.attention_window"),Np.forEach(t),pe=s(ft,` if required. Therefore a small speed-up is
gained, when `),Se=r(ft,"A",{href:!0});var Wp=d(Se);Lt=s(Wp,"LEDTokenizer"),Wp.forEach(t),it=s(ft," is used with the "),lt=r(ft,"CODE",{});var Zp=d(lt);Le=s(Zp,"pad_to_multiple_of"),Zp.forEach(t),zt=s(ft," argument."),ft.forEach(t),Vd=h(X),se=r(X,"LI",{});var Me=d(se);Ad=s(Me,"LED makes use of "),Ys=r(Me,"EM",{});var Bp=d(Ys);Rd=s(Bp,"global attention"),Bp.forEach(t),Pd=s(Me," by means of the "),Ks=r(Me,"CODE",{});var Op=d(Ks);Xd=s(Op,"global_attention_mask"),Op.forEach(t),Qd=s(Me,` (see
`),gs=r(Me,"A",{href:!0});var Vp=d(gs);Hd=s(Vp,"LongformerModel"),Vp.forEach(t),Yd=s(Me,"). For summarization, it is advised to put "),ea=r(Me,"EM",{});var Ap=d(ea);Kd=s(Ap,"global attention"),Ap.forEach(t),ei=s(Me,` only on the first
`),ta=r(Me,"CODE",{});var Rp=d(ta);ti=s(Rp,"<s>"),Rp.forEach(t),oi=s(Me," token. For question answering, it is advised to put "),oa=r(Me,"EM",{});var Pp=d(oa);ni=s(Pp,"global attention"),Pp.forEach(t),si=s(Me," on all tokens of the question."),Me.forEach(t),ai=h(X),ct=r(X,"LI",{});var Wo=d(ct);ri=s(Wo,"To fine-tune LED on all 16384, "),na=r(Wo,"EM",{});var Xp=d(na);di=s(Xp,"gradient checkpointing"),Xp.forEach(t),ii=s(Wo,` can be enabled in case training leads to out-of-memory (OOM)
errors. This can be done by executing `),sa=r(Wo,"CODE",{});var Qp=d(sa);li=s(Qp,"model.gradient_checkpointing_enable()"),Qp.forEach(t),ci=s(Wo,`.
Moreover, the `),aa=r(Wo,"CODE",{});var Hp=d(aa);hi=s(Hp,"use_cache=False"),Hp.forEach(t),pi=s(Wo,`
flag can be used to disable the caching mechanism to save memory.`),Wo.forEach(t),ui=h(X),Qo=r(X,"LI",{});var td=d(Qo);mi=s(td,"A notebook showing how to evaluate LED, can be accessed "),Ho=r(td,"A",{href:!0,rel:!0});var Yp=d(Ho);fi=s(Yp,"here"),Yp.forEach(t),gi=s(td,"."),td.forEach(t),_i=h(X),Yo=r(X,"LI",{});var od=d(Yo);bi=s(od,"A notebook showing how to fine-tune LED, can be accessed "),Ko=r(od,"A",{href:!0,rel:!0});var Kp=d(Ko);Ti=s(Kp,"here"),Kp.forEach(t),yi=s(od,"."),od.forEach(t),wi=h(X),ra=r(X,"LI",{});var eu=d(ra);ki=s(eu,`LED is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),eu.forEach(t),X.forEach(t),Mr=h(o),so=r(o,"P",{});var nd=d(so);vi=s(nd,"This model was contributed by "),en=r(nd,"A",{href:!0,rel:!0});var tu=d(en);Mi=s(tu,"patrickvonplaten"),tu.forEach(t),Ei=s(nd,"."),nd.forEach(t),Er=h(o),$t=r(o,"H2",{class:!0});var sd=d($t);ao=r(sd,"A",{id:!0,class:!0,href:!0});var ou=d(ao);da=r(ou,"SPAN",{});var nu=d(da);w(tn.$$.fragment,nu),nu.forEach(t),ou.forEach(t),qi=h(sd),ia=r(sd,"SPAN",{});var su=d(ia);Fi=s(su,"Documentation resources"),su.forEach(t),sd.forEach(t),qr=h(o),Ie=r(o,"UL",{});var Zo=d(Ie);la=r(Zo,"LI",{});var au=d(la);_s=r(au,"A",{href:!0});var ru=d(_s);Li=s(ru,"Text classification task guide"),ru.forEach(t),au.forEach(t),zi=h(Zo),ca=r(Zo,"LI",{});var du=d(ca);bs=r(du,"A",{href:!0});var iu=d(bs);$i=s(iu,"Question answering task guide"),iu.forEach(t),du.forEach(t),Di=h(Zo),ha=r(Zo,"LI",{});var lu=d(ha);Ts=r(lu,"A",{href:!0});var cu=d(Ts);xi=s(cu,"Translation task guide"),cu.forEach(t),lu.forEach(t),ji=h(Zo),pa=r(Zo,"LI",{});var hu=d(pa);ys=r(hu,"A",{href:!0});var pu=d(ys);Ji=s(pu,"Summarization task guide"),pu.forEach(t),hu.forEach(t),Zo.forEach(t),Fr=h(o),Dt=r(o,"H2",{class:!0});var ad=d(Dt);ro=r(ad,"A",{id:!0,class:!0,href:!0});var uu=d(ro);ua=r(uu,"SPAN",{});var mu=d(ua);w(on.$$.fragment,mu),mu.forEach(t),uu.forEach(t),Ui=h(ad),ma=r(ad,"SPAN",{});var fu=d(ma);Ci=s(fu,"LEDConfig"),fu.forEach(t),ad.forEach(t),Lr=h(o),ze=r(o,"DIV",{class:!0});var Bo=d(ze);w(nn.$$.fragment,Bo),Si=h(Bo),xt=r(Bo,"P",{});var Zs=d(xt);Ii=s(Zs,"This is the configuration class to store the configuration of a "),ws=r(Zs,"A",{href:!0});var gu=d(ws);Gi=s(gu,"LEDModel"),gu.forEach(t),Ni=s(Zs,`. It is used to instantiate an LED
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LED
`),sn=r(Zs,"A",{href:!0,rel:!0});var _u=d(sn);Wi=s(_u,"allenai/led-base-16384"),_u.forEach(t),Zi=s(Zs," architecture."),Zs.forEach(t),Bi=h(Bo),jt=r(Bo,"P",{});var Bs=d(jt);Oi=s(Bs,"Configuration objects inherit from "),ks=r(Bs,"A",{href:!0});var bu=d(ks);Vi=s(bu,"PretrainedConfig"),bu.forEach(t),Ai=s(Bs,` and can be used to control the model outputs. Read the
documentation from `),vs=r(Bs,"A",{href:!0});var Tu=d(vs);Ri=s(Tu,"PretrainedConfig"),Tu.forEach(t),Pi=s(Bs," for more information."),Bs.forEach(t),Xi=h(Bo),w(io.$$.fragment,Bo),Bo.forEach(t),zr=h(o),Jt=r(o,"H2",{class:!0});var rd=d(Jt);lo=r(rd,"A",{id:!0,class:!0,href:!0});var yu=d(lo);fa=r(yu,"SPAN",{});var wu=d(fa);w(an.$$.fragment,wu),wu.forEach(t),yu.forEach(t),Qi=h(rd),ga=r(rd,"SPAN",{});var ku=d(ga);Hi=s(ku,"LEDTokenizer"),ku.forEach(t),rd.forEach(t),$r=h(o),U=r(o,"DIV",{class:!0});var I=d(U);w(rn.$$.fragment,I),Yi=h(I),_a=r(I,"P",{});var vu=d(_a);Ki=s(vu,"Constructs a LED tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),vu.forEach(t),el=h(I),ba=r(I,"P",{});var Mu=d(ba);tl=s(Mu,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Mu.forEach(t),ol=h(I),w(co.$$.fragment,I),nl=h(I),dn=r(I,"P",{});var dd=d(dn);sl=s(dd,"You can get around that behavior by passing "),Ta=r(dd,"CODE",{});var Eu=d(Ta);al=s(Eu,"add_prefix_space=True"),Eu.forEach(t),rl=s(dd,` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),dd.forEach(t),dl=h(I),w(ho.$$.fragment,I),il=h(I),ln=r(I,"P",{});var id=d(ln);ll=s(id,"This tokenizer inherits from "),Ms=r(id,"A",{href:!0});var qu=d(Ms);cl=s(qu,"PreTrainedTokenizer"),qu.forEach(t),hl=s(id,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),id.forEach(t),pl=h(I),mt=r(I,"DIV",{class:!0});var Os=d(mt);w(cn.$$.fragment,Os),ul=h(Os),ya=r(Os,"P",{});var Fu=d(ya);ml=s(Fu,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A LED sequence has the following format:`),Fu.forEach(t),fl=h(Os),hn=r(Os,"UL",{});var ld=d(hn);Es=r(ld,"LI",{});var jp=d(Es);gl=s(jp,"single sequence: "),wa=r(jp,"CODE",{});var Lu=d(wa);_l=s(Lu,"<s> X </s>"),Lu.forEach(t),jp.forEach(t),bl=h(ld),qs=r(ld,"LI",{});var Jp=d(qs);Tl=s(Jp,"pair of sequences: "),ka=r(Jp,"CODE",{});var zu=d(ka);yl=s(zu,"<s> A </s></s> B </s>"),zu.forEach(t),Jp.forEach(t),ld.forEach(t),Os.forEach(t),wl=h(I),po=r(I,"DIV",{class:!0});var cd=d(po);w(pn.$$.fragment,cd),kl=h(cd),un=r(cd,"P",{});var hd=d(un);vl=s(hd,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),va=r(hd,"CODE",{});var $u=d(va);Ml=s($u,"prepare_for_model"),$u.forEach(t),El=s(hd," method."),hd.forEach(t),cd.forEach(t),ql=h(I),uo=r(I,"DIV",{class:!0});var pd=d(uo);w(mn.$$.fragment,pd),Fl=h(pd),Ma=r(pd,"P",{});var Du=d(Ma);Ll=s(Du,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. LED does not
make use of token type ids, therefore a list of zeros is returned.`),Du.forEach(t),pd.forEach(t),zl=h(I),Fs=r(I,"DIV",{class:!0});var xu=d(Fs);w(fn.$$.fragment,xu),xu.forEach(t),I.forEach(t),Dr=h(o),Ut=r(o,"H2",{class:!0});var ud=d(Ut);mo=r(ud,"A",{id:!0,class:!0,href:!0});var ju=d(mo);Ea=r(ju,"SPAN",{});var Ju=d(Ea);w(gn.$$.fragment,Ju),Ju.forEach(t),ju.forEach(t),$l=h(ud),qa=r(ud,"SPAN",{});var Uu=d(qa);Dl=s(Uu,"LEDTokenizerFast"),Uu.forEach(t),ud.forEach(t),xr=h(o),B=r(o,"DIV",{class:!0});var ae=d(B);w(_n.$$.fragment,ae),xl=h(ae),bn=r(ae,"P",{});var md=d(bn);jl=s(md,"Construct a \u201Cfast\u201D LED tokenizer (backed by HuggingFace\u2019s "),Fa=r(md,"EM",{});var Cu=d(Fa);Jl=s(Cu,"tokenizers"),Cu.forEach(t),Ul=s(md,` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),md.forEach(t),Cl=h(ae),La=r(ae,"P",{});var Su=d(La);Sl=s(Su,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Su.forEach(t),Il=h(ae),w(fo.$$.fragment,ae),Gl=h(ae),Tn=r(ae,"P",{});var fd=d(Tn);Nl=s(fd,"You can get around that behavior by passing "),za=r(fd,"CODE",{});var Iu=d(za);Wl=s(Iu,"add_prefix_space=True"),Iu.forEach(t),Zl=s(fd,` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),fd.forEach(t),Bl=h(ae),w(go.$$.fragment,ae),Ol=h(ae),yn=r(ae,"P",{});var gd=d(yn);Vl=s(gd,"This tokenizer inherits from "),Ls=r(gd,"A",{href:!0});var Gu=d(Ls);Al=s(Gu,"PreTrainedTokenizerFast"),Gu.forEach(t),Rl=s(gd,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),gd.forEach(t),Pl=h(ae),_o=r(ae,"DIV",{class:!0});var _d=d(_o);w(wn.$$.fragment,_d),Xl=h(_d),$a=r(_d,"P",{});var Nu=d($a);Ql=s(Nu,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. LED does not
make use of token type ids, therefore a list of zeros is returned.`),Nu.forEach(t),_d.forEach(t),ae.forEach(t),jr=h(o),Ct=r(o,"H2",{class:!0});var bd=d(Ct);bo=r(bd,"A",{id:!0,class:!0,href:!0});var Wu=d(bo);Da=r(Wu,"SPAN",{});var Zu=d(Da);w(kn.$$.fragment,Zu),Zu.forEach(t),Wu.forEach(t),Hl=h(bd),xa=r(bd,"SPAN",{});var Bu=d(xa);Yl=s(Bu,"LED specific outputs"),Bu.forEach(t),bd.forEach(t),Jr=h(o),St=r(o,"DIV",{class:!0});var Td=d(St);w(vn.$$.fragment,Td),Kl=h(Td),ja=r(Td,"P",{});var Ou=d(ja);ec=s(Ou,"Base class for LEDEncoder\u2019s outputs, with potential hidden states, local and global attentions."),Ou.forEach(t),Td.forEach(t),Ur=h(o),It=r(o,"DIV",{class:!0});var yd=d(It);w(Mn.$$.fragment,yd),tc=h(yd),Ja=r(yd,"P",{});var Vu=d(Ja);oc=s(Vu,`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),Vu.forEach(t),yd.forEach(t),Cr=h(o),Gt=r(o,"DIV",{class:!0});var wd=d(Gt);w(En.$$.fragment,wd),nc=h(wd),Ua=r(wd,"P",{});var Au=d(Ua);sc=s(Au,"Base class for sequence-to-sequence language models outputs."),Au.forEach(t),wd.forEach(t),Sr=h(o),Nt=r(o,"DIV",{class:!0});var kd=d(Nt);w(qn.$$.fragment,kd),ac=h(kd),Ca=r(kd,"P",{});var Ru=d(Ca);rc=s(Ru,"Base class for outputs of sequence-to-sequence sentence classification models."),Ru.forEach(t),kd.forEach(t),Ir=h(o),Wt=r(o,"DIV",{class:!0});var vd=d(Wt);w(Fn.$$.fragment,vd),dc=h(vd),Sa=r(vd,"P",{});var Pu=d(Sa);ic=s(Pu,"Base class for outputs of sequence-to-sequence question answering models."),Pu.forEach(t),vd.forEach(t),Gr=h(o),Zt=r(o,"DIV",{class:!0});var Md=d(Zt);w(Ln.$$.fragment,Md),lc=h(Md),Ia=r(Md,"P",{});var Xu=d(Ia);cc=s(Xu,"Base class for Longformer\u2019s outputs, with potential hidden states, local and global attentions."),Xu.forEach(t),Md.forEach(t),Nr=h(o),Bt=r(o,"DIV",{class:!0});var Ed=d(Bt);w(zn.$$.fragment,Ed),hc=h(Ed),Ga=r(Ed,"P",{});var Qu=d(Ga);pc=s(Qu,`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),Qu.forEach(t),Ed.forEach(t),Wr=h(o),Ot=r(o,"DIV",{class:!0});var qd=d(Ot);w($n.$$.fragment,qd),uc=h(qd),Na=r(qd,"P",{});var Hu=d(Na);mc=s(Hu,"Base class for sequence-to-sequence language models outputs."),Hu.forEach(t),qd.forEach(t),Zr=h(o),Vt=r(o,"H2",{class:!0});var Fd=d(Vt);To=r(Fd,"A",{id:!0,class:!0,href:!0});var Yu=d(To);Wa=r(Yu,"SPAN",{});var Ku=d(Wa);w(Dn.$$.fragment,Ku),Ku.forEach(t),Yu.forEach(t),fc=h(Fd),Za=r(Fd,"SPAN",{});var em=d(Za);gc=s(em,"LEDModel"),em.forEach(t),Fd.forEach(t),Br=h(o),$e=r(o,"DIV",{class:!0});var Oo=d($e);w(xn.$$.fragment,Oo),_c=h(Oo),jn=r(Oo,"P",{});var Ld=d(jn);bc=s(Ld,`The bare LED Model outputting raw hidden-states without any specific head on top.
This model inherits from `),zs=r(Ld,"A",{href:!0});var tm=d(zs);Tc=s(tm,"PreTrainedModel"),tm.forEach(t),yc=s(Ld,`. See the superclass documentation for the generic methods the library
implements for all its models (such as downloading or saving, resizing the input embeddings, pruning heads etc.)`),Ld.forEach(t),wc=h(Oo),Jn=r(Oo,"P",{});var zd=d(Jn);kc=s(zd,"This model is also a PyTorch "),Un=r(zd,"A",{href:!0,rel:!0});var om=d(Un);vc=s(om,"torch.nn.Module"),om.forEach(t),Mc=s(zd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),zd.forEach(t),Ec=h(Oo),Ge=r(Oo,"DIV",{class:!0});var Vo=d(Ge);w(Cn.$$.fragment,Vo),qc=h(Vo),At=r(Vo,"P",{});var Vs=d(At);Fc=s(Vs,"The "),$s=r(Vs,"A",{href:!0});var nm=d($s);Lc=s(nm,"LEDModel"),nm.forEach(t),zc=s(Vs," forward method, overrides the "),Ba=r(Vs,"CODE",{});var sm=d(Ba);$c=s(sm,"__call__"),sm.forEach(t),Dc=s(Vs," special method."),Vs.forEach(t),xc=h(Vo),w(yo.$$.fragment,Vo),jc=h(Vo),w(wo.$$.fragment,Vo),Vo.forEach(t),Oo.forEach(t),Or=h(o),Rt=r(o,"H2",{class:!0});var $d=d(Rt);ko=r($d,"A",{id:!0,class:!0,href:!0});var am=d(ko);Oa=r(am,"SPAN",{});var rm=d(Oa);w(Sn.$$.fragment,rm),rm.forEach(t),am.forEach(t),Jc=h($d),Va=r($d,"SPAN",{});var dm=d(Va);Uc=s(dm,"LEDForConditionalGeneration"),dm.forEach(t),$d.forEach(t),Vr=h(o),De=r(o,"DIV",{class:!0});var Ao=d(De);w(In.$$.fragment,Ao),Cc=h(Ao),Gn=r(Ao,"P",{});var Dd=d(Gn);Sc=s(Dd,`The LED Model with a language modeling head. Can be used for summarization.
This model inherits from `),Ds=r(Dd,"A",{href:!0});var im=d(Ds);Ic=s(im,"PreTrainedModel"),im.forEach(t),Gc=s(Dd,`. See the superclass documentation for the generic methods the library
implements for all its models (such as downloading or saving, resizing the input embeddings, pruning heads etc.)`),Dd.forEach(t),Nc=h(Ao),Nn=r(Ao,"P",{});var xd=d(Nn);Wc=s(xd,"This model is also a PyTorch "),Wn=r(xd,"A",{href:!0,rel:!0});var lm=d(Wn);Zc=s(lm,"torch.nn.Module"),lm.forEach(t),Bc=s(xd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),xd.forEach(t),Oc=h(Ao),ke=r(Ao,"DIV",{class:!0});var gt=d(ke);w(Zn.$$.fragment,gt),Vc=h(gt),Pt=r(gt,"P",{});var As=d(Pt);Ac=s(As,"The "),xs=r(As,"A",{href:!0});var cm=d(xs);Rc=s(cm,"LEDForConditionalGeneration"),cm.forEach(t),Pc=s(As," forward method, overrides the "),Aa=r(As,"CODE",{});var hm=d(Aa);Xc=s(hm,"__call__"),hm.forEach(t),Qc=s(As," special method."),As.forEach(t),Hc=h(gt),w(vo.$$.fragment,gt),Yc=h(gt),w(Mo.$$.fragment,gt),Kc=h(gt),w(Eo.$$.fragment,gt),gt.forEach(t),Ao.forEach(t),Ar=h(o),Xt=r(o,"H2",{class:!0});var jd=d(Xt);qo=r(jd,"A",{id:!0,class:!0,href:!0});var pm=d(qo);Ra=r(pm,"SPAN",{});var um=d(Ra);w(Bn.$$.fragment,um),um.forEach(t),pm.forEach(t),eh=h(jd),Pa=r(jd,"SPAN",{});var mm=d(Pa);th=s(mm,"LEDForSequenceClassification"),mm.forEach(t),jd.forEach(t),Rr=h(o),ue=r(o,"DIV",{class:!0});var _t=d(ue);w(On.$$.fragment,_t),oh=h(_t),Xa=r(_t,"P",{});var fm=d(Xa);nh=s(fm,`LED model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),fm.forEach(t),sh=h(_t),Vn=r(_t,"P",{});var Jd=d(Vn);ah=s(Jd,"This model inherits from "),js=r(Jd,"A",{href:!0});var gm=d(js);rh=s(gm,"PreTrainedModel"),gm.forEach(t),dh=s(Jd,`. See the superclass documentation for the generic methods the library
implements for all its models (such as downloading or saving, resizing the input embeddings, pruning heads etc.)`),Jd.forEach(t),ih=h(_t),An=r(_t,"P",{});var Ud=d(An);lh=s(Ud,"This model is also a PyTorch "),Rn=r(Ud,"A",{href:!0,rel:!0});var _m=d(Rn);ch=s(_m,"torch.nn.Module"),_m.forEach(t),hh=s(Ud,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),Ud.forEach(t),ph=h(_t),ve=r(_t,"DIV",{class:!0});var bt=d(ve);w(Pn.$$.fragment,bt),uh=h(bt),Qt=r(bt,"P",{});var Rs=d(Qt);mh=s(Rs,"The "),Js=r(Rs,"A",{href:!0});var bm=d(Js);fh=s(bm,"LEDForSequenceClassification"),bm.forEach(t),gh=s(Rs," forward method, overrides the "),Qa=r(Rs,"CODE",{});var Tm=d(Qa);_h=s(Tm,"__call__"),Tm.forEach(t),bh=s(Rs," special method."),Rs.forEach(t),Th=h(bt),w(Fo.$$.fragment,bt),yh=h(bt),w(Lo.$$.fragment,bt),wh=h(bt),w(zo.$$.fragment,bt),bt.forEach(t),_t.forEach(t),Pr=h(o),Ht=r(o,"H2",{class:!0});var Cd=d(Ht);$o=r(Cd,"A",{id:!0,class:!0,href:!0});var ym=d($o);Ha=r(ym,"SPAN",{});var wm=d(Ha);w(Xn.$$.fragment,wm),wm.forEach(t),ym.forEach(t),kh=h(Cd),Ya=r(Cd,"SPAN",{});var km=d(Ya);vh=s(km,"LEDForQuestionAnswering"),km.forEach(t),Cd.forEach(t),Xr=h(o),me=r(o,"DIV",{class:!0});var Tt=d(me);w(Qn.$$.fragment,Tt),Mh=h(Tt),Yt=r(Tt,"P",{});var Ps=d(Yt);Eh=s(Ps,`LED Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layer
on top of the hidden-states output to compute `),Ka=r(Ps,"CODE",{});var vm=d(Ka);qh=s(vm,"span start logits"),vm.forEach(t),Fh=s(Ps," and "),er=r(Ps,"CODE",{});var Mm=d(er);Lh=s(Mm,"span end logits"),Mm.forEach(t),zh=s(Ps,")."),Ps.forEach(t),$h=h(Tt),Hn=r(Tt,"P",{});var Sd=d(Hn);Dh=s(Sd,"This model inherits from "),Us=r(Sd,"A",{href:!0});var Em=d(Us);xh=s(Em,"PreTrainedModel"),Em.forEach(t),jh=s(Sd,`. See the superclass documentation for the generic methods the library
implements for all its models (such as downloading or saving, resizing the input embeddings, pruning heads etc.)`),Sd.forEach(t),Jh=h(Tt),Yn=r(Tt,"P",{});var Id=d(Yn);Uh=s(Id,"This model is also a PyTorch "),Kn=r(Id,"A",{href:!0,rel:!0});var qm=d(Kn);Ch=s(qm,"torch.nn.Module"),qm.forEach(t),Sh=s(Id,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),Id.forEach(t),Ih=h(Tt),Ne=r(Tt,"DIV",{class:!0});var Ro=d(Ne);w(es.$$.fragment,Ro),Gh=h(Ro),Kt=r(Ro,"P",{});var Xs=d(Kt);Nh=s(Xs,"The "),Cs=r(Xs,"A",{href:!0});var Fm=d(Cs);Wh=s(Fm,"LEDForQuestionAnswering"),Fm.forEach(t),Zh=s(Xs," forward method, overrides the "),tr=r(Xs,"CODE",{});var Lm=d(tr);Bh=s(Lm,"__call__"),Lm.forEach(t),Oh=s(Xs," special method."),Xs.forEach(t),Vh=h(Ro),w(Do.$$.fragment,Ro),Ah=h(Ro),w(xo.$$.fragment,Ro),Ro.forEach(t),Tt.forEach(t),Qr=h(o),eo=r(o,"H2",{class:!0});var Gd=d(eo);jo=r(Gd,"A",{id:!0,class:!0,href:!0});var zm=d(jo);or=r(zm,"SPAN",{});var $m=d(or);w(ts.$$.fragment,$m),$m.forEach(t),zm.forEach(t),Rh=h(Gd),nr=r(Gd,"SPAN",{});var Dm=d(nr);Ph=s(Dm,"TFLEDModel"),Dm.forEach(t),Gd.forEach(t),Hr=h(o),fe=r(o,"DIV",{class:!0});var yt=d(fe);w(os.$$.fragment,yt),Xh=h(yt),ns=r(yt,"P",{});var Nd=d(ns);Qh=s(Nd,`The bare LED Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ss=r(Nd,"A",{href:!0});var xm=d(Ss);Hh=s(xm,"TFPreTrainedModel"),xm.forEach(t),Yh=s(Nd,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Nd.forEach(t),Kh=h(yt),ss=r(yt,"P",{});var Wd=d(ss);ep=s(Wd,"This model is also a "),as=r(Wd,"A",{href:!0,rel:!0});var jm=d(as);tp=s(jm,"tf.keras.Model"),jm.forEach(t),op=s(Wd,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Wd.forEach(t),np=h(yt),w(Jo.$$.fragment,yt),sp=h(yt),We=r(yt,"DIV",{class:!0});var Po=d(We);w(rs.$$.fragment,Po),ap=h(Po),to=r(Po,"P",{});var Qs=d(to);rp=s(Qs,"The "),Is=r(Qs,"A",{href:!0});var Jm=d(Is);dp=s(Jm,"TFLEDModel"),Jm.forEach(t),ip=s(Qs," forward method, overrides the "),sr=r(Qs,"CODE",{});var Um=d(sr);lp=s(Um,"__call__"),Um.forEach(t),cp=s(Qs," special method."),Qs.forEach(t),hp=h(Po),w(Uo.$$.fragment,Po),pp=h(Po),w(Co.$$.fragment,Po),Po.forEach(t),yt.forEach(t),Yr=h(o),oo=r(o,"H2",{class:!0});var Zd=d(oo);So=r(Zd,"A",{id:!0,class:!0,href:!0});var Cm=d(So);ar=r(Cm,"SPAN",{});var Sm=d(ar);w(ds.$$.fragment,Sm),Sm.forEach(t),Cm.forEach(t),up=h(Zd),rr=r(Zd,"SPAN",{});var Im=d(rr);mp=s(Im,"TFLEDForConditionalGeneration"),Im.forEach(t),Zd.forEach(t),Kr=h(o),ge=r(o,"DIV",{class:!0});var wt=d(ge);w(is.$$.fragment,wt),fp=h(wt),ls=r(wt,"P",{});var Bd=d(ls);gp=s(Bd,`The LED Model with a language modeling head. Can be used for summarization.
This model inherits from `),Gs=r(Bd,"A",{href:!0});var Gm=d(Gs);_p=s(Gm,"TFPreTrainedModel"),Gm.forEach(t),bp=s(Bd,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Bd.forEach(t),Tp=h(wt),cs=r(wt,"P",{});var Od=d(cs);yp=s(Od,"This model is also a "),hs=r(Od,"A",{href:!0,rel:!0});var Nm=d(hs);wp=s(Nm,"tf.keras.Model"),Nm.forEach(t),kp=s(Od,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Od.forEach(t),vp=h(wt),w(Io.$$.fragment,wt),Mp=h(wt),Ze=r(wt,"DIV",{class:!0});var Xo=d(Ze);w(ps.$$.fragment,Xo),Ep=h(Xo),no=r(Xo,"P",{});var Hs=d(no);qp=s(Hs,"The "),Ns=r(Hs,"A",{href:!0});var Wm=d(Ns);Fp=s(Wm,"TFLEDForConditionalGeneration"),Wm.forEach(t),Lp=s(Hs," forward method, overrides the "),dr=r(Hs,"CODE",{});var Zm=d(dr);zp=s(Zm,"__call__"),Zm.forEach(t),$p=s(Hs," special method."),Hs.forEach(t),Dp=h(Xo),w(Go.$$.fragment,Xo),xp=h(Xo),w(No.$$.fragment,Xo),Xo.forEach(t),wt.forEach(t),this.h()},h(){m(l,"name","hf:doc:metadata"),m(l,"content",JSON.stringify(_f)),m(u,"id","led"),m(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(u,"href","#led"),m(f,"class","relative group"),m(V,"id","overview"),m(V,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(V,"href","#overview"),m(S,"class","relative group"),m(de,"href","https://arxiv.org/abs/2004.05150"),m(de,"rel","nofollow"),m(be,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDForConditionalGeneration"),m(Te,"href","/docs/transformers/main/en/model_doc/bart#transformers.BartForConditionalGeneration"),m(ye,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDTokenizer"),m(we,"href","/docs/transformers/main/en/model_doc/bart#transformers.BartTokenizer"),m(Se,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDTokenizer"),m(gs,"href","/docs/transformers/main/en/model_doc/longformer#transformers.LongformerModel"),m(Ho,"href","https://colab.research.google.com/drive/12INTTR6n64TzS4RrXZxMSXfrOd9Xzamo?usp=sharing"),m(Ho,"rel","nofollow"),m(Ko,"href","https://colab.research.google.com/drive/12LjJazBl7Gam0XBPy_y0CTOJZeZ34c2v?usp=sharing"),m(Ko,"rel","nofollow"),m(en,"href","https://huggingface.co/patrickvonplaten"),m(en,"rel","nofollow"),m(ao,"id","documentation-resources"),m(ao,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ao,"href","#documentation-resources"),m($t,"class","relative group"),m(_s,"href","../tasks/sequence_classification"),m(bs,"href","../tasks/question_answering"),m(Ts,"href","../tasks/translation"),m(ys,"href","../tasks/summarization"),m(ro,"id","transformers.LEDConfig"),m(ro,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ro,"href","#transformers.LEDConfig"),m(Dt,"class","relative group"),m(ws,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDModel"),m(sn,"href","https://huggingface.co/allenai/led-base-16384"),m(sn,"rel","nofollow"),m(ks,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(vs,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(lo,"id","transformers.LEDTokenizer"),m(lo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(lo,"href","#transformers.LEDTokenizer"),m(Jt,"class","relative group"),m(Ms,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(mo,"id","transformers.LEDTokenizerFast"),m(mo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(mo,"href","#transformers.LEDTokenizerFast"),m(Ut,"class","relative group"),m(Ls,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(bo,"id","transformers.models.led.modeling_led.LEDEncoderBaseModelOutput"),m(bo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(bo,"href","#transformers.models.led.modeling_led.LEDEncoderBaseModelOutput"),m(Ct,"class","relative group"),m(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(To,"id","transformers.LEDModel"),m(To,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(To,"href","#transformers.LEDModel"),m(Vt,"class","relative group"),m(zs,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Un,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Un,"rel","nofollow"),m($s,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDModel"),m(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ko,"id","transformers.LEDForConditionalGeneration"),m(ko,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ko,"href","#transformers.LEDForConditionalGeneration"),m(Rt,"class","relative group"),m(Ds,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Wn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Wn,"rel","nofollow"),m(xs,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDForConditionalGeneration"),m(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(qo,"id","transformers.LEDForSequenceClassification"),m(qo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(qo,"href","#transformers.LEDForSequenceClassification"),m(Xt,"class","relative group"),m(js,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Rn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Rn,"rel","nofollow"),m(Js,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDForSequenceClassification"),m(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($o,"id","transformers.LEDForQuestionAnswering"),m($o,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m($o,"href","#transformers.LEDForQuestionAnswering"),m(Ht,"class","relative group"),m(Us,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Kn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Kn,"rel","nofollow"),m(Cs,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDForQuestionAnswering"),m(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(jo,"id","transformers.TFLEDModel"),m(jo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(jo,"href","#transformers.TFLEDModel"),m(eo,"class","relative group"),m(Ss,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(as,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(as,"rel","nofollow"),m(Is,"href","/docs/transformers/main/en/model_doc/led#transformers.TFLEDModel"),m(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(So,"id","transformers.TFLEDForConditionalGeneration"),m(So,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(So,"href","#transformers.TFLEDForConditionalGeneration"),m(oo,"class","relative group"),m(Gs,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(hs,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(hs,"rel","nofollow"),m(Ns,"href","/docs/transformers/main/en/model_doc/led#transformers.TFLEDForConditionalGeneration"),m(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,_){e(document.head,l),g(o,T,_),g(o,f,_),e(f,u),e(u,b),k(i,b,null),e(f,p),e(f,L),e(L,K),g(o,G,_),g(o,S,_),e(S,V),e(V,re),k(z,re,null),e(S,Be),e(S,ee),e(ee,Oe),g(o,je,_),g(o,O,_),e(O,Ve),e(O,de),e(de,ie),e(O,Ae),g(o,Je,_),g(o,Q,_),e(Q,Re),g(o,Ue,_),g(o,H,_),e(H,Ee),e(Ee,Pe),g(o,_e,_),g(o,j,_),e(j,N),g(o,Ce,_),g(o,D,_),e(D,C),e(C,be),e(be,le),e(C,Xe),e(C,Te),e(Te,W),e(C,Qe),e(C,te),e(te,He),e(C,Ye),e(C,oe),e(oe,Ke),e(C,et),e(C,A),e(A,tt),e(C,ce),e(C,ye),e(ye,qe),e(C,Z),e(C,we),e(we,R),e(C,ot),e(D,nt),e(D,q),e(q,$),e(q,st),e(st,Fe),e(q,vt),e(q,at),e(at,x),e(q,Mt),e(D,Et),e(D,P),e(P,qt),e(P,rt),e(rt,ne),e(P,he),e(P,dt),e(dt,Ft),e(P,pe),e(P,Se),e(Se,Lt),e(P,it),e(P,lt),e(lt,Le),e(P,zt),e(D,Vd),e(D,se),e(se,Ad),e(se,Ys),e(Ys,Rd),e(se,Pd),e(se,Ks),e(Ks,Xd),e(se,Qd),e(se,gs),e(gs,Hd),e(se,Yd),e(se,ea),e(ea,Kd),e(se,ei),e(se,ta),e(ta,ti),e(se,oi),e(se,oa),e(oa,ni),e(se,si),e(D,ai),e(D,ct),e(ct,ri),e(ct,na),e(na,di),e(ct,ii),e(ct,sa),e(sa,li),e(ct,ci),e(ct,aa),e(aa,hi),e(ct,pi),e(D,ui),e(D,Qo),e(Qo,mi),e(Qo,Ho),e(Ho,fi),e(Qo,gi),e(D,_i),e(D,Yo),e(Yo,bi),e(Yo,Ko),e(Ko,Ti),e(Yo,yi),e(D,wi),e(D,ra),e(ra,ki),g(o,Mr,_),g(o,so,_),e(so,vi),e(so,en),e(en,Mi),e(so,Ei),g(o,Er,_),g(o,$t,_),e($t,ao),e(ao,da),k(tn,da,null),e($t,qi),e($t,ia),e(ia,Fi),g(o,qr,_),g(o,Ie,_),e(Ie,la),e(la,_s),e(_s,Li),e(Ie,zi),e(Ie,ca),e(ca,bs),e(bs,$i),e(Ie,Di),e(Ie,ha),e(ha,Ts),e(Ts,xi),e(Ie,ji),e(Ie,pa),e(pa,ys),e(ys,Ji),g(o,Fr,_),g(o,Dt,_),e(Dt,ro),e(ro,ua),k(on,ua,null),e(Dt,Ui),e(Dt,ma),e(ma,Ci),g(o,Lr,_),g(o,ze,_),k(nn,ze,null),e(ze,Si),e(ze,xt),e(xt,Ii),e(xt,ws),e(ws,Gi),e(xt,Ni),e(xt,sn),e(sn,Wi),e(xt,Zi),e(ze,Bi),e(ze,jt),e(jt,Oi),e(jt,ks),e(ks,Vi),e(jt,Ai),e(jt,vs),e(vs,Ri),e(jt,Pi),e(ze,Xi),k(io,ze,null),g(o,zr,_),g(o,Jt,_),e(Jt,lo),e(lo,fa),k(an,fa,null),e(Jt,Qi),e(Jt,ga),e(ga,Hi),g(o,$r,_),g(o,U,_),k(rn,U,null),e(U,Yi),e(U,_a),e(_a,Ki),e(U,el),e(U,ba),e(ba,tl),e(U,ol),k(co,U,null),e(U,nl),e(U,dn),e(dn,sl),e(dn,Ta),e(Ta,al),e(dn,rl),e(U,dl),k(ho,U,null),e(U,il),e(U,ln),e(ln,ll),e(ln,Ms),e(Ms,cl),e(ln,hl),e(U,pl),e(U,mt),k(cn,mt,null),e(mt,ul),e(mt,ya),e(ya,ml),e(mt,fl),e(mt,hn),e(hn,Es),e(Es,gl),e(Es,wa),e(wa,_l),e(hn,bl),e(hn,qs),e(qs,Tl),e(qs,ka),e(ka,yl),e(U,wl),e(U,po),k(pn,po,null),e(po,kl),e(po,un),e(un,vl),e(un,va),e(va,Ml),e(un,El),e(U,ql),e(U,uo),k(mn,uo,null),e(uo,Fl),e(uo,Ma),e(Ma,Ll),e(U,zl),e(U,Fs),k(fn,Fs,null),g(o,Dr,_),g(o,Ut,_),e(Ut,mo),e(mo,Ea),k(gn,Ea,null),e(Ut,$l),e(Ut,qa),e(qa,Dl),g(o,xr,_),g(o,B,_),k(_n,B,null),e(B,xl),e(B,bn),e(bn,jl),e(bn,Fa),e(Fa,Jl),e(bn,Ul),e(B,Cl),e(B,La),e(La,Sl),e(B,Il),k(fo,B,null),e(B,Gl),e(B,Tn),e(Tn,Nl),e(Tn,za),e(za,Wl),e(Tn,Zl),e(B,Bl),k(go,B,null),e(B,Ol),e(B,yn),e(yn,Vl),e(yn,Ls),e(Ls,Al),e(yn,Rl),e(B,Pl),e(B,_o),k(wn,_o,null),e(_o,Xl),e(_o,$a),e($a,Ql),g(o,jr,_),g(o,Ct,_),e(Ct,bo),e(bo,Da),k(kn,Da,null),e(Ct,Hl),e(Ct,xa),e(xa,Yl),g(o,Jr,_),g(o,St,_),k(vn,St,null),e(St,Kl),e(St,ja),e(ja,ec),g(o,Ur,_),g(o,It,_),k(Mn,It,null),e(It,tc),e(It,Ja),e(Ja,oc),g(o,Cr,_),g(o,Gt,_),k(En,Gt,null),e(Gt,nc),e(Gt,Ua),e(Ua,sc),g(o,Sr,_),g(o,Nt,_),k(qn,Nt,null),e(Nt,ac),e(Nt,Ca),e(Ca,rc),g(o,Ir,_),g(o,Wt,_),k(Fn,Wt,null),e(Wt,dc),e(Wt,Sa),e(Sa,ic),g(o,Gr,_),g(o,Zt,_),k(Ln,Zt,null),e(Zt,lc),e(Zt,Ia),e(Ia,cc),g(o,Nr,_),g(o,Bt,_),k(zn,Bt,null),e(Bt,hc),e(Bt,Ga),e(Ga,pc),g(o,Wr,_),g(o,Ot,_),k($n,Ot,null),e(Ot,uc),e(Ot,Na),e(Na,mc),g(o,Zr,_),g(o,Vt,_),e(Vt,To),e(To,Wa),k(Dn,Wa,null),e(Vt,fc),e(Vt,Za),e(Za,gc),g(o,Br,_),g(o,$e,_),k(xn,$e,null),e($e,_c),e($e,jn),e(jn,bc),e(jn,zs),e(zs,Tc),e(jn,yc),e($e,wc),e($e,Jn),e(Jn,kc),e(Jn,Un),e(Un,vc),e(Jn,Mc),e($e,Ec),e($e,Ge),k(Cn,Ge,null),e(Ge,qc),e(Ge,At),e(At,Fc),e(At,$s),e($s,Lc),e(At,zc),e(At,Ba),e(Ba,$c),e(At,Dc),e(Ge,xc),k(yo,Ge,null),e(Ge,jc),k(wo,Ge,null),g(o,Or,_),g(o,Rt,_),e(Rt,ko),e(ko,Oa),k(Sn,Oa,null),e(Rt,Jc),e(Rt,Va),e(Va,Uc),g(o,Vr,_),g(o,De,_),k(In,De,null),e(De,Cc),e(De,Gn),e(Gn,Sc),e(Gn,Ds),e(Ds,Ic),e(Gn,Gc),e(De,Nc),e(De,Nn),e(Nn,Wc),e(Nn,Wn),e(Wn,Zc),e(Nn,Bc),e(De,Oc),e(De,ke),k(Zn,ke,null),e(ke,Vc),e(ke,Pt),e(Pt,Ac),e(Pt,xs),e(xs,Rc),e(Pt,Pc),e(Pt,Aa),e(Aa,Xc),e(Pt,Qc),e(ke,Hc),k(vo,ke,null),e(ke,Yc),k(Mo,ke,null),e(ke,Kc),k(Eo,ke,null),g(o,Ar,_),g(o,Xt,_),e(Xt,qo),e(qo,Ra),k(Bn,Ra,null),e(Xt,eh),e(Xt,Pa),e(Pa,th),g(o,Rr,_),g(o,ue,_),k(On,ue,null),e(ue,oh),e(ue,Xa),e(Xa,nh),e(ue,sh),e(ue,Vn),e(Vn,ah),e(Vn,js),e(js,rh),e(Vn,dh),e(ue,ih),e(ue,An),e(An,lh),e(An,Rn),e(Rn,ch),e(An,hh),e(ue,ph),e(ue,ve),k(Pn,ve,null),e(ve,uh),e(ve,Qt),e(Qt,mh),e(Qt,Js),e(Js,fh),e(Qt,gh),e(Qt,Qa),e(Qa,_h),e(Qt,bh),e(ve,Th),k(Fo,ve,null),e(ve,yh),k(Lo,ve,null),e(ve,wh),k(zo,ve,null),g(o,Pr,_),g(o,Ht,_),e(Ht,$o),e($o,Ha),k(Xn,Ha,null),e(Ht,kh),e(Ht,Ya),e(Ya,vh),g(o,Xr,_),g(o,me,_),k(Qn,me,null),e(me,Mh),e(me,Yt),e(Yt,Eh),e(Yt,Ka),e(Ka,qh),e(Yt,Fh),e(Yt,er),e(er,Lh),e(Yt,zh),e(me,$h),e(me,Hn),e(Hn,Dh),e(Hn,Us),e(Us,xh),e(Hn,jh),e(me,Jh),e(me,Yn),e(Yn,Uh),e(Yn,Kn),e(Kn,Ch),e(Yn,Sh),e(me,Ih),e(me,Ne),k(es,Ne,null),e(Ne,Gh),e(Ne,Kt),e(Kt,Nh),e(Kt,Cs),e(Cs,Wh),e(Kt,Zh),e(Kt,tr),e(tr,Bh),e(Kt,Oh),e(Ne,Vh),k(Do,Ne,null),e(Ne,Ah),k(xo,Ne,null),g(o,Qr,_),g(o,eo,_),e(eo,jo),e(jo,or),k(ts,or,null),e(eo,Rh),e(eo,nr),e(nr,Ph),g(o,Hr,_),g(o,fe,_),k(os,fe,null),e(fe,Xh),e(fe,ns),e(ns,Qh),e(ns,Ss),e(Ss,Hh),e(ns,Yh),e(fe,Kh),e(fe,ss),e(ss,ep),e(ss,as),e(as,tp),e(ss,op),e(fe,np),k(Jo,fe,null),e(fe,sp),e(fe,We),k(rs,We,null),e(We,ap),e(We,to),e(to,rp),e(to,Is),e(Is,dp),e(to,ip),e(to,sr),e(sr,lp),e(to,cp),e(We,hp),k(Uo,We,null),e(We,pp),k(Co,We,null),g(o,Yr,_),g(o,oo,_),e(oo,So),e(So,ar),k(ds,ar,null),e(oo,up),e(oo,rr),e(rr,mp),g(o,Kr,_),g(o,ge,_),k(is,ge,null),e(ge,fp),e(ge,ls),e(ls,gp),e(ls,Gs),e(Gs,_p),e(ls,bp),e(ge,Tp),e(ge,cs),e(cs,yp),e(cs,hs),e(hs,wp),e(cs,kp),e(ge,vp),k(Io,ge,null),e(ge,Mp),e(ge,Ze),k(ps,Ze,null),e(Ze,Ep),e(Ze,no),e(no,qp),e(no,Ns),e(Ns,Fp),e(no,Lp),e(no,dr),e(dr,zp),e(no,$p),e(Ze,Dp),k(Go,Ze,null),e(Ze,xp),k(No,Ze,null),ed=!0},p(o,[_]){const us={};_&2&&(us.$$scope={dirty:_,ctx:o}),io.$set(us);const ir={};_&2&&(ir.$$scope={dirty:_,ctx:o}),co.$set(ir);const lr={};_&2&&(lr.$$scope={dirty:_,ctx:o}),ho.$set(lr);const cr={};_&2&&(cr.$$scope={dirty:_,ctx:o}),fo.$set(cr);const ms={};_&2&&(ms.$$scope={dirty:_,ctx:o}),go.$set(ms);const hr={};_&2&&(hr.$$scope={dirty:_,ctx:o}),yo.$set(hr);const pr={};_&2&&(pr.$$scope={dirty:_,ctx:o}),wo.$set(pr);const ur={};_&2&&(ur.$$scope={dirty:_,ctx:o}),vo.$set(ur);const fs={};_&2&&(fs.$$scope={dirty:_,ctx:o}),Mo.$set(fs);const mr={};_&2&&(mr.$$scope={dirty:_,ctx:o}),Eo.$set(mr);const fr={};_&2&&(fr.$$scope={dirty:_,ctx:o}),Fo.$set(fr);const gr={};_&2&&(gr.$$scope={dirty:_,ctx:o}),Lo.$set(gr);const _r={};_&2&&(_r.$$scope={dirty:_,ctx:o}),zo.$set(_r);const br={};_&2&&(br.$$scope={dirty:_,ctx:o}),Do.$set(br);const X={};_&2&&(X.$$scope={dirty:_,ctx:o}),xo.$set(X);const Y={};_&2&&(Y.$$scope={dirty:_,ctx:o}),Jo.$set(Y);const Tr={};_&2&&(Tr.$$scope={dirty:_,ctx:o}),Uo.$set(Tr);const yr={};_&2&&(yr.$$scope={dirty:_,ctx:o}),Co.$set(yr);const wr={};_&2&&(wr.$$scope={dirty:_,ctx:o}),Io.$set(wr);const kr={};_&2&&(kr.$$scope={dirty:_,ctx:o}),Go.$set(kr);const vr={};_&2&&(vr.$$scope={dirty:_,ctx:o}),No.$set(vr)},i(o){ed||(v(i.$$.fragment,o),v(z.$$.fragment,o),v(tn.$$.fragment,o),v(on.$$.fragment,o),v(nn.$$.fragment,o),v(io.$$.fragment,o),v(an.$$.fragment,o),v(rn.$$.fragment,o),v(co.$$.fragment,o),v(ho.$$.fragment,o),v(cn.$$.fragment,o),v(pn.$$.fragment,o),v(mn.$$.fragment,o),v(fn.$$.fragment,o),v(gn.$$.fragment,o),v(_n.$$.fragment,o),v(fo.$$.fragment,o),v(go.$$.fragment,o),v(wn.$$.fragment,o),v(kn.$$.fragment,o),v(vn.$$.fragment,o),v(Mn.$$.fragment,o),v(En.$$.fragment,o),v(qn.$$.fragment,o),v(Fn.$$.fragment,o),v(Ln.$$.fragment,o),v(zn.$$.fragment,o),v($n.$$.fragment,o),v(Dn.$$.fragment,o),v(xn.$$.fragment,o),v(Cn.$$.fragment,o),v(yo.$$.fragment,o),v(wo.$$.fragment,o),v(Sn.$$.fragment,o),v(In.$$.fragment,o),v(Zn.$$.fragment,o),v(vo.$$.fragment,o),v(Mo.$$.fragment,o),v(Eo.$$.fragment,o),v(Bn.$$.fragment,o),v(On.$$.fragment,o),v(Pn.$$.fragment,o),v(Fo.$$.fragment,o),v(Lo.$$.fragment,o),v(zo.$$.fragment,o),v(Xn.$$.fragment,o),v(Qn.$$.fragment,o),v(es.$$.fragment,o),v(Do.$$.fragment,o),v(xo.$$.fragment,o),v(ts.$$.fragment,o),v(os.$$.fragment,o),v(Jo.$$.fragment,o),v(rs.$$.fragment,o),v(Uo.$$.fragment,o),v(Co.$$.fragment,o),v(ds.$$.fragment,o),v(is.$$.fragment,o),v(Io.$$.fragment,o),v(ps.$$.fragment,o),v(Go.$$.fragment,o),v(No.$$.fragment,o),ed=!0)},o(o){M(i.$$.fragment,o),M(z.$$.fragment,o),M(tn.$$.fragment,o),M(on.$$.fragment,o),M(nn.$$.fragment,o),M(io.$$.fragment,o),M(an.$$.fragment,o),M(rn.$$.fragment,o),M(co.$$.fragment,o),M(ho.$$.fragment,o),M(cn.$$.fragment,o),M(pn.$$.fragment,o),M(mn.$$.fragment,o),M(fn.$$.fragment,o),M(gn.$$.fragment,o),M(_n.$$.fragment,o),M(fo.$$.fragment,o),M(go.$$.fragment,o),M(wn.$$.fragment,o),M(kn.$$.fragment,o),M(vn.$$.fragment,o),M(Mn.$$.fragment,o),M(En.$$.fragment,o),M(qn.$$.fragment,o),M(Fn.$$.fragment,o),M(Ln.$$.fragment,o),M(zn.$$.fragment,o),M($n.$$.fragment,o),M(Dn.$$.fragment,o),M(xn.$$.fragment,o),M(Cn.$$.fragment,o),M(yo.$$.fragment,o),M(wo.$$.fragment,o),M(Sn.$$.fragment,o),M(In.$$.fragment,o),M(Zn.$$.fragment,o),M(vo.$$.fragment,o),M(Mo.$$.fragment,o),M(Eo.$$.fragment,o),M(Bn.$$.fragment,o),M(On.$$.fragment,o),M(Pn.$$.fragment,o),M(Fo.$$.fragment,o),M(Lo.$$.fragment,o),M(zo.$$.fragment,o),M(Xn.$$.fragment,o),M(Qn.$$.fragment,o),M(es.$$.fragment,o),M(Do.$$.fragment,o),M(xo.$$.fragment,o),M(ts.$$.fragment,o),M(os.$$.fragment,o),M(Jo.$$.fragment,o),M(rs.$$.fragment,o),M(Uo.$$.fragment,o),M(Co.$$.fragment,o),M(ds.$$.fragment,o),M(is.$$.fragment,o),M(Io.$$.fragment,o),M(ps.$$.fragment,o),M(Go.$$.fragment,o),M(No.$$.fragment,o),ed=!1},d(o){t(l),o&&t(T),o&&t(f),E(i),o&&t(G),o&&t(S),E(z),o&&t(je),o&&t(O),o&&t(Je),o&&t(Q),o&&t(Ue),o&&t(H),o&&t(_e),o&&t(j),o&&t(Ce),o&&t(D),o&&t(Mr),o&&t(so),o&&t(Er),o&&t($t),E(tn),o&&t(qr),o&&t(Ie),o&&t(Fr),o&&t(Dt),E(on),o&&t(Lr),o&&t(ze),E(nn),E(io),o&&t(zr),o&&t(Jt),E(an),o&&t($r),o&&t(U),E(rn),E(co),E(ho),E(cn),E(pn),E(mn),E(fn),o&&t(Dr),o&&t(Ut),E(gn),o&&t(xr),o&&t(B),E(_n),E(fo),E(go),E(wn),o&&t(jr),o&&t(Ct),E(kn),o&&t(Jr),o&&t(St),E(vn),o&&t(Ur),o&&t(It),E(Mn),o&&t(Cr),o&&t(Gt),E(En),o&&t(Sr),o&&t(Nt),E(qn),o&&t(Ir),o&&t(Wt),E(Fn),o&&t(Gr),o&&t(Zt),E(Ln),o&&t(Nr),o&&t(Bt),E(zn),o&&t(Wr),o&&t(Ot),E($n),o&&t(Zr),o&&t(Vt),E(Dn),o&&t(Br),o&&t($e),E(xn),E(Cn),E(yo),E(wo),o&&t(Or),o&&t(Rt),E(Sn),o&&t(Vr),o&&t(De),E(In),E(Zn),E(vo),E(Mo),E(Eo),o&&t(Ar),o&&t(Xt),E(Bn),o&&t(Rr),o&&t(ue),E(On),E(Pn),E(Fo),E(Lo),E(zo),o&&t(Pr),o&&t(Ht),E(Xn),o&&t(Xr),o&&t(me),E(Qn),E(es),E(Do),E(xo),o&&t(Qr),o&&t(eo),E(ts),o&&t(Hr),o&&t(fe),E(os),E(Jo),E(rs),E(Uo),E(Co),o&&t(Yr),o&&t(oo),E(ds),o&&t(Kr),o&&t(ge),E(is),E(Io),E(ps),E(Go),E(No)}}}const _f={local:"led",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.LEDConfig",title:"LEDConfig"},{local:"transformers.LEDTokenizer",title:"LEDTokenizer"},{local:"transformers.LEDTokenizerFast",title:"LEDTokenizerFast"},{local:"transformers.models.led.modeling_led.LEDEncoderBaseModelOutput",title:"LED specific outputs"},{local:"transformers.LEDModel",title:"LEDModel"},{local:"transformers.LEDForConditionalGeneration",title:"LEDForConditionalGeneration"},{local:"transformers.LEDForSequenceClassification",title:"LEDForSequenceClassification"},{local:"transformers.LEDForQuestionAnswering",title:"LEDForQuestionAnswering"},{local:"transformers.TFLEDModel",title:"TFLEDModel"},{local:"transformers.TFLEDForConditionalGeneration",title:"TFLEDForConditionalGeneration"}],title:"LED"};function bf(F){return Rm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ef extends Bm{constructor(l){super();Om(this,l,bf,gf,Vm,{})}}export{Ef as default,_f as metadata};
