import{S as Yi,i as Xi,s as ed,e as s,k as u,w as y,t as i,M as od,c as a,d as t,m as p,a as r,x as w,h as d,b as c,G as e,g as _,y as k,q as B,o as T,B as P,v as td,L as xo}from"../../chunks/vendor-hf-doc-builder.js";import{T as In}from"../../chunks/Tip-hf-doc-builder.js";import{D}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Fo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as le}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as zo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function nd($){let l,v,f,h,b;return h=new Fo({props:{code:`from transformers import BigBirdPegasusConfig, BigBirdPegasusModel

# Initializing a BigBirdPegasus bigbird-pegasus-base style configuration
configuration = BigBirdPegasusConfig()

# Initializing a model (with random weights) from the bigbird-pegasus-base style configuration
model = BigBirdPegasusModel(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> BigBirdPegasusConfig, BigBirdPegasusModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BigBirdPegasus bigbird-pegasus-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BigBirdPegasusConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the bigbird-pegasus-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BigBirdPegasusModel(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=s("p"),v=i("Example:"),f=u(),y(h.$$.fragment)},l(n){l=a(n,"P",{});var g=r(l);v=d(g,"Example:"),g.forEach(t),f=p(n),w(h.$$.fragment,n)},m(n,g){_(n,l,g),e(l,v),_(n,f,g),k(h,n,g),b=!0},p:xo,i(n){b||(B(h.$$.fragment,n),b=!0)},o(n){T(h.$$.fragment,n),b=!1},d(n){n&&t(l),n&&t(f),P(h,n)}}}function sd($){let l,v,f,h,b;return{c(){l=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),b=i(`
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(n){l=a(n,"P",{});var g=r(l);v=d(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(g,"CODE",{});var z=r(f);h=d(z,"Module"),z.forEach(t),b=d(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(n,g){_(n,l,g),e(l,v),e(l,f),e(f,h),e(l,b)},d(n){n&&t(l)}}}function ad($){let l,v,f,h,b;return h=new Fo({props:{code:`from transformers import AutoTokenizer, BigBirdPegasusModel
import torch

tokenizer = AutoTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")
model = BigBirdPegasusModel.from_pretrained("google/bigbird-pegasus-large-arxiv")

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, BigBirdPegasusModel
<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;google/bigbird-pegasus-large-arxiv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BigBirdPegasusModel.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&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=s("p"),v=i("Example:"),f=u(),y(h.$$.fragment)},l(n){l=a(n,"P",{});var g=r(l);v=d(g,"Example:"),g.forEach(t),f=p(n),w(h.$$.fragment,n)},m(n,g){_(n,l,g),e(l,v),_(n,f,g),k(h,n,g),b=!0},p:xo,i(n){b||(B(h.$$.fragment,n),b=!0)},o(n){T(h.$$.fragment,n),b=!1},d(n){n&&t(l),n&&t(f),P(h,n)}}}function rd($){let l,v,f,h,b;return{c(){l=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),b=i(`
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(n){l=a(n,"P",{});var g=r(l);v=d(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(g,"CODE",{});var z=r(f);h=d(z,"Module"),z.forEach(t),b=d(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(n,g){_(n,l,g),e(l,v),e(l,f),e(f,h),e(l,b)},d(n){n&&t(l)}}}function id($){let l,v,f,h,b;return h=new Fo({props:{code:`from transformers import AutoTokenizer, BigBirdPegasusForConditionalGeneration

model = BigBirdPegasusForConditionalGeneration.from_pretrained("google/bigbird-pegasus-large-arxiv")
tokenizer = AutoTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")

ARTICLE_TO_SUMMARIZE = (
    "The dominant sequence transduction models are based on complex recurrent or convolutional neural "
    "networks in an encoder-decoder configuration. The best performing models also connect the encoder "
    "and decoder through an attention mechanism. We propose a new simple network architecture, the Transformer, "
    "based solely on attention mechanisms, dispensing with recurrence and convolutions entirely. "
    "Experiments on two machine translation tasks show these models to be superior in quality "
    "while being more parallelizable and requiring significantly less time to train."
)
inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=4096, return_tensors="pt", truncation=True)

# Generate Summary
summary_ids = model.generate(inputs["input_ids"], num_beams=4, max_length=15)
tokenizer.batch_decode(summary_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BigBirdPegasusForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BigBirdPegasusForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = (
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;The dominant sequence transduction models are based on complex recurrent or convolutional neural &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;networks in an encoder-decoder configuration. The best performing models also connect the encoder &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;and decoder through an attention mechanism. We propose a new simple network architecture, the Transformer, &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;based solely on attention mechanisms, dispensing with recurrence and convolutions entirely. &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Experiments on two machine translation tasks show these models to be superior in quality &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;while being more parallelizable and requiring significantly less time to train.&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=<span class="hljs-number">4096</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, truncation=<span class="hljs-literal">True</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[<span class="hljs-string">&quot;input_ids&quot;</span>], num_beams=<span class="hljs-number">4</span>, max_length=<span class="hljs-number">15</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;dominant sequence models are based on recurrent or convolutional neural networks .&#x27;</span>`}}),{c(){l=s("p"),v=i("Summarization example:"),f=u(),y(h.$$.fragment)},l(n){l=a(n,"P",{});var g=r(l);v=d(g,"Summarization example:"),g.forEach(t),f=p(n),w(h.$$.fragment,n)},m(n,g){_(n,l,g),e(l,v),_(n,f,g),k(h,n,g),b=!0},p:xo,i(n){b||(B(h.$$.fragment,n),b=!0)},o(n){T(h.$$.fragment,n),b=!1},d(n){n&&t(l),n&&t(f),P(h,n)}}}function dd($){let l,v,f,h,b;return{c(){l=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),b=i(`
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(n){l=a(n,"P",{});var g=r(l);v=d(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(g,"CODE",{});var z=r(f);h=d(z,"Module"),z.forEach(t),b=d(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(n,g){_(n,l,g),e(l,v),e(l,f),e(f,h),e(l,b)},d(n){n&&t(l)}}}function ld($){let l,v,f,h,b;return h=new Fo({props:{code:`import torch
from transformers import AutoTokenizer, BigBirdPegasusForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")
model = BigBirdPegasusForSequenceClassification.from_pretrained("google/bigbird-pegasus-large-arxiv")

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 = BigBirdPegasusForSequenceClassification.from_pretrained("google/bigbird-pegasus-large-arxiv", 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, BigBirdPegasusForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BigBirdPegasusForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&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 = BigBirdPegasusForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&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=s("p"),v=i("Example of single-label classification:"),f=u(),y(h.$$.fragment)},l(n){l=a(n,"P",{});var g=r(l);v=d(g,"Example of single-label classification:"),g.forEach(t),f=p(n),w(h.$$.fragment,n)},m(n,g){_(n,l,g),e(l,v),_(n,f,g),k(h,n,g),b=!0},p:xo,i(n){b||(B(h.$$.fragment,n),b=!0)},o(n){T(h.$$.fragment,n),b=!1},d(n){n&&t(l),n&&t(f),P(h,n)}}}function cd($){let l,v,f,h,b;return h=new Fo({props:{code:`import torch
from transformers import AutoTokenizer, BigBirdPegasusForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")
model = BigBirdPegasusForSequenceClassification.from_pretrained("google/bigbird-pegasus-large-arxiv", 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 = BigBirdPegasusForSequenceClassification.from_pretrained(
    "google/bigbird-pegasus-large-arxiv", 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, BigBirdPegasusForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BigBirdPegasusForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&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 = BigBirdPegasusForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&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=s("p"),v=i("Example of multi-label classification:"),f=u(),y(h.$$.fragment)},l(n){l=a(n,"P",{});var g=r(l);v=d(g,"Example of multi-label classification:"),g.forEach(t),f=p(n),w(h.$$.fragment,n)},m(n,g){_(n,l,g),e(l,v),_(n,f,g),k(h,n,g),b=!0},p:xo,i(n){b||(B(h.$$.fragment,n),b=!0)},o(n){T(h.$$.fragment,n),b=!1},d(n){n&&t(l),n&&t(f),P(h,n)}}}function ud($){let l,v,f,h,b;return{c(){l=s("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s("code"),h=i("Module"),b=i(`
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(n){l=a(n,"P",{});var g=r(l);v=d(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(g,"CODE",{});var z=r(f);h=d(z,"Module"),z.forEach(t),b=d(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(n,g){_(n,l,g),e(l,v),e(l,f),e(f,h),e(l,b)},d(n){n&&t(l)}}}function pd($){let l,v,f,h,b;return h=new Fo({props:{code:`from transformers import AutoTokenizer, BigBirdPegasusForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")
model = BigBirdPegasusForQuestionAnswering.from_pretrained("google/bigbird-pegasus-large-arxiv")

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, BigBirdPegasusForQuestionAnswering
<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;google/bigbird-pegasus-large-arxiv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BigBirdPegasusForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&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=s("p"),v=i("Example:"),f=u(),y(h.$$.fragment)},l(n){l=a(n,"P",{});var g=r(l);v=d(g,"Example:"),g.forEach(t),f=p(n),w(h.$$.fragment,n)},m(n,g){_(n,l,g),e(l,v),_(n,f,g),k(h,n,g),b=!0},p:xo,i(n){b||(B(h.$$.fragment,n),b=!0)},o(n){T(h.$$.fragment,n),b=!1},d(n){n&&t(l),n&&t(f),P(h,n)}}}function hd($){let l,v,f,h,b;return h=new Fo({props:{code:`from transformers import AutoTokenizer, BigBirdPegasusForCausalLM

tokenizer = AutoTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")
model = BigBirdPegasusForCausalLM.from_pretrained(
    "google/bigbird-pegasus-large-arxiv", add_cross_attention=False
)
assert model.config.is_decoder, f"{model.__class__} has to be configured as a decoder."
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BigBirdPegasusForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BigBirdPegasusForCausalLM.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;google/bigbird-pegasus-large-arxiv&quot;</span>, add_cross_attention=<span class="hljs-literal">False</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> model.config.is_decoder, <span class="hljs-string">f&quot;<span class="hljs-subst">{model.__class__}</span> has to be configured as a decoder.&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>logits = outputs.logits`}}),{c(){l=s("p"),v=i("Example:"),f=u(),y(h.$$.fragment)},l(n){l=a(n,"P",{});var g=r(l);v=d(g,"Example:"),g.forEach(t),f=p(n),w(h.$$.fragment,n)},m(n,g){_(n,l,g),e(l,v),_(n,f,g),k(h,n,g),b=!0},p:xo,i(n){b||(B(h.$$.fragment,n),b=!0)},o(n){T(h.$$.fragment,n),b=!1},d(n){n&&t(l),n&&t(f),P(h,n)}}}function gd($){let l,v,f,h,b,n,g,z,Dn,Jt,U,ce,nt,Le,Gn,st,Wn,Zt,ue,Qn,Ne,Hn,Rn,Kt,Co,Un,Yt,Mo,at,Vn,Xt,Eo,Jn,en,q,Ie,Zn,De,Kn,Yn,Xn,A,es,rt,os,ts,it,ns,ss,dt,as,rs,lt,is,ds,ls,ct,cs,us,ut,ps,hs,Ge,gs,pt,ms,fs,_s,We,bs,ht,vs,ys,ws,Qe,ks,He,Bs,Ts,Ps,gt,$s,on,pe,qs,Re,zs,xs,tn,V,he,mt,Ue,Fs,ft,Cs,nn,M,_t,Ao,Ms,Es,bt,jo,As,js,vt,So,Ss,Os,yt,Oo,Ls,Ns,wt,Lo,Is,sn,J,ge,kt,Ve,Ds,Bt,Gs,an,j,Je,Ws,Z,Qs,No,Hs,Rs,Ze,Us,Vs,Js,K,Zs,Io,Ks,Ys,Do,Xs,ea,oa,me,rn,Y,fe,Tt,Ke,ta,Pt,na,dn,S,Ye,sa,Xe,aa,Go,ra,ia,da,eo,la,oo,ca,ua,pa,L,to,ha,X,ga,Wo,ma,fa,$t,_a,ba,va,_e,ya,be,ln,ee,ve,qt,no,wa,zt,ka,cn,O,so,Ba,ao,Ta,Qo,Pa,$a,qa,ro,za,io,xa,Fa,Ca,N,lo,Ma,oe,Ea,Ho,Aa,ja,xt,Sa,Oa,La,ye,Na,we,un,te,ke,Ft,co,Ia,Ct,Da,pn,F,uo,Ga,Mt,Wa,Qa,po,Ha,Ro,Ra,Ua,Va,ho,Ja,go,Za,Ka,Ya,E,mo,Xa,ne,er,Uo,or,tr,Et,nr,sr,ar,Be,rr,Te,ir,Pe,hn,se,$e,At,fo,dr,jt,lr,gn,C,_o,cr,ae,ur,St,pr,hr,Ot,gr,mr,fr,bo,_r,Vo,br,vr,yr,vo,wr,yo,kr,Br,Tr,I,wo,Pr,re,$r,Jo,qr,zr,Lt,xr,Fr,Cr,qe,Mr,ze,mn,ie,xe,Nt,ko,Er,It,Ar,fn,de,Bo,jr,Fe,To,Sr,Ce,_n;return n=new le({}),Le=new le({}),Ue=new le({}),Ve=new le({}),Je=new D({props:{name:"class transformers.BigBirdPegasusConfig",anchor:"transformers.BigBirdPegasusConfig",parameters:[{name:"vocab_size",val:" = 96103"},{name:"max_position_embeddings",val:" = 4096"},{name:"encoder_layers",val:" = 16"},{name:"encoder_ffn_dim",val:" = 4096"},{name:"encoder_attention_heads",val:" = 16"},{name:"decoder_layers",val:" = 16"},{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_new'"},{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:"scale_embedding",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 2"},{name:"eos_token_id",val:" = 1"},{name:"attention_type",val:" = 'block_sparse'"},{name:"block_size",val:" = 64"},{name:"num_random_blocks",val:" = 3"},{name:"use_bias",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BigBirdPegasusConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 96103) &#x2014;
Vocabulary size of the BigBirdPegasus model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusModel">BigBirdPegasusModel</a>.`,name:"vocab_size"},{anchor:"transformers.BigBirdPegasusConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimension of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.BigBirdPegasusConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.BigBirdPegasusConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.BigBirdPegasusConfig.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.BigBirdPegasusConfig.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.BigBirdPegasusConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.BigBirdPegasusConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.BigBirdPegasusConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_new&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.BigBirdPegasusConfig.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.BigBirdPegasusConfig.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.BigBirdPegasusConfig.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.BigBirdPegasusConfig.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.BigBirdPegasusConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 1024 or 2048 or 4096).`,name:"max_position_embeddings"},{anchor:"transformers.BigBirdPegasusConfig.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.BigBirdPegasusConfig.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.BigBirdPegasusConfig.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.BigBirdPegasusConfig.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"},{anchor:"transformers.BigBirdPegasusConfig.attention_type",description:`<strong>attention_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;block_sparse&quot;</code>) &#x2014;
Whether to use block sparse attention (with n complexity) as introduced in paper or original attention
layer (with n^2 complexity) in encoder. Possible values are <code>&quot;original_full&quot;</code> and <code>&quot;block_sparse&quot;</code>.`,name:"attention_type"},{anchor:"transformers.BigBirdPegasusConfig.use_bias",description:`<strong>use_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use bias in query, key, value.`,name:"use_bias"},{anchor:"transformers.BigBirdPegasusConfig.block_size",description:`<strong>block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Size of each block. Useful only when <code>attention_type == &quot;block_sparse&quot;</code>.`,name:"block_size"},{anchor:"transformers.BigBirdPegasusConfig.num_random_blocks",description:`<strong>num_random_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Each query is going to attend these many number of random blocks. Useful only when <code>attention_type == &quot;block_sparse&quot;</code>.`,name:"num_random_blocks"},{anchor:"transformers.BigBirdPegasusConfig.scale_embeddings",description:`<strong>scale_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale embeddings with (hidden_size ** 0.5).`,name:"scale_embeddings"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py#L43"}}),me=new zo({props:{anchor:"transformers.BigBirdPegasusConfig.example",$$slots:{default:[nd]},$$scope:{ctx:$}}}),Ke=new le({}),Ye=new D({props:{name:"class transformers.BigBirdPegasusModel",anchor:"transformers.BigBirdPegasusModel",parameters:[{name:"config",val:": BigBirdPegasusConfig"}],parametersDescription:[{anchor:"transformers.BigBirdPegasusModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig">BigBirdPegasusConfig</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/v4.29.0/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/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2354"}}),to=new D({props:{name:"forward",anchor:"transformers.BigBirdPegasusModel.forward",parameters:[{name:"input_ids",val:": 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.List[torch.FloatTensor]] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[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.BigBirdPegasusModel.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BigBirdPegasusModel.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.BigBirdPegasusModel.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;
Provide for translation and summarization training. By default, the model will create this tensor by
shifting the <code>input_ids</code> to the right, following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.BigBirdPegasusModel.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_bigbird_pegasus._prepare_decoder_attention_mask</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.BigBirdPegasusModel.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_layers, num_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.BigBirdPegasusModel.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.BigBirdPegasusModel.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>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.BigBirdPegasusModel.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.BigBirdPegasusModel.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.BigBirdPegasusModel.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.BigBirdPegasusModel.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.BigBirdPegasusModel.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/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2383",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig"
>BigBirdPegasusConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new In({props:{$$slots:{default:[sd]},$$scope:{ctx:$}}}),be=new zo({props:{anchor:"transformers.BigBirdPegasusModel.forward.example",$$slots:{default:[ad]},$$scope:{ctx:$}}}),no=new le({}),so=new D({props:{name:"class transformers.BigBirdPegasusForConditionalGeneration",anchor:"transformers.BigBirdPegasusForConditionalGeneration",parameters:[{name:"config",val:": BigBirdPegasusConfig"}],parametersDescription:[{anchor:"transformers.BigBirdPegasusForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig">BigBirdPegasusConfig</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/v4.29.0/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/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2484"}}),lo=new D({props:{name:"forward",anchor:"transformers.BigBirdPegasusForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": 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.List[torch.FloatTensor]] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[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.BigBirdPegasusForConditionalGeneration.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BigBirdPegasusForConditionalGeneration.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.BigBirdPegasusForConditionalGeneration.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;
Provide for translation and summarization training. By default, the model will create this tensor by
shifting the <code>input_ids</code> to the right, following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.BigBirdPegasusForConditionalGeneration.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_bigbird_pegasus._prepare_decoder_attention_mask</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.BigBirdPegasusForConditionalGeneration.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_layers, num_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.BigBirdPegasusForConditionalGeneration.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.BigBirdPegasusForConditionalGeneration.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>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.BigBirdPegasusForConditionalGeneration.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.BigBirdPegasusForConditionalGeneration.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.BigBirdPegasusForConditionalGeneration.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.BigBirdPegasusForConditionalGeneration.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.BigBirdPegasusForConditionalGeneration.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/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BigBirdPegasusForConditionalGeneration.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/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2528",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig"
>BigBirdPegasusConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new In({props:{$$slots:{default:[rd]},$$scope:{ctx:$}}}),we=new zo({props:{anchor:"transformers.BigBirdPegasusForConditionalGeneration.forward.example",$$slots:{default:[id]},$$scope:{ctx:$}}}),co=new le({}),uo=new D({props:{name:"class transformers.BigBirdPegasusForSequenceClassification",anchor:"transformers.BigBirdPegasusForSequenceClassification",parameters:[{name:"config",val:": BigBirdPegasusConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BigBirdPegasusForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig">BigBirdPegasusConfig</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/v4.29.0/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/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2663"}}),mo=new D({props:{name:"forward",anchor:"transformers.BigBirdPegasusForSequenceClassification.forward",parameters:[{name:"input_ids",val:": 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.List[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.BigBirdPegasusForSequenceClassification.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BigBirdPegasusForSequenceClassification.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.BigBirdPegasusForSequenceClassification.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;
Provide for translation and summarization training. By default, the model will create this tensor by
shifting the <code>input_ids</code> to the right, following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.BigBirdPegasusForSequenceClassification.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_bigbird_pegasus._prepare_decoder_attention_mask</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.BigBirdPegasusForSequenceClassification.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_layers, num_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.BigBirdPegasusForSequenceClassification.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.BigBirdPegasusForSequenceClassification.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>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.BigBirdPegasusForSequenceClassification.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.BigBirdPegasusForSequenceClassification.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.BigBirdPegasusForSequenceClassification.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.BigBirdPegasusForSequenceClassification.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.BigBirdPegasusForSequenceClassification.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/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BigBirdPegasusForSequenceClassification.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/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2679",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig"
>BigBirdPegasusConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Be=new In({props:{$$slots:{default:[dd]},$$scope:{ctx:$}}}),Te=new zo({props:{anchor:"transformers.BigBirdPegasusForSequenceClassification.forward.example",$$slots:{default:[ld]},$$scope:{ctx:$}}}),Pe=new zo({props:{anchor:"transformers.BigBirdPegasusForSequenceClassification.forward.example-2",$$slots:{default:[cd]},$$scope:{ctx:$}}}),fo=new le({}),_o=new D({props:{name:"class transformers.BigBirdPegasusForQuestionAnswering",anchor:"transformers.BigBirdPegasusForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BigBirdPegasusForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig">BigBirdPegasusConfig</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/v4.29.0/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/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2792"}}),wo=new D({props:{name:"forward",anchor:"transformers.BigBirdPegasusForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": Tensor = 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.List[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.BigBirdPegasusForQuestionAnswering.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BigBirdPegasusForQuestionAnswering.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.BigBirdPegasusForQuestionAnswering.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;
Provide for translation and summarization training. By default, the model will create this tensor by
shifting the <code>input_ids</code> to the right, following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.BigBirdPegasusForQuestionAnswering.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_bigbird_pegasus._prepare_decoder_attention_mask</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.BigBirdPegasusForQuestionAnswering.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_layers, num_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.BigBirdPegasusForQuestionAnswering.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.BigBirdPegasusForQuestionAnswering.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>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.BigBirdPegasusForQuestionAnswering.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.BigBirdPegasusForQuestionAnswering.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.BigBirdPegasusForQuestionAnswering.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.BigBirdPegasusForQuestionAnswering.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.BigBirdPegasusForQuestionAnswering.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/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BigBirdPegasusForQuestionAnswering.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.BigBirdPegasusForQuestionAnswering.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/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2807",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig"
>BigBirdPegasusConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qe=new In({props:{$$slots:{default:[ud]},$$scope:{ctx:$}}}),ze=new zo({props:{anchor:"transformers.BigBirdPegasusForQuestionAnswering.forward.example",$$slots:{default:[pd]},$$scope:{ctx:$}}}),ko=new le({}),Bo=new D({props:{name:"class transformers.BigBirdPegasusForCausalLM",anchor:"transformers.BigBirdPegasusForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2924"}}),To=new D({props:{name:"forward",anchor:"transformers.BigBirdPegasusForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"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.BigBirdPegasusForCausalLM.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BigBirdPegasusForCausalLM.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.BigBirdPegasusForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</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. Used in the cross-attention
if the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.BigBirdPegasusForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used
in the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:`,name:"encoder_attention_mask"},{anchor:"transformers.BigBirdPegasusForCausalLM.forward.head_mask",description:`<strong>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. 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.BigBirdPegasusForCausalLM.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. 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.BigBirdPegasusForCausalLM.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>. The two additional
tensors are only required when the model is used as a decoder in a Sequence to Sequence model.</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.BigBirdPegasusForCausalLM.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"},{anchor:"transformers.BigBirdPegasusForCausalLM.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>).</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"use_cache"},{anchor:"transformers.BigBirdPegasusForCausalLM.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.BigBirdPegasusForCausalLM.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.BigBirdPegasusForCausalLM.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/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2957",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</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/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig"
>BigBirdPegasusConfig</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 (for next-token prediction).</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>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 model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><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>) \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 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>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</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>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ce=new zo({props:{anchor:"transformers.BigBirdPegasusForCausalLM.forward.example",$$slots:{default:[hd]},$$scope:{ctx:$}}}),{c(){l=s("meta"),v=u(),f=s("h1"),h=s("a"),b=s("span"),y(n.$$.fragment),g=u(),z=s("span"),Dn=i("BigBirdPegasus"),Jt=u(),U=s("h2"),ce=s("a"),nt=s("span"),y(Le.$$.fragment),Gn=u(),st=s("span"),Wn=i("Overview"),Zt=u(),ue=s("p"),Qn=i("The BigBird model was proposed in "),Ne=s("a"),Hn=i("Big Bird: Transformers for Longer Sequences"),Rn=i(` by
Zaheer, Manzil and Guruganesh, Guru and Dubey, Kumar Avinava and Ainslie, Joshua and Alberti, Chris and Ontanon,
Santiago and Pham, Philip and Ravula, Anirudh and Wang, Qifan and Yang, Li and others. BigBird, is a sparse-attention
based transformer which extends Transformer based models, such as BERT to much longer sequences. In addition to sparse
attention, BigBird also applies global attention as well as random attention to the input sequence. Theoretically, it
has been shown that applying sparse, global, and random attention approximates full attention, while being
computationally much more efficient for longer sequences. As a consequence of the capability to handle longer context,
BigBird has shown improved performance on various long document NLP tasks, such as question answering and
summarization, compared to BERT or RoBERTa.`),Kt=u(),Co=s("p"),Un=i("The abstract from the paper is the following:"),Yt=u(),Mo=s("p"),at=s("em"),Vn=i(`Transformers-based models, such as BERT, have been one of the most successful deep learning models for NLP.
Unfortunately, one of their core limitations is the quadratic dependency (mainly in terms of memory) on the sequence
length due to their full attention mechanism. To remedy this, we propose, BigBird, a sparse attention mechanism that
reduces this quadratic dependency to linear. We show that BigBird is a universal approximator of sequence functions and
is Turing complete, thereby preserving these properties of the quadratic, full attention model. Along the way, our
theoretical analysis reveals some of the benefits of having O(1) global tokens (such as CLS), that attend to the entire
sequence as part of the sparse attention mechanism. The proposed sparse attention can handle sequences of length up to
8x of what was previously possible using similar hardware. As a consequence of the capability to handle longer context,
BigBird drastically improves performance on various NLP tasks such as question answering and summarization. We also
propose novel applications to genomics data.`),Xt=u(),Eo=s("p"),Jn=i("Tips:"),en=u(),q=s("ul"),Ie=s("li"),Zn=i("For an in-detail explanation on how BigBird\u2019s attention works, see "),De=s("a"),Kn=i("this blog post"),Yn=i("."),Xn=u(),A=s("li"),es=i("BigBird comes with 2 implementations: "),rt=s("strong"),os=i("original_full"),ts=i(" & "),it=s("strong"),ns=i("block_sparse"),ss=i(`. For the sequence length < 1024, using
`),dt=s("strong"),as=i("original_full"),rs=i(" is advised as there is no benefit in using "),lt=s("strong"),is=i("block_sparse"),ds=i(" attention."),ls=u(),ct=s("li"),cs=i("The code currently uses window size of 3 blocks and 2 global blocks."),us=u(),ut=s("li"),ps=i("Sequence length must be divisible by block size."),hs=u(),Ge=s("li"),gs=i("Current implementation supports only "),pt=s("strong"),ms=i("ITC"),fs=i("."),_s=u(),We=s("li"),bs=i("Current implementation doesn\u2019t support "),ht=s("strong"),vs=i("num_random_blocks = 0"),ys=i("."),ws=u(),Qe=s("li"),ks=i("BigBirdPegasus uses the "),He=s("a"),Bs=i("PegasusTokenizer"),Ts=i("."),Ps=u(),gt=s("li"),$s=i(`BigBird is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),on=u(),pe=s("p"),qs=i("The original code can be found "),Re=s("a"),zs=i("here"),xs=i("."),tn=u(),V=s("h2"),he=s("a"),mt=s("span"),y(Ue.$$.fragment),Fs=u(),ft=s("span"),Cs=i("Documentation resources"),nn=u(),M=s("ul"),_t=s("li"),Ao=s("a"),Ms=i("Text classification task guide"),Es=u(),bt=s("li"),jo=s("a"),As=i("Question answering task guide"),js=u(),vt=s("li"),So=s("a"),Ss=i("Causal language modeling task guide"),Os=u(),yt=s("li"),Oo=s("a"),Ls=i("Translation task guide"),Ns=u(),wt=s("li"),Lo=s("a"),Is=i("Summarization task guide"),sn=u(),J=s("h2"),ge=s("a"),kt=s("span"),y(Ve.$$.fragment),Ds=u(),Bt=s("span"),Gs=i("BigBirdPegasusConfig"),an=u(),j=s("div"),y(Je.$$.fragment),Ws=u(),Z=s("p"),Qs=i("This is the configuration class to store the configuration of a "),No=s("a"),Hs=i("BigBirdPegasusModel"),Rs=i(`. It is used to instantiate
an BigBirdPegasus 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 BigBirdPegasus
`),Ze=s("a"),Us=i("google/bigbird-pegasus-large-arxiv"),Vs=i(" architecture."),Js=u(),K=s("p"),Zs=i("Configuration objects inherit from "),Io=s("a"),Ks=i("PretrainedConfig"),Ys=i(` and can be used to control the model outputs. Read the
documentation from `),Do=s("a"),Xs=i("PretrainedConfig"),ea=i(" for more information."),oa=u(),y(me.$$.fragment),rn=u(),Y=s("h2"),fe=s("a"),Tt=s("span"),y(Ke.$$.fragment),ta=u(),Pt=s("span"),na=i("BigBirdPegasusModel"),dn=u(),S=s("div"),y(Ye.$$.fragment),sa=u(),Xe=s("p"),aa=i(`The bare BigBirdPegasus Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Go=s("a"),ra=i("PreTrainedModel"),ia=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),da=u(),eo=s("p"),la=i("This model is also a PyTorch "),oo=s("a"),ca=i("torch.nn.Module"),ua=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pa=u(),L=s("div"),y(to.$$.fragment),ha=u(),X=s("p"),ga=i("The "),Wo=s("a"),ma=i("BigBirdPegasusModel"),fa=i(" forward method, overrides the "),$t=s("code"),_a=i("__call__"),ba=i(" special method."),va=u(),y(_e.$$.fragment),ya=u(),y(be.$$.fragment),ln=u(),ee=s("h2"),ve=s("a"),qt=s("span"),y(no.$$.fragment),wa=u(),zt=s("span"),ka=i("BigBirdPegasusForConditionalGeneration"),cn=u(),O=s("div"),y(so.$$.fragment),Ba=u(),ao=s("p"),Ta=i(`The BigBirdPegasus Model with a language modeling head. Can be used for summarization.
This model inherits from `),Qo=s("a"),Pa=i("PreTrainedModel"),$a=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),qa=u(),ro=s("p"),za=i("This model is also a PyTorch "),io=s("a"),xa=i("torch.nn.Module"),Fa=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ca=u(),N=s("div"),y(lo.$$.fragment),Ma=u(),oe=s("p"),Ea=i("The "),Ho=s("a"),Aa=i("BigBirdPegasusForConditionalGeneration"),ja=i(" forward method, overrides the "),xt=s("code"),Sa=i("__call__"),Oa=i(" special method."),La=u(),y(ye.$$.fragment),Na=u(),y(we.$$.fragment),un=u(),te=s("h2"),ke=s("a"),Ft=s("span"),y(co.$$.fragment),Ia=u(),Ct=s("span"),Da=i("BigBirdPegasusForSequenceClassification"),pn=u(),F=s("div"),y(uo.$$.fragment),Ga=u(),Mt=s("p"),Wa=i(`BigBirdPegasus model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),Qa=u(),po=s("p"),Ha=i("This model inherits from "),Ro=s("a"),Ra=i("PreTrainedModel"),Ua=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Va=u(),ho=s("p"),Ja=i("This model is also a PyTorch "),go=s("a"),Za=i("torch.nn.Module"),Ka=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ya=u(),E=s("div"),y(mo.$$.fragment),Xa=u(),ne=s("p"),er=i("The "),Uo=s("a"),or=i("BigBirdPegasusForSequenceClassification"),tr=i(" forward method, overrides the "),Et=s("code"),nr=i("__call__"),sr=i(" special method."),ar=u(),y(Be.$$.fragment),rr=u(),y(Te.$$.fragment),ir=u(),y(Pe.$$.fragment),hn=u(),se=s("h2"),$e=s("a"),At=s("span"),y(fo.$$.fragment),dr=u(),jt=s("span"),lr=i("BigBirdPegasusForQuestionAnswering"),gn=u(),C=s("div"),y(_o.$$.fragment),cr=u(),ae=s("p"),ur=i(`BigBirdPegasus 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 `),St=s("code"),pr=i("span start logits"),hr=i(" and "),Ot=s("code"),gr=i("span end logits"),mr=i(")."),fr=u(),bo=s("p"),_r=i("This model inherits from "),Vo=s("a"),br=i("PreTrainedModel"),vr=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),yr=u(),vo=s("p"),wr=i("This model is also a PyTorch "),yo=s("a"),kr=i("torch.nn.Module"),Br=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tr=u(),I=s("div"),y(wo.$$.fragment),Pr=u(),re=s("p"),$r=i("The "),Jo=s("a"),qr=i("BigBirdPegasusForQuestionAnswering"),zr=i(" forward method, overrides the "),Lt=s("code"),xr=i("__call__"),Fr=i(" special method."),Cr=u(),y(qe.$$.fragment),Mr=u(),y(ze.$$.fragment),mn=u(),ie=s("h2"),xe=s("a"),Nt=s("span"),y(ko.$$.fragment),Er=u(),It=s("span"),Ar=i("BigBirdPegasusForCausalLM"),fn=u(),de=s("div"),y(Bo.$$.fragment),jr=u(),Fe=s("div"),y(To.$$.fragment),Sr=u(),y(Ce.$$.fragment),this.h()},l(o){const m=od('[data-svelte="svelte-1phssyn"]',document.head);l=a(m,"META",{name:!0,content:!0}),m.forEach(t),v=p(o),f=a(o,"H1",{class:!0});var Po=r(f);h=a(Po,"A",{id:!0,class:!0,href:!0});var Dt=r(h);b=a(Dt,"SPAN",{});var Gt=r(b);w(n.$$.fragment,Gt),Gt.forEach(t),Dt.forEach(t),g=p(Po),z=a(Po,"SPAN",{});var Wt=r(z);Dn=d(Wt,"BigBirdPegasus"),Wt.forEach(t),Po.forEach(t),Jt=p(o),U=a(o,"H2",{class:!0});var $o=r(U);ce=a($o,"A",{id:!0,class:!0,href:!0});var Qt=r(ce);nt=a(Qt,"SPAN",{});var Ht=r(nt);w(Le.$$.fragment,Ht),Ht.forEach(t),Qt.forEach(t),Gn=p($o),st=a($o,"SPAN",{});var Rt=r(st);Wn=d(Rt,"Overview"),Rt.forEach(t),$o.forEach(t),Zt=p(o),ue=a(o,"P",{});var qo=r(ue);Qn=d(qo,"The BigBird model was proposed in "),Ne=a(qo,"A",{href:!0,rel:!0});var Ut=r(Ne);Hn=d(Ut,"Big Bird: Transformers for Longer Sequences"),Ut.forEach(t),Rn=d(qo,` by
Zaheer, Manzil and Guruganesh, Guru and Dubey, Kumar Avinava and Ainslie, Joshua and Alberti, Chris and Ontanon,
Santiago and Pham, Philip and Ravula, Anirudh and Wang, Qifan and Yang, Li and others. BigBird, is a sparse-attention
based transformer which extends Transformer based models, such as BERT to much longer sequences. In addition to sparse
attention, BigBird also applies global attention as well as random attention to the input sequence. Theoretically, it
has been shown that applying sparse, global, and random attention approximates full attention, while being
computationally much more efficient for longer sequences. As a consequence of the capability to handle longer context,
BigBird has shown improved performance on various long document NLP tasks, such as question answering and
summarization, compared to BERT or RoBERTa.`),qo.forEach(t),Kt=p(o),Co=a(o,"P",{});var Vt=r(Co);Un=d(Vt,"The abstract from the paper is the following:"),Vt.forEach(t),Yt=p(o),Mo=a(o,"P",{});var Or=r(Mo);at=a(Or,"EM",{});var Lr=r(at);Vn=d(Lr,`Transformers-based models, such as BERT, have been one of the most successful deep learning models for NLP.
Unfortunately, one of their core limitations is the quadratic dependency (mainly in terms of memory) on the sequence
length due to their full attention mechanism. To remedy this, we propose, BigBird, a sparse attention mechanism that
reduces this quadratic dependency to linear. We show that BigBird is a universal approximator of sequence functions and
is Turing complete, thereby preserving these properties of the quadratic, full attention model. Along the way, our
theoretical analysis reveals some of the benefits of having O(1) global tokens (such as CLS), that attend to the entire
sequence as part of the sparse attention mechanism. The proposed sparse attention can handle sequences of length up to
8x of what was previously possible using similar hardware. As a consequence of the capability to handle longer context,
BigBird drastically improves performance on various NLP tasks such as question answering and summarization. We also
propose novel applications to genomics data.`),Lr.forEach(t),Or.forEach(t),Xt=p(o),Eo=a(o,"P",{});var Nr=r(Eo);Jn=d(Nr,"Tips:"),Nr.forEach(t),en=p(o),q=a(o,"UL",{});var x=r(q);Ie=a(x,"LI",{});var bn=r(Ie);Zn=d(bn,"For an in-detail explanation on how BigBird\u2019s attention works, see "),De=a(bn,"A",{href:!0,rel:!0});var Ir=r(De);Kn=d(Ir,"this blog post"),Ir.forEach(t),Yn=d(bn,"."),bn.forEach(t),Xn=p(x),A=a(x,"LI",{});var G=r(A);es=d(G,"BigBird comes with 2 implementations: "),rt=a(G,"STRONG",{});var Dr=r(rt);os=d(Dr,"original_full"),Dr.forEach(t),ts=d(G," & "),it=a(G,"STRONG",{});var Gr=r(it);ns=d(Gr,"block_sparse"),Gr.forEach(t),ss=d(G,`. For the sequence length < 1024, using
`),dt=a(G,"STRONG",{});var Wr=r(dt);as=d(Wr,"original_full"),Wr.forEach(t),rs=d(G," is advised as there is no benefit in using "),lt=a(G,"STRONG",{});var Qr=r(lt);is=d(Qr,"block_sparse"),Qr.forEach(t),ds=d(G," attention."),G.forEach(t),ls=p(x),ct=a(x,"LI",{});var Hr=r(ct);cs=d(Hr,"The code currently uses window size of 3 blocks and 2 global blocks."),Hr.forEach(t),us=p(x),ut=a(x,"LI",{});var Rr=r(ut);ps=d(Rr,"Sequence length must be divisible by block size."),Rr.forEach(t),hs=p(x),Ge=a(x,"LI",{});var vn=r(Ge);gs=d(vn,"Current implementation supports only "),pt=a(vn,"STRONG",{});var Ur=r(pt);ms=d(Ur,"ITC"),Ur.forEach(t),fs=d(vn,"."),vn.forEach(t),_s=p(x),We=a(x,"LI",{});var yn=r(We);bs=d(yn,"Current implementation doesn\u2019t support "),ht=a(yn,"STRONG",{});var Vr=r(ht);vs=d(Vr,"num_random_blocks = 0"),Vr.forEach(t),ys=d(yn,"."),yn.forEach(t),ws=p(x),Qe=a(x,"LI",{});var wn=r(Qe);ks=d(wn,"BigBirdPegasus uses the "),He=a(wn,"A",{href:!0,rel:!0});var Jr=r(He);Bs=d(Jr,"PegasusTokenizer"),Jr.forEach(t),Ts=d(wn,"."),wn.forEach(t),Ps=p(x),gt=a(x,"LI",{});var Zr=r(gt);$s=d(Zr,`BigBird is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Zr.forEach(t),x.forEach(t),on=p(o),pe=a(o,"P",{});var kn=r(pe);qs=d(kn,"The original code can be found "),Re=a(kn,"A",{href:!0,rel:!0});var Kr=r(Re);zs=d(Kr,"here"),Kr.forEach(t),xs=d(kn,"."),kn.forEach(t),tn=p(o),V=a(o,"H2",{class:!0});var Bn=r(V);he=a(Bn,"A",{id:!0,class:!0,href:!0});var Yr=r(he);mt=a(Yr,"SPAN",{});var Xr=r(mt);w(Ue.$$.fragment,Xr),Xr.forEach(t),Yr.forEach(t),Fs=p(Bn),ft=a(Bn,"SPAN",{});var ei=r(ft);Cs=d(ei,"Documentation resources"),ei.forEach(t),Bn.forEach(t),nn=p(o),M=a(o,"UL",{});var W=r(M);_t=a(W,"LI",{});var oi=r(_t);Ao=a(oi,"A",{href:!0});var ti=r(Ao);Ms=d(ti,"Text classification task guide"),ti.forEach(t),oi.forEach(t),Es=p(W),bt=a(W,"LI",{});var ni=r(bt);jo=a(ni,"A",{href:!0});var si=r(jo);As=d(si,"Question answering task guide"),si.forEach(t),ni.forEach(t),js=p(W),vt=a(W,"LI",{});var ai=r(vt);So=a(ai,"A",{href:!0});var ri=r(So);Ss=d(ri,"Causal language modeling task guide"),ri.forEach(t),ai.forEach(t),Os=p(W),yt=a(W,"LI",{});var ii=r(yt);Oo=a(ii,"A",{href:!0});var di=r(Oo);Ls=d(di,"Translation task guide"),di.forEach(t),ii.forEach(t),Ns=p(W),wt=a(W,"LI",{});var li=r(wt);Lo=a(li,"A",{href:!0});var ci=r(Lo);Is=d(ci,"Summarization task guide"),ci.forEach(t),li.forEach(t),W.forEach(t),sn=p(o),J=a(o,"H2",{class:!0});var Tn=r(J);ge=a(Tn,"A",{id:!0,class:!0,href:!0});var ui=r(ge);kt=a(ui,"SPAN",{});var pi=r(kt);w(Ve.$$.fragment,pi),pi.forEach(t),ui.forEach(t),Ds=p(Tn),Bt=a(Tn,"SPAN",{});var hi=r(Bt);Gs=d(hi,"BigBirdPegasusConfig"),hi.forEach(t),Tn.forEach(t),an=p(o),j=a(o,"DIV",{class:!0});var Me=r(j);w(Je.$$.fragment,Me),Ws=p(Me),Z=a(Me,"P",{});var Zo=r(Z);Qs=d(Zo,"This is the configuration class to store the configuration of a "),No=a(Zo,"A",{href:!0});var gi=r(No);Hs=d(gi,"BigBirdPegasusModel"),gi.forEach(t),Rs=d(Zo,`. It is used to instantiate
an BigBirdPegasus 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 BigBirdPegasus
`),Ze=a(Zo,"A",{href:!0,rel:!0});var mi=r(Ze);Us=d(mi,"google/bigbird-pegasus-large-arxiv"),mi.forEach(t),Vs=d(Zo," architecture."),Zo.forEach(t),Js=p(Me),K=a(Me,"P",{});var Ko=r(K);Zs=d(Ko,"Configuration objects inherit from "),Io=a(Ko,"A",{href:!0});var fi=r(Io);Ks=d(fi,"PretrainedConfig"),fi.forEach(t),Ys=d(Ko,` and can be used to control the model outputs. Read the
documentation from `),Do=a(Ko,"A",{href:!0});var _i=r(Do);Xs=d(_i,"PretrainedConfig"),_i.forEach(t),ea=d(Ko," for more information."),Ko.forEach(t),oa=p(Me),w(me.$$.fragment,Me),Me.forEach(t),rn=p(o),Y=a(o,"H2",{class:!0});var Pn=r(Y);fe=a(Pn,"A",{id:!0,class:!0,href:!0});var bi=r(fe);Tt=a(bi,"SPAN",{});var vi=r(Tt);w(Ke.$$.fragment,vi),vi.forEach(t),bi.forEach(t),ta=p(Pn),Pt=a(Pn,"SPAN",{});var yi=r(Pt);na=d(yi,"BigBirdPegasusModel"),yi.forEach(t),Pn.forEach(t),dn=p(o),S=a(o,"DIV",{class:!0});var Ee=r(S);w(Ye.$$.fragment,Ee),sa=p(Ee),Xe=a(Ee,"P",{});var $n=r(Xe);aa=d($n,`The bare BigBirdPegasus Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Go=a($n,"A",{href:!0});var wi=r(Go);ra=d(wi,"PreTrainedModel"),wi.forEach(t),ia=d($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 etc.)`),$n.forEach(t),da=p(Ee),eo=a(Ee,"P",{});var qn=r(eo);la=d(qn,"This model is also a PyTorch "),oo=a(qn,"A",{href:!0,rel:!0});var ki=r(oo);ca=d(ki,"torch.nn.Module"),ki.forEach(t),ua=d(qn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qn.forEach(t),pa=p(Ee),L=a(Ee,"DIV",{class:!0});var Ae=r(L);w(to.$$.fragment,Ae),ha=p(Ae),X=a(Ae,"P",{});var Yo=r(X);ga=d(Yo,"The "),Wo=a(Yo,"A",{href:!0});var Bi=r(Wo);ma=d(Bi,"BigBirdPegasusModel"),Bi.forEach(t),fa=d(Yo," forward method, overrides the "),$t=a(Yo,"CODE",{});var Ti=r($t);_a=d(Ti,"__call__"),Ti.forEach(t),ba=d(Yo," special method."),Yo.forEach(t),va=p(Ae),w(_e.$$.fragment,Ae),ya=p(Ae),w(be.$$.fragment,Ae),Ae.forEach(t),Ee.forEach(t),ln=p(o),ee=a(o,"H2",{class:!0});var zn=r(ee);ve=a(zn,"A",{id:!0,class:!0,href:!0});var Pi=r(ve);qt=a(Pi,"SPAN",{});var $i=r(qt);w(no.$$.fragment,$i),$i.forEach(t),Pi.forEach(t),wa=p(zn),zt=a(zn,"SPAN",{});var qi=r(zt);ka=d(qi,"BigBirdPegasusForConditionalGeneration"),qi.forEach(t),zn.forEach(t),cn=p(o),O=a(o,"DIV",{class:!0});var je=r(O);w(so.$$.fragment,je),Ba=p(je),ao=a(je,"P",{});var xn=r(ao);Ta=d(xn,`The BigBirdPegasus Model with a language modeling head. Can be used for summarization.
This model inherits from `),Qo=a(xn,"A",{href:!0});var zi=r(Qo);Pa=d(zi,"PreTrainedModel"),zi.forEach(t),$a=d(xn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),xn.forEach(t),qa=p(je),ro=a(je,"P",{});var Fn=r(ro);za=d(Fn,"This model is also a PyTorch "),io=a(Fn,"A",{href:!0,rel:!0});var xi=r(io);xa=d(xi,"torch.nn.Module"),xi.forEach(t),Fa=d(Fn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fn.forEach(t),Ca=p(je),N=a(je,"DIV",{class:!0});var Se=r(N);w(lo.$$.fragment,Se),Ma=p(Se),oe=a(Se,"P",{});var Xo=r(oe);Ea=d(Xo,"The "),Ho=a(Xo,"A",{href:!0});var Fi=r(Ho);Aa=d(Fi,"BigBirdPegasusForConditionalGeneration"),Fi.forEach(t),ja=d(Xo," forward method, overrides the "),xt=a(Xo,"CODE",{});var Ci=r(xt);Sa=d(Ci,"__call__"),Ci.forEach(t),Oa=d(Xo," special method."),Xo.forEach(t),La=p(Se),w(ye.$$.fragment,Se),Na=p(Se),w(we.$$.fragment,Se),Se.forEach(t),je.forEach(t),un=p(o),te=a(o,"H2",{class:!0});var Cn=r(te);ke=a(Cn,"A",{id:!0,class:!0,href:!0});var Mi=r(ke);Ft=a(Mi,"SPAN",{});var Ei=r(Ft);w(co.$$.fragment,Ei),Ei.forEach(t),Mi.forEach(t),Ia=p(Cn),Ct=a(Cn,"SPAN",{});var Ai=r(Ct);Da=d(Ai,"BigBirdPegasusForSequenceClassification"),Ai.forEach(t),Cn.forEach(t),pn=p(o),F=a(o,"DIV",{class:!0});var Q=r(F);w(uo.$$.fragment,Q),Ga=p(Q),Mt=a(Q,"P",{});var ji=r(Mt);Wa=d(ji,`BigBirdPegasus model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),ji.forEach(t),Qa=p(Q),po=a(Q,"P",{});var Mn=r(po);Ha=d(Mn,"This model inherits from "),Ro=a(Mn,"A",{href:!0});var Si=r(Ro);Ra=d(Si,"PreTrainedModel"),Si.forEach(t),Ua=d(Mn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Mn.forEach(t),Va=p(Q),ho=a(Q,"P",{});var En=r(ho);Ja=d(En,"This model is also a PyTorch "),go=a(En,"A",{href:!0,rel:!0});var Oi=r(go);Za=d(Oi,"torch.nn.Module"),Oi.forEach(t),Ka=d(En,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),En.forEach(t),Ya=p(Q),E=a(Q,"DIV",{class:!0});var H=r(E);w(mo.$$.fragment,H),Xa=p(H),ne=a(H,"P",{});var et=r(ne);er=d(et,"The "),Uo=a(et,"A",{href:!0});var Li=r(Uo);or=d(Li,"BigBirdPegasusForSequenceClassification"),Li.forEach(t),tr=d(et," forward method, overrides the "),Et=a(et,"CODE",{});var Ni=r(Et);nr=d(Ni,"__call__"),Ni.forEach(t),sr=d(et," special method."),et.forEach(t),ar=p(H),w(Be.$$.fragment,H),rr=p(H),w(Te.$$.fragment,H),ir=p(H),w(Pe.$$.fragment,H),H.forEach(t),Q.forEach(t),hn=p(o),se=a(o,"H2",{class:!0});var An=r(se);$e=a(An,"A",{id:!0,class:!0,href:!0});var Ii=r($e);At=a(Ii,"SPAN",{});var Di=r(At);w(fo.$$.fragment,Di),Di.forEach(t),Ii.forEach(t),dr=p(An),jt=a(An,"SPAN",{});var Gi=r(jt);lr=d(Gi,"BigBirdPegasusForQuestionAnswering"),Gi.forEach(t),An.forEach(t),gn=p(o),C=a(o,"DIV",{class:!0});var R=r(C);w(_o.$$.fragment,R),cr=p(R),ae=a(R,"P",{});var ot=r(ae);ur=d(ot,`BigBirdPegasus 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 `),St=a(ot,"CODE",{});var Wi=r(St);pr=d(Wi,"span start logits"),Wi.forEach(t),hr=d(ot," and "),Ot=a(ot,"CODE",{});var Qi=r(Ot);gr=d(Qi,"span end logits"),Qi.forEach(t),mr=d(ot,")."),ot.forEach(t),fr=p(R),bo=a(R,"P",{});var jn=r(bo);_r=d(jn,"This model inherits from "),Vo=a(jn,"A",{href:!0});var Hi=r(Vo);br=d(Hi,"PreTrainedModel"),Hi.forEach(t),vr=d(jn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),jn.forEach(t),yr=p(R),vo=a(R,"P",{});var Sn=r(vo);wr=d(Sn,"This model is also a PyTorch "),yo=a(Sn,"A",{href:!0,rel:!0});var Ri=r(yo);kr=d(Ri,"torch.nn.Module"),Ri.forEach(t),Br=d(Sn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sn.forEach(t),Tr=p(R),I=a(R,"DIV",{class:!0});var Oe=r(I);w(wo.$$.fragment,Oe),Pr=p(Oe),re=a(Oe,"P",{});var tt=r(re);$r=d(tt,"The "),Jo=a(tt,"A",{href:!0});var Ui=r(Jo);qr=d(Ui,"BigBirdPegasusForQuestionAnswering"),Ui.forEach(t),zr=d(tt," forward method, overrides the "),Lt=a(tt,"CODE",{});var Vi=r(Lt);xr=d(Vi,"__call__"),Vi.forEach(t),Fr=d(tt," special method."),tt.forEach(t),Cr=p(Oe),w(qe.$$.fragment,Oe),Mr=p(Oe),w(ze.$$.fragment,Oe),Oe.forEach(t),R.forEach(t),mn=p(o),ie=a(o,"H2",{class:!0});var On=r(ie);xe=a(On,"A",{id:!0,class:!0,href:!0});var Ji=r(xe);Nt=a(Ji,"SPAN",{});var Zi=r(Nt);w(ko.$$.fragment,Zi),Zi.forEach(t),Ji.forEach(t),Er=p(On),It=a(On,"SPAN",{});var Ki=r(It);Ar=d(Ki,"BigBirdPegasusForCausalLM"),Ki.forEach(t),On.forEach(t),fn=p(o),de=a(o,"DIV",{class:!0});var Ln=r(de);w(Bo.$$.fragment,Ln),jr=p(Ln),Fe=a(Ln,"DIV",{class:!0});var Nn=r(Fe);w(To.$$.fragment,Nn),Sr=p(Nn),w(Ce.$$.fragment,Nn),Nn.forEach(t),Ln.forEach(t),this.h()},h(){c(l,"name","hf:doc:metadata"),c(l,"content",JSON.stringify(md)),c(h,"id","bigbirdpegasus"),c(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(h,"href","#bigbirdpegasus"),c(f,"class","relative group"),c(ce,"id","overview"),c(ce,"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"),c(ce,"href","#overview"),c(U,"class","relative group"),c(Ne,"href","https://arxiv.org/abs/2007.14062"),c(Ne,"rel","nofollow"),c(De,"href","https://huggingface.co/blog/big-bird"),c(De,"rel","nofollow"),c(He,"href","https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/tokenization_pegasus.py"),c(He,"rel","nofollow"),c(Re,"href","https://github.com/google-research/bigbird"),c(Re,"rel","nofollow"),c(he,"id","documentation-resources"),c(he,"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"),c(he,"href","#documentation-resources"),c(V,"class","relative group"),c(Ao,"href","../tasks/sequence_classification"),c(jo,"href","../tasks/question_answering"),c(So,"href","../tasks/language_modeling"),c(Oo,"href","../tasks/translation"),c(Lo,"href","../tasks/summarization"),c(ge,"id","transformers.BigBirdPegasusConfig"),c(ge,"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"),c(ge,"href","#transformers.BigBirdPegasusConfig"),c(J,"class","relative group"),c(No,"href","/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusModel"),c(Ze,"href","https://huggingface.co/google/bigbird-pegasus-large-arxiv"),c(Ze,"rel","nofollow"),c(Io,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Do,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(fe,"id","transformers.BigBirdPegasusModel"),c(fe,"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"),c(fe,"href","#transformers.BigBirdPegasusModel"),c(Y,"class","relative group"),c(Go,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(oo,"rel","nofollow"),c(Wo,"href","/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusModel"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ve,"id","transformers.BigBirdPegasusForConditionalGeneration"),c(ve,"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"),c(ve,"href","#transformers.BigBirdPegasusForConditionalGeneration"),c(ee,"class","relative group"),c(Qo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(io,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(io,"rel","nofollow"),c(Ho,"href","/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusForConditionalGeneration"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ke,"id","transformers.BigBirdPegasusForSequenceClassification"),c(ke,"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"),c(ke,"href","#transformers.BigBirdPegasusForSequenceClassification"),c(te,"class","relative group"),c(Ro,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(go,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(go,"rel","nofollow"),c(Uo,"href","/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusForSequenceClassification"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($e,"id","transformers.BigBirdPegasusForQuestionAnswering"),c($e,"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"),c($e,"href","#transformers.BigBirdPegasusForQuestionAnswering"),c(se,"class","relative group"),c(Vo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(yo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(yo,"rel","nofollow"),c(Jo,"href","/docs/transformers/v4.29.0/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusForQuestionAnswering"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(xe,"id","transformers.BigBirdPegasusForCausalLM"),c(xe,"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"),c(xe,"href","#transformers.BigBirdPegasusForCausalLM"),c(ie,"class","relative group"),c(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,m){e(document.head,l),_(o,v,m),_(o,f,m),e(f,h),e(h,b),k(n,b,null),e(f,g),e(f,z),e(z,Dn),_(o,Jt,m),_(o,U,m),e(U,ce),e(ce,nt),k(Le,nt,null),e(U,Gn),e(U,st),e(st,Wn),_(o,Zt,m),_(o,ue,m),e(ue,Qn),e(ue,Ne),e(Ne,Hn),e(ue,Rn),_(o,Kt,m),_(o,Co,m),e(Co,Un),_(o,Yt,m),_(o,Mo,m),e(Mo,at),e(at,Vn),_(o,Xt,m),_(o,Eo,m),e(Eo,Jn),_(o,en,m),_(o,q,m),e(q,Ie),e(Ie,Zn),e(Ie,De),e(De,Kn),e(Ie,Yn),e(q,Xn),e(q,A),e(A,es),e(A,rt),e(rt,os),e(A,ts),e(A,it),e(it,ns),e(A,ss),e(A,dt),e(dt,as),e(A,rs),e(A,lt),e(lt,is),e(A,ds),e(q,ls),e(q,ct),e(ct,cs),e(q,us),e(q,ut),e(ut,ps),e(q,hs),e(q,Ge),e(Ge,gs),e(Ge,pt),e(pt,ms),e(Ge,fs),e(q,_s),e(q,We),e(We,bs),e(We,ht),e(ht,vs),e(We,ys),e(q,ws),e(q,Qe),e(Qe,ks),e(Qe,He),e(He,Bs),e(Qe,Ts),e(q,Ps),e(q,gt),e(gt,$s),_(o,on,m),_(o,pe,m),e(pe,qs),e(pe,Re),e(Re,zs),e(pe,xs),_(o,tn,m),_(o,V,m),e(V,he),e(he,mt),k(Ue,mt,null),e(V,Fs),e(V,ft),e(ft,Cs),_(o,nn,m),_(o,M,m),e(M,_t),e(_t,Ao),e(Ao,Ms),e(M,Es),e(M,bt),e(bt,jo),e(jo,As),e(M,js),e(M,vt),e(vt,So),e(So,Ss),e(M,Os),e(M,yt),e(yt,Oo),e(Oo,Ls),e(M,Ns),e(M,wt),e(wt,Lo),e(Lo,Is),_(o,sn,m),_(o,J,m),e(J,ge),e(ge,kt),k(Ve,kt,null),e(J,Ds),e(J,Bt),e(Bt,Gs),_(o,an,m),_(o,j,m),k(Je,j,null),e(j,Ws),e(j,Z),e(Z,Qs),e(Z,No),e(No,Hs),e(Z,Rs),e(Z,Ze),e(Ze,Us),e(Z,Vs),e(j,Js),e(j,K),e(K,Zs),e(K,Io),e(Io,Ks),e(K,Ys),e(K,Do),e(Do,Xs),e(K,ea),e(j,oa),k(me,j,null),_(o,rn,m),_(o,Y,m),e(Y,fe),e(fe,Tt),k(Ke,Tt,null),e(Y,ta),e(Y,Pt),e(Pt,na),_(o,dn,m),_(o,S,m),k(Ye,S,null),e(S,sa),e(S,Xe),e(Xe,aa),e(Xe,Go),e(Go,ra),e(Xe,ia),e(S,da),e(S,eo),e(eo,la),e(eo,oo),e(oo,ca),e(eo,ua),e(S,pa),e(S,L),k(to,L,null),e(L,ha),e(L,X),e(X,ga),e(X,Wo),e(Wo,ma),e(X,fa),e(X,$t),e($t,_a),e(X,ba),e(L,va),k(_e,L,null),e(L,ya),k(be,L,null),_(o,ln,m),_(o,ee,m),e(ee,ve),e(ve,qt),k(no,qt,null),e(ee,wa),e(ee,zt),e(zt,ka),_(o,cn,m),_(o,O,m),k(so,O,null),e(O,Ba),e(O,ao),e(ao,Ta),e(ao,Qo),e(Qo,Pa),e(ao,$a),e(O,qa),e(O,ro),e(ro,za),e(ro,io),e(io,xa),e(ro,Fa),e(O,Ca),e(O,N),k(lo,N,null),e(N,Ma),e(N,oe),e(oe,Ea),e(oe,Ho),e(Ho,Aa),e(oe,ja),e(oe,xt),e(xt,Sa),e(oe,Oa),e(N,La),k(ye,N,null),e(N,Na),k(we,N,null),_(o,un,m),_(o,te,m),e(te,ke),e(ke,Ft),k(co,Ft,null),e(te,Ia),e(te,Ct),e(Ct,Da),_(o,pn,m),_(o,F,m),k(uo,F,null),e(F,Ga),e(F,Mt),e(Mt,Wa),e(F,Qa),e(F,po),e(po,Ha),e(po,Ro),e(Ro,Ra),e(po,Ua),e(F,Va),e(F,ho),e(ho,Ja),e(ho,go),e(go,Za),e(ho,Ka),e(F,Ya),e(F,E),k(mo,E,null),e(E,Xa),e(E,ne),e(ne,er),e(ne,Uo),e(Uo,or),e(ne,tr),e(ne,Et),e(Et,nr),e(ne,sr),e(E,ar),k(Be,E,null),e(E,rr),k(Te,E,null),e(E,ir),k(Pe,E,null),_(o,hn,m),_(o,se,m),e(se,$e),e($e,At),k(fo,At,null),e(se,dr),e(se,jt),e(jt,lr),_(o,gn,m),_(o,C,m),k(_o,C,null),e(C,cr),e(C,ae),e(ae,ur),e(ae,St),e(St,pr),e(ae,hr),e(ae,Ot),e(Ot,gr),e(ae,mr),e(C,fr),e(C,bo),e(bo,_r),e(bo,Vo),e(Vo,br),e(bo,vr),e(C,yr),e(C,vo),e(vo,wr),e(vo,yo),e(yo,kr),e(vo,Br),e(C,Tr),e(C,I),k(wo,I,null),e(I,Pr),e(I,re),e(re,$r),e(re,Jo),e(Jo,qr),e(re,zr),e(re,Lt),e(Lt,xr),e(re,Fr),e(I,Cr),k(qe,I,null),e(I,Mr),k(ze,I,null),_(o,mn,m),_(o,ie,m),e(ie,xe),e(xe,Nt),k(ko,Nt,null),e(ie,Er),e(ie,It),e(It,Ar),_(o,fn,m),_(o,de,m),k(Bo,de,null),e(de,jr),e(de,Fe),k(To,Fe,null),e(Fe,Sr),k(Ce,Fe,null),_n=!0},p(o,[m]){const Po={};m&2&&(Po.$$scope={dirty:m,ctx:o}),me.$set(Po);const Dt={};m&2&&(Dt.$$scope={dirty:m,ctx:o}),_e.$set(Dt);const Gt={};m&2&&(Gt.$$scope={dirty:m,ctx:o}),be.$set(Gt);const Wt={};m&2&&(Wt.$$scope={dirty:m,ctx:o}),ye.$set(Wt);const $o={};m&2&&($o.$$scope={dirty:m,ctx:o}),we.$set($o);const Qt={};m&2&&(Qt.$$scope={dirty:m,ctx:o}),Be.$set(Qt);const Ht={};m&2&&(Ht.$$scope={dirty:m,ctx:o}),Te.$set(Ht);const Rt={};m&2&&(Rt.$$scope={dirty:m,ctx:o}),Pe.$set(Rt);const qo={};m&2&&(qo.$$scope={dirty:m,ctx:o}),qe.$set(qo);const Ut={};m&2&&(Ut.$$scope={dirty:m,ctx:o}),ze.$set(Ut);const Vt={};m&2&&(Vt.$$scope={dirty:m,ctx:o}),Ce.$set(Vt)},i(o){_n||(B(n.$$.fragment,o),B(Le.$$.fragment,o),B(Ue.$$.fragment,o),B(Ve.$$.fragment,o),B(Je.$$.fragment,o),B(me.$$.fragment,o),B(Ke.$$.fragment,o),B(Ye.$$.fragment,o),B(to.$$.fragment,o),B(_e.$$.fragment,o),B(be.$$.fragment,o),B(no.$$.fragment,o),B(so.$$.fragment,o),B(lo.$$.fragment,o),B(ye.$$.fragment,o),B(we.$$.fragment,o),B(co.$$.fragment,o),B(uo.$$.fragment,o),B(mo.$$.fragment,o),B(Be.$$.fragment,o),B(Te.$$.fragment,o),B(Pe.$$.fragment,o),B(fo.$$.fragment,o),B(_o.$$.fragment,o),B(wo.$$.fragment,o),B(qe.$$.fragment,o),B(ze.$$.fragment,o),B(ko.$$.fragment,o),B(Bo.$$.fragment,o),B(To.$$.fragment,o),B(Ce.$$.fragment,o),_n=!0)},o(o){T(n.$$.fragment,o),T(Le.$$.fragment,o),T(Ue.$$.fragment,o),T(Ve.$$.fragment,o),T(Je.$$.fragment,o),T(me.$$.fragment,o),T(Ke.$$.fragment,o),T(Ye.$$.fragment,o),T(to.$$.fragment,o),T(_e.$$.fragment,o),T(be.$$.fragment,o),T(no.$$.fragment,o),T(so.$$.fragment,o),T(lo.$$.fragment,o),T(ye.$$.fragment,o),T(we.$$.fragment,o),T(co.$$.fragment,o),T(uo.$$.fragment,o),T(mo.$$.fragment,o),T(Be.$$.fragment,o),T(Te.$$.fragment,o),T(Pe.$$.fragment,o),T(fo.$$.fragment,o),T(_o.$$.fragment,o),T(wo.$$.fragment,o),T(qe.$$.fragment,o),T(ze.$$.fragment,o),T(ko.$$.fragment,o),T(Bo.$$.fragment,o),T(To.$$.fragment,o),T(Ce.$$.fragment,o),_n=!1},d(o){t(l),o&&t(v),o&&t(f),P(n),o&&t(Jt),o&&t(U),P(Le),o&&t(Zt),o&&t(ue),o&&t(Kt),o&&t(Co),o&&t(Yt),o&&t(Mo),o&&t(Xt),o&&t(Eo),o&&t(en),o&&t(q),o&&t(on),o&&t(pe),o&&t(tn),o&&t(V),P(Ue),o&&t(nn),o&&t(M),o&&t(sn),o&&t(J),P(Ve),o&&t(an),o&&t(j),P(Je),P(me),o&&t(rn),o&&t(Y),P(Ke),o&&t(dn),o&&t(S),P(Ye),P(to),P(_e),P(be),o&&t(ln),o&&t(ee),P(no),o&&t(cn),o&&t(O),P(so),P(lo),P(ye),P(we),o&&t(un),o&&t(te),P(co),o&&t(pn),o&&t(F),P(uo),P(mo),P(Be),P(Te),P(Pe),o&&t(hn),o&&t(se),P(fo),o&&t(gn),o&&t(C),P(_o),P(wo),P(qe),P(ze),o&&t(mn),o&&t(ie),P(ko),o&&t(fn),o&&t(de),P(Bo),P(To),P(Ce)}}}const md={local:"bigbirdpegasus",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.BigBirdPegasusConfig",title:"BigBirdPegasusConfig"},{local:"transformers.BigBirdPegasusModel",title:"BigBirdPegasusModel"},{local:"transformers.BigBirdPegasusForConditionalGeneration",title:"BigBirdPegasusForConditionalGeneration"},{local:"transformers.BigBirdPegasusForSequenceClassification",title:"BigBirdPegasusForSequenceClassification"},{local:"transformers.BigBirdPegasusForQuestionAnswering",title:"BigBirdPegasusForQuestionAnswering"},{local:"transformers.BigBirdPegasusForCausalLM",title:"BigBirdPegasusForCausalLM"}],title:"BigBirdPegasus"};function fd($){return td(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bd extends Yi{constructor(l){super();Xi(this,l,fd,gd,ed,{})}}export{Bd as default,md as metadata};
