import{S as es,i as os,s as ts,e as n,k as p,w as y,t as d,M as ns,c as s,d as t,m as h,a,x as w,h as i,b as l,G as o,g as m,y as T,q as k,o as M,B as P,v as ss,L as cn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Kn}from"../../chunks/Tip-hf-doc-builder.js";import{D as mo}from"../../chunks/Docstring-hf-doc-builder.js";import{C as un}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Oe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ln}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function as(U){let c,v,_,f,b;return f=new un({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBlZ2FzdXNYQ29uZmlnJTJDJTIwUGVnYXN1c1hNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBQRUdBU1VTJTIwZ29vZ2xlJTJGcGVnYXN1cy14LWxhcmdlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFBlZ2FzdXNYQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGdvb2dsZSUyRnBlZ2FzdXMteC1sYXJnZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwUGVnYXN1c1hNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",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"),v=d("Example:"),_=p(),y(f.$$.fragment)},l(r){c=s(r,"P",{});var g=a(c);v=i(g,"Example:"),g.forEach(t),_=h(r),w(f.$$.fragment,r)},m(r,g){m(r,c,g),o(c,v),m(r,_,g),T(f,r,g),b=!0},p:cn,i(r){b||(k(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&t(c),r&&t(_),P(f,r)}}}function rs(U){let c,v,_,f,b;return{c(){c=n("p"),v=d("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),f=d("Module"),b=d(`
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);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var S=a(_);f=i(S,"Module"),S.forEach(t),b=i(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){m(r,c,g),o(c,v),o(c,_),o(_,f),o(c,b)},d(r){r&&t(c)}}}function ds(U){let c,v,_,f,b;return f=new un({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQZWdhc3VzTW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZwZWdhc3VzLXgtbGFyZ2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBQZWdhc3VzTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnBlZ2FzdXMteC1sYXJnZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyU3R1ZGllcyUyMGhhdmUlMjBiZWVuJTIwc2hvd24lMjB0aGF0JTIwb3duaW5nJTIwYSUyMGRvZyUyMGlzJTIwZ29vZCUyMGZvciUyMHlvdSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBZGVjb2Rlcl9pbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyU3R1ZGllcyUyMHNob3clMjB0aGF0JTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTNEaW5wdXRzLmlucHV0X2lkcyUyQyUyMGRlY29kZXJfaW5wdXRfaWRzJTNEZGVjb2Rlcl9pbnB1dHMuaW5wdXRfaWRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",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"),v=d("Example:"),_=p(),y(f.$$.fragment)},l(r){c=s(r,"P",{});var g=a(c);v=i(g,"Example:"),g.forEach(t),_=h(r),w(f.$$.fragment,r)},m(r,g){m(r,c,g),o(c,v),m(r,_,g),T(f,r,g),b=!0},p:cn,i(r){b||(k(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&t(c),r&&t(_),P(f,r)}}}function is(U){let c,v,_,f,b;return{c(){c=n("p"),v=d("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),f=d("Module"),b=d(`
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);v=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var S=a(_);f=i(S,"Module"),S.forEach(t),b=i(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){m(r,c,g),o(c,v),o(c,_),o(_,f),o(c,b)},d(r){r&&t(c)}}}function ls(U){let c,v,_,f,b;return f=new un({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQZWdhc3VzWEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwUGVnYXN1c1hGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnBlZ2FzdXMteC1iYXNlJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnBlZ2FzdXMteC1sYXJnZSUyMiklMEElMEFBUlRJQ0xFX1RPX1NVTU1BUklaRSUyMCUzRCUyMCglMEElMjAlMjAlMjAlMjAlMjJQRyUyNkUlMjBzdGF0ZWQlMjBpdCUyMHNjaGVkdWxlZCUyMHRoZSUyMGJsYWNrb3V0cyUyMGluJTIwcmVzcG9uc2UlMjB0byUyMGZvcmVjYXN0cyUyMGZvciUyMGhpZ2glMjB3aW5kcyUyMCUyMiUwQSUyMCUyMCUyMCUyMCUyMmFtaWQlMjBkcnklMjBjb25kaXRpb25zLiUyMFRoZSUyMGFpbSUyMGlzJTIwdG8lMjByZWR1Y2UlMjB0aGUlMjByaXNrJTIwb2YlMjB3aWxkZmlyZXMuJTIwTmVhcmx5JTIwODAwJTIwdGhvdXNhbmQlMjBjdXN0b21lcnMlMjB3ZXJlJTIwJTIyJTBBJTIwJTIwJTIwJTIwJTIyc2NoZWR1bGVkJTIwdG8lMjBiZSUyMGFmZmVjdGVkJTIwYnklMjB0aGUlMjBzaHV0b2ZmcyUyMHdoaWNoJTIwd2VyZSUyMGV4cGVjdGVkJTIwdG8lMjBsYXN0JTIwdGhyb3VnaCUyMGF0JTIwbGVhc3QlMjBtaWRkYXklMjB0b21vcnJvdy4lMjIlMEEpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKEFSVElDTEVfVE9fU1VNTUFSSVpFJTJDJTIwbWF4X2xlbmd0aCUzRDEwMjQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTIwU3VtbWFyeSUwQXN1bW1hcnlfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUoc3VtbWFyeV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",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"),v=d("Summarization example:"),_=p(),y(f.$$.fragment)},l(r){c=s(r,"P",{});var g=a(c);v=i(g,"Summarization example:"),g.forEach(t),_=h(r),w(f.$$.fragment,r)},m(r,g){m(r,c,g),o(c,v),m(r,_,g),T(f,r,g),b=!0},p:cn,i(r){b||(k(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&t(c),r&&t(_),P(f,r)}}}function cs(U){let c,v,_,f,b,r,g,S,Wo,fo,G,N,De,re,No,Le,Vo,go,V,Ro,de,Bo,Oo,_o,ze,Do,bo,$e,Lo,vo,Ue,Qe,Qo,yo,Ee,Ho,wo,xe,He,Yo,To,C,Ko,Se,et,ot,ie,tt,nt,ko,F,R,Ye,le,st,Ke,at,Mo,B,eo,Ce,rt,dt,oo,Ge,it,Po,j,O,to,ce,lt,no,ct,Xo,X,ue,ut,q,pt,Fe,ht,mt,pe,ft,gt,_t,J,bt,je,vt,yt,qe,wt,Tt,kt,D,zo,I,L,so,he,Mt,ao,Pt,$o,z,me,Xt,fe,zt,Je,$t,Ut,Et,ge,xt,_e,St,Ct,Gt,E,be,Ft,Z,jt,Ie,qt,Jt,ro,It,Zt,At,Q,Wt,H,Uo,A,Y,io,ve,Nt,lo,Vt,Eo,$,ye,Rt,we,Bt,Ze,Ot,Dt,Lt,Te,Qt,ke,Ht,Yt,Kt,x,Me,en,W,on,Ae,tn,nn,co,sn,an,rn,K,dn,ee,xo;return r=new Oe({}),re=new Oe({}),le=new Oe({}),ce=new Oe({}),ue=new mo({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.31.0/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.`,name:"init_std"},{anchor:"transformers.PegasusXConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.PegasusXConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.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.31.0/src/transformers/models/pegasus_x/configuration_pegasus_x.py#L30"}}),D=new ln({props:{anchor:"transformers.PegasusXConfig.example",$$slots:{default:[as]},$$scope:{ctx:U}}}),he=new Oe({}),me=new mo({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.31.0/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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus_x/modeling_pegasus_x.py#L1393"}}),be=new mo({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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus_x/modeling_pegasus_x.py#L1445",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/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.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Q=new Kn({props:{$$slots:{default:[rs]},$$scope:{ctx:U}}}),H=new ln({props:{anchor:"transformers.PegasusXModel.forward.example",$$slots:{default:[ds]},$$scope:{ctx:U}}}),ve=new Oe({}),ye=new mo({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.31.0/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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus_x/modeling_pegasus_x.py#L1536"}}),Me=new mo({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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.31.0/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.31.0/src/transformers/models/pegasus_x/modeling_pegasus_x.py#L1587",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/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.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),K=new Kn({props:{$$slots:{default:[is]},$$scope:{ctx:U}}}),ee=new ln({props:{anchor:"transformers.PegasusXForConditionalGeneration.forward.example",$$slots:{default:[ls]},$$scope:{ctx:U}}}),{c(){c=n("meta"),v=p(),_=n("h1"),f=n("a"),b=n("span"),y(r.$$.fragment),g=p(),S=n("span"),Wo=d("PEGASUS-X"),fo=p(),G=n("h2"),N=n("a"),De=n("span"),y(re.$$.fragment),No=p(),Le=n("span"),Vo=d("Overview"),go=p(),V=n("p"),Ro=d("The PEGASUS-X model was proposed in "),de=n("a"),Bo=d("Investigating Efficiently Extending Transformers for Long Input Summarization"),Oo=d("  by Jason Phang, Yao Zhao and Peter J. Liu."),_o=p(),ze=n("p"),Do=d("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."),bo=p(),$e=n("p"),Lo=d("The abstract from the paper is the following:"),vo=p(),Ue=n("p"),Qe=n("em"),Qo=d("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(),Ee=n("p"),Ho=d("Tips:"),wo=p(),xe=n("ul"),He=n("li"),Yo=d("PEGASUS-X uses the same tokenizer as PEGASUS."),To=p(),C=n("p"),Ko=d("This model was contributed by "),Se=n("a"),et=d("zphang"),ot=d(". The original code can be found "),ie=n("a"),tt=d("here"),nt=d("."),ko=p(),F=n("h2"),R=n("a"),Ye=n("span"),y(le.$$.fragment),st=p(),Ke=n("span"),at=d("Documentation resources"),Mo=p(),B=n("ul"),eo=n("li"),Ce=n("a"),rt=d("Translation task guide"),dt=p(),oo=n("li"),Ge=n("a"),it=d("Summarization task guide"),Po=p(),j=n("h2"),O=n("a"),to=n("span"),y(ce.$$.fragment),lt=p(),no=n("span"),ct=d("PegasusXConfig"),Xo=p(),X=n("div"),y(ue.$$.fragment),ut=p(),q=n("p"),pt=d("This is the configuration class to store the configuration of a "),Fe=n("a"),ht=d("PegasusXModel"),mt=d(`. 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"),ft=d("google/pegasus-x-large"),gt=d(" architecture."),_t=p(),J=n("p"),bt=d("Configuration objects inherit from "),je=n("a"),vt=d("PretrainedConfig"),yt=d(` and can be used to control the model outputs. Read the
documentation from `),qe=n("a"),wt=d("PretrainedConfig"),Tt=d(" for more information."),kt=p(),y(D.$$.fragment),zo=p(),I=n("h2"),L=n("a"),so=n("span"),y(he.$$.fragment),Mt=p(),ao=n("span"),Pt=d("PegasusXModel"),$o=p(),z=n("div"),y(me.$$.fragment),Xt=p(),fe=n("p"),zt=d(`The bare PEGASUS-X Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Je=n("a"),$t=d("PreTrainedModel"),Ut=d(`. 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.)`),Et=p(),ge=n("p"),xt=d("This model is also a PyTorch "),_e=n("a"),St=d("torch.nn.Module"),Ct=d(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gt=p(),E=n("div"),y(be.$$.fragment),Ft=p(),Z=n("p"),jt=d("The "),Ie=n("a"),qt=d("PegasusXModel"),Jt=d(" forward method, overrides the "),ro=n("code"),It=d("__call__"),Zt=d(" special method."),At=p(),y(Q.$$.fragment),Wt=p(),y(H.$$.fragment),Uo=p(),A=n("h2"),Y=n("a"),io=n("span"),y(ve.$$.fragment),Nt=p(),lo=n("span"),Vt=d("PegasusXForConditionalGeneration"),Eo=p(),$=n("div"),y(ye.$$.fragment),Rt=p(),we=n("p"),Bt=d(`The PEGASUS-X for conditional generation (e.g. summarization).
This model inherits from `),Ze=n("a"),Ot=d("PreTrainedModel"),Dt=d(`. 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.)`),Lt=p(),Te=n("p"),Qt=d("This model is also a PyTorch "),ke=n("a"),Ht=d("torch.nn.Module"),Yt=d(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kt=p(),x=n("div"),y(Me.$$.fragment),en=p(),W=n("p"),on=d("The "),Ae=n("a"),tn=d("PegasusXForConditionalGeneration"),nn=d(" forward method, overrides the "),co=n("code"),sn=d("__call__"),an=d(" special method."),rn=p(),y(K.$$.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),v=h(e),_=s(e,"H1",{class:!0});var Pe=a(_);f=s(Pe,"A",{id:!0,class:!0,href:!0});var uo=a(f);b=s(uo,"SPAN",{});var po=a(b);w(r.$$.fragment,po),po.forEach(t),uo.forEach(t),g=h(Pe),S=s(Pe,"SPAN",{});var ho=a(S);Wo=i(ho,"PEGASUS-X"),ho.forEach(t),Pe.forEach(t),fo=h(e),G=s(e,"H2",{class:!0});var Xe=a(G);N=s(Xe,"A",{id:!0,class:!0,href:!0});var pn=a(N);De=s(pn,"SPAN",{});var hn=a(De);w(re.$$.fragment,hn),hn.forEach(t),pn.forEach(t),No=h(Xe),Le=s(Xe,"SPAN",{});var mn=a(Le);Vo=i(mn,"Overview"),mn.forEach(t),Xe.forEach(t),go=h(e),V=s(e,"P",{});var So=a(V);Ro=i(So,"The PEGASUS-X model was proposed in "),de=s(So,"A",{href:!0,rel:!0});var fn=a(de);Bo=i(fn,"Investigating Efficiently Extending Transformers for Long Input Summarization"),fn.forEach(t),Oo=i(So,"  by Jason Phang, Yao Zhao and Peter J. Liu."),So.forEach(t),_o=h(e),ze=s(e,"P",{});var gn=a(ze);Do=i(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),bo=h(e),$e=s(e,"P",{});var _n=a($e);Lo=i(_n,"The abstract from the paper is the following:"),_n.forEach(t),vo=h(e),Ue=s(e,"P",{});var bn=a(Ue);Qe=s(bn,"EM",{});var vn=a(Qe);Qo=i(vn,"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."),vn.forEach(t),bn.forEach(t),yo=h(e),Ee=s(e,"P",{});var yn=a(Ee);Ho=i(yn,"Tips:"),yn.forEach(t),wo=h(e),xe=s(e,"UL",{});var wn=a(xe);He=s(wn,"LI",{});var Tn=a(He);Yo=i(Tn,"PEGASUS-X uses the same tokenizer as PEGASUS."),Tn.forEach(t),wn.forEach(t),To=h(e),C=s(e,"P",{});var We=a(C);Ko=i(We,"This model was contributed by "),Se=s(We,"A",{href:!0});var kn=a(Se);et=i(kn,"zphang"),kn.forEach(t),ot=i(We,". The original code can be found "),ie=s(We,"A",{href:!0,rel:!0});var Mn=a(ie);tt=i(Mn,"here"),Mn.forEach(t),nt=i(We,"."),We.forEach(t),ko=h(e),F=s(e,"H2",{class:!0});var Co=a(F);R=s(Co,"A",{id:!0,class:!0,href:!0});var Pn=a(R);Ye=s(Pn,"SPAN",{});var Xn=a(Ye);w(le.$$.fragment,Xn),Xn.forEach(t),Pn.forEach(t),st=h(Co),Ke=s(Co,"SPAN",{});var zn=a(Ke);at=i(zn,"Documentation resources"),zn.forEach(t),Co.forEach(t),Mo=h(e),B=s(e,"UL",{});var Go=a(B);eo=s(Go,"LI",{});var $n=a(eo);Ce=s($n,"A",{href:!0});var Un=a(Ce);rt=i(Un,"Translation task guide"),Un.forEach(t),$n.forEach(t),dt=h(Go),oo=s(Go,"LI",{});var En=a(oo);Ge=s(En,"A",{href:!0});var xn=a(Ge);it=i(xn,"Summarization task guide"),xn.forEach(t),En.forEach(t),Go.forEach(t),Po=h(e),j=s(e,"H2",{class:!0});var Fo=a(j);O=s(Fo,"A",{id:!0,class:!0,href:!0});var Sn=a(O);to=s(Sn,"SPAN",{});var Cn=a(to);w(ce.$$.fragment,Cn),Cn.forEach(t),Sn.forEach(t),lt=h(Fo),no=s(Fo,"SPAN",{});var Gn=a(no);ct=i(Gn,"PegasusXConfig"),Gn.forEach(t),Fo.forEach(t),Xo=h(e),X=s(e,"DIV",{class:!0});var oe=a(X);w(ue.$$.fragment,oe),ut=h(oe),q=s(oe,"P",{});var Ne=a(q);pt=i(Ne,"This is the configuration class to store the configuration of a "),Fe=s(Ne,"A",{href:!0});var Fn=a(Fe);ht=i(Fn,"PegasusXModel"),Fn.forEach(t),mt=i(Ne,`. 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(Ne,"A",{href:!0,rel:!0});var jn=a(pe);ft=i(jn,"google/pegasus-x-large"),jn.forEach(t),gt=i(Ne," architecture."),Ne.forEach(t),_t=h(oe),J=s(oe,"P",{});var Ve=a(J);bt=i(Ve,"Configuration objects inherit from "),je=s(Ve,"A",{href:!0});var qn=a(je);vt=i(qn,"PretrainedConfig"),qn.forEach(t),yt=i(Ve,` and can be used to control the model outputs. Read the
documentation from `),qe=s(Ve,"A",{href:!0});var Jn=a(qe);wt=i(Jn,"PretrainedConfig"),Jn.forEach(t),Tt=i(Ve," for more information."),Ve.forEach(t),kt=h(oe),w(D.$$.fragment,oe),oe.forEach(t),zo=h(e),I=s(e,"H2",{class:!0});var jo=a(I);L=s(jo,"A",{id:!0,class:!0,href:!0});var In=a(L);so=s(In,"SPAN",{});var Zn=a(so);w(he.$$.fragment,Zn),Zn.forEach(t),In.forEach(t),Mt=h(jo),ao=s(jo,"SPAN",{});var An=a(ao);Pt=i(An,"PegasusXModel"),An.forEach(t),jo.forEach(t),$o=h(e),z=s(e,"DIV",{class:!0});var te=a(z);w(me.$$.fragment,te),Xt=h(te),fe=s(te,"P",{});var qo=a(fe);zt=i(qo,`The bare PEGASUS-X Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Je=s(qo,"A",{href:!0});var Wn=a(Je);$t=i(Wn,"PreTrainedModel"),Wn.forEach(t),Ut=i(qo,`. 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.)`),qo.forEach(t),Et=h(te),ge=s(te,"P",{});var Jo=a(ge);xt=i(Jo,"This model is also a PyTorch "),_e=s(Jo,"A",{href:!0,rel:!0});var Nn=a(_e);St=i(Nn,"torch.nn.Module"),Nn.forEach(t),Ct=i(Jo,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jo.forEach(t),Gt=h(te),E=s(te,"DIV",{class:!0});var ne=a(E);w(be.$$.fragment,ne),Ft=h(ne),Z=s(ne,"P",{});var Re=a(Z);jt=i(Re,"The "),Ie=s(Re,"A",{href:!0});var Vn=a(Ie);qt=i(Vn,"PegasusXModel"),Vn.forEach(t),Jt=i(Re," forward method, overrides the "),ro=s(Re,"CODE",{});var Rn=a(ro);It=i(Rn,"__call__"),Rn.forEach(t),Zt=i(Re," special method."),Re.forEach(t),At=h(ne),w(Q.$$.fragment,ne),Wt=h(ne),w(H.$$.fragment,ne),ne.forEach(t),te.forEach(t),Uo=h(e),A=s(e,"H2",{class:!0});var Io=a(A);Y=s(Io,"A",{id:!0,class:!0,href:!0});var Bn=a(Y);io=s(Bn,"SPAN",{});var On=a(io);w(ve.$$.fragment,On),On.forEach(t),Bn.forEach(t),Nt=h(Io),lo=s(Io,"SPAN",{});var Dn=a(lo);Vt=i(Dn,"PegasusXForConditionalGeneration"),Dn.forEach(t),Io.forEach(t),Eo=h(e),$=s(e,"DIV",{class:!0});var se=a($);w(ye.$$.fragment,se),Rt=h(se),we=s(se,"P",{});var Zo=a(we);Bt=i(Zo,`The PEGASUS-X for conditional generation (e.g. summarization).
This model inherits from `),Ze=s(Zo,"A",{href:!0});var Ln=a(Ze);Ot=i(Ln,"PreTrainedModel"),Ln.forEach(t),Dt=i(Zo,`. 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.)`),Zo.forEach(t),Lt=h(se),Te=s(se,"P",{});var Ao=a(Te);Qt=i(Ao,"This model is also a PyTorch "),ke=s(Ao,"A",{href:!0,rel:!0});var Qn=a(ke);Ht=i(Qn,"torch.nn.Module"),Qn.forEach(t),Yt=i(Ao,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ao.forEach(t),Kt=h(se),x=s(se,"DIV",{class:!0});var ae=a(x);w(Me.$$.fragment,ae),en=h(ae),W=s(ae,"P",{});var Be=a(W);on=i(Be,"The "),Ae=s(Be,"A",{href:!0});var Hn=a(Ae);tn=i(Hn,"PegasusXForConditionalGeneration"),Hn.forEach(t),nn=i(Be," forward method, overrides the "),co=s(Be,"CODE",{});var Yn=a(co);sn=i(Yn,"__call__"),Yn.forEach(t),an=i(Be," special method."),Be.forEach(t),rn=h(ae),w(K.$$.fragment,ae),dn=h(ae),w(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(f,"id","pegasusx"),l(f,"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(f,"href","#pegasusx"),l(_,"class","relative group"),l(N,"id","overview"),l(N,"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(N,"href","#overview"),l(G,"class","relative group"),l(de,"href","https://arxiv.org/abs/2208.04347"),l(de,"rel","nofollow"),l(Se,"href","<https://huggingface.co/zphang"),l(ie,"href","https://github.com/google-research/pegasus"),l(ie,"rel","nofollow"),l(R,"id","documentation-resources"),l(R,"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(R,"href","#documentation-resources"),l(F,"class","relative group"),l(Ce,"href","../tasks/translation"),l(Ge,"href","../tasks/summarization"),l(O,"id","transformers.PegasusXConfig"),l(O,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(O,"href","#transformers.PegasusXConfig"),l(j,"class","relative group"),l(Fe,"href","/docs/transformers/v4.31.0/en/model_doc/pegasus_x#transformers.PegasusXModel"),l(pe,"href","https://huggingface.co/google/pegasus-x-large"),l(pe,"rel","nofollow"),l(je,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(qe,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(L,"id","transformers.PegasusXModel"),l(L,"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(L,"href","#transformers.PegasusXModel"),l(I,"class","relative group"),l(Je,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(_e,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(_e,"rel","nofollow"),l(Ie,"href","/docs/transformers/v4.31.0/en/model_doc/pegasus_x#transformers.PegasusXModel"),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"),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(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(A,"class","relative group"),l(Ze,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(ke,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ke,"rel","nofollow"),l(Ae,"href","/docs/transformers/v4.31.0/en/model_doc/pegasus_x#transformers.PegasusXForConditionalGeneration"),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($,"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),m(e,v,u),m(e,_,u),o(_,f),o(f,b),T(r,b,null),o(_,g),o(_,S),o(S,Wo),m(e,fo,u),m(e,G,u),o(G,N),o(N,De),T(re,De,null),o(G,No),o(G,Le),o(Le,Vo),m(e,go,u),m(e,V,u),o(V,Ro),o(V,de),o(de,Bo),o(V,Oo),m(e,_o,u),m(e,ze,u),o(ze,Do),m(e,bo,u),m(e,$e,u),o($e,Lo),m(e,vo,u),m(e,Ue,u),o(Ue,Qe),o(Qe,Qo),m(e,yo,u),m(e,Ee,u),o(Ee,Ho),m(e,wo,u),m(e,xe,u),o(xe,He),o(He,Yo),m(e,To,u),m(e,C,u),o(C,Ko),o(C,Se),o(Se,et),o(C,ot),o(C,ie),o(ie,tt),o(C,nt),m(e,ko,u),m(e,F,u),o(F,R),o(R,Ye),T(le,Ye,null),o(F,st),o(F,Ke),o(Ke,at),m(e,Mo,u),m(e,B,u),o(B,eo),o(eo,Ce),o(Ce,rt),o(B,dt),o(B,oo),o(oo,Ge),o(Ge,it),m(e,Po,u),m(e,j,u),o(j,O),o(O,to),T(ce,to,null),o(j,lt),o(j,no),o(no,ct),m(e,Xo,u),m(e,X,u),T(ue,X,null),o(X,ut),o(X,q),o(q,pt),o(q,Fe),o(Fe,ht),o(q,mt),o(q,pe),o(pe,ft),o(q,gt),o(X,_t),o(X,J),o(J,bt),o(J,je),o(je,vt),o(J,yt),o(J,qe),o(qe,wt),o(J,Tt),o(X,kt),T(D,X,null),m(e,zo,u),m(e,I,u),o(I,L),o(L,so),T(he,so,null),o(I,Mt),o(I,ao),o(ao,Pt),m(e,$o,u),m(e,z,u),T(me,z,null),o(z,Xt),o(z,fe),o(fe,zt),o(fe,Je),o(Je,$t),o(fe,Ut),o(z,Et),o(z,ge),o(ge,xt),o(ge,_e),o(_e,St),o(ge,Ct),o(z,Gt),o(z,E),T(be,E,null),o(E,Ft),o(E,Z),o(Z,jt),o(Z,Ie),o(Ie,qt),o(Z,Jt),o(Z,ro),o(ro,It),o(Z,Zt),o(E,At),T(Q,E,null),o(E,Wt),T(H,E,null),m(e,Uo,u),m(e,A,u),o(A,Y),o(Y,io),T(ve,io,null),o(A,Nt),o(A,lo),o(lo,Vt),m(e,Eo,u),m(e,$,u),T(ye,$,null),o($,Rt),o($,we),o(we,Bt),o(we,Ze),o(Ze,Ot),o(we,Dt),o($,Lt),o($,Te),o(Te,Qt),o(Te,ke),o(ke,Ht),o(Te,Yt),o($,Kt),o($,x),T(Me,x,null),o(x,en),o(x,W),o(W,on),o(W,Ae),o(Ae,tn),o(W,nn),o(W,co),o(co,sn),o(W,an),o(x,rn),T(K,x,null),o(x,dn),T(ee,x,null),xo=!0},p(e,[u]){const Pe={};u&2&&(Pe.$$scope={dirty:u,ctx:e}),D.$set(Pe);const uo={};u&2&&(uo.$$scope={dirty:u,ctx:e}),Q.$set(uo);const po={};u&2&&(po.$$scope={dirty:u,ctx:e}),H.$set(po);const ho={};u&2&&(ho.$$scope={dirty:u,ctx:e}),K.$set(ho);const Xe={};u&2&&(Xe.$$scope={dirty:u,ctx:e}),ee.$set(Xe)},i(e){xo||(k(r.$$.fragment,e),k(re.$$.fragment,e),k(le.$$.fragment,e),k(ce.$$.fragment,e),k(ue.$$.fragment,e),k(D.$$.fragment,e),k(he.$$.fragment,e),k(me.$$.fragment,e),k(be.$$.fragment,e),k(Q.$$.fragment,e),k(H.$$.fragment,e),k(ve.$$.fragment,e),k(ye.$$.fragment,e),k(Me.$$.fragment,e),k(K.$$.fragment,e),k(ee.$$.fragment,e),xo=!0)},o(e){M(r.$$.fragment,e),M(re.$$.fragment,e),M(le.$$.fragment,e),M(ce.$$.fragment,e),M(ue.$$.fragment,e),M(D.$$.fragment,e),M(he.$$.fragment,e),M(me.$$.fragment,e),M(be.$$.fragment,e),M(Q.$$.fragment,e),M(H.$$.fragment,e),M(ve.$$.fragment,e),M(ye.$$.fragment,e),M(Me.$$.fragment,e),M(K.$$.fragment,e),M(ee.$$.fragment,e),xo=!1},d(e){t(c),e&&t(v),e&&t(_),P(r),e&&t(fo),e&&t(G),P(re),e&&t(go),e&&t(V),e&&t(_o),e&&t(ze),e&&t(bo),e&&t($e),e&&t(vo),e&&t(Ue),e&&t(yo),e&&t(Ee),e&&t(wo),e&&t(xe),e&&t(To),e&&t(C),e&&t(ko),e&&t(F),P(le),e&&t(Mo),e&&t(B),e&&t(Po),e&&t(j),P(ce),e&&t(Xo),e&&t(X),P(ue),P(D),e&&t(zo),e&&t(I),P(he),e&&t($o),e&&t(z),P(me),P(be),P(Q),P(H),e&&t(Uo),e&&t(A),P(ve),e&&t(Eo),e&&t($),P(ye),P(Me),P(K),P(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(U){return ss(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vs extends es{constructor(c){super();os(this,c,ps,cs,ts,{})}}export{vs as default,us as metadata};
