import{S as $l,i as xl,s as zl,e as r,k as h,w as v,t as a,M as Ll,c as i,d as o,m,a as d,x as k,h as s,b as u,G as e,g as T,y,q as w,o as $,B as x,v as ql,L as fe}from"../../chunks/vendor-hf-doc-builder.js";import{T as qn}from"../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as X}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as me}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ge}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function jl(z){let l,b,g,p,_;return{c(){l=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),p=a("Module"),_=a(`
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(n){l=i(n,"P",{});var c=d(l);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(c,"CODE",{});var L=d(g);p=s(L,"Module"),L.forEach(o),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){T(n,l,c),e(l,b),e(l,g),e(g,p),e(l,_)},d(n){n&&o(l)}}}function Fl(z){let l,b,g,p,_;return p=new X({props:{code:`from transformers import AutoTokenizer, LongT5Model

tokenizer = AutoTokenizer.from_pretrained("google/long-t5-local-base")
model = LongT5Model.from_pretrained("google/long-t5-local-base")

# Let's try a very long encoder input.
input_ids = tokenizer(
    100 * "Studies have been shown that owning a dog is good for you", return_tensors="pt"
).input_ids  # Batch size 1

decoder_input_ids = tokenizer("Studies show that", return_tensors="pt").input_ids  # Batch size 1

# forward pass
outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
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, LongT5Model

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LongT5Model.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Let&#x27;s try a very long encoder input.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-number">100</span> * <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">... </span>).input_ids  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(<span class="hljs-string">&quot;Studies show that&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){l=r("p"),b=a("Example:"),g=h(),v(p.$$.fragment)},l(n){l=i(n,"P",{});var c=d(l);b=s(c,"Example:"),c.forEach(o),g=m(n),k(p.$$.fragment,n)},m(n,c){T(n,l,c),e(l,b),T(n,g,c),y(p,n,c),_=!0},p:fe,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(l),n&&o(g),x(p,n)}}}function Ml(z){let l,b,g,p,_;return{c(){l=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),p=a("Module"),_=a(`
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(n){l=i(n,"P",{});var c=d(l);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(c,"CODE",{});var L=d(g);p=s(L,"Module"),L.forEach(o),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){T(n,l,c),e(l,b),e(l,g),e(g,p),e(l,_)},d(n){n&&o(l)}}}function El(z){let l,b,g,p,_;return p=new X({props:{code:`from transformers import AutoTokenizer, LongT5ForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("Stancld/longt5-tglobal-large-16384-pubmed-3k_steps")
model = LongT5ForConditionalGeneration.from_pretrained(
    "Stancld/longt5-tglobal-large-16384-pubmed-3k_steps"
)

# Let's try a very long input.
inputs = tokenizer(100 * "studies have shown that owning a dog is good for you ", return_tensors="pt")
input_ids = inputs.input_ids

outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LongT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Stancld/longt5-tglobal-large-16384-pubmed-3k_steps&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LongT5ForConditionalGeneration.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Stancld/longt5-tglobal-large-16384-pubmed-3k_steps&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Let&#x27;s try a very long input.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-number">100</span> * <span class="hljs-string">&quot;studies have 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>input_ids = inputs.input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
abstractthe aim of this article <span class="hljs-keyword">is</span> to provide an overview of the literature on the role of dog`}}),{c(){l=r("p"),b=a("Examples:"),g=h(),v(p.$$.fragment)},l(n){l=i(n,"P",{});var c=d(l);b=s(c,"Examples:"),c.forEach(o),g=m(n),k(p.$$.fragment,n)},m(n,c){T(n,l,c),e(l,b),T(n,g,c),y(p,n,c),_=!0},p:fe,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(l),n&&o(g),x(p,n)}}}function Cl(z){let l,b,g,p,_;return{c(){l=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),p=a("Module"),_=a(`
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(n){l=i(n,"P",{});var c=d(l);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(c,"CODE",{});var L=d(g);p=s(L,"Module"),L.forEach(o),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){T(n,l,c),e(l,b),e(l,g),e(g,p),e(l,_)},d(n){n&&o(l)}}}function Al(z){let l,b,g,p,_;return p=new X({props:{code:`from transformers import AutoTokenizer, LongT5ForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("google/long-t5-local-base")
model = LongT5EncoderModel.from_pretrained("google/long-t5-local-base")
input_ids = tokenizer(
    100 * "Studies have been shown that owning a dog is good for you ", return_tensors="pt"
).input_ids  # Batch size 1
outputs = model(input_ids=input_ids)
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, LongT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LongT5EncoderModel.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-number">100</span> * <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">... </span>).input_ids  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){l=r("p"),b=a("Example:"),g=h(),v(p.$$.fragment)},l(n){l=i(n,"P",{});var c=d(l);b=s(c,"Example:"),c.forEach(o),g=m(n),k(p.$$.fragment,n)},m(n,c){T(n,l,c),e(l,b),T(n,g,c),y(p,n,c),_=!0},p:fe,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(l),n&&o(g),x(p,n)}}}function Ol(z){let l,b,g,p,_;return{c(){l=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),p=a("Module"),_=a(`
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(n){l=i(n,"P",{});var c=d(l);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(c,"CODE",{});var L=d(g);p=s(L,"Module"),L.forEach(o),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){T(n,l,c),e(l,b),e(l,g),e(g,p),e(l,_)},d(n){n&&o(l)}}}function Pl(z){let l,b,g,p,_;return p=new X({props:{code:`from transformers import AutoTokenizer, FlaxLongT5Model

tokenizer = AutoTokenizer.from_pretrained("t5-base")
model = FlaxLongT5Model.from_pretrained("google/long-t5-local-base")

input_ids = tokenizer(
    "Studies have been shown that owning a dog is good for you", return_tensors="np"
).input_ids
decoder_input_ids = tokenizer("Studies show that", return_tensors="np").input_ids

# forward pass
outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
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, FlaxLongT5Model

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxLongT5Model.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <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;np&quot;</span>
<span class="hljs-meta">... </span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(<span class="hljs-string">&quot;Studies show that&quot;</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){l=r("p"),b=a("Example:"),g=h(),v(p.$$.fragment)},l(n){l=i(n,"P",{});var c=d(l);b=s(c,"Example:"),c.forEach(o),g=m(n),k(p.$$.fragment,n)},m(n,c){T(n,l,c),e(l,b),T(n,g,c),y(p,n,c),_=!0},p:fe,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(l),n&&o(g),x(p,n)}}}function Gl(z){let l,b,g,p,_;return p=new X({props:{code:`from transformers import AutoTokenizer, FlaxLongT5ForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("t5-base")
model = FlaxLongT5ForConditionalGeneration.from_pretrained("google/long-t5-local-base")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, 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, FlaxLongT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxLongT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&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, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)`}}),{c(){l=r("p"),b=a("Example:"),g=h(),v(p.$$.fragment)},l(n){l=i(n,"P",{});var c=d(l);b=s(c,"Example:"),c.forEach(o),g=m(n),k(p.$$.fragment,n)},m(n,c){T(n,l,c),e(l,b),T(n,g,c),y(p,n,c),_=!0},p:fe,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(l),n&&o(g),x(p,n)}}}function Sl(z){let l,b,g,p,_;return p=new X({props:{code:`from transformers import AutoTokenizer, FlaxLongT5ForConditionalGeneration
import jax.numpy as jnp

tokenizer = AutoTokenizer.from_pretrained("t5-base")
model = FlaxLongT5ForConditionalGeneration.from_pretrained("google/long-t5-local-base")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, 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">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxLongT5ForConditionalGeneration
<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>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxLongT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&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, 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(){l=r("p"),b=a("Example:"),g=h(),v(p.$$.fragment)},l(n){l=i(n,"P",{});var c=d(l);b=s(c,"Example:"),c.forEach(o),g=m(n),k(p.$$.fragment,n)},m(n,c){T(n,l,c),e(l,b),T(n,g,c),y(p,n,c),_=!0},p:fe,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(l),n&&o(g),x(p,n)}}}function Nl(z){let l,b,g,p,_;return{c(){l=r("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),p=a("Module"),_=a(`
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(n){l=i(n,"P",{});var c=d(l);b=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(c,"CODE",{});var L=d(g);p=s(L,"Module"),L.forEach(o),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){T(n,l,c),e(l,b),e(l,g),e(g,p),e(l,_)},d(n){n&&o(l)}}}function Il(z){let l,b,g,p,_;return p=new X({props:{code:`from transformers import AutoTokenizer, FlaxLongT5ForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("t5-base")
model = FlaxLongT5ForConditionalGeneration.from_pretrained("google/long-t5-local-base")

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

# Generate Summary
summary_ids = model.generate(inputs["input_ids"]).sequences
print(tokenizer.decode(summary_ids[0], 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, FlaxLongT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxLongT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = <span class="hljs-string">&quot;summarize: My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([ARTICLE_TO_SUMMARIZE], return_tensors=<span class="hljs-string">&quot;np&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>]).sequences
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(summary_ids[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>))`}}),{c(){l=r("p"),b=a("Example:"),g=h(),v(p.$$.fragment)},l(n){l=i(n,"P",{});var c=d(l);b=s(c,"Example:"),c.forEach(o),g=m(n),k(p.$$.fragment,n)},m(n,c){T(n,l,c),e(l,b),T(n,g,c),y(p,n,c),_=!0},p:fe,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(l),n&&o(g),x(p,n)}}}function Dl(z){let l,b,g,p,_;return p=new X({props:{code:`from transformers import AutoTokenizer, FlaxLongT5ForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("t5-base")
model = FlaxLongT5ForConditionalGeneration.from_pretrained("google/long-t5-local-base")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, 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, FlaxLongT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxLongT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&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, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)`}}),{c(){l=r("p"),b=a("Example:"),g=h(),v(p.$$.fragment)},l(n){l=i(n,"P",{});var c=d(l);b=s(c,"Example:"),c.forEach(o),g=m(n),k(p.$$.fragment,n)},m(n,c){T(n,l,c),e(l,b),T(n,g,c),y(p,n,c),_=!0},p:fe,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(l),n&&o(g),x(p,n)}}}function Bl(z){let l,b,g,p,_;return p=new X({props:{code:`from transformers import AutoTokenizer, FlaxLongT5ForConditionalGeneration
import jax.numpy as jnp

tokenizer = AutoTokenizer.from_pretrained("t5-base")
model = FlaxLongT5ForConditionalGeneration.from_pretrained("google/long-t5-local-base")

text = "summarize: My friends are cool but they eat too many carbs."
inputs = tokenizer(text, 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">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxLongT5ForConditionalGeneration
<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>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxLongT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/long-t5-local-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;summarize: My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, 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(){l=r("p"),b=a("Example:"),g=h(),v(p.$$.fragment)},l(n){l=i(n,"P",{});var c=d(l);b=s(c,"Example:"),c.forEach(o),g=m(n),k(p.$$.fragment,n)},m(n,c){T(n,l,c),e(l,b),T(n,g,c),y(p,n,c),_=!0},p:fe,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){$(p.$$.fragment,n),_=!1},d(n){n&&o(l),n&&o(g),x(p,n)}}}function Wl(z){let l,b,g,p,_,n,c,L,wa,jn,ee,_e,wo,Xe,$a,$o,xa,Fn,Te,za,et,La,qa,Mn,Kt,ja,En,Zt,xo,Fa,Cn,Qt,Ma,An,C,A,Xt,Ea,Ca,eo,Aa,Oa,zo,Pa,Ga,Lo,Sa,Na,qo,Ia,Da,jo,Ba,Wa,Ua,tt,Ha,to,Ya,Ra,Ja,ot,Va,Fo,Ka,Za,Qa,j,Xa,Mo,es,ts,Eo,os,ns,Co,as,ss,Ao,rs,is,Oo,ds,ls,Po,cs,ps,us,q,Go,hs,ms,So,gs,fs,No,_s,Ts,Io,bs,vs,Do,ks,ys,Bo,ws,$s,Wo,xs,zs,Ls,nt,qs,at,js,Fs,On,st,Pn,Q,Ms,rt,Es,Cs,it,As,Os,Gn,te,be,Uo,dt,Ps,Ho,Gs,Sn,ve,Yo,oo,Ss,Ns,Ro,no,Is,Nn,oe,ke,Jo,lt,Ds,Vo,Bs,In,K,ct,Ws,Z,Us,ao,Hs,Ys,so,Rs,Js,pt,Vs,Ks,Zs,ne,Qs,ro,Xs,er,io,tr,or,Dn,ae,ye,Ko,ut,nr,Zo,ar,Bn,F,ht,sr,Qo,rr,ir,mt,dr,gt,lr,cr,pr,ft,ur,lo,hr,mr,gr,_t,fr,Tt,_r,Tr,br,D,bt,vr,se,kr,co,yr,wr,Xo,$r,xr,zr,we,Lr,$e,Wn,re,xe,en,vt,qr,tn,jr,Un,M,kt,Fr,yt,Mr,on,Er,Cr,Ar,wt,Or,$t,Pr,Gr,Sr,xt,Nr,po,Ir,Dr,Br,zt,Wr,Lt,Ur,Hr,Yr,B,qt,Rr,ie,Jr,uo,Vr,Kr,nn,Zr,Qr,Xr,ze,ei,Le,Hn,de,qe,an,jt,ti,sn,oi,Yn,E,Ft,ni,rn,ai,si,Mt,ri,Et,ii,di,li,Ct,ci,ho,pi,ui,hi,At,mi,Ot,gi,fi,_i,W,Pt,Ti,le,bi,mo,vi,ki,dn,yi,wi,$i,je,xi,Fe,Rn,ce,Me,ln,Gt,zi,cn,Li,Jn,S,St,qi,U,Nt,ji,pe,Fi,pn,Mi,Ei,un,Ci,Ai,Oi,Ee,Pi,Ce,Gi,Ae,It,Si,Oe,Ni,Pe,Dt,Ii,Ge,Vn,ue,Se,hn,Bt,Di,mn,Bi,Kn,N,Wt,Wi,H,Ut,Ui,he,Hi,gn,Yi,Ri,fn,Ji,Vi,Ki,Ne,Zi,Ie,Qi,De,Ht,Xi,Be,ed,We,Yt,td,Ue,Zn;return n=new me({}),Xe=new me({}),st=new X({props:{code:`import evaluate
from datasets import load_dataset
from transformers import AutoTokenizer, LongT5ForConditionalGeneration

dataset = load_dataset("scientific_papers", "pubmed", split="validation")
model = (
    LongT5ForConditionalGeneration.from_pretrained("Stancld/longt5-tglobal-large-16384-pubmed-3k_steps")
    .to("cuda")
    .half()
)
tokenizer = AutoTokenizer.from_pretrained("Stancld/longt5-tglobal-large-16384-pubmed-3k_steps")


def generate_answers(batch):
    inputs_dict = tokenizer(
        batch["article"], max_length=16384, padding="max_length", truncation=True, return_tensors="pt"
    )
    input_ids = inputs_dict.input_ids.to("cuda")
    attention_mask = inputs_dict.attention_mask.to("cuda")
    output_ids = model.generate(input_ids, attention_mask=attention_mask, max_length=512, num_beams=2)
    batch["predicted_abstract"] = tokenizer.batch_decode(output_ids, skip_special_tokens=True)
    return batch


result = dataset.map(generate_answer, batched=True, batch_size=2)
rouge = evaluate.load("rouge")
rouge.compute(predictions=result["predicted_abstract"], references=result["abstract"])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> evaluate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LongT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;scientific_papers&quot;</span>, <span class="hljs-string">&quot;pubmed&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = (
<span class="hljs-meta">... </span>    LongT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;Stancld/longt5-tglobal-large-16384-pubmed-3k_steps&quot;</span>)
<span class="hljs-meta">... </span>    .to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">... </span>    .half()
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Stancld/longt5-tglobal-large-16384-pubmed-3k_steps&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">generate_answers</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    inputs_dict = tokenizer(
<span class="hljs-meta">... </span>        batch[<span class="hljs-string">&quot;article&quot;</span>], max_length=<span class="hljs-number">16384</span>, padding=<span class="hljs-string">&quot;max_length&quot;</span>, truncation=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>    )
<span class="hljs-meta">... </span>    input_ids = inputs_dict.input_ids.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">... </span>    attention_mask = inputs_dict.attention_mask.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">... </span>    output_ids = model.generate(input_ids, attention_mask=attention_mask, max_length=<span class="hljs-number">512</span>, num_beams=<span class="hljs-number">2</span>)
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;predicted_abstract&quot;</span>] = tokenizer.batch_decode(output_ids, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span>result = dataset.<span class="hljs-built_in">map</span>(generate_answer, batched=<span class="hljs-literal">True</span>, batch_size=<span class="hljs-number">2</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>rouge = evaluate.load(<span class="hljs-string">&quot;rouge&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>rouge.compute(predictions=result[<span class="hljs-string">&quot;predicted_abstract&quot;</span>], references=result[<span class="hljs-string">&quot;abstract&quot;</span>])`}}),dt=new me({}),lt=new me({}),ct=new P({props:{name:"class transformers.LongT5Config",anchor:"transformers.LongT5Config",parameters:[{name:"vocab_size",val:" = 32128"},{name:"d_model",val:" = 512"},{name:"d_kv",val:" = 64"},{name:"d_ff",val:" = 2048"},{name:"num_layers",val:" = 6"},{name:"num_decoder_layers",val:" = None"},{name:"num_heads",val:" = 8"},{name:"local_radius",val:" = 127"},{name:"global_block_size",val:" = 16"},{name:"relative_attention_num_buckets",val:" = 32"},{name:"relative_attention_max_distance",val:" = 128"},{name:"dropout_rate",val:" = 0.1"},{name:"layer_norm_epsilon",val:" = 1e-06"},{name:"initializer_factor",val:" = 1.0"},{name:"feed_forward_proj",val:" = 'relu'"},{name:"is_encoder_decoder",val:" = True"},{name:"encoder_attention_type",val:" = 'local'"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LongT5Config.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32128) &#x2014;
Vocabulary size of the LongT5 model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Model">LongT5Model</a>.`,name:"vocab_size"},{anchor:"transformers.LongT5Config.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Size of the encoder layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.LongT5Config.d_kv",description:`<strong>d_kv</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Size of the key, query, value projections per attention head. <code>d_kv</code> has to be equal to <code>d_model // num_heads</code>.`,name:"d_kv"},{anchor:"transformers.LongT5Config.d_ff",description:`<strong>d_ff</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Size of the intermediate feed forward layer in each <code>LongT5Block</code>.`,name:"d_ff"},{anchor:"transformers.LongT5Config.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_layers"},{anchor:"transformers.LongT5Config.num_decoder_layers",description:`<strong>num_decoder_layers</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of hidden layers in the Transformer decoder. Will use the same value as <code>num_layers</code> if not set.`,name:"num_decoder_layers"},{anchor:"transformers.LongT5Config.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.LongT5Config.local_radius",description:`<strong>local_radius</strong> (<code>int</code>, <em>optional</em>, defaults to 127) &#x2014;
Number of tokens to the left/right for each token to locally self-attend in a local attention mechanism.`,name:"local_radius"},{anchor:"transformers.LongT5Config.global_block_size",description:`<strong>global_block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Lenght of blocks an input sequence is divided into for a global token representation. Used only for
<code>encoder_attention_type = &quot;transient-global&quot;</code>.`,name:"global_block_size"},{anchor:"transformers.LongT5Config.relative_attention_num_buckets",description:`<strong>relative_attention_num_buckets</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The number of buckets to use for each attention layer.`,name:"relative_attention_num_buckets"},{anchor:"transformers.LongT5Config.relative_attention_max_distance",description:`<strong>relative_attention_max_distance</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
The maximum distance of the longer sequences for the bucket separation.`,name:"relative_attention_max_distance"},{anchor:"transformers.LongT5Config.dropout_rate",description:`<strong>dropout_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The ratio for all dropout layers.`,name:"dropout_rate"},{anchor:"transformers.LongT5Config.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-6) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.LongT5Config.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.LongT5Config.feed_forward_proj",description:`<strong>feed_forward_proj</strong> (<code>string</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
Type of feed forward layer to be used. Should be one of <code>&quot;relu&quot;</code> or <code>&quot;gated-gelu&quot;</code>. LongT5v1.1 uses the
<code>&quot;gated-gelu&quot;</code> feed forward projection. Original LongT5 implementation uses <code>&quot;gated-gelu&quot;</code>.`,name:"feed_forward_proj"},{anchor:"transformers.LongT5Config.encoder_attention_type",description:`<strong>encoder_attention_type</strong> (<code>string</code>, <em>optional</em>, defaults to <code>&quot;local&quot;</code>) &#x2014;
Type of encoder attention to be used. Should be one of <code>&quot;local&quot;</code> or <code>&quot;transient-global&quot;</code>, which are
supported by LongT5 implementation.`,name:"encoder_attention_type"},{anchor:"transformers.LongT5Config.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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/configuration_longt5.py#L33"}}),ut=new me({}),ht=new P({props:{name:"class transformers.LongT5Model",anchor:"transformers.LongT5Model",parameters:[{name:"config",val:": LongT5Config"}],parametersDescription:[{anchor:"transformers.LongT5Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Config">LongT5Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_longt5.py#L1762"}}),bt=new P({props:{name:"forward",anchor:"transformers.LongT5Model.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[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.LongT5Model.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. LongT5 is a model with relative position embeddings so
you should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./longt5#training">LONGT5
Training</a>.`,name:"input_ids"},{anchor:"transformers.LongT5Model.forward.attention_mask",description:`<strong>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 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.LongT5Model.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>LONGT5 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>).</p>
<p>To know more on how to prepare <code>decoder_input_ids</code> for pretraining take a look at <a href="./longt5#training">LONGT5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.LongT5Model.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</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.LongT5Model.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.LongT5Model.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.LongT5Model.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_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.LongT5Model.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>, <code>optional</code>: <em>hidden_states</em>, <code>optional</code>: <em>attentions</em>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code> 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.LongT5Model.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up 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.LongT5Model.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
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:"inputs_embeds"},{anchor:"transformers.LongT5Model.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.LongT5Model.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.LongT5Model.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.LongT5Model.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.LongT5Model.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_longt5.py#L1812",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Config"
>LongT5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),we=new qn({props:{$$slots:{default:[jl]},$$scope:{ctx:z}}}),$e=new ge({props:{anchor:"transformers.LongT5Model.forward.example",$$slots:{default:[Fl]},$$scope:{ctx:z}}}),vt=new me({}),kt=new P({props:{name:"class transformers.LongT5ForConditionalGeneration",anchor:"transformers.LongT5ForConditionalGeneration",parameters:[{name:"config",val:": LongT5Config"}],parametersDescription:[{anchor:"transformers.LongT5ForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Config">LongT5Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_longt5.py#L1915"}}),qt=new P({props:{name:"forward",anchor:"transformers.LongT5ForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_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.LongT5ForConditionalGeneration.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. LongT5 is a model with relative position embeddings so
you should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./longt5#training">LONGT5
Training</a>.`,name:"input_ids"},{anchor:"transformers.LongT5ForConditionalGeneration.forward.attention_mask",description:`<strong>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 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.LongT5ForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>LONGT5 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>).</p>
<p>To know more on how to prepare <code>decoder_input_ids</code> for pretraining take a look at <a href="./longt5#training">LONGT5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.LongT5ForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</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.LongT5ForConditionalGeneration.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.LongT5ForConditionalGeneration.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.LongT5ForConditionalGeneration.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_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.LongT5ForConditionalGeneration.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>, <code>optional</code>: <em>hidden_states</em>, <code>optional</code>: <em>attentions</em>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code> 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.LongT5ForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up 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.LongT5ForConditionalGeneration.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
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:"inputs_embeds"},{anchor:"transformers.LongT5ForConditionalGeneration.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.LongT5ForConditionalGeneration.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.LongT5ForConditionalGeneration.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.LongT5ForConditionalGeneration.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.LongT5ForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LongT5ForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[-100, 0, ..., config.vocab_size - 1]</code>. All labels set to <code>-100</code> are ignored (masked), the loss is only computed for
labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_longt5.py#L1968",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Config"
>LongT5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ze=new qn({props:{$$slots:{default:[Ml]},$$scope:{ctx:z}}}),Le=new ge({props:{anchor:"transformers.LongT5ForConditionalGeneration.forward.example",$$slots:{default:[El]},$$scope:{ctx:z}}}),jt=new me({}),Ft=new P({props:{name:"class transformers.LongT5EncoderModel",anchor:"transformers.LongT5EncoderModel",parameters:[{name:"config",val:": LongT5Config"}],parametersDescription:[{anchor:"transformers.LongT5EncoderModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Config">LongT5Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_longt5.py#L2155"}}),Pt=new P({props:{name:"forward",anchor:"transformers.LongT5EncoderModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = 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.LongT5EncoderModel.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. LongT5 is a model with relative position embeddings so
you should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./longt5#training">LONGT5
Training</a>.`,name:"input_ids"},{anchor:"transformers.LongT5EncoderModel.forward.attention_mask",description:`<strong>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 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.LongT5EncoderModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.LongT5EncoderModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
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:"inputs_embeds"},{anchor:"transformers.LongT5EncoderModel.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.LongT5EncoderModel.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.LongT5EncoderModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_longt5.py#L2188",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Config"
>LongT5Config</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 model.</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new qn({props:{$$slots:{default:[Cl]},$$scope:{ctx:z}}}),Fe=new ge({props:{anchor:"transformers.LongT5EncoderModel.forward.example",$$slots:{default:[Al]},$$scope:{ctx:z}}}),Gt=new me({}),St=new P({props:{name:"class transformers.FlaxLongT5Model",anchor:"transformers.FlaxLongT5Model",parameters:[{name:"config",val:": LongT5Config"},{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:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_flax_longt5.py#L2108"}}),Nt=new P({props:{name:"__call__",anchor:"transformers.FlaxLongT5Model.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": ndarray = None"},{name:"decoder_attention_mask",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.FlaxLongT5Model.__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. LongT5 is a model with relative position embeddings so
you should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./longt5#training">LONGT5
Training</a>.`,name:"input_ids"},{anchor:"transformers.FlaxLongT5Model.__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.FlaxLongT5Model.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>LONGT5 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>).</p>
<p>To know more on how to prepare <code>decoder_input_ids</code> for pretraining take a look at <a href="./longt5#training">LONGT5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxLongT5Model.__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.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxLongT5Model.__call__.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <code>optional</code>: <em>hidden_states</em>, <code>optional</code>: <em>attentions</em>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code> 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.FlaxLongT5Model.__call__.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up 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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_flax_longt5.py#L1724",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Config"
>LongT5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ee=new qn({props:{$$slots:{default:[Ol]},$$scope:{ctx:z}}}),Ce=new ge({props:{anchor:"transformers.FlaxLongT5Model.__call__.example",$$slots:{default:[Pl]},$$scope:{ctx:z}}}),It=new P({props:{name:"encode",anchor:"transformers.FlaxLongT5Model.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",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.FlaxLongT5Model.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. LongT5 is a model with relative position embeddings so
you should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./longt5#training">LONGT5
Training</a>.`,name:"input_ids"},{anchor:"transformers.FlaxLongT5Model.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.FlaxLongT5Model.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.FlaxLongT5Model.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.FlaxLongT5Model.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_flax_longt5.py#L1810",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.longt5.configuration_longt5.LongT5Config'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Oe=new ge({props:{anchor:"transformers.FlaxLongT5Model.encode.example",$$slots:{default:[Gl]},$$scope:{ctx:z}}}),Dt=new P({props:{name:"decode",anchor:"transformers.FlaxLongT5Model.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:"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.FlaxLongT5Model.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For training, <code>decoder_input_ids</code> should be provided.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxLongT5Model.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.FlaxLongT5Model.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.FlaxLongT5Model.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.FlaxLongT5Model.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.FlaxLongT5Model.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.FlaxLongT5Model.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.FlaxLongT5Model.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_flax_longt5.py#L1868",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.longt5.configuration_longt5.LongT5Config'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ge=new ge({props:{anchor:"transformers.FlaxLongT5Model.decode.example",$$slots:{default:[Sl]},$$scope:{ctx:z}}}),Bt=new me({}),Wt=new P({props:{name:"class transformers.FlaxLongT5ForConditionalGeneration",anchor:"transformers.FlaxLongT5ForConditionalGeneration",parameters:[{name:"config",val:": LongT5Config"},{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:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_flax_longt5.py#L2253"}}),Ut=new P({props:{name:"__call__",anchor:"transformers.FlaxLongT5ForConditionalGeneration.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": ndarray = None"},{name:"decoder_attention_mask",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.FlaxLongT5ForConditionalGeneration.__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. LongT5 is a model with relative position embeddings so
you should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./longt5#training">LONGT5
Training</a>.`,name:"input_ids"},{anchor:"transformers.FlaxLongT5ForConditionalGeneration.__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.FlaxLongT5ForConditionalGeneration.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>LONGT5 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>).</p>
<p>To know more on how to prepare <code>decoder_input_ids</code> for pretraining take a look at <a href="./longt5#training">LONGT5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxLongT5ForConditionalGeneration.__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.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxLongT5ForConditionalGeneration.__call__.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <code>optional</code>: <em>hidden_states</em>, <code>optional</code>: <em>attentions</em>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code> 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.FlaxLongT5ForConditionalGeneration.__call__.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up 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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_flax_longt5.py#L1724",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Config"
>LongT5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ne=new qn({props:{$$slots:{default:[Nl]},$$scope:{ctx:z}}}),Ie=new ge({props:{anchor:"transformers.FlaxLongT5ForConditionalGeneration.__call__.example",$$slots:{default:[Il]},$$scope:{ctx:z}}}),Ht=new P({props:{name:"encode",anchor:"transformers.FlaxLongT5ForConditionalGeneration.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",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.FlaxLongT5ForConditionalGeneration.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. LongT5 is a model with relative position embeddings so
you should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./longt5#training">LONGT5
Training</a>.`,name:"input_ids"},{anchor:"transformers.FlaxLongT5ForConditionalGeneration.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.FlaxLongT5ForConditionalGeneration.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.FlaxLongT5ForConditionalGeneration.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.FlaxLongT5ForConditionalGeneration.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_flax_longt5.py#L1810",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.longt5.configuration_longt5.LongT5Config'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Be=new ge({props:{anchor:"transformers.FlaxLongT5ForConditionalGeneration.encode.example",$$slots:{default:[Dl]},$$scope:{ctx:z}}}),Yt=new P({props:{name:"decode",anchor:"transformers.FlaxLongT5ForConditionalGeneration.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:"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.FlaxLongT5ForConditionalGeneration.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For training, <code>decoder_input_ids</code> should be provided.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxLongT5ForConditionalGeneration.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.FlaxLongT5ForConditionalGeneration.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.FlaxLongT5ForConditionalGeneration.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.FlaxLongT5ForConditionalGeneration.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.FlaxLongT5ForConditionalGeneration.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.FlaxLongT5ForConditionalGeneration.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.FlaxLongT5ForConditionalGeneration.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/longt5/modeling_flax_longt5.py#L2256",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.longt5.configuration_longt5.LongT5Config'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new ge({props:{anchor:"transformers.FlaxLongT5ForConditionalGeneration.decode.example",$$slots:{default:[Bl]},$$scope:{ctx:z}}}),{c(){l=r("meta"),b=h(),g=r("h1"),p=r("a"),_=r("span"),v(n.$$.fragment),c=h(),L=r("span"),wa=a("LongT5"),jn=h(),ee=r("h2"),_e=r("a"),wo=r("span"),v(Xe.$$.fragment),$a=h(),$o=r("span"),xa=a("Overview"),Fn=h(),Te=r("p"),za=a("The LongT5 model was proposed in "),et=r("a"),La=a("LongT5: Efficient Text-To-Text Transformer for Long Sequences"),qa=a(`
by Mandy Guo, Joshua Ainslie, David Uthus, Santiago Ontanon, Jianmo Ni, Yun-Hsuan Sung and Yinfei Yang. It\u2019s an
encoder-decoder transformer pre-trained in a text-to-text denoising generative setting. LongT5 model is an extension of
T5 model, and it enables using one of the two different efficient attention mechanisms - (1) Local attention, or (2)
Transient-Global attention.`),Mn=h(),Kt=r("p"),ja=a("The abstract from the paper is the following:"),En=h(),Zt=r("p"),xo=r("em"),Fa=a(`Recent work has shown that either (1) increasing the input length or (2) increasing model size can improve the
performance of Transformer-based neural models. In this paper, we present a new model, called LongT5, with which we
explore the effects of scaling both the input length and model size at the same time. Specifically, we integrated
attention ideas from long-input transformers (ETC), and adopted pre-training strategies from summarization pre-training
(PEGASUS) into the scalable T5 architecture. The result is a new attention mechanism we call {\\em Transient Global}
(TGlobal), which mimics ETC\u2019s local/global attention mechanism, but without requiring additional side-inputs. We are
able to achieve state-of-the-art results on several summarization tasks and outperform the original T5 models on
question answering tasks.`),Cn=h(),Qt=r("p"),Ma=a("Tips:"),An=h(),C=r("ul"),A=r("li"),Xt=r("a"),Ea=a("LongT5ForConditionalGeneration"),Ca=a(" is an extension of "),eo=r("a"),Aa=a("T5ForConditionalGeneration"),Oa=a(` exchanging the traditional
encoder `),zo=r("em"),Pa=a("self-attention"),Ga=a(" layer with efficient either "),Lo=r("em"),Sa=a("local"),Na=a(" attention or "),qo=r("em"),Ia=a("transient-global"),Da=a(" ("),jo=r("em"),Ba=a("tglobal"),Wa=a(") attention."),Ua=h(),tt=r("li"),Ha=a(`Unlike the T5 model, LongT5 does not use a task prefix. Furthermore, it uses a different pre-training objective
inspired by the pre-training of `),to=r("a"),Ya=a("PegasusForConditionalGeneration"),Ra=a("."),Ja=h(),ot=r("li"),Va=a("LongT5 model is designed to work efficiently and very well on long-range "),Fo=r("em"),Ka=a("sequence-to-sequence"),Za=a(` tasks where the
input sequence exceeds commonly used 512 tokens. It is capable of handling input sequences of a length up to 16,384 tokens.`),Qa=h(),j=r("li"),Xa=a("For "),Mo=r("em"),es=a("Local Attention"),ts=a(", the sparse sliding-window local attention operation allows a given token to attend only "),Eo=r("code"),os=a("r"),ns=a(`
tokens to the left and right of it (with `),Co=r("code"),as=a("r=127"),ss=a(" by default). "),Ao=r("em"),rs=a("Local Attention"),is=a(` does not introduce any new parameters
to the model. The complexity of the mechanism is linear in input sequence length `),Oo=r("code"),ds=a("l"),ls=a(": "),Po=r("code"),cs=a("O(l*r)"),ps=a("."),us=h(),q=r("li"),Go=r("em"),hs=a("Transient Global Attention"),ms=a(" is an extension of the "),So=r("em"),gs=a("Local Attention"),fs=a(`. It, furthermore, allows each input token to
interact with all other tokens in the layer. This is achieved via splitting an input sequence into blocks of a fixed
length `),No=r("code"),_s=a("k"),Ts=a(" (with a default "),Io=r("code"),bs=a("k=16"),vs=a(`). Then, a global token for such a block is obtained via summing and normalizing the embeddings of every token
in the block. Thanks to this, the attention allows each token to attend to both nearby tokens like in Local attention, and
also every global token like in the case of standard global attention (`),Do=r("em"),ks=a("transient"),ys=a(` represents the fact the global tokens
are constructed dynamically within each attention operation).  As a consequence, `),Bo=r("em"),ws=a("TGlobal"),$s=a(` attention introduces
a few new parameters \u2014 global relative position biases and a layer normalization for global token\u2019s embedding.
The complexity of this mechanism is `),Wo=r("code"),xs=a("O(l(r + l/k))"),zs=a("."),Ls=h(),nt=r("li"),qs=a("An example showing how to evaluate a fine-tuned LongT5 model on the "),at=r("a"),js=a("pubmed dataset"),Fs=a(" is below."),On=h(),v(st.$$.fragment),Pn=h(),Q=r("p"),Ms=a("This model was contributed by "),rt=r("a"),Es=a("stancld"),Cs=a(`.
The original code can be found `),it=r("a"),As=a("here"),Os=a("."),Gn=h(),te=r("h2"),be=r("a"),Uo=r("span"),v(dt.$$.fragment),Ps=h(),Ho=r("span"),Gs=a("Documentation resources"),Sn=h(),ve=r("ul"),Yo=r("li"),oo=r("a"),Ss=a("Translation task guide"),Ns=h(),Ro=r("li"),no=r("a"),Is=a("Summarization task guide"),Nn=h(),oe=r("h2"),ke=r("a"),Jo=r("span"),v(lt.$$.fragment),Ds=h(),Vo=r("span"),Bs=a("LongT5Config"),In=h(),K=r("div"),v(ct.$$.fragment),Ws=h(),Z=r("p"),Us=a("This is the configuration class to store the configuration of a "),ao=r("a"),Hs=a("LongT5Model"),Ys=a(" or a "),so=r("a"),Rs=a("FlaxLongT5Model"),Js=a(`. It is
used to instantiate a LongT5 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 LongT5
`),pt=r("a"),Vs=a("google/long-t5-local-base"),Ks=a(" architecture."),Zs=h(),ne=r("p"),Qs=a("Configuration objects inherit from "),ro=r("a"),Xs=a("PretrainedConfig"),er=a(` and can be used to control the model outputs. Read the
documentation from `),io=r("a"),tr=a("PretrainedConfig"),or=a(" for more information."),Dn=h(),ae=r("h2"),ye=r("a"),Ko=r("span"),v(ut.$$.fragment),nr=h(),Zo=r("span"),ar=a("LongT5Model"),Bn=h(),F=r("div"),v(ht.$$.fragment),sr=h(),Qo=r("p"),rr=a("The bare LONGT5 Model transformer outputting raw hidden-states without any specific head on top."),ir=h(),mt=r("p"),dr=a("The LongT5 model was proposed in "),gt=r("a"),lr=a(`LongT5: Efficient Text-To-Text Transformer for Long
Sequences`),cr=a(` by Mandy Guo, Joshua Ainslie, David Uthus, Santiago Ontanon, Jianmo
Ni, Yun-Hsuan Sung and Yinfei Yang. It\u2019s an encoder-decoder transformer pre-trained in a text-to-text denoising
generative setting. LongT5 model is an extension of T5 model, and it enables using one of the two different
efficient attention mechanisms - (1) Local attention, or (2) Transient-Global attention.`),pr=h(),ft=r("p"),ur=a("This model inherits from "),lo=r("a"),hr=a("PreTrainedModel"),mr=a(`. 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.)`),gr=h(),_t=r("p"),fr=a("This model is also a PyTorch "),Tt=r("a"),_r=a("torch.nn.Module"),Tr=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),br=h(),D=r("div"),v(bt.$$.fragment),vr=h(),se=r("p"),kr=a("The "),co=r("a"),yr=a("LongT5Model"),wr=a(" forward method, overrides the "),Xo=r("code"),$r=a("__call__"),xr=a(" special method."),zr=h(),v(we.$$.fragment),Lr=h(),v($e.$$.fragment),Wn=h(),re=r("h2"),xe=r("a"),en=r("span"),v(vt.$$.fragment),qr=h(),tn=r("span"),jr=a("LongT5ForConditionalGeneration"),Un=h(),M=r("div"),v(kt.$$.fragment),Fr=h(),yt=r("p"),Mr=a("LONGT5 Model with a "),on=r("code"),Er=a("language modeling"),Cr=a(" head on top."),Ar=h(),wt=r("p"),Or=a("The LongT5 model was proposed in "),$t=r("a"),Pr=a(`LongT5: Efficient Text-To-Text Transformer for Long
Sequences`),Gr=a(` by Mandy Guo, Joshua Ainslie, David Uthus, Santiago Ontanon, Jianmo
Ni, Yun-Hsuan Sung and Yinfei Yang. It\u2019s an encoder-decoder transformer pre-trained in a text-to-text denoising
generative setting. LongT5 model is an extension of T5 model, and it enables using one of the two different
efficient attention mechanisms - (1) Local attention, or (2) Transient-Global attention.`),Sr=h(),xt=r("p"),Nr=a("This model inherits from "),po=r("a"),Ir=a("PreTrainedModel"),Dr=a(`. 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.)`),Br=h(),zt=r("p"),Wr=a("This model is also a PyTorch "),Lt=r("a"),Ur=a("torch.nn.Module"),Hr=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Yr=h(),B=r("div"),v(qt.$$.fragment),Rr=h(),ie=r("p"),Jr=a("The "),uo=r("a"),Vr=a("LongT5ForConditionalGeneration"),Kr=a(" forward method, overrides the "),nn=r("code"),Zr=a("__call__"),Qr=a(" special method."),Xr=h(),v(ze.$$.fragment),ei=h(),v(Le.$$.fragment),Hn=h(),de=r("h2"),qe=r("a"),an=r("span"),v(jt.$$.fragment),ti=h(),sn=r("span"),oi=a("LongT5EncoderModel"),Yn=h(),E=r("div"),v(Ft.$$.fragment),ni=h(),rn=r("p"),ai=a("The bare LONGT5 Model transformer outputting encoder\u2019s raw hidden-states without any specific head on top."),si=h(),Mt=r("p"),ri=a("The LongT5 model was proposed in "),Et=r("a"),ii=a(`LongT5: Efficient Text-To-Text Transformer for Long
Sequences`),di=a(` by Mandy Guo, Joshua Ainslie, David Uthus, Santiago Ontanon, Jianmo
Ni, Yun-Hsuan Sung and Yinfei Yang. It\u2019s an encoder-decoder transformer pre-trained in a text-to-text denoising
generative setting. LongT5 model is an extension of T5 model, and it enables using one of the two different
efficient attention mechanisms - (1) Local attention, or (2) Transient-Global attention.`),li=h(),Ct=r("p"),ci=a("This model inherits from "),ho=r("a"),pi=a("PreTrainedModel"),ui=a(`. 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.)`),hi=h(),At=r("p"),mi=a("This model is also a PyTorch "),Ot=r("a"),gi=a("torch.nn.Module"),fi=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_i=h(),W=r("div"),v(Pt.$$.fragment),Ti=h(),le=r("p"),bi=a("The "),mo=r("a"),vi=a("LongT5EncoderModel"),ki=a(" forward method, overrides the "),dn=r("code"),yi=a("__call__"),wi=a(" special method."),$i=h(),v(je.$$.fragment),xi=h(),v(Fe.$$.fragment),Rn=h(),ce=r("h2"),Me=r("a"),ln=r("span"),v(Gt.$$.fragment),zi=h(),cn=r("span"),Li=a("FlaxLongT5Model"),Jn=h(),S=r("div"),v(St.$$.fragment),qi=h(),U=r("div"),v(Nt.$$.fragment),ji=h(),pe=r("p"),Fi=a("The "),pn=r("code"),Mi=a("FlaxLongT5PreTrainedModel"),Ei=a(" forward method, overrides the "),un=r("code"),Ci=a("__call__"),Ai=a(" special method."),Oi=h(),v(Ee.$$.fragment),Pi=h(),v(Ce.$$.fragment),Gi=h(),Ae=r("div"),v(It.$$.fragment),Si=h(),v(Oe.$$.fragment),Ni=h(),Pe=r("div"),v(Dt.$$.fragment),Ii=h(),v(Ge.$$.fragment),Vn=h(),ue=r("h2"),Se=r("a"),hn=r("span"),v(Bt.$$.fragment),Di=h(),mn=r("span"),Bi=a("FlaxLongT5ForConditionalGeneration"),Kn=h(),N=r("div"),v(Wt.$$.fragment),Wi=h(),H=r("div"),v(Ut.$$.fragment),Ui=h(),he=r("p"),Hi=a("The "),gn=r("code"),Yi=a("FlaxLongT5PreTrainedModel"),Ri=a(" forward method, overrides the "),fn=r("code"),Ji=a("__call__"),Vi=a(" special method."),Ki=h(),v(Ne.$$.fragment),Zi=h(),v(Ie.$$.fragment),Qi=h(),De=r("div"),v(Ht.$$.fragment),Xi=h(),v(Be.$$.fragment),ed=h(),We=r("div"),v(Yt.$$.fragment),td=h(),v(Ue.$$.fragment),this.h()},l(t){const f=Ll('[data-svelte="svelte-1phssyn"]',document.head);l=i(f,"META",{name:!0,content:!0}),f.forEach(o),b=m(t),g=i(t,"H1",{class:!0});var Rt=d(g);p=i(Rt,"A",{id:!0,class:!0,href:!0});var _n=d(p);_=i(_n,"SPAN",{});var Tn=d(_);k(n.$$.fragment,Tn),Tn.forEach(o),_n.forEach(o),c=m(Rt),L=i(Rt,"SPAN",{});var bn=d(L);wa=s(bn,"LongT5"),bn.forEach(o),Rt.forEach(o),jn=m(t),ee=i(t,"H2",{class:!0});var Jt=d(ee);_e=i(Jt,"A",{id:!0,class:!0,href:!0});var vn=d(_e);wo=i(vn,"SPAN",{});var kn=d(wo);k(Xe.$$.fragment,kn),kn.forEach(o),vn.forEach(o),$a=m(Jt),$o=i(Jt,"SPAN",{});var yn=d($o);xa=s(yn,"Overview"),yn.forEach(o),Jt.forEach(o),Fn=m(t),Te=i(t,"P",{});var Vt=d(Te);za=s(Vt,"The LongT5 model was proposed in "),et=i(Vt,"A",{href:!0,rel:!0});var wn=d(et);La=s(wn,"LongT5: Efficient Text-To-Text Transformer for Long Sequences"),wn.forEach(o),qa=s(Vt,`
by Mandy Guo, Joshua Ainslie, David Uthus, Santiago Ontanon, Jianmo Ni, Yun-Hsuan Sung and Yinfei Yang. It\u2019s an
encoder-decoder transformer pre-trained in a text-to-text denoising generative setting. LongT5 model is an extension of
T5 model, and it enables using one of the two different efficient attention mechanisms - (1) Local attention, or (2)
Transient-Global attention.`),Vt.forEach(o),Mn=m(t),Kt=i(t,"P",{});var $n=d(Kt);ja=s($n,"The abstract from the paper is the following:"),$n.forEach(o),En=m(t),Zt=i(t,"P",{});var xn=d(Zt);xo=i(xn,"EM",{});var zn=d(xo);Fa=s(zn,`Recent work has shown that either (1) increasing the input length or (2) increasing model size can improve the
performance of Transformer-based neural models. In this paper, we present a new model, called LongT5, with which we
explore the effects of scaling both the input length and model size at the same time. Specifically, we integrated
attention ideas from long-input transformers (ETC), and adopted pre-training strategies from summarization pre-training
(PEGASUS) into the scalable T5 architecture. The result is a new attention mechanism we call {\\em Transient Global}
(TGlobal), which mimics ETC\u2019s local/global attention mechanism, but without requiring additional side-inputs. We are
able to achieve state-of-the-art results on several summarization tasks and outperform the original T5 models on
question answering tasks.`),zn.forEach(o),xn.forEach(o),Cn=m(t),Qt=i(t,"P",{});var Ln=d(Qt);Ma=s(Ln,"Tips:"),Ln.forEach(o),An=m(t),C=i(t,"UL",{});var Y=d(C);A=i(Y,"LI",{});var I=d(A);Xt=i(I,"A",{href:!0});var od=d(Xt);Ea=s(od,"LongT5ForConditionalGeneration"),od.forEach(o),Ca=s(I," is an extension of "),eo=i(I,"A",{href:!0});var nd=d(eo);Aa=s(nd,"T5ForConditionalGeneration"),nd.forEach(o),Oa=s(I,` exchanging the traditional
encoder `),zo=i(I,"EM",{});var ad=d(zo);Pa=s(ad,"self-attention"),ad.forEach(o),Ga=s(I," layer with efficient either "),Lo=i(I,"EM",{});var sd=d(Lo);Sa=s(sd,"local"),sd.forEach(o),Na=s(I," attention or "),qo=i(I,"EM",{});var rd=d(qo);Ia=s(rd,"transient-global"),rd.forEach(o),Da=s(I," ("),jo=i(I,"EM",{});var id=d(jo);Ba=s(id,"tglobal"),id.forEach(o),Wa=s(I,") attention."),I.forEach(o),Ua=m(Y),tt=i(Y,"LI",{});var Qn=d(tt);Ha=s(Qn,`Unlike the T5 model, LongT5 does not use a task prefix. Furthermore, it uses a different pre-training objective
inspired by the pre-training of `),to=i(Qn,"A",{href:!0});var dd=d(to);Ya=s(dd,"PegasusForConditionalGeneration"),dd.forEach(o),Ra=s(Qn,"."),Qn.forEach(o),Ja=m(Y),ot=i(Y,"LI",{});var Xn=d(ot);Va=s(Xn,"LongT5 model is designed to work efficiently and very well on long-range "),Fo=i(Xn,"EM",{});var ld=d(Fo);Ka=s(ld,"sequence-to-sequence"),ld.forEach(o),Za=s(Xn,` tasks where the
input sequence exceeds commonly used 512 tokens. It is capable of handling input sequences of a length up to 16,384 tokens.`),Xn.forEach(o),Qa=m(Y),j=i(Y,"LI",{});var G=d(j);Xa=s(G,"For "),Mo=i(G,"EM",{});var cd=d(Mo);es=s(cd,"Local Attention"),cd.forEach(o),ts=s(G,", the sparse sliding-window local attention operation allows a given token to attend only "),Eo=i(G,"CODE",{});var pd=d(Eo);os=s(pd,"r"),pd.forEach(o),ns=s(G,`
tokens to the left and right of it (with `),Co=i(G,"CODE",{});var ud=d(Co);as=s(ud,"r=127"),ud.forEach(o),ss=s(G," by default). "),Ao=i(G,"EM",{});var hd=d(Ao);rs=s(hd,"Local Attention"),hd.forEach(o),is=s(G,` does not introduce any new parameters
to the model. The complexity of the mechanism is linear in input sequence length `),Oo=i(G,"CODE",{});var md=d(Oo);ds=s(md,"l"),md.forEach(o),ls=s(G,": "),Po=i(G,"CODE",{});var gd=d(Po);cs=s(gd,"O(l*r)"),gd.forEach(o),ps=s(G,"."),G.forEach(o),us=m(Y),q=i(Y,"LI",{});var O=d(q);Go=i(O,"EM",{});var fd=d(Go);hs=s(fd,"Transient Global Attention"),fd.forEach(o),ms=s(O," is an extension of the "),So=i(O,"EM",{});var _d=d(So);gs=s(_d,"Local Attention"),_d.forEach(o),fs=s(O,`. It, furthermore, allows each input token to
interact with all other tokens in the layer. This is achieved via splitting an input sequence into blocks of a fixed
length `),No=i(O,"CODE",{});var Td=d(No);_s=s(Td,"k"),Td.forEach(o),Ts=s(O," (with a default "),Io=i(O,"CODE",{});var bd=d(Io);bs=s(bd,"k=16"),bd.forEach(o),vs=s(O,`). Then, a global token for such a block is obtained via summing and normalizing the embeddings of every token
in the block. Thanks to this, the attention allows each token to attend to both nearby tokens like in Local attention, and
also every global token like in the case of standard global attention (`),Do=i(O,"EM",{});var vd=d(Do);ks=s(vd,"transient"),vd.forEach(o),ys=s(O,` represents the fact the global tokens
are constructed dynamically within each attention operation).  As a consequence, `),Bo=i(O,"EM",{});var kd=d(Bo);ws=s(kd,"TGlobal"),kd.forEach(o),$s=s(O,` attention introduces
a few new parameters \u2014 global relative position biases and a layer normalization for global token\u2019s embedding.
The complexity of this mechanism is `),Wo=i(O,"CODE",{});var yd=d(Wo);xs=s(yd,"O(l(r + l/k))"),yd.forEach(o),zs=s(O,"."),O.forEach(o),Ls=m(Y),nt=i(Y,"LI",{});var ea=d(nt);qs=s(ea,"An example showing how to evaluate a fine-tuned LongT5 model on the "),at=i(ea,"A",{href:!0,rel:!0});var wd=d(at);js=s(wd,"pubmed dataset"),wd.forEach(o),Fs=s(ea," is below."),ea.forEach(o),Y.forEach(o),On=m(t),k(st.$$.fragment,t),Pn=m(t),Q=i(t,"P",{});var go=d(Q);Ms=s(go,"This model was contributed by "),rt=i(go,"A",{href:!0,rel:!0});var $d=d(rt);Es=s($d,"stancld"),$d.forEach(o),Cs=s(go,`.
The original code can be found `),it=i(go,"A",{href:!0,rel:!0});var xd=d(it);As=s(xd,"here"),xd.forEach(o),Os=s(go,"."),go.forEach(o),Gn=m(t),te=i(t,"H2",{class:!0});var ta=d(te);be=i(ta,"A",{id:!0,class:!0,href:!0});var zd=d(be);Uo=i(zd,"SPAN",{});var Ld=d(Uo);k(dt.$$.fragment,Ld),Ld.forEach(o),zd.forEach(o),Ps=m(ta),Ho=i(ta,"SPAN",{});var qd=d(Ho);Gs=s(qd,"Documentation resources"),qd.forEach(o),ta.forEach(o),Sn=m(t),ve=i(t,"UL",{});var oa=d(ve);Yo=i(oa,"LI",{});var jd=d(Yo);oo=i(jd,"A",{href:!0});var Fd=d(oo);Ss=s(Fd,"Translation task guide"),Fd.forEach(o),jd.forEach(o),Ns=m(oa),Ro=i(oa,"LI",{});var Md=d(Ro);no=i(Md,"A",{href:!0});var Ed=d(no);Is=s(Ed,"Summarization task guide"),Ed.forEach(o),Md.forEach(o),oa.forEach(o),Nn=m(t),oe=i(t,"H2",{class:!0});var na=d(oe);ke=i(na,"A",{id:!0,class:!0,href:!0});var Cd=d(ke);Jo=i(Cd,"SPAN",{});var Ad=d(Jo);k(lt.$$.fragment,Ad),Ad.forEach(o),Cd.forEach(o),Ds=m(na),Vo=i(na,"SPAN",{});var Od=d(Vo);Bs=s(Od,"LongT5Config"),Od.forEach(o),na.forEach(o),In=m(t),K=i(t,"DIV",{class:!0});var fo=d(K);k(ct.$$.fragment,fo),Ws=m(fo),Z=i(fo,"P",{});var He=d(Z);Us=s(He,"This is the configuration class to store the configuration of a "),ao=i(He,"A",{href:!0});var Pd=d(ao);Hs=s(Pd,"LongT5Model"),Pd.forEach(o),Ys=s(He," or a "),so=i(He,"A",{href:!0});var Gd=d(so);Rs=s(Gd,"FlaxLongT5Model"),Gd.forEach(o),Js=s(He,`. It is
used to instantiate a LongT5 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 LongT5
`),pt=i(He,"A",{href:!0,rel:!0});var Sd=d(pt);Vs=s(Sd,"google/long-t5-local-base"),Sd.forEach(o),Ks=s(He," architecture."),He.forEach(o),Zs=m(fo),ne=i(fo,"P",{});var _o=d(ne);Qs=s(_o,"Configuration objects inherit from "),ro=i(_o,"A",{href:!0});var Nd=d(ro);Xs=s(Nd,"PretrainedConfig"),Nd.forEach(o),er=s(_o,` and can be used to control the model outputs. Read the
documentation from `),io=i(_o,"A",{href:!0});var Id=d(io);tr=s(Id,"PretrainedConfig"),Id.forEach(o),or=s(_o," for more information."),_o.forEach(o),fo.forEach(o),Dn=m(t),ae=i(t,"H2",{class:!0});var aa=d(ae);ye=i(aa,"A",{id:!0,class:!0,href:!0});var Dd=d(ye);Ko=i(Dd,"SPAN",{});var Bd=d(Ko);k(ut.$$.fragment,Bd),Bd.forEach(o),Dd.forEach(o),nr=m(aa),Zo=i(aa,"SPAN",{});var Wd=d(Zo);ar=s(Wd,"LongT5Model"),Wd.forEach(o),aa.forEach(o),Bn=m(t),F=i(t,"DIV",{class:!0});var R=d(F);k(ht.$$.fragment,R),sr=m(R),Qo=i(R,"P",{});var Ud=d(Qo);rr=s(Ud,"The bare LONGT5 Model transformer outputting raw hidden-states without any specific head on top."),Ud.forEach(o),ir=m(R),mt=i(R,"P",{});var sa=d(mt);dr=s(sa,"The LongT5 model was proposed in "),gt=i(sa,"A",{href:!0,rel:!0});var Hd=d(gt);lr=s(Hd,`LongT5: Efficient Text-To-Text Transformer for Long
Sequences`),Hd.forEach(o),cr=s(sa,` by Mandy Guo, Joshua Ainslie, David Uthus, Santiago Ontanon, Jianmo
Ni, Yun-Hsuan Sung and Yinfei Yang. It\u2019s an encoder-decoder transformer pre-trained in a text-to-text denoising
generative setting. LongT5 model is an extension of T5 model, and it enables using one of the two different
efficient attention mechanisms - (1) Local attention, or (2) Transient-Global attention.`),sa.forEach(o),pr=m(R),ft=i(R,"P",{});var ra=d(ft);ur=s(ra,"This model inherits from "),lo=i(ra,"A",{href:!0});var Yd=d(lo);hr=s(Yd,"PreTrainedModel"),Yd.forEach(o),mr=s(ra,`. 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.)`),ra.forEach(o),gr=m(R),_t=i(R,"P",{});var ia=d(_t);fr=s(ia,"This model is also a PyTorch "),Tt=i(ia,"A",{href:!0,rel:!0});var Rd=d(Tt);_r=s(Rd,"torch.nn.Module"),Rd.forEach(o),Tr=s(ia,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ia.forEach(o),br=m(R),D=i(R,"DIV",{class:!0});var Ye=d(D);k(bt.$$.fragment,Ye),vr=m(Ye),se=i(Ye,"P",{});var To=d(se);kr=s(To,"The "),co=i(To,"A",{href:!0});var Jd=d(co);yr=s(Jd,"LongT5Model"),Jd.forEach(o),wr=s(To," forward method, overrides the "),Xo=i(To,"CODE",{});var Vd=d(Xo);$r=s(Vd,"__call__"),Vd.forEach(o),xr=s(To," special method."),To.forEach(o),zr=m(Ye),k(we.$$.fragment,Ye),Lr=m(Ye),k($e.$$.fragment,Ye),Ye.forEach(o),R.forEach(o),Wn=m(t),re=i(t,"H2",{class:!0});var da=d(re);xe=i(da,"A",{id:!0,class:!0,href:!0});var Kd=d(xe);en=i(Kd,"SPAN",{});var Zd=d(en);k(vt.$$.fragment,Zd),Zd.forEach(o),Kd.forEach(o),qr=m(da),tn=i(da,"SPAN",{});var Qd=d(tn);jr=s(Qd,"LongT5ForConditionalGeneration"),Qd.forEach(o),da.forEach(o),Un=m(t),M=i(t,"DIV",{class:!0});var J=d(M);k(kt.$$.fragment,J),Fr=m(J),yt=i(J,"P",{});var la=d(yt);Mr=s(la,"LONGT5 Model with a "),on=i(la,"CODE",{});var Xd=d(on);Er=s(Xd,"language modeling"),Xd.forEach(o),Cr=s(la," head on top."),la.forEach(o),Ar=m(J),wt=i(J,"P",{});var ca=d(wt);Or=s(ca,"The LongT5 model was proposed in "),$t=i(ca,"A",{href:!0,rel:!0});var el=d($t);Pr=s(el,`LongT5: Efficient Text-To-Text Transformer for Long
Sequences`),el.forEach(o),Gr=s(ca,` by Mandy Guo, Joshua Ainslie, David Uthus, Santiago Ontanon, Jianmo
Ni, Yun-Hsuan Sung and Yinfei Yang. It\u2019s an encoder-decoder transformer pre-trained in a text-to-text denoising
generative setting. LongT5 model is an extension of T5 model, and it enables using one of the two different
efficient attention mechanisms - (1) Local attention, or (2) Transient-Global attention.`),ca.forEach(o),Sr=m(J),xt=i(J,"P",{});var pa=d(xt);Nr=s(pa,"This model inherits from "),po=i(pa,"A",{href:!0});var tl=d(po);Ir=s(tl,"PreTrainedModel"),tl.forEach(o),Dr=s(pa,`. 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.)`),pa.forEach(o),Br=m(J),zt=i(J,"P",{});var ua=d(zt);Wr=s(ua,"This model is also a PyTorch "),Lt=i(ua,"A",{href:!0,rel:!0});var ol=d(Lt);Ur=s(ol,"torch.nn.Module"),ol.forEach(o),Hr=s(ua,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ua.forEach(o),Yr=m(J),B=i(J,"DIV",{class:!0});var Re=d(B);k(qt.$$.fragment,Re),Rr=m(Re),ie=i(Re,"P",{});var bo=d(ie);Jr=s(bo,"The "),uo=i(bo,"A",{href:!0});var nl=d(uo);Vr=s(nl,"LongT5ForConditionalGeneration"),nl.forEach(o),Kr=s(bo," forward method, overrides the "),nn=i(bo,"CODE",{});var al=d(nn);Zr=s(al,"__call__"),al.forEach(o),Qr=s(bo," special method."),bo.forEach(o),Xr=m(Re),k(ze.$$.fragment,Re),ei=m(Re),k(Le.$$.fragment,Re),Re.forEach(o),J.forEach(o),Hn=m(t),de=i(t,"H2",{class:!0});var ha=d(de);qe=i(ha,"A",{id:!0,class:!0,href:!0});var sl=d(qe);an=i(sl,"SPAN",{});var rl=d(an);k(jt.$$.fragment,rl),rl.forEach(o),sl.forEach(o),ti=m(ha),sn=i(ha,"SPAN",{});var il=d(sn);oi=s(il,"LongT5EncoderModel"),il.forEach(o),ha.forEach(o),Yn=m(t),E=i(t,"DIV",{class:!0});var V=d(E);k(Ft.$$.fragment,V),ni=m(V),rn=i(V,"P",{});var dl=d(rn);ai=s(dl,"The bare LONGT5 Model transformer outputting encoder\u2019s raw hidden-states without any specific head on top."),dl.forEach(o),si=m(V),Mt=i(V,"P",{});var ma=d(Mt);ri=s(ma,"The LongT5 model was proposed in "),Et=i(ma,"A",{href:!0,rel:!0});var ll=d(Et);ii=s(ll,`LongT5: Efficient Text-To-Text Transformer for Long
Sequences`),ll.forEach(o),di=s(ma,` by Mandy Guo, Joshua Ainslie, David Uthus, Santiago Ontanon, Jianmo
Ni, Yun-Hsuan Sung and Yinfei Yang. It\u2019s an encoder-decoder transformer pre-trained in a text-to-text denoising
generative setting. LongT5 model is an extension of T5 model, and it enables using one of the two different
efficient attention mechanisms - (1) Local attention, or (2) Transient-Global attention.`),ma.forEach(o),li=m(V),Ct=i(V,"P",{});var ga=d(Ct);ci=s(ga,"This model inherits from "),ho=i(ga,"A",{href:!0});var cl=d(ho);pi=s(cl,"PreTrainedModel"),cl.forEach(o),ui=s(ga,`. 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.)`),ga.forEach(o),hi=m(V),At=i(V,"P",{});var fa=d(At);mi=s(fa,"This model is also a PyTorch "),Ot=i(fa,"A",{href:!0,rel:!0});var pl=d(Ot);gi=s(pl,"torch.nn.Module"),pl.forEach(o),fi=s(fa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fa.forEach(o),_i=m(V),W=i(V,"DIV",{class:!0});var Je=d(W);k(Pt.$$.fragment,Je),Ti=m(Je),le=i(Je,"P",{});var vo=d(le);bi=s(vo,"The "),mo=i(vo,"A",{href:!0});var ul=d(mo);vi=s(ul,"LongT5EncoderModel"),ul.forEach(o),ki=s(vo," forward method, overrides the "),dn=i(vo,"CODE",{});var hl=d(dn);yi=s(hl,"__call__"),hl.forEach(o),wi=s(vo," special method."),vo.forEach(o),$i=m(Je),k(je.$$.fragment,Je),xi=m(Je),k(Fe.$$.fragment,Je),Je.forEach(o),V.forEach(o),Rn=m(t),ce=i(t,"H2",{class:!0});var _a=d(ce);Me=i(_a,"A",{id:!0,class:!0,href:!0});var ml=d(Me);ln=i(ml,"SPAN",{});var gl=d(ln);k(Gt.$$.fragment,gl),gl.forEach(o),ml.forEach(o),zi=m(_a),cn=i(_a,"SPAN",{});var fl=d(cn);Li=s(fl,"FlaxLongT5Model"),fl.forEach(o),_a.forEach(o),Jn=m(t),S=i(t,"DIV",{class:!0});var Ve=d(S);k(St.$$.fragment,Ve),qi=m(Ve),U=i(Ve,"DIV",{class:!0});var Ke=d(U);k(Nt.$$.fragment,Ke),ji=m(Ke),pe=i(Ke,"P",{});var ko=d(pe);Fi=s(ko,"The "),pn=i(ko,"CODE",{});var _l=d(pn);Mi=s(_l,"FlaxLongT5PreTrainedModel"),_l.forEach(o),Ei=s(ko," forward method, overrides the "),un=i(ko,"CODE",{});var Tl=d(un);Ci=s(Tl,"__call__"),Tl.forEach(o),Ai=s(ko," special method."),ko.forEach(o),Oi=m(Ke),k(Ee.$$.fragment,Ke),Pi=m(Ke),k(Ce.$$.fragment,Ke),Ke.forEach(o),Gi=m(Ve),Ae=i(Ve,"DIV",{class:!0});var Ta=d(Ae);k(It.$$.fragment,Ta),Si=m(Ta),k(Oe.$$.fragment,Ta),Ta.forEach(o),Ni=m(Ve),Pe=i(Ve,"DIV",{class:!0});var ba=d(Pe);k(Dt.$$.fragment,ba),Ii=m(ba),k(Ge.$$.fragment,ba),ba.forEach(o),Ve.forEach(o),Vn=m(t),ue=i(t,"H2",{class:!0});var va=d(ue);Se=i(va,"A",{id:!0,class:!0,href:!0});var bl=d(Se);hn=i(bl,"SPAN",{});var vl=d(hn);k(Bt.$$.fragment,vl),vl.forEach(o),bl.forEach(o),Di=m(va),mn=i(va,"SPAN",{});var kl=d(mn);Bi=s(kl,"FlaxLongT5ForConditionalGeneration"),kl.forEach(o),va.forEach(o),Kn=m(t),N=i(t,"DIV",{class:!0});var Ze=d(N);k(Wt.$$.fragment,Ze),Wi=m(Ze),H=i(Ze,"DIV",{class:!0});var Qe=d(H);k(Ut.$$.fragment,Qe),Ui=m(Qe),he=i(Qe,"P",{});var yo=d(he);Hi=s(yo,"The "),gn=i(yo,"CODE",{});var yl=d(gn);Yi=s(yl,"FlaxLongT5PreTrainedModel"),yl.forEach(o),Ri=s(yo," forward method, overrides the "),fn=i(yo,"CODE",{});var wl=d(fn);Ji=s(wl,"__call__"),wl.forEach(o),Vi=s(yo," special method."),yo.forEach(o),Ki=m(Qe),k(Ne.$$.fragment,Qe),Zi=m(Qe),k(Ie.$$.fragment,Qe),Qe.forEach(o),Qi=m(Ze),De=i(Ze,"DIV",{class:!0});var ka=d(De);k(Ht.$$.fragment,ka),Xi=m(ka),k(Be.$$.fragment,ka),ka.forEach(o),ed=m(Ze),We=i(Ze,"DIV",{class:!0});var ya=d(We);k(Yt.$$.fragment,ya),td=m(ya),k(Ue.$$.fragment,ya),ya.forEach(o),Ze.forEach(o),this.h()},h(){u(l,"name","hf:doc:metadata"),u(l,"content",JSON.stringify(Ul)),u(p,"id","longt5"),u(p,"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(p,"href","#longt5"),u(g,"class","relative group"),u(_e,"id","overview"),u(_e,"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(_e,"href","#overview"),u(ee,"class","relative group"),u(et,"href","https://arxiv.org/abs/2112.07916"),u(et,"rel","nofollow"),u(Xt,"href","/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5ForConditionalGeneration"),u(eo,"href","/docs/transformers/v4.27.1/en/model_doc/t5#transformers.T5ForConditionalGeneration"),u(to,"href","/docs/transformers/v4.27.1/en/model_doc/pegasus#transformers.PegasusForConditionalGeneration"),u(at,"href","https://huggingface.co/datasets/scientific_papers"),u(at,"rel","nofollow"),u(rt,"href","https://huggingface.co/stancld"),u(rt,"rel","nofollow"),u(it,"href","https://github.com/google-research/longt5"),u(it,"rel","nofollow"),u(be,"id","documentation-resources"),u(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(be,"href","#documentation-resources"),u(te,"class","relative group"),u(oo,"href","./tasks/translation"),u(no,"href","./tasks/summarization"),u(ke,"id","transformers.LongT5Config"),u(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(ke,"href","#transformers.LongT5Config"),u(oe,"class","relative group"),u(ao,"href","/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Model"),u(so,"href","/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.FlaxLongT5Model"),u(pt,"href","https://huggingface.co/google/long-t5-local-base"),u(pt,"rel","nofollow"),u(ro,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),u(io,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),u(K,"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,"id","transformers.LongT5Model"),u(ye,"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(ye,"href","#transformers.LongT5Model"),u(ae,"class","relative group"),u(gt,"href","https://arxiv.org/abs/2112.07916"),u(gt,"rel","nofollow"),u(lo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),u(Tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(Tt,"rel","nofollow"),u(co,"href","/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5Model"),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"),u(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(xe,"id","transformers.LongT5ForConditionalGeneration"),u(xe,"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(xe,"href","#transformers.LongT5ForConditionalGeneration"),u(re,"class","relative group"),u($t,"href","https://arxiv.org/abs/2112.07916"),u($t,"rel","nofollow"),u(po,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),u(Lt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(Lt,"rel","nofollow"),u(uo,"href","/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5ForConditionalGeneration"),u(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(qe,"id","transformers.LongT5EncoderModel"),u(qe,"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(qe,"href","#transformers.LongT5EncoderModel"),u(de,"class","relative group"),u(Et,"href","https://arxiv.org/abs/2112.07916"),u(Et,"rel","nofollow"),u(ho,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),u(Ot,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(Ot,"rel","nofollow"),u(mo,"href","/docs/transformers/v4.27.1/en/model_doc/longt5#transformers.LongT5EncoderModel"),u(W,"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(Me,"id","transformers.FlaxLongT5Model"),u(Me,"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(Me,"href","#transformers.FlaxLongT5Model"),u(ce,"class","relative group"),u(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Se,"id","transformers.FlaxLongT5ForConditionalGeneration"),u(Se,"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(Se,"href","#transformers.FlaxLongT5ForConditionalGeneration"),u(ue,"class","relative group"),u(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,f){e(document.head,l),T(t,b,f),T(t,g,f),e(g,p),e(p,_),y(n,_,null),e(g,c),e(g,L),e(L,wa),T(t,jn,f),T(t,ee,f),e(ee,_e),e(_e,wo),y(Xe,wo,null),e(ee,$a),e(ee,$o),e($o,xa),T(t,Fn,f),T(t,Te,f),e(Te,za),e(Te,et),e(et,La),e(Te,qa),T(t,Mn,f),T(t,Kt,f),e(Kt,ja),T(t,En,f),T(t,Zt,f),e(Zt,xo),e(xo,Fa),T(t,Cn,f),T(t,Qt,f),e(Qt,Ma),T(t,An,f),T(t,C,f),e(C,A),e(A,Xt),e(Xt,Ea),e(A,Ca),e(A,eo),e(eo,Aa),e(A,Oa),e(A,zo),e(zo,Pa),e(A,Ga),e(A,Lo),e(Lo,Sa),e(A,Na),e(A,qo),e(qo,Ia),e(A,Da),e(A,jo),e(jo,Ba),e(A,Wa),e(C,Ua),e(C,tt),e(tt,Ha),e(tt,to),e(to,Ya),e(tt,Ra),e(C,Ja),e(C,ot),e(ot,Va),e(ot,Fo),e(Fo,Ka),e(ot,Za),e(C,Qa),e(C,j),e(j,Xa),e(j,Mo),e(Mo,es),e(j,ts),e(j,Eo),e(Eo,os),e(j,ns),e(j,Co),e(Co,as),e(j,ss),e(j,Ao),e(Ao,rs),e(j,is),e(j,Oo),e(Oo,ds),e(j,ls),e(j,Po),e(Po,cs),e(j,ps),e(C,us),e(C,q),e(q,Go),e(Go,hs),e(q,ms),e(q,So),e(So,gs),e(q,fs),e(q,No),e(No,_s),e(q,Ts),e(q,Io),e(Io,bs),e(q,vs),e(q,Do),e(Do,ks),e(q,ys),e(q,Bo),e(Bo,ws),e(q,$s),e(q,Wo),e(Wo,xs),e(q,zs),e(C,Ls),e(C,nt),e(nt,qs),e(nt,at),e(at,js),e(nt,Fs),T(t,On,f),y(st,t,f),T(t,Pn,f),T(t,Q,f),e(Q,Ms),e(Q,rt),e(rt,Es),e(Q,Cs),e(Q,it),e(it,As),e(Q,Os),T(t,Gn,f),T(t,te,f),e(te,be),e(be,Uo),y(dt,Uo,null),e(te,Ps),e(te,Ho),e(Ho,Gs),T(t,Sn,f),T(t,ve,f),e(ve,Yo),e(Yo,oo),e(oo,Ss),e(ve,Ns),e(ve,Ro),e(Ro,no),e(no,Is),T(t,Nn,f),T(t,oe,f),e(oe,ke),e(ke,Jo),y(lt,Jo,null),e(oe,Ds),e(oe,Vo),e(Vo,Bs),T(t,In,f),T(t,K,f),y(ct,K,null),e(K,Ws),e(K,Z),e(Z,Us),e(Z,ao),e(ao,Hs),e(Z,Ys),e(Z,so),e(so,Rs),e(Z,Js),e(Z,pt),e(pt,Vs),e(Z,Ks),e(K,Zs),e(K,ne),e(ne,Qs),e(ne,ro),e(ro,Xs),e(ne,er),e(ne,io),e(io,tr),e(ne,or),T(t,Dn,f),T(t,ae,f),e(ae,ye),e(ye,Ko),y(ut,Ko,null),e(ae,nr),e(ae,Zo),e(Zo,ar),T(t,Bn,f),T(t,F,f),y(ht,F,null),e(F,sr),e(F,Qo),e(Qo,rr),e(F,ir),e(F,mt),e(mt,dr),e(mt,gt),e(gt,lr),e(mt,cr),e(F,pr),e(F,ft),e(ft,ur),e(ft,lo),e(lo,hr),e(ft,mr),e(F,gr),e(F,_t),e(_t,fr),e(_t,Tt),e(Tt,_r),e(_t,Tr),e(F,br),e(F,D),y(bt,D,null),e(D,vr),e(D,se),e(se,kr),e(se,co),e(co,yr),e(se,wr),e(se,Xo),e(Xo,$r),e(se,xr),e(D,zr),y(we,D,null),e(D,Lr),y($e,D,null),T(t,Wn,f),T(t,re,f),e(re,xe),e(xe,en),y(vt,en,null),e(re,qr),e(re,tn),e(tn,jr),T(t,Un,f),T(t,M,f),y(kt,M,null),e(M,Fr),e(M,yt),e(yt,Mr),e(yt,on),e(on,Er),e(yt,Cr),e(M,Ar),e(M,wt),e(wt,Or),e(wt,$t),e($t,Pr),e(wt,Gr),e(M,Sr),e(M,xt),e(xt,Nr),e(xt,po),e(po,Ir),e(xt,Dr),e(M,Br),e(M,zt),e(zt,Wr),e(zt,Lt),e(Lt,Ur),e(zt,Hr),e(M,Yr),e(M,B),y(qt,B,null),e(B,Rr),e(B,ie),e(ie,Jr),e(ie,uo),e(uo,Vr),e(ie,Kr),e(ie,nn),e(nn,Zr),e(ie,Qr),e(B,Xr),y(ze,B,null),e(B,ei),y(Le,B,null),T(t,Hn,f),T(t,de,f),e(de,qe),e(qe,an),y(jt,an,null),e(de,ti),e(de,sn),e(sn,oi),T(t,Yn,f),T(t,E,f),y(Ft,E,null),e(E,ni),e(E,rn),e(rn,ai),e(E,si),e(E,Mt),e(Mt,ri),e(Mt,Et),e(Et,ii),e(Mt,di),e(E,li),e(E,Ct),e(Ct,ci),e(Ct,ho),e(ho,pi),e(Ct,ui),e(E,hi),e(E,At),e(At,mi),e(At,Ot),e(Ot,gi),e(At,fi),e(E,_i),e(E,W),y(Pt,W,null),e(W,Ti),e(W,le),e(le,bi),e(le,mo),e(mo,vi),e(le,ki),e(le,dn),e(dn,yi),e(le,wi),e(W,$i),y(je,W,null),e(W,xi),y(Fe,W,null),T(t,Rn,f),T(t,ce,f),e(ce,Me),e(Me,ln),y(Gt,ln,null),e(ce,zi),e(ce,cn),e(cn,Li),T(t,Jn,f),T(t,S,f),y(St,S,null),e(S,qi),e(S,U),y(Nt,U,null),e(U,ji),e(U,pe),e(pe,Fi),e(pe,pn),e(pn,Mi),e(pe,Ei),e(pe,un),e(un,Ci),e(pe,Ai),e(U,Oi),y(Ee,U,null),e(U,Pi),y(Ce,U,null),e(S,Gi),e(S,Ae),y(It,Ae,null),e(Ae,Si),y(Oe,Ae,null),e(S,Ni),e(S,Pe),y(Dt,Pe,null),e(Pe,Ii),y(Ge,Pe,null),T(t,Vn,f),T(t,ue,f),e(ue,Se),e(Se,hn),y(Bt,hn,null),e(ue,Di),e(ue,mn),e(mn,Bi),T(t,Kn,f),T(t,N,f),y(Wt,N,null),e(N,Wi),e(N,H),y(Ut,H,null),e(H,Ui),e(H,he),e(he,Hi),e(he,gn),e(gn,Yi),e(he,Ri),e(he,fn),e(fn,Ji),e(he,Vi),e(H,Ki),y(Ne,H,null),e(H,Zi),y(Ie,H,null),e(N,Qi),e(N,De),y(Ht,De,null),e(De,Xi),y(Be,De,null),e(N,ed),e(N,We),y(Yt,We,null),e(We,td),y(Ue,We,null),Zn=!0},p(t,[f]){const Rt={};f&2&&(Rt.$$scope={dirty:f,ctx:t}),we.$set(Rt);const _n={};f&2&&(_n.$$scope={dirty:f,ctx:t}),$e.$set(_n);const Tn={};f&2&&(Tn.$$scope={dirty:f,ctx:t}),ze.$set(Tn);const bn={};f&2&&(bn.$$scope={dirty:f,ctx:t}),Le.$set(bn);const Jt={};f&2&&(Jt.$$scope={dirty:f,ctx:t}),je.$set(Jt);const vn={};f&2&&(vn.$$scope={dirty:f,ctx:t}),Fe.$set(vn);const kn={};f&2&&(kn.$$scope={dirty:f,ctx:t}),Ee.$set(kn);const yn={};f&2&&(yn.$$scope={dirty:f,ctx:t}),Ce.$set(yn);const Vt={};f&2&&(Vt.$$scope={dirty:f,ctx:t}),Oe.$set(Vt);const wn={};f&2&&(wn.$$scope={dirty:f,ctx:t}),Ge.$set(wn);const $n={};f&2&&($n.$$scope={dirty:f,ctx:t}),Ne.$set($n);const xn={};f&2&&(xn.$$scope={dirty:f,ctx:t}),Ie.$set(xn);const zn={};f&2&&(zn.$$scope={dirty:f,ctx:t}),Be.$set(zn);const Ln={};f&2&&(Ln.$$scope={dirty:f,ctx:t}),Ue.$set(Ln)},i(t){Zn||(w(n.$$.fragment,t),w(Xe.$$.fragment,t),w(st.$$.fragment,t),w(dt.$$.fragment,t),w(lt.$$.fragment,t),w(ct.$$.fragment,t),w(ut.$$.fragment,t),w(ht.$$.fragment,t),w(bt.$$.fragment,t),w(we.$$.fragment,t),w($e.$$.fragment,t),w(vt.$$.fragment,t),w(kt.$$.fragment,t),w(qt.$$.fragment,t),w(ze.$$.fragment,t),w(Le.$$.fragment,t),w(jt.$$.fragment,t),w(Ft.$$.fragment,t),w(Pt.$$.fragment,t),w(je.$$.fragment,t),w(Fe.$$.fragment,t),w(Gt.$$.fragment,t),w(St.$$.fragment,t),w(Nt.$$.fragment,t),w(Ee.$$.fragment,t),w(Ce.$$.fragment,t),w(It.$$.fragment,t),w(Oe.$$.fragment,t),w(Dt.$$.fragment,t),w(Ge.$$.fragment,t),w(Bt.$$.fragment,t),w(Wt.$$.fragment,t),w(Ut.$$.fragment,t),w(Ne.$$.fragment,t),w(Ie.$$.fragment,t),w(Ht.$$.fragment,t),w(Be.$$.fragment,t),w(Yt.$$.fragment,t),w(Ue.$$.fragment,t),Zn=!0)},o(t){$(n.$$.fragment,t),$(Xe.$$.fragment,t),$(st.$$.fragment,t),$(dt.$$.fragment,t),$(lt.$$.fragment,t),$(ct.$$.fragment,t),$(ut.$$.fragment,t),$(ht.$$.fragment,t),$(bt.$$.fragment,t),$(we.$$.fragment,t),$($e.$$.fragment,t),$(vt.$$.fragment,t),$(kt.$$.fragment,t),$(qt.$$.fragment,t),$(ze.$$.fragment,t),$(Le.$$.fragment,t),$(jt.$$.fragment,t),$(Ft.$$.fragment,t),$(Pt.$$.fragment,t),$(je.$$.fragment,t),$(Fe.$$.fragment,t),$(Gt.$$.fragment,t),$(St.$$.fragment,t),$(Nt.$$.fragment,t),$(Ee.$$.fragment,t),$(Ce.$$.fragment,t),$(It.$$.fragment,t),$(Oe.$$.fragment,t),$(Dt.$$.fragment,t),$(Ge.$$.fragment,t),$(Bt.$$.fragment,t),$(Wt.$$.fragment,t),$(Ut.$$.fragment,t),$(Ne.$$.fragment,t),$(Ie.$$.fragment,t),$(Ht.$$.fragment,t),$(Be.$$.fragment,t),$(Yt.$$.fragment,t),$(Ue.$$.fragment,t),Zn=!1},d(t){o(l),t&&o(b),t&&o(g),x(n),t&&o(jn),t&&o(ee),x(Xe),t&&o(Fn),t&&o(Te),t&&o(Mn),t&&o(Kt),t&&o(En),t&&o(Zt),t&&o(Cn),t&&o(Qt),t&&o(An),t&&o(C),t&&o(On),x(st,t),t&&o(Pn),t&&o(Q),t&&o(Gn),t&&o(te),x(dt),t&&o(Sn),t&&o(ve),t&&o(Nn),t&&o(oe),x(lt),t&&o(In),t&&o(K),x(ct),t&&o(Dn),t&&o(ae),x(ut),t&&o(Bn),t&&o(F),x(ht),x(bt),x(we),x($e),t&&o(Wn),t&&o(re),x(vt),t&&o(Un),t&&o(M),x(kt),x(qt),x(ze),x(Le),t&&o(Hn),t&&o(de),x(jt),t&&o(Yn),t&&o(E),x(Ft),x(Pt),x(je),x(Fe),t&&o(Rn),t&&o(ce),x(Gt),t&&o(Jn),t&&o(S),x(St),x(Nt),x(Ee),x(Ce),x(It),x(Oe),x(Dt),x(Ge),t&&o(Vn),t&&o(ue),x(Bt),t&&o(Kn),t&&o(N),x(Wt),x(Ut),x(Ne),x(Ie),x(Ht),x(Be),x(Yt),x(Ue)}}}const Ul={local:"longt5",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.LongT5Config",title:"LongT5Config"},{local:"transformers.LongT5Model",title:"LongT5Model"},{local:"transformers.LongT5ForConditionalGeneration",title:"LongT5ForConditionalGeneration"},{local:"transformers.LongT5EncoderModel",title:"LongT5EncoderModel"},{local:"transformers.FlaxLongT5Model",title:"FlaxLongT5Model"},{local:"transformers.FlaxLongT5ForConditionalGeneration",title:"FlaxLongT5ForConditionalGeneration"}],title:"LongT5"};function Hl(z){return ql(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ql extends $l{constructor(l){super();xl(this,l,Hl,Wl,zl,{})}}export{Ql as default,Ul as metadata};
