import{S as g_,i as __,s as k_,e as n,k as l,w as y,t as r,M as v_,c as s,d as t,m as c,a,x as b,h as i,b as p,N as f_,G as e,g as f,y as T,q as w,o as $,B as P,v as y_,L as Ne}from"../../chunks/vendor-hf-doc-builder.js";import{T as hn}from"../../chunks/Tip-hf-doc-builder.js";import{D as M}from"../../chunks/Docstring-hf-doc-builder.js";import{C as xe}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Z}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ge}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function b_(z){let u,v,_,m,k;return m=new xe({props:{code:`from transformers import PegasusConfig, PegasusModel

# Initializing a PEGASUS google/pegasus-large style configuration
configuration = PegasusConfig()

# Initializing a model (with random weights) from the google/pegasus-large style configuration
model = PegasusModel(configuration)

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

tokenizer = AutoTokenizer.from_pretrained("google/pegasus-large")
model = PegasusModel.from_pretrained("google/pegasus-large")

inputs = tokenizer("Studies have been shown that owning a dog is good for you", return_tensors="pt")
decoder_inputs = tokenizer("Studies show that", return_tensors="pt")
outputs = model(input_ids=inputs.input_ids, decoder_input_ids=decoder_inputs.input_ids)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,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"),v=r("Example:"),_=l(),y(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Example:"),h.forEach(t),_=c(d),b(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,v),f(d,_,h),T(m,d,h),k=!0},p:Ne,i(d){k||(w(m.$$.fragment,d),k=!0)},o(d){$(m.$$.fragment,d),k=!1},d(d){d&&t(u),d&&t(_),P(m,d)}}}function $_(z){let u,v,_,m,k;return{c(){u=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=r("Module"),k=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(h,"CODE",{});var E=a(_);m=i(E,"Module"),E.forEach(t),k=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(d,h){f(d,u,h),e(u,v),e(u,_),e(_,m),e(u,k)},d(d){d&&t(u)}}}function P_(z){let u,v,_,m,k;return m=new xe({props:{code:`from transformers import AutoTokenizer, PegasusForConditionalGeneration

model = PegasusForConditionalGeneration.from_pretrained("google/pegasus-xsum")
tokenizer = AutoTokenizer.from_pretrained("google/pegasus-xsum")

ARTICLE_TO_SUMMARIZE = (
    "PG&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."
)
inputs = tokenizer(ARTICLE_TO_SUMMARIZE, max_length=1024, return_tensors="pt")

# Generate Summary
summary_ids = model.generate(inputs["input_ids"])
tokenizer.batch_decode(summary_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]`,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"),v=r("Summarization example:"),_=l(),y(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Summarization example:"),h.forEach(t),_=c(d),b(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,v),f(d,_,h),T(m,d,h),k=!0},p:Ne,i(d){k||(w(m.$$.fragment,d),k=!0)},o(d){$(m.$$.fragment,d),k=!1},d(d){d&&t(u),d&&t(_),P(m,d)}}}function x_(z){let u,v,_,m,k;return m=new xe({props:{code:`from transformers import AutoTokenizer, PegasusForCausalLM

tokenizer = AutoTokenizer.from_pretrained("google/pegasus-large")
model = PegasusForCausalLM.from_pretrained("google/pegasus-large", add_cross_attention=False)
assert model.config.is_decoder, f"{model.__class__} has to be configured as a decoder."
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

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

tokenizer = AutoTokenizer.from_pretrained("google/pegasus-large")
model = TFPegasusModel.from_pretrained("google/pegasus-large")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)

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

model = TFPegasusForConditionalGeneration.from_pretrained("google/pegasus-xsum")
tokenizer = AutoTokenizer.from_pretrained("google/pegasus-xsum")

ARTICLE_TO_SUMMARIZE = (
    "PG&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."
)
inputs = tokenizer(ARTICLE_TO_SUMMARIZE, max_length=1024, return_tensors="tf")

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

tokenizer = AutoTokenizer.from_pretrained("google/pegasus-large")
model = FlaxPegasusModel.from_pretrained("google/pegasus-large")

inputs = tokenizer("Hello, my dog is cute", return_tensors="jax")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,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"),v=r("Example:"),_=l(),y(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Example:"),h.forEach(t),_=c(d),b(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,v),f(d,_,h),T(m,d,h),k=!0},p:Ne,i(d){k||(w(m.$$.fragment,d),k=!0)},o(d){$(m.$$.fragment,d),k=!1},d(d){d&&t(u),d&&t(_),P(m,d)}}}function S_(z){let u,v,_,m,k;return m=new xe({props:{code:`from transformers import AutoTokenizer, FlaxPegasusForConditionalGeneration

model = FlaxPegasusForConditionalGeneration.from_pretrained("google/pegasus-large")
tokenizer = AutoTokenizer.from_pretrained("google/pegasus-large")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, max_length=1024, return_tensors="np")
encoder_outputs = model.encode(**inputs)`,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"),v=r("Example:"),_=l(),y(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Example:"),h.forEach(t),_=c(d),b(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,v),f(d,_,h),T(m,d,h),k=!0},p:Ne,i(d){k||(w(m.$$.fragment,d),k=!0)},o(d){$(m.$$.fragment,d),k=!1},d(d){d&&t(u),d&&t(_),P(m,d)}}}function I_(z){let u,v,_,m,k;return m=new xe({props:{code:`import jax.numpy as jnp
from transformers import AutoTokenizer, FlaxPegasusForConditionalGeneration

model = FlaxPegasusForConditionalGeneration.from_pretrained("google/pegasus-large")
tokenizer = AutoTokenizer.from_pretrained("google/pegasus-large")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, max_length=1024, return_tensors="np")
encoder_outputs = model.encode(**inputs)

decoder_start_token_id = model.config.decoder_start_token_id
decoder_input_ids = jnp.ones((inputs.input_ids.shape[0], 1), dtype="i4") * decoder_start_token_id

outputs = model.decode(decoder_input_ids, encoder_outputs)
last_decoder_hidden_states = outputs.last_hidden_state`,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"),v=r("Example:"),_=l(),y(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Example:"),h.forEach(t),_=c(d),b(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,v),f(d,_,h),T(m,d,h),k=!0},p:Ne,i(d){k||(w(m.$$.fragment,d),k=!0)},o(d){$(m.$$.fragment,d),k=!1},d(d){d&&t(u),d&&t(_),P(m,d)}}}function O_(z){let u,v,_,m,k;return{c(){u=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),m=r("Module"),k=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(h,"CODE",{});var E=a(_);m=i(E,"Module"),E.forEach(t),k=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(d,h){f(d,u,h),e(u,v),e(u,_),e(_,m),e(u,k)},d(d){d&&t(u)}}}function G_(z){let u,v,_,m,k;return m=new xe({props:{code:`from transformers import AutoTokenizer, FlaxPegasusForConditionalGeneration

model = FlaxPegasusForConditionalGeneration.from_pretrained('google/pegasus-large')
tokenizer = AutoTokenizer.from_pretrained('google/pegasus-large')

ARTICLE_TO_SUMMARIZE = "My friends are cool but they eat too many carbs."
inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors='np')

# Generate Summary
summary_ids = model.generate(inputs['input_ids']).sequences
print(tokenizer.batch_decode(summary_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False))`,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"),v=r("Summarization example:"),_=l(),y(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Summarization example:"),h.forEach(t),_=c(d),b(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,v),f(d,_,h),T(m,d,h),k=!0},p:Ne,i(d){k||(w(m.$$.fragment,d),k=!0)},o(d){$(m.$$.fragment,d),k=!1},d(d){d&&t(u),d&&t(_),P(m,d)}}}function N_(z){let u,v,_,m,k;return m=new xe({props:{code:`from transformers import AutoTokenizer, FlaxPegasusForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("google/pegasus-large")
TXT = "My friends are <mask> but they eat too many carbs."

model = FlaxPegasusForConditionalGeneration.from_pretrained("google/pegasus-large")
input_ids = tokenizer([TXT], return_tensors="np")["input_ids"]
logits = model(input_ids).logits

masked_index = (input_ids[0] == tokenizer.mask_token_id).nonzero().item()
probs = jax.nn.softmax(logits[0, masked_index], axis=0)
values, predictions = jax.lax.top_k(probs)

tokenizer.decode(predictions).split()`,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"),v=r("Mask filling example:"),_=l(),y(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Mask filling example:"),h.forEach(t),_=c(d),b(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,v),f(d,_,h),T(m,d,h),k=!0},p:Ne,i(d){k||(w(m.$$.fragment,d),k=!0)},o(d){$(m.$$.fragment,d),k=!1},d(d){d&&t(u),d&&t(_),P(m,d)}}}function L_(z){let u,v,_,m,k;return m=new xe({props:{code:`from transformers import AutoTokenizer, FlaxPegasusForConditionalGeneration

model = FlaxPegasusForConditionalGeneration.from_pretrained("google/pegasus-large")
tokenizer = AutoTokenizer.from_pretrained("google/pegasus-large")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, max_length=1024, return_tensors="np")
encoder_outputs = model.encode(**inputs)`,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"),v=r("Example:"),_=l(),y(m.$$.fragment)},l(d){u=s(d,"P",{});var h=a(u);v=i(h,"Example:"),h.forEach(t),_=c(d),b(m.$$.fragment,d)},m(d,h){f(d,u,h),e(u,v),f(d,_,h),T(m,d,h),k=!0},p:Ne,i(d){k||(w(m.$$.fragment,d),k=!0)},o(d){$(m.$$.fragment,d),k=!1},d(d){d&&t(u),d&&t(_),P(m,d)}}}function D_(z){let u,v,_,m,k;return m=new xe({props:{code:`import jax.numpy as jnp
from transformers import AutoTokenizer, FlaxPegasusForConditionalGeneration

model = FlaxPegasusForConditionalGeneration.from_pretrained("google/pegasus-large")
tokenizer = AutoTokenizer.from_pretrained("google/pegasus-large")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, max_length=1024, return_tensors="np")
encoder_outputs = model.encode(**inputs)

decoder_start_token_id = model.config.decoder_start_token_id
decoder_input_ids = jnp.ones((inputs.input_ids.shape[0], 1), dtype="i4") * decoder_start_token_id

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

src_text = [
    """ PG&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."""
]

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