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