import{S as es,i as os,s as ts,e as n,k as p,w as y,t as i,M as ns,c as s,d as t,m as h,a,x as k,h as d,b as l,G as o,g as f,y as T,q as w,o as P,B as $,v as ss,L as cn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Qn}from"../../chunks/Tip-hf-doc-builder.js";import{D as fo}from"../../chunks/Docstring-hf-doc-builder.js";import{C as un}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as He}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ln}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function as(X){let c,b,_,m,v;return m=new un({props:{code:`from transformers import PegasusXConfig, PegasusXModel

# Initializing a PEGASUS google/pegasus-x-large style configuration
configuration = PegasusXConfig()

# Initializing a model (with random weights) from the google/pegasus-x-large style configuration
model = PegasusXModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PegasusXConfig, PegasusXModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a PEGASUS google/pegasus-x-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = PegasusXConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the google/pegasus-x-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PegasusXModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){c=n("p"),b=i("Example:"),_=p(),y(m.$$.fragment)},l(r){c=s(r,"P",{});var g=a(c);b=d(g,"Example:"),g.forEach(t),_=h(r),k(m.$$.fragment,r)},m(r,g){f(r,c,g),o(c,b),f(r,_,g),T(m,r,g),v=!0},p:cn,i(r){v||(w(m.$$.fragment,r),v=!0)},o(r){P(m.$$.fragment,r),v=!1},d(r){r&&t(c),r&&t(_),$(m,r)}}}function rs(X){let c,b,_,m,v;return{c(){c=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=s(r,"P",{});var g=a(c);b=d(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var C=a(_);m=d(C,"Module"),C.forEach(t),v=d(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(r,g){f(r,c,g),o(c,b),o(c,_),o(_,m),o(c,v)},d(r){r&&t(c)}}}function is(X){let c,b,_,m,v;return m=new un({props:{code:`from transformers import AutoTokenizer, PegasusModel

tokenizer = AutoTokenizer.from_pretrained("google/pegasus-x-large")
model = PegasusModel.from_pretrained("google/pegasus-x-large")

inputs = tokenizer("Studies have been shown that owning a dog is good for you", return_tensors="pt")
decoder_inputs = tokenizer("Studies show that", return_tensors="pt")
outputs = model(input_ids=inputs.input_ids, decoder_input_ids=decoder_inputs.input_ids)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, PegasusModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Studies have been shown that owning a dog is good for you&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_inputs = tokenizer(<span class="hljs-string">&quot;Studies show that&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=inputs.input_ids, decoder_input_ids=decoder_inputs.input_ids)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">4</span>, <span class="hljs-number">1024</span>]`}}),{c(){c=n("p"),b=i("Example:"),_=p(),y(m.$$.fragment)},l(r){c=s(r,"P",{});var g=a(c);b=d(g,"Example:"),g.forEach(t),_=h(r),k(m.$$.fragment,r)},m(r,g){f(r,c,g),o(c,b),f(r,_,g),T(m,r,g),v=!0},p:cn,i(r){v||(w(m.$$.fragment,r),v=!0)},o(r){P(m.$$.fragment,r),v=!1},d(r){r&&t(c),r&&t(_),$(m,r)}}}function ds(X){let c,b,_,m,v;return{c(){c=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=s(r,"P",{});var g=a(c);b=d(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var C=a(_);m=d(C,"Module"),C.forEach(t),v=d(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(r,g){f(r,c,g),o(c,b),o(c,_),o(_,m),o(c,v)},d(r){r&&t(c)}}}function ls(X){let c,b,_,m,v;return m=new un({props:{code:`from transformers import AutoTokenizer, PegasusXForConditionalGeneration

model = PegasusXForConditionalGeneration.from_pretrained("google/pegasus-x-base")
tokenizer = AutoTokenizer.from_pretrained("google/pegasus-x-large")

ARTICLE_TO_SUMMARIZE = (
    "PG&E stated it scheduled the blackouts in response to forecasts for high winds "
    "amid dry conditions. The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were "
    "scheduled to be affected by the shutoffs which were expected to last through at least midday tomorrow."
)
inputs = tokenizer(ARTICLE_TO_SUMMARIZE, max_length=1024, return_tensors="pt")

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = (
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;PG&amp;E stated it scheduled the blackouts in response to forecasts for high winds &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;amid dry conditions. The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;scheduled to be affected by the shutoffs which were expected to last through at least midday tomorrow.&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">1024</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</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>])
<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">&quot;California&#x27;s largest electricity provider has turned off power to hundreds of thousands of customers.&quot;</span>`}}),{c(){c=n("p"),b=i("Summarization example:"),_=p(),y(m.$$.fragment)},l(r){c=s(r,"P",{});var g=a(c);b=d(g,"Summarization example:"),g.forEach(t),_=h(r),k(m.$$.fragment,r)},m(r,g){f(r,c,g),o(c,b),f(r,_,g),T(m,r,g),v=!0},p:cn,i(r){v||(w(m.$$.fragment,r),v=!0)},o(r){P(m.$$.fragment,r),v=!1},d(r){r&&t(c),r&&t(_),$(m,r)}}}function cs(X){let c,b,_,m,v,r,g,C,Lo,mo,M,D,Ve,re,Do,Ze,Wo,go,W,Bo,ie,Ro,Ho,_o,xe,Vo,vo,Ee,Zo,bo,Xe,Je,Jo,yo,Se,Ko,ko,qe,Ke,Yo,To,A,Qo,Ce,et,ot,de,tt,nt,wo,F,B,Ye,le,st,Qe,at,Po,R,eo,Ae,rt,it,oo,Me,dt,$o,G,H,to,ce,lt,no,ct,zo,z,ue,ut,j,pt,Fe,ht,ft,pe,mt,gt,_t,I,vt,Ge,bt,yt,je,kt,Tt,wt,V,xo,O,Z,so,he,Pt,ao,$t,Eo,x,fe,zt,me,xt,Ie,Et,Xt,St,ge,qt,_e,Ct,At,Mt,S,ve,Ft,U,Gt,Oe,jt,It,ro,Ot,Ut,Nt,J,Lt,K,Xo,N,Y,io,be,Dt,lo,Wt,So,E,ye,Bt,ke,Rt,Ue,Ht,Vt,Zt,Te,Jt,we,Kt,Yt,Qt,q,Pe,en,L,on,Ne,tn,nn,co,sn,an,rn,Q,dn,ee,qo;return r=new He({}),re=new He({}),le=new He({}),ce=new He({}),ue=new fo({props:{name:"class transformers.PegasusXConfig",anchor:"transformers.PegasusXConfig",parameters:[{name:"vocab_size",val:" = 96103"},{name:"max_position_embeddings",val:" = 16384"},{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'"},{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:" = 0"},{name:"scale_embedding",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"forced_eos_token_id",val:" = 1"},{name:"num_global_tokens",val:" = 32"},{name:"block_size",val:" = 512"},{name:"stagger_local_blocks",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PegasusXConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 96103) &#x2014;
Vocabulary size of the PEGASUS-X model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/pegasus_x#transformers.PegasusXModel">PegasusXModel</a>.`,name:"vocab_size"},{anchor:"transformers.PegasusXConfig.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.PegasusXConfig.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.PegasusXConfig.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.PegasusXConfig.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.PegasusXConfig.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.PegasusXConfig.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.PegasusXConfig.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.PegasusXConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.PegasusXConfig.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.PegasusXConfig.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.PegasusXConfig.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.PegasusXConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 16384) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.PegasusXConfig.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.PegasusXConfig.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.PegasusXConfig.forced_eos_token_id",description:`<strong>forced_eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Usually set to
<code>eos_token_id</code>.`,name:"forced_eos_token_id"},{anchor:"transformers.PegasusXConfig.num_global_tokens",description:`<strong>num_global_tokens</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Number of global tokens to use for the encoder`,name:"num_global_tokens"},{anchor:"transformers.PegasusXConfig.block_size",description:`<strong>block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Block size for encoder local attention. Sequence length should be an exact multiple of block size.
block_size must be a multiple of 2 if stagger_local_block is True`,name:"block_size"},{anchor:"transformers.PegasusXConfig.stagger_local_block",description:`<strong>stagger_local_block</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to stagger every other local attention by half a block`,name:"stagger_local_block"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/pegasus_x/configuration_pegasus_x.py#L30"}}),V=new ln({props:{anchor:"transformers.PegasusXConfig.example",$$slots:{default:[as]},$$scope:{ctx:X}}}),he=new He({}),fe=new fo({props:{name:"class transformers.PegasusXModel",anchor:"transformers.PegasusXModel",parameters:[{name:"config",val:": PegasusXConfig"}],parametersDescription:[{anchor:"transformers.PegasusXModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/pegasus_x#transformers.PegasusXConfig">PegasusXConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/pegasus_x/modeling_pegasus_x.py#L1383"}}),ve=new fo({props:{name:"forward",anchor:"transformers.PegasusXModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.PegasusXModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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.PegasusXModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation.`,name:"inputs_embeds"},{anchor:"transformers.PegasusXModel.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.PegasusXModel.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>PEGASUS-X uses the <code>pad_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.PegasusXModel.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.`,name:"decoder_attention_mask"},{anchor:"transformers.PegasusXModel.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.PegasusXModel.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.PegasusXModel.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.PegasusXModel.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.PegasusXModel.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.PegasusXModel.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.PegasusXModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/pegasus_x/modeling_pegasus_x.py#L1435",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/pegasus_x#transformers.PegasusXConfig"
>PegasusXConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),J=new Qn({props:{$$slots:{default:[rs]},$$scope:{ctx:X}}}),K=new ln({props:{anchor:"transformers.PegasusXModel.forward.example",$$slots:{default:[is]},$$scope:{ctx:X}}}),be=new He({}),ye=new fo({props:{name:"class transformers.PegasusXForConditionalGeneration",anchor:"transformers.PegasusXForConditionalGeneration",parameters:[{name:"config",val:": PegasusXConfig"}],parametersDescription:[{anchor:"transformers.PegasusXForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/pegasus_x#transformers.PegasusXConfig">PegasusXConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/pegasus_x/modeling_pegasus_x.py#L1526"}}),Pe=new fo({props:{name:"forward",anchor:"transformers.PegasusXForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.PegasusXForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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.PegasusXForConditionalGeneration.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation.`,name:"inputs_embeds"},{anchor:"transformers.PegasusXForConditionalGeneration.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.PegasusXForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>PEGASUS-X uses the <code>pad_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.PegasusXForConditionalGeneration.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.`,name:"decoder_attention_mask"},{anchor:"transformers.PegasusXForConditionalGeneration.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.PegasusXForConditionalGeneration.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.PegasusXForConditionalGeneration.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.PegasusXForConditionalGeneration.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.PegasusXForConditionalGeneration.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.PegasusXForConditionalGeneration.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.PegasusXForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.PegasusXForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/pegasus_x/modeling_pegasus_x.py#L1584",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/pegasus_x#transformers.PegasusXConfig"
>PegasusXConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Q=new Qn({props:{$$slots:{default:[ds]},$$scope:{ctx:X}}}),ee=new ln({props:{anchor:"transformers.PegasusXForConditionalGeneration.forward.example",$$slots:{default:[ls]},$$scope:{ctx:X}}}),{c(){c=n("meta"),b=p(),_=n("h1"),m=n("a"),v=n("span"),y(r.$$.fragment),g=p(),C=n("span"),Lo=i("PEGASUS-X"),mo=p(),M=n("h2"),D=n("a"),Ve=n("span"),y(re.$$.fragment),Do=p(),Ze=n("span"),Wo=i("Overview"),go=p(),W=n("p"),Bo=i("The PEGASUS-X model was proposed in "),ie=n("a"),Ro=i("Investigating Efficiently Extending Transformers for Long Input Summarization"),Ho=i("  by Jason Phang, Yao Zhao and Peter J. Liu."),_o=p(),xe=n("p"),Vo=i("PEGASUS-X (PEGASUS eXtended) extends the PEGASUS models for long input summarization through additional long input pretraining and using staggered block-local attention with global tokens in the encoder."),vo=p(),Ee=n("p"),Zo=i("The abstract from the paper is the following:"),bo=p(),Xe=n("p"),Je=n("em"),Jo=i("While large pretrained Transformer models have proven highly capable at tackling natural language tasks, handling long sequence inputs continues to be a significant challenge. One such task is long input summarization, where inputs are longer than the maximum input context of most pretrained models. Through an extensive set of experiments, we investigate what model architectural changes and pretraining paradigms can most efficiently adapt a pretrained Transformer for long input summarization. We find that a staggered, block-local Transformer with global encoder tokens strikes a good balance of performance and efficiency, and that an additional pretraining phase on long sequences meaningfully improves downstream summarization performance. Based on our findings, we introduce PEGASUS-X, an extension of the PEGASUS model with additional long input pretraining to handle inputs of up to 16K tokens. PEGASUS-X achieves strong performance on long input summarization tasks comparable with much larger models while adding few additional parameters and not requiring model parallelism to train."),yo=p(),Se=n("p"),Ko=i("Tips:"),ko=p(),qe=n("ul"),Ke=n("li"),Yo=i("PEGASUS-X uses the same tokenizer as PEGASUS."),To=p(),A=n("p"),Qo=i("This model was contributed by "),Ce=n("a"),et=i("zphang"),ot=i(". The original code can be found "),de=n("a"),tt=i("here"),nt=i("."),wo=p(),F=n("h2"),B=n("a"),Ye=n("span"),y(le.$$.fragment),st=p(),Qe=n("span"),at=i("Documentation resources"),Po=p(),R=n("ul"),eo=n("li"),Ae=n("a"),rt=i("Translation task guide"),it=p(),oo=n("li"),Me=n("a"),dt=i("Summarization task guide"),$o=p(),G=n("h2"),H=n("a"),to=n("span"),y(ce.$$.fragment),lt=p(),no=n("span"),ct=i("PegasusXConfig"),zo=p(),z=n("div"),y(ue.$$.fragment),ut=p(),j=n("p"),pt=i("This is the configuration class to store the configuration of a "),Fe=n("a"),ht=i("PegasusXModel"),ft=i(`. It is used to instantiate a
PEGASUS-X 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 PEGASUS-X
`),pe=n("a"),mt=i("google/pegasus-x-large"),gt=i(" architecture."),_t=p(),I=n("p"),vt=i("Configuration objects inherit from "),Ge=n("a"),bt=i("PretrainedConfig"),yt=i(` and can be used to control the model outputs. Read the
documentation from `),je=n("a"),kt=i("PretrainedConfig"),Tt=i(" for more information."),wt=p(),y(V.$$.fragment),xo=p(),O=n("h2"),Z=n("a"),so=n("span"),y(he.$$.fragment),Pt=p(),ao=n("span"),$t=i("PegasusXModel"),Eo=p(),x=n("div"),y(fe.$$.fragment),zt=p(),me=n("p"),xt=i(`The bare PEGASUS-X Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ie=n("a"),Et=i("PreTrainedModel"),Xt=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),St=p(),ge=n("p"),qt=i("This model is also a PyTorch "),_e=n("a"),Ct=i("torch.nn.Module"),At=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mt=p(),S=n("div"),y(ve.$$.fragment),Ft=p(),U=n("p"),Gt=i("The "),Oe=n("a"),jt=i("PegasusXModel"),It=i(" forward method, overrides the "),ro=n("code"),Ot=i("__call__"),Ut=i(" special method."),Nt=p(),y(J.$$.fragment),Lt=p(),y(K.$$.fragment),Xo=p(),N=n("h2"),Y=n("a"),io=n("span"),y(be.$$.fragment),Dt=p(),lo=n("span"),Wt=i("PegasusXForConditionalGeneration"),So=p(),E=n("div"),y(ye.$$.fragment),Bt=p(),ke=n("p"),Rt=i(`The PEGASUS-X for conditional generation (e.g. summarization).
This model inherits from `),Ue=n("a"),Ht=i("PreTrainedModel"),Vt=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zt=p(),Te=n("p"),Jt=i("This model is also a PyTorch "),we=n("a"),Kt=i("torch.nn.Module"),Yt=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Qt=p(),q=n("div"),y(Pe.$$.fragment),en=p(),L=n("p"),on=i("The "),Ne=n("a"),tn=i("PegasusXForConditionalGeneration"),nn=i(" forward method, overrides the "),co=n("code"),sn=i("__call__"),an=i(" special method."),rn=p(),y(Q.$$.fragment),dn=p(),y(ee.$$.fragment),this.h()},l(e){const u=ns('[data-svelte="svelte-1phssyn"]',document.head);c=s(u,"META",{name:!0,content:!0}),u.forEach(t),b=h(e),_=s(e,"H1",{class:!0});var $e=a(_);m=s($e,"A",{id:!0,class:!0,href:!0});var uo=a(m);v=s(uo,"SPAN",{});var po=a(v);k(r.$$.fragment,po),po.forEach(t),uo.forEach(t),g=h($e),C=s($e,"SPAN",{});var ho=a(C);Lo=d(ho,"PEGASUS-X"),ho.forEach(t),$e.forEach(t),mo=h(e),M=s(e,"H2",{class:!0});var ze=a(M);D=s(ze,"A",{id:!0,class:!0,href:!0});var pn=a(D);Ve=s(pn,"SPAN",{});var hn=a(Ve);k(re.$$.fragment,hn),hn.forEach(t),pn.forEach(t),Do=h(ze),Ze=s(ze,"SPAN",{});var fn=a(Ze);Wo=d(fn,"Overview"),fn.forEach(t),ze.forEach(t),go=h(e),W=s(e,"P",{});var Co=a(W);Bo=d(Co,"The PEGASUS-X model was proposed in "),ie=s(Co,"A",{href:!0,rel:!0});var mn=a(ie);Ro=d(mn,"Investigating Efficiently Extending Transformers for Long Input Summarization"),mn.forEach(t),Ho=d(Co,"  by Jason Phang, Yao Zhao and Peter J. Liu."),Co.forEach(t),_o=h(e),xe=s(e,"P",{});var gn=a(xe);Vo=d(gn,"PEGASUS-X (PEGASUS eXtended) extends the PEGASUS models for long input summarization through additional long input pretraining and using staggered block-local attention with global tokens in the encoder."),gn.forEach(t),vo=h(e),Ee=s(e,"P",{});var _n=a(Ee);Zo=d(_n,"The abstract from the paper is the following:"),_n.forEach(t),bo=h(e),Xe=s(e,"P",{});var vn=a(Xe);Je=s(vn,"EM",{});var bn=a(Je);Jo=d(bn,"While large pretrained Transformer models have proven highly capable at tackling natural language tasks, handling long sequence inputs continues to be a significant challenge. One such task is long input summarization, where inputs are longer than the maximum input context of most pretrained models. Through an extensive set of experiments, we investigate what model architectural changes and pretraining paradigms can most efficiently adapt a pretrained Transformer for long input summarization. We find that a staggered, block-local Transformer with global encoder tokens strikes a good balance of performance and efficiency, and that an additional pretraining phase on long sequences meaningfully improves downstream summarization performance. Based on our findings, we introduce PEGASUS-X, an extension of the PEGASUS model with additional long input pretraining to handle inputs of up to 16K tokens. PEGASUS-X achieves strong performance on long input summarization tasks comparable with much larger models while adding few additional parameters and not requiring model parallelism to train."),bn.forEach(t),vn.forEach(t),yo=h(e),Se=s(e,"P",{});var yn=a(Se);Ko=d(yn,"Tips:"),yn.forEach(t),ko=h(e),qe=s(e,"UL",{});var kn=a(qe);Ke=s(kn,"LI",{});var Tn=a(Ke);Yo=d(Tn,"PEGASUS-X uses the same tokenizer as PEGASUS."),Tn.forEach(t),kn.forEach(t),To=h(e),A=s(e,"P",{});var Le=a(A);Qo=d(Le,"This model was contributed by "),Ce=s(Le,"A",{href:!0});var wn=a(Ce);et=d(wn,"zphang"),wn.forEach(t),ot=d(Le,". The original code can be found "),de=s(Le,"A",{href:!0,rel:!0});var Pn=a(de);tt=d(Pn,"here"),Pn.forEach(t),nt=d(Le,"."),Le.forEach(t),wo=h(e),F=s(e,"H2",{class:!0});var Ao=a(F);B=s(Ao,"A",{id:!0,class:!0,href:!0});var $n=a(B);Ye=s($n,"SPAN",{});var zn=a(Ye);k(le.$$.fragment,zn),zn.forEach(t),$n.forEach(t),st=h(Ao),Qe=s(Ao,"SPAN",{});var xn=a(Qe);at=d(xn,"Documentation resources"),xn.forEach(t),Ao.forEach(t),Po=h(e),R=s(e,"UL",{});var Mo=a(R);eo=s(Mo,"LI",{});var En=a(eo);Ae=s(En,"A",{href:!0});var Xn=a(Ae);rt=d(Xn,"Translation task guide"),Xn.forEach(t),En.forEach(t),it=h(Mo),oo=s(Mo,"LI",{});var Sn=a(oo);Me=s(Sn,"A",{href:!0});var qn=a(Me);dt=d(qn,"Summarization task guide"),qn.forEach(t),Sn.forEach(t),Mo.forEach(t),$o=h(e),G=s(e,"H2",{class:!0});var Fo=a(G);H=s(Fo,"A",{id:!0,class:!0,href:!0});var Cn=a(H);to=s(Cn,"SPAN",{});var An=a(to);k(ce.$$.fragment,An),An.forEach(t),Cn.forEach(t),lt=h(Fo),no=s(Fo,"SPAN",{});var Mn=a(no);ct=d(Mn,"PegasusXConfig"),Mn.forEach(t),Fo.forEach(t),zo=h(e),z=s(e,"DIV",{class:!0});var oe=a(z);k(ue.$$.fragment,oe),ut=h(oe),j=s(oe,"P",{});var De=a(j);pt=d(De,"This is the configuration class to store the configuration of a "),Fe=s(De,"A",{href:!0});var Fn=a(Fe);ht=d(Fn,"PegasusXModel"),Fn.forEach(t),ft=d(De,`. It is used to instantiate a
PEGASUS-X 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 PEGASUS-X
`),pe=s(De,"A",{href:!0,rel:!0});var Gn=a(pe);mt=d(Gn,"google/pegasus-x-large"),Gn.forEach(t),gt=d(De," architecture."),De.forEach(t),_t=h(oe),I=s(oe,"P",{});var We=a(I);vt=d(We,"Configuration objects inherit from "),Ge=s(We,"A",{href:!0});var jn=a(Ge);bt=d(jn,"PretrainedConfig"),jn.forEach(t),yt=d(We,` and can be used to control the model outputs. Read the
documentation from `),je=s(We,"A",{href:!0});var In=a(je);kt=d(In,"PretrainedConfig"),In.forEach(t),Tt=d(We," for more information."),We.forEach(t),wt=h(oe),k(V.$$.fragment,oe),oe.forEach(t),xo=h(e),O=s(e,"H2",{class:!0});var Go=a(O);Z=s(Go,"A",{id:!0,class:!0,href:!0});var On=a(Z);so=s(On,"SPAN",{});var Un=a(so);k(he.$$.fragment,Un),Un.forEach(t),On.forEach(t),Pt=h(Go),ao=s(Go,"SPAN",{});var Nn=a(ao);$t=d(Nn,"PegasusXModel"),Nn.forEach(t),Go.forEach(t),Eo=h(e),x=s(e,"DIV",{class:!0});var te=a(x);k(fe.$$.fragment,te),zt=h(te),me=s(te,"P",{});var jo=a(me);xt=d(jo,`The bare PEGASUS-X Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ie=s(jo,"A",{href:!0});var Ln=a(Ie);Et=d(Ln,"PreTrainedModel"),Ln.forEach(t),Xt=d(jo,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),jo.forEach(t),St=h(te),ge=s(te,"P",{});var Io=a(ge);qt=d(Io,"This model is also a PyTorch "),_e=s(Io,"A",{href:!0,rel:!0});var Dn=a(_e);Ct=d(Dn,"torch.nn.Module"),Dn.forEach(t),At=d(Io,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Io.forEach(t),Mt=h(te),S=s(te,"DIV",{class:!0});var ne=a(S);k(ve.$$.fragment,ne),Ft=h(ne),U=s(ne,"P",{});var Be=a(U);Gt=d(Be,"The "),Oe=s(Be,"A",{href:!0});var Wn=a(Oe);jt=d(Wn,"PegasusXModel"),Wn.forEach(t),It=d(Be," forward method, overrides the "),ro=s(Be,"CODE",{});var Bn=a(ro);Ot=d(Bn,"__call__"),Bn.forEach(t),Ut=d(Be," special method."),Be.forEach(t),Nt=h(ne),k(J.$$.fragment,ne),Lt=h(ne),k(K.$$.fragment,ne),ne.forEach(t),te.forEach(t),Xo=h(e),N=s(e,"H2",{class:!0});var Oo=a(N);Y=s(Oo,"A",{id:!0,class:!0,href:!0});var Rn=a(Y);io=s(Rn,"SPAN",{});var Hn=a(io);k(be.$$.fragment,Hn),Hn.forEach(t),Rn.forEach(t),Dt=h(Oo),lo=s(Oo,"SPAN",{});var Vn=a(lo);Wt=d(Vn,"PegasusXForConditionalGeneration"),Vn.forEach(t),Oo.forEach(t),So=h(e),E=s(e,"DIV",{class:!0});var se=a(E);k(ye.$$.fragment,se),Bt=h(se),ke=s(se,"P",{});var Uo=a(ke);Rt=d(Uo,`The PEGASUS-X for conditional generation (e.g. summarization).
This model inherits from `),Ue=s(Uo,"A",{href:!0});var Zn=a(Ue);Ht=d(Zn,"PreTrainedModel"),Zn.forEach(t),Vt=d(Uo,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Uo.forEach(t),Zt=h(se),Te=s(se,"P",{});var No=a(Te);Jt=d(No,"This model is also a PyTorch "),we=s(No,"A",{href:!0,rel:!0});var Jn=a(we);Kt=d(Jn,"torch.nn.Module"),Jn.forEach(t),Yt=d(No,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),No.forEach(t),Qt=h(se),q=s(se,"DIV",{class:!0});var ae=a(q);k(Pe.$$.fragment,ae),en=h(ae),L=s(ae,"P",{});var Re=a(L);on=d(Re,"The "),Ne=s(Re,"A",{href:!0});var Kn=a(Ne);tn=d(Kn,"PegasusXForConditionalGeneration"),Kn.forEach(t),nn=d(Re," forward method, overrides the "),co=s(Re,"CODE",{});var Yn=a(co);sn=d(Yn,"__call__"),Yn.forEach(t),an=d(Re," special method."),Re.forEach(t),rn=h(ae),k(Q.$$.fragment,ae),dn=h(ae),k(ee.$$.fragment,ae),ae.forEach(t),se.forEach(t),this.h()},h(){l(c,"name","hf:doc:metadata"),l(c,"content",JSON.stringify(us)),l(m,"id","pegasusx"),l(m,"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"),l(m,"href","#pegasusx"),l(_,"class","relative group"),l(D,"id","overview"),l(D,"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"),l(D,"href","#overview"),l(M,"class","relative group"),l(ie,"href","https://arxiv.org/abs/2208.04347"),l(ie,"rel","nofollow"),l(Ce,"href","<https://huggingface.co/zphang"),l(de,"href","https://github.com/google-research/pegasus"),l(de,"rel","nofollow"),l(B,"id","documentation-resources"),l(B,"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"),l(B,"href","#documentation-resources"),l(F,"class","relative group"),l(Ae,"href","./tasks/translation"),l(Me,"href","./tasks/summarization"),l(H,"id","transformers.PegasusXConfig"),l(H,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(H,"href","#transformers.PegasusXConfig"),l(G,"class","relative group"),l(Fe,"href","/docs/transformers/v4.27.1/en/model_doc/pegasus_x#transformers.PegasusXModel"),l(pe,"href","https://huggingface.co/google/pegasus-x-large"),l(pe,"rel","nofollow"),l(Ge,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(je,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Z,"id","transformers.PegasusXModel"),l(Z,"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"),l(Z,"href","#transformers.PegasusXModel"),l(O,"class","relative group"),l(Ie,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(_e,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(_e,"rel","nofollow"),l(Oe,"href","/docs/transformers/v4.27.1/en/model_doc/pegasus_x#transformers.PegasusXModel"),l(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Y,"id","transformers.PegasusXForConditionalGeneration"),l(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"),l(Y,"href","#transformers.PegasusXForConditionalGeneration"),l(N,"class","relative group"),l(Ue,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),l(we,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(we,"rel","nofollow"),l(Ne,"href","/docs/transformers/v4.27.1/en/model_doc/pegasus_x#transformers.PegasusXForConditionalGeneration"),l(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,u){o(document.head,c),f(e,b,u),f(e,_,u),o(_,m),o(m,v),T(r,v,null),o(_,g),o(_,C),o(C,Lo),f(e,mo,u),f(e,M,u),o(M,D),o(D,Ve),T(re,Ve,null),o(M,Do),o(M,Ze),o(Ze,Wo),f(e,go,u),f(e,W,u),o(W,Bo),o(W,ie),o(ie,Ro),o(W,Ho),f(e,_o,u),f(e,xe,u),o(xe,Vo),f(e,vo,u),f(e,Ee,u),o(Ee,Zo),f(e,bo,u),f(e,Xe,u),o(Xe,Je),o(Je,Jo),f(e,yo,u),f(e,Se,u),o(Se,Ko),f(e,ko,u),f(e,qe,u),o(qe,Ke),o(Ke,Yo),f(e,To,u),f(e,A,u),o(A,Qo),o(A,Ce),o(Ce,et),o(A,ot),o(A,de),o(de,tt),o(A,nt),f(e,wo,u),f(e,F,u),o(F,B),o(B,Ye),T(le,Ye,null),o(F,st),o(F,Qe),o(Qe,at),f(e,Po,u),f(e,R,u),o(R,eo),o(eo,Ae),o(Ae,rt),o(R,it),o(R,oo),o(oo,Me),o(Me,dt),f(e,$o,u),f(e,G,u),o(G,H),o(H,to),T(ce,to,null),o(G,lt),o(G,no),o(no,ct),f(e,zo,u),f(e,z,u),T(ue,z,null),o(z,ut),o(z,j),o(j,pt),o(j,Fe),o(Fe,ht),o(j,ft),o(j,pe),o(pe,mt),o(j,gt),o(z,_t),o(z,I),o(I,vt),o(I,Ge),o(Ge,bt),o(I,yt),o(I,je),o(je,kt),o(I,Tt),o(z,wt),T(V,z,null),f(e,xo,u),f(e,O,u),o(O,Z),o(Z,so),T(he,so,null),o(O,Pt),o(O,ao),o(ao,$t),f(e,Eo,u),f(e,x,u),T(fe,x,null),o(x,zt),o(x,me),o(me,xt),o(me,Ie),o(Ie,Et),o(me,Xt),o(x,St),o(x,ge),o(ge,qt),o(ge,_e),o(_e,Ct),o(ge,At),o(x,Mt),o(x,S),T(ve,S,null),o(S,Ft),o(S,U),o(U,Gt),o(U,Oe),o(Oe,jt),o(U,It),o(U,ro),o(ro,Ot),o(U,Ut),o(S,Nt),T(J,S,null),o(S,Lt),T(K,S,null),f(e,Xo,u),f(e,N,u),o(N,Y),o(Y,io),T(be,io,null),o(N,Dt),o(N,lo),o(lo,Wt),f(e,So,u),f(e,E,u),T(ye,E,null),o(E,Bt),o(E,ke),o(ke,Rt),o(ke,Ue),o(Ue,Ht),o(ke,Vt),o(E,Zt),o(E,Te),o(Te,Jt),o(Te,we),o(we,Kt),o(Te,Yt),o(E,Qt),o(E,q),T(Pe,q,null),o(q,en),o(q,L),o(L,on),o(L,Ne),o(Ne,tn),o(L,nn),o(L,co),o(co,sn),o(L,an),o(q,rn),T(Q,q,null),o(q,dn),T(ee,q,null),qo=!0},p(e,[u]){const $e={};u&2&&($e.$$scope={dirty:u,ctx:e}),V.$set($e);const uo={};u&2&&(uo.$$scope={dirty:u,ctx:e}),J.$set(uo);const po={};u&2&&(po.$$scope={dirty:u,ctx:e}),K.$set(po);const ho={};u&2&&(ho.$$scope={dirty:u,ctx:e}),Q.$set(ho);const ze={};u&2&&(ze.$$scope={dirty:u,ctx:e}),ee.$set(ze)},i(e){qo||(w(r.$$.fragment,e),w(re.$$.fragment,e),w(le.$$.fragment,e),w(ce.$$.fragment,e),w(ue.$$.fragment,e),w(V.$$.fragment,e),w(he.$$.fragment,e),w(fe.$$.fragment,e),w(ve.$$.fragment,e),w(J.$$.fragment,e),w(K.$$.fragment,e),w(be.$$.fragment,e),w(ye.$$.fragment,e),w(Pe.$$.fragment,e),w(Q.$$.fragment,e),w(ee.$$.fragment,e),qo=!0)},o(e){P(r.$$.fragment,e),P(re.$$.fragment,e),P(le.$$.fragment,e),P(ce.$$.fragment,e),P(ue.$$.fragment,e),P(V.$$.fragment,e),P(he.$$.fragment,e),P(fe.$$.fragment,e),P(ve.$$.fragment,e),P(J.$$.fragment,e),P(K.$$.fragment,e),P(be.$$.fragment,e),P(ye.$$.fragment,e),P(Pe.$$.fragment,e),P(Q.$$.fragment,e),P(ee.$$.fragment,e),qo=!1},d(e){t(c),e&&t(b),e&&t(_),$(r),e&&t(mo),e&&t(M),$(re),e&&t(go),e&&t(W),e&&t(_o),e&&t(xe),e&&t(vo),e&&t(Ee),e&&t(bo),e&&t(Xe),e&&t(yo),e&&t(Se),e&&t(ko),e&&t(qe),e&&t(To),e&&t(A),e&&t(wo),e&&t(F),$(le),e&&t(Po),e&&t(R),e&&t($o),e&&t(G),$(ce),e&&t(zo),e&&t(z),$(ue),$(V),e&&t(xo),e&&t(O),$(he),e&&t(Eo),e&&t(x),$(fe),$(ve),$(J),$(K),e&&t(Xo),e&&t(N),$(be),e&&t(So),e&&t(E),$(ye),$(Pe),$(Q),$(ee)}}}const us={local:"pegasusx",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.PegasusXConfig",title:"PegasusXConfig"},{local:"transformers.PegasusXModel",title:"PegasusXModel"},{local:"transformers.PegasusXForConditionalGeneration",title:"PegasusXForConditionalGeneration"}],title:"PEGASUS-X"};function ps(X){return ss(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bs extends es{constructor(c){super();os(this,c,ps,cs,ts,{})}}export{bs as default,us as metadata};
