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