import{S as Kd,i as Vd,s as Jd,e as s,k as l,w as m,t as r,M as Zd,c as n,d as t,m as c,a,x as f,h as i,b as d,F as e,g as p,y as _,q as b,o as v,B as k}from"../../chunks/vendor-4833417e.js";import{T as Xs}from"../../chunks/Tip-fffd6df1.js";import{D as Q}from"../../chunks/Docstring-4f315ed9.js";import{C as Eo}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as W}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function Yd(D){let h,P,g,y,q;return{c(){h=s("p"),P=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),y=r("Module"),q=r(`
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(w){h=n(w,"P",{});var B=a(h);P=i(B,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(B,"CODE",{});var x=a(g);y=i(x,"Module"),x.forEach(t),q=i(B,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),B.forEach(t)},m(w,B){p(w,h,B),e(h,P),e(h,g),e(g,y),e(h,q)},d(w){w&&t(h)}}}function Xd(D){let h,P,g,y,q;return{c(){h=s("p"),P=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),y=r("Module"),q=r(`
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(w){h=n(w,"P",{});var B=a(h);P=i(B,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(B,"CODE",{});var x=a(g);y=i(x,"Module"),x.forEach(t),q=i(B,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),B.forEach(t)},m(w,B){p(w,h,B),e(h,P),e(h,g),e(g,y),e(h,q)},d(w){w&&t(h)}}}function el(D){let h,P,g,y,q;return{c(){h=s("p"),P=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),y=r("Module"),q=r(`
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(w){h=n(w,"P",{});var B=a(h);P=i(B,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(B,"CODE",{});var x=a(g);y=i(x,"Module"),x.forEach(t),q=i(B,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),B.forEach(t)},m(w,B){p(w,h,B),e(h,P),e(h,g),e(g,y),e(h,q)},d(w){w&&t(h)}}}function ol(D){let h,P,g,y,q;return{c(){h=s("p"),P=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),y=r("Module"),q=r(`
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(w){h=n(w,"P",{});var B=a(h);P=i(B,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(B,"CODE",{});var x=a(g);y=i(x,"Module"),x.forEach(t),q=i(B,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),B.forEach(t)},m(w,B){p(w,h,B),e(h,P),e(h,g),e(g,y),e(h,q)},d(w){w&&t(h)}}}function tl(D){let h,P,g,y,q,w,B,x,en,rs,Z,he,ot,Me,on,tt,tn,is,pe,sn,je,nn,an,ds,Mo,rn,ls,jo,st,dn,cs,So,ln,us,z,Se,cn,Ae,un,hn,pn,N,gn,nt,mn,fn,at,_n,bn,rt,vn,kn,it,wn,Bn,yn,dt,Tn,Pn,lt,qn,zn,Le,$n,ct,Fn,xn,Cn,Ne,En,ut,Mn,jn,Sn,Oe,An,Ie,Ln,Nn,hs,ge,On,De,In,Dn,ps,Y,me,ht,Qe,Qn,pt,Wn,gs,T,We,Gn,X,Un,Ao,Hn,Rn,Ge,Kn,Vn,Jn,ee,Zn,Lo,Yn,Xn,No,ea,oa,ta,gt,sa,na,Ue,aa,mt,ft,_t,bt,ra,ia,vt,kt,He,fe,_e,wt,Re,da,Bt,la,ca,yt,ua,ha,Tt,Pt,Ke,be,ve,qt,Ve,pa,zt,ga,ma,$t,fa,_a,Ft,xt,Ct,ke,we,Et,Je,ba,Mt,va,ms,oe,Be,jt,Ze,ka,St,wa,fs,O,Ye,Ba,Xe,ya,Oo,Ta,Pa,qa,eo,za,oo,$a,Fa,xa,M,to,Ca,te,Ea,Io,Ma,ja,At,Sa,Aa,La,ye,Na,Lt,Oa,Ia,so,_s,se,Te,Nt,no,Da,Ot,Qa,bs,I,ao,Wa,ro,Ga,Do,Ua,Ha,Ra,io,Ka,lo,Va,Ja,Za,j,co,Ya,ne,Xa,Qo,er,or,It,tr,sr,nr,Pe,ar,Dt,rr,ir,uo,vs,ae,qe,Qt,ho,dr,Wt,lr,ks,C,po,cr,Gt,ur,hr,go,pr,Wo,gr,mr,fr,mo,_r,fo,br,vr,kr,$,_o,wr,re,Br,Go,yr,Tr,Ut,Pr,qr,zr,ze,$r,Ht,Fr,xr,bo,Cr,Rt,Er,Mr,vo,ws,ie,$e,Kt,ko,jr,Vt,Sr,Bs,E,wo,Ar,de,Lr,Jt,Nr,Or,Zt,Ir,Dr,Qr,Bo,Wr,Uo,Gr,Ur,Hr,yo,Rr,To,Kr,Vr,Jr,S,Po,Zr,le,Yr,Ho,Xr,ei,Yt,oi,ti,si,Fe,ni,Xt,ai,ri,qo,ys,ce,xe,es,zo,ii,os,di,Ts,ue,$o,li,G,Fo,ci,ts,ui,hi,xo,Ps;return w=new W({}),Me=new W({}),Qe=new W({}),We=new Q({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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py#L31",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/pr_15839/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.
encoder_layerdrop &#x2014; (<code>float</code>, <em>optional</em>, defaults to 0.0):
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.
decoder_layerdrop &#x2014; (<code>float</code>, <em>optional</em>, defaults to 0.0):
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:"init_std"},{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"}]}}),Ue=new Eo({props:{code:"",highlighted:""}}),Re=new W({}),Ve=new W({}),Je=new W({}),Ze=new W({}),Ye=new Q({props:{name:"class transformers.BigBirdPegasusModel",anchor:"transformers.BigBirdPegasusModel",parameters:[{name:"config",val:": BigBirdPegasusConfig"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2333",parametersDescription:[{anchor:"transformers.BigBirdPegasusModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),to=new Q({props:{name:"forward",anchor:"transformers.BigBirdPegasusModel.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"decoder_input_ids",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"decoder_head_mask",val:" = None"},{name:"cross_attn_head_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"past_key_values",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2360",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/pr_15839/en/model_doc/pegasus#transformers.PegasusTokenizer">PegasusTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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_inputs</code> and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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 + 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 + 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/pr_15839/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new Xs({props:{$$slots:{default:[Yd]},$$scope:{ctx:D}}}),so=new Eo({props:{code:`from transformers import PegasusTokenizer, BigBirdPegasusModel
import torch

tokenizer = PegasusTokenizer.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> PegasusTokenizer, 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 = PegasusTokenizer.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`}}),no=new W({}),ao=new Q({props:{name:"class transformers.BigBirdPegasusForConditionalGeneration",anchor:"transformers.BigBirdPegasusForConditionalGeneration",parameters:[{name:"config",val:": BigBirdPegasusConfig"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2462",parametersDescription:[{anchor:"transformers.BigBirdPegasusForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),co=new Q({props:{name:"forward",anchor:"transformers.BigBirdPegasusForConditionalGeneration.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"decoder_input_ids",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"decoder_head_mask",val:" = None"},{name:"cross_attn_head_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"past_key_values",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2501",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/pr_15839/en/model_doc/pegasus#transformers.PegasusTokenizer">PegasusTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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_inputs</code> and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.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/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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 + 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 + 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/pr_15839/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pe=new Xs({props:{$$slots:{default:[Xd]},$$scope:{ctx:D}}}),uo=new Eo({props:{code:`from transformers import PegasusTokenizer, BigBirdPegasusForConditionalGeneration

model = BigBirdPegasusForConditionalGeneration.from_pretrained("google/bigbird-pegasus-large-arxiv")
tokenizer = PegasusTokenizer.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> PegasusTokenizer, 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 = PegasusTokenizer.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>`}}),ho=new W({}),po=new Q({props:{name:"class transformers.BigBirdPegasusForSequenceClassification",anchor:"transformers.BigBirdPegasusForSequenceClassification",parameters:[{name:"config",val:": BigBirdPegasusConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2632",parametersDescription:[{anchor:"transformers.BigBirdPegasusForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),_o=new Q({props:{name:"forward",anchor:"transformers.BigBirdPegasusForSequenceClassification.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"decoder_input_ids",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"decoder_head_mask",val:" = None"},{name:"cross_attn_head_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2645",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/pr_15839/en/model_doc/pegasus#transformers.PegasusTokenizer">PegasusTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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_inputs</code> and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.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/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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 + 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 + 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/pr_15839/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ze=new Xs({props:{$$slots:{default:[el]},$$scope:{ctx:D}}}),bo=new Eo({props:{code:`import torch
from transformers import PegasusTokenizer, BigBirdPegasusForSequenceClassification

torch.manual_seed(0)
tokenizer = PegasusTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")
model = BigBirdPegasusForSequenceClassification.from_pretrained("google/bigbird-pegasus-large-arxiv", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([1]).unsqueeze(0)  # Batch size 1
outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits
list(logits.shape)`,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> PegasusTokenizer, BigBirdPegasusForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = PegasusTokenizer.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>, num_labels=<span class="hljs-number">2</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>labels = torch.tensor([<span class="hljs-number">1</span>]).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>]`}}),vo=new Eo({props:{code:`import torch
from transformers import PegasusTokenizer, BigBirdPegasusForSequenceClassification

torch.manual_seed(0)
tokenizer = PegasusTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")
model = BigBirdPegasusForSequenceClassification.from_pretrained("google/bigbird-pegasus-large-arxiv", problem_type="multi_label_classification", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([[1, 1]], dtype=torch.float)  # need dtype=float for BCEWithLogitsLoss
outputs = model(**inputs, labels=labels)
loss = outputs.loss
list(logits.shape)`,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> PegasusTokenizer, BigBirdPegasusForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = PegasusTokenizer.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>, num_labels=<span class="hljs-number">2</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>labels = torch.tensor([[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>]], dtype=torch.<span class="hljs-built_in">float</span>)  <span class="hljs-comment"># need dtype=float for BCEWithLogitsLoss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>]`}}),ko=new W({}),wo=new Q({props:{name:"class transformers.BigBirdPegasusForQuestionAnswering",anchor:"transformers.BigBirdPegasusForQuestionAnswering",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2759",parametersDescription:[{anchor:"transformers.BigBirdPegasusForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Po=new Q({props:{name:"forward",anchor:"transformers.BigBirdPegasusForQuestionAnswering.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"decoder_input_ids",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"decoder_head_mask",val:" = None"},{name:"cross_attn_head_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"start_positions",val:" = None"},{name:"end_positions",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2771",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/pr_15839/en/model_doc/pegasus#transformers.PegasusTokenizer">PegasusTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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_inputs</code> and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.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/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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 + 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 + 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/pr_15839/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fe=new Xs({props:{$$slots:{default:[ol]},$$scope:{ctx:D}}}),qo=new Eo({props:{code:`from transformers import PegasusTokenizer, BigBirdPegasusForQuestionAnswering
import torch

torch.manual_seed(0)
tokenizer = PegasusTokenizer.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")
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])

outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
loss = outputs.loss
round(loss.item(), 2)

start_scores = outputs.start_logits
list(start_scores.shape)

end_scores = outputs.end_logits
list(end_scores.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PegasusTokenizer, BigBirdPegasusForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = PegasusTokenizer.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>start_positions = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>end_positions = torch.tensor([<span class="hljs-number">3</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">2.56</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(start_scores.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">12</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(end_scores.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">12</span>]`}}),zo=new W({}),$o=new Q({props:{name:"class transformers.BigBirdPegasusForCausalLM",anchor:"transformers.BigBirdPegasusForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2890"}}),Fo=new Q({props:{name:"forward",anchor:"transformers.BigBirdPegasusForCausalLM.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"cross_attn_head_mask",val:" = None"},{name:"past_key_values",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py#L2921",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/pr_15839/en/model_doc/pegasus#transformers.PegasusTokenizer">PegasusTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</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/pr_15839/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xo=new Eo({props:{code:`from transformers import PegasusTokenizer, BigBirdPegasusForCausalLM

tokenizer = PegasusTokenizer.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> PegasusTokenizer, BigBirdPegasusForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = PegasusTokenizer.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(){h=s("meta"),P=l(),g=s("h1"),y=s("a"),q=s("span"),m(w.$$.fragment),B=l(),x=s("span"),en=r("BigBirdPegasus"),rs=l(),Z=s("h2"),he=s("a"),ot=s("span"),m(Me.$$.fragment),on=l(),tt=s("span"),tn=r("Overview"),is=l(),pe=s("p"),sn=r("The BigBird model was proposed in "),je=s("a"),nn=r("Big Bird: Transformers for Longer Sequences"),an=r(` 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.`),ds=l(),Mo=s("p"),rn=r("The abstract from the paper is the following:"),ls=l(),jo=s("p"),st=s("em"),dn=r(`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.`),cs=l(),So=s("p"),ln=r("Tips:"),us=l(),z=s("ul"),Se=s("li"),cn=r("For an in-detail explanation on how BigBird\u2019s attention works, see "),Ae=s("a"),un=r("this blog post"),hn=r("."),pn=l(),N=s("li"),gn=r("BigBird comes with 2 implementations: "),nt=s("strong"),mn=r("original_full"),fn=r(" & "),at=s("strong"),_n=r("block_sparse"),bn=r(`. For the sequence length < 1024, using
`),rt=s("strong"),vn=r("original_full"),kn=r(" is advised as there is no benefit in using "),it=s("strong"),wn=r("block_sparse"),Bn=r(" attention."),yn=l(),dt=s("li"),Tn=r("The code currently uses window size of 3 blocks and 2 global blocks."),Pn=l(),lt=s("li"),qn=r("Sequence length must be divisible by block size."),zn=l(),Le=s("li"),$n=r("Current implementation supports only "),ct=s("strong"),Fn=r("ITC"),xn=r("."),Cn=l(),Ne=s("li"),En=r("Current implementation doesn\u2019t support "),ut=s("strong"),Mn=r("num_random_blocks = 0"),jn=r("."),Sn=l(),Oe=s("li"),An=r("BigBirdPegasus uses the "),Ie=s("a"),Ln=r("PegasusTokenizer"),Nn=r("."),hs=l(),ge=s("p"),On=r("The original code can be found "),De=s("a"),In=r("here"),Dn=r("."),ps=l(),Y=s("h2"),me=s("a"),ht=s("span"),m(Qe.$$.fragment),Qn=l(),pt=s("span"),Wn=r("BigBirdPegasusConfig"),gs=l(),T=s("div"),m(We.$$.fragment),Gn=l(),X=s("p"),Un=r("This is the configuration class to store the configuration of a "),Ao=s("a"),Hn=r("BigBirdPegasusModel"),Rn=r(`. 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
`),Ge=s("a"),Kn=r("google/bigbird-pegasus-large-arxiv"),Vn=r(" architecture."),Jn=l(),ee=s("p"),Zn=r("Configuration objects inherit from "),Lo=s("a"),Yn=r("PretrainedConfig"),Xn=r(` and can be used to control the model outputs. Read the
documentation from `),No=s("a"),ea=r("PretrainedConfig"),oa=r(" for more information."),ta=l(),gt=s("p"),sa=r("Example:"),na=l(),m(Ue.$$.fragment),aa=l(),mt=s("blockquote"),ft=s("blockquote"),_t=s("blockquote"),bt=s("p"),ra=r("from transformers import BigBirdPegasusModel, BigBirdPegasusConfig"),ia=l(),vt=s("blockquote"),kt=s("blockquote"),He=s("blockquote"),fe=s("h1"),_e=s("a"),wt=s("span"),m(Re.$$.fragment),da=l(),Bt=s("span"),la=r("Initializing a BigBirdPegasus bigbird-pegasus-base style configuration >>> configuration ="),ca=l(),yt=s("p"),ua=r("BigBirdPegasusConfig()"),ha=l(),Tt=s("blockquote"),Pt=s("blockquote"),Ke=s("blockquote"),be=s("h1"),ve=s("a"),qt=s("span"),m(Ve.$$.fragment),pa=l(),zt=s("span"),ga=r("Initializing a model from the bigbird-pegasus-base style configuration >>> model ="),ma=l(),$t=s("p"),fa=r("BigBirdPegasusModel(configuration)"),_a=l(),Ft=s("blockquote"),xt=s("blockquote"),Ct=s("blockquote"),ke=s("h1"),we=s("a"),Et=s("span"),m(Je.$$.fragment),ba=l(),Mt=s("span"),va=r("Accessing the model configuration >>> configuration = model.config"),ms=l(),oe=s("h2"),Be=s("a"),jt=s("span"),m(Ze.$$.fragment),ka=l(),St=s("span"),wa=r("BigBirdPegasusModel"),fs=l(),O=s("div"),m(Ye.$$.fragment),Ba=l(),Xe=s("p"),ya=r(`The bare BigBirdPegasus Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Oo=s("a"),Ta=r("PreTrainedModel"),Pa=r(`. 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=l(),eo=s("p"),za=r("This model is also a PyTorch "),oo=s("a"),$a=r("torch.nn.Module"),Fa=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xa=l(),M=s("div"),m(to.$$.fragment),Ca=l(),te=s("p"),Ea=r("The "),Io=s("a"),Ma=r("BigBirdPegasusModel"),ja=r(" forward method, overrides the "),At=s("code"),Sa=r("__call__"),Aa=r(" special method."),La=l(),m(ye.$$.fragment),Na=l(),Lt=s("p"),Oa=r("Example:"),Ia=l(),m(so.$$.fragment),_s=l(),se=s("h2"),Te=s("a"),Nt=s("span"),m(no.$$.fragment),Da=l(),Ot=s("span"),Qa=r("BigBirdPegasusForConditionalGeneration"),bs=l(),I=s("div"),m(ao.$$.fragment),Wa=l(),ro=s("p"),Ga=r(`The BigBirdPegasus Model with a language modeling head. Can be used for summarization.
This model inherits from `),Do=s("a"),Ua=r("PreTrainedModel"),Ha=r(`. 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.)`),Ra=l(),io=s("p"),Ka=r("This model is also a PyTorch "),lo=s("a"),Va=r("torch.nn.Module"),Ja=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Za=l(),j=s("div"),m(co.$$.fragment),Ya=l(),ne=s("p"),Xa=r("The "),Qo=s("a"),er=r("BigBirdPegasusForConditionalGeneration"),or=r(" forward method, overrides the "),It=s("code"),tr=r("__call__"),sr=r(" special method."),nr=l(),m(Pe.$$.fragment),ar=l(),Dt=s("p"),rr=r("Summarization example:"),ir=l(),m(uo.$$.fragment),vs=l(),ae=s("h2"),qe=s("a"),Qt=s("span"),m(ho.$$.fragment),dr=l(),Wt=s("span"),lr=r("BigBirdPegasusForSequenceClassification"),ks=l(),C=s("div"),m(po.$$.fragment),cr=l(),Gt=s("p"),ur=r(`BigBirdPegasus model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),hr=l(),go=s("p"),pr=r("This model inherits from "),Wo=s("a"),gr=r("PreTrainedModel"),mr=r(`. 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.)`),fr=l(),mo=s("p"),_r=r("This model is also a PyTorch "),fo=s("a"),br=r("torch.nn.Module"),vr=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),kr=l(),$=s("div"),m(_o.$$.fragment),wr=l(),re=s("p"),Br=r("The "),Go=s("a"),yr=r("BigBirdPegasusForSequenceClassification"),Tr=r(" forward method, overrides the "),Ut=s("code"),Pr=r("__call__"),qr=r(" special method."),zr=l(),m(ze.$$.fragment),$r=l(),Ht=s("p"),Fr=r("Example of single-label classification:"),xr=l(),m(bo.$$.fragment),Cr=l(),Rt=s("p"),Er=r("Example of multi-label classification:"),Mr=l(),m(vo.$$.fragment),ws=l(),ie=s("h2"),$e=s("a"),Kt=s("span"),m(ko.$$.fragment),jr=l(),Vt=s("span"),Sr=r("BigBirdPegasusForQuestionAnswering"),Bs=l(),E=s("div"),m(wo.$$.fragment),Ar=l(),de=s("p"),Lr=r(`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 `),Jt=s("code"),Nr=r("span start logits"),Or=r(" and "),Zt=s("code"),Ir=r("span end logits"),Dr=r(")."),Qr=l(),Bo=s("p"),Wr=r("This model inherits from "),Uo=s("a"),Gr=r("PreTrainedModel"),Ur=r(`. 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.)`),Hr=l(),yo=s("p"),Rr=r("This model is also a PyTorch "),To=s("a"),Kr=r("torch.nn.Module"),Vr=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jr=l(),S=s("div"),m(Po.$$.fragment),Zr=l(),le=s("p"),Yr=r("The "),Ho=s("a"),Xr=r("BigBirdPegasusForQuestionAnswering"),ei=r(" forward method, overrides the "),Yt=s("code"),oi=r("__call__"),ti=r(" special method."),si=l(),m(Fe.$$.fragment),ni=l(),Xt=s("p"),ai=r("Example:"),ri=l(),m(qo.$$.fragment),ys=l(),ce=s("h2"),xe=s("a"),es=s("span"),m(zo.$$.fragment),ii=l(),os=s("span"),di=r("BigBirdPegasusForCausalLM"),Ts=l(),ue=s("div"),m($o.$$.fragment),li=l(),G=s("div"),m(Fo.$$.fragment),ci=l(),ts=s("p"),ui=r("Example:"),hi=l(),m(xo.$$.fragment),this.h()},l(o){const u=Zd('[data-svelte="svelte-1phssyn"]',document.head);h=n(u,"META",{name:!0,content:!0}),u.forEach(t),P=c(o),g=n(o,"H1",{class:!0});var Co=a(g);y=n(Co,"A",{id:!0,class:!0,href:!0});var ss=a(y);q=n(ss,"SPAN",{});var ns=a(q);f(w.$$.fragment,ns),ns.forEach(t),ss.forEach(t),B=c(Co),x=n(Co,"SPAN",{});var as=a(x);en=i(as,"BigBirdPegasus"),as.forEach(t),Co.forEach(t),rs=c(o),Z=n(o,"H2",{class:!0});var qs=a(Z);he=n(qs,"A",{id:!0,class:!0,href:!0});var pi=a(he);ot=n(pi,"SPAN",{});var gi=a(ot);f(Me.$$.fragment,gi),gi.forEach(t),pi.forEach(t),on=c(qs),tt=n(qs,"SPAN",{});var mi=a(tt);tn=i(mi,"Overview"),mi.forEach(t),qs.forEach(t),is=c(o),pe=n(o,"P",{});var zs=a(pe);sn=i(zs,"The BigBird model was proposed in "),je=n(zs,"A",{href:!0,rel:!0});var fi=a(je);nn=i(fi,"Big Bird: Transformers for Longer Sequences"),fi.forEach(t),an=i(zs,` 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.`),zs.forEach(t),ds=c(o),Mo=n(o,"P",{});var _i=a(Mo);rn=i(_i,"The abstract from the paper is the following:"),_i.forEach(t),ls=c(o),jo=n(o,"P",{});var bi=a(jo);st=n(bi,"EM",{});var vi=a(st);dn=i(vi,`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.`),vi.forEach(t),bi.forEach(t),cs=c(o),So=n(o,"P",{});var ki=a(So);ln=i(ki,"Tips:"),ki.forEach(t),us=c(o),z=n(o,"UL",{});var A=a(z);Se=n(A,"LI",{});var $s=a(Se);cn=i($s,"For an in-detail explanation on how BigBird\u2019s attention works, see "),Ae=n($s,"A",{href:!0,rel:!0});var wi=a(Ae);un=i(wi,"this blog post"),wi.forEach(t),hn=i($s,"."),$s.forEach(t),pn=c(A),N=n(A,"LI",{});var U=a(N);gn=i(U,"BigBird comes with 2 implementations: "),nt=n(U,"STRONG",{});var Bi=a(nt);mn=i(Bi,"original_full"),Bi.forEach(t),fn=i(U," & "),at=n(U,"STRONG",{});var yi=a(at);_n=i(yi,"block_sparse"),yi.forEach(t),bn=i(U,`. For the sequence length < 1024, using
`),rt=n(U,"STRONG",{});var Ti=a(rt);vn=i(Ti,"original_full"),Ti.forEach(t),kn=i(U," is advised as there is no benefit in using "),it=n(U,"STRONG",{});var Pi=a(it);wn=i(Pi,"block_sparse"),Pi.forEach(t),Bn=i(U," attention."),U.forEach(t),yn=c(A),dt=n(A,"LI",{});var qi=a(dt);Tn=i(qi,"The code currently uses window size of 3 blocks and 2 global blocks."),qi.forEach(t),Pn=c(A),lt=n(A,"LI",{});var zi=a(lt);qn=i(zi,"Sequence length must be divisible by block size."),zi.forEach(t),zn=c(A),Le=n(A,"LI",{});var Fs=a(Le);$n=i(Fs,"Current implementation supports only "),ct=n(Fs,"STRONG",{});var $i=a(ct);Fn=i($i,"ITC"),$i.forEach(t),xn=i(Fs,"."),Fs.forEach(t),Cn=c(A),Ne=n(A,"LI",{});var xs=a(Ne);En=i(xs,"Current implementation doesn\u2019t support "),ut=n(xs,"STRONG",{});var Fi=a(ut);Mn=i(Fi,"num_random_blocks = 0"),Fi.forEach(t),jn=i(xs,"."),xs.forEach(t),Sn=c(A),Oe=n(A,"LI",{});var Cs=a(Oe);An=i(Cs,"BigBirdPegasus uses the "),Ie=n(Cs,"A",{href:!0,rel:!0});var xi=a(Ie);Ln=i(xi,"PegasusTokenizer"),xi.forEach(t),Nn=i(Cs,"."),Cs.forEach(t),A.forEach(t),hs=c(o),ge=n(o,"P",{});var Es=a(ge);On=i(Es,"The original code can be found "),De=n(Es,"A",{href:!0,rel:!0});var Ci=a(De);In=i(Ci,"here"),Ci.forEach(t),Dn=i(Es,"."),Es.forEach(t),ps=c(o),Y=n(o,"H2",{class:!0});var Ms=a(Y);me=n(Ms,"A",{id:!0,class:!0,href:!0});var Ei=a(me);ht=n(Ei,"SPAN",{});var Mi=a(ht);f(Qe.$$.fragment,Mi),Mi.forEach(t),Ei.forEach(t),Qn=c(Ms),pt=n(Ms,"SPAN",{});var ji=a(pt);Wn=i(ji,"BigBirdPegasusConfig"),ji.forEach(t),Ms.forEach(t),gs=c(o),T=n(o,"DIV",{class:!0});var F=a(T);f(We.$$.fragment,F),Gn=c(F),X=n(F,"P",{});var Ro=a(X);Un=i(Ro,"This is the configuration class to store the configuration of a "),Ao=n(Ro,"A",{href:!0});var Si=a(Ao);Hn=i(Si,"BigBirdPegasusModel"),Si.forEach(t),Rn=i(Ro,`. 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
`),Ge=n(Ro,"A",{href:!0,rel:!0});var Ai=a(Ge);Kn=i(Ai,"google/bigbird-pegasus-large-arxiv"),Ai.forEach(t),Vn=i(Ro," architecture."),Ro.forEach(t),Jn=c(F),ee=n(F,"P",{});var Ko=a(ee);Zn=i(Ko,"Configuration objects inherit from "),Lo=n(Ko,"A",{href:!0});var Li=a(Lo);Yn=i(Li,"PretrainedConfig"),Li.forEach(t),Xn=i(Ko,` and can be used to control the model outputs. Read the
documentation from `),No=n(Ko,"A",{href:!0});var Ni=a(No);ea=i(Ni,"PretrainedConfig"),Ni.forEach(t),oa=i(Ko," for more information."),Ko.forEach(t),ta=c(F),gt=n(F,"P",{});var Oi=a(gt);sa=i(Oi,"Example:"),Oi.forEach(t),na=c(F),f(Ue.$$.fragment,F),aa=c(F),mt=n(F,"BLOCKQUOTE",{});var Ii=a(mt);ft=n(Ii,"BLOCKQUOTE",{});var Di=a(ft);_t=n(Di,"BLOCKQUOTE",{});var Qi=a(_t);bt=n(Qi,"P",{});var Wi=a(bt);ra=i(Wi,"from transformers import BigBirdPegasusModel, BigBirdPegasusConfig"),Wi.forEach(t),Qi.forEach(t),Di.forEach(t),Ii.forEach(t),ia=c(F),vt=n(F,"BLOCKQUOTE",{});var Gi=a(vt);kt=n(Gi,"BLOCKQUOTE",{});var Ui=a(kt);He=n(Ui,"BLOCKQUOTE",{});var js=a(He);fe=n(js,"H1",{class:!0});var Ss=a(fe);_e=n(Ss,"A",{id:!0,class:!0,href:!0});var Hi=a(_e);wt=n(Hi,"SPAN",{});var Ri=a(wt);f(Re.$$.fragment,Ri),Ri.forEach(t),Hi.forEach(t),da=c(Ss),Bt=n(Ss,"SPAN",{});var Ki=a(Bt);la=i(Ki,"Initializing a BigBirdPegasus bigbird-pegasus-base style configuration >>> configuration ="),Ki.forEach(t),Ss.forEach(t),ca=c(js),yt=n(js,"P",{});var Vi=a(yt);ua=i(Vi,"BigBirdPegasusConfig()"),Vi.forEach(t),js.forEach(t),Ui.forEach(t),Gi.forEach(t),ha=c(F),Tt=n(F,"BLOCKQUOTE",{});var Ji=a(Tt);Pt=n(Ji,"BLOCKQUOTE",{});var Zi=a(Pt);Ke=n(Zi,"BLOCKQUOTE",{});var As=a(Ke);be=n(As,"H1",{class:!0});var Ls=a(be);ve=n(Ls,"A",{id:!0,class:!0,href:!0});var Yi=a(ve);qt=n(Yi,"SPAN",{});var Xi=a(qt);f(Ve.$$.fragment,Xi),Xi.forEach(t),Yi.forEach(t),pa=c(Ls),zt=n(Ls,"SPAN",{});var ed=a(zt);ga=i(ed,"Initializing a model from the bigbird-pegasus-base style configuration >>> model ="),ed.forEach(t),Ls.forEach(t),ma=c(As),$t=n(As,"P",{});var od=a($t);fa=i(od,"BigBirdPegasusModel(configuration)"),od.forEach(t),As.forEach(t),Zi.forEach(t),Ji.forEach(t),_a=c(F),Ft=n(F,"BLOCKQUOTE",{});var td=a(Ft);xt=n(td,"BLOCKQUOTE",{});var sd=a(xt);Ct=n(sd,"BLOCKQUOTE",{});var nd=a(Ct);ke=n(nd,"H1",{class:!0});var Ns=a(ke);we=n(Ns,"A",{id:!0,class:!0,href:!0});var ad=a(we);Et=n(ad,"SPAN",{});var rd=a(Et);f(Je.$$.fragment,rd),rd.forEach(t),ad.forEach(t),ba=c(Ns),Mt=n(Ns,"SPAN",{});var id=a(Mt);va=i(id,"Accessing the model configuration >>> configuration = model.config"),id.forEach(t),Ns.forEach(t),nd.forEach(t),sd.forEach(t),td.forEach(t),F.forEach(t),ms=c(o),oe=n(o,"H2",{class:!0});var Os=a(oe);Be=n(Os,"A",{id:!0,class:!0,href:!0});var dd=a(Be);jt=n(dd,"SPAN",{});var ld=a(jt);f(Ze.$$.fragment,ld),ld.forEach(t),dd.forEach(t),ka=c(Os),St=n(Os,"SPAN",{});var cd=a(St);wa=i(cd,"BigBirdPegasusModel"),cd.forEach(t),Os.forEach(t),fs=c(o),O=n(o,"DIV",{class:!0});var Ce=a(O);f(Ye.$$.fragment,Ce),Ba=c(Ce),Xe=n(Ce,"P",{});var Is=a(Xe);ya=i(Is,`The bare BigBirdPegasus Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Oo=n(Is,"A",{href:!0});var ud=a(Oo);Ta=i(ud,"PreTrainedModel"),ud.forEach(t),Pa=i(Is,`. 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.)`),Is.forEach(t),qa=c(Ce),eo=n(Ce,"P",{});var Ds=a(eo);za=i(Ds,"This model is also a PyTorch "),oo=n(Ds,"A",{href:!0,rel:!0});var hd=a(oo);$a=i(hd,"torch.nn.Module"),hd.forEach(t),Fa=i(Ds,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ds.forEach(t),xa=c(Ce),M=n(Ce,"DIV",{class:!0});var H=a(M);f(to.$$.fragment,H),Ca=c(H),te=n(H,"P",{});var Vo=a(te);Ea=i(Vo,"The "),Io=n(Vo,"A",{href:!0});var pd=a(Io);Ma=i(pd,"BigBirdPegasusModel"),pd.forEach(t),ja=i(Vo," forward method, overrides the "),At=n(Vo,"CODE",{});var gd=a(At);Sa=i(gd,"__call__"),gd.forEach(t),Aa=i(Vo," special method."),Vo.forEach(t),La=c(H),f(ye.$$.fragment,H),Na=c(H),Lt=n(H,"P",{});var md=a(Lt);Oa=i(md,"Example:"),md.forEach(t),Ia=c(H),f(so.$$.fragment,H),H.forEach(t),Ce.forEach(t),_s=c(o),se=n(o,"H2",{class:!0});var Qs=a(se);Te=n(Qs,"A",{id:!0,class:!0,href:!0});var fd=a(Te);Nt=n(fd,"SPAN",{});var _d=a(Nt);f(no.$$.fragment,_d),_d.forEach(t),fd.forEach(t),Da=c(Qs),Ot=n(Qs,"SPAN",{});var bd=a(Ot);Qa=i(bd,"BigBirdPegasusForConditionalGeneration"),bd.forEach(t),Qs.forEach(t),bs=c(o),I=n(o,"DIV",{class:!0});var Ee=a(I);f(ao.$$.fragment,Ee),Wa=c(Ee),ro=n(Ee,"P",{});var Ws=a(ro);Ga=i(Ws,`The BigBirdPegasus Model with a language modeling head. Can be used for summarization.
This model inherits from `),Do=n(Ws,"A",{href:!0});var vd=a(Do);Ua=i(vd,"PreTrainedModel"),vd.forEach(t),Ha=i(Ws,`. 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.)`),Ws.forEach(t),Ra=c(Ee),io=n(Ee,"P",{});var Gs=a(io);Ka=i(Gs,"This model is also a PyTorch "),lo=n(Gs,"A",{href:!0,rel:!0});var kd=a(lo);Va=i(kd,"torch.nn.Module"),kd.forEach(t),Ja=i(Gs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gs.forEach(t),Za=c(Ee),j=n(Ee,"DIV",{class:!0});var R=a(j);f(co.$$.fragment,R),Ya=c(R),ne=n(R,"P",{});var Jo=a(ne);Xa=i(Jo,"The "),Qo=n(Jo,"A",{href:!0});var wd=a(Qo);er=i(wd,"BigBirdPegasusForConditionalGeneration"),wd.forEach(t),or=i(Jo," forward method, overrides the "),It=n(Jo,"CODE",{});var Bd=a(It);tr=i(Bd,"__call__"),Bd.forEach(t),sr=i(Jo," special method."),Jo.forEach(t),nr=c(R),f(Pe.$$.fragment,R),ar=c(R),Dt=n(R,"P",{});var yd=a(Dt);rr=i(yd,"Summarization example:"),yd.forEach(t),ir=c(R),f(uo.$$.fragment,R),R.forEach(t),Ee.forEach(t),vs=c(o),ae=n(o,"H2",{class:!0});var Us=a(ae);qe=n(Us,"A",{id:!0,class:!0,href:!0});var Td=a(qe);Qt=n(Td,"SPAN",{});var Pd=a(Qt);f(ho.$$.fragment,Pd),Pd.forEach(t),Td.forEach(t),dr=c(Us),Wt=n(Us,"SPAN",{});var qd=a(Wt);lr=i(qd,"BigBirdPegasusForSequenceClassification"),qd.forEach(t),Us.forEach(t),ks=c(o),C=n(o,"DIV",{class:!0});var K=a(C);f(po.$$.fragment,K),cr=c(K),Gt=n(K,"P",{});var zd=a(Gt);ur=i(zd,`BigBirdPegasus model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),zd.forEach(t),hr=c(K),go=n(K,"P",{});var Hs=a(go);pr=i(Hs,"This model inherits from "),Wo=n(Hs,"A",{href:!0});var $d=a(Wo);gr=i($d,"PreTrainedModel"),$d.forEach(t),mr=i(Hs,`. 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.)`),Hs.forEach(t),fr=c(K),mo=n(K,"P",{});var Rs=a(mo);_r=i(Rs,"This model is also a PyTorch "),fo=n(Rs,"A",{href:!0,rel:!0});var Fd=a(fo);br=i(Fd,"torch.nn.Module"),Fd.forEach(t),vr=i(Rs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rs.forEach(t),kr=c(K),$=n(K,"DIV",{class:!0});var L=a($);f(_o.$$.fragment,L),wr=c(L),re=n(L,"P",{});var Zo=a(re);Br=i(Zo,"The "),Go=n(Zo,"A",{href:!0});var xd=a(Go);yr=i(xd,"BigBirdPegasusForSequenceClassification"),xd.forEach(t),Tr=i(Zo," forward method, overrides the "),Ut=n(Zo,"CODE",{});var Cd=a(Ut);Pr=i(Cd,"__call__"),Cd.forEach(t),qr=i(Zo," special method."),Zo.forEach(t),zr=c(L),f(ze.$$.fragment,L),$r=c(L),Ht=n(L,"P",{});var Ed=a(Ht);Fr=i(Ed,"Example of single-label classification:"),Ed.forEach(t),xr=c(L),f(bo.$$.fragment,L),Cr=c(L),Rt=n(L,"P",{});var Md=a(Rt);Er=i(Md,"Example of multi-label classification:"),Md.forEach(t),Mr=c(L),f(vo.$$.fragment,L),L.forEach(t),K.forEach(t),ws=c(o),ie=n(o,"H2",{class:!0});var Ks=a(ie);$e=n(Ks,"A",{id:!0,class:!0,href:!0});var jd=a($e);Kt=n(jd,"SPAN",{});var Sd=a(Kt);f(ko.$$.fragment,Sd),Sd.forEach(t),jd.forEach(t),jr=c(Ks),Vt=n(Ks,"SPAN",{});var Ad=a(Vt);Sr=i(Ad,"BigBirdPegasusForQuestionAnswering"),Ad.forEach(t),Ks.forEach(t),Bs=c(o),E=n(o,"DIV",{class:!0});var V=a(E);f(wo.$$.fragment,V),Ar=c(V),de=n(V,"P",{});var Yo=a(de);Lr=i(Yo,`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 `),Jt=n(Yo,"CODE",{});var Ld=a(Jt);Nr=i(Ld,"span start logits"),Ld.forEach(t),Or=i(Yo," and "),Zt=n(Yo,"CODE",{});var Nd=a(Zt);Ir=i(Nd,"span end logits"),Nd.forEach(t),Dr=i(Yo,")."),Yo.forEach(t),Qr=c(V),Bo=n(V,"P",{});var Vs=a(Bo);Wr=i(Vs,"This model inherits from "),Uo=n(Vs,"A",{href:!0});var Od=a(Uo);Gr=i(Od,"PreTrainedModel"),Od.forEach(t),Ur=i(Vs,`. 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.)`),Vs.forEach(t),Hr=c(V),yo=n(V,"P",{});var Js=a(yo);Rr=i(Js,"This model is also a PyTorch "),To=n(Js,"A",{href:!0,rel:!0});var Id=a(To);Kr=i(Id,"torch.nn.Module"),Id.forEach(t),Vr=i(Js,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Js.forEach(t),Jr=c(V),S=n(V,"DIV",{class:!0});var J=a(S);f(Po.$$.fragment,J),Zr=c(J),le=n(J,"P",{});var Xo=a(le);Yr=i(Xo,"The "),Ho=n(Xo,"A",{href:!0});var Dd=a(Ho);Xr=i(Dd,"BigBirdPegasusForQuestionAnswering"),Dd.forEach(t),ei=i(Xo," forward method, overrides the "),Yt=n(Xo,"CODE",{});var Qd=a(Yt);oi=i(Qd,"__call__"),Qd.forEach(t),ti=i(Xo," special method."),Xo.forEach(t),si=c(J),f(Fe.$$.fragment,J),ni=c(J),Xt=n(J,"P",{});var Wd=a(Xt);ai=i(Wd,"Example:"),Wd.forEach(t),ri=c(J),f(qo.$$.fragment,J),J.forEach(t),V.forEach(t),ys=c(o),ce=n(o,"H2",{class:!0});var Zs=a(ce);xe=n(Zs,"A",{id:!0,class:!0,href:!0});var Gd=a(xe);es=n(Gd,"SPAN",{});var Ud=a(es);f(zo.$$.fragment,Ud),Ud.forEach(t),Gd.forEach(t),ii=c(Zs),os=n(Zs,"SPAN",{});var Hd=a(os);di=i(Hd,"BigBirdPegasusForCausalLM"),Hd.forEach(t),Zs.forEach(t),Ts=c(o),ue=n(o,"DIV",{class:!0});var Ys=a(ue);f($o.$$.fragment,Ys),li=c(Ys),G=n(Ys,"DIV",{class:!0});var et=a(G);f(Fo.$$.fragment,et),ci=c(et),ts=n(et,"P",{});var Rd=a(ts);ui=i(Rd,"Example:"),Rd.forEach(t),hi=c(et),f(xo.$$.fragment,et),et.forEach(t),Ys.forEach(t),this.h()},h(){d(h,"name","hf:doc:metadata"),d(h,"content",JSON.stringify(sl)),d(y,"id","bigbirdpegasus"),d(y,"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"),d(y,"href","#bigbirdpegasus"),d(g,"class","relative group"),d(he,"id","overview"),d(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"),d(he,"href","#overview"),d(Z,"class","relative group"),d(je,"href","https://arxiv.org/abs/2007.14062"),d(je,"rel","nofollow"),d(Ae,"href","https://huggingface.co/blog/big-bird"),d(Ae,"rel","nofollow"),d(Ie,"href","https://github.com/huggingface/transformers/blob/master/src/transformers/models/pegasus/tokenization_pegasus.py"),d(Ie,"rel","nofollow"),d(De,"href","https://github.com/google-research/bigbird"),d(De,"rel","nofollow"),d(me,"id","transformers.BigBirdPegasusConfig"),d(me,"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"),d(me,"href","#transformers.BigBirdPegasusConfig"),d(Y,"class","relative group"),d(Ao,"href","/docs/transformers/pr_15839/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusModel"),d(Ge,"href","https://huggingface.co/google/bigbird-pegasus-large-arxiv"),d(Ge,"rel","nofollow"),d(Lo,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),d(No,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),d(_e,"id","initializing-a-bigbirdpegasus-bigbird-pegasus-base-style-configuration->>>-configuration-="),d(_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"),d(_e,"href","#initializing-a-bigbirdpegasus-bigbird-pegasus-base-style-configuration->>>-configuration-="),d(fe,"class","relative group"),d(ve,"id","initializing-a-model-from-the-bigbird-pegasus-base-style-configuration->>>-model-="),d(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"),d(ve,"href","#initializing-a-model-from-the-bigbird-pegasus-base-style-configuration->>>-model-="),d(be,"class","relative group"),d(we,"id","accessing-the-model-configuration->>>-configuration-=-model.config"),d(we,"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"),d(we,"href","#accessing-the-model-configuration->>>-configuration-=-model.config"),d(ke,"class","relative group"),d(T,"class","docstring"),d(Be,"id","transformers.BigBirdPegasusModel"),d(Be,"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"),d(Be,"href","#transformers.BigBirdPegasusModel"),d(oe,"class","relative group"),d(Oo,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(oo,"rel","nofollow"),d(Io,"href","/docs/transformers/pr_15839/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusModel"),d(M,"class","docstring"),d(O,"class","docstring"),d(Te,"id","transformers.BigBirdPegasusForConditionalGeneration"),d(Te,"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"),d(Te,"href","#transformers.BigBirdPegasusForConditionalGeneration"),d(se,"class","relative group"),d(Do,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(lo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(lo,"rel","nofollow"),d(Qo,"href","/docs/transformers/pr_15839/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusForConditionalGeneration"),d(j,"class","docstring"),d(I,"class","docstring"),d(qe,"id","transformers.BigBirdPegasusForSequenceClassification"),d(qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(qe,"href","#transformers.BigBirdPegasusForSequenceClassification"),d(ae,"class","relative group"),d(Wo,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(fo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(fo,"rel","nofollow"),d(Go,"href","/docs/transformers/pr_15839/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusForSequenceClassification"),d($,"class","docstring"),d(C,"class","docstring"),d($e,"id","transformers.BigBirdPegasusForQuestionAnswering"),d($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"),d($e,"href","#transformers.BigBirdPegasusForQuestionAnswering"),d(ie,"class","relative group"),d(Uo,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),d(To,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(To,"rel","nofollow"),d(Ho,"href","/docs/transformers/pr_15839/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusForQuestionAnswering"),d(S,"class","docstring"),d(E,"class","docstring"),d(xe,"id","transformers.BigBirdPegasusForCausalLM"),d(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"),d(xe,"href","#transformers.BigBirdPegasusForCausalLM"),d(ce,"class","relative group"),d(G,"class","docstring"),d(ue,"class","docstring")},m(o,u){e(document.head,h),p(o,P,u),p(o,g,u),e(g,y),e(y,q),_(w,q,null),e(g,B),e(g,x),e(x,en),p(o,rs,u),p(o,Z,u),e(Z,he),e(he,ot),_(Me,ot,null),e(Z,on),e(Z,tt),e(tt,tn),p(o,is,u),p(o,pe,u),e(pe,sn),e(pe,je),e(je,nn),e(pe,an),p(o,ds,u),p(o,Mo,u),e(Mo,rn),p(o,ls,u),p(o,jo,u),e(jo,st),e(st,dn),p(o,cs,u),p(o,So,u),e(So,ln),p(o,us,u),p(o,z,u),e(z,Se),e(Se,cn),e(Se,Ae),e(Ae,un),e(Se,hn),e(z,pn),e(z,N),e(N,gn),e(N,nt),e(nt,mn),e(N,fn),e(N,at),e(at,_n),e(N,bn),e(N,rt),e(rt,vn),e(N,kn),e(N,it),e(it,wn),e(N,Bn),e(z,yn),e(z,dt),e(dt,Tn),e(z,Pn),e(z,lt),e(lt,qn),e(z,zn),e(z,Le),e(Le,$n),e(Le,ct),e(ct,Fn),e(Le,xn),e(z,Cn),e(z,Ne),e(Ne,En),e(Ne,ut),e(ut,Mn),e(Ne,jn),e(z,Sn),e(z,Oe),e(Oe,An),e(Oe,Ie),e(Ie,Ln),e(Oe,Nn),p(o,hs,u),p(o,ge,u),e(ge,On),e(ge,De),e(De,In),e(ge,Dn),p(o,ps,u),p(o,Y,u),e(Y,me),e(me,ht),_(Qe,ht,null),e(Y,Qn),e(Y,pt),e(pt,Wn),p(o,gs,u),p(o,T,u),_(We,T,null),e(T,Gn),e(T,X),e(X,Un),e(X,Ao),e(Ao,Hn),e(X,Rn),e(X,Ge),e(Ge,Kn),e(X,Vn),e(T,Jn),e(T,ee),e(ee,Zn),e(ee,Lo),e(Lo,Yn),e(ee,Xn),e(ee,No),e(No,ea),e(ee,oa),e(T,ta),e(T,gt),e(gt,sa),e(T,na),_(Ue,T,null),e(T,aa),e(T,mt),e(mt,ft),e(ft,_t),e(_t,bt),e(bt,ra),e(T,ia),e(T,vt),e(vt,kt),e(kt,He),e(He,fe),e(fe,_e),e(_e,wt),_(Re,wt,null),e(fe,da),e(fe,Bt),e(Bt,la),e(He,ca),e(He,yt),e(yt,ua),e(T,ha),e(T,Tt),e(Tt,Pt),e(Pt,Ke),e(Ke,be),e(be,ve),e(ve,qt),_(Ve,qt,null),e(be,pa),e(be,zt),e(zt,ga),e(Ke,ma),e(Ke,$t),e($t,fa),e(T,_a),e(T,Ft),e(Ft,xt),e(xt,Ct),e(Ct,ke),e(ke,we),e(we,Et),_(Je,Et,null),e(ke,ba),e(ke,Mt),e(Mt,va),p(o,ms,u),p(o,oe,u),e(oe,Be),e(Be,jt),_(Ze,jt,null),e(oe,ka),e(oe,St),e(St,wa),p(o,fs,u),p(o,O,u),_(Ye,O,null),e(O,Ba),e(O,Xe),e(Xe,ya),e(Xe,Oo),e(Oo,Ta),e(Xe,Pa),e(O,qa),e(O,eo),e(eo,za),e(eo,oo),e(oo,$a),e(eo,Fa),e(O,xa),e(O,M),_(to,M,null),e(M,Ca),e(M,te),e(te,Ea),e(te,Io),e(Io,Ma),e(te,ja),e(te,At),e(At,Sa),e(te,Aa),e(M,La),_(ye,M,null),e(M,Na),e(M,Lt),e(Lt,Oa),e(M,Ia),_(so,M,null),p(o,_s,u),p(o,se,u),e(se,Te),e(Te,Nt),_(no,Nt,null),e(se,Da),e(se,Ot),e(Ot,Qa),p(o,bs,u),p(o,I,u),_(ao,I,null),e(I,Wa),e(I,ro),e(ro,Ga),e(ro,Do),e(Do,Ua),e(ro,Ha),e(I,Ra),e(I,io),e(io,Ka),e(io,lo),e(lo,Va),e(io,Ja),e(I,Za),e(I,j),_(co,j,null),e(j,Ya),e(j,ne),e(ne,Xa),e(ne,Qo),e(Qo,er),e(ne,or),e(ne,It),e(It,tr),e(ne,sr),e(j,nr),_(Pe,j,null),e(j,ar),e(j,Dt),e(Dt,rr),e(j,ir),_(uo,j,null),p(o,vs,u),p(o,ae,u),e(ae,qe),e(qe,Qt),_(ho,Qt,null),e(ae,dr),e(ae,Wt),e(Wt,lr),p(o,ks,u),p(o,C,u),_(po,C,null),e(C,cr),e(C,Gt),e(Gt,ur),e(C,hr),e(C,go),e(go,pr),e(go,Wo),e(Wo,gr),e(go,mr),e(C,fr),e(C,mo),e(mo,_r),e(mo,fo),e(fo,br),e(mo,vr),e(C,kr),e(C,$),_(_o,$,null),e($,wr),e($,re),e(re,Br),e(re,Go),e(Go,yr),e(re,Tr),e(re,Ut),e(Ut,Pr),e(re,qr),e($,zr),_(ze,$,null),e($,$r),e($,Ht),e(Ht,Fr),e($,xr),_(bo,$,null),e($,Cr),e($,Rt),e(Rt,Er),e($,Mr),_(vo,$,null),p(o,ws,u),p(o,ie,u),e(ie,$e),e($e,Kt),_(ko,Kt,null),e(ie,jr),e(ie,Vt),e(Vt,Sr),p(o,Bs,u),p(o,E,u),_(wo,E,null),e(E,Ar),e(E,de),e(de,Lr),e(de,Jt),e(Jt,Nr),e(de,Or),e(de,Zt),e(Zt,Ir),e(de,Dr),e(E,Qr),e(E,Bo),e(Bo,Wr),e(Bo,Uo),e(Uo,Gr),e(Bo,Ur),e(E,Hr),e(E,yo),e(yo,Rr),e(yo,To),e(To,Kr),e(yo,Vr),e(E,Jr),e(E,S),_(Po,S,null),e(S,Zr),e(S,le),e(le,Yr),e(le,Ho),e(Ho,Xr),e(le,ei),e(le,Yt),e(Yt,oi),e(le,ti),e(S,si),_(Fe,S,null),e(S,ni),e(S,Xt),e(Xt,ai),e(S,ri),_(qo,S,null),p(o,ys,u),p(o,ce,u),e(ce,xe),e(xe,es),_(zo,es,null),e(ce,ii),e(ce,os),e(os,di),p(o,Ts,u),p(o,ue,u),_($o,ue,null),e(ue,li),e(ue,G),_(Fo,G,null),e(G,ci),e(G,ts),e(ts,ui),e(G,hi),_(xo,G,null),Ps=!0},p(o,[u]){const Co={};u&2&&(Co.$$scope={dirty:u,ctx:o}),ye.$set(Co);const ss={};u&2&&(ss.$$scope={dirty:u,ctx:o}),Pe.$set(ss);const ns={};u&2&&(ns.$$scope={dirty:u,ctx:o}),ze.$set(ns);const as={};u&2&&(as.$$scope={dirty:u,ctx:o}),Fe.$set(as)},i(o){Ps||(b(w.$$.fragment,o),b(Me.$$.fragment,o),b(Qe.$$.fragment,o),b(We.$$.fragment,o),b(Ue.$$.fragment,o),b(Re.$$.fragment,o),b(Ve.$$.fragment,o),b(Je.$$.fragment,o),b(Ze.$$.fragment,o),b(Ye.$$.fragment,o),b(to.$$.fragment,o),b(ye.$$.fragment,o),b(so.$$.fragment,o),b(no.$$.fragment,o),b(ao.$$.fragment,o),b(co.$$.fragment,o),b(Pe.$$.fragment,o),b(uo.$$.fragment,o),b(ho.$$.fragment,o),b(po.$$.fragment,o),b(_o.$$.fragment,o),b(ze.$$.fragment,o),b(bo.$$.fragment,o),b(vo.$$.fragment,o),b(ko.$$.fragment,o),b(wo.$$.fragment,o),b(Po.$$.fragment,o),b(Fe.$$.fragment,o),b(qo.$$.fragment,o),b(zo.$$.fragment,o),b($o.$$.fragment,o),b(Fo.$$.fragment,o),b(xo.$$.fragment,o),Ps=!0)},o(o){v(w.$$.fragment,o),v(Me.$$.fragment,o),v(Qe.$$.fragment,o),v(We.$$.fragment,o),v(Ue.$$.fragment,o),v(Re.$$.fragment,o),v(Ve.$$.fragment,o),v(Je.$$.fragment,o),v(Ze.$$.fragment,o),v(Ye.$$.fragment,o),v(to.$$.fragment,o),v(ye.$$.fragment,o),v(so.$$.fragment,o),v(no.$$.fragment,o),v(ao.$$.fragment,o),v(co.$$.fragment,o),v(Pe.$$.fragment,o),v(uo.$$.fragment,o),v(ho.$$.fragment,o),v(po.$$.fragment,o),v(_o.$$.fragment,o),v(ze.$$.fragment,o),v(bo.$$.fragment,o),v(vo.$$.fragment,o),v(ko.$$.fragment,o),v(wo.$$.fragment,o),v(Po.$$.fragment,o),v(Fe.$$.fragment,o),v(qo.$$.fragment,o),v(zo.$$.fragment,o),v($o.$$.fragment,o),v(Fo.$$.fragment,o),v(xo.$$.fragment,o),Ps=!1},d(o){t(h),o&&t(P),o&&t(g),k(w),o&&t(rs),o&&t(Z),k(Me),o&&t(is),o&&t(pe),o&&t(ds),o&&t(Mo),o&&t(ls),o&&t(jo),o&&t(cs),o&&t(So),o&&t(us),o&&t(z),o&&t(hs),o&&t(ge),o&&t(ps),o&&t(Y),k(Qe),o&&t(gs),o&&t(T),k(We),k(Ue),k(Re),k(Ve),k(Je),o&&t(ms),o&&t(oe),k(Ze),o&&t(fs),o&&t(O),k(Ye),k(to),k(ye),k(so),o&&t(_s),o&&t(se),k(no),o&&t(bs),o&&t(I),k(ao),k(co),k(Pe),k(uo),o&&t(vs),o&&t(ae),k(ho),o&&t(ks),o&&t(C),k(po),k(_o),k(ze),k(bo),k(vo),o&&t(ws),o&&t(ie),k(ko),o&&t(Bs),o&&t(E),k(wo),k(Po),k(Fe),k(qo),o&&t(ys),o&&t(ce),k(zo),o&&t(Ts),o&&t(ue),k($o),k(Fo),k(xo)}}}const sl={local:"bigbirdpegasus",sections:[{local:"overview",title:"Overview"},{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 nl(D,h,P){let{fw:g}=h;return D.$$set=y=>{"fw"in y&&P(0,g=y.fw)},[g]}class ul extends Kd{constructor(h){super();Vd(this,h,nl,tl,Jd,{fw:0})}}export{ul as default,sl as metadata};
