import{S as am,i as rm,s as im,e as a,k as c,w as T,t as n,M as dm,c as r,d as t,m as h,a as i,x as w,h as s,b as m,G as e,g,y,q as v,o as E,B as q,v as lm,L as ht}from"../../chunks/vendor-hf-doc-builder.js";import{T as wt}from"../../chunks/Tip-hf-doc-builder.js";import{D as O}from"../../chunks/Docstring-hf-doc-builder.js";import{C as pt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ge}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ct}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function cm($){let l,k,f,u,b;return u=new pt({props:{code:`from transformers import LEDModel, LEDConfig

# Initializing a LED allenai/led-base-16384 style configuration
configuration = LEDConfig()

# Initializing a model from the allenai/led-base-16384 style configuration
model = LEDModel(configuration)

# Accessing the model configuration
configuration = model.config`,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"),k=n("Example:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"Example:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function hm($){let l,k,f,u,b;return u=new pt({props:{code:`from transformers import LEDTokenizer
tokenizer = LEDTokenizer.from_pretrained("allenai/led-base-16384")
tokenizer("Hello world")['input_ids']
tokenizer(" Hello world")['input_ids']`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python"><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LEDTokenizer</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer = LEDTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&#x27;input_ids&#x27;</span>]</span>
[0, 31414, 232, 2]
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&#x27;input_ids&#x27;</span>]</span>
[0, 20920, 232, 2]`}}),{c(){l=a("p"),k=n("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function pm($){let l,k,f,u,b;return{c(){l=a("p"),k=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(d){l=r(d,"P",{});var p=i(l);k=s(p,"When used with "),f=r(p,"CODE",{});var D=i(f);u=s(D,"is_split_into_words=True"),D.forEach(t),b=s(p,", this tokenizer will add a space before each word (even the first one)."),p.forEach(t)},m(d,p){g(d,l,p),e(l,k),e(l,f),e(f,u),e(l,b)},d(d){d&&t(l)}}}function um($){let l,k,f,u,b;return u=new pt({props:{code:`from transformers import LEDTokenizerFast
tokenizer = LEDTokenizerFast.from_pretrained("allenai/led-base-16384")
tokenizer("Hello world")['input_ids']
tokenizer(" Hello world")['input_ids']`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python"><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LEDTokenizerFast</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer = LEDTokenizerFast.from_pretrained(<span class="hljs-string">&quot;allenai/led-base-16384&quot;</span>)</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&#x27;input_ids&#x27;</span>]</span>
[0, 31414, 232, 2]
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&#x27;input_ids&#x27;</span>]</span>
[0, 20920, 232, 2]`}}),{c(){l=a("p"),k=n("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function mm($){let l,k,f,u,b,d,p,D;return{c(){l=a("p"),k=n("When used with "),f=a("code"),u=n("is_split_into_words=True"),b=n(", this tokenizer needs to be instantiated with "),d=a("code"),p=n("add_prefix_space=True"),D=n(".")},l(Y){l=r(Y,"P",{});var N=i(l);k=s(N,"When used with "),f=r(N,"CODE",{});var j=i(f);u=s(j,"is_split_into_words=True"),j.forEach(t),b=s(N,", this tokenizer needs to be instantiated with "),d=r(N,"CODE",{});var W=i(d);p=s(W,"add_prefix_space=True"),W.forEach(t),D=s(N,"."),N.forEach(t)},m(Y,N){g(Y,l,N),e(l,k),e(l,f),e(f,u),e(l,b),e(l,d),e(d,p),e(l,D)},d(Y){Y&&t(l)}}}function fm($){let l,k,f,u,b;return{c(){l=a("p"),k=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(d){l=r(d,"P",{});var p=i(l);k=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var D=i(f);u=s(D,"Module"),D.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(d,p){g(d,l,p),e(l,k),e(l,f),e(f,u),e(l,b)},d(d){d&&t(l)}}}function gm($){let l,k,f,u,b;return u=new pt({props:{code:`from transformers import AutoTokenizer, LEDModel
import torch

tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
model = LEDModel.from_pretrained("allenai/led-base-16384")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,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"),k=n("Example:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"Example:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function _m($){let l,k,f,u,b;return{c(){l=a("p"),k=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(d){l=r(d,"P",{});var p=i(l);k=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var D=i(f);u=s(D,"Module"),D.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(d,p){g(d,l,p),e(l,k),e(l,f),e(f,u),e(l,b)},d(d){d&&t(l)}}}function bm($){let l,k,f,u,b;return u=new pt({props:{code:`from transformers import AutoTokenizer, LEDForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
TXT = "My friends are <mask> but they eat too many carbs."

model = LEDForConditionalGeneration.from_pretrained("allenai/led-base-16384")
input_ids = tokenizer([TXT], return_tensors="pt")["input_ids"]

prediction = model.generate(input_ids)[0]
print(tokenizer.decode(prediction, skip_special_tokens=True))`,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"),k=n("Conditional generation example:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"Conditional generation example:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function km($){let l,k,f,u,b;return u=new pt({props:{code:`import torch
from transformers import AutoTokenizer, LEDForConditionalGeneration

model = LEDForConditionalGeneration.from_pretrained("allenai/led-large-16384-arxiv")
tokenizer = AutoTokenizer.from_pretrained("allenai/led-large-16384-arxiv")

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

# Global attention on the first token (cf. Beltagy et al. 2020)
global_attention_mask = torch.zeros_like(inputs)
global_attention_mask[:, 0] = 1

# Generate Summary
summary_ids = model.generate(inputs, global_attention_mask=global_attention_mask, num_beams=3, max_length=32)
print(tokenizer.decode(summary_ids[0], skip_special_tokens=True, clean_up_tokenization_spaces=True))`,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"),k=n("Summarization example:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"Summarization example:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function Tm($){let l,k,f,u,b;return{c(){l=a("p"),k=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(d){l=r(d,"P",{});var p=i(l);k=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var D=i(f);u=s(D,"Module"),D.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(d,p){g(d,l,p),e(l,k),e(l,f),e(f,u),e(l,b)},d(d){d&&t(l)}}}function wm($){let l,k,f,u,b;return u=new pt({props:{code:`import torch
from transformers import AutoTokenizer, LEDForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
model = LEDForSequenceClassification.from_pretrained("allenai/led-base-16384")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = LEDForSequenceClassification.from_pretrained("allenai/led-base-16384", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,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"),k=n("Example of single-label classification:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"Example of single-label classification:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function ym($){let l,k,f,u,b;return u=new pt({props:{code:`import torch
from transformers import AutoTokenizer, LEDForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
model = LEDForSequenceClassification.from_pretrained("allenai/led-base-16384", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = LEDForSequenceClassification.from_pretrained(
    "allenai/led-base-16384", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,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"),k=n("Example of multi-label classification:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"Example of multi-label classification:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function vm($){let l,k,f,u,b;return{c(){l=a("p"),k=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(d){l=r(d,"P",{});var p=i(l);k=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var D=i(f);u=s(D,"Module"),D.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(d,p){g(d,l,p),e(l,k),e(l,f),e(f,u),e(l,b)},d(d){d&&t(l)}}}function Em($){let l,k,f,u,b;return u=new pt({props:{code:`from transformers import AutoTokenizer, LEDForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
model = LEDForQuestionAnswering.from_pretrained("allenai/led-base-16384")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,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"),k=n("Example:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"Example:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function qm($){let l,k,f,u,b,d,p,D,Y,N,j,W,re,z,Be,ee,He,Se,Q,Qe,ie,de,We,Me,X,Ue,Oe,J,qe,Re,_e,M,I,Ce,x,A,be,le,Ve,ke,G,Ke,te,Xe,Je,oe,Ze,Ye,U,et,ce,Te,Le,B,we,R,tt,ot;return{c(){l=a("p"),k=n("TensorFlow models and layers in "),f=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),d=c(),p=a("ul"),D=a("li"),Y=n("having all inputs as keyword arguments (like PyTorch models), or"),N=c(),j=a("li"),W=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"),He=n("model.fit()"),Se=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),Qe=n("model.fit()"),ie=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),de=a("code"),We=n("fit()"),Me=n(" and "),X=a("code"),Ue=n("predict()"),Oe=n(`, such as when creating your own layers or models with
the Keras `),J=a("code"),qe=n("Functional"),Re=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),_e=c(),M=a("ul"),I=a("li"),Ce=n("a single Tensor with "),x=a("code"),A=n("input_ids"),be=n(" only and nothing else: "),le=a("code"),Ve=n("model(input_ids)"),ke=c(),G=a("li"),Ke=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=a("code"),Xe=n("model([input_ids, attention_mask])"),Je=n(" or "),oe=a("code"),Ze=n("model([input_ids, attention_mask, token_type_ids])"),Ye=c(),U=a("li"),et=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ce=a("code"),Te=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Le=c(),B=a("p"),we=n(`Note that when creating models and layers with
`),R=a("a"),tt=n("subclassing"),ot=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(L){l=r(L,"P",{});var F=i(l);k=s(F,"TensorFlow models and layers in "),f=r(F,"CODE",{});var nt=i(f);u=s(nt,"transformers"),nt.forEach(t),b=s(F," accept two formats as input:"),F.forEach(t),d=h(L),p=r(L,"UL",{});var $e=i(p);D=r($e,"LI",{});var yt=i(D);Y=s(yt,"having all inputs as keyword arguments (like PyTorch models), or"),yt.forEach(t),N=h($e),j=r($e,"LI",{});var st=i(j);W=s(st,"having all inputs as a list, tuple or dict in the first positional argument."),st.forEach(t),$e.forEach(t),re=h(L),z=r(L,"P",{});var S=i(z);Be=s(S,`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(S,"CODE",{});var vt=i(ee);He=s(vt,"model.fit()"),vt.forEach(t),Se=s(S,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(S,"CODE",{});var Et=i(Q);Qe=s(Et,"model.fit()"),Et.forEach(t),ie=s(S,` supports! If, however, you want to use the second
format outside of Keras methods like `),de=r(S,"CODE",{});var V=i(de);We=s(V,"fit()"),V.forEach(t),Me=s(S," and "),X=r(S,"CODE",{});var qt=i(X);Ue=s(qt,"predict()"),qt.forEach(t),Oe=s(S,`, such as when creating your own layers or models with
the Keras `),J=r(S,"CODE",{});var at=i(J);qe=s(at,"Functional"),at.forEach(t),Re=s(S,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),S.forEach(t),_e=h(L),M=r(L,"UL",{});var ne=i(M);I=r(ne,"LI",{});var he=i(I);Ce=s(he,"a single Tensor with "),x=r(he,"CODE",{});var rt=i(x);A=s(rt,"input_ids"),rt.forEach(t),be=s(he," only and nothing else: "),le=r(he,"CODE",{});var Lt=i(le);Ve=s(Lt,"model(input_ids)"),Lt.forEach(t),he.forEach(t),ke=h(ne),G=r(ne,"LI",{});var pe=i(G);Ke=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 Ae=i(te);Xe=s(Ae,"model([input_ids, attention_mask])"),Ae.forEach(t),Je=s(pe," or "),oe=r(pe,"CODE",{});var $t=i(oe);Ze=s($t,"model([input_ids, attention_mask, token_type_ids])"),$t.forEach(t),pe.forEach(t),Ye=h(ne),U=r(ne,"LI",{});var it=i(U);et=s(it,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ce=r(it,"CODE",{});var dt=i(ce);Te=s(dt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),dt.forEach(t),it.forEach(t),ne.forEach(t),Le=h(L),B=r(L,"P",{});var De=i(B);we=s(De,`Note that when creating models and layers with
`),R=r(De,"A",{href:!0,rel:!0});var Dt=i(R);tt=s(Dt,"subclassing"),Dt.forEach(t),ot=s(De,` 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!`),De.forEach(t),this.h()},h(){m(R,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(R,"rel","nofollow")},m(L,F){g(L,l,F),e(l,k),e(l,f),e(f,u),e(l,b),g(L,d,F),g(L,p,F),e(p,D),e(D,Y),e(p,N),e(p,j),e(j,W),g(L,re,F),g(L,z,F),e(z,Be),e(z,ee),e(ee,He),e(z,Se),e(z,Q),e(Q,Qe),e(z,ie),e(z,de),e(de,We),e(z,Me),e(z,X),e(X,Ue),e(z,Oe),e(z,J),e(J,qe),e(z,Re),g(L,_e,F),g(L,M,F),e(M,I),e(I,Ce),e(I,x),e(x,A),e(I,be),e(I,le),e(le,Ve),e(M,ke),e(M,G),e(G,Ke),e(G,te),e(te,Xe),e(G,Je),e(G,oe),e(oe,Ze),e(M,Ye),e(M,U),e(U,et),e(U,ce),e(ce,Te),g(L,Le,F),g(L,B,F),e(B,we),e(B,R),e(R,tt),e(B,ot)},d(L){L&&t(l),L&&t(d),L&&t(p),L&&t(re),L&&t(z),L&&t(_e),L&&t(M),L&&t(Le),L&&t(B)}}}function Lm($){let l,k,f,u,b;return{c(){l=a("p"),k=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(d){l=r(d,"P",{});var p=i(l);k=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var D=i(f);u=s(D,"Module"),D.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(d,p){g(d,l,p),e(l,k),e(l,f),e(f,u),e(l,b)},d(d){d&&t(l)}}}function $m($){let l,k,f,u,b;return u=new pt({props:{code:`from transformers import AutoTokenizer, TFLEDModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
model = TFLEDModel.from_pretrained("allenai/led-base-16384")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)

last_hidden_states = outputs.last_hidden_state`,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"),k=n("Example:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"Example:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function Dm($){let l,k,f,u,b,d,p,D,Y,N,j,W,re,z,Be,ee,He,Se,Q,Qe,ie,de,We,Me,X,Ue,Oe,J,qe,Re,_e,M,I,Ce,x,A,be,le,Ve,ke,G,Ke,te,Xe,Je,oe,Ze,Ye,U,et,ce,Te,Le,B,we,R,tt,ot;return{c(){l=a("p"),k=n("TensorFlow models and layers in "),f=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),d=c(),p=a("ul"),D=a("li"),Y=n("having all inputs as keyword arguments (like PyTorch models), or"),N=c(),j=a("li"),W=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"),He=n("model.fit()"),Se=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),Qe=n("model.fit()"),ie=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),de=a("code"),We=n("fit()"),Me=n(" and "),X=a("code"),Ue=n("predict()"),Oe=n(`, such as when creating your own layers or models with
the Keras `),J=a("code"),qe=n("Functional"),Re=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),_e=c(),M=a("ul"),I=a("li"),Ce=n("a single Tensor with "),x=a("code"),A=n("input_ids"),be=n(" only and nothing else: "),le=a("code"),Ve=n("model(input_ids)"),ke=c(),G=a("li"),Ke=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=a("code"),Xe=n("model([input_ids, attention_mask])"),Je=n(" or "),oe=a("code"),Ze=n("model([input_ids, attention_mask, token_type_ids])"),Ye=c(),U=a("li"),et=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ce=a("code"),Te=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Le=c(),B=a("p"),we=n(`Note that when creating models and layers with
`),R=a("a"),tt=n("subclassing"),ot=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(L){l=r(L,"P",{});var F=i(l);k=s(F,"TensorFlow models and layers in "),f=r(F,"CODE",{});var nt=i(f);u=s(nt,"transformers"),nt.forEach(t),b=s(F," accept two formats as input:"),F.forEach(t),d=h(L),p=r(L,"UL",{});var $e=i(p);D=r($e,"LI",{});var yt=i(D);Y=s(yt,"having all inputs as keyword arguments (like PyTorch models), or"),yt.forEach(t),N=h($e),j=r($e,"LI",{});var st=i(j);W=s(st,"having all inputs as a list, tuple or dict in the first positional argument."),st.forEach(t),$e.forEach(t),re=h(L),z=r(L,"P",{});var S=i(z);Be=s(S,`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(S,"CODE",{});var vt=i(ee);He=s(vt,"model.fit()"),vt.forEach(t),Se=s(S,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(S,"CODE",{});var Et=i(Q);Qe=s(Et,"model.fit()"),Et.forEach(t),ie=s(S,` supports! If, however, you want to use the second
format outside of Keras methods like `),de=r(S,"CODE",{});var V=i(de);We=s(V,"fit()"),V.forEach(t),Me=s(S," and "),X=r(S,"CODE",{});var qt=i(X);Ue=s(qt,"predict()"),qt.forEach(t),Oe=s(S,`, such as when creating your own layers or models with
the Keras `),J=r(S,"CODE",{});var at=i(J);qe=s(at,"Functional"),at.forEach(t),Re=s(S,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),S.forEach(t),_e=h(L),M=r(L,"UL",{});var ne=i(M);I=r(ne,"LI",{});var he=i(I);Ce=s(he,"a single Tensor with "),x=r(he,"CODE",{});var rt=i(x);A=s(rt,"input_ids"),rt.forEach(t),be=s(he," only and nothing else: "),le=r(he,"CODE",{});var Lt=i(le);Ve=s(Lt,"model(input_ids)"),Lt.forEach(t),he.forEach(t),ke=h(ne),G=r(ne,"LI",{});var pe=i(G);Ke=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 Ae=i(te);Xe=s(Ae,"model([input_ids, attention_mask])"),Ae.forEach(t),Je=s(pe," or "),oe=r(pe,"CODE",{});var $t=i(oe);Ze=s($t,"model([input_ids, attention_mask, token_type_ids])"),$t.forEach(t),pe.forEach(t),Ye=h(ne),U=r(ne,"LI",{});var it=i(U);et=s(it,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ce=r(it,"CODE",{});var dt=i(ce);Te=s(dt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),dt.forEach(t),it.forEach(t),ne.forEach(t),Le=h(L),B=r(L,"P",{});var De=i(B);we=s(De,`Note that when creating models and layers with
`),R=r(De,"A",{href:!0,rel:!0});var Dt=i(R);tt=s(Dt,"subclassing"),Dt.forEach(t),ot=s(De,` 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!`),De.forEach(t),this.h()},h(){m(R,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(R,"rel","nofollow")},m(L,F){g(L,l,F),e(l,k),e(l,f),e(f,u),e(l,b),g(L,d,F),g(L,p,F),e(p,D),e(D,Y),e(p,N),e(p,j),e(j,W),g(L,re,F),g(L,z,F),e(z,Be),e(z,ee),e(ee,He),e(z,Se),e(z,Q),e(Q,Qe),e(z,ie),e(z,de),e(de,We),e(z,Me),e(z,X),e(X,Ue),e(z,Oe),e(z,J),e(J,qe),e(z,Re),g(L,_e,F),g(L,M,F),e(M,I),e(I,Ce),e(I,x),e(x,A),e(I,be),e(I,le),e(le,Ve),e(M,ke),e(M,G),e(G,Ke),e(G,te),e(te,Xe),e(G,Je),e(G,oe),e(oe,Ze),e(M,Ye),e(M,U),e(U,et),e(U,ce),e(ce,Te),g(L,Le,F),g(L,B,F),e(B,we),e(B,R),e(R,tt),e(B,ot)},d(L){L&&t(l),L&&t(d),L&&t(p),L&&t(re),L&&t(z),L&&t(_e),L&&t(M),L&&t(Le),L&&t(B)}}}function zm($){let l,k,f,u,b;return{c(){l=a("p"),k=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(d){l=r(d,"P",{});var p=i(l);k=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var D=i(f);u=s(D,"Module"),D.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(d,p){g(d,l,p),e(l,k),e(l,f),e(f,u),e(l,b)},d(d){d&&t(l)}}}function Fm($){let l,k,f,u,b;return u=new pt({props:{code:`from transformers import AutoTokenizer, TFLEDForConditionalGeneration
import tensorflow as tf

mname = "allenai/led-base-16384"
tokenizer = AutoTokenizer.from_pretrained(mname)
TXT = "My friends are <mask> but they eat too many carbs."
model = TFLEDForConditionalGeneration.from_pretrained(mname)
batch = tokenizer([TXT], return_tensors="tf")
logits = model(inputs=batch.input_ids).logits
probs = tf.nn.softmax(logits[0])
# probs[5] is associated with the mask token`,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"),k=n("Examples:"),f=c(),T(u.$$.fragment)},l(d){l=r(d,"P",{});var p=i(l);k=s(p,"Examples:"),p.forEach(t),f=h(d),w(u.$$.fragment,d)},m(d,p){g(d,l,p),e(l,k),g(d,f,p),y(u,d,p),b=!0},p:ht,i(d){b||(v(u.$$.fragment,d),b=!0)},o(d){E(u.$$.fragment,d),b=!1},d(d){d&&t(l),d&&t(f),q(u,d)}}}function xm($){let l,k,f,u,b,d,p,D,Y,N,j,W,re,z,Be,ee,He,Se,Q,Qe,ie,de,We,Me,X,Ue,Oe,J,qe,Re,_e,M,I,Ce,x,A,be,le,Ve,ke,G,Ke,te,Xe,Je,oe,Ze,Ye,U,et,ce,Te,Le,B,we,R,tt,ot,L,F,nt,$e,yt,st,S,vt,Et,V,qt,at,ne,he,rt,Lt,pe,Ae,$t,it,dt,De,Dt,$i,se,Di,Hs,zi,Fi,Qs,xi,Si,hs,Mi,Oi,Ws,Ci,Ai,Us,ji,Pi,Rs,Ni,Ii,Gi,lt,Bi,Vs,Hi,Qi,Ks,Wi,Ui,Xs,Ri,Vi,Ki,Uo,Xi,Ro,Ji,Zi,Yi,Vo,ed,Ko,td,od,nd,Js,sd,lr,oo,ad,Xo,rd,id,cr,zt,no,Zs,Jo,dd,Ys,ld,hr,ze,Zo,cd,Ft,hd,ps,pd,ud,Yo,md,fd,gd,xt,_d,us,bd,kd,ms,Td,wd,yd,so,pr,St,ao,ea,en,vd,ta,Ed,ur,C,tn,qd,oa,Ld,$d,na,Dd,zd,ro,Fd,on,xd,sa,Sd,Md,Od,io,Cd,nn,Ad,fs,jd,Pd,Nd,ut,sn,Id,aa,Gd,Bd,an,gs,Hd,ra,Qd,Wd,_s,Ud,ia,Rd,Vd,lo,rn,Kd,dn,Xd,da,Jd,Zd,Yd,co,ln,el,la,tl,ol,bs,cn,mr,Mt,ho,ca,hn,nl,ha,sl,fr,H,pn,al,un,rl,pa,il,dl,ll,ua,cl,hl,po,pl,mn,ul,ma,ml,fl,gl,uo,_l,fn,bl,ks,kl,Tl,wl,mo,gn,yl,fa,vl,gr,Ot,fo,ga,_n,El,_a,ql,_r,Ct,bn,Ll,ba,$l,br,At,kn,Dl,ka,zl,kr,jt,Tn,Fl,Ta,xl,Tr,Pt,wn,Sl,wa,Ml,wr,Nt,yn,Ol,ya,Cl,yr,It,vn,Al,va,jl,vr,Gt,En,Pl,Ea,Nl,Er,Bt,qn,Il,qa,Gl,qr,Ht,go,La,Ln,Bl,$a,Hl,Lr,Fe,$n,Ql,Dn,Wl,Ts,Ul,Rl,Vl,zn,Kl,Fn,Xl,Jl,Zl,je,xn,Yl,Qt,ec,ws,tc,oc,Da,nc,sc,ac,_o,rc,bo,$r,Wt,ko,za,Sn,ic,Fa,dc,Dr,xe,Mn,lc,On,cc,ys,hc,pc,uc,Cn,mc,An,fc,gc,_c,ye,jn,bc,Ut,kc,vs,Tc,wc,xa,yc,vc,Ec,To,qc,wo,Lc,yo,zr,Rt,vo,Sa,Pn,$c,Ma,Dc,Fr,ue,Nn,zc,Oa,Fc,xc,In,Sc,Es,Mc,Oc,Cc,Gn,Ac,Bn,jc,Pc,Nc,ve,Hn,Ic,Vt,Gc,qs,Bc,Hc,Ca,Qc,Wc,Uc,Eo,Rc,qo,Vc,Lo,xr,Kt,$o,Aa,Qn,Kc,ja,Xc,Sr,me,Wn,Jc,Xt,Zc,Pa,Yc,eh,Na,th,oh,nh,Un,sh,Ls,ah,rh,ih,Rn,dh,Vn,lh,ch,hh,Pe,Kn,ph,Jt,uh,$s,mh,fh,Ia,gh,_h,bh,Do,kh,zo,Mr,Zt,Fo,Ga,Xn,Th,Ba,wh,Or,fe,Jn,yh,Zn,vh,Ds,Eh,qh,Lh,Yn,$h,es,Dh,zh,Fh,xo,xh,Ne,ts,Sh,Yt,Mh,zs,Oh,Ch,Ha,Ah,jh,Ph,So,Nh,Mo,Cr,eo,Oo,Qa,os,Ih,Wa,Gh,Ar,ge,ns,Bh,ss,Hh,Fs,Qh,Wh,Uh,as,Rh,rs,Vh,Kh,Xh,Co,Jh,Ie,is,Zh,to,Yh,xs,ep,tp,Ua,op,np,sp,Ao,ap,jo,jr;return d=new Ge({}),z=new Ge({}),Jo=new Ge({}),Zo=new O({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"}}),so=new ct({props:{anchor:"transformers.LEDConfig.example",$$slots:{default:[cm]},$$scope:{ctx:$}}}),en=new Ge({}),tn=new O({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"}}),ro=new ct({props:{anchor:"transformers.LEDTokenizer.example",$$slots:{default:[hm]},$$scope:{ctx:$}}}),io=new wt({props:{$$slots:{default:[pm]},$$scope:{ctx:$}}}),sn=new O({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#L340",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>
`}}),rn=new O({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#L366",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>
`}}),ln=new O({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#L394",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),cn=new O({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#L310"}}),hn=new Ge({}),pn=new O({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"}}),po=new ct({props:{anchor:"transformers.LEDTokenizerFast.example",$$slots:{default:[um]},$$scope:{ctx:$}}}),uo=new wt({props:{$$slots:{default:[mm]},$$scope:{ctx:$}}}),gn=new O({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#L271",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),_n=new Ge({}),bn=new O({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#L1176"}}),kn=new O({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#L1219"}}),Tn=new O({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#L1287"}}),wn=new O({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#L1354"}}),yn=new O({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#L1421"}}),vn=new O({props:{name:"class transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput",anchor:"transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput",parameters:[{name:"last_hidden_state",val:": Tensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"global_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = 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#L1355"}}),En=new O({props:{name:"class transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput",anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqModelOutput",parameters:[{name:"last_hidden_state",val:": Tensor = None"},{name:"past_key_values",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_global_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = 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#L1398"}}),qn=new O({props:{name:"class transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput",anchor:"transformers.models.led.modeling_tf_led.TFLEDSeq2SeqLMOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"logits",val:": Tensor = None"},{name:"past_key_values",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_last_hidden_state",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_global_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = 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#L1466"}}),Ln=new Ge({}),$n=new O({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#L2210"}}),xn=new O({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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#L2239",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>
`}}),_o=new wt({props:{$$slots:{default:[fm]},$$scope:{ctx:$}}}),bo=new ct({props:{anchor:"transformers.LEDModel.forward.example",$$slots:{default:[gm]},$$scope:{ctx:$}}}),Sn=new Ge({}),Mn=new O({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#L2334"}}),jn=new O({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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#L2380",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>
`}}),To=new wt({props:{$$slots:{default:[_m]},$$scope:{ctx:$}}}),wo=new ct({props:{anchor:"transformers.LEDForConditionalGeneration.forward.example",$$slots:{default:[bm]},$$scope:{ctx:$}}}),yo=new ct({props:{anchor:"transformers.LEDForConditionalGeneration.forward.example-2",$$slots:{default:[km]},$$scope:{ctx:$}}}),Pn=new Ge({}),Nn=new O({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#L2529"}}),Hn=new O({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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#L2550",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>
`}}),Eo=new wt({props:{$$slots:{default:[Tm]},$$scope:{ctx:$}}}),qo=new ct({props:{anchor:"transformers.LEDForSequenceClassification.forward.example",$$slots:{default:[wm]},$$scope:{ctx:$}}}),Lo=new ct({props:{anchor:"transformers.LEDForSequenceClassification.forward.example-2",$$slots:{default:[ym]},$$scope:{ctx:$}}}),Qn=new Ge({}),Wn=new O({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#L2664"}}),Kn=new O({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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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#L2678",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 wt({props:{$$slots:{default:[vm]},$$scope:{ctx:$}}}),zo=new ct({props:{anchor:"transformers.LEDForQuestionAnswering.forward.example",$$slots:{default:[Em]},$$scope:{ctx:$}}}),Xn=new Ge({}),Jn=new O({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#L2256"}}),xo=new wt({props:{$$slots:{default:[qm]},$$scope:{ctx:$}}}),ts=new O({props:{name:"call",anchor:"transformers.TFLEDModel.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"decoder_input_ids",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"decoder_head_mask",val:" = None"},{name:"encoder_outputs",val:": typing.Union[typing.Tuple, transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput, NoneType] = None"},{name:"global_attention_mask",val:" = None"},{name:"past_key_values",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:" = 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/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.FloatTensor</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#L2268",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>
`}}),So=new wt({props:{$$slots:{default:[Lm]},$$scope:{ctx:$}}}),Mo=new ct({props:{anchor:"transformers.TFLEDModel.call.example",$$slots:{default:[$m]},$$scope:{ctx:$}}}),os=new Ge({}),ns=new O({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#L2361"}}),Co=new wt({props:{$$slots:{default:[Dm]},$$scope:{ctx:$}}}),is=new O({props:{name:"call",anchor:"transformers.TFLEDForConditionalGeneration.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_input_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_outputs",val:": typing.Optional[transformers.models.led.modeling_tf_led.TFLEDEncoderBaseModelOutput] = None"},{name:"global_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = 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"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = 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/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.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/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.FloatTensor</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#L2402",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>
`}}),Ao=new wt({props:{$$slots:{default:[zm]},$$scope:{ctx:$}}}),jo=new ct({props:{anchor:"transformers.TFLEDForConditionalGeneration.call.example",$$slots:{default:[Fm]},$$scope:{ctx:$}}}),{c(){l=a("meta"),k=c(),f=a("h1"),u=a("a"),b=a("span"),T(d.$$.fragment),p=c(),D=a("span"),Y=n("LED"),N=c(),j=a("h2"),W=a("a"),re=a("span"),T(z.$$.fragment),Be=c(),ee=a("span"),He=n("Overview"),Se=c(),Q=a("p"),Qe=n("The LED model was proposed in "),ie=a("a"),de=n("Longformer: The Long-Document Transformer"),We=n(` by Iz
Beltagy, Matthew E. Peters, Arman Cohan.`),Me=c(),X=a("p"),Ue=n("The abstract from the paper is the following:"),Oe=c(),J=a("p"),qe=a("em"),Re=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(),M=a("p"),I=n("Tips:"),Ce=c(),x=a("ul"),A=a("li"),be=a("a"),le=n("LEDForConditionalGeneration"),Ve=n(` is an extension of
`),ke=a("a"),G=n("BartForConditionalGeneration"),Ke=n(" exchanging the traditional "),te=a("em"),Xe=n("self-attention"),Je=n(` layer with
`),oe=a("em"),Ze=n("Longformer"),Ye=n("\u2019s "),U=a("em"),et=n("chunked self-attention"),ce=n(" layer. "),Te=a("a"),Le=n("LEDTokenizer"),B=n(` is an alias of
`),we=a("a"),R=n("BartTokenizer"),tt=n("."),ot=c(),L=a("li"),F=n("LED works very well on long-range "),nt=a("em"),$e=n("sequence-to-sequence"),yt=n(" tasks where the "),st=a("code"),S=n("input_ids"),vt=n(` largely exceed a length of
1024 tokens.`),Et=c(),V=a("li"),qt=n("LED pads the "),at=a("code"),ne=n("input_ids"),he=n(" to be a multiple of "),rt=a("code"),Lt=n("config.attention_window"),pe=n(` if required. Therefore a small speed-up is
gained, when `),Ae=a("a"),$t=n("LEDTokenizer"),it=n(" is used with the "),dt=a("code"),De=n("pad_to_multiple_of"),Dt=n(" argument."),$i=c(),se=a("li"),Di=n("LED makes use of "),Hs=a("em"),zi=n("global attention"),Fi=n(" by means of the "),Qs=a("code"),xi=n("global_attention_mask"),Si=n(` (see
`),hs=a("a"),Mi=n("LongformerModel"),Oi=n("). For summarization, it is advised to put "),Ws=a("em"),Ci=n("global attention"),Ai=n(` only on the first
`),Us=a("code"),ji=n("<s>"),Pi=n(" token. For question answering, it is advised to put "),Rs=a("em"),Ni=n("global attention"),Ii=n(" on all tokens of the question."),Gi=c(),lt=a("li"),Bi=n("To fine-tune LED on all 16384, "),Vs=a("em"),Hi=n("gradient checkpointing"),Qi=n(` can be enabled in case training leads to out-of-memory (OOM)
errors. This can be done by executing `),Ks=a("code"),Wi=n("model.gradient_checkpointing_enable()"),Ui=n(`.
Moreover, the `),Xs=a("code"),Ri=n("use_cache=False"),Vi=n(`
flag can be used to disable the caching mechanism to save memory.`),Ki=c(),Uo=a("li"),Xi=n("A notebook showing how to evaluate LED, can be accessed "),Ro=a("a"),Ji=n("here"),Zi=n("."),Yi=c(),Vo=a("li"),ed=n("A notebook showing how to fine-tune LED, can be accessed "),Ko=a("a"),td=n("here"),od=n("."),nd=c(),Js=a("li"),sd=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.`),lr=c(),oo=a("p"),ad=n("This model was contributed by "),Xo=a("a"),rd=n("patrickvonplaten"),id=n("."),cr=c(),zt=a("h2"),no=a("a"),Zs=a("span"),T(Jo.$$.fragment),dd=c(),Ys=a("span"),ld=n("LEDConfig"),hr=c(),ze=a("div"),T(Zo.$$.fragment),cd=c(),Ft=a("p"),hd=n("This is the configuration class to store the configuration of a "),ps=a("a"),pd=n("LEDModel"),ud=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
`),Yo=a("a"),md=n("allenai/led-base-16384"),fd=n(" architecture."),gd=c(),xt=a("p"),_d=n("Configuration objects inherit from "),us=a("a"),bd=n("PretrainedConfig"),kd=n(` and can be used to control the model outputs. Read the
documentation from `),ms=a("a"),Td=n("PretrainedConfig"),wd=n(" for more information."),yd=c(),T(so.$$.fragment),pr=c(),St=a("h2"),ao=a("a"),ea=a("span"),T(en.$$.fragment),vd=c(),ta=a("span"),Ed=n("LEDTokenizer"),ur=c(),C=a("div"),T(tn.$$.fragment),qd=c(),oa=a("p"),Ld=n("Constructs a LED tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),$d=c(),na=a("p"),Dd=n("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),zd=c(),T(ro.$$.fragment),Fd=c(),on=a("p"),xd=n("You can get around that behavior by passing "),sa=a("code"),Sd=n("add_prefix_space=True"),Md=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.`),Od=c(),T(io.$$.fragment),Cd=c(),nn=a("p"),Ad=n("This tokenizer inherits from "),fs=a("a"),jd=n("PreTrainedTokenizer"),Pd=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Nd=c(),ut=a("div"),T(sn.$$.fragment),Id=c(),aa=a("p"),Gd=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:`),Bd=c(),an=a("ul"),gs=a("li"),Hd=n("single sequence: "),ra=a("code"),Qd=n("<s> X </s>"),Wd=c(),_s=a("li"),Ud=n("pair of sequences: "),ia=a("code"),Rd=n("<s> A </s></s> B </s>"),Vd=c(),lo=a("div"),T(rn.$$.fragment),Kd=c(),dn=a("p"),Xd=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 `),da=a("code"),Jd=n("prepare_for_model"),Zd=n(" method."),Yd=c(),co=a("div"),T(ln.$$.fragment),el=c(),la=a("p"),tl=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.`),ol=c(),bs=a("div"),T(cn.$$.fragment),mr=c(),Mt=a("h2"),ho=a("a"),ca=a("span"),T(hn.$$.fragment),nl=c(),ha=a("span"),sl=n("LEDTokenizerFast"),fr=c(),H=a("div"),T(pn.$$.fragment),al=c(),un=a("p"),rl=n("Construct a \u201Cfast\u201D LED tokenizer (backed by HuggingFace\u2019s "),pa=a("em"),il=n("tokenizers"),dl=n(` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),ll=c(),ua=a("p"),cl=n("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),hl=c(),T(po.$$.fragment),pl=c(),mn=a("p"),ul=n("You can get around that behavior by passing "),ma=a("code"),ml=n("add_prefix_space=True"),fl=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.`),gl=c(),T(uo.$$.fragment),_l=c(),fn=a("p"),bl=n("This tokenizer inherits from "),ks=a("a"),kl=n("PreTrainedTokenizerFast"),Tl=n(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),wl=c(),mo=a("div"),T(gn.$$.fragment),yl=c(),fa=a("p"),vl=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.`),gr=c(),Ot=a("h2"),fo=a("a"),ga=a("span"),T(_n.$$.fragment),El=c(),_a=a("span"),ql=n("LED specific outputs"),_r=c(),Ct=a("div"),T(bn.$$.fragment),Ll=c(),ba=a("p"),$l=n("Base class for LEDEncoder\u2019s outputs, with potential hidden states, local and global attentions."),br=c(),At=a("div"),T(kn.$$.fragment),Dl=c(),ka=a("p"),zl=n(`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),kr=c(),jt=a("div"),T(Tn.$$.fragment),Fl=c(),Ta=a("p"),xl=n("Base class for sequence-to-sequence language models outputs."),Tr=c(),Pt=a("div"),T(wn.$$.fragment),Sl=c(),wa=a("p"),Ml=n("Base class for outputs of sequence-to-sequence sentence classification models."),wr=c(),Nt=a("div"),T(yn.$$.fragment),Ol=c(),ya=a("p"),Cl=n("Base class for outputs of sequence-to-sequence question answering models."),yr=c(),It=a("div"),T(vn.$$.fragment),Al=c(),va=a("p"),jl=n("Base class for Longformer\u2019s outputs, with potential hidden states, local and global attentions."),vr=c(),Gt=a("div"),T(En.$$.fragment),Pl=c(),Ea=a("p"),Nl=n(`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),Er=c(),Bt=a("div"),T(qn.$$.fragment),Il=c(),qa=a("p"),Gl=n("Base class for sequence-to-sequence language models outputs."),qr=c(),Ht=a("h2"),go=a("a"),La=a("span"),T(Ln.$$.fragment),Bl=c(),$a=a("span"),Hl=n("LEDModel"),Lr=c(),Fe=a("div"),T($n.$$.fragment),Ql=c(),Dn=a("p"),Wl=n(`The bare LED Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ts=a("a"),Ul=n("PreTrainedModel"),Rl=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.)`),Vl=c(),zn=a("p"),Kl=n("This model is also a PyTorch "),Fn=a("a"),Xl=n("torch.nn.Module"),Jl=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),Zl=c(),je=a("div"),T(xn.$$.fragment),Yl=c(),Qt=a("p"),ec=n("The "),ws=a("a"),tc=n("LEDModel"),oc=n(" forward method, overrides the "),Da=a("code"),nc=n("__call__"),sc=n(" special method."),ac=c(),T(_o.$$.fragment),rc=c(),T(bo.$$.fragment),$r=c(),Wt=a("h2"),ko=a("a"),za=a("span"),T(Sn.$$.fragment),ic=c(),Fa=a("span"),dc=n("LEDForConditionalGeneration"),Dr=c(),xe=a("div"),T(Mn.$$.fragment),lc=c(),On=a("p"),cc=n(`The LED Model with a language modeling head. Can be used for summarization.
This model inherits from `),ys=a("a"),hc=n("PreTrainedModel"),pc=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.)`),uc=c(),Cn=a("p"),mc=n("This model is also a PyTorch "),An=a("a"),fc=n("torch.nn.Module"),gc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),_c=c(),ye=a("div"),T(jn.$$.fragment),bc=c(),Ut=a("p"),kc=n("The "),vs=a("a"),Tc=n("LEDForConditionalGeneration"),wc=n(" forward method, overrides the "),xa=a("code"),yc=n("__call__"),vc=n(" special method."),Ec=c(),T(To.$$.fragment),qc=c(),T(wo.$$.fragment),Lc=c(),T(yo.$$.fragment),zr=c(),Rt=a("h2"),vo=a("a"),Sa=a("span"),T(Pn.$$.fragment),$c=c(),Ma=a("span"),Dc=n("LEDForSequenceClassification"),Fr=c(),ue=a("div"),T(Nn.$$.fragment),zc=c(),Oa=a("p"),Fc=n(`LED model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),xc=c(),In=a("p"),Sc=n("This model inherits from "),Es=a("a"),Mc=n("PreTrainedModel"),Oc=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.)`),Cc=c(),Gn=a("p"),Ac=n("This model is also a PyTorch "),Bn=a("a"),jc=n("torch.nn.Module"),Pc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),Nc=c(),ve=a("div"),T(Hn.$$.fragment),Ic=c(),Vt=a("p"),Gc=n("The "),qs=a("a"),Bc=n("LEDForSequenceClassification"),Hc=n(" forward method, overrides the "),Ca=a("code"),Qc=n("__call__"),Wc=n(" special method."),Uc=c(),T(Eo.$$.fragment),Rc=c(),T(qo.$$.fragment),Vc=c(),T(Lo.$$.fragment),xr=c(),Kt=a("h2"),$o=a("a"),Aa=a("span"),T(Qn.$$.fragment),Kc=c(),ja=a("span"),Xc=n("LEDForQuestionAnswering"),Sr=c(),me=a("div"),T(Wn.$$.fragment),Jc=c(),Xt=a("p"),Zc=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 `),Pa=a("code"),Yc=n("span start logits"),eh=n(" and "),Na=a("code"),th=n("span end logits"),oh=n(")."),nh=c(),Un=a("p"),sh=n("This model inherits from "),Ls=a("a"),ah=n("PreTrainedModel"),rh=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(),Rn=a("p"),dh=n("This model is also a PyTorch "),Vn=a("a"),lh=n("torch.nn.Module"),ch=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),hh=c(),Pe=a("div"),T(Kn.$$.fragment),ph=c(),Jt=a("p"),uh=n("The "),$s=a("a"),mh=n("LEDForQuestionAnswering"),fh=n(" forward method, overrides the "),Ia=a("code"),gh=n("__call__"),_h=n(" special method."),bh=c(),T(Do.$$.fragment),kh=c(),T(zo.$$.fragment),Mr=c(),Zt=a("h2"),Fo=a("a"),Ga=a("span"),T(Xn.$$.fragment),Th=c(),Ba=a("span"),wh=n("TFLEDModel"),Or=c(),fe=a("div"),T(Jn.$$.fragment),yh=c(),Zn=a("p"),vh=n(`The bare LED Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ds=a("a"),Eh=n("TFPreTrainedModel"),qh=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.)`),Lh=c(),Yn=a("p"),$h=n("This model is also a "),es=a("a"),Dh=n("tf.keras.Model"),zh=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.`),Fh=c(),T(xo.$$.fragment),xh=c(),Ne=a("div"),T(ts.$$.fragment),Sh=c(),Yt=a("p"),Mh=n("The "),zs=a("a"),Oh=n("TFLEDModel"),Ch=n(" forward method, overrides the "),Ha=a("code"),Ah=n("__call__"),jh=n(" special method."),Ph=c(),T(So.$$.fragment),Nh=c(),T(Mo.$$.fragment),Cr=c(),eo=a("h2"),Oo=a("a"),Qa=a("span"),T(os.$$.fragment),Ih=c(),Wa=a("span"),Gh=n("TFLEDForConditionalGeneration"),Ar=c(),ge=a("div"),T(ns.$$.fragment),Bh=c(),ss=a("p"),Hh=n(`The LED Model with a language modeling head. Can be used for summarization.
This model inherits from `),Fs=a("a"),Qh=n("TFPreTrainedModel"),Wh=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.)`),Uh=c(),as=a("p"),Rh=n("This model is also a "),rs=a("a"),Vh=n("tf.keras.Model"),Kh=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.`),Xh=c(),T(Co.$$.fragment),Jh=c(),Ie=a("div"),T(is.$$.fragment),Zh=c(),to=a("p"),Yh=n("The "),xs=a("a"),ep=n("TFLEDForConditionalGeneration"),tp=n(" forward method, overrides the "),Ua=a("code"),op=n("__call__"),np=n(" special method."),sp=c(),T(Ao.$$.fragment),ap=c(),T(jo.$$.fragment),this.h()},l(o){const _=dm('[data-svelte="svelte-1phssyn"]',document.head);l=r(_,"META",{name:!0,content:!0}),_.forEach(t),k=h(o),f=r(o,"H1",{class:!0});var ds=i(f);u=r(ds,"A",{id:!0,class:!0,href:!0});var Ra=i(u);b=r(Ra,"SPAN",{});var Va=i(b);w(d.$$.fragment,Va),Va.forEach(t),Ra.forEach(t),p=h(ds),D=r(ds,"SPAN",{});var Ka=i(D);Y=s(Ka,"LED"),Ka.forEach(t),ds.forEach(t),N=h(o),j=r(o,"H2",{class:!0});var ls=i(j);W=r(ls,"A",{id:!0,class:!0,href:!0});var Xa=i(W);re=r(Xa,"SPAN",{});var Ja=i(re);w(z.$$.fragment,Ja),Ja.forEach(t),Xa.forEach(t),Be=h(ls),ee=r(ls,"SPAN",{});var Za=i(ee);He=s(Za,"Overview"),Za.forEach(t),ls.forEach(t),Se=h(o),Q=r(o,"P",{});var cs=i(Q);Qe=s(cs,"The LED model was proposed in "),ie=r(cs,"A",{href:!0,rel:!0});var Ya=i(ie);de=s(Ya,"Longformer: The Long-Document Transformer"),Ya.forEach(t),We=s(cs,` by Iz
Beltagy, Matthew E. Peters, Arman Cohan.`),cs.forEach(t),Me=h(o),X=r(o,"P",{});var er=i(X);Ue=s(er,"The abstract from the paper is the following:"),er.forEach(t),Oe=h(o),J=r(o,"P",{});var tr=i(J);qe=r(tr,"EM",{});var or=i(qe);Re=s(or,`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.`),or.forEach(t),tr.forEach(t),_e=h(o),M=r(o,"P",{});var nr=i(M);I=s(nr,"Tips:"),nr.forEach(t),Ce=h(o),x=r(o,"UL",{});var K=i(x);A=r(K,"LI",{});var Z=i(A);be=r(Z,"A",{href:!0});var sr=i(be);le=s(sr,"LEDForConditionalGeneration"),sr.forEach(t),Ve=s(Z,` is an extension of
`),ke=r(Z,"A",{href:!0});var ar=i(ke);G=s(ar,"BartForConditionalGeneration"),ar.forEach(t),Ke=s(Z," exchanging the traditional "),te=r(Z,"EM",{});var rr=i(te);Xe=s(rr,"self-attention"),rr.forEach(t),Je=s(Z,` layer with
`),oe=r(Z,"EM",{});var ir=i(oe);Ze=s(ir,"Longformer"),ir.forEach(t),Ye=s(Z,"\u2019s "),U=r(Z,"EM",{});var dr=i(U);et=s(dr,"chunked self-attention"),dr.forEach(t),ce=s(Z," layer. "),Te=r(Z,"A",{href:!0});var dp=i(Te);Le=s(dp,"LEDTokenizer"),dp.forEach(t),B=s(Z,` is an alias of
`),we=r(Z,"A",{href:!0});var lp=i(we);R=s(lp,"BartTokenizer"),lp.forEach(t),tt=s(Z,"."),Z.forEach(t),ot=h(K),L=r(K,"LI",{});var Ss=i(L);F=s(Ss,"LED works very well on long-range "),nt=r(Ss,"EM",{});var cp=i(nt);$e=s(cp,"sequence-to-sequence"),cp.forEach(t),yt=s(Ss," tasks where the "),st=r(Ss,"CODE",{});var hp=i(st);S=s(hp,"input_ids"),hp.forEach(t),vt=s(Ss,` largely exceed a length of
1024 tokens.`),Ss.forEach(t),Et=h(K),V=r(K,"LI",{});var mt=i(V);qt=s(mt,"LED pads the "),at=r(mt,"CODE",{});var pp=i(at);ne=s(pp,"input_ids"),pp.forEach(t),he=s(mt," to be a multiple of "),rt=r(mt,"CODE",{});var up=i(rt);Lt=s(up,"config.attention_window"),up.forEach(t),pe=s(mt,` if required. Therefore a small speed-up is
gained, when `),Ae=r(mt,"A",{href:!0});var mp=i(Ae);$t=s(mp,"LEDTokenizer"),mp.forEach(t),it=s(mt," is used with the "),dt=r(mt,"CODE",{});var fp=i(dt);De=s(fp,"pad_to_multiple_of"),fp.forEach(t),Dt=s(mt," argument."),mt.forEach(t),$i=h(K),se=r(K,"LI",{});var Ee=i(se);Di=s(Ee,"LED makes use of "),Hs=r(Ee,"EM",{});var gp=i(Hs);zi=s(gp,"global attention"),gp.forEach(t),Fi=s(Ee," by means of the "),Qs=r(Ee,"CODE",{});var _p=i(Qs);xi=s(_p,"global_attention_mask"),_p.forEach(t),Si=s(Ee,` (see
`),hs=r(Ee,"A",{href:!0});var bp=i(hs);Mi=s(bp,"LongformerModel"),bp.forEach(t),Oi=s(Ee,"). For summarization, it is advised to put "),Ws=r(Ee,"EM",{});var kp=i(Ws);Ci=s(kp,"global attention"),kp.forEach(t),Ai=s(Ee,` only on the first
`),Us=r(Ee,"CODE",{});var Tp=i(Us);ji=s(Tp,"<s>"),Tp.forEach(t),Pi=s(Ee," token. For question answering, it is advised to put "),Rs=r(Ee,"EM",{});var wp=i(Rs);Ni=s(wp,"global attention"),wp.forEach(t),Ii=s(Ee," on all tokens of the question."),Ee.forEach(t),Gi=h(K),lt=r(K,"LI",{});var Po=i(lt);Bi=s(Po,"To fine-tune LED on all 16384, "),Vs=r(Po,"EM",{});var yp=i(Vs);Hi=s(yp,"gradient checkpointing"),yp.forEach(t),Qi=s(Po,` can be enabled in case training leads to out-of-memory (OOM)
errors. This can be done by executing `),Ks=r(Po,"CODE",{});var vp=i(Ks);Wi=s(vp,"model.gradient_checkpointing_enable()"),vp.forEach(t),Ui=s(Po,`.
Moreover, the `),Xs=r(Po,"CODE",{});var Ep=i(Xs);Ri=s(Ep,"use_cache=False"),Ep.forEach(t),Vi=s(Po,`
flag can be used to disable the caching mechanism to save memory.`),Po.forEach(t),Ki=h(K),Uo=r(K,"LI",{});var Pr=i(Uo);Xi=s(Pr,"A notebook showing how to evaluate LED, can be accessed "),Ro=r(Pr,"A",{href:!0,rel:!0});var qp=i(Ro);Ji=s(qp,"here"),qp.forEach(t),Zi=s(Pr,"."),Pr.forEach(t),Yi=h(K),Vo=r(K,"LI",{});var Nr=i(Vo);ed=s(Nr,"A notebook showing how to fine-tune LED, can be accessed "),Ko=r(Nr,"A",{href:!0,rel:!0});var Lp=i(Ko);td=s(Lp,"here"),Lp.forEach(t),od=s(Nr,"."),Nr.forEach(t),nd=h(K),Js=r(K,"LI",{});var $p=i(Js);sd=s($p,`LED is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),$p.forEach(t),K.forEach(t),lr=h(o),oo=r(o,"P",{});var Ir=i(oo);ad=s(Ir,"This model was contributed by "),Xo=r(Ir,"A",{href:!0,rel:!0});var Dp=i(Xo);rd=s(Dp,"patrickvonplaten"),Dp.forEach(t),id=s(Ir,"."),Ir.forEach(t),cr=h(o),zt=r(o,"H2",{class:!0});var Gr=i(zt);no=r(Gr,"A",{id:!0,class:!0,href:!0});var zp=i(no);Zs=r(zp,"SPAN",{});var Fp=i(Zs);w(Jo.$$.fragment,Fp),Fp.forEach(t),zp.forEach(t),dd=h(Gr),Ys=r(Gr,"SPAN",{});var xp=i(Ys);ld=s(xp,"LEDConfig"),xp.forEach(t),Gr.forEach(t),hr=h(o),ze=r(o,"DIV",{class:!0});var No=i(ze);w(Zo.$$.fragment,No),cd=h(No),Ft=r(No,"P",{});var Ms=i(Ft);hd=s(Ms,"This is the configuration class to store the configuration of a "),ps=r(Ms,"A",{href:!0});var Sp=i(ps);pd=s(Sp,"LEDModel"),Sp.forEach(t),ud=s(Ms,`. 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
`),Yo=r(Ms,"A",{href:!0,rel:!0});var Mp=i(Yo);md=s(Mp,"allenai/led-base-16384"),Mp.forEach(t),fd=s(Ms," architecture."),Ms.forEach(t),gd=h(No),xt=r(No,"P",{});var Os=i(xt);_d=s(Os,"Configuration objects inherit from "),us=r(Os,"A",{href:!0});var Op=i(us);bd=s(Op,"PretrainedConfig"),Op.forEach(t),kd=s(Os,` and can be used to control the model outputs. Read the
documentation from `),ms=r(Os,"A",{href:!0});var Cp=i(ms);Td=s(Cp,"PretrainedConfig"),Cp.forEach(t),wd=s(Os," for more information."),Os.forEach(t),yd=h(No),w(so.$$.fragment,No),No.forEach(t),pr=h(o),St=r(o,"H2",{class:!0});var Br=i(St);ao=r(Br,"A",{id:!0,class:!0,href:!0});var Ap=i(ao);ea=r(Ap,"SPAN",{});var jp=i(ea);w(en.$$.fragment,jp),jp.forEach(t),Ap.forEach(t),vd=h(Br),ta=r(Br,"SPAN",{});var Pp=i(ta);Ed=s(Pp,"LEDTokenizer"),Pp.forEach(t),Br.forEach(t),ur=h(o),C=r(o,"DIV",{class:!0});var P=i(C);w(tn.$$.fragment,P),qd=h(P),oa=r(P,"P",{});var Np=i(oa);Ld=s(Np,"Constructs a LED tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),Np.forEach(t),$d=h(P),na=r(P,"P",{});var Ip=i(na);Dd=s(Ip,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Ip.forEach(t),zd=h(P),w(ro.$$.fragment,P),Fd=h(P),on=r(P,"P",{});var Hr=i(on);xd=s(Hr,"You can get around that behavior by passing "),sa=r(Hr,"CODE",{});var Gp=i(sa);Sd=s(Gp,"add_prefix_space=True"),Gp.forEach(t),Md=s(Hr,` 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.`),Hr.forEach(t),Od=h(P),w(io.$$.fragment,P),Cd=h(P),nn=r(P,"P",{});var Qr=i(nn);Ad=s(Qr,"This tokenizer inherits from "),fs=r(Qr,"A",{href:!0});var Bp=i(fs);jd=s(Bp,"PreTrainedTokenizer"),Bp.forEach(t),Pd=s(Qr,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Qr.forEach(t),Nd=h(P),ut=r(P,"DIV",{class:!0});var Cs=i(ut);w(sn.$$.fragment,Cs),Id=h(Cs),aa=r(Cs,"P",{});var Hp=i(aa);Gd=s(Hp,`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:`),Hp.forEach(t),Bd=h(Cs),an=r(Cs,"UL",{});var Wr=i(an);gs=r(Wr,"LI",{});var rp=i(gs);Hd=s(rp,"single sequence: "),ra=r(rp,"CODE",{});var Qp=i(ra);Qd=s(Qp,"<s> X </s>"),Qp.forEach(t),rp.forEach(t),Wd=h(Wr),_s=r(Wr,"LI",{});var ip=i(_s);Ud=s(ip,"pair of sequences: "),ia=r(ip,"CODE",{});var Wp=i(ia);Rd=s(Wp,"<s> A </s></s> B </s>"),Wp.forEach(t),ip.forEach(t),Wr.forEach(t),Cs.forEach(t),Vd=h(P),lo=r(P,"DIV",{class:!0});var Ur=i(lo);w(rn.$$.fragment,Ur),Kd=h(Ur),dn=r(Ur,"P",{});var Rr=i(dn);Xd=s(Rr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),da=r(Rr,"CODE",{});var Up=i(da);Jd=s(Up,"prepare_for_model"),Up.forEach(t),Zd=s(Rr," method."),Rr.forEach(t),Ur.forEach(t),Yd=h(P),co=r(P,"DIV",{class:!0});var Vr=i(co);w(ln.$$.fragment,Vr),el=h(Vr),la=r(Vr,"P",{});var Rp=i(la);tl=s(Rp,`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.`),Rp.forEach(t),Vr.forEach(t),ol=h(P),bs=r(P,"DIV",{class:!0});var Vp=i(bs);w(cn.$$.fragment,Vp),Vp.forEach(t),P.forEach(t),mr=h(o),Mt=r(o,"H2",{class:!0});var Kr=i(Mt);ho=r(Kr,"A",{id:!0,class:!0,href:!0});var Kp=i(ho);ca=r(Kp,"SPAN",{});var Xp=i(ca);w(hn.$$.fragment,Xp),Xp.forEach(t),Kp.forEach(t),nl=h(Kr),ha=r(Kr,"SPAN",{});var Jp=i(ha);sl=s(Jp,"LEDTokenizerFast"),Jp.forEach(t),Kr.forEach(t),fr=h(o),H=r(o,"DIV",{class:!0});var ae=i(H);w(pn.$$.fragment,ae),al=h(ae),un=r(ae,"P",{});var Xr=i(un);rl=s(Xr,"Construct a \u201Cfast\u201D LED tokenizer (backed by HuggingFace\u2019s "),pa=r(Xr,"EM",{});var Zp=i(pa);il=s(Zp,"tokenizers"),Zp.forEach(t),dl=s(Xr,` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),Xr.forEach(t),ll=h(ae),ua=r(ae,"P",{});var Yp=i(ua);cl=s(Yp,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Yp.forEach(t),hl=h(ae),w(po.$$.fragment,ae),pl=h(ae),mn=r(ae,"P",{});var Jr=i(mn);ul=s(Jr,"You can get around that behavior by passing "),ma=r(Jr,"CODE",{});var eu=i(ma);ml=s(eu,"add_prefix_space=True"),eu.forEach(t),fl=s(Jr,` 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.`),Jr.forEach(t),gl=h(ae),w(uo.$$.fragment,ae),_l=h(ae),fn=r(ae,"P",{});var Zr=i(fn);bl=s(Zr,"This tokenizer inherits from "),ks=r(Zr,"A",{href:!0});var tu=i(ks);kl=s(tu,"PreTrainedTokenizerFast"),tu.forEach(t),Tl=s(Zr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Zr.forEach(t),wl=h(ae),mo=r(ae,"DIV",{class:!0});var Yr=i(mo);w(gn.$$.fragment,Yr),yl=h(Yr),fa=r(Yr,"P",{});var ou=i(fa);vl=s(ou,`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.`),ou.forEach(t),Yr.forEach(t),ae.forEach(t),gr=h(o),Ot=r(o,"H2",{class:!0});var ei=i(Ot);fo=r(ei,"A",{id:!0,class:!0,href:!0});var nu=i(fo);ga=r(nu,"SPAN",{});var su=i(ga);w(_n.$$.fragment,su),su.forEach(t),nu.forEach(t),El=h(ei),_a=r(ei,"SPAN",{});var au=i(_a);ql=s(au,"LED specific outputs"),au.forEach(t),ei.forEach(t),_r=h(o),Ct=r(o,"DIV",{class:!0});var ti=i(Ct);w(bn.$$.fragment,ti),Ll=h(ti),ba=r(ti,"P",{});var ru=i(ba);$l=s(ru,"Base class for LEDEncoder\u2019s outputs, with potential hidden states, local and global attentions."),ru.forEach(t),ti.forEach(t),br=h(o),At=r(o,"DIV",{class:!0});var oi=i(At);w(kn.$$.fragment,oi),Dl=h(oi),ka=r(oi,"P",{});var iu=i(ka);zl=s(iu,`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),iu.forEach(t),oi.forEach(t),kr=h(o),jt=r(o,"DIV",{class:!0});var ni=i(jt);w(Tn.$$.fragment,ni),Fl=h(ni),Ta=r(ni,"P",{});var du=i(Ta);xl=s(du,"Base class for sequence-to-sequence language models outputs."),du.forEach(t),ni.forEach(t),Tr=h(o),Pt=r(o,"DIV",{class:!0});var si=i(Pt);w(wn.$$.fragment,si),Sl=h(si),wa=r(si,"P",{});var lu=i(wa);Ml=s(lu,"Base class for outputs of sequence-to-sequence sentence classification models."),lu.forEach(t),si.forEach(t),wr=h(o),Nt=r(o,"DIV",{class:!0});var ai=i(Nt);w(yn.$$.fragment,ai),Ol=h(ai),ya=r(ai,"P",{});var cu=i(ya);Cl=s(cu,"Base class for outputs of sequence-to-sequence question answering models."),cu.forEach(t),ai.forEach(t),yr=h(o),It=r(o,"DIV",{class:!0});var ri=i(It);w(vn.$$.fragment,ri),Al=h(ri),va=r(ri,"P",{});var hu=i(va);jl=s(hu,"Base class for Longformer\u2019s outputs, with potential hidden states, local and global attentions."),hu.forEach(t),ri.forEach(t),vr=h(o),Gt=r(o,"DIV",{class:!0});var ii=i(Gt);w(En.$$.fragment,ii),Pl=h(ii),Ea=r(ii,"P",{});var pu=i(Ea);Nl=s(pu,`Base class for model encoder\u2019s outputs that also contains : pre-computed hidden states that can speed up sequential
decoding.`),pu.forEach(t),ii.forEach(t),Er=h(o),Bt=r(o,"DIV",{class:!0});var di=i(Bt);w(qn.$$.fragment,di),Il=h(di),qa=r(di,"P",{});var uu=i(qa);Gl=s(uu,"Base class for sequence-to-sequence language models outputs."),uu.forEach(t),di.forEach(t),qr=h(o),Ht=r(o,"H2",{class:!0});var li=i(Ht);go=r(li,"A",{id:!0,class:!0,href:!0});var mu=i(go);La=r(mu,"SPAN",{});var fu=i(La);w(Ln.$$.fragment,fu),fu.forEach(t),mu.forEach(t),Bl=h(li),$a=r(li,"SPAN",{});var gu=i($a);Hl=s(gu,"LEDModel"),gu.forEach(t),li.forEach(t),Lr=h(o),Fe=r(o,"DIV",{class:!0});var Io=i(Fe);w($n.$$.fragment,Io),Ql=h(Io),Dn=r(Io,"P",{});var ci=i(Dn);Wl=s(ci,`The bare LED Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ts=r(ci,"A",{href:!0});var _u=i(Ts);Ul=s(_u,"PreTrainedModel"),_u.forEach(t),Rl=s(ci,`. 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.)`),ci.forEach(t),Vl=h(Io),zn=r(Io,"P",{});var hi=i(zn);Kl=s(hi,"This model is also a PyTorch "),Fn=r(hi,"A",{href:!0,rel:!0});var bu=i(Fn);Xl=s(bu,"torch.nn.Module"),bu.forEach(t),Jl=s(hi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),hi.forEach(t),Zl=h(Io),je=r(Io,"DIV",{class:!0});var Go=i(je);w(xn.$$.fragment,Go),Yl=h(Go),Qt=r(Go,"P",{});var As=i(Qt);ec=s(As,"The "),ws=r(As,"A",{href:!0});var ku=i(ws);tc=s(ku,"LEDModel"),ku.forEach(t),oc=s(As," forward method, overrides the "),Da=r(As,"CODE",{});var Tu=i(Da);nc=s(Tu,"__call__"),Tu.forEach(t),sc=s(As," special method."),As.forEach(t),ac=h(Go),w(_o.$$.fragment,Go),rc=h(Go),w(bo.$$.fragment,Go),Go.forEach(t),Io.forEach(t),$r=h(o),Wt=r(o,"H2",{class:!0});var pi=i(Wt);ko=r(pi,"A",{id:!0,class:!0,href:!0});var wu=i(ko);za=r(wu,"SPAN",{});var yu=i(za);w(Sn.$$.fragment,yu),yu.forEach(t),wu.forEach(t),ic=h(pi),Fa=r(pi,"SPAN",{});var vu=i(Fa);dc=s(vu,"LEDForConditionalGeneration"),vu.forEach(t),pi.forEach(t),Dr=h(o),xe=r(o,"DIV",{class:!0});var Bo=i(xe);w(Mn.$$.fragment,Bo),lc=h(Bo),On=r(Bo,"P",{});var ui=i(On);cc=s(ui,`The LED Model with a language modeling head. Can be used for summarization.
This model inherits from `),ys=r(ui,"A",{href:!0});var Eu=i(ys);hc=s(Eu,"PreTrainedModel"),Eu.forEach(t),pc=s(ui,`. 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.)`),ui.forEach(t),uc=h(Bo),Cn=r(Bo,"P",{});var mi=i(Cn);mc=s(mi,"This model is also a PyTorch "),An=r(mi,"A",{href:!0,rel:!0});var qu=i(An);fc=s(qu,"torch.nn.Module"),qu.forEach(t),gc=s(mi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),mi.forEach(t),_c=h(Bo),ye=r(Bo,"DIV",{class:!0});var ft=i(ye);w(jn.$$.fragment,ft),bc=h(ft),Ut=r(ft,"P",{});var js=i(Ut);kc=s(js,"The "),vs=r(js,"A",{href:!0});var Lu=i(vs);Tc=s(Lu,"LEDForConditionalGeneration"),Lu.forEach(t),wc=s(js," forward method, overrides the "),xa=r(js,"CODE",{});var $u=i(xa);yc=s($u,"__call__"),$u.forEach(t),vc=s(js," special method."),js.forEach(t),Ec=h(ft),w(To.$$.fragment,ft),qc=h(ft),w(wo.$$.fragment,ft),Lc=h(ft),w(yo.$$.fragment,ft),ft.forEach(t),Bo.forEach(t),zr=h(o),Rt=r(o,"H2",{class:!0});var fi=i(Rt);vo=r(fi,"A",{id:!0,class:!0,href:!0});var Du=i(vo);Sa=r(Du,"SPAN",{});var zu=i(Sa);w(Pn.$$.fragment,zu),zu.forEach(t),Du.forEach(t),$c=h(fi),Ma=r(fi,"SPAN",{});var Fu=i(Ma);Dc=s(Fu,"LEDForSequenceClassification"),Fu.forEach(t),fi.forEach(t),Fr=h(o),ue=r(o,"DIV",{class:!0});var gt=i(ue);w(Nn.$$.fragment,gt),zc=h(gt),Oa=r(gt,"P",{});var xu=i(Oa);Fc=s(xu,`LED model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),xu.forEach(t),xc=h(gt),In=r(gt,"P",{});var gi=i(In);Sc=s(gi,"This model inherits from "),Es=r(gi,"A",{href:!0});var Su=i(Es);Mc=s(Su,"PreTrainedModel"),Su.forEach(t),Oc=s(gi,`. 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.)`),gi.forEach(t),Cc=h(gt),Gn=r(gt,"P",{});var _i=i(Gn);Ac=s(_i,"This model is also a PyTorch "),Bn=r(_i,"A",{href:!0,rel:!0});var Mu=i(Bn);jc=s(Mu,"torch.nn.Module"),Mu.forEach(t),Pc=s(_i,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),_i.forEach(t),Nc=h(gt),ve=r(gt,"DIV",{class:!0});var _t=i(ve);w(Hn.$$.fragment,_t),Ic=h(_t),Vt=r(_t,"P",{});var Ps=i(Vt);Gc=s(Ps,"The "),qs=r(Ps,"A",{href:!0});var Ou=i(qs);Bc=s(Ou,"LEDForSequenceClassification"),Ou.forEach(t),Hc=s(Ps," forward method, overrides the "),Ca=r(Ps,"CODE",{});var Cu=i(Ca);Qc=s(Cu,"__call__"),Cu.forEach(t),Wc=s(Ps," special method."),Ps.forEach(t),Uc=h(_t),w(Eo.$$.fragment,_t),Rc=h(_t),w(qo.$$.fragment,_t),Vc=h(_t),w(Lo.$$.fragment,_t),_t.forEach(t),gt.forEach(t),xr=h(o),Kt=r(o,"H2",{class:!0});var bi=i(Kt);$o=r(bi,"A",{id:!0,class:!0,href:!0});var Au=i($o);Aa=r(Au,"SPAN",{});var ju=i(Aa);w(Qn.$$.fragment,ju),ju.forEach(t),Au.forEach(t),Kc=h(bi),ja=r(bi,"SPAN",{});var Pu=i(ja);Xc=s(Pu,"LEDForQuestionAnswering"),Pu.forEach(t),bi.forEach(t),Sr=h(o),me=r(o,"DIV",{class:!0});var bt=i(me);w(Wn.$$.fragment,bt),Jc=h(bt),Xt=r(bt,"P",{});var Ns=i(Xt);Zc=s(Ns,`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 `),Pa=r(Ns,"CODE",{});var Nu=i(Pa);Yc=s(Nu,"span start logits"),Nu.forEach(t),eh=s(Ns," and "),Na=r(Ns,"CODE",{});var Iu=i(Na);th=s(Iu,"span end logits"),Iu.forEach(t),oh=s(Ns,")."),Ns.forEach(t),nh=h(bt),Un=r(bt,"P",{});var ki=i(Un);sh=s(ki,"This model inherits from "),Ls=r(ki,"A",{href:!0});var Gu=i(Ls);ah=s(Gu,"PreTrainedModel"),Gu.forEach(t),rh=s(ki,`. 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.)`),ki.forEach(t),ih=h(bt),Rn=r(bt,"P",{});var Ti=i(Rn);dh=s(Ti,"This model is also a PyTorch "),Vn=r(Ti,"A",{href:!0,rel:!0});var Bu=i(Vn);lh=s(Bu,"torch.nn.Module"),Bu.forEach(t),ch=s(Ti,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for general usage and behavior.`),Ti.forEach(t),hh=h(bt),Pe=r(bt,"DIV",{class:!0});var Ho=i(Pe);w(Kn.$$.fragment,Ho),ph=h(Ho),Jt=r(Ho,"P",{});var Is=i(Jt);uh=s(Is,"The "),$s=r(Is,"A",{href:!0});var Hu=i($s);mh=s(Hu,"LEDForQuestionAnswering"),Hu.forEach(t),fh=s(Is," forward method, overrides the "),Ia=r(Is,"CODE",{});var Qu=i(Ia);gh=s(Qu,"__call__"),Qu.forEach(t),_h=s(Is," special method."),Is.forEach(t),bh=h(Ho),w(Do.$$.fragment,Ho),kh=h(Ho),w(zo.$$.fragment,Ho),Ho.forEach(t),bt.forEach(t),Mr=h(o),Zt=r(o,"H2",{class:!0});var wi=i(Zt);Fo=r(wi,"A",{id:!0,class:!0,href:!0});var Wu=i(Fo);Ga=r(Wu,"SPAN",{});var Uu=i(Ga);w(Xn.$$.fragment,Uu),Uu.forEach(t),Wu.forEach(t),Th=h(wi),Ba=r(wi,"SPAN",{});var Ru=i(Ba);wh=s(Ru,"TFLEDModel"),Ru.forEach(t),wi.forEach(t),Or=h(o),fe=r(o,"DIV",{class:!0});var kt=i(fe);w(Jn.$$.fragment,kt),yh=h(kt),Zn=r(kt,"P",{});var yi=i(Zn);vh=s(yi,`The bare LED Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ds=r(yi,"A",{href:!0});var Vu=i(Ds);Eh=s(Vu,"TFPreTrainedModel"),Vu.forEach(t),qh=s(yi,`. 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.)`),yi.forEach(t),Lh=h(kt),Yn=r(kt,"P",{});var vi=i(Yn);$h=s(vi,"This model is also a "),es=r(vi,"A",{href:!0,rel:!0});var Ku=i(es);Dh=s(Ku,"tf.keras.Model"),Ku.forEach(t),zh=s(vi,` 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.`),vi.forEach(t),Fh=h(kt),w(xo.$$.fragment,kt),xh=h(kt),Ne=r(kt,"DIV",{class:!0});var Qo=i(Ne);w(ts.$$.fragment,Qo),Sh=h(Qo),Yt=r(Qo,"P",{});var Gs=i(Yt);Mh=s(Gs,"The "),zs=r(Gs,"A",{href:!0});var Xu=i(zs);Oh=s(Xu,"TFLEDModel"),Xu.forEach(t),Ch=s(Gs," forward method, overrides the "),Ha=r(Gs,"CODE",{});var Ju=i(Ha);Ah=s(Ju,"__call__"),Ju.forEach(t),jh=s(Gs," special method."),Gs.forEach(t),Ph=h(Qo),w(So.$$.fragment,Qo),Nh=h(Qo),w(Mo.$$.fragment,Qo),Qo.forEach(t),kt.forEach(t),Cr=h(o),eo=r(o,"H2",{class:!0});var Ei=i(eo);Oo=r(Ei,"A",{id:!0,class:!0,href:!0});var Zu=i(Oo);Qa=r(Zu,"SPAN",{});var Yu=i(Qa);w(os.$$.fragment,Yu),Yu.forEach(t),Zu.forEach(t),Ih=h(Ei),Wa=r(Ei,"SPAN",{});var em=i(Wa);Gh=s(em,"TFLEDForConditionalGeneration"),em.forEach(t),Ei.forEach(t),Ar=h(o),ge=r(o,"DIV",{class:!0});var Tt=i(ge);w(ns.$$.fragment,Tt),Bh=h(Tt),ss=r(Tt,"P",{});var qi=i(ss);Hh=s(qi,`The LED Model with a language modeling head. Can be used for summarization.
This model inherits from `),Fs=r(qi,"A",{href:!0});var tm=i(Fs);Qh=s(tm,"TFPreTrainedModel"),tm.forEach(t),Wh=s(qi,`. 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.)`),qi.forEach(t),Uh=h(Tt),as=r(Tt,"P",{});var Li=i(as);Rh=s(Li,"This model is also a "),rs=r(Li,"A",{href:!0,rel:!0});var om=i(rs);Vh=s(om,"tf.keras.Model"),om.forEach(t),Kh=s(Li,` 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.`),Li.forEach(t),Xh=h(Tt),w(Co.$$.fragment,Tt),Jh=h(Tt),Ie=r(Tt,"DIV",{class:!0});var Wo=i(Ie);w(is.$$.fragment,Wo),Zh=h(Wo),to=r(Wo,"P",{});var Bs=i(to);Yh=s(Bs,"The "),xs=r(Bs,"A",{href:!0});var nm=i(xs);ep=s(nm,"TFLEDForConditionalGeneration"),nm.forEach(t),tp=s(Bs," forward method, overrides the "),Ua=r(Bs,"CODE",{});var sm=i(Ua);op=s(sm,"__call__"),sm.forEach(t),np=s(Bs," special method."),Bs.forEach(t),sp=h(Wo),w(Ao.$$.fragment,Wo),ap=h(Wo),w(jo.$$.fragment,Wo),Wo.forEach(t),Tt.forEach(t),this.h()},h(){m(l,"name","hf:doc:metadata"),m(l,"content",JSON.stringify(Sm)),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(W,"id","overview"),m(W,"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(W,"href","#overview"),m(j,"class","relative group"),m(ie,"href","https://arxiv.org/abs/2004.05150"),m(ie,"rel","nofollow"),m(be,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDForConditionalGeneration"),m(ke,"href","/docs/transformers/main/en/model_doc/bart#transformers.BartForConditionalGeneration"),m(Te,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDTokenizer"),m(we,"href","/docs/transformers/main/en/model_doc/bart#transformers.BartTokenizer"),m(Ae,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDTokenizer"),m(hs,"href","/docs/transformers/main/en/model_doc/longformer#transformers.LongformerModel"),m(Ro,"href","https://colab.research.google.com/drive/12INTTR6n64TzS4RrXZxMSXfrOd9Xzamo?usp=sharing"),m(Ro,"rel","nofollow"),m(Ko,"href","https://colab.research.google.com/drive/12LjJazBl7Gam0XBPy_y0CTOJZeZ34c2v?usp=sharing"),m(Ko,"rel","nofollow"),m(Xo,"href","https://huggingface.co/patrickvonplaten"),m(Xo,"rel","nofollow"),m(no,"id","transformers.LEDConfig"),m(no,"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(no,"href","#transformers.LEDConfig"),m(zt,"class","relative group"),m(ps,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDModel"),m(Yo,"href","https://huggingface.co/allenai/led-base-16384"),m(Yo,"rel","nofollow"),m(us,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(ms,"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(ao,"id","transformers.LEDTokenizer"),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","#transformers.LEDTokenizer"),m(St,"class","relative group"),m(fs,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(ut,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(bs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ho,"id","transformers.LEDTokenizerFast"),m(ho,"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(ho,"href","#transformers.LEDTokenizerFast"),m(Mt,"class","relative group"),m(ks,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(fo,"id","transformers.models.led.modeling_led.LEDEncoderBaseModelOutput"),m(fo,"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(fo,"href","#transformers.models.led.modeling_led.LEDEncoderBaseModelOutput"),m(Ot,"class","relative group"),m(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Pt,"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(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(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(go,"id","transformers.LEDModel"),m(go,"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(go,"href","#transformers.LEDModel"),m(Ht,"class","relative group"),m(Ts,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Fn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Fn,"rel","nofollow"),m(ws,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDModel"),m(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(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(Wt,"class","relative group"),m(ys,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(An,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(An,"rel","nofollow"),m(vs,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDForConditionalGeneration"),m(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(vo,"id","transformers.LEDForSequenceClassification"),m(vo,"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(vo,"href","#transformers.LEDForSequenceClassification"),m(Rt,"class","relative group"),m(Es,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Bn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Bn,"rel","nofollow"),m(qs,"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(Kt,"class","relative group"),m(Ls,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Vn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Vn,"rel","nofollow"),m($s,"href","/docs/transformers/main/en/model_doc/led#transformers.LEDForQuestionAnswering"),m(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(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(Fo,"id","transformers.TFLEDModel"),m(Fo,"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(Fo,"href","#transformers.TFLEDModel"),m(Zt,"class","relative group"),m(Ds,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(es,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(es,"rel","nofollow"),m(zs,"href","/docs/transformers/main/en/model_doc/led#transformers.TFLEDModel"),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(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(Oo,"id","transformers.TFLEDForConditionalGeneration"),m(Oo,"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(Oo,"href","#transformers.TFLEDForConditionalGeneration"),m(eo,"class","relative group"),m(Fs,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(rs,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(rs,"rel","nofollow"),m(xs,"href","/docs/transformers/main/en/model_doc/led#transformers.TFLEDForConditionalGeneration"),m(Ie,"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,k,_),g(o,f,_),e(f,u),e(u,b),y(d,b,null),e(f,p),e(f,D),e(D,Y),g(o,N,_),g(o,j,_),e(j,W),e(W,re),y(z,re,null),e(j,Be),e(j,ee),e(ee,He),g(o,Se,_),g(o,Q,_),e(Q,Qe),e(Q,ie),e(ie,de),e(Q,We),g(o,Me,_),g(o,X,_),e(X,Ue),g(o,Oe,_),g(o,J,_),e(J,qe),e(qe,Re),g(o,_e,_),g(o,M,_),e(M,I),g(o,Ce,_),g(o,x,_),e(x,A),e(A,be),e(be,le),e(A,Ve),e(A,ke),e(ke,G),e(A,Ke),e(A,te),e(te,Xe),e(A,Je),e(A,oe),e(oe,Ze),e(A,Ye),e(A,U),e(U,et),e(A,ce),e(A,Te),e(Te,Le),e(A,B),e(A,we),e(we,R),e(A,tt),e(x,ot),e(x,L),e(L,F),e(L,nt),e(nt,$e),e(L,yt),e(L,st),e(st,S),e(L,vt),e(x,Et),e(x,V),e(V,qt),e(V,at),e(at,ne),e(V,he),e(V,rt),e(rt,Lt),e(V,pe),e(V,Ae),e(Ae,$t),e(V,it),e(V,dt),e(dt,De),e(V,Dt),e(x,$i),e(x,se),e(se,Di),e(se,Hs),e(Hs,zi),e(se,Fi),e(se,Qs),e(Qs,xi),e(se,Si),e(se,hs),e(hs,Mi),e(se,Oi),e(se,Ws),e(Ws,Ci),e(se,Ai),e(se,Us),e(Us,ji),e(se,Pi),e(se,Rs),e(Rs,Ni),e(se,Ii),e(x,Gi),e(x,lt),e(lt,Bi),e(lt,Vs),e(Vs,Hi),e(lt,Qi),e(lt,Ks),e(Ks,Wi),e(lt,Ui),e(lt,Xs),e(Xs,Ri),e(lt,Vi),e(x,Ki),e(x,Uo),e(Uo,Xi),e(Uo,Ro),e(Ro,Ji),e(Uo,Zi),e(x,Yi),e(x,Vo),e(Vo,ed),e(Vo,Ko),e(Ko,td),e(Vo,od),e(x,nd),e(x,Js),e(Js,sd),g(o,lr,_),g(o,oo,_),e(oo,ad),e(oo,Xo),e(Xo,rd),e(oo,id),g(o,cr,_),g(o,zt,_),e(zt,no),e(no,Zs),y(Jo,Zs,null),e(zt,dd),e(zt,Ys),e(Ys,ld),g(o,hr,_),g(o,ze,_),y(Zo,ze,null),e(ze,cd),e(ze,Ft),e(Ft,hd),e(Ft,ps),e(ps,pd),e(Ft,ud),e(Ft,Yo),e(Yo,md),e(Ft,fd),e(ze,gd),e(ze,xt),e(xt,_d),e(xt,us),e(us,bd),e(xt,kd),e(xt,ms),e(ms,Td),e(xt,wd),e(ze,yd),y(so,ze,null),g(o,pr,_),g(o,St,_),e(St,ao),e(ao,ea),y(en,ea,null),e(St,vd),e(St,ta),e(ta,Ed),g(o,ur,_),g(o,C,_),y(tn,C,null),e(C,qd),e(C,oa),e(oa,Ld),e(C,$d),e(C,na),e(na,Dd),e(C,zd),y(ro,C,null),e(C,Fd),e(C,on),e(on,xd),e(on,sa),e(sa,Sd),e(on,Md),e(C,Od),y(io,C,null),e(C,Cd),e(C,nn),e(nn,Ad),e(nn,fs),e(fs,jd),e(nn,Pd),e(C,Nd),e(C,ut),y(sn,ut,null),e(ut,Id),e(ut,aa),e(aa,Gd),e(ut,Bd),e(ut,an),e(an,gs),e(gs,Hd),e(gs,ra),e(ra,Qd),e(an,Wd),e(an,_s),e(_s,Ud),e(_s,ia),e(ia,Rd),e(C,Vd),e(C,lo),y(rn,lo,null),e(lo,Kd),e(lo,dn),e(dn,Xd),e(dn,da),e(da,Jd),e(dn,Zd),e(C,Yd),e(C,co),y(ln,co,null),e(co,el),e(co,la),e(la,tl),e(C,ol),e(C,bs),y(cn,bs,null),g(o,mr,_),g(o,Mt,_),e(Mt,ho),e(ho,ca),y(hn,ca,null),e(Mt,nl),e(Mt,ha),e(ha,sl),g(o,fr,_),g(o,H,_),y(pn,H,null),e(H,al),e(H,un),e(un,rl),e(un,pa),e(pa,il),e(un,dl),e(H,ll),e(H,ua),e(ua,cl),e(H,hl),y(po,H,null),e(H,pl),e(H,mn),e(mn,ul),e(mn,ma),e(ma,ml),e(mn,fl),e(H,gl),y(uo,H,null),e(H,_l),e(H,fn),e(fn,bl),e(fn,ks),e(ks,kl),e(fn,Tl),e(H,wl),e(H,mo),y(gn,mo,null),e(mo,yl),e(mo,fa),e(fa,vl),g(o,gr,_),g(o,Ot,_),e(Ot,fo),e(fo,ga),y(_n,ga,null),e(Ot,El),e(Ot,_a),e(_a,ql),g(o,_r,_),g(o,Ct,_),y(bn,Ct,null),e(Ct,Ll),e(Ct,ba),e(ba,$l),g(o,br,_),g(o,At,_),y(kn,At,null),e(At,Dl),e(At,ka),e(ka,zl),g(o,kr,_),g(o,jt,_),y(Tn,jt,null),e(jt,Fl),e(jt,Ta),e(Ta,xl),g(o,Tr,_),g(o,Pt,_),y(wn,Pt,null),e(Pt,Sl),e(Pt,wa),e(wa,Ml),g(o,wr,_),g(o,Nt,_),y(yn,Nt,null),e(Nt,Ol),e(Nt,ya),e(ya,Cl),g(o,yr,_),g(o,It,_),y(vn,It,null),e(It,Al),e(It,va),e(va,jl),g(o,vr,_),g(o,Gt,_),y(En,Gt,null),e(Gt,Pl),e(Gt,Ea),e(Ea,Nl),g(o,Er,_),g(o,Bt,_),y(qn,Bt,null),e(Bt,Il),e(Bt,qa),e(qa,Gl),g(o,qr,_),g(o,Ht,_),e(Ht,go),e(go,La),y(Ln,La,null),e(Ht,Bl),e(Ht,$a),e($a,Hl),g(o,Lr,_),g(o,Fe,_),y($n,Fe,null),e(Fe,Ql),e(Fe,Dn),e(Dn,Wl),e(Dn,Ts),e(Ts,Ul),e(Dn,Rl),e(Fe,Vl),e(Fe,zn),e(zn,Kl),e(zn,Fn),e(Fn,Xl),e(zn,Jl),e(Fe,Zl),e(Fe,je),y(xn,je,null),e(je,Yl),e(je,Qt),e(Qt,ec),e(Qt,ws),e(ws,tc),e(Qt,oc),e(Qt,Da),e(Da,nc),e(Qt,sc),e(je,ac),y(_o,je,null),e(je,rc),y(bo,je,null),g(o,$r,_),g(o,Wt,_),e(Wt,ko),e(ko,za),y(Sn,za,null),e(Wt,ic),e(Wt,Fa),e(Fa,dc),g(o,Dr,_),g(o,xe,_),y(Mn,xe,null),e(xe,lc),e(xe,On),e(On,cc),e(On,ys),e(ys,hc),e(On,pc),e(xe,uc),e(xe,Cn),e(Cn,mc),e(Cn,An),e(An,fc),e(Cn,gc),e(xe,_c),e(xe,ye),y(jn,ye,null),e(ye,bc),e(ye,Ut),e(Ut,kc),e(Ut,vs),e(vs,Tc),e(Ut,wc),e(Ut,xa),e(xa,yc),e(Ut,vc),e(ye,Ec),y(To,ye,null),e(ye,qc),y(wo,ye,null),e(ye,Lc),y(yo,ye,null),g(o,zr,_),g(o,Rt,_),e(Rt,vo),e(vo,Sa),y(Pn,Sa,null),e(Rt,$c),e(Rt,Ma),e(Ma,Dc),g(o,Fr,_),g(o,ue,_),y(Nn,ue,null),e(ue,zc),e(ue,Oa),e(Oa,Fc),e(ue,xc),e(ue,In),e(In,Sc),e(In,Es),e(Es,Mc),e(In,Oc),e(ue,Cc),e(ue,Gn),e(Gn,Ac),e(Gn,Bn),e(Bn,jc),e(Gn,Pc),e(ue,Nc),e(ue,ve),y(Hn,ve,null),e(ve,Ic),e(ve,Vt),e(Vt,Gc),e(Vt,qs),e(qs,Bc),e(Vt,Hc),e(Vt,Ca),e(Ca,Qc),e(Vt,Wc),e(ve,Uc),y(Eo,ve,null),e(ve,Rc),y(qo,ve,null),e(ve,Vc),y(Lo,ve,null),g(o,xr,_),g(o,Kt,_),e(Kt,$o),e($o,Aa),y(Qn,Aa,null),e(Kt,Kc),e(Kt,ja),e(ja,Xc),g(o,Sr,_),g(o,me,_),y(Wn,me,null),e(me,Jc),e(me,Xt),e(Xt,Zc),e(Xt,Pa),e(Pa,Yc),e(Xt,eh),e(Xt,Na),e(Na,th),e(Xt,oh),e(me,nh),e(me,Un),e(Un,sh),e(Un,Ls),e(Ls,ah),e(Un,rh),e(me,ih),e(me,Rn),e(Rn,dh),e(Rn,Vn),e(Vn,lh),e(Rn,ch),e(me,hh),e(me,Pe),y(Kn,Pe,null),e(Pe,ph),e(Pe,Jt),e(Jt,uh),e(Jt,$s),e($s,mh),e(Jt,fh),e(Jt,Ia),e(Ia,gh),e(Jt,_h),e(Pe,bh),y(Do,Pe,null),e(Pe,kh),y(zo,Pe,null),g(o,Mr,_),g(o,Zt,_),e(Zt,Fo),e(Fo,Ga),y(Xn,Ga,null),e(Zt,Th),e(Zt,Ba),e(Ba,wh),g(o,Or,_),g(o,fe,_),y(Jn,fe,null),e(fe,yh),e(fe,Zn),e(Zn,vh),e(Zn,Ds),e(Ds,Eh),e(Zn,qh),e(fe,Lh),e(fe,Yn),e(Yn,$h),e(Yn,es),e(es,Dh),e(Yn,zh),e(fe,Fh),y(xo,fe,null),e(fe,xh),e(fe,Ne),y(ts,Ne,null),e(Ne,Sh),e(Ne,Yt),e(Yt,Mh),e(Yt,zs),e(zs,Oh),e(Yt,Ch),e(Yt,Ha),e(Ha,Ah),e(Yt,jh),e(Ne,Ph),y(So,Ne,null),e(Ne,Nh),y(Mo,Ne,null),g(o,Cr,_),g(o,eo,_),e(eo,Oo),e(Oo,Qa),y(os,Qa,null),e(eo,Ih),e(eo,Wa),e(Wa,Gh),g(o,Ar,_),g(o,ge,_),y(ns,ge,null),e(ge,Bh),e(ge,ss),e(ss,Hh),e(ss,Fs),e(Fs,Qh),e(ss,Wh),e(ge,Uh),e(ge,as),e(as,Rh),e(as,rs),e(rs,Vh),e(as,Kh),e(ge,Xh),y(Co,ge,null),e(ge,Jh),e(ge,Ie),y(is,Ie,null),e(Ie,Zh),e(Ie,to),e(to,Yh),e(to,xs),e(xs,ep),e(to,tp),e(to,Ua),e(Ua,op),e(to,np),e(Ie,sp),y(Ao,Ie,null),e(Ie,ap),y(jo,Ie,null),jr=!0},p(o,[_]){const ds={};_&2&&(ds.$$scope={dirty:_,ctx:o}),so.$set(ds);const Ra={};_&2&&(Ra.$$scope={dirty:_,ctx:o}),ro.$set(Ra);const Va={};_&2&&(Va.$$scope={dirty:_,ctx:o}),io.$set(Va);const Ka={};_&2&&(Ka.$$scope={dirty:_,ctx:o}),po.$set(Ka);const ls={};_&2&&(ls.$$scope={dirty:_,ctx:o}),uo.$set(ls);const Xa={};_&2&&(Xa.$$scope={dirty:_,ctx:o}),_o.$set(Xa);const Ja={};_&2&&(Ja.$$scope={dirty:_,ctx:o}),bo.$set(Ja);const Za={};_&2&&(Za.$$scope={dirty:_,ctx:o}),To.$set(Za);const cs={};_&2&&(cs.$$scope={dirty:_,ctx:o}),wo.$set(cs);const Ya={};_&2&&(Ya.$$scope={dirty:_,ctx:o}),yo.$set(Ya);const er={};_&2&&(er.$$scope={dirty:_,ctx:o}),Eo.$set(er);const tr={};_&2&&(tr.$$scope={dirty:_,ctx:o}),qo.$set(tr);const or={};_&2&&(or.$$scope={dirty:_,ctx:o}),Lo.$set(or);const nr={};_&2&&(nr.$$scope={dirty:_,ctx:o}),Do.$set(nr);const K={};_&2&&(K.$$scope={dirty:_,ctx:o}),zo.$set(K);const Z={};_&2&&(Z.$$scope={dirty:_,ctx:o}),xo.$set(Z);const sr={};_&2&&(sr.$$scope={dirty:_,ctx:o}),So.$set(sr);const ar={};_&2&&(ar.$$scope={dirty:_,ctx:o}),Mo.$set(ar);const rr={};_&2&&(rr.$$scope={dirty:_,ctx:o}),Co.$set(rr);const ir={};_&2&&(ir.$$scope={dirty:_,ctx:o}),Ao.$set(ir);const dr={};_&2&&(dr.$$scope={dirty:_,ctx:o}),jo.$set(dr)},i(o){jr||(v(d.$$.fragment,o),v(z.$$.fragment,o),v(Jo.$$.fragment,o),v(Zo.$$.fragment,o),v(so.$$.fragment,o),v(en.$$.fragment,o),v(tn.$$.fragment,o),v(ro.$$.fragment,o),v(io.$$.fragment,o),v(sn.$$.fragment,o),v(rn.$$.fragment,o),v(ln.$$.fragment,o),v(cn.$$.fragment,o),v(hn.$$.fragment,o),v(pn.$$.fragment,o),v(po.$$.fragment,o),v(uo.$$.fragment,o),v(gn.$$.fragment,o),v(_n.$$.fragment,o),v(bn.$$.fragment,o),v(kn.$$.fragment,o),v(Tn.$$.fragment,o),v(wn.$$.fragment,o),v(yn.$$.fragment,o),v(vn.$$.fragment,o),v(En.$$.fragment,o),v(qn.$$.fragment,o),v(Ln.$$.fragment,o),v($n.$$.fragment,o),v(xn.$$.fragment,o),v(_o.$$.fragment,o),v(bo.$$.fragment,o),v(Sn.$$.fragment,o),v(Mn.$$.fragment,o),v(jn.$$.fragment,o),v(To.$$.fragment,o),v(wo.$$.fragment,o),v(yo.$$.fragment,o),v(Pn.$$.fragment,o),v(Nn.$$.fragment,o),v(Hn.$$.fragment,o),v(Eo.$$.fragment,o),v(qo.$$.fragment,o),v(Lo.$$.fragment,o),v(Qn.$$.fragment,o),v(Wn.$$.fragment,o),v(Kn.$$.fragment,o),v(Do.$$.fragment,o),v(zo.$$.fragment,o),v(Xn.$$.fragment,o),v(Jn.$$.fragment,o),v(xo.$$.fragment,o),v(ts.$$.fragment,o),v(So.$$.fragment,o),v(Mo.$$.fragment,o),v(os.$$.fragment,o),v(ns.$$.fragment,o),v(Co.$$.fragment,o),v(is.$$.fragment,o),v(Ao.$$.fragment,o),v(jo.$$.fragment,o),jr=!0)},o(o){E(d.$$.fragment,o),E(z.$$.fragment,o),E(Jo.$$.fragment,o),E(Zo.$$.fragment,o),E(so.$$.fragment,o),E(en.$$.fragment,o),E(tn.$$.fragment,o),E(ro.$$.fragment,o),E(io.$$.fragment,o),E(sn.$$.fragment,o),E(rn.$$.fragment,o),E(ln.$$.fragment,o),E(cn.$$.fragment,o),E(hn.$$.fragment,o),E(pn.$$.fragment,o),E(po.$$.fragment,o),E(uo.$$.fragment,o),E(gn.$$.fragment,o),E(_n.$$.fragment,o),E(bn.$$.fragment,o),E(kn.$$.fragment,o),E(Tn.$$.fragment,o),E(wn.$$.fragment,o),E(yn.$$.fragment,o),E(vn.$$.fragment,o),E(En.$$.fragment,o),E(qn.$$.fragment,o),E(Ln.$$.fragment,o),E($n.$$.fragment,o),E(xn.$$.fragment,o),E(_o.$$.fragment,o),E(bo.$$.fragment,o),E(Sn.$$.fragment,o),E(Mn.$$.fragment,o),E(jn.$$.fragment,o),E(To.$$.fragment,o),E(wo.$$.fragment,o),E(yo.$$.fragment,o),E(Pn.$$.fragment,o),E(Nn.$$.fragment,o),E(Hn.$$.fragment,o),E(Eo.$$.fragment,o),E(qo.$$.fragment,o),E(Lo.$$.fragment,o),E(Qn.$$.fragment,o),E(Wn.$$.fragment,o),E(Kn.$$.fragment,o),E(Do.$$.fragment,o),E(zo.$$.fragment,o),E(Xn.$$.fragment,o),E(Jn.$$.fragment,o),E(xo.$$.fragment,o),E(ts.$$.fragment,o),E(So.$$.fragment,o),E(Mo.$$.fragment,o),E(os.$$.fragment,o),E(ns.$$.fragment,o),E(Co.$$.fragment,o),E(is.$$.fragment,o),E(Ao.$$.fragment,o),E(jo.$$.fragment,o),jr=!1},d(o){t(l),o&&t(k),o&&t(f),q(d),o&&t(N),o&&t(j),q(z),o&&t(Se),o&&t(Q),o&&t(Me),o&&t(X),o&&t(Oe),o&&t(J),o&&t(_e),o&&t(M),o&&t(Ce),o&&t(x),o&&t(lr),o&&t(oo),o&&t(cr),o&&t(zt),q(Jo),o&&t(hr),o&&t(ze),q(Zo),q(so),o&&t(pr),o&&t(St),q(en),o&&t(ur),o&&t(C),q(tn),q(ro),q(io),q(sn),q(rn),q(ln),q(cn),o&&t(mr),o&&t(Mt),q(hn),o&&t(fr),o&&t(H),q(pn),q(po),q(uo),q(gn),o&&t(gr),o&&t(Ot),q(_n),o&&t(_r),o&&t(Ct),q(bn),o&&t(br),o&&t(At),q(kn),o&&t(kr),o&&t(jt),q(Tn),o&&t(Tr),o&&t(Pt),q(wn),o&&t(wr),o&&t(Nt),q(yn),o&&t(yr),o&&t(It),q(vn),o&&t(vr),o&&t(Gt),q(En),o&&t(Er),o&&t(Bt),q(qn),o&&t(qr),o&&t(Ht),q(Ln),o&&t(Lr),o&&t(Fe),q($n),q(xn),q(_o),q(bo),o&&t($r),o&&t(Wt),q(Sn),o&&t(Dr),o&&t(xe),q(Mn),q(jn),q(To),q(wo),q(yo),o&&t(zr),o&&t(Rt),q(Pn),o&&t(Fr),o&&t(ue),q(Nn),q(Hn),q(Eo),q(qo),q(Lo),o&&t(xr),o&&t(Kt),q(Qn),o&&t(Sr),o&&t(me),q(Wn),q(Kn),q(Do),q(zo),o&&t(Mr),o&&t(Zt),q(Xn),o&&t(Or),o&&t(fe),q(Jn),q(xo),q(ts),q(So),q(Mo),o&&t(Cr),o&&t(eo),q(os),o&&t(Ar),o&&t(ge),q(ns),q(Co),q(is),q(Ao),q(jo)}}}const Sm={local:"led",sections:[{local:"overview",title:"Overview"},{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 Mm($){return lm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Im extends am{constructor(l){super();rm(this,l,Mm,xm,im,{})}}export{Im as default,Sm as metadata};
