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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate Summary</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;California&#x27;s largest electricity provider has turned off power to hundreds of thousands of customers.&quot;</span>`}}),{c(){u=n("p"),b=r("Summarization example:"),_=l(),v(m.$$.fragment)},l(i){u=s(i,"P",{});var h=a(u);b=d(h,"Summarization example:"),h.forEach(t),_=c(i),k(m.$$.fragment,i)},m(i,h){f(i,u,h),e(u,b),f(i,_,h),T(m,i,h),y=!0},p:Se,i(i){y||(w(m.$$.fragment,i),y=!0)},o(i){M(m.$$.fragment,i),y=!1},d(i){i&&t(u),i&&t(_),$(m,i)}}}function F_(z){let u,b,_,m,y;return m=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQZWdhc3VzRm9yQ2F1c2FsTE0lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZwZWdhc3VzLWxhcmdlJTIyKSUwQW1vZGVsJTIwJTNEJTIwUGVnYXN1c0ZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZwZWdhc3VzLWxhcmdlJTIyJTJDJTIwYWRkX2Nyb3NzX2F0dGVudGlvbiUzREZhbHNlKSUwQWFzc2VydCUyMG1vZGVsLmNvbmZpZy5pc19kZWNvZGVyJTJDJTIwZiUyMiU3Qm1vZGVsLl9fY2xhc3NfXyU3RCUyMGhhcyUyMHRvJTIwYmUlMjBjb25maWd1cmVkJTIwYXMlMjBhJTIwZGVjb2Rlci4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBZXhwZWN0ZWRfc2hhcGUlMjAlM0QlMjAlNUIxJTJDJTIwaW5wdXRzLmlucHV0X2lkcy5zaGFwZSU1Qi0xJTVEJTJDJTIwbW9kZWwuY29uZmlnLnZvY2FiX3NpemUlNUQlMEFsaXN0KGxvZ2l0cy5zaGFwZSklMjAlM0QlM0QlMjBleHBlY3RlZF9zaGFwZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, PegasusForCausalLM

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">... </span>model_name = <span class="hljs-string">&quot;google/pegasus-xsum&quot;</span>
<span class="hljs-meta">... </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>
<span class="hljs-meta">... </span>tokenizer = PegasusTokenizer.from_pretrained(model_name)
<span class="hljs-meta">... </span>model = PegasusForConditionalGeneration.from_pretrained(model_name).to(device)
<span class="hljs-meta">... </span>batch = tokenizer(src_text, truncation=<span class="hljs-literal">True</span>, padding=<span class="hljs-string">&quot;longest&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device)
<span class="hljs-meta">... </span>translated = model.generate(**batch)
<span class="hljs-meta">... </span>tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-meta">... </span><span class="hljs-keyword">assert</span> (
<span class="hljs-meta">... </span>    tgt_text[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>    == <span class="hljs-string">&quot;California&#x27;s largest electricity provider has turned off power to hundreds of thousands of customers.&quot;</span>
<span class="hljs-meta">... </span>)`}}),xn=new Q({}),jn=new Q({}),Pn=new J({props:{name:"class transformers.PegasusConfig",anchor:"transformers.PegasusConfig",parameters:[{name:"vocab_size",val:" = 50265"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 12"},{name:"encoder_ffn_dim",val:" = 4096"},{name:"encoder_attention_heads",val:" = 16"},{name:"decoder_layers",val:" = 12"},{name:"decoder_ffn_dim",val:" = 4096"},{name:"decoder_attention_heads",val:" = 16"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"use_cache",val:" = True"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'gelu'"},{name:"d_model",val:" = 1024"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"decoder_start_token_id",val:" = 0"},{name:"scale_embedding",val:" = False"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"forced_eos_token_id",val:" = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PegasusConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the PEGASUS model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.30.0/en/model_doc/pegasus#transformers.PegasusModel">PegasusModel</a> or <a href="/docs/transformers/v4.30.0/en/model_doc/pegasus#transformers.TFPegasusModel">TFPegasusModel</a>.`,name:"vocab_size"},{anchor:"transformers.PegasusConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.PegasusConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.PegasusConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.PegasusConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.PegasusConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.PegasusConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.PegasusConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.PegasusConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.PegasusConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.PegasusConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.PegasusConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.PegasusConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.PegasusConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.PegasusConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.PegasusConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.PegasusConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.PegasusConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models)`,name:"use_cache"},{anchor:"transformers.PegasusConfig.forced_eos_token_id",description:`<strong>forced_eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Usually set to
<code>eos_token_id</code>.`,name:"forced_eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/pegasus/configuration_pegasus.py#L29"}}),ho=new qe({props:{anchor:"transformers.PegasusConfig.example",$$slots:{default:[k_]},$$scope:{ctx:z}}}),Jn=new Q({}),Gn=new J({props:{name:"class transformers.PegasusTokenizer",anchor:"transformers.PegasusTokenizer",parameters:[{name:"vocab_file",val:""},{name:"pad_token",val:" = '<pad>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"mask_token",val:" = '<mask_2>'"},{name:"mask_token_sent",val:" = '<mask_1>'"},{name:"additional_special_tokens",val:" = None"},{name:"offset",val:" = 103"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PegasusTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.PegasusTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.PegasusTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

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