import{S as g_,i as __,s as y_,e as n,k as l,w as k,t as r,M as b_,c as s,d as t,m as c,a,x as v,h as i,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 k_,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 ze}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 v_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function T_(F){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(d){u=s(d,"P",{});var h=a(u);b=i(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=i(j,"Module"),j.forEach(t),y=i(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(d,h){f(d,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(d){d&&t(u)}}}function w_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function M_(F){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(d){u=s(d,"P",{});var h=a(u);b=i(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=i(j,"Module"),j.forEach(t),y=i(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(d,h){f(d,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(d){d&&t(u)}}}function $_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Summarization example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function z_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function F_(F){let u,b,_,m,y,d,h,j,Qe,Se,C,ye,Y,x,Ye,V,be,_t,K,L,Fe,de,Ke,le,ce,et,Ne,q,ee,xe,O,G,I,tt,te,oe,ot,N,nt,st,Z,ke,pe,Ae,ne,H,at,rt,A,it,se,X,je,U,dt,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:"),d=l(),h=n("ul"),j=n("li"),Qe=r("having all inputs as keyword arguments (like PyTorch models), or"),Se=l(),C=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 `),V=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()"),Fe=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),de=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"),I=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(),Z=n("li"),ke=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"),it=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"),dt=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(z){u=s(z,"P",{});var P=a(u);b=i(P,"TensorFlow models and layers in "),_=s(P,"CODE",{});var Be=a(_);m=i(Be,"transformers"),Be.forEach(t),y=i(P," accept two formats as input:"),P.forEach(t),d=c(z),h=s(z,"UL",{});var Pe=a(h);j=s(Pe,"LI",{});var yt=a(j);Qe=i(yt,"having all inputs as keyword arguments (like PyTorch models), or"),yt.forEach(t),Se=c(Pe),C=s(Pe,"LI",{});var Re=a(C);ye=i(Re,"having all inputs as a list, tuple or dict in the first positional argument."),Re.forEach(t),Pe.forEach(t),Y=c(z),x=s(z,"P",{});var E=a(x);Ye=i(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 `),V=s(E,"CODE",{});var ct=a(V);be=i(ct,"model.fit()"),ct.forEach(t),_t=i(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=i(jt,"model.fit()"),jt.forEach(t),Fe=i(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),de=s(E,"CODE",{});var Pt=a(de);Ke=i(Pt,"fit()"),Pt.forEach(t),le=i(E," and "),ce=s(E,"CODE",{});var Ee=a(ce);et=i(Ee,"predict()"),Ee.forEach(t),Ne=i(E,`, such as when creating your own layers or models with
the Keras `),q=s(E,"CODE",{});var pt=a(q);ee=i(pt,"Functional"),pt.forEach(t),xe=i(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(z),G=s(z,"UL",{});var D=a(G);I=s(D,"LI",{});var he=a(I);tt=i(he,"a single Tensor with "),te=s(he,"CODE",{});var ut=a(te);oe=i(ut,"input_ids"),ut.forEach(t),ot=i(he," only and nothing else: "),N=s(he,"CODE",{});var Et=a(N);nt=i(Et,"model(input_ids)"),Et.forEach(t),he.forEach(t),st=c(D),Z=s(D,"LI",{});var ae=a(Z);ke=i(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=i(me,"model([input_ids, attention_mask])"),me.forEach(t),ne=i(ae," or "),H=s(ae,"CODE",{});var ve=a(H);at=i(ve,"model([input_ids, attention_mask, token_type_ids])"),ve.forEach(t),ae.forEach(t),rt=c(D),A=s(D,"LI",{});var Je=a(A);it=i(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=i(Ge,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ge.forEach(t),Je.forEach(t),D.forEach(t),je=c(z),U=s(z,"P",{});var Ue=a(U);dt=i(Ue,`Note that when creating models and layers with
`),B=s(Ue,"A",{href:!0,rel:!0});var ht=a(B);ue=i(ht,"subclassing"),ht.forEach(t),lt=i(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(z,P){f(z,u,P),e(u,b),e(u,_),e(_,m),e(u,y),f(z,d,P),f(z,h,P),e(h,j),e(j,Qe),e(h,Se),e(h,C),e(C,ye),f(z,Y,P),f(z,x,P),e(x,Ye),e(x,V),e(V,be),e(x,_t),e(x,K),e(K,L),e(x,Fe),e(x,de),e(de,Ke),e(x,le),e(x,ce),e(ce,et),e(x,Ne),e(x,q),e(q,ee),e(x,xe),f(z,O,P),f(z,G,P),e(G,I),e(I,tt),e(I,te),e(te,oe),e(I,ot),e(I,N),e(N,nt),e(G,st),e(G,Z),e(Z,ke),e(Z,pe),e(pe,Ae),e(Z,ne),e(Z,H),e(H,at),e(G,rt),e(G,A),e(A,it),e(A,se),e(se,X),f(z,je,P),f(z,U,P),e(U,dt),e(U,B),e(B,ue),e(U,lt)},d(z){z&&t(u),z&&t(d),z&&t(h),z&&t(Y),z&&t(x),z&&t(O),z&&t(G),z&&t(je),z&&t(U)}}}function x_(F){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(d){u=s(d,"P",{});var h=a(u);b=i(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=i(j,"Module"),j.forEach(t),y=i(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(d,h){f(d,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(d){d&&t(u)}}}function j_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function P_(F){let u,b,_,m,y,d,h,j,Qe,Se,C,ye,Y,x,Ye,V,be,_t,K,L,Fe,de,Ke,le,ce,et,Ne,q,ee,xe,O,G,I,tt,te,oe,ot,N,nt,st,Z,ke,pe,Ae,ne,H,at,rt,A,it,se,X,je,U,dt,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:"),d=l(),h=n("ul"),j=n("li"),Qe=r("having all inputs as keyword arguments (like PyTorch models), or"),Se=l(),C=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 `),V=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()"),Fe=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),de=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"),I=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(),Z=n("li"),ke=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"),it=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"),dt=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(z){u=s(z,"P",{});var P=a(u);b=i(P,"TensorFlow models and layers in "),_=s(P,"CODE",{});var Be=a(_);m=i(Be,"transformers"),Be.forEach(t),y=i(P," accept two formats as input:"),P.forEach(t),d=c(z),h=s(z,"UL",{});var Pe=a(h);j=s(Pe,"LI",{});var yt=a(j);Qe=i(yt,"having all inputs as keyword arguments (like PyTorch models), or"),yt.forEach(t),Se=c(Pe),C=s(Pe,"LI",{});var Re=a(C);ye=i(Re,"having all inputs as a list, tuple or dict in the first positional argument."),Re.forEach(t),Pe.forEach(t),Y=c(z),x=s(z,"P",{});var E=a(x);Ye=i(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 `),V=s(E,"CODE",{});var ct=a(V);be=i(ct,"model.fit()"),ct.forEach(t),_t=i(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=i(jt,"model.fit()"),jt.forEach(t),Fe=i(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),de=s(E,"CODE",{});var Pt=a(de);Ke=i(Pt,"fit()"),Pt.forEach(t),le=i(E," and "),ce=s(E,"CODE",{});var Ee=a(ce);et=i(Ee,"predict()"),Ee.forEach(t),Ne=i(E,`, such as when creating your own layers or models with
the Keras `),q=s(E,"CODE",{});var pt=a(q);ee=i(pt,"Functional"),pt.forEach(t),xe=i(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(z),G=s(z,"UL",{});var D=a(G);I=s(D,"LI",{});var he=a(I);tt=i(he,"a single Tensor with "),te=s(he,"CODE",{});var ut=a(te);oe=i(ut,"input_ids"),ut.forEach(t),ot=i(he," only and nothing else: "),N=s(he,"CODE",{});var Et=a(N);nt=i(Et,"model(input_ids)"),Et.forEach(t),he.forEach(t),st=c(D),Z=s(D,"LI",{});var ae=a(Z);ke=i(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=i(me,"model([input_ids, attention_mask])"),me.forEach(t),ne=i(ae," or "),H=s(ae,"CODE",{});var ve=a(H);at=i(ve,"model([input_ids, attention_mask, token_type_ids])"),ve.forEach(t),ae.forEach(t),rt=c(D),A=s(D,"LI",{});var Je=a(A);it=i(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=i(Ge,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ge.forEach(t),Je.forEach(t),D.forEach(t),je=c(z),U=s(z,"P",{});var Ue=a(U);dt=i(Ue,`Note that when creating models and layers with
`),B=s(Ue,"A",{href:!0,rel:!0});var ht=a(B);ue=i(ht,"subclassing"),ht.forEach(t),lt=i(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(z,P){f(z,u,P),e(u,b),e(u,_),e(_,m),e(u,y),f(z,d,P),f(z,h,P),e(h,j),e(j,Qe),e(h,Se),e(h,C),e(C,ye),f(z,Y,P),f(z,x,P),e(x,Ye),e(x,V),e(V,be),e(x,_t),e(x,K),e(K,L),e(x,Fe),e(x,de),e(de,Ke),e(x,le),e(x,ce),e(ce,et),e(x,Ne),e(x,q),e(q,ee),e(x,xe),f(z,O,P),f(z,G,P),e(G,I),e(I,tt),e(I,te),e(te,oe),e(I,ot),e(I,N),e(N,nt),e(G,st),e(G,Z),e(Z,ke),e(Z,pe),e(pe,Ae),e(Z,ne),e(Z,H),e(H,at),e(G,rt),e(G,A),e(A,it),e(A,se),e(se,X),f(z,je,P),f(z,U,P),e(U,dt),e(U,B),e(B,ue),e(U,lt)},d(z){z&&t(u),z&&t(d),z&&t(h),z&&t(Y),z&&t(x),z&&t(O),z&&t(G),z&&t(je),z&&t(U)}}}function E_(F){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(d){u=s(d,"P",{});var h=a(u);b=i(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=i(j,"Module"),j.forEach(t),y=i(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(d,h){f(d,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(d){d&&t(u)}}}function J_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Summarization example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function G_(F){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(d){u=s(d,"P",{});var h=a(u);b=i(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=i(j,"Module"),j.forEach(t),y=i(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(d,h){f(d,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(d){d&&t(u)}}}function U_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function I_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function Z_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function C_(F){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(d){u=s(d,"P",{});var h=a(u);b=i(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=i(j,"Module"),j.forEach(t),y=i(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(d,h){f(d,u,h),e(u,b),e(u,_),e(_,m),e(u,y)},d(d){d&&t(u)}}}function q_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Summarization example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function W_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Mask filling example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function S_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function N_(F){let u,b,_,m,y;return m=new ze({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(),k(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);b=i(h,"Example:"),h.forEach(t),_=c(d),v(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,b),f(d,_,h),T(m,d,h),y=!0},p:We,i(d){y||(w(m.$$.fragment,d),y=!0)},o(d){M(m.$$.fragment,d),y=!1},d(d){d&&t(u),d&&t(_),$(m,d)}}}function A_(F){let u,b,_,m,y,d,h,j,Qe,Se,C,ye,Y,x,Ye,V,be,_t,K,L,Fe,de,Ke,le,ce,et,Ne,q,ee,xe,O,G,I,tt,te,oe,ot,N,nt,st,Z,ke,pe,Ae,ne,H,at,rt,A,it,se,X,je,U,dt,B,ue,lt,z,P,Be,Pe,yt,Re,E,ct,jt,Pt,Ee,pt,D,he,ut,Et,ae,me,ve,Je,Ge,Ue,ht,tl,zi,bt,ol,mn,nl,sl,Ca,al,rl,Fi,Te,qa,il,dl,Wa,ll,cl,Sa,pl,ul,fn,hl,gn,ml,fl,gl,ao,_n,_l,yl,yn,bl,kl,xi,Jt,ro,Na,bn,vl,Aa,Tl,ji,kt,io,kn,wl,Ml,vn,$l,zl,Fl,Ba,xl,jl,Ra,Pl,Pi,Gt,lo,Va,Tn,El,Xa,Jl,Ei,we,La,Oa,Gl,Ul,Ha,ea,Il,ta,Zl,Cl,wn,Da,ql,Wl,Ut,Qa,Sl,Nl,Ya,Al,Bl,Mn,Rl,Ka,Vl,Xl,Ll,er,mt,Ol,tr,Hl,Dl,or,Ql,Yl,nr,Kl,ec,tc,sr,It,oc,$n,nc,sc,ar,ac,rc,Ji,Zt,co,rr,zn,ic,ir,dc,Gi,Fn,Ui,Ct,po,dr,xn,lc,lr,cc,Ii,vt,cr,oa,pc,uc,pr,na,hc,mc,ur,sa,fc,Zi,qt,uo,hr,jn,gc,mr,_c,Ci,Ie,Pn,yc,Wt,bc,aa,kc,vc,En,Tc,wc,Mc,St,$c,ra,zc,Fc,ia,xc,jc,Pc,ho,qi,Nt,mo,fr,Jn,Ec,gr,Jc,Wi,fo,Gc,_r,Uc,Ic,Si,R,Gn,Zc,Un,Cc,In,qc,Wc,Sc,Zn,Nc,da,Ac,Bc,Rc,Ve,Cn,Vc,qn,Xc,yr,Lc,Oc,Hc,Wn,la,Dc,br,Qc,Yc,Sn,Kc,kr,ep,tp,op,vr,np,sp,go,Nn,ap,Tr,rp,ip,_o,An,dp,wr,lp,cp,yo,Bn,pp,Mr,up,Ni,At,bo,$r,Rn,hp,zr,mp,Ai,fe,Vn,fp,Bt,gp,Fr,_p,yp,Xn,bp,kp,vp,Ln,Tp,ca,wp,Mp,$p,Tt,On,zp,xr,Fp,xp,Hn,pa,jp,jr,Pp,Ep,Dn,Jp,Pr,Gp,Up,Ip,ko,Qn,Zp,Er,Cp,Bi,Rt,vo,Jr,Yn,qp,Gr,Wp,Ri,Ze,Kn,Sp,es,Np,ua,Ap,Bp,Rp,ts,Vp,os,Xp,Lp,Op,Xe,ns,Hp,Vt,Dp,ha,Qp,Yp,Ur,Kp,eu,tu,To,ou,wo,Vi,Xt,Mo,Ir,ss,nu,Zr,su,Xi,Ce,as,au,rs,ru,ma,iu,du,lu,is,cu,ds,pu,uu,hu,Le,ls,mu,Lt,fu,fa,gu,_u,Cr,yu,bu,ku,$o,vu,zo,Li,Ot,Fo,qr,cs,Tu,Wr,wu,Oi,Ht,ps,Mu,xo,us,$u,jo,Hi,Dt,Po,Sr,hs,zu,Nr,Fu,Di,ge,ms,xu,fs,ju,ga,Pu,Eu,Ju,gs,Gu,_s,Uu,Iu,Zu,Eo,Cu,Oe,ys,qu,Qt,Wu,_a,Su,Nu,Ar,Au,Bu,Ru,Jo,Vu,Go,Qi,Yt,Uo,Br,bs,Xu,Rr,Lu,Yi,_e,ks,Ou,vs,Hu,ya,Du,Qu,Yu,Ts,Ku,ws,eh,th,oh,Io,nh,He,Ms,sh,Kt,ah,ba,rh,ih,Vr,dh,lh,ch,Zo,ph,Co,Ki,eo,qo,Xr,$s,uh,Lr,hh,ed,W,zs,mh,Fs,fh,ka,gh,_h,yh,xs,bh,js,kh,vh,Th,Or,wh,Mh,ft,Hr,Ps,$h,zh,Dr,Es,Fh,xh,Qr,Js,jh,Ph,Yr,Gs,Eh,Jh,De,Us,Gh,to,Uh,Kr,Ih,Zh,ei,Ch,qh,Wh,Wo,Sh,So,Nh,No,Is,Ah,Ao,Bh,Bo,Zs,Rh,Ro,td,oo,Vo,ti,Cs,Vh,oi,Xh,od,S,qs,Lh,Ws,Oh,va,Hh,Dh,Qh,Ss,Yh,Ns,Kh,em,tm,ni,om,nm,gt,si,As,sm,am,ai,Bs,rm,im,ri,Rs,dm,lm,ii,Vs,cm,pm,Me,Xs,um,no,hm,di,mm,fm,li,gm,_m,ym,Xo,bm,Lo,km,Oo,vm,Ho,Ls,Tm,Do,wm,Qo,Os,Mm,Yo,nd;return d=new Q({}),O=new Q({}),Ge=new Q({}),bn=new Q({}),Tn=new Q({}),zn=new Q({}),Fn=new ze({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/main/en/model_doc/pegasus#transformers.PegasusModel">PegasusModel</a> or <a href="/docs/transformers/main/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/main/src/transformers/models/pegasus/configuration_pegasus.py#L29"}}),ho=new qe({props:{anchor:"transformers.PegasusConfig.example",$$slots:{default:[v_]},$$scope:{ctx:F}}}),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/main/src/transformers/models/pegasus/tokenization_pegasus.py#L41"}}),Cn=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/main/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/main/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/main/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/main/src/transformers/models/pegasus/tokenization_pegasus.py#L246"}}),Rn=new Q({}),Vn=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/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_pegasus.py#L1159"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Pegasus 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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_pegasus.py#L1211",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/pegasus#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/main/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:F}}}),wo=new qe({props:{anchor:"transformers.PegasusModel.forward.example",$$slots:{default:[w_]},$$scope:{ctx:F}}}),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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_pegasus.py#L1310"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Pegasus 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/main/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/main/src/transformers/models/pegasus/modeling_pegasus.py#L1373",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/pegasus#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/main/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:F}}}),zo=new qe({props:{anchor:"transformers.PegasusForConditionalGeneration.forward.example",$$slots:{default:[$_]},$$scope:{ctx:F}}}),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/main/src/transformers/models/pegasus/modeling_pegasus.py#L1512"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_pegasus.py#L1567",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:[z_]},$$scope:{ctx:F}}}),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/main/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/main/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/main/src/transformers/models/pegasus/modeling_tf_pegasus.py#L1166"}}),Eo=new hn({props:{$$slots:{default:[F_]},$$scope:{ctx:F}}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Pegasus 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/main/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/main/src/transformers/models/pegasus/modeling_tf_pegasus.py#L1178",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:F}}}),Go=new qe({props:{anchor:"transformers.TFPegasusModel.call.example",$$slots:{default:[j_]},$$scope:{ctx:F}}}),bs=new Q({}),ks=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/main/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/main/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/main/src/transformers/models/pegasus/modeling_tf_pegasus.py#L1271"}}),Io=new hn({props:{$$slots:{default:[P_]},$$scope:{ctx:F}}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Pegasus 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/main/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/main/src/transformers/models/pegasus/modeling_tf_pegasus.py#L1309",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Zo=new hn({props:{$$slots:{default:[E_]},$$scope:{ctx:F}}}),Co=new qe({props:{anchor:"transformers.TFPegasusForConditionalGeneration.call.example",$$slots:{default:[J_]},$$scope:{ctx:F}}}),$s=new Q({}),zs=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/main/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/main/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/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_flax_pegasus.py#L1223"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a>`,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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_flax_pegasus.py#L1158",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:F}}}),So=new qe({props:{anchor:"transformers.FlaxPegasusModel.__call__.example",$$slots:{default:[U_]},$$scope:{ctx:F}}}),Is=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_flax_pegasus.py#L981",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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:[I_]},$$scope:{ctx:F}}}),Zs=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a>`,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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_flax_pegasus.py#L1044",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ro=new qe({props:{anchor:"transformers.FlaxPegasusModel.decode.example",$$slots:{default:[Z_]},$$scope:{ctx:F}}}),Cs=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/main/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/main/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/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_flax_pegasus.py#L1308"}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a>`,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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_flax_pegasus.py#L1158",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:[C_]},$$scope:{ctx:F}}}),Lo=new qe({props:{anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__.example",$$slots:{default:[q_]},$$scope:{ctx:F}}}),Oo=new qe({props:{anchor:"transformers.FlaxPegasusForConditionalGeneration.__call__.example-2",$$slots:{default:[W_]},$$scope:{ctx:F}}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_flax_pegasus.py#L981",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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:F}}}),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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a>`,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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pegasus/modeling_flax_pegasus.py#L1312",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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:F}}}),{c(){u=n("meta"),b=l(),_=n("h1"),m=n("a"),y=n("span"),k(d.$$.fragment),h=l(),j=n("span"),Qe=r("Pegasus"),Se=l(),C=n("div"),ye=n("a"),Y=n("img"),Ye=l(),V=n("a"),be=n("img"),K=l(),L=n("p"),Fe=n("strong"),de=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"),k(O.$$.fragment),G=l(),I=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."),Z=l(),ke=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"),it=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"),dt=r("sshleifer"),B=r(". The Authors\u2019 code can be found "),ue=n("a"),lt=r("here"),z=r("."),P=l(),Be=n("p"),Pe=r("Tips:"),yt=l(),Re=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"),ve=n("a"),Je=n("span"),k(Ge.$$.fragment),Ue=l(),ht=n("span"),tl=r("Checkpoints"),zi=l(),bt=n("p"),ol=r("All the "),mn=n("a"),nl=r("checkpoints"),sl=r(` are fine-tuned for summarization, besides
`),Ca=n("em"),al=r("pegasus-large"),rl=r(", whence the other checkpoints are fine-tuned:"),Fi=l(),Te=n("ul"),qa=n("li"),il=r("Each checkpoint is 2.2 GB on disk and 568M parameters."),dl=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"),kl=r("."),xi=l(),Jt=n("h3"),ro=n("a"),Na=n("span"),k(bn.$$.fragment),vl=l(),Aa=n("span"),Tl=r("Examples"),ji=l(),kt=n("ul"),io=n("li"),kn=n("a"),wl=r("Script"),Ml=r(` to fine-tune pegasus
on the XSUM dataset. Data download instructions at `),vn=n("a"),$l=r("examples/pytorch/summarization/"),zl=r("."),Fl=l(),Ba=n("li"),xl=r("FP16 is not supported (help/ideas on this appreciated!)."),jl=l(),Ra=n("li"),Pl=r("The adafactor optimizer is recommended for pegasus fine-tuning."),Pi=l(),Gt=n("h2"),lo=n("a"),Va=n("span"),k(Tn.$$.fragment),El=l(),Xa=n("span"),Jl=r("Implementation Notes"),Ei=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"),Il=r("The implementation is completely inherited from "),ta=n("a"),Zl=r("BartForConditionalGeneration"),Cl=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"),Rl=r("more beams are used ("),Ka=n("code"),Vl=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"),It=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("."),Ji=l(),Zt=n("h2"),co=n("a"),rr=n("span"),k(zn.$$.fragment),ic=l(),ir=n("span"),dc=r("Usage Example"),Gi=l(),k(Fn.$$.fragment),Ui=l(),Ct=n("h2"),po=n("a"),dr=n("span"),k(xn.$$.fragment),lc=l(),lr=n("span"),cc=r("Documentation resources"),Ii=l(),vt=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"),Zi=l(),qt=n("h2"),uo=n("a"),hr=n("span"),k(jn.$$.fragment),gc=l(),mr=n("span"),_c=r("PegasusConfig"),Ci=l(),Ie=n("div"),k(Pn.$$.fragment),yc=l(),Wt=n("p"),bc=r("This is the configuration class to store the configuration of a "),aa=n("a"),kc=r("PegasusModel"),vc=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"),zc=r("PretrainedConfig"),Fc=r(` and can be used to control the model outputs. Read the
documentation from `),ia=n("a"),xc=r("PretrainedConfig"),jc=r(" for more information."),Pc=l(),k(ho.$$.fragment),qi=l(),Nt=n("h2"),mo=n("a"),fr=n("span"),k(Jn.$$.fragment),Ec=l(),gr=n("span"),Jc=r("PegasusTokenizer"),Wi=l(),fo=n("p"),Gc=r("warning: "),_r=n("code"),Uc=r("add_tokens"),Ic=r(" does not work at the moment."),Si=l(),R=n("div"),k(Gn.$$.fragment),Zc=l(),Un=n("p"),Cc=r("Construct a PEGASUS tokenizer. Based on "),In=n("a"),qc=r("SentencePiece"),Wc=r("."),Sc=l(),Zn=n("p"),Nc=r("This tokenizer inherits from "),da=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.`),Rc=l(),Ve=n("div"),k(Cn.$$.fragment),Vc=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: "),kr=n("code"),ep=r("A B </s>"),tp=r(" (not intended use)"),op=l(),vr=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"),k(Nn.$$.fragment),ap=l(),Tr=n("p"),rp=r("Converts a sequence of tokens (string) in a single string."),ip=l(),_o=n("div"),k(An.$$.fragment),dp=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"),k(Bn.$$.fragment),pp=l(),Mr=n("p"),up=r("Just EOS"),Ni=l(),At=n("h2"),bo=n("a"),$r=n("span"),k(Rn.$$.fragment),hp=l(),zr=n("span"),mp=r("PegasusTokenizerFast"),Ai=l(),fe=n("div"),k(Vn.$$.fragment),fp=l(),Bt=n("p"),gp=r("Construct a \u201Cfast\u201D PEGASUS tokenizer (backed by HuggingFace\u2019s "),Fr=n("em"),_p=r("tokenizers"),yp=r(` library). Based on
`),Xn=n("a"),bp=r("Unigram"),kp=r("."),vp=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"),k(On.$$.fragment),zp=l(),xr=n("p"),Fp=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)"),Ip=l(),ko=n("div"),k(Qn.$$.fragment),Zp=l(),Er=n("p"),Cp=r("Get list where entries are [1] if a token is [eos] or [pad] else 0."),Bi=l(),Rt=n("h2"),vo=n("a"),Jr=n("span"),k(Yn.$$.fragment),qp=l(),Gr=n("span"),Wp=r("PegasusModel"),Ri=l(),Ze=n("div"),k(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.)`),Rp=l(),ts=n("p"),Vp=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"),k(ns.$$.fragment),Hp=l(),Vt=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(),k(To.$$.fragment),ou=l(),k(wo.$$.fragment),Vi=l(),Xt=n("h2"),Mo=n("a"),Ir=n("span"),k(ss.$$.fragment),nu=l(),Zr=n("span"),su=r("PegasusForConditionalGeneration"),Xi=l(),Ce=n("div"),k(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"),iu=r("PreTrainedModel"),du=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(),is=n("p"),cu=r("This model is also a PyTorch "),ds=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"),k(ls.$$.fragment),mu=l(),Lt=n("p"),fu=r("The "),fa=n("a"),gu=r("PegasusForConditionalGeneration"),_u=r(" forward method, overrides the "),Cr=n("code"),yu=r("__call__"),bu=r(" special method."),ku=l(),k($o.$$.fragment),vu=l(),k(zo.$$.fragment),Li=l(),Ot=n("h2"),Fo=n("a"),qr=n("span"),k(cs.$$.fragment),Tu=l(),Wr=n("span"),wu=r("PegasusForCausalLM"),Oi=l(),Ht=n("div"),k(ps.$$.fragment),Mu=l(),xo=n("div"),k(us.$$.fragment),$u=l(),k(jo.$$.fragment),Hi=l(),Dt=n("h2"),Po=n("a"),Sr=n("span"),k(hs.$$.fragment),zu=l(),Nr=n("span"),Fu=r("TFPegasusModel"),Di=l(),ge=n("div"),k(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"),Iu=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.`),Zu=l(),k(Eo.$$.fragment),Cu=l(),Oe=n("div"),k(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."),Ru=l(),k(Jo.$$.fragment),Vu=l(),k(Go.$$.fragment),Qi=l(),Yt=n("h2"),Uo=n("a"),Br=n("span"),k(bs.$$.fragment),Xu=l(),Rr=n("span"),Lu=r("TFPegasusForConditionalGeneration"),Yi=l(),_e=n("div"),k(ks.$$.fragment),Ou=l(),vs=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(),k(Io.$$.fragment),nh=l(),He=n("div"),k(Ms.$$.fragment),sh=l(),Kt=n("p"),ah=r("The "),ba=n("a"),rh=r("TFPegasusForConditionalGeneration"),ih=r(" forward method, overrides the "),Vr=n("code"),dh=r("__call__"),lh=r(" special method."),ch=l(),k(Zo.$$.fragment),ph=l(),k(Co.$$.fragment),Ki=l(),eo=n("h2"),qo=n("a"),Xr=n("span"),k($s.$$.fragment),uh=l(),Lr=n("span"),hh=r("FlaxPegasusModel"),ed=l(),W=n("div"),k(zs.$$.fragment),mh=l(),Fs=n("p"),fh=r(`The bare Pegasus Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),ka=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"),kh=r("flax.nn.Module"),vh=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"),zh=l(),Dr=n("li"),Es=n("a"),Fh=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"),k(Us.$$.fragment),Gh=l(),to=n("p"),Uh=r("The "),Kr=n("code"),Ih=r("FlaxPegasusPreTrainedModel"),Zh=r(" forward method, overrides the "),ei=n("code"),Ch=r("__call__"),qh=r(" special method."),Wh=l(),k(Wo.$$.fragment),Sh=l(),k(So.$$.fragment),Nh=l(),No=n("div"),k(Is.$$.fragment),Ah=l(),k(Ao.$$.fragment),Bh=l(),Bo=n("div"),k(Zs.$$.fragment),Rh=l(),k(Ro.$$.fragment),td=l(),oo=n("h2"),Vo=n("a"),ti=n("span"),k(Cs.$$.fragment),Vh=l(),oi=n("span"),Xh=r("FlaxPegasusForConditionalGeneration"),od=l(),S=n("div"),k(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 `),va=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(),ni=n("p"),om=r("Finally, this model supports inherent JAX features such as:"),nm=l(),gt=n("ul"),si=n("li"),As=n("a"),sm=r("Just-In-Time (JIT) compilation"),am=l(),ai=n("li"),Bs=n("a"),rm=r("Automatic Differentiation"),im=l(),ri=n("li"),Rs=n("a"),dm=r("Vectorization"),lm=l(),ii=n("li"),Vs=n("a"),cm=r("Parallelization"),pm=l(),Me=n("div"),k(Xs.$$.fragment),um=l(),no=n("p"),hm=r("The "),di=n("code"),mm=r("FlaxPegasusPreTrainedModel"),fm=r(" forward method, overrides the "),li=n("code"),gm=r("__call__"),_m=r(" special method."),ym=l(),k(Xo.$$.fragment),bm=l(),k(Lo.$$.fragment),km=l(),k(Oo.$$.fragment),vm=l(),Ho=n("div"),k(Ls.$$.fragment),Tm=l(),k(Do.$$.fragment),wm=l(),Qo=n("div"),k(Os.$$.fragment),Mm=l(),k(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 ci=a(m);y=s(ci,"SPAN",{});var pi=a(y);v(d.$$.fragment,pi),pi.forEach(t),ci.forEach(t),h=c(Hs),j=s(Hs,"SPAN",{});var ui=a(j);Qe=i(ui,"Pegasus"),ui.forEach(t),Hs.forEach(t),Se=c(o),C=s(o,"DIV",{class:!0});var Ds=a(C);ye=s(Ds,"A",{href:!0});var hi=a(ye);Y=s(hi,"IMG",{alt:!0,src:!0}),hi.forEach(t),Ye=c(Ds),V=s(Ds,"A",{href:!0});var mi=a(V);be=s(mi,"IMG",{alt:!0,src:!0}),mi.forEach(t),Ds.forEach(t),K=c(o),L=s(o,"P",{});var Ko=a(L);Fe=s(Ko,"STRONG",{});var fi=a(Fe);de=i(fi,"DISCLAIMER:"),fi.forEach(t),Ke=i(Ko," If you see something strange, file a "),le=s(Ko,"A",{href:!0,rel:!0});var gi=a(le);ce=i(gi,"Github Issue"),gi.forEach(t),et=i(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 _i=a(ee);xe=s(_i,"SPAN",{});var yi=a(xe);v(O.$$.fragment,yi),yi.forEach(t),_i.forEach(t),G=c(Qs),I=s(Qs,"SPAN",{});var bi=a(I);tt=i(bi,"Overview"),bi.forEach(t),Qs.forEach(t),te=c(o),oe=s(o,"P",{});var Ys=a(oe);ot=i(Ys,"The Pegasus model was proposed in "),N=s(Ys,"A",{href:!0,rel:!0});var ki=a(N);nt=i(ki,"PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization"),ki.forEach(t),st=i(Ys," by Jingqing Zhang, Yao Zhao, Mohammad Saleh and Peter J. Liu on Dec 18, 2019."),Ys.forEach(t),Z=c(o),ke=s(o,"P",{});var vi=a(ke);pe=i(vi,"According to the abstract,"),vi.forEach(t),Ae=c(o),ne=s(o,"UL",{});var Ks=a(ne);H=s(Ks,"LI",{});var Ti=a(H);at=i(Ti,`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.`),Ti.forEach(t),rt=c(Ks),A=s(Ks,"LI",{});var wi=a(A);it=i(wi,"Pegasus achieves SOTA summarization performance on all 12 downstream tasks, as measured by ROUGE and human eval."),wi.forEach(t),Ks.forEach(t),se=c(o),X=s(o,"P",{});var so=a(X);je=i(so,"This model was contributed by "),U=s(so,"A",{href:!0,rel:!0});var xm=a(U);dt=i(xm,"sshleifer"),xm.forEach(t),B=i(so,". The Authors\u2019 code can be found "),ue=s(so,"A",{href:!0,rel:!0});var jm=a(ue);lt=i(jm,"here"),jm.forEach(t),z=i(so,"."),so.forEach(t),P=c(o),Be=s(o,"P",{});var Pm=a(Be);Pe=i(Pm,"Tips:"),Pm.forEach(t),yt=c(o),Re=s(o,"UL",{});var Em=a(Re);E=s(Em,"LI",{});var sd=a(E);ct=s(sd,"P",{});var Jm=a(ct);jt=i(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(sd),Ee=s(sd,"UL",{});var ad=a(Ee);pt=s(ad,"LI",{});var Gm=a(pt);D=i(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(ad),ut=s(ad,"LI",{});var Um=a(ut);Et=i(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),ad.forEach(t),sd.forEach(t),Em.forEach(t),ae=c(o),me=s(o,"H2",{class:!0});var rd=a(me);ve=s(rd,"A",{id:!0,class:!0,href:!0});var Im=a(ve);Je=s(Im,"SPAN",{});var Zm=a(Je);v(Ge.$$.fragment,Zm),Zm.forEach(t),Im.forEach(t),Ue=c(rd),ht=s(rd,"SPAN",{});var Cm=a(ht);tl=i(Cm,"Checkpoints"),Cm.forEach(t),rd.forEach(t),zi=c(o),bt=s(o,"P",{});var Ta=a(bt);ol=i(Ta,"All the "),mn=s(Ta,"A",{href:!0,rel:!0});var qm=a(mn);nl=i(qm,"checkpoints"),qm.forEach(t),sl=i(Ta,` are fine-tuned for summarization, besides
`),Ca=s(Ta,"EM",{});var Wm=a(Ca);al=i(Wm,"pegasus-large"),Wm.forEach(t),rl=i(Ta,", whence the other checkpoints are fine-tuned:"),Ta.forEach(t),Fi=c(o),Te=s(o,"UL",{});var wt=a(Te);qa=s(wt,"LI",{});var Sm=a(qa);il=i(Sm,"Each checkpoint is 2.2 GB on disk and 568M parameters."),Sm.forEach(t),dl=c(wt),Wa=s(wt,"LI",{});var Nm=a(Wa);ll=i(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=i(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 id=a(fn);hl=i(id,"Full replication results and correctly pre-processed data can be found in this "),gn=s(id,"A",{href:!0,rel:!0});var Bm=a(gn);ml=i(Bm,"Issue"),Bm.forEach(t),fl=i(id,"."),id.forEach(t),gl=c(wt),ao=s(wt,"LI",{});var Mi=a(ao);_n=s(Mi,"A",{href:!0,rel:!0});var Rm=a(_n);_l=i(Rm,"Distilled checkpoints"),Rm.forEach(t),yl=i(Mi," are described in this "),yn=s(Mi,"A",{href:!0,rel:!0});var Vm=a(yn);bl=i(Vm,"paper"),Vm.forEach(t),kl=i(Mi,"."),Mi.forEach(t),wt.forEach(t),xi=c(o),Jt=s(o,"H3",{class:!0});var dd=a(Jt);ro=s(dd,"A",{id:!0,class:!0,href:!0});var Xm=a(ro);Na=s(Xm,"SPAN",{});var Lm=a(Na);v(bn.$$.fragment,Lm),Lm.forEach(t),Xm.forEach(t),vl=c(dd),Aa=s(dd,"SPAN",{});var Om=a(Aa);Tl=i(Om,"Examples"),Om.forEach(t),dd.forEach(t),ji=c(o),kt=s(o,"UL",{});var wa=a(kt);io=s(wa,"LI",{});var $i=a(io);kn=s($i,"A",{href:!0,rel:!0});var Hm=a(kn);wl=i(Hm,"Script"),Hm.forEach(t),Ml=i($i,` to fine-tune pegasus
on the XSUM dataset. Data download instructions at `),vn=s($i,"A",{href:!0,rel:!0});var Dm=a(vn);$l=i(Dm,"examples/pytorch/summarization/"),Dm.forEach(t),zl=i($i,"."),$i.forEach(t),Fl=c(wa),Ba=s(wa,"LI",{});var Qm=a(Ba);xl=i(Qm,"FP16 is not supported (help/ideas on this appreciated!)."),Qm.forEach(t),jl=c(wa),Ra=s(wa,"LI",{});var Ym=a(Ra);Pl=i(Ym,"The adafactor optimizer is recommended for pegasus fine-tuning."),Ym.forEach(t),wa.forEach(t),Pi=c(o),Gt=s(o,"H2",{class:!0});var ld=a(Gt);lo=s(ld,"A",{id:!0,class:!0,href:!0});var Km=a(lo);Va=s(Km,"SPAN",{});var ef=a(Va);v(Tn.$$.fragment,ef),ef.forEach(t),Km.forEach(t),El=c(ld),Xa=s(ld,"SPAN",{});var tf=a(Xa);Jl=i(tf,"Implementation Notes"),tf.forEach(t),ld.forEach(t),Ei=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=i(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);Il=i($m,"The implementation is completely inherited from "),ta=s($m,"A",{href:!0});var af=a(ta);Zl=i(af,"BartForConditionalGeneration"),af.forEach(t),$m.forEach(t),sf.forEach(t),Cl=c(Mt),wn=s(Mt,"LI",{});var cd=a(wn);Da=s(cd,"P",{});var rf=a(Da);ql=i(rf,"Some key configuration differences:"),rf.forEach(t),Wl=c(cd),Ut=s(cd,"UL",{});var Ma=a(Ut);Qa=s(Ma,"LI",{});var df=a(Qa);Sl=i(df,"static, sinusoidal position embeddings"),df.forEach(t),Nl=c(Ma),Ya=s(Ma,"LI",{});var lf=a(Ya);Al=i(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 pd=a(Mn);Rl=i(pd,"more beams are used ("),Ka=s(pd,"CODE",{});var cf=a(Ka);Vl=i(cf,"num_beams=8"),cf.forEach(t),Xl=i(pd,")"),pd.forEach(t),Ma.forEach(t),cd.forEach(t),Ll=c(Mt),er=s(Mt,"LI",{});var pf=a(er);mt=s(pf,"P",{});var en=a(mt);Ol=i(en,"All pretrained pegasus checkpoints are the same besides three attributes: "),tr=s(en,"CODE",{});var uf=a(tr);Hl=i(uf,"tokenizer.model_max_length"),uf.forEach(t),Dl=i(en,` (maximum
input size), `),or=s(en,"CODE",{});var hf=a(or);Ql=i(hf,"max_length"),hf.forEach(t),Yl=i(en," (the maximum number of tokens to generate) and "),nr=s(en,"CODE",{});var mf=a(nr);Kl=i(mf,"length_penalty"),mf.forEach(t),ec=i(en,"."),en.forEach(t),pf.forEach(t),tc=c(Mt),sr=s(Mt,"LI",{});var ff=a(sr);It=s(ff,"P",{});var $a=a(It);oc=i($a,"The code to convert checkpoints trained in the author\u2019s "),$n=s($a,"A",{href:!0,rel:!0});var gf=a($n);nc=i(gf,"repo"),gf.forEach(t),sc=i($a,` can be
found in `),ar=s($a,"CODE",{});var _f=a(ar);ac=i(_f,"convert_pegasus_tf_to_pytorch.py"),_f.forEach(t),rc=i($a,"."),$a.forEach(t),ff.forEach(t),Mt.forEach(t),Ji=c(o),Zt=s(o,"H2",{class:!0});var ud=a(Zt);co=s(ud,"A",{id:!0,class:!0,href:!0});var yf=a(co);rr=s(yf,"SPAN",{});var bf=a(rr);v(zn.$$.fragment,bf),bf.forEach(t),yf.forEach(t),ic=c(ud),ir=s(ud,"SPAN",{});var kf=a(ir);dc=i(kf,"Usage Example"),kf.forEach(t),ud.forEach(t),Gi=c(o),v(Fn.$$.fragment,o),Ui=c(o),Ct=s(o,"H2",{class:!0});var hd=a(Ct);po=s(hd,"A",{id:!0,class:!0,href:!0});var vf=a(po);dr=s(vf,"SPAN",{});var Tf=a(dr);v(xn.$$.fragment,Tf),Tf.forEach(t),vf.forEach(t),lc=c(hd),lr=s(hd,"SPAN",{});var wf=a(lr);cc=i(wf,"Documentation resources"),wf.forEach(t),hd.forEach(t),Ii=c(o),vt=s(o,"UL",{});var za=a(vt);cr=s(za,"LI",{});var Mf=a(cr);oa=s(Mf,"A",{href:!0});var $f=a(oa);pc=i($f,"Causal language modeling task guide"),$f.forEach(t),Mf.forEach(t),uc=c(za),pr=s(za,"LI",{});var zf=a(pr);na=s(zf,"A",{href:!0});var Ff=a(na);hc=i(Ff,"Translation task guide"),Ff.forEach(t),zf.forEach(t),mc=c(za),ur=s(za,"LI",{});var xf=a(ur);sa=s(xf,"A",{href:!0});var jf=a(sa);fc=i(jf,"Summarization task guide"),jf.forEach(t),xf.forEach(t),za.forEach(t),Zi=c(o),qt=s(o,"H2",{class:!0});var md=a(qt);uo=s(md,"A",{id:!0,class:!0,href:!0});var Pf=a(uo);hr=s(Pf,"SPAN",{});var Ef=a(hr);v(jn.$$.fragment,Ef),Ef.forEach(t),Pf.forEach(t),gc=c(md),mr=s(md,"SPAN",{});var Jf=a(mr);_c=i(Jf,"PegasusConfig"),Jf.forEach(t),md.forEach(t),Ci=c(o),Ie=s(o,"DIV",{class:!0});var tn=a(Ie);v(Pn.$$.fragment,tn),yc=c(tn),Wt=s(tn,"P",{});var Fa=a(Wt);bc=i(Fa,"This is the configuration class to store the configuration of a "),aa=s(Fa,"A",{href:!0});var Gf=a(aa);kc=i(Gf,"PegasusModel"),Gf.forEach(t),vc=i(Fa,`. 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(Fa,"A",{href:!0,rel:!0});var Uf=a(En);Tc=i(Uf,"google/pegasus-large"),Uf.forEach(t),wc=i(Fa," architecture."),Fa.forEach(t),Mc=c(tn),St=s(tn,"P",{});var xa=a(St);$c=i(xa,"Configuration objects inherit from "),ra=s(xa,"A",{href:!0});var If=a(ra);zc=i(If,"PretrainedConfig"),If.forEach(t),Fc=i(xa,` and can be used to control the model outputs. Read the
documentation from `),ia=s(xa,"A",{href:!0});var Zf=a(ia);xc=i(Zf,"PretrainedConfig"),Zf.forEach(t),jc=i(xa," for more information."),xa.forEach(t),Pc=c(tn),v(ho.$$.fragment,tn),tn.forEach(t),qi=c(o),Nt=s(o,"H2",{class:!0});var fd=a(Nt);mo=s(fd,"A",{id:!0,class:!0,href:!0});var Cf=a(mo);fr=s(Cf,"SPAN",{});var qf=a(fr);v(Jn.$$.fragment,qf),qf.forEach(t),Cf.forEach(t),Ec=c(fd),gr=s(fd,"SPAN",{});var Wf=a(gr);Jc=i(Wf,"PegasusTokenizer"),Wf.forEach(t),fd.forEach(t),Wi=c(o),fo=s(o,"P",{});var gd=a(fo);Gc=i(gd,"warning: "),_r=s(gd,"CODE",{});var Sf=a(_r);Uc=i(Sf,"add_tokens"),Sf.forEach(t),Ic=i(gd," does not work at the moment."),gd.forEach(t),Si=c(o),R=s(o,"DIV",{class:!0});var $e=a(R);v(Gn.$$.fragment,$e),Zc=c($e),Un=s($e,"P",{});var _d=a(Un);Cc=i(_d,"Construct a PEGASUS tokenizer. Based on "),In=s(_d,"A",{href:!0,rel:!0});var Nf=a(In);qc=i(Nf,"SentencePiece"),Nf.forEach(t),Wc=i(_d,"."),_d.forEach(t),Sc=c($e),Zn=s($e,"P",{});var yd=a(Zn);Nc=i(yd,"This tokenizer inherits from "),da=s(yd,"A",{href:!0});var Af=a(da);Ac=i(Af,"PreTrainedTokenizer"),Af.forEach(t),Bc=i(yd,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),yd.forEach(t),Rc=c($e),Ve=s($e,"DIV",{class:!0});var on=a(Ve);v(Cn.$$.fragment,on),Vc=c(on),qn=s(on,"P",{});var bd=a(qn);Xc=i(bd,`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(bd,"CODE",{});var Bf=a(yr);Lc=i(Bf,"X"),Bf.forEach(t),Oc=i(bd," represents the sequence:"),bd.forEach(t),Hc=c(on),Wn=s(on,"UL",{});var kd=a(Wn);la=s(kd,"LI",{});var zm=a(la);Dc=i(zm,"single sequence: "),br=s(zm,"CODE",{});var Rf=a(br);Qc=i(Rf,"X </s>"),Rf.forEach(t),zm.forEach(t),Yc=c(kd),Sn=s(kd,"LI",{});var vd=a(Sn);Kc=i(vd,"pair of sequences: "),kr=s(vd,"CODE",{});var Vf=a(kr);ep=i(Vf,"A B </s>"),Vf.forEach(t),tp=i(vd," (not intended use)"),vd.forEach(t),kd.forEach(t),op=c(on),vr=s(on,"P",{});var Xf=a(vr);np=i(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 Td=a(go);v(Nn.$$.fragment,Td),ap=c(Td),Tr=s(Td,"P",{});var Lf=a(Tr);rp=i(Lf,"Converts a sequence of tokens (string) in a single string."),Lf.forEach(t),Td.forEach(t),ip=c($e),_o=s($e,"DIV",{class:!0});var wd=a(_o);v(An.$$.fragment,wd),dp=c(wd),wr=s(wd,"P",{});var Of=a(wr);lp=i(Of,"Get list where entries are [1] if a token is [eos] or [pad] else 0."),Of.forEach(t),wd.forEach(t),cp=c($e),yo=s($e,"DIV",{class:!0});var Md=a(yo);v(Bn.$$.fragment,Md),pp=c(Md),Mr=s(Md,"P",{});var Hf=a(Mr);up=i(Hf,"Just EOS"),Hf.forEach(t),Md.forEach(t),$e.forEach(t),Ni=c(o),At=s(o,"H2",{class:!0});var $d=a(At);bo=s($d,"A",{id:!0,class:!0,href:!0});var Df=a(bo);$r=s(Df,"SPAN",{});var Qf=a($r);v(Rn.$$.fragment,Qf),Qf.forEach(t),Df.forEach(t),hp=c($d),zr=s($d,"SPAN",{});var Yf=a(zr);mp=i(Yf,"PegasusTokenizerFast"),Yf.forEach(t),$d.forEach(t),Ai=c(o),fe=s(o,"DIV",{class:!0});var $t=a(fe);v(Vn.$$.fragment,$t),fp=c($t),Bt=s($t,"P",{});var ja=a(Bt);gp=i(ja,"Construct a \u201Cfast\u201D PEGASUS tokenizer (backed by HuggingFace\u2019s "),Fr=s(ja,"EM",{});var Kf=a(Fr);_p=i(Kf,"tokenizers"),Kf.forEach(t),yp=i(ja,` library). Based on
`),Xn=s(ja,"A",{href:!0,rel:!0});var eg=a(Xn);bp=i(eg,"Unigram"),eg.forEach(t),kp=i(ja,"."),ja.forEach(t),vp=c($t),Ln=s($t,"P",{});var zd=a(Ln);Tp=i(zd,"This tokenizer inherits from "),ca=s(zd,"A",{href:!0});var tg=a(ca);wp=i(tg,"PreTrainedTokenizerFast"),tg.forEach(t),Mp=i(zd,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),zd.forEach(t),$p=c($t),Tt=s($t,"DIV",{class:!0});var Pa=a(Tt);v(On.$$.fragment,Pa),zp=c(Pa),xr=s(Pa,"P",{});var og=a(xr);Fp=i(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 Fd=a(Hn);pa=s(Fd,"LI",{});var Fm=a(pa);jp=i(Fm,"single sequence: "),jr=s(Fm,"CODE",{});var ng=a(jr);Pp=i(ng,"X </s>"),ng.forEach(t),Fm.forEach(t),Ep=c(Fd),Dn=s(Fd,"LI",{});var xd=a(Dn);Jp=i(xd,"pair of sequences: "),Pr=s(xd,"CODE",{});var sg=a(Pr);Gp=i(sg,"A B </s>"),sg.forEach(t),Up=i(xd," (not intended use)"),xd.forEach(t),Fd.forEach(t),Pa.forEach(t),Ip=c($t),ko=s($t,"DIV",{class:!0});var jd=a(ko);v(Qn.$$.fragment,jd),Zp=c(jd),Er=s(jd,"P",{});var ag=a(Er);Cp=i(ag,"Get list where entries are [1] if a token is [eos] or [pad] else 0."),ag.forEach(t),jd.forEach(t),$t.forEach(t),Bi=c(o),Rt=s(o,"H2",{class:!0});var Pd=a(Rt);vo=s(Pd,"A",{id:!0,class:!0,href:!0});var rg=a(vo);Jr=s(rg,"SPAN",{});var ig=a(Jr);v(Yn.$$.fragment,ig),ig.forEach(t),rg.forEach(t),qp=c(Pd),Gr=s(Pd,"SPAN",{});var dg=a(Gr);Wp=i(dg,"PegasusModel"),dg.forEach(t),Pd.forEach(t),Ri=c(o),Ze=s(o,"DIV",{class:!0});var nn=a(Ze);v(Kn.$$.fragment,nn),Sp=c(nn),es=s(nn,"P",{});var Ed=a(es);Np=i(Ed,`The bare PEGASUS Model outputting raw hidden-states without any specific head on top.
This model inherits from `),ua=s(Ed,"A",{href:!0});var lg=a(ua);Ap=i(lg,"PreTrainedModel"),lg.forEach(t),Bp=i(Ed,`. 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.)`),Ed.forEach(t),Rp=c(nn),ts=s(nn,"P",{});var Jd=a(ts);Vp=i(Jd,"This model is also a PyTorch "),os=s(Jd,"A",{href:!0,rel:!0});var cg=a(os);Xp=i(cg,"torch.nn.Module"),cg.forEach(t),Lp=i(Jd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jd.forEach(t),Op=c(nn),Xe=s(nn,"DIV",{class:!0});var sn=a(Xe);v(ns.$$.fragment,sn),Hp=c(sn),Vt=s(sn,"P",{});var Ea=a(Vt);Dp=i(Ea,"The "),ha=s(Ea,"A",{href:!0});var pg=a(ha);Qp=i(pg,"PegasusModel"),pg.forEach(t),Yp=i(Ea," forward method, overrides the "),Ur=s(Ea,"CODE",{});var ug=a(Ur);Kp=i(ug,"__call__"),ug.forEach(t),eu=i(Ea," special method."),Ea.forEach(t),tu=c(sn),v(To.$$.fragment,sn),ou=c(sn),v(wo.$$.fragment,sn),sn.forEach(t),nn.forEach(t),Vi=c(o),Xt=s(o,"H2",{class:!0});var Gd=a(Xt);Mo=s(Gd,"A",{id:!0,class:!0,href:!0});var hg=a(Mo);Ir=s(hg,"SPAN",{});var mg=a(Ir);v(ss.$$.fragment,mg),mg.forEach(t),hg.forEach(t),nu=c(Gd),Zr=s(Gd,"SPAN",{});var fg=a(Zr);su=i(fg,"PegasusForConditionalGeneration"),fg.forEach(t),Gd.forEach(t),Xi=c(o),Ce=s(o,"DIV",{class:!0});var an=a(Ce);v(as.$$.fragment,an),au=c(an),rs=s(an,"P",{});var Ud=a(rs);ru=i(Ud,`The PEGASUS Model with a language modeling head. Can be used for summarization.
This model inherits from `),ma=s(Ud,"A",{href:!0});var gg=a(ma);iu=i(gg,"PreTrainedModel"),gg.forEach(t),du=i(Ud,`. 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.)`),Ud.forEach(t),lu=c(an),is=s(an,"P",{});var Id=a(is);cu=i(Id,"This model is also a PyTorch "),ds=s(Id,"A",{href:!0,rel:!0});var _g=a(ds);pu=i(_g,"torch.nn.Module"),_g.forEach(t),uu=i(Id,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Id.forEach(t),hu=c(an),Le=s(an,"DIV",{class:!0});var rn=a(Le);v(ls.$$.fragment,rn),mu=c(rn),Lt=s(rn,"P",{});var Ja=a(Lt);fu=i(Ja,"The "),fa=s(Ja,"A",{href:!0});var yg=a(fa);gu=i(yg,"PegasusForConditionalGeneration"),yg.forEach(t),_u=i(Ja," forward method, overrides the "),Cr=s(Ja,"CODE",{});var bg=a(Cr);yu=i(bg,"__call__"),bg.forEach(t),bu=i(Ja," special method."),Ja.forEach(t),ku=c(rn),v($o.$$.fragment,rn),vu=c(rn),v(zo.$$.fragment,rn),rn.forEach(t),an.forEach(t),Li=c(o),Ot=s(o,"H2",{class:!0});var Zd=a(Ot);Fo=s(Zd,"A",{id:!0,class:!0,href:!0});var kg=a(Fo);qr=s(kg,"SPAN",{});var vg=a(qr);v(cs.$$.fragment,vg),vg.forEach(t),kg.forEach(t),Tu=c(Zd),Wr=s(Zd,"SPAN",{});var Tg=a(Wr);wu=i(Tg,"PegasusForCausalLM"),Tg.forEach(t),Zd.forEach(t),Oi=c(o),Ht=s(o,"DIV",{class:!0});var Cd=a(Ht);v(ps.$$.fragment,Cd),Mu=c(Cd),xo=s(Cd,"DIV",{class:!0});var qd=a(xo);v(us.$$.fragment,qd),$u=c(qd),v(jo.$$.fragment,qd),qd.forEach(t),Cd.forEach(t),Hi=c(o),Dt=s(o,"H2",{class:!0});var Wd=a(Dt);Po=s(Wd,"A",{id:!0,class:!0,href:!0});var wg=a(Po);Sr=s(wg,"SPAN",{});var Mg=a(Sr);v(hs.$$.fragment,Mg),Mg.forEach(t),wg.forEach(t),zu=c(Wd),Nr=s(Wd,"SPAN",{});var $g=a(Nr);Fu=i($g,"TFPegasusModel"),$g.forEach(t),Wd.forEach(t),Di=c(o),ge=s(o,"DIV",{class:!0});var zt=a(ge);v(ms.$$.fragment,zt),xu=c(zt),fs=s(zt,"P",{});var Sd=a(fs);ju=i(Sd,`The bare PEGASUS Model outputting raw hidden-states without any specific head on top.
This model inherits from `),ga=s(Sd,"A",{href:!0});var zg=a(ga);Pu=i(zg,"TFPreTrainedModel"),zg.forEach(t),Eu=i(Sd,`. 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.)`),Sd.forEach(t),Ju=c(zt),gs=s(zt,"P",{});var Nd=a(gs);Gu=i(Nd,"This model is also a "),_s=s(Nd,"A",{href:!0,rel:!0});var Fg=a(_s);Uu=i(Fg,"tf.keras.Model"),Fg.forEach(t),Iu=i(Nd,` 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.`),Nd.forEach(t),Zu=c(zt),v(Eo.$$.fragment,zt),Cu=c(zt),Oe=s(zt,"DIV",{class:!0});var dn=a(Oe);v(ys.$$.fragment,dn),qu=c(dn),Qt=s(dn,"P",{});var Ga=a(Qt);Wu=i(Ga,"The "),_a=s(Ga,"A",{href:!0});var xg=a(_a);Su=i(xg,"TFPegasusModel"),xg.forEach(t),Nu=i(Ga," forward method, overrides the "),Ar=s(Ga,"CODE",{});var jg=a(Ar);Au=i(jg,"__call__"),jg.forEach(t),Bu=i(Ga," special method."),Ga.forEach(t),Ru=c(dn),v(Jo.$$.fragment,dn),Vu=c(dn),v(Go.$$.fragment,dn),dn.forEach(t),zt.forEach(t),Qi=c(o),Yt=s(o,"H2",{class:!0});var Ad=a(Yt);Uo=s(Ad,"A",{id:!0,class:!0,href:!0});var Pg=a(Uo);Br=s(Pg,"SPAN",{});var Eg=a(Br);v(bs.$$.fragment,Eg),Eg.forEach(t),Pg.forEach(t),Xu=c(Ad),Rr=s(Ad,"SPAN",{});var Jg=a(Rr);Lu=i(Jg,"TFPegasusForConditionalGeneration"),Jg.forEach(t),Ad.forEach(t),Yi=c(o),_e=s(o,"DIV",{class:!0});var Ft=a(_e);v(ks.$$.fragment,Ft),Ou=c(Ft),vs=s(Ft,"P",{});var Bd=a(vs);Hu=i(Bd,`The PEGASUS Model with a language modeling head. Can be used for summarization.
This model inherits from `),ya=s(Bd,"A",{href:!0});var Gg=a(ya);Du=i(Gg,"TFPreTrainedModel"),Gg.forEach(t),Qu=i(Bd,`. 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.)`),Bd.forEach(t),Yu=c(Ft),Ts=s(Ft,"P",{});var Rd=a(Ts);Ku=i(Rd,"This model is also a "),ws=s(Rd,"A",{href:!0,rel:!0});var Ug=a(ws);eh=i(Ug,"tf.keras.Model"),Ug.forEach(t),th=i(Rd,` 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.`),Rd.forEach(t),oh=c(Ft),v(Io.$$.fragment,Ft),nh=c(Ft),He=s(Ft,"DIV",{class:!0});var ln=a(He);v(Ms.$$.fragment,ln),sh=c(ln),Kt=s(ln,"P",{});var Ua=a(Kt);ah=i(Ua,"The "),ba=s(Ua,"A",{href:!0});var Ig=a(ba);rh=i(Ig,"TFPegasusForConditionalGeneration"),Ig.forEach(t),ih=i(Ua," forward method, overrides the "),Vr=s(Ua,"CODE",{});var Zg=a(Vr);dh=i(Zg,"__call__"),Zg.forEach(t),lh=i(Ua," special method."),Ua.forEach(t),ch=c(ln),v(Zo.$$.fragment,ln),ph=c(ln),v(Co.$$.fragment,ln),ln.forEach(t),Ft.forEach(t),Ki=c(o),eo=s(o,"H2",{class:!0});var Vd=a(eo);qo=s(Vd,"A",{id:!0,class:!0,href:!0});var Cg=a(qo);Xr=s(Cg,"SPAN",{});var qg=a(Xr);v($s.$$.fragment,qg),qg.forEach(t),Cg.forEach(t),uh=c(Vd),Lr=s(Vd,"SPAN",{});var Wg=a(Lr);hh=i(Wg,"FlaxPegasusModel"),Wg.forEach(t),Vd.forEach(t),ed=c(o),W=s(o,"DIV",{class:!0});var re=a(W);v(zs.$$.fragment,re),mh=c(re),Fs=s(re,"P",{});var Xd=a(Fs);fh=i(Xd,`The bare Pegasus Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),ka=s(Xd,"A",{href:!0});var Sg=a(ka);gh=i(Sg,"FlaxPreTrainedModel"),Sg.forEach(t),_h=i(Xd,`. 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.)`),Xd.forEach(t),yh=c(re),xs=s(re,"P",{});var Ld=a(xs);bh=i(Ld,`This model is also a Flax Linen
`),js=s(Ld,"A",{href:!0,rel:!0});var Ng=a(js);kh=i(Ng,"flax.nn.Module"),Ng.forEach(t),vh=i(Ld,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Ld.forEach(t),Th=c(re),Or=s(re,"P",{});var Ag=a(Or);wh=i(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 Rg=a(Ps);$h=i(Rg,"Just-In-Time (JIT) compilation"),Rg.forEach(t),Bg.forEach(t),zh=c(cn),Dr=s(cn,"LI",{});var Vg=a(Dr);Es=s(Vg,"A",{href:!0,rel:!0});var Xg=a(Es);Fh=i(Xg,"Automatic Differentiation"),Xg.forEach(t),Vg.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=i(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=i(Dg,"Parallelization"),Dg.forEach(t),Hg.forEach(t),cn.forEach(t),Jh=c(re),De=s(re,"DIV",{class:!0});var pn=a(De);v(Us.$$.fragment,pn),Gh=c(pn),to=s(pn,"P",{});var Ia=a(to);Uh=i(Ia,"The "),Kr=s(Ia,"CODE",{});var Qg=a(Kr);Ih=i(Qg,"FlaxPegasusPreTrainedModel"),Qg.forEach(t),Zh=i(Ia," forward method, overrides the "),ei=s(Ia,"CODE",{});var Yg=a(ei);Ch=i(Yg,"__call__"),Yg.forEach(t),qh=i(Ia," special method."),Ia.forEach(t),Wh=c(pn),v(Wo.$$.fragment,pn),Sh=c(pn),v(So.$$.fragment,pn),pn.forEach(t),Nh=c(re),No=s(re,"DIV",{class:!0});var Od=a(No);v(Is.$$.fragment,Od),Ah=c(Od),v(Ao.$$.fragment,Od),Od.forEach(t),Bh=c(re),Bo=s(re,"DIV",{class:!0});var Hd=a(Bo);v(Zs.$$.fragment,Hd),Rh=c(Hd),v(Ro.$$.fragment,Hd),Hd.forEach(t),re.forEach(t),td=c(o),oo=s(o,"H2",{class:!0});var Dd=a(oo);Vo=s(Dd,"A",{id:!0,class:!0,href:!0});var Kg=a(Vo);ti=s(Kg,"SPAN",{});var e_=a(ti);v(Cs.$$.fragment,e_),e_.forEach(t),Kg.forEach(t),Vh=c(Dd),oi=s(Dd,"SPAN",{});var t_=a(oi);Xh=i(t_,"FlaxPegasusForConditionalGeneration"),t_.forEach(t),Dd.forEach(t),od=c(o),S=s(o,"DIV",{class:!0});var ie=a(S);v(qs.$$.fragment,ie),Lh=c(ie),Ws=s(ie,"P",{});var Qd=a(Ws);Oh=i(Qd,`The PEGASUS Model with a language modeling head. Can be used for summarization.
This model inherits from `),va=s(Qd,"A",{href:!0});var o_=a(va);Hh=i(o_,"FlaxPreTrainedModel"),o_.forEach(t),Dh=i(Qd,`. 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.)`),Qd.forEach(t),Qh=c(ie),Ss=s(ie,"P",{});var Yd=a(Ss);Yh=i(Yd,`This model is also a Flax Linen
`),Ns=s(Yd,"A",{href:!0,rel:!0});var n_=a(Ns);Kh=i(n_,"flax.nn.Module"),n_.forEach(t),em=i(Yd,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Yd.forEach(t),tm=c(ie),ni=s(ie,"P",{});var s_=a(ni);om=i(s_,"Finally, this model supports inherent JAX features such as:"),s_.forEach(t),nm=c(ie),gt=s(ie,"UL",{});var un=a(gt);si=s(un,"LI",{});var a_=a(si);As=s(a_,"A",{href:!0,rel:!0});var r_=a(As);sm=i(r_,"Just-In-Time (JIT) compilation"),r_.forEach(t),a_.forEach(t),am=c(un),ai=s(un,"LI",{});var i_=a(ai);Bs=s(i_,"A",{href:!0,rel:!0});var d_=a(Bs);rm=i(d_,"Automatic Differentiation"),d_.forEach(t),i_.forEach(t),im=c(un),ri=s(un,"LI",{});var l_=a(ri);Rs=s(l_,"A",{href:!0,rel:!0});var c_=a(Rs);dm=i(c_,"Vectorization"),c_.forEach(t),l_.forEach(t),lm=c(un),ii=s(un,"LI",{});var p_=a(ii);Vs=s(p_,"A",{href:!0,rel:!0});var u_=a(Vs);cm=i(u_,"Parallelization"),u_.forEach(t),p_.forEach(t),un.forEach(t),pm=c(ie),Me=s(ie,"DIV",{class:!0});var xt=a(Me);v(Xs.$$.fragment,xt),um=c(xt),no=s(xt,"P",{});var Za=a(no);hm=i(Za,"The "),di=s(Za,"CODE",{});var h_=a(di);mm=i(h_,"FlaxPegasusPreTrainedModel"),h_.forEach(t),fm=i(Za," forward method, overrides the "),li=s(Za,"CODE",{});var m_=a(li);gm=i(m_,"__call__"),m_.forEach(t),_m=i(Za," special method."),Za.forEach(t),ym=c(xt),v(Xo.$$.fragment,xt),bm=c(xt),v(Lo.$$.fragment,xt),km=c(xt),v(Oo.$$.fragment,xt),xt.forEach(t),vm=c(ie),Ho=s(ie,"DIV",{class:!0});var Kd=a(Ho);v(Ls.$$.fragment,Kd),Tm=c(Kd),v(Do.$$.fragment,Kd),Kd.forEach(t),wm=c(ie),Qo=s(ie,"DIV",{class:!0});var el=a(Qo);v(Os.$$.fragment,el),Mm=c(el),v(Yo.$$.fragment,el),el.forEach(t),ie.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(V,"href","https://huggingface.co/spaces/docs-demos/pegasus_paraphrase"),p(C,"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(ve,"id","checkpoints"),p(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ve,"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(kn,"href","https://github.com/huggingface/transformers/tree/main/examples/research_projects/seq2seq-distillation/finetune_pegasus_xsum.sh"),p(kn,"rel","nofollow"),p(vn,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization/README.md"),p(vn,"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/main/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(Zt,"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(Ct,"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/main/en/model_doc/pegasus#transformers.PegasusModel"),p(En,"href","https://huggingface.co/google/pegasus-large"),p(En,"rel","nofollow"),p(ra,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(ia,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),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.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(In,"href","https://github.com/google/sentencepiece"),p(In,"rel","nofollow"),p(da,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),p(Ve,"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(R,"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/main/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(ko,"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(vo,"id","transformers.PegasusModel"),p(vo,"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(vo,"href","#transformers.PegasusModel"),p(Rt,"class","relative group"),p(ua,"href","/docs/transformers/main/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/main/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(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(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/main/en/main_classes/model#transformers.PreTrainedModel"),p(ds,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ds,"rel","nofollow"),p(fa,"href","/docs/transformers/main/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(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(Fo,"id","transformers.PegasusForCausalLM"),p(Fo,"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(Fo,"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/main/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/main/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/main/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/main/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(ka,"href","/docs/transformers/main/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(Vo,"id","transformers.FlaxPegasusForConditionalGeneration"),p(Vo,"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(Vo,"href","#transformers.FlaxPegasusForConditionalGeneration"),p(oo,"class","relative group"),p(va,"href","/docs/transformers/main/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(Rs,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),p(Rs,"rel","nofollow"),p(Vs,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),p(Vs,"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(d,y,null),e(_,h),e(_,j),e(j,Qe),f(o,Se,g),f(o,C,g),e(C,ye),e(ye,Y),e(C,Ye),e(C,V),e(V,be),f(o,K,g),f(o,L,g),e(L,Fe),e(Fe,de),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,I),e(I,tt),f(o,te,g),f(o,oe,g),e(oe,ot),e(oe,N),e(N,nt),e(oe,st),f(o,Z,g),f(o,ke,g),e(ke,pe),f(o,Ae,g),f(o,ne,g),e(ne,H),e(H,at),e(ne,rt),e(ne,A),e(A,it),f(o,se,g),f(o,X,g),e(X,je),e(X,U),e(U,dt),e(X,B),e(X,ue),e(ue,lt),e(X,z),f(o,P,g),f(o,Be,g),e(Be,Pe),f(o,yt,g),f(o,Re,g),e(Re,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,ve),e(ve,Je),T(Ge,Je,null),e(me,Ue),e(me,ht),e(ht,tl),f(o,zi,g),f(o,bt,g),e(bt,ol),e(bt,mn),e(mn,nl),e(bt,sl),e(bt,Ca),e(Ca,al),e(bt,rl),f(o,Fi,g),f(o,Te,g),e(Te,qa),e(qa,il),e(Te,dl),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,kl),f(o,xi,g),f(o,Jt,g),e(Jt,ro),e(ro,Na),T(bn,Na,null),e(Jt,vl),e(Jt,Aa),e(Aa,Tl),f(o,ji,g),f(o,kt,g),e(kt,io),e(io,kn),e(kn,wl),e(io,Ml),e(io,vn),e(vn,$l),e(io,zl),e(kt,Fl),e(kt,Ba),e(Ba,xl),e(kt,jl),e(kt,Ra),e(Ra,Pl),f(o,Pi,g),f(o,Gt,g),e(Gt,lo),e(lo,Va),T(Tn,Va,null),e(Gt,El),e(Gt,Xa),e(Xa,Jl),f(o,Ei,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,Il),e(ea,ta),e(ta,Zl),e(we,Cl),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,Rl),e(Mn,Ka),e(Ka,Vl),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,It),e(It,oc),e(It,$n),e($n,nc),e(It,sc),e(It,ar),e(ar,ac),e(It,rc),f(o,Ji,g),f(o,Zt,g),e(Zt,co),e(co,rr),T(zn,rr,null),e(Zt,ic),e(Zt,ir),e(ir,dc),f(o,Gi,g),T(Fn,o,g),f(o,Ui,g),f(o,Ct,g),e(Ct,po),e(po,dr),T(xn,dr,null),e(Ct,lc),e(Ct,lr),e(lr,cc),f(o,Ii,g),f(o,vt,g),e(vt,cr),e(cr,oa),e(oa,pc),e(vt,uc),e(vt,pr),e(pr,na),e(na,hc),e(vt,mc),e(vt,ur),e(ur,sa),e(sa,fc),f(o,Zi,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,Ci,g),f(o,Ie,g),T(Pn,Ie,null),e(Ie,yc),e(Ie,Wt),e(Wt,bc),e(Wt,aa),e(aa,kc),e(Wt,vc),e(Wt,En),e(En,Tc),e(Wt,wc),e(Ie,Mc),e(Ie,St),e(St,$c),e(St,ra),e(ra,zc),e(St,Fc),e(St,ia),e(ia,xc),e(St,jc),e(Ie,Pc),T(ho,Ie,null),f(o,qi,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,Wi,g),f(o,fo,g),e(fo,Gc),e(fo,_r),e(_r,Uc),e(fo,Ic),f(o,Si,g),f(o,R,g),T(Gn,R,null),e(R,Zc),e(R,Un),e(Un,Cc),e(Un,In),e(In,qc),e(Un,Wc),e(R,Sc),e(R,Zn),e(Zn,Nc),e(Zn,da),e(da,Ac),e(Zn,Bc),e(R,Rc),e(R,Ve),T(Cn,Ve,null),e(Ve,Vc),e(Ve,qn),e(qn,Xc),e(qn,yr),e(yr,Lc),e(qn,Oc),e(Ve,Hc),e(Ve,Wn),e(Wn,la),e(la,Dc),e(la,br),e(br,Qc),e(Wn,Yc),e(Wn,Sn),e(Sn,Kc),e(Sn,kr),e(kr,ep),e(Sn,tp),e(Ve,op),e(Ve,vr),e(vr,np),e(R,sp),e(R,go),T(Nn,go,null),e(go,ap),e(go,Tr),e(Tr,rp),e(R,ip),e(R,_o),T(An,_o,null),e(_o,dp),e(_o,wr),e(wr,lp),e(R,cp),e(R,yo),T(Bn,yo,null),e(yo,pp),e(yo,Mr),e(Mr,up),f(o,Ni,g),f(o,At,g),e(At,bo),e(bo,$r),T(Rn,$r,null),e(At,hp),e(At,zr),e(zr,mp),f(o,Ai,g),f(o,fe,g),T(Vn,fe,null),e(fe,fp),e(fe,Bt),e(Bt,gp),e(Bt,Fr),e(Fr,_p),e(Bt,yp),e(Bt,Xn),e(Xn,bp),e(Bt,kp),e(fe,vp),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,zp),e(Tt,xr),e(xr,Fp),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,Ip),e(fe,ko),T(Qn,ko,null),e(ko,Zp),e(ko,Er),e(Er,Cp),f(o,Bi,g),f(o,Rt,g),e(Rt,vo),e(vo,Jr),T(Yn,Jr,null),e(Rt,qp),e(Rt,Gr),e(Gr,Wp),f(o,Ri,g),f(o,Ze,g),T(Kn,Ze,null),e(Ze,Sp),e(Ze,es),e(es,Np),e(es,ua),e(ua,Ap),e(es,Bp),e(Ze,Rp),e(Ze,ts),e(ts,Vp),e(ts,os),e(os,Xp),e(ts,Lp),e(Ze,Op),e(Ze,Xe),T(ns,Xe,null),e(Xe,Hp),e(Xe,Vt),e(Vt,Dp),e(Vt,ha),e(ha,Qp),e(Vt,Yp),e(Vt,Ur),e(Ur,Kp),e(Vt,eu),e(Xe,tu),T(To,Xe,null),e(Xe,ou),T(wo,Xe,null),f(o,Vi,g),f(o,Xt,g),e(Xt,Mo),e(Mo,Ir),T(ss,Ir,null),e(Xt,nu),e(Xt,Zr),e(Zr,su),f(o,Xi,g),f(o,Ce,g),T(as,Ce,null),e(Ce,au),e(Ce,rs),e(rs,ru),e(rs,ma),e(ma,iu),e(rs,du),e(Ce,lu),e(Ce,is),e(is,cu),e(is,ds),e(ds,pu),e(is,uu),e(Ce,hu),e(Ce,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,Cr),e(Cr,yu),e(Lt,bu),e(Le,ku),T($o,Le,null),e(Le,vu),T(zo,Le,null),f(o,Li,g),f(o,Ot,g),e(Ot,Fo),e(Fo,qr),T(cs,qr,null),e(Ot,Tu),e(Ot,Wr),e(Wr,wu),f(o,Oi,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,Hi,g),f(o,Dt,g),e(Dt,Po),e(Po,Sr),T(hs,Sr,null),e(Dt,zu),e(Dt,Nr),e(Nr,Fu),f(o,Di,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,Iu),e(ge,Zu),T(Eo,ge,null),e(ge,Cu),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,Ru),T(Jo,Oe,null),e(Oe,Vu),T(Go,Oe,null),f(o,Qi,g),f(o,Yt,g),e(Yt,Uo),e(Uo,Br),T(bs,Br,null),e(Yt,Xu),e(Yt,Rr),e(Rr,Lu),f(o,Yi,g),f(o,_e,g),T(ks,_e,null),e(_e,Ou),e(_e,vs),e(vs,Hu),e(vs,ya),e(ya,Du),e(vs,Qu),e(_e,Yu),e(_e,Ts),e(Ts,Ku),e(Ts,ws),e(ws,eh),e(Ts,th),e(_e,oh),T(Io,_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,ih),e(Kt,Vr),e(Vr,dh),e(Kt,lh),e(He,ch),T(Zo,He,null),e(He,ph),T(Co,He,null),f(o,Ki,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,ed,g),f(o,W,g),T(zs,W,null),e(W,mh),e(W,Fs),e(Fs,fh),e(Fs,ka),e(ka,gh),e(Fs,_h),e(W,yh),e(W,xs),e(xs,bh),e(xs,js),e(js,kh),e(xs,vh),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,zh),e(ft,Dr),e(Dr,Es),e(Es,Fh),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,Ih),e(to,Zh),e(to,ei),e(ei,Ch),e(to,qh),e(De,Wh),T(Wo,De,null),e(De,Sh),T(So,De,null),e(W,Nh),e(W,No),T(Is,No,null),e(No,Ah),T(Ao,No,null),e(W,Bh),e(W,Bo),T(Zs,Bo,null),e(Bo,Rh),T(Ro,Bo,null),f(o,td,g),f(o,oo,g),e(oo,Vo),e(Vo,ti),T(Cs,ti,null),e(oo,Vh),e(oo,oi),e(oi,Xh),f(o,od,g),f(o,S,g),T(qs,S,null),e(S,Lh),e(S,Ws),e(Ws,Oh),e(Ws,va),e(va,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,ni),e(ni,om),e(S,nm),e(S,gt),e(gt,si),e(si,As),e(As,sm),e(gt,am),e(gt,ai),e(ai,Bs),e(Bs,rm),e(gt,im),e(gt,ri),e(ri,Rs),e(Rs,dm),e(gt,lm),e(gt,ii),e(ii,Vs),e(Vs,cm),e(S,pm),e(S,Me),T(Xs,Me,null),e(Me,um),e(Me,no),e(no,hm),e(no,di),e(di,mm),e(no,fm),e(no,li),e(li,gm),e(no,_m),e(Me,ym),T(Xo,Me,null),e(Me,bm),T(Lo,Me,null),e(Me,km),T(Oo,Me,null),e(S,vm),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),nd=!0},p(o,[g]){const Hs={};g&2&&(Hs.$$scope={dirty:g,ctx:o}),ho.$set(Hs);const ci={};g&2&&(ci.$$scope={dirty:g,ctx:o}),To.$set(ci);const pi={};g&2&&(pi.$$scope={dirty:g,ctx:o}),wo.$set(pi);const ui={};g&2&&(ui.$$scope={dirty:g,ctx:o}),$o.$set(ui);const Ds={};g&2&&(Ds.$$scope={dirty:g,ctx:o}),zo.$set(Ds);const hi={};g&2&&(hi.$$scope={dirty:g,ctx:o}),jo.$set(hi);const mi={};g&2&&(mi.$$scope={dirty:g,ctx:o}),Eo.$set(mi);const Ko={};g&2&&(Ko.$$scope={dirty:g,ctx:o}),Jo.$set(Ko);const fi={};g&2&&(fi.$$scope={dirty:g,ctx:o}),Go.$set(fi);const gi={};g&2&&(gi.$$scope={dirty:g,ctx:o}),Io.$set(gi);const Qs={};g&2&&(Qs.$$scope={dirty:g,ctx:o}),Zo.$set(Qs);const _i={};g&2&&(_i.$$scope={dirty:g,ctx:o}),Co.$set(_i);const yi={};g&2&&(yi.$$scope={dirty:g,ctx:o}),Wo.$set(yi);const bi={};g&2&&(bi.$$scope={dirty:g,ctx:o}),So.$set(bi);const Ys={};g&2&&(Ys.$$scope={dirty:g,ctx:o}),Ao.$set(Ys);const ki={};g&2&&(ki.$$scope={dirty:g,ctx:o}),Ro.$set(ki);const vi={};g&2&&(vi.$$scope={dirty:g,ctx:o}),Xo.$set(vi);const Ks={};g&2&&(Ks.$$scope={dirty:g,ctx:o}),Lo.$set(Ks);const Ti={};g&2&&(Ti.$$scope={dirty:g,ctx:o}),Oo.$set(Ti);const wi={};g&2&&(wi.$$scope={dirty:g,ctx:o}),Do.$set(wi);const so={};g&2&&(so.$$scope={dirty:g,ctx:o}),Yo.$set(so)},i(o){nd||(w(d.$$.fragment,o),w(O.$$.fragment,o),w(Ge.$$.fragment,o),w(bn.$$.fragment,o),w(Tn.$$.fragment,o),w(zn.$$.fragment,o),w(Fn.$$.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(Cn.$$.fragment,o),w(Nn.$$.fragment,o),w(An.$$.fragment,o),w(Bn.$$.fragment,o),w(Rn.$$.fragment,o),w(Vn.$$.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(zo.$$.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(ks.$$.fragment,o),w(Io.$$.fragment,o),w(Ms.$$.fragment,o),w(Zo.$$.fragment,o),w(Co.$$.fragment,o),w($s.$$.fragment,o),w(zs.$$.fragment,o),w(Us.$$.fragment,o),w(Wo.$$.fragment,o),w(So.$$.fragment,o),w(Is.$$.fragment,o),w(Ao.$$.fragment,o),w(Zs.$$.fragment,o),w(Ro.$$.fragment,o),w(Cs.$$.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),nd=!0)},o(o){M(d.$$.fragment,o),M(O.$$.fragment,o),M(Ge.$$.fragment,o),M(bn.$$.fragment,o),M(Tn.$$.fragment,o),M(zn.$$.fragment,o),M(Fn.$$.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(Cn.$$.fragment,o),M(Nn.$$.fragment,o),M(An.$$.fragment,o),M(Bn.$$.fragment,o),M(Rn.$$.fragment,o),M(Vn.$$.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(zo.$$.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(ks.$$.fragment,o),M(Io.$$.fragment,o),M(Ms.$$.fragment,o),M(Zo.$$.fragment,o),M(Co.$$.fragment,o),M($s.$$.fragment,o),M(zs.$$.fragment,o),M(Us.$$.fragment,o),M(Wo.$$.fragment,o),M(So.$$.fragment,o),M(Is.$$.fragment,o),M(Ao.$$.fragment,o),M(Zs.$$.fragment,o),M(Ro.$$.fragment,o),M(Cs.$$.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),nd=!1},d(o){t(u),o&&t(b),o&&t(_),$(d),o&&t(Se),o&&t(C),o&&t(K),o&&t(L),o&&t(Ne),o&&t(q),$(O),o&&t(te),o&&t(oe),o&&t(Z),o&&t(ke),o&&t(Ae),o&&t(ne),o&&t(se),o&&t(X),o&&t(P),o&&t(Be),o&&t(yt),o&&t(Re),o&&t(ae),o&&t(me),$(Ge),o&&t(zi),o&&t(bt),o&&t(Fi),o&&t(Te),o&&t(xi),o&&t(Jt),$(bn),o&&t(ji),o&&t(kt),o&&t(Pi),o&&t(Gt),$(Tn),o&&t(Ei),o&&t(we),o&&t(Ji),o&&t(Zt),$(zn),o&&t(Gi),$(Fn,o),o&&t(Ui),o&&t(Ct),$(xn),o&&t(Ii),o&&t(vt),o&&t(Zi),o&&t(qt),$(jn),o&&t(Ci),o&&t(Ie),$(Pn),$(ho),o&&t(qi),o&&t(Nt),$(Jn),o&&t(Wi),o&&t(fo),o&&t(Si),o&&t(R),$(Gn),$(Cn),$(Nn),$(An),$(Bn),o&&t(Ni),o&&t(At),$(Rn),o&&t(Ai),o&&t(fe),$(Vn),$(On),$(Qn),o&&t(Bi),o&&t(Rt),$(Yn),o&&t(Ri),o&&t(Ze),$(Kn),$(ns),$(To),$(wo),o&&t(Vi),o&&t(Xt),$(ss),o&&t(Xi),o&&t(Ce),$(as),$(ls),$($o),$(zo),o&&t(Li),o&&t(Ot),$(cs),o&&t(Oi),o&&t(Ht),$(ps),$(us),$(jo),o&&t(Hi),o&&t(Dt),$(hs),o&&t(Di),o&&t(ge),$(ms),$(Eo),$(ys),$(Jo),$(Go),o&&t(Qi),o&&t(Yt),$(bs),o&&t(Yi),o&&t(_e),$(ks),$(Io),$(Ms),$(Zo),$(Co),o&&t(Ki),o&&t(eo),$($s),o&&t(ed),o&&t(W),$(zs),$(Us),$(Wo),$(So),$(Is),$(Ao),$(Zs),$(Ro),o&&t(td),o&&t(oo),$(Cs),o&&t(od),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 R_(F){return k_(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Q_ extends g_{constructor(u){super();__(this,u,R_,A_,y_,{})}}export{Q_ as default,B_ as metadata};
