import{S as g_,i as __,s as y_,e as n,k as l,w as v,t as r,M as b_,c as s,d as t,m as c,a,x as k,h as d,b as p,N as f_,G as e,g as f,y as T,q as w,o as M,B as $,v as v_,L as We}from"../../chunks/vendor-hf-doc-builder.js";import{T as hn}from"../../chunks/Tip-hf-doc-builder.js";import{D as J}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Fe}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Q}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as qe}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function k_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBlZ2FzdXNDb25maWclMkMlMjBQZWdhc3VzTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwUEVHQVNVUyUyMGdvb2dsZSUyRnBlZ2FzdXMtbGFyZ2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwUGVnYXN1c0NvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBnb29nbGUlMkZwZWdhc3VzLWxhcmdlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBQZWdhc3VzTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PegasusConfig, PegasusModel

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = PegasusForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/pegasus-xsum&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/pegasus-xsum&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(){u=n("p"),b=r("Summarization example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Summarization example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function F_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQZWdhc3VzRm9yQ2F1c2FsTE0lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZwZWdhc3VzLWxhcmdlJTIyKSUwQW1vZGVsJTIwJTNEJTIwUGVnYXN1c0ZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZwZWdhc3VzLWxhcmdlJTIyJTJDJTIwYWRkX2Nyb3NzX2F0dGVudGlvbiUzREZhbHNlKSUwQWFzc2VydCUyMG1vZGVsLmNvbmZpZy5pc19kZWNvZGVyJTJDJTIwZiUyMiU3Qm1vZGVsLl9fY2xhc3NfXyU3RCUyMGhhcyUyMHRvJTIwYmUlMjBjb25maWd1cmVkJTIwYXMlMjBhJTIwZGVjb2Rlci4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBZXhwZWN0ZWRfc2hhcGUlMjAlM0QlMjAlNUIxJTJDJTIwaW5wdXRzLmlucHV0X2lkcy5zaGFwZSU1Qi0xJTVEJTJDJTIwbW9kZWwuY29uZmlnLnZvY2FiX3NpemUlNUQlMEFsaXN0KGxvZ2l0cy5zaGFwZSklMjAlM0QlM0QlMjBleHBlY3RlZF9zaGFwZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, PegasusForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/pegasus-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PegasusForCausalLM.from_pretrained(<span class="hljs-string">&quot;google/pegasus-large&quot;</span>, add_cross_attention=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> model.config.is_decoder, <span class="hljs-string">f&quot;<span class="hljs-subst">{model.__class__}</span> has to be configured as a decoder.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_shape = [<span class="hljs-number">1</span>, inputs.input_ids.shape[-<span class="hljs-number">1</span>], model.config.vocab_size]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape) == expected_shape
<span class="hljs-literal">True</span>`}}),{c(){u=n("p"),b=r("Example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function z_(z){let u,b,_,m,y,i,h,j,Qe,Se,Z,ye,Y,x,Ye,R,be,_t,K,L,ze,ie,Ke,le,ce,et,Ne,q,ee,xe,O,G,C,tt,te,oe,ot,N,nt,st,I,ve,pe,Ae,ne,H,at,rt,A,dt,se,X,je,U,it,B,ue,lt;return{c(){u=n("p"),b=r("TensorFlow models and layers in "),_=n("code"),m=r("transformers"),y=r(" accept two formats as input:"),i=l(),h=n("ul"),j=n("li"),Qe=r("having all inputs as keyword arguments (like PyTorch models), or"),Se=l(),Z=n("li"),ye=r("having all inputs as a list, tuple or dict in the first positional argument."),Y=l(),x=n("p"),Ye=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=n("code"),be=r("model.fit()"),_t=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),K=n("code"),L=r("model.fit()"),ze=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=n("code"),Ke=r("fit()"),le=r(" and "),ce=n("code"),et=r("predict()"),Ne=r(`, such as when creating your own layers or models with
the Keras `),q=n("code"),ee=r("Functional"),xe=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),O=l(),G=n("ul"),C=n("li"),tt=r("a single Tensor with "),te=n("code"),oe=r("input_ids"),ot=r(" only and nothing else: "),N=n("code"),nt=r("model(input_ids)"),st=l(),I=n("li"),ve=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=n("code"),Ae=r("model([input_ids, attention_mask])"),ne=r(" or "),H=n("code"),at=r("model([input_ids, attention_mask, token_type_ids])"),rt=l(),A=n("li"),dt=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),se=n("code"),X=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),je=l(),U=n("p"),it=r(`Note that when creating models and layers with
`),B=n("a"),ue=r("subclassing"),lt=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(F){u=s(F,"P",{});var P=a(u);b=d(P,"TensorFlow models and layers in "),_=s(P,"CODE",{});var Be=a(_);m=d(Be,"transformers"),Be.forEach(t),y=d(P," accept two formats as input:"),P.forEach(t),i=c(F),h=s(F,"UL",{});var Pe=a(h);j=s(Pe,"LI",{});var yt=a(j);Qe=d(yt,"having all inputs as keyword arguments (like PyTorch models), or"),yt.forEach(t),Se=c(Pe),Z=s(Pe,"LI",{});var Ve=a(Z);ye=d(Ve,"having all inputs as a list, tuple or dict in the first positional argument."),Ve.forEach(t),Pe.forEach(t),Y=c(F),x=s(F,"P",{});var E=a(x);Ye=d(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=s(E,"CODE",{});var ct=a(R);be=d(ct,"model.fit()"),ct.forEach(t),_t=d(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),K=s(E,"CODE",{});var jt=a(K);L=d(jt,"model.fit()"),jt.forEach(t),ze=d(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=s(E,"CODE",{});var Pt=a(ie);Ke=d(Pt,"fit()"),Pt.forEach(t),le=d(E," and "),ce=s(E,"CODE",{});var Ee=a(ce);et=d(Ee,"predict()"),Ee.forEach(t),Ne=d(E,`, such as when creating your own layers or models with
the Keras `),q=s(E,"CODE",{});var pt=a(q);ee=d(pt,"Functional"),pt.forEach(t),xe=d(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),O=c(F),G=s(F,"UL",{});var D=a(G);C=s(D,"LI",{});var he=a(C);tt=d(he,"a single Tensor with "),te=s(he,"CODE",{});var ut=a(te);oe=d(ut,"input_ids"),ut.forEach(t),ot=d(he," only and nothing else: "),N=s(he,"CODE",{});var Et=a(N);nt=d(Et,"model(input_ids)"),Et.forEach(t),he.forEach(t),st=c(D),I=s(D,"LI",{});var ae=a(I);ve=d(ae,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=s(ae,"CODE",{});var me=a(pe);Ae=d(me,"model([input_ids, attention_mask])"),me.forEach(t),ne=d(ae," or "),H=s(ae,"CODE",{});var ke=a(H);at=d(ke,"model([input_ids, attention_mask, token_type_ids])"),ke.forEach(t),ae.forEach(t),rt=c(D),A=s(D,"LI",{});var Je=a(A);dt=d(Je,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),se=s(Je,"CODE",{});var Ge=a(se);X=d(Ge,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ge.forEach(t),Je.forEach(t),D.forEach(t),je=c(F),U=s(F,"P",{});var Ue=a(U);it=d(Ue,`Note that when creating models and layers with
`),B=s(Ue,"A",{href:!0,rel:!0});var ht=a(B);ue=d(ht,"subclassing"),ht.forEach(t),lt=d(Ue,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Ue.forEach(t),this.h()},h(){p(B,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(B,"rel","nofollow")},m(F,P){f(F,u,P),e(u,b),e(u,_),e(_,m),e(u,y),f(F,i,P),f(F,h,P),e(h,j),e(j,Qe),e(h,Se),e(h,Z),e(Z,ye),f(F,Y,P),f(F,x,P),e(x,Ye),e(x,R),e(R,be),e(x,_t),e(x,K),e(K,L),e(x,ze),e(x,ie),e(ie,Ke),e(x,le),e(x,ce),e(ce,et),e(x,Ne),e(x,q),e(q,ee),e(x,xe),f(F,O,P),f(F,G,P),e(G,C),e(C,tt),e(C,te),e(te,oe),e(C,ot),e(C,N),e(N,nt),e(G,st),e(G,I),e(I,ve),e(I,pe),e(pe,Ae),e(I,ne),e(I,H),e(H,at),e(G,rt),e(G,A),e(A,dt),e(A,se),e(se,X),f(F,je,P),f(F,U,P),e(U,it),e(U,B),e(B,ue),e(U,lt)},d(F){F&&t(u),F&&t(i),F&&t(h),F&&t(Y),F&&t(x),F&&t(O),F&&t(G),F&&t(je),F&&t(U)}}}function x_(z){let u,b,_,m,y;return{c(){u=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=r("Module"),y=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(h,"CODE",{});var j=a(_);m=d(j,"Module"),j.forEach(t),y=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){f(i,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(i){i&&t(u)}}}function j_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlBlZ2FzdXNNb2RlbCUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGcGVnYXN1cy1sYXJnZSUyMiklMEFtb2RlbCUyMCUzRCUyMFRGUGVnYXN1c01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZwZWdhc3VzLWxhcmdlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFPegasusModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){u=n("p"),b=r("Example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function P_(z){let u,b,_,m,y,i,h,j,Qe,Se,Z,ye,Y,x,Ye,R,be,_t,K,L,ze,ie,Ke,le,ce,et,Ne,q,ee,xe,O,G,C,tt,te,oe,ot,N,nt,st,I,ve,pe,Ae,ne,H,at,rt,A,dt,se,X,je,U,it,B,ue,lt;return{c(){u=n("p"),b=r("TensorFlow models and layers in "),_=n("code"),m=r("transformers"),y=r(" accept two formats as input:"),i=l(),h=n("ul"),j=n("li"),Qe=r("having all inputs as keyword arguments (like PyTorch models), or"),Se=l(),Z=n("li"),ye=r("having all inputs as a list, tuple or dict in the first positional argument."),Y=l(),x=n("p"),Ye=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=n("code"),be=r("model.fit()"),_t=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),K=n("code"),L=r("model.fit()"),ze=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=n("code"),Ke=r("fit()"),le=r(" and "),ce=n("code"),et=r("predict()"),Ne=r(`, such as when creating your own layers or models with
the Keras `),q=n("code"),ee=r("Functional"),xe=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),O=l(),G=n("ul"),C=n("li"),tt=r("a single Tensor with "),te=n("code"),oe=r("input_ids"),ot=r(" only and nothing else: "),N=n("code"),nt=r("model(input_ids)"),st=l(),I=n("li"),ve=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=n("code"),Ae=r("model([input_ids, attention_mask])"),ne=r(" or "),H=n("code"),at=r("model([input_ids, attention_mask, token_type_ids])"),rt=l(),A=n("li"),dt=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),se=n("code"),X=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),je=l(),U=n("p"),it=r(`Note that when creating models and layers with
`),B=n("a"),ue=r("subclassing"),lt=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(F){u=s(F,"P",{});var P=a(u);b=d(P,"TensorFlow models and layers in "),_=s(P,"CODE",{});var Be=a(_);m=d(Be,"transformers"),Be.forEach(t),y=d(P," accept two formats as input:"),P.forEach(t),i=c(F),h=s(F,"UL",{});var Pe=a(h);j=s(Pe,"LI",{});var yt=a(j);Qe=d(yt,"having all inputs as keyword arguments (like PyTorch models), or"),yt.forEach(t),Se=c(Pe),Z=s(Pe,"LI",{});var Ve=a(Z);ye=d(Ve,"having all inputs as a list, tuple or dict in the first positional argument."),Ve.forEach(t),Pe.forEach(t),Y=c(F),x=s(F,"P",{});var E=a(x);Ye=d(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=s(E,"CODE",{});var ct=a(R);be=d(ct,"model.fit()"),ct.forEach(t),_t=d(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),K=s(E,"CODE",{});var jt=a(K);L=d(jt,"model.fit()"),jt.forEach(t),ze=d(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),ie=s(E,"CODE",{});var Pt=a(ie);Ke=d(Pt,"fit()"),Pt.forEach(t),le=d(E," and "),ce=s(E,"CODE",{});var Ee=a(ce);et=d(Ee,"predict()"),Ee.forEach(t),Ne=d(E,`, such as when creating your own layers or models with
the Keras `),q=s(E,"CODE",{});var pt=a(q);ee=d(pt,"Functional"),pt.forEach(t),xe=d(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),O=c(F),G=s(F,"UL",{});var D=a(G);C=s(D,"LI",{});var he=a(C);tt=d(he,"a single Tensor with "),te=s(he,"CODE",{});var ut=a(te);oe=d(ut,"input_ids"),ut.forEach(t),ot=d(he," only and nothing else: "),N=s(he,"CODE",{});var Et=a(N);nt=d(Et,"model(input_ids)"),Et.forEach(t),he.forEach(t),st=c(D),I=s(D,"LI",{});var ae=a(I);ve=d(ae,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=s(ae,"CODE",{});var me=a(pe);Ae=d(me,"model([input_ids, attention_mask])"),me.forEach(t),ne=d(ae," or "),H=s(ae,"CODE",{});var ke=a(H);at=d(ke,"model([input_ids, attention_mask, token_type_ids])"),ke.forEach(t),ae.forEach(t),rt=c(D),A=s(D,"LI",{});var Je=a(A);dt=d(Je,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),se=s(Je,"CODE",{});var Ge=a(se);X=d(Ge,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ge.forEach(t),Je.forEach(t),D.forEach(t),je=c(F),U=s(F,"P",{});var Ue=a(U);it=d(Ue,`Note that when creating models and layers with
`),B=s(Ue,"A",{href:!0,rel:!0});var ht=a(B);ue=d(ht,"subclassing"),ht.forEach(t),lt=d(Ue,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Ue.forEach(t),this.h()},h(){p(B,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(B,"rel","nofollow")},m(F,P){f(F,u,P),e(u,b),e(u,_),e(_,m),e(u,y),f(F,i,P),f(F,h,P),e(h,j),e(j,Qe),e(h,Se),e(h,Z),e(Z,ye),f(F,Y,P),f(F,x,P),e(x,Ye),e(x,R),e(R,be),e(x,_t),e(x,K),e(K,L),e(x,ze),e(x,ie),e(ie,Ke),e(x,le),e(x,ce),e(ce,et),e(x,Ne),e(x,q),e(q,ee),e(x,xe),f(F,O,P),f(F,G,P),e(G,C),e(C,tt),e(C,te),e(te,oe),e(C,ot),e(C,N),e(N,nt),e(G,st),e(G,I),e(I,ve),e(I,pe),e(pe,Ae),e(I,ne),e(I,H),e(H,at),e(G,rt),e(G,A),e(A,dt),e(A,se),e(se,X),f(F,je,P),f(F,U,P),e(U,it),e(U,B),e(B,ue),e(U,lt)},d(F){F&&t(u),F&&t(i),F&&t(h),F&&t(Y),F&&t(x),F&&t(O),F&&t(G),F&&t(je),F&&t(U)}}}function E_(z){let u,b,_,m,y;return{c(){u=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=r("Module"),y=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(h,"CODE",{});var j=a(_);m=d(j,"Module"),j.forEach(t),y=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){f(i,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(i){i&&t(u)}}}function J_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlBlZ2FzdXNGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMFRGUGVnYXN1c0ZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGcGVnYXN1cy14c3VtJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnBlZ2FzdXMteHN1bSUyMiklMEElMEFBUlRJQ0xFX1RPX1NVTU1BUklaRSUyMCUzRCUyMCglMEElMjAlMjAlMjAlMjAlMjJQRyUyNkUlMjBzdGF0ZWQlMjBpdCUyMHNjaGVkdWxlZCUyMHRoZSUyMGJsYWNrb3V0cyUyMGluJTIwcmVzcG9uc2UlMjB0byUyMGZvcmVjYXN0cyUyMGZvciUyMGhpZ2glMjB3aW5kcyUyMCUyMiUwQSUyMCUyMCUyMCUyMCUyMmFtaWQlMjBkcnklMjBjb25kaXRpb25zLiUyMFRoZSUyMGFpbSUyMGlzJTIwdG8lMjByZWR1Y2UlMjB0aGUlMjByaXNrJTIwb2YlMjB3aWxkZmlyZXMuJTIwTmVhcmx5JTIwODAwJTIwdGhvdXNhbmQlMjBjdXN0b21lcnMlMjB3ZXJlJTIwJTIyJTBBJTIwJTIwJTIwJTIwJTIyc2NoZWR1bGVkJTIwdG8lMjBiZSUyMGFmZmVjdGVkJTIwYnklMjB0aGUlMjBzaHV0b2ZmcyUyMHdoaWNoJTIwd2VyZSUyMGV4cGVjdGVkJTIwdG8lMjBsYXN0JTIwdGhyb3VnaCUyMGF0JTIwbGVhc3QlMjBtaWRkYXklMjB0b21vcnJvdy4lMjIlMEEpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKEFSVElDTEVfVE9fU1VNTUFSSVpFJTJDJTIwbWF4X2xlbmd0aCUzRDEwMjQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTIwU3VtbWFyeSUwQXN1bW1hcnlfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUoc3VtbWFyeV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFPegasusForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFPegasusForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/pegasus-xsum&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/pegasus-xsum&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;tf&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(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</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>))`}}),{c(){u=n("p"),b=r("Summarization example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Summarization example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function G_(z){let u,b,_,m,y;return{c(){u=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=r("Module"),y=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(h,"CODE",{});var j=a(_);m=d(j,"Module"),j.forEach(t),y=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){f(i,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(i){i&&t(u)}}}function U_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4UGVnYXN1c01vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGcGVnYXN1cy1sYXJnZSUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhQZWdhc3VzTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnBlZ2FzdXMtbGFyZ2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMmpheCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxPegasusModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){u=n("p"),b=r("Example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function C_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4UGVnYXN1c0ZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheFBlZ2FzdXNGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnBlZ2FzdXMtbGFyZ2UlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGcGVnYXN1cy1sYXJnZSUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjBtYXhfbGVuZ3RoJTNEMTAyNCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBZW5jb2Rlcl9vdXRwdXRzJTIwJTNEJTIwbW9kZWwuZW5jb2RlKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxPegasusForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, max_length=<span class="hljs-number">1024</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)`}}),{c(){u=n("p"),b=r("Example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function I_(z){let u,b,_,m,y;return m=new Fe({props:{code:"aW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEZsYXhQZWdhc3VzRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4UGVnYXN1c0ZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGcGVnYXN1cy1sYXJnZSUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZwZWdhc3VzLWxhcmdlJTIyKSUwQSUwQXRleHQlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUyQyUyMG1heF9sZW5ndGglM0QxMDI0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFlbmNvZGVyX291dHB1dHMlMjAlM0QlMjBtb2RlbC5lbmNvZGUoKippbnB1dHMpJTBBJTBBZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUyMCUzRCUyMG1vZGVsLmNvbmZpZy5kZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTBBZGVjb2Rlcl9pbnB1dF9pZHMlMjAlM0QlMjBqbnAub25lcygoaW5wdXRzLmlucHV0X2lkcy5zaGFwZSU1QjAlNUQlMkMlMjAxKSUyQyUyMGR0eXBlJTNEJTIyaTQlMjIpJTIwKiUyMGRlY29kZXJfc3RhcnRfdG9rZW5faWQlMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZGVjb2RlKGRlY29kZXJfaW5wdXRfaWRzJTJDJTIwZW5jb2Rlcl9vdXRwdXRzKSUwQWxhc3RfZGVjb2Rlcl9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxPegasusForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, max_length=<span class="hljs-number">1024</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_start_token_id = model.config.decoder_start_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = jnp.ones((inputs.input_ids.shape[<span class="hljs-number">0</span>], <span class="hljs-number">1</span>), dtype=<span class="hljs-string">&quot;i4&quot;</span>) * decoder_start_token_id

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.decode(decoder_input_ids, encoder_outputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_decoder_hidden_states = outputs.last_hidden_state`}}),{c(){u=n("p"),b=r("Example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function Z_(z){let u,b,_,m,y;return{c(){u=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=r("Module"),y=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(h,"CODE",{});var j=a(_);m=d(j,"Module"),j.forEach(t),y=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){f(i,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(i){i&&t(u)}}}function q_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4UGVnYXN1c0ZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheFBlZ2FzdXNGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCdnb29nbGUlMkZwZWdhc3VzLWxhcmdlJyklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCgnZ29vZ2xlJTJGcGVnYXN1cy1sYXJnZScpJTBBJTBBQVJUSUNMRV9UT19TVU1NQVJJWkUlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCQVJUSUNMRV9UT19TVU1NQVJJWkUlNUQlMkMlMjBtYXhfbGVuZ3RoJTNEMTAyNCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJ25wJyklMEElMEElMjMlMjBHZW5lcmF0ZSUyMFN1bW1hcnklMEFzdW1tYXJ5X2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QidpbnB1dF9pZHMnJTVEKS5zZXF1ZW5jZXMlMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHN1bW1hcnlfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNERmFsc2UpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python"><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxPegasusForConditionalGeneration</span>

<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">model = FlaxPegasusForConditionalGeneration.from_pretrained(<span class="hljs-string">&#x27;google/pegasus-large&#x27;</span>)</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&#x27;google/pegasus-large&#x27;</span>)</span>

<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">ARTICLE_TO_SUMMARIZE = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span></span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=<span class="hljs-number">1024</span>, return_tensors=<span class="hljs-string">&#x27;np&#x27;</span>)</span>

<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python"><span class="hljs-comment"># Generate Summary</span></span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">summary_ids = model.generate(inputs[<span class="hljs-string">&#x27;input_ids&#x27;</span>]).sequences</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python"><span class="hljs-built_in">print</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>`}}),{c(){u=n("p"),b=r("Summarization example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Summarization example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function W_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4UGVnYXN1c0ZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnBlZ2FzdXMtbGFyZ2UlMjIpJTBBVFhUJTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwJTNDbWFzayUzRSUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4UGVnYXN1c0ZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGcGVnYXN1cy1sYXJnZSUyMiklMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCVFhUJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEFsb2dpdHMlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMpLmxvZ2l0cyUwQSUwQW1hc2tlZF9pbmRleCUyMCUzRCUyMChpbnB1dF9pZHMlNUIwJTVEJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpLm5vbnplcm8oKS5pdGVtKCklMEFwcm9icyUyMCUzRCUyMGpheC5ubi5zb2Z0bWF4KGxvZ2l0cyU1QjAlMkMlMjBtYXNrZWRfaW5kZXglNUQlMkMlMjBheGlzJTNEMCklMEF2YWx1ZXMlMkMlMjBwcmVkaWN0aW9ucyUyMCUzRCUyMGpheC5sYXgudG9wX2socHJvYnMpJTBBJTBBdG9rZW5pemVyLmRlY29kZShwcmVkaWN0aW9ucykuc3BsaXQoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxPegasusForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/pegasus-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;My friends are &lt;mask&gt; but they eat too many carbs.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxPegasusForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/pegasus-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], return_tensors=<span class="hljs-string">&quot;np&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_ids).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>masked_index = (input_ids[<span class="hljs-number">0</span>] == tokenizer.mask_token_id).nonzero().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = jax.nn.softmax(logits[<span class="hljs-number">0</span>, masked_index], axis=<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>values, predictions = jax.lax.top_k(probs)

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predictions).split()`}}),{c(){u=n("p"),b=r("Mask filling example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Mask filling example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function S_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4UGVnYXN1c0ZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheFBlZ2FzdXNGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnBlZ2FzdXMtbGFyZ2UlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGcGVnYXN1cy1sYXJnZSUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjBtYXhfbGVuZ3RoJTNEMTAyNCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBZW5jb2Rlcl9vdXRwdXRzJTIwJTNEJTIwbW9kZWwuZW5jb2RlKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxPegasusForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, max_length=<span class="hljs-number">1024</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)`}}),{c(){u=n("p"),b=r("Example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function N_(z){let u,b,_,m,y;return m=new Fe({props:{code:"aW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEZsYXhQZWdhc3VzRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4UGVnYXN1c0ZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGcGVnYXN1cy1sYXJnZSUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZwZWdhc3VzLWxhcmdlJTIyKSUwQSUwQXRleHQlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUyQyUyMG1heF9sZW5ndGglM0QxMDI0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFlbmNvZGVyX291dHB1dHMlMjAlM0QlMjBtb2RlbC5lbmNvZGUoKippbnB1dHMpJTBBJTBBZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUyMCUzRCUyMG1vZGVsLmNvbmZpZy5kZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTBBZGVjb2Rlcl9pbnB1dF9pZHMlMjAlM0QlMjBqbnAub25lcygoaW5wdXRzLmlucHV0X2lkcy5zaGFwZSU1QjAlNUQlMkMlMjAxKSUyQyUyMGR0eXBlJTNEJTIyaTQlMjIpJTIwKiUyMGRlY29kZXJfc3RhcnRfdG9rZW5faWQlMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZGVjb2RlKGRlY29kZXJfaW5wdXRfaWRzJTJDJTIwZW5jb2Rlcl9vdXRwdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxPegasusForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, max_length=<span class="hljs-number">1024</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_start_token_id = model.config.decoder_start_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = jnp.ones((inputs.input_ids.shape[<span class="hljs-number">0</span>], <span class="hljs-number">1</span>), dtype=<span class="hljs-string">&quot;i4&quot;</span>) * decoder_start_token_id

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.decode(decoder_input_ids, encoder_outputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){u=n("p"),b=r("Example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:We,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function A_(z){let u,b,_,m,y,i,h,j,Qe,Se,Z,ye,Y,x,Ye,R,be,_t,K,L,ze,ie,Ke,le,ce,et,Ne,q,ee,xe,O,G,C,tt,te,oe,ot,N,nt,st,I,ve,pe,Ae,ne,H,at,rt,A,dt,se,X,je,U,it,B,ue,lt,F,P,Be,Pe,yt,Ve,E,ct,jt,Pt,Ee,pt,D,he,ut,Et,ae,me,ke,Je,Ge,Ue,ht,tl,Fd,bt,ol,mn,nl,sl,Za,al,rl,zd,Te,qa,dl,il,Wa,ll,cl,Sa,pl,ul,fn,hl,gn,ml,fl,gl,ao,_n,_l,yl,yn,bl,vl,xd,Jt,ro,Na,bn,kl,Aa,Tl,jd,vt,io,vn,wl,Ml,kn,$l,Fl,zl,Ba,xl,jl,Va,Pl,Pd,Gt,lo,Ra,Tn,El,Xa,Jl,Ed,we,La,Oa,Gl,Ul,Ha,ea,Cl,ta,Il,Zl,wn,Da,ql,Wl,Ut,Qa,Sl,Nl,Ya,Al,Bl,Mn,Vl,Ka,Rl,Xl,Ll,er,mt,Ol,tr,Hl,Dl,or,Ql,Yl,nr,Kl,ec,tc,sr,Ct,oc,$n,nc,sc,ar,ac,rc,Jd,It,co,rr,Fn,dc,dr,ic,Gd,zn,Ud,Zt,po,ir,xn,lc,lr,cc,Cd,kt,cr,oa,pc,uc,pr,na,hc,mc,ur,sa,fc,Id,qt,uo,hr,jn,gc,mr,_c,Zd,Ce,Pn,yc,Wt,bc,aa,vc,kc,En,Tc,wc,Mc,St,$c,ra,Fc,zc,da,xc,jc,Pc,ho,qd,Nt,mo,fr,Jn,Ec,gr,Jc,Wd,fo,Gc,_r,Uc,Cc,Sd,V,Gn,Ic,Un,Zc,Cn,qc,Wc,Sc,In,Nc,ia,Ac,Bc,Vc,Re,Zn,Rc,qn,Xc,yr,Lc,Oc,Hc,Wn,la,Dc,br,Qc,Yc,Sn,Kc,vr,ep,tp,op,kr,np,sp,go,Nn,ap,Tr,rp,dp,_o,An,ip,wr,lp,cp,yo,Bn,pp,Mr,up,Nd,At,bo,$r,Vn,hp,Fr,mp,Ad,fe,Rn,fp,Bt,gp,zr,_p,yp,Xn,bp,vp,kp,Ln,Tp,ca,wp,Mp,$p,Tt,On,Fp,xr,zp,xp,Hn,pa,jp,jr,Pp,Ep,Dn,Jp,Pr,Gp,Up,Cp,vo,Qn,Ip,Er,Zp,Bd,Vt,ko,Jr,Yn,qp,Gr,Wp,Vd,Ie,Kn,Sp,es,Np,ua,Ap,Bp,Vp,ts,Rp,os,Xp,Lp,Op,Xe,ns,Hp,Rt,Dp,ha,Qp,Yp,Ur,Kp,eu,tu,To,ou,wo,Rd,Xt,Mo,Cr,ss,nu,Ir,su,Xd,Ze,as,au,rs,ru,ma,du,iu,lu,ds,cu,is,pu,uu,hu,Le,ls,mu,Lt,fu,fa,gu,_u,Zr,yu,bu,vu,$o,ku,Fo,Ld,Ot,zo,qr,cs,Tu,Wr,wu,Od,Ht,ps,Mu,xo,us,$u,jo,Hd,Dt,Po,Sr,hs,Fu,Nr,zu,Dd,ge,ms,xu,fs,ju,ga,Pu,Eu,Ju,gs,Gu,_s,Uu,Cu,Iu,Eo,Zu,Oe,ys,qu,Qt,Wu,_a,Su,Nu,Ar,Au,Bu,Vu,Jo,Ru,Go,Qd,Yt,Uo,Br,bs,Xu,Vr,Lu,Yd,_e,vs,Ou,ks,Hu,ya,Du,Qu,Yu,Ts,Ku,ws,eh,th,oh,Co,nh,He,Ms,sh,Kt,ah,ba,rh,dh,Rr,ih,lh,ch,Io,ph,Zo,Kd,eo,qo,Xr,$s,uh,Lr,hh,ei,W,Fs,mh,zs,fh,va,gh,_h,yh,xs,bh,js,vh,kh,Th,Or,wh,Mh,ft,Hr,Ps,$h,Fh,Dr,Es,zh,xh,Qr,Js,jh,Ph,Yr,Gs,Eh,Jh,De,Us,Gh,to,Uh,Kr,Ch,Ih,ed,Zh,qh,Wh,Wo,Sh,So,Nh,No,Cs,Ah,Ao,Bh,Bo,Is,Vh,Vo,ti,oo,Ro,td,Zs,Rh,od,Xh,oi,S,qs,Lh,Ws,Oh,ka,Hh,Dh,Qh,Ss,Yh,Ns,Kh,em,tm,nd,om,nm,gt,sd,As,sm,am,ad,Bs,rm,dm,rd,Vs,im,lm,dd,Rs,cm,pm,Me,Xs,um,no,hm,id,mm,fm,ld,gm,_m,ym,Xo,bm,Lo,vm,Oo,km,Ho,Ls,Tm,Do,wm,Qo,Os,Mm,Yo,ni;return i=new Q({}),O=new Q({}),Ge=new Q({}),bn=new Q({}),Tn=new Q({}),Fn=new Q({}),zn=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBlZ2FzdXNGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMkMlMjBQZWdhc3VzVG9rZW5pemVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEFzcmNfdGV4dCUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMiUyMiUyMiUyMFBHJTI2RSUyMHN0YXRlZCUyMGl0JTIwc2NoZWR1bGVkJTIwdGhlJTIwYmxhY2tvdXRzJTIwaW4lMjByZXNwb25zZSUyMHRvJTIwZm9yZWNhc3RzJTIwZm9yJTIwaGlnaCUyMHdpbmRzJTIwYW1pZCUyMGRyeSUyMGNvbmRpdGlvbnMuJTIwVGhlJTIwYWltJTIwaXMlMjB0byUyMHJlZHVjZSUyMHRoZSUyMHJpc2slMjBvZiUyMHdpbGRmaXJlcy4lMjBOZWFybHklMjA4MDAlMjB0aG91c2FuZCUyMGN1c3RvbWVycyUyMHdlcmUlMjBzY2hlZHVsZWQlMjB0byUyMGJlJTIwYWZmZWN0ZWQlMjBieSUyMHRoZSUyMHNodXRvZmZzJTIwd2hpY2glMjB3ZXJlJTIwZXhwZWN0ZWQlMjB0byUyMGxhc3QlMjB0aHJvdWdoJTIwYXQlMjBsZWFzdCUyMG1pZGRheSUyMHRvbW9ycm93LiUyMiUyMiUyMiUwQSU1RCUwQSUwQW1vZGVsX25hbWUlMjAlM0QlMjAlMjJnb29nbGUlMkZwZWdhc3VzLXhzdW0lMjIlMEFkZXZpY2UlMjAlM0QlMjAlMjJjdWRhJTIyJTIwaWYlMjB0b3JjaC5jdWRhLmlzX2F2YWlsYWJsZSgpJTIwZWxzZSUyMCUyMmNwdSUyMiUwQXRva2VuaXplciUyMCUzRCUyMFBlZ2FzdXNUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX25hbWUpJTBBbW9kZWwlMjAlM0QlMjBQZWdhc3VzRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZChtb2RlbF9uYW1lKS50byhkZXZpY2UpJTBBYmF0Y2glMjAlM0QlMjB0b2tlbml6ZXIoc3JjX3RleHQlMkMlMjB0cnVuY2F0aW9uJTNEVHJ1ZSUyQyUyMHBhZGRpbmclM0QlMjJsb25nZXN0JTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oZGV2aWNlKSUwQXRyYW5zbGF0ZWQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmJhdGNoKSUwQXRndF90ZXh0JTIwJTNEJTIwdG9rZW5pemVyLmJhdGNoX2RlY29kZSh0cmFuc2xhdGVkJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTBBYXNzZXJ0JTIwKCUwQSUyMCUyMCUyMCUyMHRndF90ZXh0JTVCMCU1RCUwQSUyMCUyMCUyMCUyMCUzRCUzRCUyMCUyMkNhbGlmb3JuaWEncyUyMGxhcmdlc3QlMjBlbGVjdHJpY2l0eSUyMHByb3ZpZGVyJTIwaGFzJTIwdHVybmVkJTIwb2ZmJTIwcG93ZXIlMjB0byUyMGh1bmRyZWRzJTIwb2YlMjB0aG91c2FuZHMlMjBvZiUyMGN1c3RvbWVycy4lMjIlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PegasusForConditionalGeneration, PegasusTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>src_text = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&quot;&quot; PG&amp;E stated it scheduled the blackouts in response to forecasts for high winds amid dry conditions. The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were scheduled to be affected by the shutoffs which were expected to last through at least midday tomorrow.&quot;&quot;&quot;</span>
<span class="hljs-meta">... </span>]

<span class="hljs-meta">... </span>model_name = <span class="hljs-string">&quot;google/pegasus-xsum&quot;</span>
<span class="hljs-meta">... </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>
<span class="hljs-meta">... </span>tokenizer = PegasusTokenizer.from_pretrained(model_name)
<span class="hljs-meta">... </span>model = PegasusForConditionalGeneration.from_pretrained(model_name).to(device)
<span class="hljs-meta">... </span>batch = tokenizer(src_text, truncation=<span class="hljs-literal">True</span>, padding=<span class="hljs-string">&quot;longest&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device)
<span class="hljs-meta">... </span>translated = model.generate(**batch)
<span class="hljs-meta">... </span>tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-meta">... </span><span class="hljs-keyword">assert</span> (
<span class="hljs-meta">... </span>    tgt_text[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>    == <span class="hljs-string">&quot;California&#x27;s largest electricity provider has turned off power to hundreds of thousands of customers.&quot;</span>
<span class="hljs-meta">... </span>)`}}),xn=new Q({}),jn=new Q({}),Pn=new J({props:{name:"class transformers.PegasusConfig",anchor:"transformers.PegasusConfig",parameters:[{name:"vocab_size",val:" = 50265"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 12"},{name:"encoder_ffn_dim",val:" = 4096"},{name:"encoder_attention_heads",val:" = 16"},{name:"decoder_layers",val:" = 12"},{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:" = False"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"forced_eos_token_id",val:" = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PegasusConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the PEGASUS 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#transformers.PegasusModel">PegasusModel</a> or <a href="/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.TFPegasusModel">TFPegasusModel</a>.`,name:"vocab_size"},{anchor:"transformers.PegasusConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.PegasusConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.PegasusConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.PegasusConfig.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.PegasusConfig.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.PegasusConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.PegasusConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.PegasusConfig.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.PegasusConfig.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.PegasusConfig.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.PegasusConfig.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.PegasusConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#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.PegasusConfig.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.PegasusConfig.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.PegasusConfig.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.PegasusConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.PegasusConfig.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.PegasusConfig.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"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/configuration_pegasus.py#L29"}}),ho=new qe({props:{anchor:"transformers.PegasusConfig.example",$$slots:{default:[k_]},$$scope:{ctx:z}}}),Jn=new Q({}),Gn=new J({props:{name:"class transformers.PegasusTokenizer",anchor:"transformers.PegasusTokenizer",parameters:[{name:"vocab_file",val:""},{name:"pad_token",val:" = '<pad>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"mask_token",val:" = '<mask_2>'"},{name:"mask_token_sent",val:" = '<mask_1>'"},{name:"additional_special_tokens",val:" = None"},{name:"offset",val:" = 103"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PegasusTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.PegasusTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.PegasusTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.PegasusTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.PegasusTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask_2&gt;&quot;</code>) &#x2014;
The token used for masking single token values. This is the token used when training this model with masked
language modeling (MLM). This is the token that the PEGASUS encoder will try to predict during pretraining.
It corresponds to <em>[MASK2]</em> in <a href="https://arxiv.org/pdf/1912.08777.pdf" rel="nofollow">PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive
Summarization</a>.`,name:"mask_token"},{anchor:"transformers.PegasusTokenizer.mask_token_sent",description:`<strong>mask_token_sent</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask_1&gt;&quot;</code>) &#x2014;
The token used for masking whole target sentences. This is the token used when training this model with gap
sentences generation (GSG). This is the sentence that the PEGASUS decoder will try to predict during
pretraining. It corresponds to <em>[MASK1]</em> in <a href="https://arxiv.org/pdf/1912.08777.pdf" rel="nofollow">PEGASUS: Pre-training with Extracted Gap-sentences for
Abstractive Summarization</a>.`,name:"mask_token_sent"},{anchor:"transformers.PegasusTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Additional special tokens used by the tokenizer. If no additional_special_tokens are provided <mask_2> and
<unk_2, \u2026, unk_102> are used as additional special tokens corresponding to the <a href="https://github.com/google-research/pegasus/blob/939830367bcf411193d2b5eca2f2f90f3f9260ca/pegasus/ops/pretrain_parsing_ops.cc#L66" rel="nofollow">original PEGASUS
tokenizer</a>
that uses the tokens 2 - 104 only for pretraining</unk_2,></mask_2>`,name:"additional_special_tokens"},{anchor:"transformers.PegasusTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/tokenization_pegasus.py#L41"}}),Zn=new J({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.PegasusTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.PegasusTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.PegasusTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/tokenization_pegasus.py#L267",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Nn=new J({props:{name:"convert_tokens_to_string",anchor:"transformers.PegasusTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/tokenization_pegasus.py#L232"}}),An=new J({props:{name:"get_special_tokens_mask",anchor:"transformers.PegasusTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List"},{name:"token_ids_1",val:": typing.Optional[typing.List] = None"},{name:"already_has_special_tokens",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/tokenization_pegasus.py#L256"}}),Bn=new J({props:{name:"num_special_tokens_to_add",anchor:"transformers.PegasusTokenizer.num_special_tokens_to_add",parameters:[{name:"pair",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/tokenization_pegasus.py#L246"}}),Vn=new Q({}),Rn=new J({props:{name:"class transformers.PegasusTokenizerFast",anchor:"transformers.PegasusTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"pad_token",val:" = '<pad>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"mask_token",val:" = '<mask_2>'"},{name:"mask_token_sent",val:" = '<mask_1>'"},{name:"additional_special_tokens",val:" = None"},{name:"offset",val:" = 103"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PegasusTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.PegasusTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.PegasusTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.PegasusTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.PegasusTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask_2&gt;&quot;</code>) &#x2014;
The token used for masking single token values. This is the token used when training this model with masked
language modeling (MLM). This is the token that the PEGASUS encoder will try to predict during pretraining.
It corresponds to <em>[MASK2]</em> in <a href="https://arxiv.org/pdf/1912.08777.pdf" rel="nofollow">PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive
Summarization</a>.`,name:"mask_token"},{anchor:"transformers.PegasusTokenizerFast.mask_token_sent",description:`<strong>mask_token_sent</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask_1&gt;&quot;</code>) &#x2014;
The token used for masking whole target sentences. This is the token used when training this model with gap
sentences generation (GSG). This is the sentence that the PEGASUS decoder will try to predict during
pretraining. It corresponds to <em>[MASK1]</em> in <a href="https://arxiv.org/pdf/1912.08777.pdf" rel="nofollow">PEGASUS: Pre-training with Extracted Gap-sentences for
Abstractive Summarization</a>.`,name:"mask_token_sent"},{anchor:"transformers.PegasusTokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Additional special tokens used by the tokenizer. If no additional_special_tokens are provided <mask_2> and
<unk_2, \u2026, unk_102> are used as additional special tokens corresponding to the <a href="https://github.com/google-research/pegasus/blob/939830367bcf411193d2b5eca2f2f90f3f9260ca/pegasus/ops/pretrain_parsing_ops.cc#L66" rel="nofollow">original PEGASUS
tokenizer</a>
that uses the tokens 2 - 104 only for pretraining</unk_2,></mask_2>`,name:"additional_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/tokenization_pegasus_fast.py#L51"}}),On=new J({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.PegasusTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.PegasusTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added`,name:"token_ids_0"},{anchor:"transformers.PegasusTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/tokenization_pegasus_fast.py#L180",returnDescription:`
<p>list of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Qn=new J({props:{name:"get_special_tokens_mask",anchor:"transformers.PegasusTokenizerFast.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List"},{name:"token_ids_1",val:": typing.Optional[typing.List] = None"},{name:"already_has_special_tokens",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/tokenization_pegasus_fast.py#L169"}}),Yn=new Q({}),Kn=new J({props:{name:"class transformers.PegasusModel",anchor:"transformers.PegasusModel",parameters:[{name:"config",val:": PegasusConfig"}],parametersDescription:[{anchor:"transformers.PegasusModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusConfig">PegasusConfig</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/modeling_pegasus.py#L1158"}}),ns=new J({props:{name:"forward",anchor:"transformers.PegasusModel.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:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.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.PegasusModel.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.PegasusModel.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.PegasusModel.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 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.PegasusModel.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.PegasusModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PegasusModel.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.PegasusModel.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.PegasusModel.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.PegasusModel.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.PegasusModel.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.PegasusModel.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.PegasusModel.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.PegasusModel.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.PegasusModel.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/modeling_pegasus.py#L1210",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#transformers.PegasusConfig"
>PegasusConfig</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>
`}}),To=new hn({props:{$$slots:{default:[T_]},$$scope:{ctx:z}}}),wo=new qe({props:{anchor:"transformers.PegasusModel.forward.example",$$slots:{default:[w_]},$$scope:{ctx:z}}}),ss=new Q({}),as=new J({props:{name:"class transformers.PegasusForConditionalGeneration",anchor:"transformers.PegasusForConditionalGeneration",parameters:[{name:"config",val:": PegasusConfig"}],parametersDescription:[{anchor:"transformers.PegasusForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusConfig">PegasusConfig</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/modeling_pegasus.py#L1309"}}),ls=new J({props:{name:"forward",anchor:"transformers.PegasusForConditionalGeneration.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:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.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.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.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 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.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PegasusForConditionalGeneration.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.PegasusForConditionalGeneration.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.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.PegasusForConditionalGeneration.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/modeling_pegasus.py#L1372",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#transformers.PegasusConfig"
>PegasusConfig</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>
`}}),$o=new hn({props:{$$slots:{default:[M_]},$$scope:{ctx:z}}}),Fo=new qe({props:{anchor:"transformers.PegasusForConditionalGeneration.forward.example",$$slots:{default:[$_]},$$scope:{ctx:z}}}),cs=new Q({}),ps=new J({props:{name:"class transformers.PegasusForCausalLM",anchor:"transformers.PegasusForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/modeling_pegasus.py#L1511"}}),us=new J({props:{name:"forward",anchor:"transformers.PegasusForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.PegasusForCausalLM.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.PegasusForCausalLM.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.PegasusForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention
if the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.PegasusForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used
in the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:`,name:"encoder_attention_mask"},{anchor:"transformers.PegasusForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.PegasusForCausalLM.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.PegasusForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of
shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>. The two additional
tensors are only required when the model is used as a decoder in a Sequence to Sequence model.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
cross-attention blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those
that don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of
all <code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.PegasusForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.PegasusForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding
(see <code>past_key_values</code>).</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"use_cache"},{anchor:"transformers.PegasusForCausalLM.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.PegasusForCausalLM.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.PegasusForCausalLM.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/modeling_pegasus.py#L1566",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusConfig"
>PegasusConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),jo=new qe({props:{anchor:"transformers.PegasusForCausalLM.forward.example",$$slots:{default:[F_]},$$scope:{ctx:z}}}),hs=new Q({}),ms=new J({props:{name:"class transformers.TFPegasusModel",anchor:"transformers.TFPegasusModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFPegasusModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusConfig">PegasusConfig</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.TFPreTrainedModel.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/modeling_tf_pegasus.py#L1166"}}),Eo=new hn({props:{$$slots:{default:[z_]},$$scope:{ctx:z}}}),ys=new J({props:{name:"call",anchor:"transformers.TFPegasusModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_input_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"cross_attn_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_outputs",val:": Optional[Union[Tuple, TFBaseModelOutput]] = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFPegasusModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of 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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFPegasusModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.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.TFPegasusModel.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</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 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.TFPegasusModel.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFPegasusModel.call.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.TFPegasusModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFPegasusModel.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.TFPegasusModel.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.TFPegasusModel.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFPegasusModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFPegasusModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#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>). Set to <code>False</code> during training, <code>True</code> during generation output_attentions (<code>bool</code>,
<em>optional</em>): Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code>
under returned tensors for more detail. This argument can be used only in eager mode, in graph mode the
value in the config will be used instead.`,name:"use_cache"},{anchor:"transformers.TFPegasusModel.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFPegasusModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFPegasusModel.call.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. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFPegasusModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/modeling_tf_pegasus.py#L1178",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</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#transformers.PegasusConfig"
>PegasusConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</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>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder 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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Jo=new hn({props:{$$slots:{default:[x_]},$$scope:{ctx:z}}}),Go=new qe({props:{anchor:"transformers.TFPegasusModel.call.example",$$slots:{default:[j_]},$$scope:{ctx:z}}}),bs=new Q({}),vs=new J({props:{name:"class transformers.TFPegasusForConditionalGeneration",anchor:"transformers.TFPegasusForConditionalGeneration",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFPegasusForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusConfig">PegasusConfig</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.TFPreTrainedModel.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/modeling_tf_pegasus.py#L1271"}}),Co=new hn({props:{$$slots:{default:[P_]},$$scope:{ctx:z}}}),Ms=new J({props:{name:"call",anchor:"transformers.TFPegasusForConditionalGeneration.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_input_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"cross_attn_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_outputs",val:": Optional[TFBaseModelOutput] = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFPegasusForConditionalGeneration.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>) &#x2014;
Indices of 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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</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.TFPegasusForConditionalGeneration.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</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 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.TFPegasusForConditionalGeneration.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#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>). Set to <code>False</code> during training, <code>True</code> during generation output_attentions (<code>bool</code>,
<em>optional</em>): Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code>
under returned tensors for more detail. This argument can be used only in eager mode, in graph mode the
value in the config will be used instead.`,name:"use_cache"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.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. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFPegasusForConditionalGeneration.call.labels",description:`<strong>labels</strong> (<code>tf.tensor</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/modeling_tf_pegasus.py#L1309",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</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#transformers.PegasusConfig"
>PegasusConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder 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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Io=new hn({props:{$$slots:{default:[E_]},$$scope:{ctx:z}}}),Zo=new qe({props:{anchor:"transformers.TFPegasusForConditionalGeneration.call.example",$$slots:{default:[J_]},$$scope:{ctx:z}}}),$s=new Q({}),Fs=new J({props:{name:"class transformers.FlaxPegasusModel",anchor:"transformers.FlaxPegasusModel",parameters:[{name:"config",val:": PegasusConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxPegasusModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusConfig">PegasusConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxPegasusModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/modeling_flax_pegasus.py#L1227"}}),Us=new J({props:{name:"__call__",anchor:"transformers.FlaxPegasusModel.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxPegasusModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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.FlaxPegasusModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</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.FlaxPegasusModel.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</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>`,name:"decoder_input_ids"},{anchor:"transformers.FlaxPegasusModel.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxPegasusModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxPegasusModel.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxPegasusModel.__call__.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.FlaxPegasusModel.__call__.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.FlaxPegasusModel.__call__.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/modeling_flax_pegasus.py#L1162",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</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#transformers.PegasusConfig"
>PegasusConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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(jnp.ndarray))</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(jnp.ndarray)</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Wo=new hn({props:{$$slots:{default:[G_]},$$scope:{ctx:z}}}),So=new qe({props:{anchor:"transformers.FlaxPegasusModel.__call__.example",$$slots:{default:[U_]},$$scope:{ctx:z}}}),Cs=new J({props:{name:"encode",anchor:"transformers.FlaxPegasusModel.encode",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = 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"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxPegasusModel.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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.FlaxPegasusModel.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</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.FlaxPegasusModel.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxPegasusModel.encode.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.FlaxPegasusModel.encode.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.FlaxPegasusModel.encode.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/modeling_flax_pegasus.py#L985",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</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 (<code>&lt;class 'transformers.models.pegasus.configuration_pegasus.PegasusConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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 model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ao=new qe({props:{anchor:"transformers.FlaxPegasusModel.encode.example",$$slots:{default:[C_]},$$scope:{ctx:z}}}),Is=new J({props:{name:"decode",anchor:"transformers.FlaxPegasusModel.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = None"},{name:"past_key_values",val:": dict = 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"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxPegasusModel.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#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>`,name:"decoder_input_ids"},{anchor:"transformers.FlaxPegasusModel.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#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.FlaxPegasusModel.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</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:"encoder_attention_mask"},{anchor:"transformers.FlaxPegasusModel.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxPegasusModel.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxPegasusModel.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxPegasusModel.decode.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.FlaxPegasusModel.decode.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.FlaxPegasusModel.decode.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/modeling_flax_pegasus.py#L1048",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</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 (<code>&lt;class 'transformers.models.pegasus.configuration_pegasus.PegasusConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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 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(jnp.ndarray))</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(jnp.ndarray)</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 optionally if
<code>config.is_encoder_decoder=True</code> 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 optionally if
<code>config.is_encoder_decoder=True</code> 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>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Vo=new qe({props:{anchor:"transformers.FlaxPegasusModel.decode.example",$$slots:{default:[I_]},$$scope:{ctx:z}}}),Zs=new Q({}),qs=new J({props:{name:"class transformers.FlaxPegasusForConditionalGeneration",anchor:"transformers.FlaxPegasusForConditionalGeneration",parameters:[{name:"config",val:": PegasusConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxPegasusForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusConfig">PegasusConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/pegasus/modeling_flax_pegasus.py#L1312"}}),Xs=new J({props:{name:"__call__",anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = 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"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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.FlaxPegasusForConditionalGeneration.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</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.FlaxPegasusForConditionalGeneration.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</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>`,name:"decoder_input_ids"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__.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.FlaxPegasusForConditionalGeneration.__call__.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.FlaxPegasusForConditionalGeneration.__call__.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/modeling_flax_pegasus.py#L1162",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</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#transformers.PegasusConfig"
>PegasusConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray))</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(jnp.ndarray)</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xo=new hn({props:{$$slots:{default:[Z_]},$$scope:{ctx:z}}}),Lo=new qe({props:{anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__.example",$$slots:{default:[q_]},$$scope:{ctx:z}}}),Oo=new qe({props:{anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__.example-2",$$slots:{default:[W_]},$$scope:{ctx:z}}}),Ls=new J({props:{name:"encode",anchor:"transformers.FlaxPegasusForConditionalGeneration.encode",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = 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"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxPegasusForConditionalGeneration.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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.FlaxPegasusForConditionalGeneration.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</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.FlaxPegasusForConditionalGeneration.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.encode.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.FlaxPegasusForConditionalGeneration.encode.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.FlaxPegasusForConditionalGeneration.encode.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/modeling_flax_pegasus.py#L985",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</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 (<code>&lt;class 'transformers.models.pegasus.configuration_pegasus.PegasusConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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 model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Do=new qe({props:{anchor:"transformers.FlaxPegasusForConditionalGeneration.encode.example",$$slots:{default:[S_]},$$scope:{ctx:z}}}),Os=new J({props:{name:"decode",anchor:"transformers.FlaxPegasusForConditionalGeneration.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = None"},{name:"past_key_values",val:": dict = 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"},{name:"deterministic",val:": bool = True"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxPegasusForConditionalGeneration.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#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>`,name:"decoder_input_ids"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#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.FlaxPegasusForConditionalGeneration.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</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:"encoder_attention_mask"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxPegasusForConditionalGeneration.decode.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.FlaxPegasusForConditionalGeneration.decode.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.FlaxPegasusForConditionalGeneration.decode.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/modeling_flax_pegasus.py#L1316",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</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 (<code>&lt;class 'transformers.models.pegasus.configuration_pegasus.PegasusConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</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>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Yo=new qe({props:{anchor:"transformers.FlaxPegasusForConditionalGeneration.decode.example",$$slots:{default:[N_]},$$scope:{ctx:z}}}),{c(){u=n("meta"),b=l(),_=n("h1"),m=n("a"),y=n("span"),v(i.$$.fragment),h=l(),j=n("span"),Qe=r("Pegasus"),Se=l(),Z=n("div"),ye=n("a"),Y=n("img"),Ye=l(),R=n("a"),be=n("img"),K=l(),L=n("p"),ze=n("strong"),ie=r("DISCLAIMER:"),Ke=r(" If you see something strange, file a "),le=n("a"),ce=r("Github Issue"),et=r(`
and assign @patrickvonplaten.`),Ne=l(),q=n("h2"),ee=n("a"),xe=n("span"),v(O.$$.fragment),G=l(),C=n("span"),tt=r("Overview"),te=l(),oe=n("p"),ot=r("The Pegasus model was proposed in "),N=n("a"),nt=r("PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization"),st=r(" by Jingqing Zhang, Yao Zhao, Mohammad Saleh and Peter J. Liu on Dec 18, 2019."),I=l(),ve=n("p"),pe=r("According to the abstract,"),Ae=l(),ne=n("ul"),H=n("li"),at=r(`Pegasus\u2019 pretraining task is intentionally similar to summarization: important sentences are removed/masked from an
input document and are generated together as one output sequence from the remaining sentences, similar to an
extractive summary.`),rt=l(),A=n("li"),dt=r("Pegasus achieves SOTA summarization performance on all 12 downstream tasks, as measured by ROUGE and human eval."),se=l(),X=n("p"),je=r("This model was contributed by "),U=n("a"),it=r("sshleifer"),B=r(". The Authors\u2019 code can be found "),ue=n("a"),lt=r("here"),F=r("."),P=l(),Be=n("p"),Pe=r("Tips:"),yt=l(),Ve=n("ul"),E=n("li"),ct=n("p"),jt=r("Sequence-to-sequence model with the same encoder-decoder model architecture as BART. Pegasus is pre-trained jointly on two self-supervised objective functions: Masked Language Modeling (MLM) and a novel summarization specific pretraining objective, called Gap Sentence Generation (GSG)."),Pt=l(),Ee=n("ul"),pt=n("li"),D=r("MLM: encoder input tokens are randomly replaced by a mask tokens and have to be predicted by the encoder (like in BERT)"),he=l(),ut=n("li"),Et=r("GSG: whole encoder input sentences are replaced by a second mask token and fed to the decoder, but which has a causal mask to hide the future words like a regular auto-regressive transformer decoder."),ae=l(),me=n("h2"),ke=n("a"),Je=n("span"),v(Ge.$$.fragment),Ue=l(),ht=n("span"),tl=r("Checkpoints"),Fd=l(),bt=n("p"),ol=r("All the "),mn=n("a"),nl=r("checkpoints"),sl=r(` are fine-tuned for summarization, besides
`),Za=n("em"),al=r("pegasus-large"),rl=r(", whence the other checkpoints are fine-tuned:"),zd=l(),Te=n("ul"),qa=n("li"),dl=r("Each checkpoint is 2.2 GB on disk and 568M parameters."),il=l(),Wa=n("li"),ll=r("FP16 is not supported (help/ideas on this appreciated!)."),cl=l(),Sa=n("li"),pl=r("Summarizing xsum in fp32 takes about 400ms/sample, with default parameters on a v100 GPU."),ul=l(),fn=n("li"),hl=r("Full replication results and correctly pre-processed data can be found in this "),gn=n("a"),ml=r("Issue"),fl=r("."),gl=l(),ao=n("li"),_n=n("a"),_l=r("Distilled checkpoints"),yl=r(" are described in this "),yn=n("a"),bl=r("paper"),vl=r("."),xd=l(),Jt=n("h3"),ro=n("a"),Na=n("span"),v(bn.$$.fragment),kl=l(),Aa=n("span"),Tl=r("Examples"),jd=l(),vt=n("ul"),io=n("li"),vn=n("a"),wl=r("Script"),Ml=r(` to fine-tune pegasus
on the XSUM dataset. Data download instructions at `),kn=n("a"),$l=r("examples/pytorch/summarization/"),Fl=r("."),zl=l(),Ba=n("li"),xl=r("FP16 is not supported (help/ideas on this appreciated!)."),jl=l(),Va=n("li"),Pl=r("The adafactor optimizer is recommended for pegasus fine-tuning."),Pd=l(),Gt=n("h2"),lo=n("a"),Ra=n("span"),v(Tn.$$.fragment),El=l(),Xa=n("span"),Jl=r("Implementation Notes"),Ed=l(),we=n("ul"),La=n("li"),Oa=n("p"),Gl=r("All models are transformer encoder-decoders with 16 layers in each component."),Ul=l(),Ha=n("li"),ea=n("p"),Cl=r("The implementation is completely inherited from "),ta=n("a"),Il=r("BartForConditionalGeneration"),Zl=l(),wn=n("li"),Da=n("p"),ql=r("Some key configuration differences:"),Wl=l(),Ut=n("ul"),Qa=n("li"),Sl=r("static, sinusoidal position embeddings"),Nl=l(),Ya=n("li"),Al=r("the model starts generating with pad_token_id (which has 0 token_embedding) as the prefix."),Bl=l(),Mn=n("li"),Vl=r("more beams are used ("),Ka=n("code"),Rl=r("num_beams=8"),Xl=r(")"),Ll=l(),er=n("li"),mt=n("p"),Ol=r("All pretrained pegasus checkpoints are the same besides three attributes: "),tr=n("code"),Hl=r("tokenizer.model_max_length"),Dl=r(` (maximum
input size), `),or=n("code"),Ql=r("max_length"),Yl=r(" (the maximum number of tokens to generate) and "),nr=n("code"),Kl=r("length_penalty"),ec=r("."),tc=l(),sr=n("li"),Ct=n("p"),oc=r("The code to convert checkpoints trained in the author\u2019s "),$n=n("a"),nc=r("repo"),sc=r(` can be
found in `),ar=n("code"),ac=r("convert_pegasus_tf_to_pytorch.py"),rc=r("."),Jd=l(),It=n("h2"),co=n("a"),rr=n("span"),v(Fn.$$.fragment),dc=l(),dr=n("span"),ic=r("Usage Example"),Gd=l(),v(zn.$$.fragment),Ud=l(),Zt=n("h2"),po=n("a"),ir=n("span"),v(xn.$$.fragment),lc=l(),lr=n("span"),cc=r("Documentation resources"),Cd=l(),kt=n("ul"),cr=n("li"),oa=n("a"),pc=r("Causal language modeling task guide"),uc=l(),pr=n("li"),na=n("a"),hc=r("Translation task guide"),mc=l(),ur=n("li"),sa=n("a"),fc=r("Summarization task guide"),Id=l(),qt=n("h2"),uo=n("a"),hr=n("span"),v(jn.$$.fragment),gc=l(),mr=n("span"),_c=r("PegasusConfig"),Zd=l(),Ce=n("div"),v(Pn.$$.fragment),yc=l(),Wt=n("p"),bc=r("This is the configuration class to store the configuration of a "),aa=n("a"),vc=r("PegasusModel"),kc=r(`. It is used to instantiate an
PEGASUS 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
`),En=n("a"),Tc=r("google/pegasus-large"),wc=r(" architecture."),Mc=l(),St=n("p"),$c=r("Configuration objects inherit from "),ra=n("a"),Fc=r("PretrainedConfig"),zc=r(` and can be used to control the model outputs. Read the
documentation from `),da=n("a"),xc=r("PretrainedConfig"),jc=r(" for more information."),Pc=l(),v(ho.$$.fragment),qd=l(),Nt=n("h2"),mo=n("a"),fr=n("span"),v(Jn.$$.fragment),Ec=l(),gr=n("span"),Jc=r("PegasusTokenizer"),Wd=l(),fo=n("p"),Gc=r("warning: "),_r=n("code"),Uc=r("add_tokens"),Cc=r(" does not work at the moment."),Sd=l(),V=n("div"),v(Gn.$$.fragment),Ic=l(),Un=n("p"),Zc=r("Construct a PEGASUS tokenizer. Based on "),Cn=n("a"),qc=r("SentencePiece"),Wc=r("."),Sc=l(),In=n("p"),Nc=r("This tokenizer inherits from "),ia=n("a"),Ac=r("PreTrainedTokenizer"),Bc=r(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Vc=l(),Re=n("div"),v(Zn.$$.fragment),Rc=l(),qn=n("p"),Xc=r(`Build model inputs from a sequence or a pair of sequences for sequence classification tasks by concatenating
and adding special tokens. A PEGASUS sequence has the following format, where `),yr=n("code"),Lc=r("X"),Oc=r(" represents the sequence:"),Hc=l(),Wn=n("ul"),la=n("li"),Dc=r("single sequence: "),br=n("code"),Qc=r("X </s>"),Yc=l(),Sn=n("li"),Kc=r("pair of sequences: "),vr=n("code"),ep=r("A B </s>"),tp=r(" (not intended use)"),op=l(),kr=n("p"),np=r(`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),sp=l(),go=n("div"),v(Nn.$$.fragment),ap=l(),Tr=n("p"),rp=r("Converts a sequence of tokens (string) in a single string."),dp=l(),_o=n("div"),v(An.$$.fragment),ip=l(),wr=n("p"),lp=r("Get list where entries are [1] if a token is [eos] or [pad] else 0."),cp=l(),yo=n("div"),v(Bn.$$.fragment),pp=l(),Mr=n("p"),up=r("Just EOS"),Nd=l(),At=n("h2"),bo=n("a"),$r=n("span"),v(Vn.$$.fragment),hp=l(),Fr=n("span"),mp=r("PegasusTokenizerFast"),Ad=l(),fe=n("div"),v(Rn.$$.fragment),fp=l(),Bt=n("p"),gp=r("Construct a \u201Cfast\u201D PEGASUS tokenizer (backed by HuggingFace\u2019s "),zr=n("em"),_p=r("tokenizers"),yp=r(` library). Based on
`),Xn=n("a"),bp=r("Unigram"),vp=r("."),kp=l(),Ln=n("p"),Tp=r("This tokenizer inherits from "),ca=n("a"),wp=r("PreTrainedTokenizerFast"),Mp=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),$p=l(),Tt=n("div"),v(On.$$.fragment),Fp=l(),xr=n("p"),zp=r("Build model inputs from a sequence by adding eos to the end. no bos token is added to the front."),xp=l(),Hn=n("ul"),pa=n("li"),jp=r("single sequence: "),jr=n("code"),Pp=r("X </s>"),Ep=l(),Dn=n("li"),Jp=r("pair of sequences: "),Pr=n("code"),Gp=r("A B </s>"),Up=r(" (not intended use)"),Cp=l(),vo=n("div"),v(Qn.$$.fragment),Ip=l(),Er=n("p"),Zp=r("Get list where entries are [1] if a token is [eos] or [pad] else 0."),Bd=l(),Vt=n("h2"),ko=n("a"),Jr=n("span"),v(Yn.$$.fragment),qp=l(),Gr=n("span"),Wp=r("PegasusModel"),Vd=l(),Ie=n("div"),v(Kn.$$.fragment),Sp=l(),es=n("p"),Np=r(`The bare PEGASUS Model outputting raw hidden-states without any specific head on top.
This model inherits from `),ua=n("a"),Ap=r("PreTrainedModel"),Bp=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Vp=l(),ts=n("p"),Rp=r("This model is also a PyTorch "),os=n("a"),Xp=r("torch.nn.Module"),Lp=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Op=l(),Xe=n("div"),v(ns.$$.fragment),Hp=l(),Rt=n("p"),Dp=r("The "),ha=n("a"),Qp=r("PegasusModel"),Yp=r(" forward method, overrides the "),Ur=n("code"),Kp=r("__call__"),eu=r(" special method."),tu=l(),v(To.$$.fragment),ou=l(),v(wo.$$.fragment),Rd=l(),Xt=n("h2"),Mo=n("a"),Cr=n("span"),v(ss.$$.fragment),nu=l(),Ir=n("span"),su=r("PegasusForConditionalGeneration"),Xd=l(),Ze=n("div"),v(as.$$.fragment),au=l(),rs=n("p"),ru=r(`The PEGASUS Model with a language modeling head. Can be used for summarization.
This model inherits from `),ma=n("a"),du=r("PreTrainedModel"),iu=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),lu=l(),ds=n("p"),cu=r("This model is also a PyTorch "),is=n("a"),pu=r("torch.nn.Module"),uu=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hu=l(),Le=n("div"),v(ls.$$.fragment),mu=l(),Lt=n("p"),fu=r("The "),fa=n("a"),gu=r("PegasusForConditionalGeneration"),_u=r(" forward method, overrides the "),Zr=n("code"),yu=r("__call__"),bu=r(" special method."),vu=l(),v($o.$$.fragment),ku=l(),v(Fo.$$.fragment),Ld=l(),Ot=n("h2"),zo=n("a"),qr=n("span"),v(cs.$$.fragment),Tu=l(),Wr=n("span"),wu=r("PegasusForCausalLM"),Od=l(),Ht=n("div"),v(ps.$$.fragment),Mu=l(),xo=n("div"),v(us.$$.fragment),$u=l(),v(jo.$$.fragment),Hd=l(),Dt=n("h2"),Po=n("a"),Sr=n("span"),v(hs.$$.fragment),Fu=l(),Nr=n("span"),zu=r("TFPegasusModel"),Dd=l(),ge=n("div"),v(ms.$$.fragment),xu=l(),fs=n("p"),ju=r(`The bare PEGASUS Model outputting raw hidden-states without any specific head on top.
This model inherits from `),ga=n("a"),Pu=r("TFPreTrainedModel"),Eu=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ju=l(),gs=n("p"),Gu=r("This model is also a "),_s=n("a"),Uu=r("tf.keras.Model"),Cu=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Iu=l(),v(Eo.$$.fragment),Zu=l(),Oe=n("div"),v(ys.$$.fragment),qu=l(),Qt=n("p"),Wu=r("The "),_a=n("a"),Su=r("TFPegasusModel"),Nu=r(" forward method, overrides the "),Ar=n("code"),Au=r("__call__"),Bu=r(" special method."),Vu=l(),v(Jo.$$.fragment),Ru=l(),v(Go.$$.fragment),Qd=l(),Yt=n("h2"),Uo=n("a"),Br=n("span"),v(bs.$$.fragment),Xu=l(),Vr=n("span"),Lu=r("TFPegasusForConditionalGeneration"),Yd=l(),_e=n("div"),v(vs.$$.fragment),Ou=l(),ks=n("p"),Hu=r(`The PEGASUS Model with a language modeling head. Can be used for summarization.
This model inherits from `),ya=n("a"),Du=r("TFPreTrainedModel"),Qu=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Yu=l(),Ts=n("p"),Ku=r("This model is also a "),ws=n("a"),eh=r("tf.keras.Model"),th=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),oh=l(),v(Co.$$.fragment),nh=l(),He=n("div"),v(Ms.$$.fragment),sh=l(),Kt=n("p"),ah=r("The "),ba=n("a"),rh=r("TFPegasusForConditionalGeneration"),dh=r(" forward method, overrides the "),Rr=n("code"),ih=r("__call__"),lh=r(" special method."),ch=l(),v(Io.$$.fragment),ph=l(),v(Zo.$$.fragment),Kd=l(),eo=n("h2"),qo=n("a"),Xr=n("span"),v($s.$$.fragment),uh=l(),Lr=n("span"),hh=r("FlaxPegasusModel"),ei=l(),W=n("div"),v(Fs.$$.fragment),mh=l(),zs=n("p"),fh=r(`The bare Pegasus Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),va=n("a"),gh=r("FlaxPreTrainedModel"),_h=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),yh=l(),xs=n("p"),bh=r(`This model is also a Flax Linen
`),js=n("a"),vh=r("flax.nn.Module"),kh=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Th=l(),Or=n("p"),wh=r("Finally, this model supports inherent JAX features such as:"),Mh=l(),ft=n("ul"),Hr=n("li"),Ps=n("a"),$h=r("Just-In-Time (JIT) compilation"),Fh=l(),Dr=n("li"),Es=n("a"),zh=r("Automatic Differentiation"),xh=l(),Qr=n("li"),Js=n("a"),jh=r("Vectorization"),Ph=l(),Yr=n("li"),Gs=n("a"),Eh=r("Parallelization"),Jh=l(),De=n("div"),v(Us.$$.fragment),Gh=l(),to=n("p"),Uh=r("The "),Kr=n("code"),Ch=r("FlaxPegasusPreTrainedModel"),Ih=r(" forward method, overrides the "),ed=n("code"),Zh=r("__call__"),qh=r(" special method."),Wh=l(),v(Wo.$$.fragment),Sh=l(),v(So.$$.fragment),Nh=l(),No=n("div"),v(Cs.$$.fragment),Ah=l(),v(Ao.$$.fragment),Bh=l(),Bo=n("div"),v(Is.$$.fragment),Vh=l(),v(Vo.$$.fragment),ti=l(),oo=n("h2"),Ro=n("a"),td=n("span"),v(Zs.$$.fragment),Rh=l(),od=n("span"),Xh=r("FlaxPegasusForConditionalGeneration"),oi=l(),S=n("div"),v(qs.$$.fragment),Lh=l(),Ws=n("p"),Oh=r(`The PEGASUS Model with a language modeling head. Can be used for summarization.
This model inherits from `),ka=n("a"),Hh=r("FlaxPreTrainedModel"),Dh=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Qh=l(),Ss=n("p"),Yh=r(`This model is also a Flax Linen
`),Ns=n("a"),Kh=r("flax.nn.Module"),em=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),tm=l(),nd=n("p"),om=r("Finally, this model supports inherent JAX features such as:"),nm=l(),gt=n("ul"),sd=n("li"),As=n("a"),sm=r("Just-In-Time (JIT) compilation"),am=l(),ad=n("li"),Bs=n("a"),rm=r("Automatic Differentiation"),dm=l(),rd=n("li"),Vs=n("a"),im=r("Vectorization"),lm=l(),dd=n("li"),Rs=n("a"),cm=r("Parallelization"),pm=l(),Me=n("div"),v(Xs.$$.fragment),um=l(),no=n("p"),hm=r("The "),id=n("code"),mm=r("FlaxPegasusPreTrainedModel"),fm=r(" forward method, overrides the "),ld=n("code"),gm=r("__call__"),_m=r(" special method."),ym=l(),v(Xo.$$.fragment),bm=l(),v(Lo.$$.fragment),vm=l(),v(Oo.$$.fragment),km=l(),Ho=n("div"),v(Ls.$$.fragment),Tm=l(),v(Do.$$.fragment),wm=l(),Qo=n("div"),v(Os.$$.fragment),Mm=l(),v(Yo.$$.fragment),this.h()},l(o){const g=b_('[data-svelte="svelte-1phssyn"]',document.head);u=s(g,"META",{name:!0,content:!0}),g.forEach(t),b=c(o),_=s(o,"H1",{class:!0});var Hs=a(_);m=s(Hs,"A",{id:!0,class:!0,href:!0});var cd=a(m);y=s(cd,"SPAN",{});var pd=a(y);k(i.$$.fragment,pd),pd.forEach(t),cd.forEach(t),h=c(Hs),j=s(Hs,"SPAN",{});var ud=a(j);Qe=d(ud,"Pegasus"),ud.forEach(t),Hs.forEach(t),Se=c(o),Z=s(o,"DIV",{class:!0});var Ds=a(Z);ye=s(Ds,"A",{href:!0});var hd=a(ye);Y=s(hd,"IMG",{alt:!0,src:!0}),hd.forEach(t),Ye=c(Ds),R=s(Ds,"A",{href:!0});var md=a(R);be=s(md,"IMG",{alt:!0,src:!0}),md.forEach(t),Ds.forEach(t),K=c(o),L=s(o,"P",{});var Ko=a(L);ze=s(Ko,"STRONG",{});var fd=a(ze);ie=d(fd,"DISCLAIMER:"),fd.forEach(t),Ke=d(Ko," If you see something strange, file a "),le=s(Ko,"A",{href:!0,rel:!0});var gd=a(le);ce=d(gd,"Github Issue"),gd.forEach(t),et=d(Ko,`
and assign @patrickvonplaten.`),Ko.forEach(t),Ne=c(o),q=s(o,"H2",{class:!0});var Qs=a(q);ee=s(Qs,"A",{id:!0,class:!0,href:!0});var _d=a(ee);xe=s(_d,"SPAN",{});var yd=a(xe);k(O.$$.fragment,yd),yd.forEach(t),_d.forEach(t),G=c(Qs),C=s(Qs,"SPAN",{});var bd=a(C);tt=d(bd,"Overview"),bd.forEach(t),Qs.forEach(t),te=c(o),oe=s(o,"P",{});var Ys=a(oe);ot=d(Ys,"The Pegasus model was proposed in "),N=s(Ys,"A",{href:!0,rel:!0});var vd=a(N);nt=d(vd,"PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization"),vd.forEach(t),st=d(Ys," by Jingqing Zhang, Yao Zhao, Mohammad Saleh and Peter J. Liu on Dec 18, 2019."),Ys.forEach(t),I=c(o),ve=s(o,"P",{});var kd=a(ve);pe=d(kd,"According to the abstract,"),kd.forEach(t),Ae=c(o),ne=s(o,"UL",{});var Ks=a(ne);H=s(Ks,"LI",{});var Td=a(H);at=d(Td,`Pegasus\u2019 pretraining task is intentionally similar to summarization: important sentences are removed/masked from an
input document and are generated together as one output sequence from the remaining sentences, similar to an
extractive summary.`),Td.forEach(t),rt=c(Ks),A=s(Ks,"LI",{});var wd=a(A);dt=d(wd,"Pegasus achieves SOTA summarization performance on all 12 downstream tasks, as measured by ROUGE and human eval."),wd.forEach(t),Ks.forEach(t),se=c(o),X=s(o,"P",{});var so=a(X);je=d(so,"This model was contributed by "),U=s(so,"A",{href:!0,rel:!0});var xm=a(U);it=d(xm,"sshleifer"),xm.forEach(t),B=d(so,". The Authors\u2019 code can be found "),ue=s(so,"A",{href:!0,rel:!0});var jm=a(ue);lt=d(jm,"here"),jm.forEach(t),F=d(so,"."),so.forEach(t),P=c(o),Be=s(o,"P",{});var Pm=a(Be);Pe=d(Pm,"Tips:"),Pm.forEach(t),yt=c(o),Ve=s(o,"UL",{});var Em=a(Ve);E=s(Em,"LI",{});var si=a(E);ct=s(si,"P",{});var Jm=a(ct);jt=d(Jm,"Sequence-to-sequence model with the same encoder-decoder model architecture as BART. Pegasus is pre-trained jointly on two self-supervised objective functions: Masked Language Modeling (MLM) and a novel summarization specific pretraining objective, called Gap Sentence Generation (GSG)."),Jm.forEach(t),Pt=c(si),Ee=s(si,"UL",{});var ai=a(Ee);pt=s(ai,"LI",{});var Gm=a(pt);D=d(Gm,"MLM: encoder input tokens are randomly replaced by a mask tokens and have to be predicted by the encoder (like in BERT)"),Gm.forEach(t),he=c(ai),ut=s(ai,"LI",{});var Um=a(ut);Et=d(Um,"GSG: whole encoder input sentences are replaced by a second mask token and fed to the decoder, but which has a causal mask to hide the future words like a regular auto-regressive transformer decoder."),Um.forEach(t),ai.forEach(t),si.forEach(t),Em.forEach(t),ae=c(o),me=s(o,"H2",{class:!0});var ri=a(me);ke=s(ri,"A",{id:!0,class:!0,href:!0});var Cm=a(ke);Je=s(Cm,"SPAN",{});var Im=a(Je);k(Ge.$$.fragment,Im),Im.forEach(t),Cm.forEach(t),Ue=c(ri),ht=s(ri,"SPAN",{});var Zm=a(ht);tl=d(Zm,"Checkpoints"),Zm.forEach(t),ri.forEach(t),Fd=c(o),bt=s(o,"P",{});var Ta=a(bt);ol=d(Ta,"All the "),mn=s(Ta,"A",{href:!0,rel:!0});var qm=a(mn);nl=d(qm,"checkpoints"),qm.forEach(t),sl=d(Ta,` are fine-tuned for summarization, besides
`),Za=s(Ta,"EM",{});var Wm=a(Za);al=d(Wm,"pegasus-large"),Wm.forEach(t),rl=d(Ta,", whence the other checkpoints are fine-tuned:"),Ta.forEach(t),zd=c(o),Te=s(o,"UL",{});var wt=a(Te);qa=s(wt,"LI",{});var Sm=a(qa);dl=d(Sm,"Each checkpoint is 2.2 GB on disk and 568M parameters."),Sm.forEach(t),il=c(wt),Wa=s(wt,"LI",{});var Nm=a(Wa);ll=d(Nm,"FP16 is not supported (help/ideas on this appreciated!)."),Nm.forEach(t),cl=c(wt),Sa=s(wt,"LI",{});var Am=a(Sa);pl=d(Am,"Summarizing xsum in fp32 takes about 400ms/sample, with default parameters on a v100 GPU."),Am.forEach(t),ul=c(wt),fn=s(wt,"LI",{});var di=a(fn);hl=d(di,"Full replication results and correctly pre-processed data can be found in this "),gn=s(di,"A",{href:!0,rel:!0});var Bm=a(gn);ml=d(Bm,"Issue"),Bm.forEach(t),fl=d(di,"."),di.forEach(t),gl=c(wt),ao=s(wt,"LI",{});var Md=a(ao);_n=s(Md,"A",{href:!0,rel:!0});var Vm=a(_n);_l=d(Vm,"Distilled checkpoints"),Vm.forEach(t),yl=d(Md," are described in this "),yn=s(Md,"A",{href:!0,rel:!0});var Rm=a(yn);bl=d(Rm,"paper"),Rm.forEach(t),vl=d(Md,"."),Md.forEach(t),wt.forEach(t),xd=c(o),Jt=s(o,"H3",{class:!0});var ii=a(Jt);ro=s(ii,"A",{id:!0,class:!0,href:!0});var Xm=a(ro);Na=s(Xm,"SPAN",{});var Lm=a(Na);k(bn.$$.fragment,Lm),Lm.forEach(t),Xm.forEach(t),kl=c(ii),Aa=s(ii,"SPAN",{});var Om=a(Aa);Tl=d(Om,"Examples"),Om.forEach(t),ii.forEach(t),jd=c(o),vt=s(o,"UL",{});var wa=a(vt);io=s(wa,"LI",{});var $d=a(io);vn=s($d,"A",{href:!0,rel:!0});var Hm=a(vn);wl=d(Hm,"Script"),Hm.forEach(t),Ml=d($d,` to fine-tune pegasus
on the XSUM dataset. Data download instructions at `),kn=s($d,"A",{href:!0,rel:!0});var Dm=a(kn);$l=d(Dm,"examples/pytorch/summarization/"),Dm.forEach(t),Fl=d($d,"."),$d.forEach(t),zl=c(wa),Ba=s(wa,"LI",{});var Qm=a(Ba);xl=d(Qm,"FP16 is not supported (help/ideas on this appreciated!)."),Qm.forEach(t),jl=c(wa),Va=s(wa,"LI",{});var Ym=a(Va);Pl=d(Ym,"The adafactor optimizer is recommended for pegasus fine-tuning."),Ym.forEach(t),wa.forEach(t),Pd=c(o),Gt=s(o,"H2",{class:!0});var li=a(Gt);lo=s(li,"A",{id:!0,class:!0,href:!0});var Km=a(lo);Ra=s(Km,"SPAN",{});var ef=a(Ra);k(Tn.$$.fragment,ef),ef.forEach(t),Km.forEach(t),El=c(li),Xa=s(li,"SPAN",{});var tf=a(Xa);Jl=d(tf,"Implementation Notes"),tf.forEach(t),li.forEach(t),Ed=c(o),we=s(o,"UL",{});var Mt=a(we);La=s(Mt,"LI",{});var of=a(La);Oa=s(of,"P",{});var nf=a(Oa);Gl=d(nf,"All models are transformer encoder-decoders with 16 layers in each component."),nf.forEach(t),of.forEach(t),Ul=c(Mt),Ha=s(Mt,"LI",{});var sf=a(Ha);ea=s(sf,"P",{});var $m=a(ea);Cl=d($m,"The implementation is completely inherited from "),ta=s($m,"A",{href:!0});var af=a(ta);Il=d(af,"BartForConditionalGeneration"),af.forEach(t),$m.forEach(t),sf.forEach(t),Zl=c(Mt),wn=s(Mt,"LI",{});var ci=a(wn);Da=s(ci,"P",{});var rf=a(Da);ql=d(rf,"Some key configuration differences:"),rf.forEach(t),Wl=c(ci),Ut=s(ci,"UL",{});var Ma=a(Ut);Qa=s(Ma,"LI",{});var df=a(Qa);Sl=d(df,"static, sinusoidal position embeddings"),df.forEach(t),Nl=c(Ma),Ya=s(Ma,"LI",{});var lf=a(Ya);Al=d(lf,"the model starts generating with pad_token_id (which has 0 token_embedding) as the prefix."),lf.forEach(t),Bl=c(Ma),Mn=s(Ma,"LI",{});var pi=a(Mn);Vl=d(pi,"more beams are used ("),Ka=s(pi,"CODE",{});var cf=a(Ka);Rl=d(cf,"num_beams=8"),cf.forEach(t),Xl=d(pi,")"),pi.forEach(t),Ma.forEach(t),ci.forEach(t),Ll=c(Mt),er=s(Mt,"LI",{});var pf=a(er);mt=s(pf,"P",{});var en=a(mt);Ol=d(en,"All pretrained pegasus checkpoints are the same besides three attributes: "),tr=s(en,"CODE",{});var uf=a(tr);Hl=d(uf,"tokenizer.model_max_length"),uf.forEach(t),Dl=d(en,` (maximum
input size), `),or=s(en,"CODE",{});var hf=a(or);Ql=d(hf,"max_length"),hf.forEach(t),Yl=d(en," (the maximum number of tokens to generate) and "),nr=s(en,"CODE",{});var mf=a(nr);Kl=d(mf,"length_penalty"),mf.forEach(t),ec=d(en,"."),en.forEach(t),pf.forEach(t),tc=c(Mt),sr=s(Mt,"LI",{});var ff=a(sr);Ct=s(ff,"P",{});var $a=a(Ct);oc=d($a,"The code to convert checkpoints trained in the author\u2019s "),$n=s($a,"A",{href:!0,rel:!0});var gf=a($n);nc=d(gf,"repo"),gf.forEach(t),sc=d($a,` can be
found in `),ar=s($a,"CODE",{});var _f=a(ar);ac=d(_f,"convert_pegasus_tf_to_pytorch.py"),_f.forEach(t),rc=d($a,"."),$a.forEach(t),ff.forEach(t),Mt.forEach(t),Jd=c(o),It=s(o,"H2",{class:!0});var ui=a(It);co=s(ui,"A",{id:!0,class:!0,href:!0});var yf=a(co);rr=s(yf,"SPAN",{});var bf=a(rr);k(Fn.$$.fragment,bf),bf.forEach(t),yf.forEach(t),dc=c(ui),dr=s(ui,"SPAN",{});var vf=a(dr);ic=d(vf,"Usage Example"),vf.forEach(t),ui.forEach(t),Gd=c(o),k(zn.$$.fragment,o),Ud=c(o),Zt=s(o,"H2",{class:!0});var hi=a(Zt);po=s(hi,"A",{id:!0,class:!0,href:!0});var kf=a(po);ir=s(kf,"SPAN",{});var Tf=a(ir);k(xn.$$.fragment,Tf),Tf.forEach(t),kf.forEach(t),lc=c(hi),lr=s(hi,"SPAN",{});var wf=a(lr);cc=d(wf,"Documentation resources"),wf.forEach(t),hi.forEach(t),Cd=c(o),kt=s(o,"UL",{});var Fa=a(kt);cr=s(Fa,"LI",{});var Mf=a(cr);oa=s(Mf,"A",{href:!0});var $f=a(oa);pc=d($f,"Causal language modeling task guide"),$f.forEach(t),Mf.forEach(t),uc=c(Fa),pr=s(Fa,"LI",{});var Ff=a(pr);na=s(Ff,"A",{href:!0});var zf=a(na);hc=d(zf,"Translation task guide"),zf.forEach(t),Ff.forEach(t),mc=c(Fa),ur=s(Fa,"LI",{});var xf=a(ur);sa=s(xf,"A",{href:!0});var jf=a(sa);fc=d(jf,"Summarization task guide"),jf.forEach(t),xf.forEach(t),Fa.forEach(t),Id=c(o),qt=s(o,"H2",{class:!0});var mi=a(qt);uo=s(mi,"A",{id:!0,class:!0,href:!0});var Pf=a(uo);hr=s(Pf,"SPAN",{});var Ef=a(hr);k(jn.$$.fragment,Ef),Ef.forEach(t),Pf.forEach(t),gc=c(mi),mr=s(mi,"SPAN",{});var Jf=a(mr);_c=d(Jf,"PegasusConfig"),Jf.forEach(t),mi.forEach(t),Zd=c(o),Ce=s(o,"DIV",{class:!0});var tn=a(Ce);k(Pn.$$.fragment,tn),yc=c(tn),Wt=s(tn,"P",{});var za=a(Wt);bc=d(za,"This is the configuration class to store the configuration of a "),aa=s(za,"A",{href:!0});var Gf=a(aa);vc=d(Gf,"PegasusModel"),Gf.forEach(t),kc=d(za,`. It is used to instantiate an
PEGASUS 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
`),En=s(za,"A",{href:!0,rel:!0});var Uf=a(En);Tc=d(Uf,"google/pegasus-large"),Uf.forEach(t),wc=d(za," architecture."),za.forEach(t),Mc=c(tn),St=s(tn,"P",{});var xa=a(St);$c=d(xa,"Configuration objects inherit from "),ra=s(xa,"A",{href:!0});var Cf=a(ra);Fc=d(Cf,"PretrainedConfig"),Cf.forEach(t),zc=d(xa,` and can be used to control the model outputs. Read the
documentation from `),da=s(xa,"A",{href:!0});var If=a(da);xc=d(If,"PretrainedConfig"),If.forEach(t),jc=d(xa," for more information."),xa.forEach(t),Pc=c(tn),k(ho.$$.fragment,tn),tn.forEach(t),qd=c(o),Nt=s(o,"H2",{class:!0});var fi=a(Nt);mo=s(fi,"A",{id:!0,class:!0,href:!0});var Zf=a(mo);fr=s(Zf,"SPAN",{});var qf=a(fr);k(Jn.$$.fragment,qf),qf.forEach(t),Zf.forEach(t),Ec=c(fi),gr=s(fi,"SPAN",{});var Wf=a(gr);Jc=d(Wf,"PegasusTokenizer"),Wf.forEach(t),fi.forEach(t),Wd=c(o),fo=s(o,"P",{});var gi=a(fo);Gc=d(gi,"warning: "),_r=s(gi,"CODE",{});var Sf=a(_r);Uc=d(Sf,"add_tokens"),Sf.forEach(t),Cc=d(gi," does not work at the moment."),gi.forEach(t),Sd=c(o),V=s(o,"DIV",{class:!0});var $e=a(V);k(Gn.$$.fragment,$e),Ic=c($e),Un=s($e,"P",{});var _i=a(Un);Zc=d(_i,"Construct a PEGASUS tokenizer. Based on "),Cn=s(_i,"A",{href:!0,rel:!0});var Nf=a(Cn);qc=d(Nf,"SentencePiece"),Nf.forEach(t),Wc=d(_i,"."),_i.forEach(t),Sc=c($e),In=s($e,"P",{});var yi=a(In);Nc=d(yi,"This tokenizer inherits from "),ia=s(yi,"A",{href:!0});var Af=a(ia);Ac=d(Af,"PreTrainedTokenizer"),Af.forEach(t),Bc=d(yi,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),yi.forEach(t),Vc=c($e),Re=s($e,"DIV",{class:!0});var on=a(Re);k(Zn.$$.fragment,on),Rc=c(on),qn=s(on,"P",{});var bi=a(qn);Xc=d(bi,`Build model inputs from a sequence or a pair of sequences for sequence classification tasks by concatenating
and adding special tokens. A PEGASUS sequence has the following format, where `),yr=s(bi,"CODE",{});var Bf=a(yr);Lc=d(Bf,"X"),Bf.forEach(t),Oc=d(bi," represents the sequence:"),bi.forEach(t),Hc=c(on),Wn=s(on,"UL",{});var vi=a(Wn);la=s(vi,"LI",{});var Fm=a(la);Dc=d(Fm,"single sequence: "),br=s(Fm,"CODE",{});var Vf=a(br);Qc=d(Vf,"X </s>"),Vf.forEach(t),Fm.forEach(t),Yc=c(vi),Sn=s(vi,"LI",{});var ki=a(Sn);Kc=d(ki,"pair of sequences: "),vr=s(ki,"CODE",{});var Rf=a(vr);ep=d(Rf,"A B </s>"),Rf.forEach(t),tp=d(ki," (not intended use)"),ki.forEach(t),vi.forEach(t),op=c(on),kr=s(on,"P",{});var Xf=a(kr);np=d(Xf,`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),Xf.forEach(t),on.forEach(t),sp=c($e),go=s($e,"DIV",{class:!0});var Ti=a(go);k(Nn.$$.fragment,Ti),ap=c(Ti),Tr=s(Ti,"P",{});var Lf=a(Tr);rp=d(Lf,"Converts a sequence of tokens (string) in a single string."),Lf.forEach(t),Ti.forEach(t),dp=c($e),_o=s($e,"DIV",{class:!0});var wi=a(_o);k(An.$$.fragment,wi),ip=c(wi),wr=s(wi,"P",{});var Of=a(wr);lp=d(Of,"Get list where entries are [1] if a token is [eos] or [pad] else 0."),Of.forEach(t),wi.forEach(t),cp=c($e),yo=s($e,"DIV",{class:!0});var Mi=a(yo);k(Bn.$$.fragment,Mi),pp=c(Mi),Mr=s(Mi,"P",{});var Hf=a(Mr);up=d(Hf,"Just EOS"),Hf.forEach(t),Mi.forEach(t),$e.forEach(t),Nd=c(o),At=s(o,"H2",{class:!0});var $i=a(At);bo=s($i,"A",{id:!0,class:!0,href:!0});var Df=a(bo);$r=s(Df,"SPAN",{});var Qf=a($r);k(Vn.$$.fragment,Qf),Qf.forEach(t),Df.forEach(t),hp=c($i),Fr=s($i,"SPAN",{});var Yf=a(Fr);mp=d(Yf,"PegasusTokenizerFast"),Yf.forEach(t),$i.forEach(t),Ad=c(o),fe=s(o,"DIV",{class:!0});var $t=a(fe);k(Rn.$$.fragment,$t),fp=c($t),Bt=s($t,"P",{});var ja=a(Bt);gp=d(ja,"Construct a \u201Cfast\u201D PEGASUS tokenizer (backed by HuggingFace\u2019s "),zr=s(ja,"EM",{});var Kf=a(zr);_p=d(Kf,"tokenizers"),Kf.forEach(t),yp=d(ja,` library). Based on
`),Xn=s(ja,"A",{href:!0,rel:!0});var eg=a(Xn);bp=d(eg,"Unigram"),eg.forEach(t),vp=d(ja,"."),ja.forEach(t),kp=c($t),Ln=s($t,"P",{});var Fi=a(Ln);Tp=d(Fi,"This tokenizer inherits from "),ca=s(Fi,"A",{href:!0});var tg=a(ca);wp=d(tg,"PreTrainedTokenizerFast"),tg.forEach(t),Mp=d(Fi,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Fi.forEach(t),$p=c($t),Tt=s($t,"DIV",{class:!0});var Pa=a(Tt);k(On.$$.fragment,Pa),Fp=c(Pa),xr=s(Pa,"P",{});var og=a(xr);zp=d(og,"Build model inputs from a sequence by adding eos to the end. no bos token is added to the front."),og.forEach(t),xp=c(Pa),Hn=s(Pa,"UL",{});var zi=a(Hn);pa=s(zi,"LI",{});var zm=a(pa);jp=d(zm,"single sequence: "),jr=s(zm,"CODE",{});var ng=a(jr);Pp=d(ng,"X </s>"),ng.forEach(t),zm.forEach(t),Ep=c(zi),Dn=s(zi,"LI",{});var xi=a(Dn);Jp=d(xi,"pair of sequences: "),Pr=s(xi,"CODE",{});var sg=a(Pr);Gp=d(sg,"A B </s>"),sg.forEach(t),Up=d(xi," (not intended use)"),xi.forEach(t),zi.forEach(t),Pa.forEach(t),Cp=c($t),vo=s($t,"DIV",{class:!0});var ji=a(vo);k(Qn.$$.fragment,ji),Ip=c(ji),Er=s(ji,"P",{});var ag=a(Er);Zp=d(ag,"Get list where entries are [1] if a token is [eos] or [pad] else 0."),ag.forEach(t),ji.forEach(t),$t.forEach(t),Bd=c(o),Vt=s(o,"H2",{class:!0});var Pi=a(Vt);ko=s(Pi,"A",{id:!0,class:!0,href:!0});var rg=a(ko);Jr=s(rg,"SPAN",{});var dg=a(Jr);k(Yn.$$.fragment,dg),dg.forEach(t),rg.forEach(t),qp=c(Pi),Gr=s(Pi,"SPAN",{});var ig=a(Gr);Wp=d(ig,"PegasusModel"),ig.forEach(t),Pi.forEach(t),Vd=c(o),Ie=s(o,"DIV",{class:!0});var nn=a(Ie);k(Kn.$$.fragment,nn),Sp=c(nn),es=s(nn,"P",{});var Ei=a(es);Np=d(Ei,`The bare PEGASUS Model outputting raw hidden-states without any specific head on top.
This model inherits from `),ua=s(Ei,"A",{href:!0});var lg=a(ua);Ap=d(lg,"PreTrainedModel"),lg.forEach(t),Bp=d(Ei,`. 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.)`),Ei.forEach(t),Vp=c(nn),ts=s(nn,"P",{});var Ji=a(ts);Rp=d(Ji,"This model is also a PyTorch "),os=s(Ji,"A",{href:!0,rel:!0});var cg=a(os);Xp=d(cg,"torch.nn.Module"),cg.forEach(t),Lp=d(Ji,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ji.forEach(t),Op=c(nn),Xe=s(nn,"DIV",{class:!0});var sn=a(Xe);k(ns.$$.fragment,sn),Hp=c(sn),Rt=s(sn,"P",{});var Ea=a(Rt);Dp=d(Ea,"The "),ha=s(Ea,"A",{href:!0});var pg=a(ha);Qp=d(pg,"PegasusModel"),pg.forEach(t),Yp=d(Ea," forward method, overrides the "),Ur=s(Ea,"CODE",{});var ug=a(Ur);Kp=d(ug,"__call__"),ug.forEach(t),eu=d(Ea," special method."),Ea.forEach(t),tu=c(sn),k(To.$$.fragment,sn),ou=c(sn),k(wo.$$.fragment,sn),sn.forEach(t),nn.forEach(t),Rd=c(o),Xt=s(o,"H2",{class:!0});var Gi=a(Xt);Mo=s(Gi,"A",{id:!0,class:!0,href:!0});var hg=a(Mo);Cr=s(hg,"SPAN",{});var mg=a(Cr);k(ss.$$.fragment,mg),mg.forEach(t),hg.forEach(t),nu=c(Gi),Ir=s(Gi,"SPAN",{});var fg=a(Ir);su=d(fg,"PegasusForConditionalGeneration"),fg.forEach(t),Gi.forEach(t),Xd=c(o),Ze=s(o,"DIV",{class:!0});var an=a(Ze);k(as.$$.fragment,an),au=c(an),rs=s(an,"P",{});var Ui=a(rs);ru=d(Ui,`The PEGASUS Model with a language modeling head. Can be used for summarization.
This model inherits from `),ma=s(Ui,"A",{href:!0});var gg=a(ma);du=d(gg,"PreTrainedModel"),gg.forEach(t),iu=d(Ui,`. 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.)`),Ui.forEach(t),lu=c(an),ds=s(an,"P",{});var Ci=a(ds);cu=d(Ci,"This model is also a PyTorch "),is=s(Ci,"A",{href:!0,rel:!0});var _g=a(is);pu=d(_g,"torch.nn.Module"),_g.forEach(t),uu=d(Ci,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ci.forEach(t),hu=c(an),Le=s(an,"DIV",{class:!0});var rn=a(Le);k(ls.$$.fragment,rn),mu=c(rn),Lt=s(rn,"P",{});var Ja=a(Lt);fu=d(Ja,"The "),fa=s(Ja,"A",{href:!0});var yg=a(fa);gu=d(yg,"PegasusForConditionalGeneration"),yg.forEach(t),_u=d(Ja," forward method, overrides the "),Zr=s(Ja,"CODE",{});var bg=a(Zr);yu=d(bg,"__call__"),bg.forEach(t),bu=d(Ja," special method."),Ja.forEach(t),vu=c(rn),k($o.$$.fragment,rn),ku=c(rn),k(Fo.$$.fragment,rn),rn.forEach(t),an.forEach(t),Ld=c(o),Ot=s(o,"H2",{class:!0});var Ii=a(Ot);zo=s(Ii,"A",{id:!0,class:!0,href:!0});var vg=a(zo);qr=s(vg,"SPAN",{});var kg=a(qr);k(cs.$$.fragment,kg),kg.forEach(t),vg.forEach(t),Tu=c(Ii),Wr=s(Ii,"SPAN",{});var Tg=a(Wr);wu=d(Tg,"PegasusForCausalLM"),Tg.forEach(t),Ii.forEach(t),Od=c(o),Ht=s(o,"DIV",{class:!0});var Zi=a(Ht);k(ps.$$.fragment,Zi),Mu=c(Zi),xo=s(Zi,"DIV",{class:!0});var qi=a(xo);k(us.$$.fragment,qi),$u=c(qi),k(jo.$$.fragment,qi),qi.forEach(t),Zi.forEach(t),Hd=c(o),Dt=s(o,"H2",{class:!0});var Wi=a(Dt);Po=s(Wi,"A",{id:!0,class:!0,href:!0});var wg=a(Po);Sr=s(wg,"SPAN",{});var Mg=a(Sr);k(hs.$$.fragment,Mg),Mg.forEach(t),wg.forEach(t),Fu=c(Wi),Nr=s(Wi,"SPAN",{});var $g=a(Nr);zu=d($g,"TFPegasusModel"),$g.forEach(t),Wi.forEach(t),Dd=c(o),ge=s(o,"DIV",{class:!0});var Ft=a(ge);k(ms.$$.fragment,Ft),xu=c(Ft),fs=s(Ft,"P",{});var Si=a(fs);ju=d(Si,`The bare PEGASUS Model outputting raw hidden-states without any specific head on top.
This model inherits from `),ga=s(Si,"A",{href:!0});var Fg=a(ga);Pu=d(Fg,"TFPreTrainedModel"),Fg.forEach(t),Eu=d(Si,`. 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.)`),Si.forEach(t),Ju=c(Ft),gs=s(Ft,"P",{});var Ni=a(gs);Gu=d(Ni,"This model is also a "),_s=s(Ni,"A",{href:!0,rel:!0});var zg=a(_s);Uu=d(zg,"tf.keras.Model"),zg.forEach(t),Cu=d(Ni,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Ni.forEach(t),Iu=c(Ft),k(Eo.$$.fragment,Ft),Zu=c(Ft),Oe=s(Ft,"DIV",{class:!0});var dn=a(Oe);k(ys.$$.fragment,dn),qu=c(dn),Qt=s(dn,"P",{});var Ga=a(Qt);Wu=d(Ga,"The "),_a=s(Ga,"A",{href:!0});var xg=a(_a);Su=d(xg,"TFPegasusModel"),xg.forEach(t),Nu=d(Ga," forward method, overrides the "),Ar=s(Ga,"CODE",{});var jg=a(Ar);Au=d(jg,"__call__"),jg.forEach(t),Bu=d(Ga," special method."),Ga.forEach(t),Vu=c(dn),k(Jo.$$.fragment,dn),Ru=c(dn),k(Go.$$.fragment,dn),dn.forEach(t),Ft.forEach(t),Qd=c(o),Yt=s(o,"H2",{class:!0});var Ai=a(Yt);Uo=s(Ai,"A",{id:!0,class:!0,href:!0});var Pg=a(Uo);Br=s(Pg,"SPAN",{});var Eg=a(Br);k(bs.$$.fragment,Eg),Eg.forEach(t),Pg.forEach(t),Xu=c(Ai),Vr=s(Ai,"SPAN",{});var Jg=a(Vr);Lu=d(Jg,"TFPegasusForConditionalGeneration"),Jg.forEach(t),Ai.forEach(t),Yd=c(o),_e=s(o,"DIV",{class:!0});var zt=a(_e);k(vs.$$.fragment,zt),Ou=c(zt),ks=s(zt,"P",{});var Bi=a(ks);Hu=d(Bi,`The PEGASUS Model with a language modeling head. Can be used for summarization.
This model inherits from `),ya=s(Bi,"A",{href:!0});var Gg=a(ya);Du=d(Gg,"TFPreTrainedModel"),Gg.forEach(t),Qu=d(Bi,`. 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.)`),Bi.forEach(t),Yu=c(zt),Ts=s(zt,"P",{});var Vi=a(Ts);Ku=d(Vi,"This model is also a "),ws=s(Vi,"A",{href:!0,rel:!0});var Ug=a(ws);eh=d(Ug,"tf.keras.Model"),Ug.forEach(t),th=d(Vi,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Vi.forEach(t),oh=c(zt),k(Co.$$.fragment,zt),nh=c(zt),He=s(zt,"DIV",{class:!0});var ln=a(He);k(Ms.$$.fragment,ln),sh=c(ln),Kt=s(ln,"P",{});var Ua=a(Kt);ah=d(Ua,"The "),ba=s(Ua,"A",{href:!0});var Cg=a(ba);rh=d(Cg,"TFPegasusForConditionalGeneration"),Cg.forEach(t),dh=d(Ua," forward method, overrides the "),Rr=s(Ua,"CODE",{});var Ig=a(Rr);ih=d(Ig,"__call__"),Ig.forEach(t),lh=d(Ua," special method."),Ua.forEach(t),ch=c(ln),k(Io.$$.fragment,ln),ph=c(ln),k(Zo.$$.fragment,ln),ln.forEach(t),zt.forEach(t),Kd=c(o),eo=s(o,"H2",{class:!0});var Ri=a(eo);qo=s(Ri,"A",{id:!0,class:!0,href:!0});var Zg=a(qo);Xr=s(Zg,"SPAN",{});var qg=a(Xr);k($s.$$.fragment,qg),qg.forEach(t),Zg.forEach(t),uh=c(Ri),Lr=s(Ri,"SPAN",{});var Wg=a(Lr);hh=d(Wg,"FlaxPegasusModel"),Wg.forEach(t),Ri.forEach(t),ei=c(o),W=s(o,"DIV",{class:!0});var re=a(W);k(Fs.$$.fragment,re),mh=c(re),zs=s(re,"P",{});var Xi=a(zs);fh=d(Xi,`The bare Pegasus Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),va=s(Xi,"A",{href:!0});var Sg=a(va);gh=d(Sg,"FlaxPreTrainedModel"),Sg.forEach(t),_h=d(Xi,`. 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.)`),Xi.forEach(t),yh=c(re),xs=s(re,"P",{});var Li=a(xs);bh=d(Li,`This model is also a Flax Linen
`),js=s(Li,"A",{href:!0,rel:!0});var Ng=a(js);vh=d(Ng,"flax.nn.Module"),Ng.forEach(t),kh=d(Li,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Li.forEach(t),Th=c(re),Or=s(re,"P",{});var Ag=a(Or);wh=d(Ag,"Finally, this model supports inherent JAX features such as:"),Ag.forEach(t),Mh=c(re),ft=s(re,"UL",{});var cn=a(ft);Hr=s(cn,"LI",{});var Bg=a(Hr);Ps=s(Bg,"A",{href:!0,rel:!0});var Vg=a(Ps);$h=d(Vg,"Just-In-Time (JIT) compilation"),Vg.forEach(t),Bg.forEach(t),Fh=c(cn),Dr=s(cn,"LI",{});var Rg=a(Dr);Es=s(Rg,"A",{href:!0,rel:!0});var Xg=a(Es);zh=d(Xg,"Automatic Differentiation"),Xg.forEach(t),Rg.forEach(t),xh=c(cn),Qr=s(cn,"LI",{});var Lg=a(Qr);Js=s(Lg,"A",{href:!0,rel:!0});var Og=a(Js);jh=d(Og,"Vectorization"),Og.forEach(t),Lg.forEach(t),Ph=c(cn),Yr=s(cn,"LI",{});var Hg=a(Yr);Gs=s(Hg,"A",{href:!0,rel:!0});var Dg=a(Gs);Eh=d(Dg,"Parallelization"),Dg.forEach(t),Hg.forEach(t),cn.forEach(t),Jh=c(re),De=s(re,"DIV",{class:!0});var pn=a(De);k(Us.$$.fragment,pn),Gh=c(pn),to=s(pn,"P",{});var Ca=a(to);Uh=d(Ca,"The "),Kr=s(Ca,"CODE",{});var Qg=a(Kr);Ch=d(Qg,"FlaxPegasusPreTrainedModel"),Qg.forEach(t),Ih=d(Ca," forward method, overrides the "),ed=s(Ca,"CODE",{});var Yg=a(ed);Zh=d(Yg,"__call__"),Yg.forEach(t),qh=d(Ca," special method."),Ca.forEach(t),Wh=c(pn),k(Wo.$$.fragment,pn),Sh=c(pn),k(So.$$.fragment,pn),pn.forEach(t),Nh=c(re),No=s(re,"DIV",{class:!0});var Oi=a(No);k(Cs.$$.fragment,Oi),Ah=c(Oi),k(Ao.$$.fragment,Oi),Oi.forEach(t),Bh=c(re),Bo=s(re,"DIV",{class:!0});var Hi=a(Bo);k(Is.$$.fragment,Hi),Vh=c(Hi),k(Vo.$$.fragment,Hi),Hi.forEach(t),re.forEach(t),ti=c(o),oo=s(o,"H2",{class:!0});var Di=a(oo);Ro=s(Di,"A",{id:!0,class:!0,href:!0});var Kg=a(Ro);td=s(Kg,"SPAN",{});var e_=a(td);k(Zs.$$.fragment,e_),e_.forEach(t),Kg.forEach(t),Rh=c(Di),od=s(Di,"SPAN",{});var t_=a(od);Xh=d(t_,"FlaxPegasusForConditionalGeneration"),t_.forEach(t),Di.forEach(t),oi=c(o),S=s(o,"DIV",{class:!0});var de=a(S);k(qs.$$.fragment,de),Lh=c(de),Ws=s(de,"P",{});var Qi=a(Ws);Oh=d(Qi,`The PEGASUS Model with a language modeling head. Can be used for summarization.
This model inherits from `),ka=s(Qi,"A",{href:!0});var o_=a(ka);Hh=d(o_,"FlaxPreTrainedModel"),o_.forEach(t),Dh=d(Qi,`. 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.)`),Qi.forEach(t),Qh=c(de),Ss=s(de,"P",{});var Yi=a(Ss);Yh=d(Yi,`This model is also a Flax Linen
`),Ns=s(Yi,"A",{href:!0,rel:!0});var n_=a(Ns);Kh=d(n_,"flax.nn.Module"),n_.forEach(t),em=d(Yi,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Yi.forEach(t),tm=c(de),nd=s(de,"P",{});var s_=a(nd);om=d(s_,"Finally, this model supports inherent JAX features such as:"),s_.forEach(t),nm=c(de),gt=s(de,"UL",{});var un=a(gt);sd=s(un,"LI",{});var a_=a(sd);As=s(a_,"A",{href:!0,rel:!0});var r_=a(As);sm=d(r_,"Just-In-Time (JIT) compilation"),r_.forEach(t),a_.forEach(t),am=c(un),ad=s(un,"LI",{});var d_=a(ad);Bs=s(d_,"A",{href:!0,rel:!0});var i_=a(Bs);rm=d(i_,"Automatic Differentiation"),i_.forEach(t),d_.forEach(t),dm=c(un),rd=s(un,"LI",{});var l_=a(rd);Vs=s(l_,"A",{href:!0,rel:!0});var c_=a(Vs);im=d(c_,"Vectorization"),c_.forEach(t),l_.forEach(t),lm=c(un),dd=s(un,"LI",{});var p_=a(dd);Rs=s(p_,"A",{href:!0,rel:!0});var u_=a(Rs);cm=d(u_,"Parallelization"),u_.forEach(t),p_.forEach(t),un.forEach(t),pm=c(de),Me=s(de,"DIV",{class:!0});var xt=a(Me);k(Xs.$$.fragment,xt),um=c(xt),no=s(xt,"P",{});var Ia=a(no);hm=d(Ia,"The "),id=s(Ia,"CODE",{});var h_=a(id);mm=d(h_,"FlaxPegasusPreTrainedModel"),h_.forEach(t),fm=d(Ia," forward method, overrides the "),ld=s(Ia,"CODE",{});var m_=a(ld);gm=d(m_,"__call__"),m_.forEach(t),_m=d(Ia," special method."),Ia.forEach(t),ym=c(xt),k(Xo.$$.fragment,xt),bm=c(xt),k(Lo.$$.fragment,xt),vm=c(xt),k(Oo.$$.fragment,xt),xt.forEach(t),km=c(de),Ho=s(de,"DIV",{class:!0});var Ki=a(Ho);k(Ls.$$.fragment,Ki),Tm=c(Ki),k(Do.$$.fragment,Ki),Ki.forEach(t),wm=c(de),Qo=s(de,"DIV",{class:!0});var el=a(Qo);k(Os.$$.fragment,el),Mm=c(el),k(Yo.$$.fragment,el),el.forEach(t),de.forEach(t),this.h()},h(){p(u,"name","hf:doc:metadata"),p(u,"content",JSON.stringify(B_)),p(m,"id","pegasus"),p(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(m,"href","#pegasus"),p(_,"class","relative group"),p(Y,"alt","Models"),f_(Y.src,x="https://img.shields.io/badge/All_model_pages-pegasus-blueviolet")||p(Y,"src",x),p(ye,"href","https://huggingface.co/models?filter=pegasus"),p(be,"alt","Spaces"),f_(be.src,_t="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||p(be,"src",_t),p(R,"href","https://huggingface.co/spaces/docs-demos/pegasus_paraphrase"),p(Z,"class","flex flex-wrap space-x-1"),p(le,"href","https://github.com/huggingface/transformers/issues/new?assignees=sshleifer&labels=&template=bug-report.md&title"),p(le,"rel","nofollow"),p(ee,"id","overview"),p(ee,"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"),p(ee,"href","#overview"),p(q,"class","relative group"),p(N,"href","https://arxiv.org/pdf/1912.08777.pdf"),p(N,"rel","nofollow"),p(U,"href","https://huggingface.co/sshleifer"),p(U,"rel","nofollow"),p(ue,"href","https://github.com/google-research/pegasus"),p(ue,"rel","nofollow"),p(ke,"id","checkpoints"),p(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ke,"href","#checkpoints"),p(me,"class","relative group"),p(mn,"href","https://huggingface.co/models?search=pegasus"),p(mn,"rel","nofollow"),p(gn,"href","https://github.com/huggingface/transformers/issues/6844#issue-689259666"),p(gn,"rel","nofollow"),p(_n,"href","https://huggingface.co/models?search=distill-pegasus"),p(_n,"rel","nofollow"),p(yn,"href","https://arxiv.org/abs/2010.13002"),p(yn,"rel","nofollow"),p(ro,"id","examples"),p(ro,"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"),p(ro,"href","#examples"),p(Jt,"class","relative group"),p(vn,"href","https://github.com/huggingface/transformers/tree/main/examples/research_projects/seq2seq-distillation/finetune_pegasus_xsum.sh"),p(vn,"rel","nofollow"),p(kn,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization/README.md"),p(kn,"rel","nofollow"),p(lo,"id","implementation-notes"),p(lo,"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"),p(lo,"href","#implementation-notes"),p(Gt,"class","relative group"),p(ta,"href","/docs/transformers/v4.31.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),p($n,"href","https://github.com/google-research/pegasus"),p($n,"rel","nofollow"),p(co,"id","usage-example"),p(co,"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"),p(co,"href","#usage-example"),p(It,"class","relative group"),p(po,"id","documentation-resources"),p(po,"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"),p(po,"href","#documentation-resources"),p(Zt,"class","relative group"),p(oa,"href","../tasks/language_modeling"),p(na,"href","../tasks/translation"),p(sa,"href","../tasks/summarization"),p(uo,"id","transformers.PegasusConfig"),p(uo,"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"),p(uo,"href","#transformers.PegasusConfig"),p(qt,"class","relative group"),p(aa,"href","/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusModel"),p(En,"href","https://huggingface.co/google/pegasus-large"),p(En,"rel","nofollow"),p(ra,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),p(da,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),p(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(mo,"id","transformers.PegasusTokenizer"),p(mo,"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"),p(mo,"href","#transformers.PegasusTokenizer"),p(Nt,"class","relative group"),p(Cn,"href","https://github.com/google/sentencepiece"),p(Cn,"rel","nofollow"),p(ia,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),p(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(bo,"id","transformers.PegasusTokenizerFast"),p(bo,"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"),p(bo,"href","#transformers.PegasusTokenizerFast"),p(At,"class","relative group"),p(Xn,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=unigram#models"),p(Xn,"rel","nofollow"),p(ca,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),p(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ko,"id","transformers.PegasusModel"),p(ko,"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"),p(ko,"href","#transformers.PegasusModel"),p(Vt,"class","relative group"),p(ua,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),p(os,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(os,"rel","nofollow"),p(ha,"href","/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusModel"),p(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Mo,"id","transformers.PegasusForConditionalGeneration"),p(Mo,"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"),p(Mo,"href","#transformers.PegasusForConditionalGeneration"),p(Xt,"class","relative group"),p(ma,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),p(is,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(is,"rel","nofollow"),p(fa,"href","/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.PegasusForConditionalGeneration"),p(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(zo,"id","transformers.PegasusForCausalLM"),p(zo,"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"),p(zo,"href","#transformers.PegasusForCausalLM"),p(Ot,"class","relative group"),p(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Po,"id","transformers.TFPegasusModel"),p(Po,"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"),p(Po,"href","#transformers.TFPegasusModel"),p(Dt,"class","relative group"),p(ga,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),p(_s,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(_s,"rel","nofollow"),p(_a,"href","/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.TFPegasusModel"),p(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Uo,"id","transformers.TFPegasusForConditionalGeneration"),p(Uo,"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"),p(Uo,"href","#transformers.TFPegasusForConditionalGeneration"),p(Yt,"class","relative group"),p(ya,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),p(ws,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(ws,"rel","nofollow"),p(ba,"href","/docs/transformers/v4.31.0/en/model_doc/pegasus#transformers.TFPegasusForConditionalGeneration"),p(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(qo,"id","transformers.FlaxPegasusModel"),p(qo,"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"),p(qo,"href","#transformers.FlaxPegasusModel"),p(eo,"class","relative group"),p(va,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),p(js,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),p(js,"rel","nofollow"),p(Ps,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),p(Ps,"rel","nofollow"),p(Es,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),p(Es,"rel","nofollow"),p(Js,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),p(Js,"rel","nofollow"),p(Gs,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),p(Gs,"rel","nofollow"),p(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(No,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ro,"id","transformers.FlaxPegasusForConditionalGeneration"),p(Ro,"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"),p(Ro,"href","#transformers.FlaxPegasusForConditionalGeneration"),p(oo,"class","relative group"),p(ka,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),p(Ns,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),p(Ns,"rel","nofollow"),p(As,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),p(As,"rel","nofollow"),p(Bs,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),p(Bs,"rel","nofollow"),p(Vs,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),p(Vs,"rel","nofollow"),p(Rs,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),p(Rs,"rel","nofollow"),p(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Qo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,u),f(o,b,g),f(o,_,g),e(_,m),e(m,y),T(i,y,null),e(_,h),e(_,j),e(j,Qe),f(o,Se,g),f(o,Z,g),e(Z,ye),e(ye,Y),e(Z,Ye),e(Z,R),e(R,be),f(o,K,g),f(o,L,g),e(L,ze),e(ze,ie),e(L,Ke),e(L,le),e(le,ce),e(L,et),f(o,Ne,g),f(o,q,g),e(q,ee),e(ee,xe),T(O,xe,null),e(q,G),e(q,C),e(C,tt),f(o,te,g),f(o,oe,g),e(oe,ot),e(oe,N),e(N,nt),e(oe,st),f(o,I,g),f(o,ve,g),e(ve,pe),f(o,Ae,g),f(o,ne,g),e(ne,H),e(H,at),e(ne,rt),e(ne,A),e(A,dt),f(o,se,g),f(o,X,g),e(X,je),e(X,U),e(U,it),e(X,B),e(X,ue),e(ue,lt),e(X,F),f(o,P,g),f(o,Be,g),e(Be,Pe),f(o,yt,g),f(o,Ve,g),e(Ve,E),e(E,ct),e(ct,jt),e(E,Pt),e(E,Ee),e(Ee,pt),e(pt,D),e(Ee,he),e(Ee,ut),e(ut,Et),f(o,ae,g),f(o,me,g),e(me,ke),e(ke,Je),T(Ge,Je,null),e(me,Ue),e(me,ht),e(ht,tl),f(o,Fd,g),f(o,bt,g),e(bt,ol),e(bt,mn),e(mn,nl),e(bt,sl),e(bt,Za),e(Za,al),e(bt,rl),f(o,zd,g),f(o,Te,g),e(Te,qa),e(qa,dl),e(Te,il),e(Te,Wa),e(Wa,ll),e(Te,cl),e(Te,Sa),e(Sa,pl),e(Te,ul),e(Te,fn),e(fn,hl),e(fn,gn),e(gn,ml),e(fn,fl),e(Te,gl),e(Te,ao),e(ao,_n),e(_n,_l),e(ao,yl),e(ao,yn),e(yn,bl),e(ao,vl),f(o,xd,g),f(o,Jt,g),e(Jt,ro),e(ro,Na),T(bn,Na,null),e(Jt,kl),e(Jt,Aa),e(Aa,Tl),f(o,jd,g),f(o,vt,g),e(vt,io),e(io,vn),e(vn,wl),e(io,Ml),e(io,kn),e(kn,$l),e(io,Fl),e(vt,zl),e(vt,Ba),e(Ba,xl),e(vt,jl),e(vt,Va),e(Va,Pl),f(o,Pd,g),f(o,Gt,g),e(Gt,lo),e(lo,Ra),T(Tn,Ra,null),e(Gt,El),e(Gt,Xa),e(Xa,Jl),f(o,Ed,g),f(o,we,g),e(we,La),e(La,Oa),e(Oa,Gl),e(we,Ul),e(we,Ha),e(Ha,ea),e(ea,Cl),e(ea,ta),e(ta,Il),e(we,Zl),e(we,wn),e(wn,Da),e(Da,ql),e(wn,Wl),e(wn,Ut),e(Ut,Qa),e(Qa,Sl),e(Ut,Nl),e(Ut,Ya),e(Ya,Al),e(Ut,Bl),e(Ut,Mn),e(Mn,Vl),e(Mn,Ka),e(Ka,Rl),e(Mn,Xl),e(we,Ll),e(we,er),e(er,mt),e(mt,Ol),e(mt,tr),e(tr,Hl),e(mt,Dl),e(mt,or),e(or,Ql),e(mt,Yl),e(mt,nr),e(nr,Kl),e(mt,ec),e(we,tc),e(we,sr),e(sr,Ct),e(Ct,oc),e(Ct,$n),e($n,nc),e(Ct,sc),e(Ct,ar),e(ar,ac),e(Ct,rc),f(o,Jd,g),f(o,It,g),e(It,co),e(co,rr),T(Fn,rr,null),e(It,dc),e(It,dr),e(dr,ic),f(o,Gd,g),T(zn,o,g),f(o,Ud,g),f(o,Zt,g),e(Zt,po),e(po,ir),T(xn,ir,null),e(Zt,lc),e(Zt,lr),e(lr,cc),f(o,Cd,g),f(o,kt,g),e(kt,cr),e(cr,oa),e(oa,pc),e(kt,uc),e(kt,pr),e(pr,na),e(na,hc),e(kt,mc),e(kt,ur),e(ur,sa),e(sa,fc),f(o,Id,g),f(o,qt,g),e(qt,uo),e(uo,hr),T(jn,hr,null),e(qt,gc),e(qt,mr),e(mr,_c),f(o,Zd,g),f(o,Ce,g),T(Pn,Ce,null),e(Ce,yc),e(Ce,Wt),e(Wt,bc),e(Wt,aa),e(aa,vc),e(Wt,kc),e(Wt,En),e(En,Tc),e(Wt,wc),e(Ce,Mc),e(Ce,St),e(St,$c),e(St,ra),e(ra,Fc),e(St,zc),e(St,da),e(da,xc),e(St,jc),e(Ce,Pc),T(ho,Ce,null),f(o,qd,g),f(o,Nt,g),e(Nt,mo),e(mo,fr),T(Jn,fr,null),e(Nt,Ec),e(Nt,gr),e(gr,Jc),f(o,Wd,g),f(o,fo,g),e(fo,Gc),e(fo,_r),e(_r,Uc),e(fo,Cc),f(o,Sd,g),f(o,V,g),T(Gn,V,null),e(V,Ic),e(V,Un),e(Un,Zc),e(Un,Cn),e(Cn,qc),e(Un,Wc),e(V,Sc),e(V,In),e(In,Nc),e(In,ia),e(ia,Ac),e(In,Bc),e(V,Vc),e(V,Re),T(Zn,Re,null),e(Re,Rc),e(Re,qn),e(qn,Xc),e(qn,yr),e(yr,Lc),e(qn,Oc),e(Re,Hc),e(Re,Wn),e(Wn,la),e(la,Dc),e(la,br),e(br,Qc),e(Wn,Yc),e(Wn,Sn),e(Sn,Kc),e(Sn,vr),e(vr,ep),e(Sn,tp),e(Re,op),e(Re,kr),e(kr,np),e(V,sp),e(V,go),T(Nn,go,null),e(go,ap),e(go,Tr),e(Tr,rp),e(V,dp),e(V,_o),T(An,_o,null),e(_o,ip),e(_o,wr),e(wr,lp),e(V,cp),e(V,yo),T(Bn,yo,null),e(yo,pp),e(yo,Mr),e(Mr,up),f(o,Nd,g),f(o,At,g),e(At,bo),e(bo,$r),T(Vn,$r,null),e(At,hp),e(At,Fr),e(Fr,mp),f(o,Ad,g),f(o,fe,g),T(Rn,fe,null),e(fe,fp),e(fe,Bt),e(Bt,gp),e(Bt,zr),e(zr,_p),e(Bt,yp),e(Bt,Xn),e(Xn,bp),e(Bt,vp),e(fe,kp),e(fe,Ln),e(Ln,Tp),e(Ln,ca),e(ca,wp),e(Ln,Mp),e(fe,$p),e(fe,Tt),T(On,Tt,null),e(Tt,Fp),e(Tt,xr),e(xr,zp),e(Tt,xp),e(Tt,Hn),e(Hn,pa),e(pa,jp),e(pa,jr),e(jr,Pp),e(Hn,Ep),e(Hn,Dn),e(Dn,Jp),e(Dn,Pr),e(Pr,Gp),e(Dn,Up),e(fe,Cp),e(fe,vo),T(Qn,vo,null),e(vo,Ip),e(vo,Er),e(Er,Zp),f(o,Bd,g),f(o,Vt,g),e(Vt,ko),e(ko,Jr),T(Yn,Jr,null),e(Vt,qp),e(Vt,Gr),e(Gr,Wp),f(o,Vd,g),f(o,Ie,g),T(Kn,Ie,null),e(Ie,Sp),e(Ie,es),e(es,Np),e(es,ua),e(ua,Ap),e(es,Bp),e(Ie,Vp),e(Ie,ts),e(ts,Rp),e(ts,os),e(os,Xp),e(ts,Lp),e(Ie,Op),e(Ie,Xe),T(ns,Xe,null),e(Xe,Hp),e(Xe,Rt),e(Rt,Dp),e(Rt,ha),e(ha,Qp),e(Rt,Yp),e(Rt,Ur),e(Ur,Kp),e(Rt,eu),e(Xe,tu),T(To,Xe,null),e(Xe,ou),T(wo,Xe,null),f(o,Rd,g),f(o,Xt,g),e(Xt,Mo),e(Mo,Cr),T(ss,Cr,null),e(Xt,nu),e(Xt,Ir),e(Ir,su),f(o,Xd,g),f(o,Ze,g),T(as,Ze,null),e(Ze,au),e(Ze,rs),e(rs,ru),e(rs,ma),e(ma,du),e(rs,iu),e(Ze,lu),e(Ze,ds),e(ds,cu),e(ds,is),e(is,pu),e(ds,uu),e(Ze,hu),e(Ze,Le),T(ls,Le,null),e(Le,mu),e(Le,Lt),e(Lt,fu),e(Lt,fa),e(fa,gu),e(Lt,_u),e(Lt,Zr),e(Zr,yu),e(Lt,bu),e(Le,vu),T($o,Le,null),e(Le,ku),T(Fo,Le,null),f(o,Ld,g),f(o,Ot,g),e(Ot,zo),e(zo,qr),T(cs,qr,null),e(Ot,Tu),e(Ot,Wr),e(Wr,wu),f(o,Od,g),f(o,Ht,g),T(ps,Ht,null),e(Ht,Mu),e(Ht,xo),T(us,xo,null),e(xo,$u),T(jo,xo,null),f(o,Hd,g),f(o,Dt,g),e(Dt,Po),e(Po,Sr),T(hs,Sr,null),e(Dt,Fu),e(Dt,Nr),e(Nr,zu),f(o,Dd,g),f(o,ge,g),T(ms,ge,null),e(ge,xu),e(ge,fs),e(fs,ju),e(fs,ga),e(ga,Pu),e(fs,Eu),e(ge,Ju),e(ge,gs),e(gs,Gu),e(gs,_s),e(_s,Uu),e(gs,Cu),e(ge,Iu),T(Eo,ge,null),e(ge,Zu),e(ge,Oe),T(ys,Oe,null),e(Oe,qu),e(Oe,Qt),e(Qt,Wu),e(Qt,_a),e(_a,Su),e(Qt,Nu),e(Qt,Ar),e(Ar,Au),e(Qt,Bu),e(Oe,Vu),T(Jo,Oe,null),e(Oe,Ru),T(Go,Oe,null),f(o,Qd,g),f(o,Yt,g),e(Yt,Uo),e(Uo,Br),T(bs,Br,null),e(Yt,Xu),e(Yt,Vr),e(Vr,Lu),f(o,Yd,g),f(o,_e,g),T(vs,_e,null),e(_e,Ou),e(_e,ks),e(ks,Hu),e(ks,ya),e(ya,Du),e(ks,Qu),e(_e,Yu),e(_e,Ts),e(Ts,Ku),e(Ts,ws),e(ws,eh),e(Ts,th),e(_e,oh),T(Co,_e,null),e(_e,nh),e(_e,He),T(Ms,He,null),e(He,sh),e(He,Kt),e(Kt,ah),e(Kt,ba),e(ba,rh),e(Kt,dh),e(Kt,Rr),e(Rr,ih),e(Kt,lh),e(He,ch),T(Io,He,null),e(He,ph),T(Zo,He,null),f(o,Kd,g),f(o,eo,g),e(eo,qo),e(qo,Xr),T($s,Xr,null),e(eo,uh),e(eo,Lr),e(Lr,hh),f(o,ei,g),f(o,W,g),T(Fs,W,null),e(W,mh),e(W,zs),e(zs,fh),e(zs,va),e(va,gh),e(zs,_h),e(W,yh),e(W,xs),e(xs,bh),e(xs,js),e(js,vh),e(xs,kh),e(W,Th),e(W,Or),e(Or,wh),e(W,Mh),e(W,ft),e(ft,Hr),e(Hr,Ps),e(Ps,$h),e(ft,Fh),e(ft,Dr),e(Dr,Es),e(Es,zh),e(ft,xh),e(ft,Qr),e(Qr,Js),e(Js,jh),e(ft,Ph),e(ft,Yr),e(Yr,Gs),e(Gs,Eh),e(W,Jh),e(W,De),T(Us,De,null),e(De,Gh),e(De,to),e(to,Uh),e(to,Kr),e(Kr,Ch),e(to,Ih),e(to,ed),e(ed,Zh),e(to,qh),e(De,Wh),T(Wo,De,null),e(De,Sh),T(So,De,null),e(W,Nh),e(W,No),T(Cs,No,null),e(No,Ah),T(Ao,No,null),e(W,Bh),e(W,Bo),T(Is,Bo,null),e(Bo,Vh),T(Vo,Bo,null),f(o,ti,g),f(o,oo,g),e(oo,Ro),e(Ro,td),T(Zs,td,null),e(oo,Rh),e(oo,od),e(od,Xh),f(o,oi,g),f(o,S,g),T(qs,S,null),e(S,Lh),e(S,Ws),e(Ws,Oh),e(Ws,ka),e(ka,Hh),e(Ws,Dh),e(S,Qh),e(S,Ss),e(Ss,Yh),e(Ss,Ns),e(Ns,Kh),e(Ss,em),e(S,tm),e(S,nd),e(nd,om),e(S,nm),e(S,gt),e(gt,sd),e(sd,As),e(As,sm),e(gt,am),e(gt,ad),e(ad,Bs),e(Bs,rm),e(gt,dm),e(gt,rd),e(rd,Vs),e(Vs,im),e(gt,lm),e(gt,dd),e(dd,Rs),e(Rs,cm),e(S,pm),e(S,Me),T(Xs,Me,null),e(Me,um),e(Me,no),e(no,hm),e(no,id),e(id,mm),e(no,fm),e(no,ld),e(ld,gm),e(no,_m),e(Me,ym),T(Xo,Me,null),e(Me,bm),T(Lo,Me,null),e(Me,vm),T(Oo,Me,null),e(S,km),e(S,Ho),T(Ls,Ho,null),e(Ho,Tm),T(Do,Ho,null),e(S,wm),e(S,Qo),T(Os,Qo,null),e(Qo,Mm),T(Yo,Qo,null),ni=!0},p(o,[g]){const Hs={};g&2&&(Hs.$$scope={dirty:g,ctx:o}),ho.$set(Hs);const cd={};g&2&&(cd.$$scope={dirty:g,ctx:o}),To.$set(cd);const pd={};g&2&&(pd.$$scope={dirty:g,ctx:o}),wo.$set(pd);const ud={};g&2&&(ud.$$scope={dirty:g,ctx:o}),$o.$set(ud);const Ds={};g&2&&(Ds.$$scope={dirty:g,ctx:o}),Fo.$set(Ds);const hd={};g&2&&(hd.$$scope={dirty:g,ctx:o}),jo.$set(hd);const md={};g&2&&(md.$$scope={dirty:g,ctx:o}),Eo.$set(md);const Ko={};g&2&&(Ko.$$scope={dirty:g,ctx:o}),Jo.$set(Ko);const fd={};g&2&&(fd.$$scope={dirty:g,ctx:o}),Go.$set(fd);const gd={};g&2&&(gd.$$scope={dirty:g,ctx:o}),Co.$set(gd);const Qs={};g&2&&(Qs.$$scope={dirty:g,ctx:o}),Io.$set(Qs);const _d={};g&2&&(_d.$$scope={dirty:g,ctx:o}),Zo.$set(_d);const yd={};g&2&&(yd.$$scope={dirty:g,ctx:o}),Wo.$set(yd);const bd={};g&2&&(bd.$$scope={dirty:g,ctx:o}),So.$set(bd);const Ys={};g&2&&(Ys.$$scope={dirty:g,ctx:o}),Ao.$set(Ys);const vd={};g&2&&(vd.$$scope={dirty:g,ctx:o}),Vo.$set(vd);const kd={};g&2&&(kd.$$scope={dirty:g,ctx:o}),Xo.$set(kd);const Ks={};g&2&&(Ks.$$scope={dirty:g,ctx:o}),Lo.$set(Ks);const Td={};g&2&&(Td.$$scope={dirty:g,ctx:o}),Oo.$set(Td);const wd={};g&2&&(wd.$$scope={dirty:g,ctx:o}),Do.$set(wd);const so={};g&2&&(so.$$scope={dirty:g,ctx:o}),Yo.$set(so)},i(o){ni||(w(i.$$.fragment,o),w(O.$$.fragment,o),w(Ge.$$.fragment,o),w(bn.$$.fragment,o),w(Tn.$$.fragment,o),w(Fn.$$.fragment,o),w(zn.$$.fragment,o),w(xn.$$.fragment,o),w(jn.$$.fragment,o),w(Pn.$$.fragment,o),w(ho.$$.fragment,o),w(Jn.$$.fragment,o),w(Gn.$$.fragment,o),w(Zn.$$.fragment,o),w(Nn.$$.fragment,o),w(An.$$.fragment,o),w(Bn.$$.fragment,o),w(Vn.$$.fragment,o),w(Rn.$$.fragment,o),w(On.$$.fragment,o),w(Qn.$$.fragment,o),w(Yn.$$.fragment,o),w(Kn.$$.fragment,o),w(ns.$$.fragment,o),w(To.$$.fragment,o),w(wo.$$.fragment,o),w(ss.$$.fragment,o),w(as.$$.fragment,o),w(ls.$$.fragment,o),w($o.$$.fragment,o),w(Fo.$$.fragment,o),w(cs.$$.fragment,o),w(ps.$$.fragment,o),w(us.$$.fragment,o),w(jo.$$.fragment,o),w(hs.$$.fragment,o),w(ms.$$.fragment,o),w(Eo.$$.fragment,o),w(ys.$$.fragment,o),w(Jo.$$.fragment,o),w(Go.$$.fragment,o),w(bs.$$.fragment,o),w(vs.$$.fragment,o),w(Co.$$.fragment,o),w(Ms.$$.fragment,o),w(Io.$$.fragment,o),w(Zo.$$.fragment,o),w($s.$$.fragment,o),w(Fs.$$.fragment,o),w(Us.$$.fragment,o),w(Wo.$$.fragment,o),w(So.$$.fragment,o),w(Cs.$$.fragment,o),w(Ao.$$.fragment,o),w(Is.$$.fragment,o),w(Vo.$$.fragment,o),w(Zs.$$.fragment,o),w(qs.$$.fragment,o),w(Xs.$$.fragment,o),w(Xo.$$.fragment,o),w(Lo.$$.fragment,o),w(Oo.$$.fragment,o),w(Ls.$$.fragment,o),w(Do.$$.fragment,o),w(Os.$$.fragment,o),w(Yo.$$.fragment,o),ni=!0)},o(o){M(i.$$.fragment,o),M(O.$$.fragment,o),M(Ge.$$.fragment,o),M(bn.$$.fragment,o),M(Tn.$$.fragment,o),M(Fn.$$.fragment,o),M(zn.$$.fragment,o),M(xn.$$.fragment,o),M(jn.$$.fragment,o),M(Pn.$$.fragment,o),M(ho.$$.fragment,o),M(Jn.$$.fragment,o),M(Gn.$$.fragment,o),M(Zn.$$.fragment,o),M(Nn.$$.fragment,o),M(An.$$.fragment,o),M(Bn.$$.fragment,o),M(Vn.$$.fragment,o),M(Rn.$$.fragment,o),M(On.$$.fragment,o),M(Qn.$$.fragment,o),M(Yn.$$.fragment,o),M(Kn.$$.fragment,o),M(ns.$$.fragment,o),M(To.$$.fragment,o),M(wo.$$.fragment,o),M(ss.$$.fragment,o),M(as.$$.fragment,o),M(ls.$$.fragment,o),M($o.$$.fragment,o),M(Fo.$$.fragment,o),M(cs.$$.fragment,o),M(ps.$$.fragment,o),M(us.$$.fragment,o),M(jo.$$.fragment,o),M(hs.$$.fragment,o),M(ms.$$.fragment,o),M(Eo.$$.fragment,o),M(ys.$$.fragment,o),M(Jo.$$.fragment,o),M(Go.$$.fragment,o),M(bs.$$.fragment,o),M(vs.$$.fragment,o),M(Co.$$.fragment,o),M(Ms.$$.fragment,o),M(Io.$$.fragment,o),M(Zo.$$.fragment,o),M($s.$$.fragment,o),M(Fs.$$.fragment,o),M(Us.$$.fragment,o),M(Wo.$$.fragment,o),M(So.$$.fragment,o),M(Cs.$$.fragment,o),M(Ao.$$.fragment,o),M(Is.$$.fragment,o),M(Vo.$$.fragment,o),M(Zs.$$.fragment,o),M(qs.$$.fragment,o),M(Xs.$$.fragment,o),M(Xo.$$.fragment,o),M(Lo.$$.fragment,o),M(Oo.$$.fragment,o),M(Ls.$$.fragment,o),M(Do.$$.fragment,o),M(Os.$$.fragment,o),M(Yo.$$.fragment,o),ni=!1},d(o){t(u),o&&t(b),o&&t(_),$(i),o&&t(Se),o&&t(Z),o&&t(K),o&&t(L),o&&t(Ne),o&&t(q),$(O),o&&t(te),o&&t(oe),o&&t(I),o&&t(ve),o&&t(Ae),o&&t(ne),o&&t(se),o&&t(X),o&&t(P),o&&t(Be),o&&t(yt),o&&t(Ve),o&&t(ae),o&&t(me),$(Ge),o&&t(Fd),o&&t(bt),o&&t(zd),o&&t(Te),o&&t(xd),o&&t(Jt),$(bn),o&&t(jd),o&&t(vt),o&&t(Pd),o&&t(Gt),$(Tn),o&&t(Ed),o&&t(we),o&&t(Jd),o&&t(It),$(Fn),o&&t(Gd),$(zn,o),o&&t(Ud),o&&t(Zt),$(xn),o&&t(Cd),o&&t(kt),o&&t(Id),o&&t(qt),$(jn),o&&t(Zd),o&&t(Ce),$(Pn),$(ho),o&&t(qd),o&&t(Nt),$(Jn),o&&t(Wd),o&&t(fo),o&&t(Sd),o&&t(V),$(Gn),$(Zn),$(Nn),$(An),$(Bn),o&&t(Nd),o&&t(At),$(Vn),o&&t(Ad),o&&t(fe),$(Rn),$(On),$(Qn),o&&t(Bd),o&&t(Vt),$(Yn),o&&t(Vd),o&&t(Ie),$(Kn),$(ns),$(To),$(wo),o&&t(Rd),o&&t(Xt),$(ss),o&&t(Xd),o&&t(Ze),$(as),$(ls),$($o),$(Fo),o&&t(Ld),o&&t(Ot),$(cs),o&&t(Od),o&&t(Ht),$(ps),$(us),$(jo),o&&t(Hd),o&&t(Dt),$(hs),o&&t(Dd),o&&t(ge),$(ms),$(Eo),$(ys),$(Jo),$(Go),o&&t(Qd),o&&t(Yt),$(bs),o&&t(Yd),o&&t(_e),$(vs),$(Co),$(Ms),$(Io),$(Zo),o&&t(Kd),o&&t(eo),$($s),o&&t(ei),o&&t(W),$(Fs),$(Us),$(Wo),$(So),$(Cs),$(Ao),$(Is),$(Vo),o&&t(ti),o&&t(oo),$(Zs),o&&t(oi),o&&t(S),$(qs),$(Xs),$(Xo),$(Lo),$(Oo),$(Ls),$(Do),$(Os),$(Yo)}}}const B_={local:"pegasus",sections:[{local:"overview",title:"Overview"},{local:"checkpoints",sections:[{local:"examples",title:"Examples"}],title:"Checkpoints"},{local:"implementation-notes",title:"Implementation Notes"},{local:"usage-example",title:"Usage Example"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.PegasusConfig",title:"PegasusConfig"},{local:"transformers.PegasusTokenizer",title:"PegasusTokenizer"},{local:"transformers.PegasusTokenizerFast",title:"PegasusTokenizerFast"},{local:"transformers.PegasusModel",title:"PegasusModel"},{local:"transformers.PegasusForConditionalGeneration",title:"PegasusForConditionalGeneration"},{local:"transformers.PegasusForCausalLM",title:"PegasusForCausalLM"},{local:"transformers.TFPegasusModel",title:"TFPegasusModel"},{local:"transformers.TFPegasusForConditionalGeneration",title:"TFPegasusForConditionalGeneration"},{local:"transformers.FlaxPegasusModel",title:"FlaxPegasusModel"},{local:"transformers.FlaxPegasusForConditionalGeneration",title:"FlaxPegasusForConditionalGeneration"}],title:"Pegasus"};function V_(z){return v_(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Q_ extends g_{constructor(u){super();__(this,u,V_,A_,y_,{})}}export{Q_ as default,B_ as metadata};
