import{S as rj,i as ij,s as lj,e as a,k as c,w as b,t as n,M as dj,c as r,d as t,m as p,a as i,x as v,h as s,b as l,N as dM,G as e,g as u,y as k,q as w,o as M,B as E,v as cj,L as St}from"../../chunks/vendor-hf-doc-builder.js";import{T as vt}from"../../chunks/Tip-hf-doc-builder.js";import{D as q}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Fe}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Te}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Xt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as mi}from"../../chunks/PipelineTag-hf-doc-builder.js";function pj(F){let m,y,_,g,T;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var z=i(_);g=s(z,"Module"),z.forEach(t),T=s(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){u(d,m,f),e(m,y),e(m,_),e(_,g),e(m,T)},d(d){d&&t(m)}}}function hj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBUNU1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBUNU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEElMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIyU3R1ZGllcyUyMGhhdmUlMjBiZWVuJTIwc2hvd24lMjB0aGF0JTIwb3duaW5nJTIwYSUyMGRvZyUyMGlzJTIwZ29vZCUyMGZvciUyMHlvdSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpLmlucHV0X2lkcyUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFkZWNvZGVyX2lucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglMjJTdHVkaWVzJTIwc2hvdyUyMHRoYXQlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBJTBBJTIzJTIwcHJlcHJvY2VzcyUzQSUyMFByZXBlbmQlMjBkZWNvZGVyX2lucHV0X2lkcyUyMHdpdGglMjBzdGFydCUyMHRva2VuJTIwd2hpY2glMjBpcyUyMHBhZCUyMHRva2VuJTIwZm9yJTIwVDVNb2RlbC4lMEElMjMlMjBUaGlzJTIwaXMlMjBub3QlMjBuZWVkZWQlMjBmb3IlMjB0b3JjaCdzJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMjBhcyUyMGl0JTIwZG9lcyUyMHRoaXMlMjBpbnRlcm5hbGx5JTIwdXNpbmclMjBsYWJlbHMlMjBhcmcuJTBBZGVjb2Rlcl9pbnB1dF9pZHMlMjAlM0QlMjBtb2RlbC5fc2hpZnRfcmlnaHQoZGVjb2Rlcl9pbnB1dF9pZHMpJTBBJTBBJTIzJTIwZm9yd2FyZCUyMHBhc3MlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwZGVjb2Rlcl9pbnB1dF9pZHMlM0RkZWNvZGVyX2lucHV0X2lkcyklMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, T5Model

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = T5Model.from_pretrained(<span class="hljs-string">&quot;t5-small&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;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"># preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This is not needed for torch&#x27;s T5ForConditionalGeneration as it does this internally using labels arg.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = model._shift_right(decoder_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(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function uj(F){let m,y,_,g,T;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var z=i(_);g=s(z,"Module"),z.forEach(t),T=s(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){u(d,m,f),e(m,y),e(m,_),e(_,g),e(m,T)},d(d){d&&t(m)}}}function mj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQSUwQSUyMyUyMHRyYWluaW5nJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMCUzQ2V4dHJhX2lkXzAlM0UlMjB3YWxrcyUyMGluJTIwJTNDZXh0cmFfaWRfMSUzRSUyMHBhcmslMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyJTNDZXh0cmFfaWRfMCUzRSUyMGN1dGUlMjBkb2clMjAlM0NleHRyYV9pZF8xJTNFJTIwdGhlJTIwJTNDZXh0cmFfaWRfMiUzRSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMlM0RpbnB1dF9pZHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBJTBBJTIzJTIwaW5mZXJlbmNlJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMnN1bW1hcml6ZSUzQSUyMHN0dWRpZXMlMjBoYXZlJTIwc2hvd24lMjB0aGF0JTIwb3duaW5nJTIwYSUyMGRvZyUyMGlzJTIwZ29vZCUyMGZvciUyMHlvdSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpLmlucHV0X2lkcyUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzKSUwQXByaW50KHRva2VuaXplci5kZWNvZGUob3V0cHV0cyU1QjAlNUQlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSkpJTBBJTIzJTIwc3R1ZGllcyUyMGhhdmUlMjBzaG93biUyMHRoYXQlMjBvd25pbmclMjBhJTIwZG9nJTIwaXMlMjBnb29kJTIwZm9yJTIweW91Lg==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, T5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># training</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;The &lt;extra_id_0&gt; walks in &lt;extra_id_1&gt; park&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;&lt;extra_id_0&gt; cute dog &lt;extra_id_1&gt; the &lt;extra_id_2&gt;&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=input_ids, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;summarize: 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">... </span>).input_ids  <span class="hljs-comment"># Batch size 1</span>
<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>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># studies have shown that owning a dog is good for you.</span>`}}),{c(){m=a("p"),y=n("Examples:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Examples:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function fj(F){let m,y,_,g,T;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var z=i(_);g=s(z,"Module"),z.forEach(t),T=s(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){u(d,m,f),e(m,y),e(m,_),e(_,g),e(m,T)},d(d){d&&t(m)}}}function gj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBUNUVuY29kZXJNb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwVDVFbmNvZGVyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQWlucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJTdHVkaWVzJTIwaGF2ZSUyMGJlZW4lMjBzaG93biUyMHRoYXQlMjBvd25pbmclMjBhJTIwZG9nJTIwaXMlMjBnb29kJTIwZm9yJTIweW91JTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSkuaW5wdXRfaWRzJTIwJTIwJTIzJTIwQmF0Y2glMjBzaXplJTIwMSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMlM0RpbnB1dF9pZHMpJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, T5EncoderModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFT5Model.from_pretrained(<span class="hljs-string">&quot;t5-small&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;tf&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;tf&quot;</span>).input_ids  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This is not needed for torch&#x27;s T5ForConditionalGeneration as it does this internally using labels arg.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = model._shift_right(decoder_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, decoder_input_ids=decoder_input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){m=a("p"),y=n("Examples:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Examples:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function vj(F){let m,y,_,g,T,d,f,z,Ne,Ze,Z,ye,H,$,Ae,V,be,et,O,ve,ke,ne,We,Q,B,xe,le,Y,Ue,Ve,de,U,I,ce,K,Xe,pe,ee,Se,he,G,Pe,N,De,Le,L,we,He,A,Me,P,Oe,ue,C,Qe,W,R,Je;return{c(){m=a("p"),y=n("TensorFlow models and layers in "),_=a("code"),g=n("transformers"),T=n(" accept two formats as input:"),d=c(),f=a("ul"),z=a("li"),Ne=n("having all inputs as keyword arguments (like PyTorch models), or"),Ze=c(),Z=a("li"),ye=n("having all inputs as a list, tuple or dict in the first positional argument."),H=c(),$=a("p"),Ae=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),V=a("code"),be=n("model.fit()"),et=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),O=a("code"),ve=n("model.fit()"),ke=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=a("code"),We=n("fit()"),Q=n(" and "),B=a("code"),xe=n("predict()"),le=n(`, such as when creating your own layers or models with
the Keras `),Y=a("code"),Ue=n("Functional"),Ve=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),de=c(),U=a("ul"),I=a("li"),ce=n("a single Tensor with "),K=a("code"),Xe=n("input_ids"),pe=n(" only and nothing else: "),ee=a("code"),Se=n("model(input_ids)"),he=c(),G=a("li"),Pe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),N=a("code"),De=n("model([input_ids, attention_mask])"),Le=n(" or "),L=a("code"),we=n("model([input_ids, attention_mask, token_type_ids])"),He=c(),A=a("li"),Me=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=a("code"),Oe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ue=c(),C=a("p"),Qe=n(`Note that when creating models and layers with
`),W=a("a"),R=n("subclassing"),Je=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(j){m=r(j,"P",{});var x=i(m);y=s(x,"TensorFlow models and layers in "),_=r(x,"CODE",{});var tt=i(_);g=s(tt,"transformers"),tt.forEach(t),T=s(x," accept two formats as input:"),x.forEach(t),d=p(j),f=r(j,"UL",{});var Ee=i(f);z=r(Ee,"LI",{});var kt=i(z);Ne=s(kt,"having all inputs as keyword arguments (like PyTorch models), or"),kt.forEach(t),Ze=p(Ee),Z=r(Ee,"LI",{});var ot=i(Z);ye=s(ot,"having all inputs as a list, tuple or dict in the first positional argument."),ot.forEach(t),Ee.forEach(t),H=p(j),$=r(j,"P",{});var J=i($);Ae=s(J,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),V=r(J,"CODE",{});var wt=i(V);be=s(wt,"model.fit()"),wt.forEach(t),et=s(J,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),O=r(J,"CODE",{});var Mt=i(O);ve=s(Mt,"model.fit()"),Mt.forEach(t),ke=s(J,` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=r(J,"CODE",{});var nt=i(ne);We=s(nt,"fit()"),nt.forEach(t),Q=s(J," and "),B=r(J,"CODE",{});var st=i(B);xe=s(st,"predict()"),st.forEach(t),le=s(J,`, such as when creating your own layers or models with
the Keras `),Y=r(J,"CODE",{});var Et=i(Y);Ue=s(Et,"Functional"),Et.forEach(t),Ve=s(J,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),J.forEach(t),de=p(j),U=r(j,"UL",{});var X=i(U);I=r(X,"LI",{});var D=i(I);ce=s(D,"a single Tensor with "),K=r(D,"CODE",{});var at=i(K);Xe=s(at,"input_ids"),at.forEach(t),pe=s(D," only and nothing else: "),ee=r(D,"CODE",{});var jt=i(ee);Se=s(jt,"model(input_ids)"),jt.forEach(t),D.forEach(t),he=p(X),G=r(X,"LI",{});var te=i(G);Pe=s(te,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),N=r(te,"CODE",{});var rt=i(N);De=s(rt,"model([input_ids, attention_mask])"),rt.forEach(t),Le=s(te," or "),L=r(te,"CODE",{});var it=i(L);we=s(it,"model([input_ids, attention_mask, token_type_ids])"),it.forEach(t),te.forEach(t),He=p(X),A=r(X,"LI",{});var Ye=i(A);Me=s(Ye,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=r(Ye,"CODE",{});var zt=i(P);Oe=s(zt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),zt.forEach(t),Ye.forEach(t),X.forEach(t),ue=p(j),C=r(j,"P",{});var se=i(C);Qe=s(se,`Note that when creating models and layers with
`),W=r(se,"A",{href:!0,rel:!0});var ae=i(W);R=s(ae,"subclassing"),ae.forEach(t),Je=s(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){l(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),l(W,"rel","nofollow")},m(j,x){u(j,m,x),e(m,y),e(m,_),e(_,g),e(m,T),u(j,d,x),u(j,f,x),e(f,z),e(z,Ne),e(f,Ze),e(f,Z),e(Z,ye),u(j,H,x),u(j,$,x),e($,Ae),e($,V),e(V,be),e($,et),e($,O),e(O,ve),e($,ke),e($,ne),e(ne,We),e($,Q),e($,B),e(B,xe),e($,le),e($,Y),e(Y,Ue),e($,Ve),u(j,de,x),u(j,U,x),e(U,I),e(I,ce),e(I,K),e(K,Xe),e(I,pe),e(I,ee),e(ee,Se),e(U,he),e(U,G),e(G,Pe),e(G,N),e(N,De),e(G,Le),e(G,L),e(L,we),e(U,He),e(U,A),e(A,Me),e(A,P),e(P,Oe),u(j,ue,x),u(j,C,x),e(C,Qe),e(C,W),e(W,R),e(C,Je)},d(j){j&&t(m),j&&t(d),j&&t(f),j&&t(H),j&&t($),j&&t(de),j&&t(U),j&&t(ue),j&&t(C)}}}function kj(F){let m,y,_,g,T;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var z=i(_);g=s(z,"Module"),z.forEach(t),T=s(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){u(d,m,f),e(m,y),e(m,_),e(_,g),e(m,T)},d(d){d&&t(m)}}}function wj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlQ1Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlQ1Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEElMEElMjMlMjB0cmFpbmluZyUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJUaGUlMjAlM0NleHRyYV9pZF8wJTNFJTIwd2Fsa3MlMjBpbiUyMCUzQ2V4dHJhX2lkXzElM0UlMjBwYXJrJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMikuaW5wdXRfaWRzJTBBbGFiZWxzJTIwJTNEJTIwdG9rZW5pemVyKCUyMiUzQ2V4dHJhX2lkXzAlM0UlMjBjdXRlJTIwZG9nJTIwJTNDZXh0cmFfaWRfMSUzRSUyMHRoZSUyMCUzQ2V4dHJhX2lkXzIlM0UlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKS5pbnB1dF9pZHMlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQSUwQSUyMyUyMGluZmVyZW5jZSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJzdW1tYXJpemUlM0ElMjBzdHVkaWVzJTIwaGF2ZSUyMHNob3duJTIwdGhhdCUyMG93bmluZyUyMGElMjBkb2clMjBpcyUyMGdvb2QlMjBmb3IlMjB5b3UlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyJTBBKS5pbnB1dF9pZHMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKSUwQSUyMyUyMHN0dWRpZXMlMjBoYXZlJTIwc2hvd24lMjB0aGF0JTIwb3duaW5nJTIwYSUyMGRvZyUyMGlzJTIwZ29vZCUyMGZvciUyMHlvdQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># training</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The &lt;extra_id_0&gt; walks in &lt;extra_id_1&gt; park&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;&lt;extra_id_0&gt; cute dog &lt;extra_id_1&gt; the &lt;extra_id_2&gt;&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;summarize: studies have shown that owning a dog is good for you&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&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.generate(inputs)
<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>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># studies have shown that owning a dog is good for you</span>`}}),{c(){m=a("p"),y=n("Examples:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Examples:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function Mj(F){let m,y,_,g,T,d,f,z,Ne,Ze,Z,ye,H,$,Ae,V,be,et,O,ve,ke,ne,We,Q,B,xe,le,Y,Ue,Ve,de,U,I,ce,K,Xe,pe,ee,Se,he,G,Pe,N,De,Le,L,we,He,A,Me,P,Oe,ue,C,Qe,W,R,Je;return{c(){m=a("p"),y=n("TensorFlow models and layers in "),_=a("code"),g=n("transformers"),T=n(" accept two formats as input:"),d=c(),f=a("ul"),z=a("li"),Ne=n("having all inputs as keyword arguments (like PyTorch models), or"),Ze=c(),Z=a("li"),ye=n("having all inputs as a list, tuple or dict in the first positional argument."),H=c(),$=a("p"),Ae=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),V=a("code"),be=n("model.fit()"),et=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),O=a("code"),ve=n("model.fit()"),ke=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=a("code"),We=n("fit()"),Q=n(" and "),B=a("code"),xe=n("predict()"),le=n(`, such as when creating your own layers or models with
the Keras `),Y=a("code"),Ue=n("Functional"),Ve=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),de=c(),U=a("ul"),I=a("li"),ce=n("a single Tensor with "),K=a("code"),Xe=n("input_ids"),pe=n(" only and nothing else: "),ee=a("code"),Se=n("model(input_ids)"),he=c(),G=a("li"),Pe=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),N=a("code"),De=n("model([input_ids, attention_mask])"),Le=n(" or "),L=a("code"),we=n("model([input_ids, attention_mask, token_type_ids])"),He=c(),A=a("li"),Me=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=a("code"),Oe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ue=c(),C=a("p"),Qe=n(`Note that when creating models and layers with
`),W=a("a"),R=n("subclassing"),Je=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(j){m=r(j,"P",{});var x=i(m);y=s(x,"TensorFlow models and layers in "),_=r(x,"CODE",{});var tt=i(_);g=s(tt,"transformers"),tt.forEach(t),T=s(x," accept two formats as input:"),x.forEach(t),d=p(j),f=r(j,"UL",{});var Ee=i(f);z=r(Ee,"LI",{});var kt=i(z);Ne=s(kt,"having all inputs as keyword arguments (like PyTorch models), or"),kt.forEach(t),Ze=p(Ee),Z=r(Ee,"LI",{});var ot=i(Z);ye=s(ot,"having all inputs as a list, tuple or dict in the first positional argument."),ot.forEach(t),Ee.forEach(t),H=p(j),$=r(j,"P",{});var J=i($);Ae=s(J,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),V=r(J,"CODE",{});var wt=i(V);be=s(wt,"model.fit()"),wt.forEach(t),et=s(J,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),O=r(J,"CODE",{});var Mt=i(O);ve=s(Mt,"model.fit()"),Mt.forEach(t),ke=s(J,` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=r(J,"CODE",{});var nt=i(ne);We=s(nt,"fit()"),nt.forEach(t),Q=s(J," and "),B=r(J,"CODE",{});var st=i(B);xe=s(st,"predict()"),st.forEach(t),le=s(J,`, such as when creating your own layers or models with
the Keras `),Y=r(J,"CODE",{});var Et=i(Y);Ue=s(Et,"Functional"),Et.forEach(t),Ve=s(J,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),J.forEach(t),de=p(j),U=r(j,"UL",{});var X=i(U);I=r(X,"LI",{});var D=i(I);ce=s(D,"a single Tensor with "),K=r(D,"CODE",{});var at=i(K);Xe=s(at,"input_ids"),at.forEach(t),pe=s(D," only and nothing else: "),ee=r(D,"CODE",{});var jt=i(ee);Se=s(jt,"model(input_ids)"),jt.forEach(t),D.forEach(t),he=p(X),G=r(X,"LI",{});var te=i(G);Pe=s(te,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),N=r(te,"CODE",{});var rt=i(N);De=s(rt,"model([input_ids, attention_mask])"),rt.forEach(t),Le=s(te," or "),L=r(te,"CODE",{});var it=i(L);we=s(it,"model([input_ids, attention_mask, token_type_ids])"),it.forEach(t),te.forEach(t),He=p(X),A=r(X,"LI",{});var Ye=i(A);Me=s(Ye,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),P=r(Ye,"CODE",{});var zt=i(P);Oe=s(zt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),zt.forEach(t),Ye.forEach(t),X.forEach(t),ue=p(j),C=r(j,"P",{});var se=i(C);Qe=s(se,`Note that when creating models and layers with
`),W=r(se,"A",{href:!0,rel:!0});var ae=i(W);R=s(ae,"subclassing"),ae.forEach(t),Je=s(se,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),se.forEach(t),this.h()},h(){l(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),l(W,"rel","nofollow")},m(j,x){u(j,m,x),e(m,y),e(m,_),e(_,g),e(m,T),u(j,d,x),u(j,f,x),e(f,z),e(z,Ne),e(f,Ze),e(f,Z),e(Z,ye),u(j,H,x),u(j,$,x),e($,Ae),e($,V),e(V,be),e($,et),e($,O),e(O,ve),e($,ke),e($,ne),e(ne,We),e($,Q),e($,B),e(B,xe),e($,le),e($,Y),e(Y,Ue),e($,Ve),u(j,de,x),u(j,U,x),e(U,I),e(I,ce),e(I,K),e(K,Xe),e(I,pe),e(I,ee),e(ee,Se),e(U,he),e(U,G),e(G,Pe),e(G,N),e(N,De),e(G,Le),e(G,L),e(L,we),e(U,He),e(U,A),e(A,Me),e(A,P),e(P,Oe),u(j,ue,x),u(j,C,x),e(C,Qe),e(C,W),e(W,R),e(C,Je)},d(j){j&&t(m),j&&t(d),j&&t(f),j&&t(H),j&&t($),j&&t(de),j&&t(U),j&&t(ue),j&&t(C)}}}function Ej(F){let m,y,_,g,T;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var z=i(_);g=s(z,"Module"),z.forEach(t),T=s(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){u(d,m,f),e(m,y),e(m,_),e(_,g),e(m,T)},d(d){d&&t(m)}}}function jj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURlQ1RW5jb2Rlck1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlQ1RW5jb2Rlck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEElMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIyU3R1ZGllcyUyMGhhdmUlMjBiZWVuJTIwc2hvd24lMjB0aGF0JTIwb3duaW5nJTIwYSUyMGRvZyUyMGlzJTIwZ29vZCUyMGZvciUyMHlvdSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIlMEEpLmlucHV0X2lkcyUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFT5EncoderModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFT5EncoderModel.from_pretrained(<span class="hljs-string">&quot;t5-small&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;tf&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)`}}),{c(){m=a("p"),y=n("Examples:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Examples:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function zj(F){let m,y,_,g,T;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var z=i(_);g=s(z,"Module"),z.forEach(t),T=s(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){u(d,m,f),e(m,y),e(m,_),e(_,g),e(m,T)},d(d){d&&t(m)}}}function $j(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVNb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheFQ1TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQSUwQWlucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJTdHVkaWVzJTIwaGF2ZSUyMGJlZW4lMjBzaG93biUyMHRoYXQlMjBvd25pbmclMjBhJTIwZG9nJTIwaXMlMjBnb29kJTIwZm9yJTIweW91JTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiUwQSkuaW5wdXRfaWRzJTBBZGVjb2Rlcl9pbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyU3R1ZGllcyUyMHNob3clMjB0aGF0JTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMikuaW5wdXRfaWRzJTBBJTBBJTIzJTIwcHJlcHJvY2VzcyUzQSUyMFByZXBlbmQlMjBkZWNvZGVyX2lucHV0X2lkcyUyMHdpdGglMjBzdGFydCUyMHRva2VuJTIwd2hpY2glMjBpcyUyMHBhZCUyMHRva2VuJTIwZm9yJTIwVDVNb2RlbC4lMEElMjMlMjBUaGlzJTIwaXMlMjBub3QlMjBuZWVkZWQlMjBmb3IlMjB0b3JjaCdzJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMjBhcyUyMGl0JTIwZG9lcyUyMHRoaXMlMjBpbnRlcm5hbGx5JTIwdXNpbmclMjBsYWJlbHMlMjBhcmcuJTBBZGVjb2Rlcl9pbnB1dF9pZHMlMjAlM0QlMjBtb2RlbC5fc2hpZnRfcmlnaHQoZGVjb2Rlcl9pbnB1dF9pZHMpJTBBJTBBJTIzJTIwZm9yd2FyZCUyMHBhc3MlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwZGVjb2Rlcl9pbnB1dF9pZHMlM0RkZWNvZGVyX2lucHV0X2lkcyklMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5Model

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxT5Model.from_pretrained(<span class="hljs-string">&quot;t5-small&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"># preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This is not needed for torch&#x27;s T5ForConditionalGeneration as it does this internally using labels arg.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = model._shift_right(decoder_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(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function Fj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBdGV4dCUyMCUzRCUyMCUyMk15JTIwZnJpZW5kcyUyMGFyZSUyMGNvb2wlMjBidXQlMjB0aGV5JTIwZWF0JTIwdG9vJTIwbWFueSUyMGNhcmJzLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcih0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFlbmNvZGVyX291dHB1dHMlMjAlM0QlMjBtb2RlbC5lbmNvZGUoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&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(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function xj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEFpbXBvcnQlMjBqYXgubnVtcHklMjBhcyUyMGpucCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheFQ1Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyKSUwQWVuY29kZXJfb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmVuY29kZSgqKmlucHV0cyklMEElMEFkZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTIwJTNEJTIwbW9kZWwuY29uZmlnLmRlY29kZXJfc3RhcnRfdG9rZW5faWQlMEFkZWNvZGVyX2lucHV0X2lkcyUyMCUzRCUyMGpucC5vbmVzKChpbnB1dHMuaW5wdXRfaWRzLnNoYXBlJTVCMCU1RCUyQyUyMDEpJTJDJTIwZHR5cGUlM0QlMjJpNCUyMiklMjAqJTIwZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5kZWNvZGUoZGVjb2Rlcl9pbnB1dF9pZHMlMkMlMjBlbmNvZGVyX291dHB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5ForConditionalGeneration
<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-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&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(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function Uj(F){let m,y,_,g,T;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var z=i(_);g=s(z,"Module"),z.forEach(t),T=s(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){u(d,m,f),e(m,y),e(m,_),e(_,g),e(m,T)},d(d){d&&t(m)}}}function Jj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBQVJUSUNMRV9UT19TVU1NQVJJWkUlMjAlM0QlMjAlMjJzdW1tYXJpemUlM0ElMjBNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCQVJUSUNMRV9UT19TVU1NQVJJWkUlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTIwU3VtbWFyeSUwQXN1bW1hcnlfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEKS5zZXF1ZW5jZXMlMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKHN1bW1hcnlfaWRzJTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&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(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function Cj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBdGV4dCUyMCUzRCUyMCUyMk15JTIwZnJpZW5kcyUyMGFyZSUyMGNvb2wlMjBidXQlMjB0aGV5JTIwZWF0JTIwdG9vJTIwbWFueSUyMGNhcmJzLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcih0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFlbmNvZGVyX291dHB1dHMlMjAlM0QlMjBtb2RlbC5lbmNvZGUoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&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(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function qj(F){let m,y,_,g,T;return g=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEFpbXBvcnQlMjBqYXgubnVtcHklMjBhcyUyMGpucCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheFQ1Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyc3VtbWFyaXplJTNBJTIwTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyKSUwQWVuY29kZXJfb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmVuY29kZSgqKmlucHV0cyklMEElMEFkZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTIwJTNEJTIwbW9kZWwuY29uZmlnLmRlY29kZXJfc3RhcnRfdG9rZW5faWQlMEFkZWNvZGVyX2lucHV0X2lkcyUyMCUzRCUyMGpucC5vbmVzKChpbnB1dHMuaW5wdXRfaWRzLnNoYXBlJTVCMCU1RCUyQyUyMDEpJTJDJTIwZHR5cGUlM0QlMjJpNCUyMiklMjAqJTIwZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5kZWNvZGUoZGVjb2Rlcl9pbnB1dF9pZHMlMkMlMjBlbmNvZGVyX291dHB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5ForConditionalGeneration
<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-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&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(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:St,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function Ij(F){let m,y,_,g,T;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var z=i(_);g=s(z,"Module"),z.forEach(t),T=s(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){u(d,m,f),e(m,y),e(m,_),e(_,g),e(m,T)},d(d){d&&t(m)}}}function Gj(F){let m,y,_,g,T,d,f,z,Ne,Ze,Z,ye,H,$,Ae,V,be,et,O,ve,ke,ne,We,Q,B,xe,le,Y,Ue,Ve,de,U,I,ce,K,Xe,pe,ee,Se,he,G,Pe,N,De,Le,L,we,He,A,Me,P,Oe,ue,C,Qe,W,R,Je,j,x,tt,Ee,kt,ot,J,wt,Mt,nt,st,Et,X,D,at,jt,te,rt,it,Ye,zt,se,ae,Im,fi,Gm,Zm,gi,Wm,Bm,_i,Rm,Nm,Vp,Ti,Am,Xp,lt,Ql,Yl,hs,Vm,Xm,Kl,ed,us,Sm,Pm,td,od,ms,Dm,Lm,nd,sd,fs,Hm,Om,ad,yi,gs,Qm,Ym,Sp,bi,Km,Pp,je,rd,Xo,id,ef,tf,vi,of,nf,sf,ld,So,dd,af,rf,ki,lf,df,cf,cd,Po,pd,pf,hf,wi,uf,mf,ff,hd,Mi,ud,gf,_f,Tf,md,S,fd,yf,bf,gd,vf,kf,_d,wf,Mf,Td,Ef,jf,yd,zf,$f,bd,Ff,xf,vd,Uf,Jf,kd,Cf,qf,wd,If,Gf,Md,Zf,Wf,Bf,Ed,Ei,jd,Rf,Nf,Af,zd,Do,$d,Vf,Xf,ji,Sf,Pf,Dp,Lo,Df,_s,Lf,Hf,Lp,Lt,Of,Ts,Qf,Yf,ys,Kf,eg,Hp,zi,Op,co,Ho,Fd,bs,tg,xd,og,Qp,$t,ng,Ud,sg,ag,Jd,rg,ig,Cd,lg,dg,Yp,Oo,cg,$i,pg,hg,Kp,Fi,qd,ug,eh,ze,mg,Id,fg,gg,Gd,_g,Tg,Zd,yg,bg,Wd,vg,kg,Bd,wg,Mg,xi,Eg,jg,th,Ui,zg,oh,vs,nh,Qo,$g,ks,Fg,xg,sh,Ji,Rd,Ug,ah,Ci,Jg,rh,ws,ih,re,Cg,Nd,qg,Ig,Ad,Gg,Zg,Vd,Wg,Bg,Xd,Rg,Ng,Sd,Ag,Vg,Pd,Xg,Sg,Dd,Pg,Dg,lh,Ht,Lg,Ld,Hg,Og,Hd,Qg,Yg,dh,$e,Kg,Od,e_,t_,Qd,o_,n_,Yd,s_,a_,Kd,r_,i_,Ms,l_,d_,ec,c_,p_,ch,Es,ph,qi,h_,hh,Ii,js,u_,tc,m_,f_,uh,Ot,g_,zs,__,T_,$s,y_,b_,mh,Yo,v_,oc,k_,w_,fh,Gi,gh,po,Ko,nc,Fs,M_,sc,E_,_h,Ft,j_,Zi,z_,$_,xs,F_,x_,Us,U_,J_,Th,Js,yh,dt,C_,ac,q_,I_,rc,G_,Z_,Wi,W_,B_,ic,R_,N_,bh,Bi,A_,vh,Cs,kh,Ri,V_,wh,qs,Mh,Ni,Eh,ho,en,lc,Is,X_,dc,S_,jh,xt,P_,Gs,D_,L_,cc,H_,O_,pc,Q_,Y_,zh,uo,tn,hc,Zs,K_,uc,eT,$h,Ai,tT,Fh,Ws,xh,on,Bs,oT,Rs,nT,sT,aT,Ns,rT,As,iT,lT,Uh,Vs,Jh,Vi,Xs,dT,Ss,cT,pT,Ch,Ps,qh,Xi,Ds,hT,Ls,uT,mT,Ih,Hs,Gh,ie,Os,fT,Qs,gT,_T,TT,Ys,yT,Ks,bT,vT,kT,ea,wT,ta,MT,ET,jT,Qt,Si,zT,$T,oa,FT,xT,na,UT,JT,CT,Yt,Pi,qT,IT,sa,GT,ZT,aa,WT,BT,RT,nn,Di,NT,AT,ra,VT,XT,ST,Li,ia,PT,DT,LT,mc,Hi,HT,Zh,la,Wh,Oi,Ut,Qi,OT,QT,da,YT,KT,Yi,ey,ty,ca,oy,ny,Bh,pa,Rh,Kt,eo,Ki,sy,ay,ha,ry,iy,ua,ly,dy,cy,to,el,py,hy,ma,uy,my,fa,fy,gy,_y,fc,tl,Ty,Nh,ga,Ah,sn,_a,yy,Ta,by,vy,ky,ya,wy,ba,My,Ey,Vh,va,jy,gc,zy,Xh,ol,ka,$y,wa,Fy,xy,Sh,mo,an,_c,Ma,Uy,Tc,Jy,Ph,Pt,Ea,Cy,Dt,qy,nl,Iy,Gy,sl,Zy,Wy,ja,By,Ry,Ny,fo,Ay,al,Vy,Xy,rl,Sy,Py,Dh,go,rn,yc,za,Dy,bc,Ly,Lh,me,$a,Hy,Fa,Oy,xa,Qy,Yy,Ky,Ua,eb,il,tb,ob,nb,oo,Ja,sb,vc,ab,rb,Ca,ll,ib,kc,lb,db,dl,cb,wc,pb,hb,ln,qa,ub,Ia,mb,Mc,fb,gb,_b,dn,Ga,Tb,Ec,yb,bb,cl,Za,Hh,_o,cn,jc,Wa,vb,zc,kb,Oh,Ke,Ba,wb,To,Mb,$c,Eb,jb,Ra,zb,$b,Fb,Na,xb,pl,Ub,Jb,Cb,no,Aa,qb,Fc,Ib,Gb,Va,hl,Zb,xc,Wb,Bb,ul,Rb,Uc,Nb,Ab,pn,Xa,Vb,Jc,Xb,Qh,yo,hn,Cc,Sa,Sb,qc,Pb,Yh,Ce,Pa,Db,Ic,Lb,Hb,Da,Ob,La,Qb,Yb,Kb,Ha,ev,ml,tv,ov,nv,Oa,sv,Qa,av,rv,iv,Jt,Ya,lv,bo,dv,fl,cv,pv,Gc,hv,uv,mv,un,fv,mn,Kh,vo,fn,Zc,Ka,gv,Wc,_v,eu,qe,er,Tv,tr,yv,Bc,bv,vv,kv,or,wv,nr,Mv,Ev,jv,sr,zv,gl,$v,Fv,xv,ar,Uv,rr,Jv,Cv,qv,Ct,ir,Iv,ko,Gv,_l,Zv,Wv,Rc,Bv,Rv,Nv,gn,Av,_n,tu,wo,Tn,Nc,lr,Vv,Ac,Xv,ou,Ie,dr,Sv,Vc,Pv,Dv,cr,Lv,pr,Hv,Ov,Qv,hr,Yv,Tl,Kv,ek,tk,ur,ok,mr,nk,sk,ak,qt,fr,rk,Mo,ik,yl,lk,dk,Xc,ck,pk,hk,yn,uk,bn,nu,Eo,vn,Sc,gr,mk,Pc,fk,su,Ge,_r,gk,jo,_k,Dc,Tk,yk,Lc,bk,vk,kk,Tr,wk,yr,Mk,Ek,jk,br,zk,bl,$k,Fk,xk,vr,Uk,kr,Jk,Ck,qk,so,wr,Ik,zo,Gk,vl,Zk,Wk,Hc,Bk,Rk,Nk,kn,au,$o,wn,Oc,Mr,Ak,Qc,Vk,ru,fe,Er,Xk,Yc,Sk,Pk,jr,Dk,zr,Lk,Hk,Ok,$r,Qk,kl,Yk,Kk,ew,Fr,tw,xr,ow,nw,sw,Mn,aw,It,Ur,rw,Fo,iw,wl,lw,dw,Kc,cw,pw,hw,En,uw,jn,iu,xo,zn,ep,Jr,mw,tp,fw,lu,ge,Cr,gw,qr,_w,op,Tw,yw,bw,Ir,vw,Gr,kw,ww,Mw,Zr,Ew,Ml,jw,zw,$w,Wr,Fw,Br,xw,Uw,Jw,$n,Cw,Gt,Rr,qw,Uo,Iw,El,Gw,Zw,np,Ww,Bw,Rw,Fn,Nw,xn,du,Jo,Un,sp,Nr,Aw,ap,Vw,cu,_e,Ar,Xw,rp,Sw,Pw,Vr,Dw,Xr,Lw,Hw,Ow,Sr,Qw,jl,Yw,Kw,e1,Pr,t1,Dr,o1,n1,s1,Jn,a1,Zt,Lr,r1,Co,i1,zl,l1,d1,ip,c1,p1,h1,Cn,u1,qn,pu,qo,In,lp,Hr,m1,dp,f1,hu,_t,Or,g1,Wt,Qr,_1,Io,T1,cp,y1,b1,pp,v1,k1,w1,Gn,M1,Zn,E1,Wn,Yr,j1,Bn,z1,Rn,Kr,$1,Nn,uu,Go,An,hp,ei,F1,up,x1,mu,Tt,ti,U1,Bt,oi,J1,Zo,C1,mp,q1,I1,fp,G1,Z1,W1,Vn,B1,Xn,R1,Sn,ni,N1,Pn,A1,Dn,si,V1,Ln,fu,Wo,Hn,gp,ai,X1,_p,S1,gu,Bo,ri,P1,ao,ii,D1,Ro,L1,$l,H1,O1,Tp,Q1,Y1,K1,On,_u;return d=new Te({}),le=new Te({}),bs=new Te({}),vs=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1VG9rZW5pemVyJTJDJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBUNVRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMCUzQ2V4dHJhX2lkXzAlM0UlMjB3YWxrcyUyMGluJTIwJTNDZXh0cmFfaWRfMSUzRSUyMHBhcmslMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyJTNDZXh0cmFfaWRfMCUzRSUyMGN1dGUlMjBkb2clMjAlM0NleHRyYV9pZF8xJTNFJTIwdGhlJTIwJTNDZXh0cmFfaWRfMiUzRSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQSUwQSUyMyUyMHRoZSUyMGZvcndhcmQlMjBmdW5jdGlvbiUyMGF1dG9tYXRpY2FsbHklMjBjcmVhdGVzJTIwdGhlJTIwY29ycmVjdCUyMGRlY29kZXJfaW5wdXRfaWRzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcyUzRGlucHV0X2lkcyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQWxvc3MuaXRlbSgp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5Tokenizer, T5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = T5Tokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;The &lt;extra_id_0&gt; walks in &lt;extra_id_1&gt; park&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;&lt;extra_id_0&gt; cute dog &lt;extra_id_1&gt; the &lt;extra_id_2&gt;&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the forward function automatically creates the correct decoder_input_ids</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(input_ids=input_ids, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span>loss.item()
<span class="hljs-number">3.7837</span>`}}),ws=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1VG9rZW5pemVyJTJDJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBUNVRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMnRyYW5zbGF0ZSUyMEVuZ2xpc2glMjB0byUyMEdlcm1hbiUzQSUyMFRoZSUyMGhvdXNlJTIwaXMlMjB3b25kZXJmdWwuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfaWRzJTBBbGFiZWxzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkRhcyUyMEhhdXMlMjBpc3QlMjB3dW5kZXJiYXIuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfaWRzJTBBJTBBJTIzJTIwdGhlJTIwZm9yd2FyZCUyMGZ1bmN0aW9uJTIwYXV0b21hdGljYWxseSUyMGNyZWF0ZXMlMjB0aGUlMjBjb3JyZWN0JTIwZGVjb2Rlcl9pbnB1dF9pZHMlMEFsb3NzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3NzJTBBbG9zcy5pdGVtKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5Tokenizer, T5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = T5Tokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;translate English to German: The house is wonderful.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;Das Haus ist wunderbar.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the forward function automatically creates the correct decoder_input_ids</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(input_ids=input_ids, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span>loss.item()
<span class="hljs-number">0.2542</span>`}}),Es=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1VG9rZW5pemVyJTJDJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMFQ1VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMFQ1Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEElMEElMjMlMjB0aGUlMjBmb2xsb3dpbmclMjAyJTIwaHlwZXJwYXJhbWV0ZXJzJTIwYXJlJTIwdGFzay1zcGVjaWZpYyUwQW1heF9zb3VyY2VfbGVuZ3RoJTIwJTNEJTIwNTEyJTBBbWF4X3RhcmdldF9sZW5ndGglMjAlM0QlMjAxMjglMEElMEElMjMlMjBTdXBwb3NlJTIwd2UlMjBoYXZlJTIwdGhlJTIwZm9sbG93aW5nJTIwMiUyMHRyYWluaW5nJTIwZXhhbXBsZXMlM0ElMEFpbnB1dF9zZXF1ZW5jZV8xJTIwJTNEJTIwJTIyV2VsY29tZSUyMHRvJTIwTllDJTIyJTBBb3V0cHV0X3NlcXVlbmNlXzElMjAlM0QlMjAlMjJCaWVudmVudWUlMjAlQzMlQTAlMjBOWUMlMjIlMEElMEFpbnB1dF9zZXF1ZW5jZV8yJTIwJTNEJTIwJTIySHVnZ2luZ0ZhY2UlMjBpcyUyMGElMjBjb21wYW55JTIyJTBBb3V0cHV0X3NlcXVlbmNlXzIlMjAlM0QlMjAlMjJIdWdnaW5nRmFjZSUyMGVzdCUyMHVuZSUyMGVudHJlcHJpc2UlMjIlMEElMEElMjMlMjBlbmNvZGUlMjB0aGUlMjBpbnB1dHMlMEF0YXNrX3ByZWZpeCUyMCUzRCUyMCUyMnRyYW5zbGF0ZSUyMEVuZ2xpc2glMjB0byUyMEZyZW5jaCUzQSUyMCUyMiUwQWlucHV0X3NlcXVlbmNlcyUyMCUzRCUyMCU1QmlucHV0X3NlcXVlbmNlXzElMkMlMjBpbnB1dF9zZXF1ZW5jZV8yJTVEJTBBJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTVCdGFza19wcmVmaXglMjAlMkIlMjBzZXF1ZW5jZSUyMGZvciUyMHNlcXVlbmNlJTIwaW4lMjBpbnB1dF9zZXF1ZW5jZXMlNUQlMkMlMEElMjAlMjAlMjAlMjBwYWRkaW5nJTNEJTIybG9uZ2VzdCUyMiUyQyUwQSUyMCUyMCUyMCUyMG1heF9sZW5ndGglM0RtYXhfc291cmNlX2xlbmd0aCUyQyUwQSUyMCUyMCUyMCUyMHRydW5jYXRpb24lM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUwQSklMEElMEFpbnB1dF9pZHMlMkMlMjBhdHRlbnRpb25fbWFzayUyMCUzRCUyMGVuY29kaW5nLmlucHV0X2lkcyUyQyUyMGVuY29kaW5nLmF0dGVudGlvbl9tYXNrJTBBJTBBJTIzJTIwZW5jb2RlJTIwdGhlJTIwdGFyZ2V0cyUwQXRhcmdldF9lbmNvZGluZyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlNUJvdXRwdXRfc2VxdWVuY2VfMSUyQyUyMG91dHB1dF9zZXF1ZW5jZV8yJTVEJTJDJTBBJTIwJTIwJTIwJTIwcGFkZGluZyUzRCUyMmxvbmdlc3QlMjIlMkMlMEElMjAlMjAlMjAlMjBtYXhfbGVuZ3RoJTNEbWF4X3RhcmdldF9sZW5ndGglMkMlMEElMjAlMjAlMjAlMjB0cnVuY2F0aW9uJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMEEpJTBBbGFiZWxzJTIwJTNEJTIwdGFyZ2V0X2VuY29kaW5nLmlucHV0X2lkcyUwQSUwQSUyMyUyMHJlcGxhY2UlMjBwYWRkaW5nJTIwdG9rZW4lMjBpZCdzJTIwb2YlMjB0aGUlMjBsYWJlbHMlMjBieSUyMC0xMDAlMjBzbyUyMGl0J3MlMjBpZ25vcmVkJTIwYnklMjB0aGUlMjBsb3NzJTBBbGFiZWxzJTVCbGFiZWxzJTIwJTNEJTNEJTIwdG9rZW5pemVyLnBhZF90b2tlbl9pZCU1RCUyMCUzRCUyMC0xMDAlMEElMEElMjMlMjBmb3J3YXJkJTIwcGFzcyUwQWxvc3MlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMlM0RpbnB1dF9pZHMlMkMlMjBhdHRlbnRpb25fbWFzayUzRGF0dGVudGlvbl9tYXNrJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3NzJTBBbG9zcy5pdGVtKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5Tokenizer, T5ForConditionalGeneration
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = T5Tokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the following 2 hyperparameters are task-specific</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>max_source_length = <span class="hljs-number">512</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>max_target_length = <span class="hljs-number">128</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Suppose we have the following 2 training examples:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_sequence_1 = <span class="hljs-string">&quot;Welcome to NYC&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>output_sequence_1 = <span class="hljs-string">&quot;Bienvenue \xE0 NYC&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>input_sequence_2 = <span class="hljs-string">&quot;HuggingFace is a company&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>output_sequence_2 = <span class="hljs-string">&quot;HuggingFace est une entreprise&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># encode the inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>task_prefix = <span class="hljs-string">&quot;translate English to French: &quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_sequences = [input_sequence_1, input_sequence_2]

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(
<span class="hljs-meta">... </span>    [task_prefix + sequence <span class="hljs-keyword">for</span> sequence <span class="hljs-keyword">in</span> input_sequences],
<span class="hljs-meta">... </span>    padding=<span class="hljs-string">&quot;longest&quot;</span>,
<span class="hljs-meta">... </span>    max_length=max_source_length,
<span class="hljs-meta">... </span>    truncation=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids, attention_mask = encoding.input_ids, encoding.attention_mask

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># encode the targets</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_encoding = tokenizer(
<span class="hljs-meta">... </span>    [output_sequence_1, output_sequence_2],
<span class="hljs-meta">... </span>    padding=<span class="hljs-string">&quot;longest&quot;</span>,
<span class="hljs-meta">... </span>    max_length=max_target_length,
<span class="hljs-meta">... </span>    truncation=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = target_encoding.input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># replace padding token id&#x27;s of the labels by -100 so it&#x27;s ignored by the loss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels[labels == tokenizer.pad_token_id] = -<span class="hljs-number">100</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(input_ids=input_ids, attention_mask=attention_mask, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span>loss.item()
<span class="hljs-number">0.188</span>`}}),Fs=new Te({}),Js=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1VG9rZW5pemVyJTJDJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBUNVRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMnRyYW5zbGF0ZSUyMEVuZ2xpc2glMjB0byUyMEdlcm1hbiUzQSUyMFRoZSUyMGhvdXNlJTIwaXMlMjB3b25kZXJmdWwuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfaWRzJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0X2lkcyklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5Tokenizer, T5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = T5Tokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;translate English to German: The house is wonderful.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).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>))
Das Haus ist wunderbar.`}}),Cs=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1VG9rZW5pemVyJTJDJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBUNVRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBdGFza19wcmVmaXglMjAlM0QlMjAlMjJ0cmFuc2xhdGUlMjBFbmdsaXNoJTIwdG8lMjBHZXJtYW4lM0ElMjAlMjIlMEElMjMlMjB1c2UlMjBkaWZmZXJlbnQlMjBsZW5ndGglMjBzZW50ZW5jZXMlMjB0byUyMHRlc3QlMjBiYXRjaGluZyUwQXNlbnRlbmNlcyUyMCUzRCUyMCU1QiUyMlRoZSUyMGhvdXNlJTIwaXMlMjB3b25kZXJmdWwuJTIyJTJDJTIwJTIySSUyMGxpa2UlMjB0byUyMHdvcmslMjBpbiUyME5ZQy4lMjIlNUQlMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCdGFza19wcmVmaXglMjAlMkIlMjBzZW50ZW5jZSUyMGZvciUyMHNlbnRlbmNlJTIwaW4lMjBzZW50ZW5jZXMlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBJTBBb3V0cHV0X3NlcXVlbmNlcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCUwQSUyMCUyMCUyMCUyMGlucHV0X2lkcyUzRGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGF0dGVudGlvbl9tYXNrJTNEaW5wdXRzJTVCJTIyYXR0ZW50aW9uX21hc2slMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBkb19zYW1wbGUlM0RGYWxzZSUyQyUyMCUyMCUyMyUyMGRpc2FibGUlMjBzYW1wbGluZyUyMHRvJTIwdGVzdCUyMGlmJTIwYmF0Y2hpbmclMjBhZmZlY3RzJTIwb3V0cHV0JTBBKSUwQSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUob3V0cHV0X3NlcXVlbmNlcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5Tokenizer, T5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = T5Tokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>task_prefix = <span class="hljs-string">&quot;translate English to German: &quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># use different length sentences to test batching</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sentences = [<span class="hljs-string">&quot;The house is wonderful.&quot;</span>, <span class="hljs-string">&quot;I like to work in NYC.&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([task_prefix + sentence <span class="hljs-keyword">for</span> sentence <span class="hljs-keyword">in</span> sentences], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>output_sequences = model.generate(
<span class="hljs-meta">... </span>    input_ids=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>],
<span class="hljs-meta">... </span>    attention_mask=inputs[<span class="hljs-string">&quot;attention_mask&quot;</span>],
<span class="hljs-meta">... </span>    do_sample=<span class="hljs-literal">False</span>,  <span class="hljs-comment"># disable sampling to test if batching affects output</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(output_sequences, skip_special_tokens=<span class="hljs-literal">True</span>))
[<span class="hljs-string">&#x27;Das Haus ist wunderbar.&#x27;</span>, <span class="hljs-string">&#x27;Ich arbeite gerne in NYC.&#x27;</span>]`}}),qs=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1VG9rZW5pemVyJTJDJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBUNVRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMCUzQ2V4dHJhX2lkXzAlM0UlMjB3YWxrcyUyMGluJTIwJTNDZXh0cmFfaWRfMSUzRSUyMHBhcmslMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMEElMEFzZXF1ZW5jZV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dF9pZHMpJTBBc2VxdWVuY2VzJTIwJTNEJTIwdG9rZW5pemVyLmJhdGNoX2RlY29kZShzZXF1ZW5jZV9pZHMpJTBBc2VxdWVuY2Vz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5Tokenizer, T5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = T5Tokenizer.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;The &lt;extra_id_0&gt; walks in &lt;extra_id_1&gt; park&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_ids = model.generate(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>sequences = tokenizer.batch_decode(sequence_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>sequences
[<span class="hljs-string">&#x27;&lt;pad&gt;&lt;extra_id_0&gt; park offers&lt;extra_id_1&gt; the&lt;extra_id_2&gt; park.&lt;/s&gt;&#x27;</span>]`}}),Is=new Te({}),Zs=new Te({}),Ws=new mi({props:{pipeline:"text-classification"}}),Vs=new mi({props:{pipeline:"token-classification"}}),Ps=new mi({props:{pipeline:"text-generation"}}),Hs=new mi({props:{pipeline:"summarization"}}),la=new mi({props:{pipeline:"fill-mask"}}),pa=new mi({props:{pipeline:"translation"}}),ga=new mi({props:{pipeline:"question-answering"}}),Ma=new Te({}),Ea=new q({props:{name:"class transformers.T5Config",anchor:"transformers.T5Config",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:"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:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.T5Config.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32128) &#x2014;
Vocabulary size of the T5 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.31.0/en/model_doc/t5#transformers.T5Model">T5Model</a> or <a href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.TFT5Model">TFT5Model</a>.`,name:"vocab_size"},{anchor:"transformers.T5Config.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.T5Config.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. The <code>inner_dim</code> of the projection layer will
be defined as <code>num_heads * d_kv</code>.`,name:"d_kv"},{anchor:"transformers.T5Config.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>T5Block</code>.`,name:"d_ff"},{anchor:"transformers.T5Config.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.T5Config.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.T5Config.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.T5Config.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.T5Config.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.T5Config.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.T5Config.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.T5Config.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.T5Config.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>. T5v1.1 uses the
<code>&quot;gated-gelu&quot;</code> feed forward projection. Original T5 uses <code>&quot;relu&quot;</code>.`,name:"feed_forward_proj"},{anchor:"transformers.T5Config.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.31.0/src/transformers/models/t5/configuration_t5.py#L34"}}),za=new Te({}),$a=new q({props:{name:"class transformers.T5Tokenizer",anchor:"transformers.T5Tokenizer",parameters:[{name:"vocab_file",val:""},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"extra_ids",val:" = 100"},{name:"additional_special_tokens",val:" = None"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"legacy",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.T5Tokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.T5Tokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.T5Tokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.T5Tokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.T5Tokenizer.extra_ids",description:`<strong>extra_ids</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Add a number of extra ids added to the vocabulary for use as sentinels. These tokens are
accessible as &#x201C;<extra<em>id{%d}&gt;&#x201D; where &#x201D;{%d}&#x201D; is a number between 0 and extra_ids-1. These tokens can be
retrieved by calling get_sentinel_tokens method and token ids can be by calling get_sentinel_token_ids
method
additional_special_tokens (<code>List[str]</code>, <em>optional</em>):
Additional special tokens used by the tokenizer.</extra<em>`,name:"extra_ids"},{anchor:"transformers.T5Tokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.T5Tokenizer.legacy",description:`<strong>legacy</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the <code>legacy</code> behaviour of the tokenizer should be used. Legacy is before the merge of #24622
which includes fixes to properly handle tokens that appear after special tokens. A simple example:</p>
<ul>
<li><code>legacy=True</code>:</li>
</ul>`,name:"legacy"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/tokenization_t5.py#L61"}}),Ja=new q({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.T5Tokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5Tokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.T5Tokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/tokenization_t5.py#L292",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),qa=new q({props:{name:"get_special_tokens_mask",anchor:"transformers.T5Tokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.T5Tokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.T5Tokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.T5Tokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/tokenization_t5.py#L223",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ga=new q({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.T5Tokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5Tokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.T5Tokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/tokenization_t5.py#L270",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Za=new q({props:{name:"save_vocabulary",anchor:"transformers.T5Tokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/tokenization_t5.py#L396"}}),Wa=new Te({}),Ba=new q({props:{name:"class transformers.T5TokenizerFast",anchor:"transformers.T5TokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"extra_ids",val:" = 100"},{name:"additional_special_tokens",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.T5TokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.T5TokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.T5TokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.T5TokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.T5TokenizerFast.extra_ids",description:`<strong>extra_ids</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Add a number of extra ids added to the vocabulary for use as sentinels. These tokens are accessible as
&#x201C;<extra<em>id{%d}&gt;&#x201D; where &#x201D;{%d}&#x201D; is a number between 0 and extra_ids-1. These tokens can be retrieved by
calling get_sentinel_tokens method and token ids can be by calling get_sentinel_token_ids method</extra<em>`,name:"extra_ids"},{anchor:"transformers.T5TokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/tokenization_t5_fast.py#L66"}}),Aa=new q({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.T5TokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5TokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.T5TokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/tokenization_t5_fast.py#L190",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Xa=new q({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.T5TokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5TokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.T5TokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/tokenization_t5_fast.py#L216",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Sa=new Te({}),Pa=new q({props:{name:"class transformers.T5Model",anchor:"transformers.T5Model",parameters:[{name:"config",val:": T5Config"}],parametersDescription:[{anchor:"transformers.T5Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config">T5Config</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_t5.py#L1328"}}),Ya=new q({props:{name:"forward",anchor:"transformers.T5Model.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.T5Model.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. T5 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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.T5Model.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.T5Model.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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>T5 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="./t5#training">T5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.T5Model.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.T5Model.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.T5Model.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.T5Model.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.T5Model.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.T5Model.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.T5Model.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.T5Model.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.T5Model.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.T5Model.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.T5Model.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.T5Model.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_t5.py#L1412",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config"
>T5Config</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.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),un=new vt({props:{$$slots:{default:[pj]},$$scope:{ctx:F}}}),mn=new Xt({props:{anchor:"transformers.T5Model.forward.example",$$slots:{default:[hj]},$$scope:{ctx:F}}}),Ka=new Te({}),er=new q({props:{name:"class transformers.T5ForConditionalGeneration",anchor:"transformers.T5ForConditionalGeneration",parameters:[{name:"config",val:": T5Config"}],parametersDescription:[{anchor:"transformers.T5ForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config">T5Config</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_t5.py#L1528"}}),ir=new q({props:{name:"forward",anchor:"transformers.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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. T5 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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>T5 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="./t5#training">T5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.T5ForConditionalGeneration.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.T5ForConditionalGeneration.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.31.0/src/transformers/models/t5/modeling_t5.py#L1616",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config"
>T5Config</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.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),gn=new vt({props:{$$slots:{default:[uj]},$$scope:{ctx:F}}}),_n=new Xt({props:{anchor:"transformers.T5ForConditionalGeneration.forward.example",$$slots:{default:[mj]},$$scope:{ctx:F}}}),lr=new Te({}),dr=new q({props:{name:"class transformers.T5EncoderModel",anchor:"transformers.T5EncoderModel",parameters:[{name:"config",val:": T5Config"}],parametersDescription:[{anchor:"transformers.T5EncoderModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config">T5Config</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_t5.py#L1838"}}),fr=new q({props:{name:"forward",anchor:"transformers.T5EncoderModel.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.T5EncoderModel.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. T5 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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.T5EncoderModel.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.T5EncoderModel.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.T5EncoderModel.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.T5EncoderModel.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.T5EncoderModel.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.T5EncoderModel.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_t5.py#L1905",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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.31.0/en/model_doc/t5#transformers.T5Config"
>T5Config</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.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yn=new vt({props:{$$slots:{default:[fj]},$$scope:{ctx:F}}}),bn=new Xt({props:{anchor:"transformers.T5EncoderModel.forward.example",$$slots:{default:[gj]},$$scope:{ctx:F}}}),gr=new Te({}),_r=new q({props:{name:"class transformers.T5ForQuestionAnswering",anchor:"transformers.T5ForQuestionAnswering",parameters:[{name:"config",val:": T5Config"}],parametersDescription:[{anchor:"transformers.T5ForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config">T5Config</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_t5.py#L1955"}}),wr=new q({props:{name:"forward",anchor:"transformers.T5ForQuestionAnswering.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:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = 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.T5ForQuestionAnswering.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. T5 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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>T5 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="./t5#training">T5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.T5ForQuestionAnswering.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.T5ForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.T5ForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_t5.py#L1999",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</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.31.0/en/model_doc/t5#transformers.T5Config"
>T5Config</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 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (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.31.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),kn=new vt({props:{$$slots:{default:[_j]},$$scope:{ctx:F}}}),Mr=new Te({}),Er=new q({props:{name:"class transformers.TFT5Model",anchor:"transformers.TFT5Model",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFT5Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config">T5Config</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_tf_t5.py#L1093"}}),Mn=new vt({props:{$$slots:{default:[Tj]},$$scope:{ctx:F}}}),Ur=new q({props:{name:"call",anchor:"transformers.TFT5Model.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_input_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_outputs",val:": np.ndarray | tf.Tensor | None = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFT5Model.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. T5 is a model with relative position embeddings so you
should be able to pad the inputs on the right or the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>To know more on how to prepare <code>inputs</code> for pretraining take a look at <a href="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.TFT5Model.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Provide for sequence to sequence training. T5 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="./t5#training">T5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.TFT5Model.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFT5Model.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
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.TFT5Model.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.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 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.TFT5Model.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.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 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.TFT5Model.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(tf.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.TFT5Model.call.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(tf.Tensor))</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.TFT5Model.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</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.TFT5Model.call.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>tf.Tensor</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.TFT5Model.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.TFT5Model.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFT5Model.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFT5Model.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFT5Model.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_tf_t5.py#L1121",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config"
>T5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),En=new vt({props:{$$slots:{default:[yj]},$$scope:{ctx:F}}}),jn=new Xt({props:{anchor:"transformers.TFT5Model.call.example",$$slots:{default:[bj]},$$scope:{ctx:F}}}),Jr=new Te({}),Cr=new q({props:{name:"class transformers.TFT5ForConditionalGeneration",anchor:"transformers.TFT5ForConditionalGeneration",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFT5ForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config">T5Config</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_tf_t5.py#L1226"}}),$n=new vt({props:{$$slots:{default:[vj]},$$scope:{ctx:F}}}),Rr=new q({props:{name:"call",anchor:"transformers.TFT5ForConditionalGeneration.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_input_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_outputs",val:": np.ndarray | tf.Tensor | None = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFT5ForConditionalGeneration.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. T5 is a model with relative position embeddings so you
should be able to pad the inputs on the right or the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>To know more on how to prepare <code>inputs</code> for pretraining take a look at <a href="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.TFT5ForConditionalGeneration.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Provide for sequence to sequence training. T5 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="./t5#training">T5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.TFT5ForConditionalGeneration.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFT5ForConditionalGeneration.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
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.TFT5ForConditionalGeneration.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.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 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.TFT5ForConditionalGeneration.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.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 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.TFT5ForConditionalGeneration.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(tf.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.TFT5ForConditionalGeneration.call.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(tf.Tensor))</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.TFT5ForConditionalGeneration.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</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.TFT5ForConditionalGeneration.call.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>tf.Tensor</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.TFT5ForConditionalGeneration.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.TFT5ForConditionalGeneration.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFT5ForConditionalGeneration.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFT5ForConditionalGeneration.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFT5ForConditionalGeneration.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFT5ForConditionalGeneration.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the cross entropy classification loss. Indices should be in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_tf_t5.py#L1281",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config"
>T5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Fn=new vt({props:{$$slots:{default:[kj]},$$scope:{ctx:F}}}),xn=new Xt({props:{anchor:"transformers.TFT5ForConditionalGeneration.call.example",$$slots:{default:[wj]},$$scope:{ctx:F}}}),Nr=new Te({}),Ar=new q({props:{name:"class transformers.TFT5EncoderModel",anchor:"transformers.TFT5EncoderModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFT5EncoderModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config">T5Config</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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_tf_t5.py#L1479"}}),Jn=new vt({props:{$$slots:{default:[Mj]},$$scope:{ctx:F}}}),Lr=new q({props:{name:"call",anchor:"transformers.TFT5EncoderModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFT5EncoderModel.call.inputs",description:`<strong>inputs</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. T5 is a model with relative position embeddings so you
should be able to pad the inputs on the right or the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p>To know more on how to prepare <code>inputs</code> for pre-training take a look at <a href="./t5#training">T5 Training</a>.`,name:"inputs"},{anchor:"transformers.TFT5EncoderModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFT5EncoderModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</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.TFT5EncoderModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.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 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.TFT5EncoderModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFT5EncoderModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFT5EncoderModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFT5EncoderModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_tf_t5.py#L1498",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config"
>T5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.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>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights 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.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Cn=new vt({props:{$$slots:{default:[Ej]},$$scope:{ctx:F}}}),qn=new Xt({props:{anchor:"transformers.TFT5EncoderModel.call.example",$$slots:{default:[jj]},$$scope:{ctx:F}}}),Hr=new Te({}),Or=new q({props:{name:"class transformers.FlaxT5Model",anchor:"transformers.FlaxT5Model",parameters:[{name:"config",val:": T5Config"},{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:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_flax_t5.py#L1367"}}),Qr=new q({props:{name:"__call__",anchor:"transformers.FlaxT5Model.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": Array = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxT5Model.__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. T5 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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.FlaxT5Model.__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.FlaxT5Model.__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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>T5 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="./t5#training">T5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxT5Model.__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.FlaxT5Model.__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.FlaxT5Model.__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.31.0/src/transformers/models/t5/modeling_flax_t5.py#L986",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config"
>T5Config</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.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Gn=new vt({props:{$$slots:{default:[zj]},$$scope:{ctx:F}}}),Zn=new Xt({props:{anchor:"transformers.FlaxT5Model.__call__.example",$$slots:{default:[$j]},$$scope:{ctx:F}}}),Yr=new q({props:{name:"encode",anchor:"transformers.FlaxT5Model.encode",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxT5Model.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. T5 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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.FlaxT5Model.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.FlaxT5Model.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.FlaxT5Model.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.FlaxT5Model.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_flax_t5.py#L1072",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.t5.configuration_t5.T5Config'&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.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Bn=new Xt({props:{anchor:"transformers.FlaxT5Model.encode.example",$$slots:{default:[Fj]},$$scope:{ctx:F}}}),Kr=new q({props:{name:"decode",anchor:"transformers.FlaxT5Model.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"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.FlaxT5Model.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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.FlaxT5Model.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.FlaxT5Model.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.FlaxT5Model.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.FlaxT5Model.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.FlaxT5Model.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.FlaxT5Model.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.FlaxT5Model.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_flax_t5.py#L1130",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.t5.configuration_t5.T5Config'&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.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Nn=new Xt({props:{anchor:"transformers.FlaxT5Model.decode.example",$$slots:{default:[xj]},$$scope:{ctx:F}}}),ei=new Te({}),ti=new q({props:{name:"class transformers.FlaxT5ForConditionalGeneration",anchor:"transformers.FlaxT5ForConditionalGeneration",parameters:[{name:"config",val:": T5Config"},{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:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_flax_t5.py#L1605"}}),oi=new q({props:{name:"__call__",anchor:"transformers.FlaxT5ForConditionalGeneration.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": Array = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxT5ForConditionalGeneration.__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. T5 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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.FlaxT5ForConditionalGeneration.__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.FlaxT5ForConditionalGeneration.__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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>T5 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="./t5#training">T5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxT5ForConditionalGeneration.__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.FlaxT5ForConditionalGeneration.__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.FlaxT5ForConditionalGeneration.__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.31.0/src/transformers/models/t5/modeling_flax_t5.py#L986",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Config"
>T5Config</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.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Vn=new vt({props:{$$slots:{default:[Uj]},$$scope:{ctx:F}}}),Xn=new Xt({props:{anchor:"transformers.FlaxT5ForConditionalGeneration.__call__.example",$$slots:{default:[Jj]},$$scope:{ctx:F}}}),ni=new q({props:{name:"encode",anchor:"transformers.FlaxT5ForConditionalGeneration.encode",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxT5ForConditionalGeneration.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. T5 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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.FlaxT5ForConditionalGeneration.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.FlaxT5ForConditionalGeneration.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.FlaxT5ForConditionalGeneration.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.FlaxT5ForConditionalGeneration.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_flax_t5.py#L1072",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.t5.configuration_t5.T5Config'&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.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pn=new Xt({props:{anchor:"transformers.FlaxT5ForConditionalGeneration.encode.example",$$slots:{default:[Cj]},$$scope:{ctx:F}}}),si=new q({props:{name:"decode",anchor:"transformers.FlaxT5ForConditionalGeneration.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"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.FlaxT5ForConditionalGeneration.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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.FlaxT5ForConditionalGeneration.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.FlaxT5ForConditionalGeneration.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.FlaxT5ForConditionalGeneration.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.FlaxT5ForConditionalGeneration.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.FlaxT5ForConditionalGeneration.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.FlaxT5ForConditionalGeneration.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.FlaxT5ForConditionalGeneration.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_flax_t5.py#L1608",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.t5.configuration_t5.T5Config'&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.31.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ln=new Xt({props:{anchor:"transformers.FlaxT5ForConditionalGeneration.decode.example",$$slots:{default:[qj]},$$scope:{ctx:F}}}),ai=new Te({}),ri=new q({props:{name:"class transformers.FlaxT5EncoderModel",anchor:"transformers.FlaxT5EncoderModel",parameters:[{name:"config",val:": T5Config"},{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:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_flax_t5.py#L1454"}}),ii=new q({props:{name:"__call__",anchor:"transformers.FlaxT5EncoderModel.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxT5EncoderModel.__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. T5 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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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="./t5#training">T5 Training</a>.`,name:"input_ids"},{anchor:"transformers.FlaxT5EncoderModel.__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.FlaxT5EncoderModel.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxT5EncoderModel.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxT5EncoderModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/t5/modeling_flax_t5.py#L1457"}}),On=new vt({props:{$$slots:{default:[Ij]},$$scope:{ctx:F}}}),{c(){m=a("meta"),y=c(),_=a("h1"),g=a("a"),T=a("span"),b(d.$$.fragment),f=c(),z=a("span"),Ne=n("T5"),Ze=c(),Z=a("div"),ye=a("a"),H=a("img"),Ae=c(),V=a("a"),be=a("img"),O=c(),ve=a("a"),ke=a("img"),We=c(),Q=a("h2"),B=a("a"),xe=a("span"),b(le.$$.fragment),Y=c(),Ue=a("span"),Ve=n("Overview"),de=c(),U=a("p"),I=n("The T5 model was presented in "),ce=a("a"),K=n("Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer"),Xe=n(" by "),pe=a("a"),ee=n("Colin Raffel"),Se=n(", Noam Shazeer, "),he=a("a"),G=n("Adam Roberts"),Pe=n(`, Katherine Lee, Sharan Narang,
Michael Matena, Yanqi Zhou, Wei Li, `),N=a("a"),De=n("Peter J. Liu"),Le=n("."),L=c(),we=a("p"),He=n("The abstract from the paper is the following:"),A=c(),Me=a("p"),P=a("em"),Oe=n(`Transfer learning, where a model is first pre-trained on a data-rich task before being fine-tuned on a downstream
task, has emerged as a powerful technique in natural language processing (NLP). The effectiveness of transfer learning
has given rise to a diversity of approaches, methodology, and practice. In this paper, we explore the landscape of
transfer learning techniques for NLP by introducing a unified framework that converts every language problem into a
text-to-text format. Our systematic study compares pretraining objectives, architectures, unlabeled datasets, transfer
approaches, and other factors on dozens of language understanding tasks. By combining the insights from our exploration
with scale and our new \u201CColossal Clean Crawled Corpus\u201D, we achieve state-of-the-art results on many benchmarks covering
summarization, question answering, text classification, and more. To facilitate future work on transfer learning for
NLP, we release our dataset, pre-trained models, and code.`),ue=c(),C=a("p"),Qe=n("Tips:"),W=c(),R=a("ul"),Je=a("li"),j=a("p"),x=n(`T5 is an encoder-decoder model pre-trained on a multi-task mixture of unsupervised and supervised tasks and for which
each task is converted into a text-to-text format. T5 works well on a variety of tasks out-of-the-box by prepending a
different prefix to the input corresponding to each task, e.g., for translation: `),tt=a("em"),Ee=n("translate English to German: \u2026"),kt=n(`,
for summarization: `),ot=a("em"),J=n("summarize: \u2026"),wt=n("."),Mt=c(),nt=a("li"),st=a("p"),Et=n("The pretraining includes both supervised and self-supervised training. Supervised training is conducted on downstream tasks provided by the GLUE and SuperGLUE benchmarks (converting them into text-to-text tasks as explained above)."),X=c(),D=a("li"),at=a("p"),jt=n("Self-supervised training uses corrupted tokens, by randomly removing 15% of the tokens and replacing them with individual sentinel tokens (if several consecutive tokens are marked for removal, the whole group is replaced with a single sentinel token). The input of the encoder is the corrupted sentence, the input of the decoder is the original sentence and the target is then the dropped out tokens delimited by their sentinel tokens."),te=c(),rt=a("li"),it=a("p"),Ye=n("T5 uses relative scalar embeddings. Encoder input padding can be done on the left and on the right."),zt=c(),se=a("li"),ae=a("p"),Im=n("See the "),fi=a("a"),Gm=n("training"),Zm=n(", "),gi=a("a"),Wm=n("inference"),Bm=n(" and "),_i=a("a"),Rm=n("scripts"),Nm=n(" sections below for all details regarding usage."),Vp=c(),Ti=a("p"),Am=n("T5 comes in different sizes:"),Xp=c(),lt=a("ul"),Ql=a("li"),Yl=a("p"),hs=a("a"),Vm=n("t5-small"),Xm=c(),Kl=a("li"),ed=a("p"),us=a("a"),Sm=n("t5-base"),Pm=c(),td=a("li"),od=a("p"),ms=a("a"),Dm=n("t5-large"),Lm=c(),nd=a("li"),sd=a("p"),fs=a("a"),Hm=n("t5-3b"),Om=c(),ad=a("li"),yi=a("p"),gs=a("a"),Qm=n("t5-11b"),Ym=n("."),Sp=c(),bi=a("p"),Km=n("Based on the original T5 model, Google has released some follow-up works:"),Pp=c(),je=a("ul"),rd=a("li"),Xo=a("p"),id=a("strong"),ef=n("T5v1.1"),tf=n(`: T5v1.1 is an improved version of T5 with some architectural tweaks, and is pre-trained on C4 only without
mixing in the supervised tasks. Refer to the documentation of T5v1.1 which can be found `),vi=a("a"),of=n("here"),nf=n("."),sf=c(),ld=a("li"),So=a("p"),dd=a("strong"),af=n("mT5"),rf=n(`: mT5 is a multilingual T5 model. It is pre-trained on the mC4 corpus, which includes 101 languages. Refer to
the documentation of mT5 which can be found `),ki=a("a"),lf=n("here"),df=n("."),cf=c(),cd=a("li"),Po=a("p"),pd=a("strong"),pf=n("byT5"),hf=n(`: byT5 is a T5 model pre-trained on byte sequences rather than SentencePiece subword token sequences. Refer
to the documentation of byT5 which can be found `),wi=a("a"),uf=n("here"),mf=n("."),ff=c(),hd=a("li"),Mi=a("p"),ud=a("strong"),gf=n("UL2"),_f=n(": UL2 is a T5 like model pretrained on various denoising objectives"),Tf=c(),md=a("li"),S=a("p"),fd=a("strong"),yf=n("Flan-T5"),bf=n(`: Flan is a pretraining methods that is based on prompting. The Flan-T5 are T5 models trained on the Flan collection of
datasets which include: `),gd=a("code"),vf=n("taskmaster2"),kf=n(", "),_d=a("code"),wf=n("djaym7/wiki_dialog"),Mf=n(", "),Td=a("code"),Ef=n("deepmind/code_contests"),jf=n(", "),yd=a("code"),zf=n("lambada"),$f=n(", "),bd=a("code"),Ff=n("gsm8k"),xf=n(", "),vd=a("code"),Uf=n("aqua_rat"),Jf=n(", "),kd=a("code"),Cf=n("esnli"),qf=n(", "),wd=a("code"),If=n("quasc"),Gf=n(" and "),Md=a("code"),Zf=n("qed"),Wf=n("."),Bf=c(),Ed=a("li"),Ei=a("p"),jd=a("strong"),Rf=n("FLan-UL2"),Nf=n(" : the UL2 model finetuned using the \u201CFlan\u201D prompt tuning and dataset collection."),Af=c(),zd=a("li"),Do=a("p"),$d=a("strong"),Vf=n("UMT5"),Xf=n(`: UmT5 is a multilingual T5 model trained on an improved and refreshed mC4 multilingual corpus,  29 trillion characters across 107 language, using a new sampling method, UniMax. Refer to
the documentation of mT5 which can be found `),ji=a("a"),Sf=n("here"),Pf=n("."),Dp=c(),Lo=a("p"),Df=n("All checkpoints can be found on the "),_s=a("a"),Lf=n("hub"),Hf=n("."),Lp=c(),Lt=a("p"),Of=n("This model was contributed by "),Ts=a("a"),Qf=n("thomwolf"),Yf=n(". The original code can be found "),ys=a("a"),Kf=n("here"),eg=n("."),Hp=c(),zi=a("a"),Op=c(),co=a("h2"),Ho=a("a"),Fd=a("span"),b(bs.$$.fragment),tg=c(),xd=a("span"),og=n("Training"),Qp=c(),$t=a("p"),ng=n(`T5 is an encoder-decoder model and converts all NLP problems into a text-to-text format. It is trained using teacher
forcing. This means that for training, we always need an input sequence and a corresponding target sequence. The input
sequence is fed to the model using `),Ud=a("code"),sg=n("input_ids"),ag=n(`. The target sequence is shifted to the right, i.e., prepended by a
start-sequence token and fed to the decoder using the `),Jd=a("code"),rg=n("decoder_input_ids"),ig=n(`. In teacher-forcing style, the target
sequence is then appended by the EOS token and corresponds to the `),Cd=a("code"),lg=n("labels"),dg=n(`. The PAD token is hereby used as the
start-sequence token. T5 can be trained / fine-tuned both in a supervised and unsupervised fashion.`),Yp=c(),Oo=a("p"),cg=n("One can use "),$i=a("a"),pg=n("T5ForConditionalGeneration"),hg=n(` (or the Tensorflow/Flax variant), which includes the
language modeling head on top of the decoder.`),Kp=c(),Fi=a("ul"),qd=a("li"),ug=n("Unsupervised denoising training"),eh=c(),ze=a("p"),mg=n("In this setup, spans of the input sequence are masked by so-called sentinel tokens ("),Id=a("em"),fg=n("a.k.a"),gg=n(` unique mask tokens) and
the output sequence is formed as a concatenation of the same sentinel tokens and the `),Gd=a("em"),_g=n("real"),Tg=n(` masked tokens. Each
sentinel token represents a unique mask token for this sentence and should start with `),Zd=a("code"),yg=n("<extra_id_0>"),bg=n(`,
`),Wd=a("code"),vg=n("<extra_id_1>"),kg=n(", \u2026 up to "),Bd=a("code"),wg=n("<extra_id_99>"),Mg=n(`. As a default, 100 sentinel tokens are available in
`),xi=a("a"),Eg=n("T5Tokenizer"),jg=n("."),th=c(),Ui=a("p"),zg=n(`For instance, the sentence \u201CThe cute dog walks in the park\u201D with the masks put on \u201Ccute dog\u201D and \u201Cthe\u201D should be
processed as follows:`),oh=c(),b(vs.$$.fragment),nh=c(),Qo=a("p"),$g=n("If you\u2019re interested in pre-training T5 on a new corpus, check out the "),ks=a("a"),Fg=n("run_t5_mlm_flax.py"),xg=n(` script in the Examples
directory.`),sh=c(),Ji=a("ul"),Rd=a("li"),Ug=n("Supervised training"),ah=c(),Ci=a("p"),Jg=n(`In this setup, the input sequence and output sequence are a standard sequence-to-sequence input-output mapping.
Suppose that we want to fine-tune the model for translation for example, and we have a training example: the input
sequence \u201CThe house is wonderful.\u201D and output sequence \u201CDas Haus ist wunderbar.\u201D, then they should be prepared for
the model as follows:`),rh=c(),b(ws.$$.fragment),ih=c(),re=a("p"),Cg=n("As you can see, only 2 inputs are required for the model in order to compute a loss: "),Nd=a("code"),qg=n("input_ids"),Ig=n(` (which are the
`),Ad=a("code"),Gg=n("input_ids"),Zg=n(" of the encoded input sequence) and "),Vd=a("code"),Wg=n("labels"),Bg=n(" (which are the "),Xd=a("code"),Rg=n("input_ids"),Ng=n(` of the encoded
target sequence). The model will automatically create the `),Sd=a("code"),Ag=n("decoder_input_ids"),Vg=n(" based on the "),Pd=a("code"),Xg=n("labels"),Sg=n(`, by
shifting them one position to the right and prepending the `),Dd=a("code"),Pg=n("config.decoder_start_token_id"),Dg=n(`, which for T5 is
equal to 0 (i.e. the id of the pad token). Also note the task prefix: we prepend the input sequence with \u2018translate
English to German: \u2019 before encoding it. This will help in improving the performance, as this task prefix was used
during T5\u2019s pre-training.`),lh=c(),Ht=a("p"),Lg=n(`However, the example above only shows a single training example. In practice, one trains deep learning models in
batches. This entails that we must pad/truncate examples to the same length. For encoder-decoder models, one
typically defines a `),Ld=a("code"),Hg=n("max_source_length"),Og=n(" and "),Hd=a("code"),Qg=n("max_target_length"),Yg=n(`, which determine the maximum length of the
input and output sequences respectively (otherwise they are truncated). These should be carefully set depending on
the task.`),dh=c(),$e=a("p"),Kg=n("In addition, we must make sure that padding token id\u2019s of the "),Od=a("code"),e_=n("labels"),t_=n(` are not taken into account by the loss
function. In PyTorch and Tensorflow, this can be done by replacing them with -100, which is the `),Qd=a("code"),o_=n("ignore_index"),n_=n(`
of the `),Yd=a("code"),s_=n("CrossEntropyLoss"),a_=n(". In Flax, one can use the "),Kd=a("code"),r_=n("decoder_attention_mask"),i_=n(` to ignore padded tokens from
the loss (see the `),Ms=a("a"),l_=n("Flax summarization script"),d_=n(` for details). We also pass
`),ec=a("code"),c_=n("attention_mask"),p_=n(` as additional input to the model, which makes sure that padding tokens of the inputs are
ignored. The code example below illustrates all of this.`),ch=c(),b(Es.$$.fragment),ph=c(),qi=a("p"),h_=n("Additional training tips:"),hh=c(),Ii=a("ul"),js=a("li"),u_=n("T5 models need a slightly higher learning rate than the default one set in the "),tc=a("code"),m_=n("Trainer"),f_=n(` when using the AdamW
optimizer. Typically, 1e-4 and 3e-4 work well for most problems (classification, summarization, translation, question
answering, question generation). Note that T5 was pre-trained using the AdaFactor optimizer.`),uh=c(),Ot=a("p"),g_=n("According to "),zs=a("a"),__=n("this forum post"),T_=n(`, task prefixes matter when
(1) doing multi-task training (2) your task is similar or related to one of the supervised tasks used in T5\u2019s
pre-training mixture (see Appendix D of the `),$s=a("a"),y_=n("paper"),b_=n(` for the task prefixes
used).`),mh=c(),Yo=a("p"),v_=n(`If training on TPU, it is recommended to pad all examples of the dataset to the same length or make use of
`),oc=a("em"),k_=n("pad_to_multiple_of"),w_=n(` to have a small number of predefined bucket sizes to fit all examples in. Dynamically padding
batches to the longest example is not recommended on TPU as it triggers a recompilation for every batch shape that is
encountered during training thus significantly slowing down the training. only padding up to the longest example in a
batch) leads to very slow training on TPU.`),fh=c(),Gi=a("a"),gh=c(),po=a("h2"),Ko=a("a"),nc=a("span"),b(Fs.$$.fragment),M_=c(),sc=a("span"),E_=n("Inference"),_h=c(),Ft=a("p"),j_=n("At inference time, it is recommended to use "),Zi=a("a"),z_=n("generate()"),$_=n(`. This
method takes care of encoding the input and feeding the encoded hidden states via cross-attention layers to the decoder
and auto-regressively generates the decoder output. Check out `),xs=a("a"),F_=n("this blog post"),x_=n(` to know all the details about generating text with Transformers.
There\u2019s also `),Us=a("a"),U_=n("this blog post"),J_=n(` which explains how
generation works in general in encoder-decoder models.`),Th=c(),b(Js.$$.fragment),yh=c(),dt=a("p"),C_=n("Note that T5 uses the "),ac=a("code"),q_=n("pad_token_id"),I_=n(" as the "),rc=a("code"),G_=n("decoder_start_token_id"),Z_=n(`, so when doing generation without using
`),Wi=a("a"),W_=n("generate()"),B_=n(", make sure you start it with the "),ic=a("code"),R_=n("pad_token_id"),N_=n("."),bh=c(),Bi=a("p"),A_=n("The example above only shows a single example. You can also do batched inference, like so:"),vh=c(),b(Cs.$$.fragment),kh=c(),Ri=a("p"),V_=n(`Because T5 has been trained with the span-mask denoising objective,
it can be used to predict the sentinel (masked-out) tokens during inference.
The predicted tokens will then be placed between the sentinel tokens.`),wh=c(),b(qs.$$.fragment),Mh=c(),Ni=a("a"),Eh=c(),ho=a("h2"),en=a("a"),lc=a("span"),b(Is.$$.fragment),X_=c(),dc=a("span"),S_=n("Performance"),jh=c(),xt=a("p"),P_=n("If you\u2019d like a faster training and inference performance, install "),Gs=a("a"),D_=n("apex"),L_=n(" and then the model will automatically use "),cc=a("code"),H_=n("apex.normalization.FusedRMSNorm"),O_=n(" instead of "),pc=a("code"),Q_=n("T5LayerNorm"),Y_=n(". The former uses an optimized fused kernel which is several times faster than the latter."),zh=c(),uo=a("h2"),tn=a("a"),hc=a("span"),b(Zs.$$.fragment),K_=c(),uc=a("span"),eT=n("Resources"),$h=c(),Ai=a("p"),tT=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with T5. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Fh=c(),b(Ws.$$.fragment),xh=c(),on=a("ul"),Bs=a("li"),oT=n("A notebook for how to "),Rs=a("a"),nT=n("finetune T5 for classification and multiple choice"),sT=n("."),aT=c(),Ns=a("li"),rT=n("A notebook for how to "),As=a("a"),iT=n("finetune T5 for sentiment span extraction"),lT=n(". \u{1F30E}"),Uh=c(),b(Vs.$$.fragment),Jh=c(),Vi=a("ul"),Xs=a("li"),dT=n("A notebook for how to "),Ss=a("a"),cT=n("finetune T5 for named entity recognition"),pT=n(". \u{1F30E}"),Ch=c(),b(Ps.$$.fragment),qh=c(),Xi=a("ul"),Ds=a("li"),hT=n("A notebook for "),Ls=a("a"),uT=n("Finetuning CodeT5 for generating docstrings from Ruby code"),mT=n("."),Ih=c(),b(Hs.$$.fragment),Gh=c(),ie=a("ul"),Os=a("li"),fT=n("A notebook to "),Qs=a("a"),gT=n("Finetune T5-base-dutch to perform Dutch abstractive summarization on a TPU"),_T=n("."),TT=c(),Ys=a("li"),yT=n("A notebook for how to "),Ks=a("a"),bT=n("finetune T5 for summarization in PyTorch and track experiments with WandB"),vT=n(". \u{1F30E}"),kT=c(),ea=a("li"),wT=n("A blog post on "),ta=a("a"),MT=n("Distributed Training: Train BART/T5 for Summarization using \u{1F917} Transformers and Amazon SageMaker"),ET=n("."),jT=c(),Qt=a("li"),Si=a("a"),zT=n("T5ForConditionalGeneration"),$T=n(" is supported by this "),oa=a("a"),FT=n("example script"),xT=n(" and "),na=a("a"),UT=n("notebook"),JT=n("."),CT=c(),Yt=a("li"),Pi=a("a"),qT=n("TFT5ForConditionalGeneration"),IT=n(" is supported by this "),sa=a("a"),GT=n("example script"),ZT=n(" and "),aa=a("a"),WT=n("notebook"),BT=n("."),RT=c(),nn=a("li"),Di=a("a"),NT=n("FlaxT5ForConditionalGeneration"),AT=n(" is supported by this "),ra=a("a"),VT=n("example script"),XT=n("."),ST=c(),Li=a("li"),ia=a("a"),PT=n("Summarization"),DT=n(" chapter of the \u{1F917} Hugging Face course."),LT=c(),mc=a("li"),Hi=a("a"),HT=n("Summarization task guide"),Zh=c(),b(la.$$.fragment),Wh=c(),Oi=a("ul"),Ut=a("li"),Qi=a("a"),OT=n("FlaxT5ForConditionalGeneration"),QT=n(" is supported by this "),da=a("a"),YT=n("example script"),KT=n(" for training T5 with a span-masked language model objective. The script also shows how to train a T5 tokenizer. "),Yi=a("a"),ey=n("FlaxT5ForConditionalGeneration"),ty=n(" is also supported by this "),ca=a("a"),oy=n("notebook"),ny=n("."),Bh=c(),b(pa.$$.fragment),Rh=c(),Kt=a("ul"),eo=a("li"),Ki=a("a"),sy=n("T5ForConditionalGeneration"),ay=n(" is supported by this "),ha=a("a"),ry=n("example script"),iy=n(" and "),ua=a("a"),ly=n("notebook"),dy=n("."),cy=c(),to=a("li"),el=a("a"),py=n("TFT5ForConditionalGeneration"),hy=n(" is supported by this "),ma=a("a"),uy=n("example script"),my=n(" and "),fa=a("a"),fy=n("notebook"),gy=n("."),_y=c(),fc=a("li"),tl=a("a"),Ty=n("Translation task guide"),Nh=c(),b(ga.$$.fragment),Ah=c(),sn=a("ul"),_a=a("li"),yy=n("A notebook on how to "),Ta=a("a"),by=n("finetune T5 for question answering with TensorFlow 2"),vy=n(". \u{1F30E}"),ky=c(),ya=a("li"),wy=n("A notebook on how to "),ba=a("a"),My=n("finetune T5 for question answering on a TPU"),Ey=n("."),Vh=c(),va=a("p"),jy=n("\u{1F680} "),gc=a("strong"),zy=n("Deploy"),Xh=c(),ol=a("ul"),ka=a("li"),$y=n("A blog post on how to deploy "),wa=a("a"),Fy=n("T5 11B for inference for less than $500"),xy=n("."),Sh=c(),mo=a("h2"),an=a("a"),_c=a("span"),b(Ma.$$.fragment),Uy=c(),Tc=a("span"),Jy=n("T5Config"),Ph=c(),Pt=a("div"),b(Ea.$$.fragment),Cy=c(),Dt=a("p"),qy=n("This is the configuration class to store the configuration of a "),nl=a("a"),Iy=n("T5Model"),Gy=n(" or a "),sl=a("a"),Zy=n("TFT5Model"),Wy=n(`. It is used to
instantiate a T5 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 T5
`),ja=a("a"),By=n("t5-small"),Ry=n(" architecture."),Ny=c(),fo=a("p"),Ay=n("Configuration objects inherit from "),al=a("a"),Vy=n("PretrainedConfig"),Xy=n(` and can be used to control the model outputs. Read the
documentation from `),rl=a("a"),Sy=n("PretrainedConfig"),Py=n(" for more information."),Dh=c(),go=a("h2"),rn=a("a"),yc=a("span"),b(za.$$.fragment),Dy=c(),bc=a("span"),Ly=n("T5Tokenizer"),Lh=c(),me=a("div"),b($a.$$.fragment),Hy=c(),Fa=a("p"),Oy=n("Construct a T5 tokenizer. Based on "),xa=a("a"),Qy=n("SentencePiece"),Yy=n("."),Ky=c(),Ua=a("p"),eb=n("This tokenizer inherits from "),il=a("a"),tb=n("PreTrainedTokenizer"),ob=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),nb=c(),oo=a("div"),b(Ja.$$.fragment),sb=c(),vc=a("p"),ab=n(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A sequence has the following format:`),rb=c(),Ca=a("ul"),ll=a("li"),ib=n("single sequence: "),kc=a("code"),lb=n("X </s>"),db=c(),dl=a("li"),cb=n("pair of sequences: "),wc=a("code"),pb=n("A </s> B </s>"),hb=c(),ln=a("div"),b(qa.$$.fragment),ub=c(),Ia=a("p"),mb=n(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Mc=a("code"),fb=n("prepare_for_model"),gb=n(" method."),_b=c(),dn=a("div"),b(Ga.$$.fragment),Tb=c(),Ec=a("p"),yb=n(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. T5 does not make
use of token type ids, therefore a list of zeros is returned.`),bb=c(),cl=a("div"),b(Za.$$.fragment),Hh=c(),_o=a("h2"),cn=a("a"),jc=a("span"),b(Wa.$$.fragment),vb=c(),zc=a("span"),kb=n("T5TokenizerFast"),Oh=c(),Ke=a("div"),b(Ba.$$.fragment),wb=c(),To=a("p"),Mb=n("Construct a \u201Cfast\u201D T5 tokenizer (backed by HuggingFace\u2019s "),$c=a("em"),Eb=n("tokenizers"),jb=n(` library). Based on
`),Ra=a("a"),zb=n("Unigram"),$b=n("."),Fb=c(),Na=a("p"),xb=n("This tokenizer inherits from "),pl=a("a"),Ub=n("PreTrainedTokenizerFast"),Jb=n(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Cb=c(),no=a("div"),b(Aa.$$.fragment),qb=c(),Fc=a("p"),Ib=n(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A sequence has the following format:`),Gb=c(),Va=a("ul"),hl=a("li"),Zb=n("single sequence: "),xc=a("code"),Wb=n("X </s>"),Bb=c(),ul=a("li"),Rb=n("pair of sequences: "),Uc=a("code"),Nb=n("A </s> B </s>"),Ab=c(),pn=a("div"),b(Xa.$$.fragment),Vb=c(),Jc=a("p"),Xb=n(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. T5 does not make
use of token type ids, therefore a list of zeros is returned.`),Qh=c(),yo=a("h2"),hn=a("a"),Cc=a("span"),b(Sa.$$.fragment),Sb=c(),qc=a("span"),Pb=n("T5Model"),Yh=c(),Ce=a("div"),b(Pa.$$.fragment),Db=c(),Ic=a("p"),Lb=n("The bare T5 Model transformer outputting raw hidden-states without any specific head on top."),Hb=c(),Da=a("p"),Ob=n("The T5 model was proposed in "),La=a("a"),Qb=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Yb=n(` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),Kb=c(),Ha=a("p"),ev=n("This model inherits from "),ml=a("a"),tv=n("PreTrainedModel"),ov=n(`. 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.)`),nv=c(),Oa=a("p"),sv=n("This model is also a PyTorch "),Qa=a("a"),av=n("torch.nn.Module"),rv=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),iv=c(),Jt=a("div"),b(Ya.$$.fragment),lv=c(),bo=a("p"),dv=n("The "),fl=a("a"),cv=n("T5Model"),pv=n(" forward method, overrides the "),Gc=a("code"),hv=n("__call__"),uv=n(" special method."),mv=c(),b(un.$$.fragment),fv=c(),b(mn.$$.fragment),Kh=c(),vo=a("h2"),fn=a("a"),Zc=a("span"),b(Ka.$$.fragment),gv=c(),Wc=a("span"),_v=n("T5ForConditionalGeneration"),eu=c(),qe=a("div"),b(er.$$.fragment),Tv=c(),tr=a("p"),yv=n("T5 Model with a "),Bc=a("code"),bv=n("language modeling"),vv=n(" head on top."),kv=c(),or=a("p"),wv=n("The T5 model was proposed in "),nr=a("a"),Mv=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Ev=n(` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),jv=c(),sr=a("p"),zv=n("This model inherits from "),gl=a("a"),$v=n("PreTrainedModel"),Fv=n(`. 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.)`),xv=c(),ar=a("p"),Uv=n("This model is also a PyTorch "),rr=a("a"),Jv=n("torch.nn.Module"),Cv=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qv=c(),Ct=a("div"),b(ir.$$.fragment),Iv=c(),ko=a("p"),Gv=n("The "),_l=a("a"),Zv=n("T5ForConditionalGeneration"),Wv=n(" forward method, overrides the "),Rc=a("code"),Bv=n("__call__"),Rv=n(" special method."),Nv=c(),b(gn.$$.fragment),Av=c(),b(_n.$$.fragment),tu=c(),wo=a("h2"),Tn=a("a"),Nc=a("span"),b(lr.$$.fragment),Vv=c(),Ac=a("span"),Xv=n("T5EncoderModel"),ou=c(),Ie=a("div"),b(dr.$$.fragment),Sv=c(),Vc=a("p"),Pv=n("The bare T5 Model transformer outputting encoder\u2019s raw hidden-states without any specific head on top."),Dv=c(),cr=a("p"),Lv=n("The T5 model was proposed in "),pr=a("a"),Hv=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Ov=n(` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),Qv=c(),hr=a("p"),Yv=n("This model inherits from "),Tl=a("a"),Kv=n("PreTrainedModel"),ek=n(`. 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.)`),tk=c(),ur=a("p"),ok=n("This model is also a PyTorch "),mr=a("a"),nk=n("torch.nn.Module"),sk=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ak=c(),qt=a("div"),b(fr.$$.fragment),rk=c(),Mo=a("p"),ik=n("The "),yl=a("a"),lk=n("T5EncoderModel"),dk=n(" forward method, overrides the "),Xc=a("code"),ck=n("__call__"),pk=n(" special method."),hk=c(),b(yn.$$.fragment),uk=c(),b(bn.$$.fragment),nu=c(),Eo=a("h2"),vn=a("a"),Sc=a("span"),b(gr.$$.fragment),mk=c(),Pc=a("span"),fk=n("T5ForQuestionAnswering"),su=c(),Ge=a("div"),b(_r.$$.fragment),gk=c(),jo=a("p"),_k=n(`T5 Model with a span classification head on top for extractive question-answering tasks like SQuAD (linear layers
on top of the hidden-states output to compute `),Dc=a("code"),Tk=n("span start logits"),yk=n(" and "),Lc=a("code"),bk=n("span end logits"),vk=n(")."),kk=c(),Tr=a("p"),wk=n("The T5 model was proposed in "),yr=a("a"),Mk=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Ek=n(` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),jk=c(),br=a("p"),zk=n("This model inherits from "),bl=a("a"),$k=n("PreTrainedModel"),Fk=n(`. 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.)`),xk=c(),vr=a("p"),Uk=n("This model is also a PyTorch "),kr=a("a"),Jk=n("torch.nn.Module"),Ck=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qk=c(),so=a("div"),b(wr.$$.fragment),Ik=c(),zo=a("p"),Gk=n("The "),vl=a("a"),Zk=n("T5ForQuestionAnswering"),Wk=n(" forward method, overrides the "),Hc=a("code"),Bk=n("__call__"),Rk=n(" special method."),Nk=c(),b(kn.$$.fragment),au=c(),$o=a("h2"),wn=a("a"),Oc=a("span"),b(Mr.$$.fragment),Ak=c(),Qc=a("span"),Vk=n("TFT5Model"),ru=c(),fe=a("div"),b(Er.$$.fragment),Xk=c(),Yc=a("p"),Sk=n("The bare T5 Model transformer outputting raw hidden-stateswithout any specific head on top."),Pk=c(),jr=a("p"),Dk=n("The T5 model was proposed in "),zr=a("a"),Lk=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Hk=n(` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),Ok=c(),$r=a("p"),Qk=n("This model inherits from "),kl=a("a"),Yk=n("TFPreTrainedModel"),Kk=n(`. 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.)`),ew=c(),Fr=a("p"),tw=n("This model is also a "),xr=a("a"),ow=n("tf.keras.Model"),nw=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),sw=c(),b(Mn.$$.fragment),aw=c(),It=a("div"),b(Ur.$$.fragment),rw=c(),Fo=a("p"),iw=n("The "),wl=a("a"),lw=n("TFT5Model"),dw=n(" forward method, overrides the "),Kc=a("code"),cw=n("__call__"),pw=n(" special method."),hw=c(),b(En.$$.fragment),uw=c(),b(jn.$$.fragment),iu=c(),xo=a("h2"),zn=a("a"),ep=a("span"),b(Jr.$$.fragment),mw=c(),tp=a("span"),fw=n("TFT5ForConditionalGeneration"),lu=c(),ge=a("div"),b(Cr.$$.fragment),gw=c(),qr=a("p"),_w=n("T5 Model with a "),op=a("code"),Tw=n("language modeling"),yw=n(" head on top."),bw=c(),Ir=a("p"),vw=n("The T5 model was proposed in "),Gr=a("a"),kw=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),ww=n(` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),Mw=c(),Zr=a("p"),Ew=n("This model inherits from "),Ml=a("a"),jw=n("TFPreTrainedModel"),zw=n(`. 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.)`),$w=c(),Wr=a("p"),Fw=n("This model is also a "),Br=a("a"),xw=n("tf.keras.Model"),Uw=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Jw=c(),b($n.$$.fragment),Cw=c(),Gt=a("div"),b(Rr.$$.fragment),qw=c(),Uo=a("p"),Iw=n("The "),El=a("a"),Gw=n("TFT5ForConditionalGeneration"),Zw=n(" forward method, overrides the "),np=a("code"),Ww=n("__call__"),Bw=n(" special method."),Rw=c(),b(Fn.$$.fragment),Nw=c(),b(xn.$$.fragment),du=c(),Jo=a("h2"),Un=a("a"),sp=a("span"),b(Nr.$$.fragment),Aw=c(),ap=a("span"),Vw=n("TFT5EncoderModel"),cu=c(),_e=a("div"),b(Ar.$$.fragment),Xw=c(),rp=a("p"),Sw=n("The bare T5 Model transformer outputting encoder\u2019s raw hidden-stateswithout any specific head on top."),Pw=c(),Vr=a("p"),Dw=n("The T5 model was proposed in "),Xr=a("a"),Lw=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Hw=n(` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),Ow=c(),Sr=a("p"),Qw=n("This model inherits from "),jl=a("a"),Yw=n("TFPreTrainedModel"),Kw=n(`. 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.)`),e1=c(),Pr=a("p"),t1=n("This model is also a "),Dr=a("a"),o1=n("tf.keras.Model"),n1=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),s1=c(),b(Jn.$$.fragment),a1=c(),Zt=a("div"),b(Lr.$$.fragment),r1=c(),Co=a("p"),i1=n("The "),zl=a("a"),l1=n("TFT5EncoderModel"),d1=n(" forward method, overrides the "),ip=a("code"),c1=n("__call__"),p1=n(" special method."),h1=c(),b(Cn.$$.fragment),u1=c(),b(qn.$$.fragment),pu=c(),qo=a("h2"),In=a("a"),lp=a("span"),b(Hr.$$.fragment),m1=c(),dp=a("span"),f1=n("FlaxT5Model"),hu=c(),_t=a("div"),b(Or.$$.fragment),g1=c(),Wt=a("div"),b(Qr.$$.fragment),_1=c(),Io=a("p"),T1=n("The "),cp=a("code"),y1=n("FlaxT5PreTrainedModel"),b1=n(" forward method, overrides the "),pp=a("code"),v1=n("__call__"),k1=n(" special method."),w1=c(),b(Gn.$$.fragment),M1=c(),b(Zn.$$.fragment),E1=c(),Wn=a("div"),b(Yr.$$.fragment),j1=c(),b(Bn.$$.fragment),z1=c(),Rn=a("div"),b(Kr.$$.fragment),$1=c(),b(Nn.$$.fragment),uu=c(),Go=a("h2"),An=a("a"),hp=a("span"),b(ei.$$.fragment),F1=c(),up=a("span"),x1=n("FlaxT5ForConditionalGeneration"),mu=c(),Tt=a("div"),b(ti.$$.fragment),U1=c(),Bt=a("div"),b(oi.$$.fragment),J1=c(),Zo=a("p"),C1=n("The "),mp=a("code"),q1=n("FlaxT5PreTrainedModel"),I1=n(" forward method, overrides the "),fp=a("code"),G1=n("__call__"),Z1=n(" special method."),W1=c(),b(Vn.$$.fragment),B1=c(),b(Xn.$$.fragment),R1=c(),Sn=a("div"),b(ni.$$.fragment),N1=c(),b(Pn.$$.fragment),A1=c(),Dn=a("div"),b(si.$$.fragment),V1=c(),b(Ln.$$.fragment),fu=c(),Wo=a("h2"),Hn=a("a"),gp=a("span"),b(ai.$$.fragment),X1=c(),_p=a("span"),S1=n("FlaxT5EncoderModel"),gu=c(),Bo=a("div"),b(ri.$$.fragment),P1=c(),ao=a("div"),b(ii.$$.fragment),D1=c(),Ro=a("p"),L1=n("The "),$l=a("a"),H1=n("FlaxT5EncoderModel"),O1=n(" forward method, overrides the "),Tp=a("code"),Q1=n("__call__"),Y1=n(" special method."),K1=c(),b(On.$$.fragment),this.h()},l(o){const h=dj('[data-svelte="svelte-1phssyn"]',document.head);m=r(h,"META",{name:!0,content:!0}),h.forEach(t),y=p(o),_=r(o,"H1",{class:!0});var li=i(_);g=r(li,"A",{id:!0,class:!0,href:!0});var yp=i(g);T=r(yp,"SPAN",{});var bp=i(T);v(d.$$.fragment,bp),bp.forEach(t),yp.forEach(t),f=p(li),z=r(li,"SPAN",{});var vp=i(z);Ne=s(vp,"T5"),vp.forEach(t),li.forEach(t),Ze=p(o),Z=r(o,"DIV",{class:!0});var No=i(Z);ye=r(No,"A",{href:!0});var kp=i(ye);H=r(kp,"IMG",{alt:!0,src:!0}),kp.forEach(t),Ae=p(No),V=r(No,"A",{href:!0});var wp=i(V);be=r(wp,"IMG",{alt:!0,src:!0}),wp.forEach(t),O=p(No),ve=r(No,"A",{href:!0});var Mp=i(ve);ke=r(Mp,"IMG",{alt:!0,src:!0}),Mp.forEach(t),No.forEach(t),We=p(o),Q=r(o,"H2",{class:!0});var di=i(Q);B=r(di,"A",{id:!0,class:!0,href:!0});var Ep=i(B);xe=r(Ep,"SPAN",{});var jp=i(xe);v(le.$$.fragment,jp),jp.forEach(t),Ep.forEach(t),Y=p(di),Ue=r(di,"SPAN",{});var zp=i(Ue);Ve=s(zp,"Overview"),zp.forEach(t),di.forEach(t),de=p(o),U=r(o,"P",{});var yt=i(U);I=s(yt,"The T5 model was presented in "),ce=r(yt,"A",{href:!0,rel:!0});var $p=i(ce);K=s($p,"Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer"),$p.forEach(t),Xe=s(yt," by "),pe=r(yt,"A",{href:!0,rel:!0});var Fp=i(pe);ee=s(Fp,"Colin Raffel"),Fp.forEach(t),Se=s(yt,", Noam Shazeer, "),he=r(yt,"A",{href:!0,rel:!0});var xp=i(he);G=s(xp,"Adam Roberts"),xp.forEach(t),Pe=s(yt,`, Katherine Lee, Sharan Narang,
Michael Matena, Yanqi Zhou, Wei Li, `),N=r(yt,"A",{href:!0,rel:!0});var Up=i(N);De=s(Up,"Peter J. Liu"),Up.forEach(t),Le=s(yt,"."),yt.forEach(t),L=p(o),we=r(o,"P",{});var Jp=i(we);He=s(Jp,"The abstract from the paper is the following:"),Jp.forEach(t),A=p(o),Me=r(o,"P",{});var Cp=i(Me);P=r(Cp,"EM",{});var qp=i(P);Oe=s(qp,`Transfer learning, where a model is first pre-trained on a data-rich task before being fine-tuned on a downstream
task, has emerged as a powerful technique in natural language processing (NLP). The effectiveness of transfer learning
has given rise to a diversity of approaches, methodology, and practice. In this paper, we explore the landscape of
transfer learning techniques for NLP by introducing a unified framework that converts every language problem into a
text-to-text format. Our systematic study compares pretraining objectives, architectures, unlabeled datasets, transfer
approaches, and other factors on dozens of language understanding tasks. By combining the insights from our exploration
with scale and our new \u201CColossal Clean Crawled Corpus\u201D, we achieve state-of-the-art results on many benchmarks covering
summarization, question answering, text classification, and more. To facilitate future work on transfer learning for
NLP, we release our dataset, pre-trained models, and code.`),qp.forEach(t),Cp.forEach(t),ue=p(o),C=r(o,"P",{});var Ip=i(C);Qe=s(Ip,"Tips:"),Ip.forEach(t),W=p(o),R=r(o,"UL",{});var bt=i(R);Je=r(bt,"LI",{});var Gp=i(Je);j=r(Gp,"P",{});var Ao=i(j);x=s(Ao,`T5 is an encoder-decoder model pre-trained on a multi-task mixture of unsupervised and supervised tasks and for which
each task is converted into a text-to-text format. T5 works well on a variety of tasks out-of-the-box by prepending a
different prefix to the input corresponding to each task, e.g., for translation: `),tt=r(Ao,"EM",{});var Zp=i(tt);Ee=s(Zp,"translate English to German: \u2026"),Zp.forEach(t),kt=s(Ao,`,
for summarization: `),ot=r(Ao,"EM",{});var cM=i(ot);J=s(cM,"summarize: \u2026"),cM.forEach(t),wt=s(Ao,"."),Ao.forEach(t),Gp.forEach(t),Mt=p(bt),nt=r(bt,"LI",{});var pM=i(nt);st=r(pM,"P",{});var hM=i(st);Et=s(hM,"The pretraining includes both supervised and self-supervised training. Supervised training is conducted on downstream tasks provided by the GLUE and SuperGLUE benchmarks (converting them into text-to-text tasks as explained above)."),hM.forEach(t),pM.forEach(t),X=p(bt),D=r(bt,"LI",{});var uM=i(D);at=r(uM,"P",{});var mM=i(at);jt=s(mM,"Self-supervised training uses corrupted tokens, by randomly removing 15% of the tokens and replacing them with individual sentinel tokens (if several consecutive tokens are marked for removal, the whole group is replaced with a single sentinel token). The input of the encoder is the corrupted sentence, the input of the decoder is the original sentence and the target is then the dropped out tokens delimited by their sentinel tokens."),mM.forEach(t),uM.forEach(t),te=p(bt),rt=r(bt,"LI",{});var fM=i(rt);it=r(fM,"P",{});var gM=i(it);Ye=s(gM,"T5 uses relative scalar embeddings. Encoder input padding can be done on the left and on the right."),gM.forEach(t),fM.forEach(t),zt=p(bt),se=r(bt,"LI",{});var _M=i(se);ae=r(_M,"P",{});var Qn=i(ae);Im=s(Qn,"See the "),fi=r(Qn,"A",{href:!0});var TM=i(fi);Gm=s(TM,"training"),TM.forEach(t),Zm=s(Qn,", "),gi=r(Qn,"A",{href:!0});var yM=i(gi);Wm=s(yM,"inference"),yM.forEach(t),Bm=s(Qn," and "),_i=r(Qn,"A",{href:!0});var bM=i(_i);Rm=s(bM,"scripts"),bM.forEach(t),Nm=s(Qn," sections below for all details regarding usage."),Qn.forEach(t),_M.forEach(t),bt.forEach(t),Vp=p(o),Ti=r(o,"P",{});var vM=i(Ti);Am=s(vM,"T5 comes in different sizes:"),vM.forEach(t),Xp=p(o),lt=r(o,"UL",{});var ro=i(lt);Ql=r(ro,"LI",{});var kM=i(Ql);Yl=r(kM,"P",{});var wM=i(Yl);hs=r(wM,"A",{href:!0,rel:!0});var MM=i(hs);Vm=s(MM,"t5-small"),MM.forEach(t),wM.forEach(t),kM.forEach(t),Xm=p(ro),Kl=r(ro,"LI",{});var EM=i(Kl);ed=r(EM,"P",{});var jM=i(ed);us=r(jM,"A",{href:!0,rel:!0});var zM=i(us);Sm=s(zM,"t5-base"),zM.forEach(t),jM.forEach(t),EM.forEach(t),Pm=p(ro),td=r(ro,"LI",{});var $M=i(td);od=r($M,"P",{});var FM=i(od);ms=r(FM,"A",{href:!0,rel:!0});var xM=i(ms);Dm=s(xM,"t5-large"),xM.forEach(t),FM.forEach(t),$M.forEach(t),Lm=p(ro),nd=r(ro,"LI",{});var UM=i(nd);sd=r(UM,"P",{});var JM=i(sd);fs=r(JM,"A",{href:!0,rel:!0});var CM=i(fs);Hm=s(CM,"t5-3b"),CM.forEach(t),JM.forEach(t),UM.forEach(t),Om=p(ro),ad=r(ro,"LI",{});var qM=i(ad);yi=r(qM,"P",{});var eM=i(yi);gs=r(eM,"A",{href:!0,rel:!0});var IM=i(gs);Qm=s(IM,"t5-11b"),IM.forEach(t),Ym=s(eM,"."),eM.forEach(t),qM.forEach(t),ro.forEach(t),Sp=p(o),bi=r(o,"P",{});var GM=i(bi);Km=s(GM,"Based on the original T5 model, Google has released some follow-up works:"),GM.forEach(t),Pp=p(o),je=r(o,"UL",{});var ct=i(je);rd=r(ct,"LI",{});var ZM=i(rd);Xo=r(ZM,"P",{});var Wp=i(Xo);id=r(Wp,"STRONG",{});var WM=i(id);ef=s(WM,"T5v1.1"),WM.forEach(t),tf=s(Wp,`: T5v1.1 is an improved version of T5 with some architectural tweaks, and is pre-trained on C4 only without
mixing in the supervised tasks. Refer to the documentation of T5v1.1 which can be found `),vi=r(Wp,"A",{href:!0});var BM=i(vi);of=s(BM,"here"),BM.forEach(t),nf=s(Wp,"."),Wp.forEach(t),ZM.forEach(t),sf=p(ct),ld=r(ct,"LI",{});var RM=i(ld);So=r(RM,"P",{});var Bp=i(So);dd=r(Bp,"STRONG",{});var NM=i(dd);af=s(NM,"mT5"),NM.forEach(t),rf=s(Bp,`: mT5 is a multilingual T5 model. It is pre-trained on the mC4 corpus, which includes 101 languages. Refer to
the documentation of mT5 which can be found `),ki=r(Bp,"A",{href:!0});var AM=i(ki);lf=s(AM,"here"),AM.forEach(t),df=s(Bp,"."),Bp.forEach(t),RM.forEach(t),cf=p(ct),cd=r(ct,"LI",{});var VM=i(cd);Po=r(VM,"P",{});var Rp=i(Po);pd=r(Rp,"STRONG",{});var XM=i(pd);pf=s(XM,"byT5"),XM.forEach(t),hf=s(Rp,`: byT5 is a T5 model pre-trained on byte sequences rather than SentencePiece subword token sequences. Refer
to the documentation of byT5 which can be found `),wi=r(Rp,"A",{href:!0});var SM=i(wi);uf=s(SM,"here"),SM.forEach(t),mf=s(Rp,"."),Rp.forEach(t),VM.forEach(t),ff=p(ct),hd=r(ct,"LI",{});var PM=i(hd);Mi=r(PM,"P",{});var tM=i(Mi);ud=r(tM,"STRONG",{});var DM=i(ud);gf=s(DM,"UL2"),DM.forEach(t),_f=s(tM,": UL2 is a T5 like model pretrained on various denoising objectives"),tM.forEach(t),PM.forEach(t),Tf=p(ct),md=r(ct,"LI",{});var LM=i(md);S=r(LM,"P",{});var oe=i(S);fd=r(oe,"STRONG",{});var HM=i(fd);yf=s(HM,"Flan-T5"),HM.forEach(t),bf=s(oe,`: Flan is a pretraining methods that is based on prompting. The Flan-T5 are T5 models trained on the Flan collection of
datasets which include: `),gd=r(oe,"CODE",{});var OM=i(gd);vf=s(OM,"taskmaster2"),OM.forEach(t),kf=s(oe,", "),_d=r(oe,"CODE",{});var QM=i(_d);wf=s(QM,"djaym7/wiki_dialog"),QM.forEach(t),Mf=s(oe,", "),Td=r(oe,"CODE",{});var YM=i(Td);Ef=s(YM,"deepmind/code_contests"),YM.forEach(t),jf=s(oe,", "),yd=r(oe,"CODE",{});var KM=i(yd);zf=s(KM,"lambada"),KM.forEach(t),$f=s(oe,", "),bd=r(oe,"CODE",{});var e5=i(bd);Ff=s(e5,"gsm8k"),e5.forEach(t),xf=s(oe,", "),vd=r(oe,"CODE",{});var t5=i(vd);Uf=s(t5,"aqua_rat"),t5.forEach(t),Jf=s(oe,", "),kd=r(oe,"CODE",{});var o5=i(kd);Cf=s(o5,"esnli"),o5.forEach(t),qf=s(oe,", "),wd=r(oe,"CODE",{});var n5=i(wd);If=s(n5,"quasc"),n5.forEach(t),Gf=s(oe," and "),Md=r(oe,"CODE",{});var s5=i(Md);Zf=s(s5,"qed"),s5.forEach(t),Wf=s(oe,"."),oe.forEach(t),LM.forEach(t),Bf=p(ct),Ed=r(ct,"LI",{});var a5=i(Ed);Ei=r(a5,"P",{});var oM=i(Ei);jd=r(oM,"STRONG",{});var r5=i(jd);Rf=s(r5,"FLan-UL2"),r5.forEach(t),Nf=s(oM," : the UL2 model finetuned using the \u201CFlan\u201D prompt tuning and dataset collection."),oM.forEach(t),a5.forEach(t),Af=p(ct),zd=r(ct,"LI",{});var i5=i(zd);Do=r(i5,"P",{});var Np=i(Do);$d=r(Np,"STRONG",{});var l5=i($d);Vf=s(l5,"UMT5"),l5.forEach(t),Xf=s(Np,`: UmT5 is a multilingual T5 model trained on an improved and refreshed mC4 multilingual corpus,  29 trillion characters across 107 language, using a new sampling method, UniMax. Refer to
the documentation of mT5 which can be found `),ji=r(Np,"A",{href:!0});var d5=i(ji);Sf=s(d5,"here"),d5.forEach(t),Pf=s(Np,"."),Np.forEach(t),i5.forEach(t),ct.forEach(t),Dp=p(o),Lo=r(o,"P",{});var Tu=i(Lo);Df=s(Tu,"All checkpoints can be found on the "),_s=r(Tu,"A",{href:!0,rel:!0});var c5=i(_s);Lf=s(c5,"hub"),c5.forEach(t),Hf=s(Tu,"."),Tu.forEach(t),Lp=p(o),Lt=r(o,"P",{});var Fl=i(Lt);Of=s(Fl,"This model was contributed by "),Ts=r(Fl,"A",{href:!0,rel:!0});var p5=i(Ts);Qf=s(p5,"thomwolf"),p5.forEach(t),Yf=s(Fl,". The original code can be found "),ys=r(Fl,"A",{href:!0,rel:!0});var h5=i(ys);Kf=s(h5,"here"),h5.forEach(t),eg=s(Fl,"."),Fl.forEach(t),Hp=p(o),zi=r(o,"A",{id:!0}),i(zi).forEach(t),Op=p(o),co=r(o,"H2",{class:!0});var yu=i(co);Ho=r(yu,"A",{id:!0,class:!0,href:!0});var u5=i(Ho);Fd=r(u5,"SPAN",{});var m5=i(Fd);v(bs.$$.fragment,m5),m5.forEach(t),u5.forEach(t),tg=p(yu),xd=r(yu,"SPAN",{});var f5=i(xd);og=s(f5,"Training"),f5.forEach(t),yu.forEach(t),Qp=p(o),$t=r(o,"P",{});var Yn=i($t);ng=s(Yn,`T5 is an encoder-decoder model and converts all NLP problems into a text-to-text format. It is trained using teacher
forcing. This means that for training, we always need an input sequence and a corresponding target sequence. The input
sequence is fed to the model using `),Ud=r(Yn,"CODE",{});var g5=i(Ud);sg=s(g5,"input_ids"),g5.forEach(t),ag=s(Yn,`. The target sequence is shifted to the right, i.e., prepended by a
start-sequence token and fed to the decoder using the `),Jd=r(Yn,"CODE",{});var _5=i(Jd);rg=s(_5,"decoder_input_ids"),_5.forEach(t),ig=s(Yn,`. In teacher-forcing style, the target
sequence is then appended by the EOS token and corresponds to the `),Cd=r(Yn,"CODE",{});var T5=i(Cd);lg=s(T5,"labels"),T5.forEach(t),dg=s(Yn,`. The PAD token is hereby used as the
start-sequence token. T5 can be trained / fine-tuned both in a supervised and unsupervised fashion.`),Yn.forEach(t),Yp=p(o),Oo=r(o,"P",{});var bu=i(Oo);cg=s(bu,"One can use "),$i=r(bu,"A",{href:!0});var y5=i($i);pg=s(y5,"T5ForConditionalGeneration"),y5.forEach(t),hg=s(bu,` (or the Tensorflow/Flax variant), which includes the
language modeling head on top of the decoder.`),bu.forEach(t),Kp=p(o),Fi=r(o,"UL",{});var b5=i(Fi);qd=r(b5,"LI",{});var v5=i(qd);ug=s(v5,"Unsupervised denoising training"),v5.forEach(t),b5.forEach(t),eh=p(o),ze=r(o,"P",{});var pt=i(ze);mg=s(pt,"In this setup, spans of the input sequence are masked by so-called sentinel tokens ("),Id=r(pt,"EM",{});var k5=i(Id);fg=s(k5,"a.k.a"),k5.forEach(t),gg=s(pt,` unique mask tokens) and
the output sequence is formed as a concatenation of the same sentinel tokens and the `),Gd=r(pt,"EM",{});var w5=i(Gd);_g=s(w5,"real"),w5.forEach(t),Tg=s(pt,` masked tokens. Each
sentinel token represents a unique mask token for this sentence and should start with `),Zd=r(pt,"CODE",{});var M5=i(Zd);yg=s(M5,"<extra_id_0>"),M5.forEach(t),bg=s(pt,`,
`),Wd=r(pt,"CODE",{});var E5=i(Wd);vg=s(E5,"<extra_id_1>"),E5.forEach(t),kg=s(pt,", \u2026 up to "),Bd=r(pt,"CODE",{});var j5=i(Bd);wg=s(j5,"<extra_id_99>"),j5.forEach(t),Mg=s(pt,`. As a default, 100 sentinel tokens are available in
`),xi=r(pt,"A",{href:!0});var z5=i(xi);Eg=s(z5,"T5Tokenizer"),z5.forEach(t),jg=s(pt,"."),pt.forEach(t),th=p(o),Ui=r(o,"P",{});var $5=i(Ui);zg=s($5,`For instance, the sentence \u201CThe cute dog walks in the park\u201D with the masks put on \u201Ccute dog\u201D and \u201Cthe\u201D should be
processed as follows:`),$5.forEach(t),oh=p(o),v(vs.$$.fragment,o),nh=p(o),Qo=r(o,"P",{});var vu=i(Qo);$g=s(vu,"If you\u2019re interested in pre-training T5 on a new corpus, check out the "),ks=r(vu,"A",{href:!0,rel:!0});var F5=i(ks);Fg=s(F5,"run_t5_mlm_flax.py"),F5.forEach(t),xg=s(vu,` script in the Examples
directory.`),vu.forEach(t),sh=p(o),Ji=r(o,"UL",{});var x5=i(Ji);Rd=r(x5,"LI",{});var U5=i(Rd);Ug=s(U5,"Supervised training"),U5.forEach(t),x5.forEach(t),ah=p(o),Ci=r(o,"P",{});var J5=i(Ci);Jg=s(J5,`In this setup, the input sequence and output sequence are a standard sequence-to-sequence input-output mapping.
Suppose that we want to fine-tune the model for translation for example, and we have a training example: the input
sequence \u201CThe house is wonderful.\u201D and output sequence \u201CDas Haus ist wunderbar.\u201D, then they should be prepared for
the model as follows:`),J5.forEach(t),rh=p(o),v(ws.$$.fragment,o),ih=p(o),re=r(o,"P",{});var Be=i(re);Cg=s(Be,"As you can see, only 2 inputs are required for the model in order to compute a loss: "),Nd=r(Be,"CODE",{});var C5=i(Nd);qg=s(C5,"input_ids"),C5.forEach(t),Ig=s(Be,` (which are the
`),Ad=r(Be,"CODE",{});var q5=i(Ad);Gg=s(q5,"input_ids"),q5.forEach(t),Zg=s(Be," of the encoded input sequence) and "),Vd=r(Be,"CODE",{});var I5=i(Vd);Wg=s(I5,"labels"),I5.forEach(t),Bg=s(Be," (which are the "),Xd=r(Be,"CODE",{});var G5=i(Xd);Rg=s(G5,"input_ids"),G5.forEach(t),Ng=s(Be,` of the encoded
target sequence). The model will automatically create the `),Sd=r(Be,"CODE",{});var Z5=i(Sd);Ag=s(Z5,"decoder_input_ids"),Z5.forEach(t),Vg=s(Be," based on the "),Pd=r(Be,"CODE",{});var W5=i(Pd);Xg=s(W5,"labels"),W5.forEach(t),Sg=s(Be,`, by
shifting them one position to the right and prepending the `),Dd=r(Be,"CODE",{});var B5=i(Dd);Pg=s(B5,"config.decoder_start_token_id"),B5.forEach(t),Dg=s(Be,`, which for T5 is
equal to 0 (i.e. the id of the pad token). Also note the task prefix: we prepend the input sequence with \u2018translate
English to German: \u2019 before encoding it. This will help in improving the performance, as this task prefix was used
during T5\u2019s pre-training.`),Be.forEach(t),lh=p(o),Ht=r(o,"P",{});var xl=i(Ht);Lg=s(xl,`However, the example above only shows a single training example. In practice, one trains deep learning models in
batches. This entails that we must pad/truncate examples to the same length. For encoder-decoder models, one
typically defines a `),Ld=r(xl,"CODE",{});var R5=i(Ld);Hg=s(R5,"max_source_length"),R5.forEach(t),Og=s(xl," and "),Hd=r(xl,"CODE",{});var N5=i(Hd);Qg=s(N5,"max_target_length"),N5.forEach(t),Yg=s(xl,`, which determine the maximum length of the
input and output sequences respectively (otherwise they are truncated). These should be carefully set depending on
the task.`),xl.forEach(t),dh=p(o),$e=r(o,"P",{});var ht=i($e);Kg=s(ht,"In addition, we must make sure that padding token id\u2019s of the "),Od=r(ht,"CODE",{});var A5=i(Od);e_=s(A5,"labels"),A5.forEach(t),t_=s(ht,` are not taken into account by the loss
function. In PyTorch and Tensorflow, this can be done by replacing them with -100, which is the `),Qd=r(ht,"CODE",{});var V5=i(Qd);o_=s(V5,"ignore_index"),V5.forEach(t),n_=s(ht,`
of the `),Yd=r(ht,"CODE",{});var X5=i(Yd);s_=s(X5,"CrossEntropyLoss"),X5.forEach(t),a_=s(ht,". In Flax, one can use the "),Kd=r(ht,"CODE",{});var S5=i(Kd);r_=s(S5,"decoder_attention_mask"),S5.forEach(t),i_=s(ht,` to ignore padded tokens from
the loss (see the `),Ms=r(ht,"A",{href:!0,rel:!0});var P5=i(Ms);l_=s(P5,"Flax summarization script"),P5.forEach(t),d_=s(ht,` for details). We also pass
`),ec=r(ht,"CODE",{});var D5=i(ec);c_=s(D5,"attention_mask"),D5.forEach(t),p_=s(ht,` as additional input to the model, which makes sure that padding tokens of the inputs are
ignored. The code example below illustrates all of this.`),ht.forEach(t),ch=p(o),v(Es.$$.fragment,o),ph=p(o),qi=r(o,"P",{});var L5=i(qi);h_=s(L5,"Additional training tips:"),L5.forEach(t),hh=p(o),Ii=r(o,"UL",{});var H5=i(Ii);js=r(H5,"LI",{});var ku=i(js);u_=s(ku,"T5 models need a slightly higher learning rate than the default one set in the "),tc=r(ku,"CODE",{});var O5=i(tc);m_=s(O5,"Trainer"),O5.forEach(t),f_=s(ku,` when using the AdamW
optimizer. Typically, 1e-4 and 3e-4 work well for most problems (classification, summarization, translation, question
answering, question generation). Note that T5 was pre-trained using the AdaFactor optimizer.`),ku.forEach(t),H5.forEach(t),uh=p(o),Ot=r(o,"P",{});var Ul=i(Ot);g_=s(Ul,"According to "),zs=r(Ul,"A",{href:!0,rel:!0});var Q5=i(zs);__=s(Q5,"this forum post"),Q5.forEach(t),T_=s(Ul,`, task prefixes matter when
(1) doing multi-task training (2) your task is similar or related to one of the supervised tasks used in T5\u2019s
pre-training mixture (see Appendix D of the `),$s=r(Ul,"A",{href:!0,rel:!0});var Y5=i($s);y_=s(Y5,"paper"),Y5.forEach(t),b_=s(Ul,` for the task prefixes
used).`),Ul.forEach(t),mh=p(o),Yo=r(o,"P",{});var wu=i(Yo);v_=s(wu,`If training on TPU, it is recommended to pad all examples of the dataset to the same length or make use of
`),oc=r(wu,"EM",{});var K5=i(oc);k_=s(K5,"pad_to_multiple_of"),K5.forEach(t),w_=s(wu,` to have a small number of predefined bucket sizes to fit all examples in. Dynamically padding
batches to the longest example is not recommended on TPU as it triggers a recompilation for every batch shape that is
encountered during training thus significantly slowing down the training. only padding up to the longest example in a
batch) leads to very slow training on TPU.`),wu.forEach(t),fh=p(o),Gi=r(o,"A",{id:!0}),i(Gi).forEach(t),gh=p(o),po=r(o,"H2",{class:!0});var Mu=i(po);Ko=r(Mu,"A",{id:!0,class:!0,href:!0});var e2=i(Ko);nc=r(e2,"SPAN",{});var t2=i(nc);v(Fs.$$.fragment,t2),t2.forEach(t),e2.forEach(t),M_=p(Mu),sc=r(Mu,"SPAN",{});var o2=i(sc);E_=s(o2,"Inference"),o2.forEach(t),Mu.forEach(t),_h=p(o),Ft=r(o,"P",{});var Kn=i(Ft);j_=s(Kn,"At inference time, it is recommended to use "),Zi=r(Kn,"A",{href:!0});var n2=i(Zi);z_=s(n2,"generate()"),n2.forEach(t),$_=s(Kn,`. This
method takes care of encoding the input and feeding the encoded hidden states via cross-attention layers to the decoder
and auto-regressively generates the decoder output. Check out `),xs=r(Kn,"A",{href:!0,rel:!0});var s2=i(xs);F_=s(s2,"this blog post"),s2.forEach(t),x_=s(Kn,` to know all the details about generating text with Transformers.
There\u2019s also `),Us=r(Kn,"A",{href:!0,rel:!0});var a2=i(Us);U_=s(a2,"this blog post"),a2.forEach(t),J_=s(Kn,` which explains how
generation works in general in encoder-decoder models.`),Kn.forEach(t),Th=p(o),v(Js.$$.fragment,o),yh=p(o),dt=r(o,"P",{});var io=i(dt);C_=s(io,"Note that T5 uses the "),ac=r(io,"CODE",{});var r2=i(ac);q_=s(r2,"pad_token_id"),r2.forEach(t),I_=s(io," as the "),rc=r(io,"CODE",{});var i2=i(rc);G_=s(i2,"decoder_start_token_id"),i2.forEach(t),Z_=s(io,`, so when doing generation without using
`),Wi=r(io,"A",{href:!0});var l2=i(Wi);W_=s(l2,"generate()"),l2.forEach(t),B_=s(io,", make sure you start it with the "),ic=r(io,"CODE",{});var d2=i(ic);R_=s(d2,"pad_token_id"),d2.forEach(t),N_=s(io,"."),io.forEach(t),bh=p(o),Bi=r(o,"P",{});var c2=i(Bi);A_=s(c2,"The example above only shows a single example. You can also do batched inference, like so:"),c2.forEach(t),vh=p(o),v(Cs.$$.fragment,o),kh=p(o),Ri=r(o,"P",{});var p2=i(Ri);V_=s(p2,`Because T5 has been trained with the span-mask denoising objective,
it can be used to predict the sentinel (masked-out) tokens during inference.
The predicted tokens will then be placed between the sentinel tokens.`),p2.forEach(t),wh=p(o),v(qs.$$.fragment,o),Mh=p(o),Ni=r(o,"A",{id:!0}),i(Ni).forEach(t),Eh=p(o),ho=r(o,"H2",{class:!0});var Eu=i(ho);en=r(Eu,"A",{id:!0,class:!0,href:!0});var h2=i(en);lc=r(h2,"SPAN",{});var u2=i(lc);v(Is.$$.fragment,u2),u2.forEach(t),h2.forEach(t),X_=p(Eu),dc=r(Eu,"SPAN",{});var m2=i(dc);S_=s(m2,"Performance"),m2.forEach(t),Eu.forEach(t),jh=p(o),xt=r(o,"P",{});var es=i(xt);P_=s(es,"If you\u2019d like a faster training and inference performance, install "),Gs=r(es,"A",{href:!0,rel:!0});var f2=i(Gs);D_=s(f2,"apex"),f2.forEach(t),L_=s(es," and then the model will automatically use "),cc=r(es,"CODE",{});var g2=i(cc);H_=s(g2,"apex.normalization.FusedRMSNorm"),g2.forEach(t),O_=s(es," instead of "),pc=r(es,"CODE",{});var _2=i(pc);Q_=s(_2,"T5LayerNorm"),_2.forEach(t),Y_=s(es,". The former uses an optimized fused kernel which is several times faster than the latter."),es.forEach(t),zh=p(o),uo=r(o,"H2",{class:!0});var ju=i(uo);tn=r(ju,"A",{id:!0,class:!0,href:!0});var T2=i(tn);hc=r(T2,"SPAN",{});var y2=i(hc);v(Zs.$$.fragment,y2),y2.forEach(t),T2.forEach(t),K_=p(ju),uc=r(ju,"SPAN",{});var b2=i(uc);eT=s(b2,"Resources"),b2.forEach(t),ju.forEach(t),$h=p(o),Ai=r(o,"P",{});var v2=i(Ai);tT=s(v2,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with T5. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),v2.forEach(t),Fh=p(o),v(Ws.$$.fragment,o),xh=p(o),on=r(o,"UL",{});var zu=i(on);Bs=r(zu,"LI",{});var $u=i(Bs);oT=s($u,"A notebook for how to "),Rs=r($u,"A",{href:!0,rel:!0});var k2=i(Rs);nT=s(k2,"finetune T5 for classification and multiple choice"),k2.forEach(t),sT=s($u,"."),$u.forEach(t),aT=p(zu),Ns=r(zu,"LI",{});var Fu=i(Ns);rT=s(Fu,"A notebook for how to "),As=r(Fu,"A",{href:!0,rel:!0});var w2=i(As);iT=s(w2,"finetune T5 for sentiment span extraction"),w2.forEach(t),lT=s(Fu,". \u{1F30E}"),Fu.forEach(t),zu.forEach(t),Uh=p(o),v(Vs.$$.fragment,o),Jh=p(o),Vi=r(o,"UL",{});var M2=i(Vi);Xs=r(M2,"LI",{});var xu=i(Xs);dT=s(xu,"A notebook for how to "),Ss=r(xu,"A",{href:!0,rel:!0});var E2=i(Ss);cT=s(E2,"finetune T5 for named entity recognition"),E2.forEach(t),pT=s(xu,". \u{1F30E}"),xu.forEach(t),M2.forEach(t),Ch=p(o),v(Ps.$$.fragment,o),qh=p(o),Xi=r(o,"UL",{});var j2=i(Xi);Ds=r(j2,"LI",{});var Uu=i(Ds);hT=s(Uu,"A notebook for "),Ls=r(Uu,"A",{href:!0,rel:!0});var z2=i(Ls);uT=s(z2,"Finetuning CodeT5 for generating docstrings from Ruby code"),z2.forEach(t),mT=s(Uu,"."),Uu.forEach(t),j2.forEach(t),Ih=p(o),v(Hs.$$.fragment,o),Gh=p(o),ie=r(o,"UL",{});var Re=i(ie);Os=r(Re,"LI",{});var Ju=i(Os);fT=s(Ju,"A notebook to "),Qs=r(Ju,"A",{href:!0,rel:!0});var $2=i(Qs);gT=s($2,"Finetune T5-base-dutch to perform Dutch abstractive summarization on a TPU"),$2.forEach(t),_T=s(Ju,"."),Ju.forEach(t),TT=p(Re),Ys=r(Re,"LI",{});var Cu=i(Ys);yT=s(Cu,"A notebook for how to "),Ks=r(Cu,"A",{href:!0,rel:!0});var F2=i(Ks);bT=s(F2,"finetune T5 for summarization in PyTorch and track experiments with WandB"),F2.forEach(t),vT=s(Cu,". \u{1F30E}"),Cu.forEach(t),kT=p(Re),ea=r(Re,"LI",{});var qu=i(ea);wT=s(qu,"A blog post on "),ta=r(qu,"A",{href:!0,rel:!0});var x2=i(ta);MT=s(x2,"Distributed Training: Train BART/T5 for Summarization using \u{1F917} Transformers and Amazon SageMaker"),x2.forEach(t),ET=s(qu,"."),qu.forEach(t),jT=p(Re),Qt=r(Re,"LI",{});var ci=i(Qt);Si=r(ci,"A",{href:!0});var U2=i(Si);zT=s(U2,"T5ForConditionalGeneration"),U2.forEach(t),$T=s(ci," is supported by this "),oa=r(ci,"A",{href:!0,rel:!0});var J2=i(oa);FT=s(J2,"example script"),J2.forEach(t),xT=s(ci," and "),na=r(ci,"A",{href:!0,rel:!0});var C2=i(na);UT=s(C2,"notebook"),C2.forEach(t),JT=s(ci,"."),ci.forEach(t),CT=p(Re),Yt=r(Re,"LI",{});var pi=i(Yt);Pi=r(pi,"A",{href:!0});var q2=i(Pi);qT=s(q2,"TFT5ForConditionalGeneration"),q2.forEach(t),IT=s(pi," is supported by this "),sa=r(pi,"A",{href:!0,rel:!0});var I2=i(sa);GT=s(I2,"example script"),I2.forEach(t),ZT=s(pi," and "),aa=r(pi,"A",{href:!0,rel:!0});var G2=i(aa);WT=s(G2,"notebook"),G2.forEach(t),BT=s(pi,"."),pi.forEach(t),RT=p(Re),nn=r(Re,"LI",{});var Ap=i(nn);Di=r(Ap,"A",{href:!0});var Z2=i(Di);NT=s(Z2,"FlaxT5ForConditionalGeneration"),Z2.forEach(t),AT=s(Ap," is supported by this "),ra=r(Ap,"A",{href:!0,rel:!0});var W2=i(ra);VT=s(W2,"example script"),W2.forEach(t),XT=s(Ap,"."),Ap.forEach(t),ST=p(Re),Li=r(Re,"LI",{});var nM=i(Li);ia=r(nM,"A",{href:!0,rel:!0});var B2=i(ia);PT=s(B2,"Summarization"),B2.forEach(t),DT=s(nM," chapter of the \u{1F917} Hugging Face course."),nM.forEach(t),LT=p(Re),mc=r(Re,"LI",{});var R2=i(mc);Hi=r(R2,"A",{href:!0});var N2=i(Hi);HT=s(N2,"Summarization task guide"),N2.forEach(t),R2.forEach(t),Re.forEach(t),Zh=p(o),v(la.$$.fragment,o),Wh=p(o),Oi=r(o,"UL",{});var A2=i(Oi);Ut=r(A2,"LI",{});var Vo=i(Ut);Qi=r(Vo,"A",{href:!0});var V2=i(Qi);OT=s(V2,"FlaxT5ForConditionalGeneration"),V2.forEach(t),QT=s(Vo," is supported by this "),da=r(Vo,"A",{href:!0,rel:!0});var X2=i(da);YT=s(X2,"example script"),X2.forEach(t),KT=s(Vo," for training T5 with a span-masked language model objective. The script also shows how to train a T5 tokenizer. "),Yi=r(Vo,"A",{href:!0});var S2=i(Yi);ey=s(S2,"FlaxT5ForConditionalGeneration"),S2.forEach(t),ty=s(Vo," is also supported by this "),ca=r(Vo,"A",{href:!0,rel:!0});var P2=i(ca);oy=s(P2,"notebook"),P2.forEach(t),ny=s(Vo,"."),Vo.forEach(t),A2.forEach(t),Bh=p(o),v(pa.$$.fragment,o),Rh=p(o),Kt=r(o,"UL",{});var Jl=i(Kt);eo=r(Jl,"LI",{});var hi=i(eo);Ki=r(hi,"A",{href:!0});var D2=i(Ki);sy=s(D2,"T5ForConditionalGeneration"),D2.forEach(t),ay=s(hi," is supported by this "),ha=r(hi,"A",{href:!0,rel:!0});var L2=i(ha);ry=s(L2,"example script"),L2.forEach(t),iy=s(hi," and "),ua=r(hi,"A",{href:!0,rel:!0});var H2=i(ua);ly=s(H2,"notebook"),H2.forEach(t),dy=s(hi,"."),hi.forEach(t),cy=p(Jl),to=r(Jl,"LI",{});var ui=i(to);el=r(ui,"A",{href:!0});var O2=i(el);py=s(O2,"TFT5ForConditionalGeneration"),O2.forEach(t),hy=s(ui," is supported by this "),ma=r(ui,"A",{href:!0,rel:!0});var Q2=i(ma);uy=s(Q2,"example script"),Q2.forEach(t),my=s(ui," and "),fa=r(ui,"A",{href:!0,rel:!0});var Y2=i(fa);fy=s(Y2,"notebook"),Y2.forEach(t),gy=s(ui,"."),ui.forEach(t),_y=p(Jl),fc=r(Jl,"LI",{});var K2=i(fc);tl=r(K2,"A",{href:!0});var e0=i(tl);Ty=s(e0,"Translation task guide"),e0.forEach(t),K2.forEach(t),Jl.forEach(t),Nh=p(o),v(ga.$$.fragment,o),Ah=p(o),sn=r(o,"UL",{});var Iu=i(sn);_a=r(Iu,"LI",{});var Gu=i(_a);yy=s(Gu,"A notebook on how to "),Ta=r(Gu,"A",{href:!0,rel:!0});var t0=i(Ta);by=s(t0,"finetune T5 for question answering with TensorFlow 2"),t0.forEach(t),vy=s(Gu,". \u{1F30E}"),Gu.forEach(t),ky=p(Iu),ya=r(Iu,"LI",{});var Zu=i(ya);wy=s(Zu,"A notebook on how to "),ba=r(Zu,"A",{href:!0,rel:!0});var o0=i(ba);My=s(o0,"finetune T5 for question answering on a TPU"),o0.forEach(t),Ey=s(Zu,"."),Zu.forEach(t),Iu.forEach(t),Vh=p(o),va=r(o,"P",{});var sM=i(va);jy=s(sM,"\u{1F680} "),gc=r(sM,"STRONG",{});var n0=i(gc);zy=s(n0,"Deploy"),n0.forEach(t),sM.forEach(t),Xh=p(o),ol=r(o,"UL",{});var s0=i(ol);ka=r(s0,"LI",{});var Wu=i(ka);$y=s(Wu,"A blog post on how to deploy "),wa=r(Wu,"A",{href:!0,rel:!0});var a0=i(wa);Fy=s(a0,"T5 11B for inference for less than $500"),a0.forEach(t),xy=s(Wu,"."),Wu.forEach(t),s0.forEach(t),Sh=p(o),mo=r(o,"H2",{class:!0});var Bu=i(mo);an=r(Bu,"A",{id:!0,class:!0,href:!0});var r0=i(an);_c=r(r0,"SPAN",{});var i0=i(_c);v(Ma.$$.fragment,i0),i0.forEach(t),r0.forEach(t),Uy=p(Bu),Tc=r(Bu,"SPAN",{});var l0=i(Tc);Jy=s(l0,"T5Config"),l0.forEach(t),Bu.forEach(t),Ph=p(o),Pt=r(o,"DIV",{class:!0});var Cl=i(Pt);v(Ea.$$.fragment,Cl),Cy=p(Cl),Dt=r(Cl,"P",{});var ts=i(Dt);qy=s(ts,"This is the configuration class to store the configuration of a "),nl=r(ts,"A",{href:!0});var d0=i(nl);Iy=s(d0,"T5Model"),d0.forEach(t),Gy=s(ts," or a "),sl=r(ts,"A",{href:!0});var c0=i(sl);Zy=s(c0,"TFT5Model"),c0.forEach(t),Wy=s(ts,`. It is used to
instantiate a T5 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 T5
`),ja=r(ts,"A",{href:!0,rel:!0});var p0=i(ja);By=s(p0,"t5-small"),p0.forEach(t),Ry=s(ts," architecture."),ts.forEach(t),Ny=p(Cl),fo=r(Cl,"P",{});var ql=i(fo);Ay=s(ql,"Configuration objects inherit from "),al=r(ql,"A",{href:!0});var h0=i(al);Vy=s(h0,"PretrainedConfig"),h0.forEach(t),Xy=s(ql,` and can be used to control the model outputs. Read the
documentation from `),rl=r(ql,"A",{href:!0});var u0=i(rl);Sy=s(u0,"PretrainedConfig"),u0.forEach(t),Py=s(ql," for more information."),ql.forEach(t),Cl.forEach(t),Dh=p(o),go=r(o,"H2",{class:!0});var Ru=i(go);rn=r(Ru,"A",{id:!0,class:!0,href:!0});var m0=i(rn);yc=r(m0,"SPAN",{});var f0=i(yc);v(za.$$.fragment,f0),f0.forEach(t),m0.forEach(t),Dy=p(Ru),bc=r(Ru,"SPAN",{});var g0=i(bc);Ly=s(g0,"T5Tokenizer"),g0.forEach(t),Ru.forEach(t),Lh=p(o),me=r(o,"DIV",{class:!0});var ut=i(me);v($a.$$.fragment,ut),Hy=p(ut),Fa=r(ut,"P",{});var Nu=i(Fa);Oy=s(Nu,"Construct a T5 tokenizer. Based on "),xa=r(Nu,"A",{href:!0,rel:!0});var _0=i(xa);Qy=s(_0,"SentencePiece"),_0.forEach(t),Yy=s(Nu,"."),Nu.forEach(t),Ky=p(ut),Ua=r(ut,"P",{});var Au=i(Ua);eb=s(Au,"This tokenizer inherits from "),il=r(Au,"A",{href:!0});var T0=i(il);tb=s(T0,"PreTrainedTokenizer"),T0.forEach(t),ob=s(Au,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Au.forEach(t),nb=p(ut),oo=r(ut,"DIV",{class:!0});var Il=i(oo);v(Ja.$$.fragment,Il),sb=p(Il),vc=r(Il,"P",{});var y0=i(vc);ab=s(y0,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A sequence has the following format:`),y0.forEach(t),rb=p(Il),Ca=r(Il,"UL",{});var Vu=i(Ca);ll=r(Vu,"LI",{});var aM=i(ll);ib=s(aM,"single sequence: "),kc=r(aM,"CODE",{});var b0=i(kc);lb=s(b0,"X </s>"),b0.forEach(t),aM.forEach(t),db=p(Vu),dl=r(Vu,"LI",{});var rM=i(dl);cb=s(rM,"pair of sequences: "),wc=r(rM,"CODE",{});var v0=i(wc);pb=s(v0,"A </s> B </s>"),v0.forEach(t),rM.forEach(t),Vu.forEach(t),Il.forEach(t),hb=p(ut),ln=r(ut,"DIV",{class:!0});var Xu=i(ln);v(qa.$$.fragment,Xu),ub=p(Xu),Ia=r(Xu,"P",{});var Su=i(Ia);mb=s(Su,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Mc=r(Su,"CODE",{});var k0=i(Mc);fb=s(k0,"prepare_for_model"),k0.forEach(t),gb=s(Su," method."),Su.forEach(t),Xu.forEach(t),_b=p(ut),dn=r(ut,"DIV",{class:!0});var Pu=i(dn);v(Ga.$$.fragment,Pu),Tb=p(Pu),Ec=r(Pu,"P",{});var w0=i(Ec);yb=s(w0,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. T5 does not make
use of token type ids, therefore a list of zeros is returned.`),w0.forEach(t),Pu.forEach(t),bb=p(ut),cl=r(ut,"DIV",{class:!0});var M0=i(cl);v(Za.$$.fragment,M0),M0.forEach(t),ut.forEach(t),Hh=p(o),_o=r(o,"H2",{class:!0});var Du=i(_o);cn=r(Du,"A",{id:!0,class:!0,href:!0});var E0=i(cn);jc=r(E0,"SPAN",{});var j0=i(jc);v(Wa.$$.fragment,j0),j0.forEach(t),E0.forEach(t),vb=p(Du),zc=r(Du,"SPAN",{});var z0=i(zc);kb=s(z0,"T5TokenizerFast"),z0.forEach(t),Du.forEach(t),Oh=p(o),Ke=r(o,"DIV",{class:!0});var lo=i(Ke);v(Ba.$$.fragment,lo),wb=p(lo),To=r(lo,"P",{});var Gl=i(To);Mb=s(Gl,"Construct a \u201Cfast\u201D T5 tokenizer (backed by HuggingFace\u2019s "),$c=r(Gl,"EM",{});var $0=i($c);Eb=s($0,"tokenizers"),$0.forEach(t),jb=s(Gl,` library). Based on
`),Ra=r(Gl,"A",{href:!0,rel:!0});var F0=i(Ra);zb=s(F0,"Unigram"),F0.forEach(t),$b=s(Gl,"."),Gl.forEach(t),Fb=p(lo),Na=r(lo,"P",{});var Lu=i(Na);xb=s(Lu,"This tokenizer inherits from "),pl=r(Lu,"A",{href:!0});var x0=i(pl);Ub=s(x0,"PreTrainedTokenizerFast"),x0.forEach(t),Jb=s(Lu,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Lu.forEach(t),Cb=p(lo),no=r(lo,"DIV",{class:!0});var Zl=i(no);v(Aa.$$.fragment,Zl),qb=p(Zl),Fc=r(Zl,"P",{});var U0=i(Fc);Ib=s(U0,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A sequence has the following format:`),U0.forEach(t),Gb=p(Zl),Va=r(Zl,"UL",{});var Hu=i(Va);hl=r(Hu,"LI",{});var iM=i(hl);Zb=s(iM,"single sequence: "),xc=r(iM,"CODE",{});var J0=i(xc);Wb=s(J0,"X </s>"),J0.forEach(t),iM.forEach(t),Bb=p(Hu),ul=r(Hu,"LI",{});var lM=i(ul);Rb=s(lM,"pair of sequences: "),Uc=r(lM,"CODE",{});var C0=i(Uc);Nb=s(C0,"A </s> B </s>"),C0.forEach(t),lM.forEach(t),Hu.forEach(t),Zl.forEach(t),Ab=p(lo),pn=r(lo,"DIV",{class:!0});var Ou=i(pn);v(Xa.$$.fragment,Ou),Vb=p(Ou),Jc=r(Ou,"P",{});var q0=i(Jc);Xb=s(q0,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. T5 does not make
use of token type ids, therefore a list of zeros is returned.`),q0.forEach(t),Ou.forEach(t),lo.forEach(t),Qh=p(o),yo=r(o,"H2",{class:!0});var Qu=i(yo);hn=r(Qu,"A",{id:!0,class:!0,href:!0});var I0=i(hn);Cc=r(I0,"SPAN",{});var G0=i(Cc);v(Sa.$$.fragment,G0),G0.forEach(t),I0.forEach(t),Sb=p(Qu),qc=r(Qu,"SPAN",{});var Z0=i(qc);Pb=s(Z0,"T5Model"),Z0.forEach(t),Qu.forEach(t),Yh=p(o),Ce=r(o,"DIV",{class:!0});var Rt=i(Ce);v(Pa.$$.fragment,Rt),Db=p(Rt),Ic=r(Rt,"P",{});var W0=i(Ic);Lb=s(W0,"The bare T5 Model transformer outputting raw hidden-states without any specific head on top."),W0.forEach(t),Hb=p(Rt),Da=r(Rt,"P",{});var Yu=i(Da);Ob=s(Yu,"The T5 model was proposed in "),La=r(Yu,"A",{href:!0,rel:!0});var B0=i(La);Qb=s(B0,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),B0.forEach(t),Yb=s(Yu,` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),Yu.forEach(t),Kb=p(Rt),Ha=r(Rt,"P",{});var Ku=i(Ha);ev=s(Ku,"This model inherits from "),ml=r(Ku,"A",{href:!0});var R0=i(ml);tv=s(R0,"PreTrainedModel"),R0.forEach(t),ov=s(Ku,`. 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.)`),Ku.forEach(t),nv=p(Rt),Oa=r(Rt,"P",{});var em=i(Oa);sv=s(em,"This model is also a PyTorch "),Qa=r(em,"A",{href:!0,rel:!0});var N0=i(Qa);av=s(N0,"torch.nn.Module"),N0.forEach(t),rv=s(em,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),em.forEach(t),iv=p(Rt),Jt=r(Rt,"DIV",{class:!0});var os=i(Jt);v(Ya.$$.fragment,os),lv=p(os),bo=r(os,"P",{});var Wl=i(bo);dv=s(Wl,"The "),fl=r(Wl,"A",{href:!0});var A0=i(fl);cv=s(A0,"T5Model"),A0.forEach(t),pv=s(Wl," forward method, overrides the "),Gc=r(Wl,"CODE",{});var V0=i(Gc);hv=s(V0,"__call__"),V0.forEach(t),uv=s(Wl," special method."),Wl.forEach(t),mv=p(os),v(un.$$.fragment,os),fv=p(os),v(mn.$$.fragment,os),os.forEach(t),Rt.forEach(t),Kh=p(o),vo=r(o,"H2",{class:!0});var tm=i(vo);fn=r(tm,"A",{id:!0,class:!0,href:!0});var X0=i(fn);Zc=r(X0,"SPAN",{});var S0=i(Zc);v(Ka.$$.fragment,S0),S0.forEach(t),X0.forEach(t),gv=p(tm),Wc=r(tm,"SPAN",{});var P0=i(Wc);_v=s(P0,"T5ForConditionalGeneration"),P0.forEach(t),tm.forEach(t),eu=p(o),qe=r(o,"DIV",{class:!0});var Nt=i(qe);v(er.$$.fragment,Nt),Tv=p(Nt),tr=r(Nt,"P",{});var om=i(tr);yv=s(om,"T5 Model with a "),Bc=r(om,"CODE",{});var D0=i(Bc);bv=s(D0,"language modeling"),D0.forEach(t),vv=s(om," head on top."),om.forEach(t),kv=p(Nt),or=r(Nt,"P",{});var nm=i(or);wv=s(nm,"The T5 model was proposed in "),nr=r(nm,"A",{href:!0,rel:!0});var L0=i(nr);Mv=s(L0,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),L0.forEach(t),Ev=s(nm,` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),nm.forEach(t),jv=p(Nt),sr=r(Nt,"P",{});var sm=i(sr);zv=s(sm,"This model inherits from "),gl=r(sm,"A",{href:!0});var H0=i(gl);$v=s(H0,"PreTrainedModel"),H0.forEach(t),Fv=s(sm,`. 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.)`),sm.forEach(t),xv=p(Nt),ar=r(Nt,"P",{});var am=i(ar);Uv=s(am,"This model is also a PyTorch "),rr=r(am,"A",{href:!0,rel:!0});var O0=i(rr);Jv=s(O0,"torch.nn.Module"),O0.forEach(t),Cv=s(am,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),am.forEach(t),qv=p(Nt),Ct=r(Nt,"DIV",{class:!0});var ns=i(Ct);v(ir.$$.fragment,ns),Iv=p(ns),ko=r(ns,"P",{});var Bl=i(ko);Gv=s(Bl,"The "),_l=r(Bl,"A",{href:!0});var Q0=i(_l);Zv=s(Q0,"T5ForConditionalGeneration"),Q0.forEach(t),Wv=s(Bl," forward method, overrides the "),Rc=r(Bl,"CODE",{});var Y0=i(Rc);Bv=s(Y0,"__call__"),Y0.forEach(t),Rv=s(Bl," special method."),Bl.forEach(t),Nv=p(ns),v(gn.$$.fragment,ns),Av=p(ns),v(_n.$$.fragment,ns),ns.forEach(t),Nt.forEach(t),tu=p(o),wo=r(o,"H2",{class:!0});var rm=i(wo);Tn=r(rm,"A",{id:!0,class:!0,href:!0});var K0=i(Tn);Nc=r(K0,"SPAN",{});var eE=i(Nc);v(lr.$$.fragment,eE),eE.forEach(t),K0.forEach(t),Vv=p(rm),Ac=r(rm,"SPAN",{});var tE=i(Ac);Xv=s(tE,"T5EncoderModel"),tE.forEach(t),rm.forEach(t),ou=p(o),Ie=r(o,"DIV",{class:!0});var At=i(Ie);v(dr.$$.fragment,At),Sv=p(At),Vc=r(At,"P",{});var oE=i(Vc);Pv=s(oE,"The bare T5 Model transformer outputting encoder\u2019s raw hidden-states without any specific head on top."),oE.forEach(t),Dv=p(At),cr=r(At,"P",{});var im=i(cr);Lv=s(im,"The T5 model was proposed in "),pr=r(im,"A",{href:!0,rel:!0});var nE=i(pr);Hv=s(nE,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),nE.forEach(t),Ov=s(im,` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),im.forEach(t),Qv=p(At),hr=r(At,"P",{});var lm=i(hr);Yv=s(lm,"This model inherits from "),Tl=r(lm,"A",{href:!0});var sE=i(Tl);Kv=s(sE,"PreTrainedModel"),sE.forEach(t),ek=s(lm,`. 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.)`),lm.forEach(t),tk=p(At),ur=r(At,"P",{});var dm=i(ur);ok=s(dm,"This model is also a PyTorch "),mr=r(dm,"A",{href:!0,rel:!0});var aE=i(mr);nk=s(aE,"torch.nn.Module"),aE.forEach(t),sk=s(dm,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dm.forEach(t),ak=p(At),qt=r(At,"DIV",{class:!0});var ss=i(qt);v(fr.$$.fragment,ss),rk=p(ss),Mo=r(ss,"P",{});var Rl=i(Mo);ik=s(Rl,"The "),yl=r(Rl,"A",{href:!0});var rE=i(yl);lk=s(rE,"T5EncoderModel"),rE.forEach(t),dk=s(Rl," forward method, overrides the "),Xc=r(Rl,"CODE",{});var iE=i(Xc);ck=s(iE,"__call__"),iE.forEach(t),pk=s(Rl," special method."),Rl.forEach(t),hk=p(ss),v(yn.$$.fragment,ss),uk=p(ss),v(bn.$$.fragment,ss),ss.forEach(t),At.forEach(t),nu=p(o),Eo=r(o,"H2",{class:!0});var cm=i(Eo);vn=r(cm,"A",{id:!0,class:!0,href:!0});var lE=i(vn);Sc=r(lE,"SPAN",{});var dE=i(Sc);v(gr.$$.fragment,dE),dE.forEach(t),lE.forEach(t),mk=p(cm),Pc=r(cm,"SPAN",{});var cE=i(Pc);fk=s(cE,"T5ForQuestionAnswering"),cE.forEach(t),cm.forEach(t),su=p(o),Ge=r(o,"DIV",{class:!0});var Vt=i(Ge);v(_r.$$.fragment,Vt),gk=p(Vt),jo=r(Vt,"P",{});var Nl=i(jo);_k=s(Nl,`T5 Model with a span classification head on top for extractive question-answering tasks like SQuAD (linear layers
on top of the hidden-states output to compute `),Dc=r(Nl,"CODE",{});var pE=i(Dc);Tk=s(pE,"span start logits"),pE.forEach(t),yk=s(Nl," and "),Lc=r(Nl,"CODE",{});var hE=i(Lc);bk=s(hE,"span end logits"),hE.forEach(t),vk=s(Nl,")."),Nl.forEach(t),kk=p(Vt),Tr=r(Vt,"P",{});var pm=i(Tr);wk=s(pm,"The T5 model was proposed in "),yr=r(pm,"A",{href:!0,rel:!0});var uE=i(yr);Mk=s(uE,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),uE.forEach(t),Ek=s(pm,` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),pm.forEach(t),jk=p(Vt),br=r(Vt,"P",{});var hm=i(br);zk=s(hm,"This model inherits from "),bl=r(hm,"A",{href:!0});var mE=i(bl);$k=s(mE,"PreTrainedModel"),mE.forEach(t),Fk=s(hm,`. 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.)`),hm.forEach(t),xk=p(Vt),vr=r(Vt,"P",{});var um=i(vr);Uk=s(um,"This model is also a PyTorch "),kr=r(um,"A",{href:!0,rel:!0});var fE=i(kr);Jk=s(fE,"torch.nn.Module"),fE.forEach(t),Ck=s(um,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),um.forEach(t),qk=p(Vt),so=r(Vt,"DIV",{class:!0});var Al=i(so);v(wr.$$.fragment,Al),Ik=p(Al),zo=r(Al,"P",{});var Vl=i(zo);Gk=s(Vl,"The "),vl=r(Vl,"A",{href:!0});var gE=i(vl);Zk=s(gE,"T5ForQuestionAnswering"),gE.forEach(t),Wk=s(Vl," forward method, overrides the "),Hc=r(Vl,"CODE",{});var _E=i(Hc);Bk=s(_E,"__call__"),_E.forEach(t),Rk=s(Vl," special method."),Vl.forEach(t),Nk=p(Al),v(kn.$$.fragment,Al),Al.forEach(t),Vt.forEach(t),au=p(o),$o=r(o,"H2",{class:!0});var mm=i($o);wn=r(mm,"A",{id:!0,class:!0,href:!0});var TE=i(wn);Oc=r(TE,"SPAN",{});var yE=i(Oc);v(Mr.$$.fragment,yE),yE.forEach(t),TE.forEach(t),Ak=p(mm),Qc=r(mm,"SPAN",{});var bE=i(Qc);Vk=s(bE,"TFT5Model"),bE.forEach(t),mm.forEach(t),ru=p(o),fe=r(o,"DIV",{class:!0});var mt=i(fe);v(Er.$$.fragment,mt),Xk=p(mt),Yc=r(mt,"P",{});var vE=i(Yc);Sk=s(vE,"The bare T5 Model transformer outputting raw hidden-stateswithout any specific head on top."),vE.forEach(t),Pk=p(mt),jr=r(mt,"P",{});var fm=i(jr);Dk=s(fm,"The T5 model was proposed in "),zr=r(fm,"A",{href:!0,rel:!0});var kE=i(zr);Lk=s(kE,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),kE.forEach(t),Hk=s(fm,` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),fm.forEach(t),Ok=p(mt),$r=r(mt,"P",{});var gm=i($r);Qk=s(gm,"This model inherits from "),kl=r(gm,"A",{href:!0});var wE=i(kl);Yk=s(wE,"TFPreTrainedModel"),wE.forEach(t),Kk=s(gm,`. 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.)`),gm.forEach(t),ew=p(mt),Fr=r(mt,"P",{});var _m=i(Fr);tw=s(_m,"This model is also a "),xr=r(_m,"A",{href:!0,rel:!0});var ME=i(xr);ow=s(ME,"tf.keras.Model"),ME.forEach(t),nw=s(_m,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),_m.forEach(t),sw=p(mt),v(Mn.$$.fragment,mt),aw=p(mt),It=r(mt,"DIV",{class:!0});var as=i(It);v(Ur.$$.fragment,as),rw=p(as),Fo=r(as,"P",{});var Xl=i(Fo);iw=s(Xl,"The "),wl=r(Xl,"A",{href:!0});var EE=i(wl);lw=s(EE,"TFT5Model"),EE.forEach(t),dw=s(Xl," forward method, overrides the "),Kc=r(Xl,"CODE",{});var jE=i(Kc);cw=s(jE,"__call__"),jE.forEach(t),pw=s(Xl," special method."),Xl.forEach(t),hw=p(as),v(En.$$.fragment,as),uw=p(as),v(jn.$$.fragment,as),as.forEach(t),mt.forEach(t),iu=p(o),xo=r(o,"H2",{class:!0});var Tm=i(xo);zn=r(Tm,"A",{id:!0,class:!0,href:!0});var zE=i(zn);ep=r(zE,"SPAN",{});var $E=i(ep);v(Jr.$$.fragment,$E),$E.forEach(t),zE.forEach(t),mw=p(Tm),tp=r(Tm,"SPAN",{});var FE=i(tp);fw=s(FE,"TFT5ForConditionalGeneration"),FE.forEach(t),Tm.forEach(t),lu=p(o),ge=r(o,"DIV",{class:!0});var ft=i(ge);v(Cr.$$.fragment,ft),gw=p(ft),qr=r(ft,"P",{});var ym=i(qr);_w=s(ym,"T5 Model with a "),op=r(ym,"CODE",{});var xE=i(op);Tw=s(xE,"language modeling"),xE.forEach(t),yw=s(ym," head on top."),ym.forEach(t),bw=p(ft),Ir=r(ft,"P",{});var bm=i(Ir);vw=s(bm,"The T5 model was proposed in "),Gr=r(bm,"A",{href:!0,rel:!0});var UE=i(Gr);kw=s(UE,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),UE.forEach(t),ww=s(bm,` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),bm.forEach(t),Mw=p(ft),Zr=r(ft,"P",{});var vm=i(Zr);Ew=s(vm,"This model inherits from "),Ml=r(vm,"A",{href:!0});var JE=i(Ml);jw=s(JE,"TFPreTrainedModel"),JE.forEach(t),zw=s(vm,`. 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.)`),vm.forEach(t),$w=p(ft),Wr=r(ft,"P",{});var km=i(Wr);Fw=s(km,"This model is also a "),Br=r(km,"A",{href:!0,rel:!0});var CE=i(Br);xw=s(CE,"tf.keras.Model"),CE.forEach(t),Uw=s(km,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),km.forEach(t),Jw=p(ft),v($n.$$.fragment,ft),Cw=p(ft),Gt=r(ft,"DIV",{class:!0});var rs=i(Gt);v(Rr.$$.fragment,rs),qw=p(rs),Uo=r(rs,"P",{});var Sl=i(Uo);Iw=s(Sl,"The "),El=r(Sl,"A",{href:!0});var qE=i(El);Gw=s(qE,"TFT5ForConditionalGeneration"),qE.forEach(t),Zw=s(Sl," forward method, overrides the "),np=r(Sl,"CODE",{});var IE=i(np);Ww=s(IE,"__call__"),IE.forEach(t),Bw=s(Sl," special method."),Sl.forEach(t),Rw=p(rs),v(Fn.$$.fragment,rs),Nw=p(rs),v(xn.$$.fragment,rs),rs.forEach(t),ft.forEach(t),du=p(o),Jo=r(o,"H2",{class:!0});var wm=i(Jo);Un=r(wm,"A",{id:!0,class:!0,href:!0});var GE=i(Un);sp=r(GE,"SPAN",{});var ZE=i(sp);v(Nr.$$.fragment,ZE),ZE.forEach(t),GE.forEach(t),Aw=p(wm),ap=r(wm,"SPAN",{});var WE=i(ap);Vw=s(WE,"TFT5EncoderModel"),WE.forEach(t),wm.forEach(t),cu=p(o),_e=r(o,"DIV",{class:!0});var gt=i(_e);v(Ar.$$.fragment,gt),Xw=p(gt),rp=r(gt,"P",{});var BE=i(rp);Sw=s(BE,"The bare T5 Model transformer outputting encoder\u2019s raw hidden-stateswithout any specific head on top."),BE.forEach(t),Pw=p(gt),Vr=r(gt,"P",{});var Mm=i(Vr);Dw=s(Mm,"The T5 model was proposed in "),Xr=r(Mm,"A",{href:!0,rel:!0});var RE=i(Xr);Lw=s(RE,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),RE.forEach(t),Hw=s(Mm,` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),Mm.forEach(t),Ow=p(gt),Sr=r(gt,"P",{});var Em=i(Sr);Qw=s(Em,"This model inherits from "),jl=r(Em,"A",{href:!0});var NE=i(jl);Yw=s(NE,"TFPreTrainedModel"),NE.forEach(t),Kw=s(Em,`. 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.)`),Em.forEach(t),e1=p(gt),Pr=r(gt,"P",{});var jm=i(Pr);t1=s(jm,"This model is also a "),Dr=r(jm,"A",{href:!0,rel:!0});var AE=i(Dr);o1=s(AE,"tf.keras.Model"),AE.forEach(t),n1=s(jm,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),jm.forEach(t),s1=p(gt),v(Jn.$$.fragment,gt),a1=p(gt),Zt=r(gt,"DIV",{class:!0});var is=i(Zt);v(Lr.$$.fragment,is),r1=p(is),Co=r(is,"P",{});var Pl=i(Co);i1=s(Pl,"The "),zl=r(Pl,"A",{href:!0});var VE=i(zl);l1=s(VE,"TFT5EncoderModel"),VE.forEach(t),d1=s(Pl," forward method, overrides the "),ip=r(Pl,"CODE",{});var XE=i(ip);c1=s(XE,"__call__"),XE.forEach(t),p1=s(Pl," special method."),Pl.forEach(t),h1=p(is),v(Cn.$$.fragment,is),u1=p(is),v(qn.$$.fragment,is),is.forEach(t),gt.forEach(t),pu=p(o),qo=r(o,"H2",{class:!0});var zm=i(qo);In=r(zm,"A",{id:!0,class:!0,href:!0});var SE=i(In);lp=r(SE,"SPAN",{});var PE=i(lp);v(Hr.$$.fragment,PE),PE.forEach(t),SE.forEach(t),m1=p(zm),dp=r(zm,"SPAN",{});var DE=i(dp);f1=s(DE,"FlaxT5Model"),DE.forEach(t),zm.forEach(t),hu=p(o),_t=r(o,"DIV",{class:!0});var ls=i(_t);v(Or.$$.fragment,ls),g1=p(ls),Wt=r(ls,"DIV",{class:!0});var ds=i(Wt);v(Qr.$$.fragment,ds),_1=p(ds),Io=r(ds,"P",{});var Dl=i(Io);T1=s(Dl,"The "),cp=r(Dl,"CODE",{});var LE=i(cp);y1=s(LE,"FlaxT5PreTrainedModel"),LE.forEach(t),b1=s(Dl," forward method, overrides the "),pp=r(Dl,"CODE",{});var HE=i(pp);v1=s(HE,"__call__"),HE.forEach(t),k1=s(Dl," special method."),Dl.forEach(t),w1=p(ds),v(Gn.$$.fragment,ds),M1=p(ds),v(Zn.$$.fragment,ds),ds.forEach(t),E1=p(ls),Wn=r(ls,"DIV",{class:!0});var $m=i(Wn);v(Yr.$$.fragment,$m),j1=p($m),v(Bn.$$.fragment,$m),$m.forEach(t),z1=p(ls),Rn=r(ls,"DIV",{class:!0});var Fm=i(Rn);v(Kr.$$.fragment,Fm),$1=p(Fm),v(Nn.$$.fragment,Fm),Fm.forEach(t),ls.forEach(t),uu=p(o),Go=r(o,"H2",{class:!0});var xm=i(Go);An=r(xm,"A",{id:!0,class:!0,href:!0});var OE=i(An);hp=r(OE,"SPAN",{});var QE=i(hp);v(ei.$$.fragment,QE),QE.forEach(t),OE.forEach(t),F1=p(xm),up=r(xm,"SPAN",{});var YE=i(up);x1=s(YE,"FlaxT5ForConditionalGeneration"),YE.forEach(t),xm.forEach(t),mu=p(o),Tt=r(o,"DIV",{class:!0});var cs=i(Tt);v(ti.$$.fragment,cs),U1=p(cs),Bt=r(cs,"DIV",{class:!0});var ps=i(Bt);v(oi.$$.fragment,ps),J1=p(ps),Zo=r(ps,"P",{});var Ll=i(Zo);C1=s(Ll,"The "),mp=r(Ll,"CODE",{});var KE=i(mp);q1=s(KE,"FlaxT5PreTrainedModel"),KE.forEach(t),I1=s(Ll," forward method, overrides the "),fp=r(Ll,"CODE",{});var ej=i(fp);G1=s(ej,"__call__"),ej.forEach(t),Z1=s(Ll," special method."),Ll.forEach(t),W1=p(ps),v(Vn.$$.fragment,ps),B1=p(ps),v(Xn.$$.fragment,ps),ps.forEach(t),R1=p(cs),Sn=r(cs,"DIV",{class:!0});var Um=i(Sn);v(ni.$$.fragment,Um),N1=p(Um),v(Pn.$$.fragment,Um),Um.forEach(t),A1=p(cs),Dn=r(cs,"DIV",{class:!0});var Jm=i(Dn);v(si.$$.fragment,Jm),V1=p(Jm),v(Ln.$$.fragment,Jm),Jm.forEach(t),cs.forEach(t),fu=p(o),Wo=r(o,"H2",{class:!0});var Cm=i(Wo);Hn=r(Cm,"A",{id:!0,class:!0,href:!0});var tj=i(Hn);gp=r(tj,"SPAN",{});var oj=i(gp);v(ai.$$.fragment,oj),oj.forEach(t),tj.forEach(t),X1=p(Cm),_p=r(Cm,"SPAN",{});var nj=i(_p);S1=s(nj,"FlaxT5EncoderModel"),nj.forEach(t),Cm.forEach(t),gu=p(o),Bo=r(o,"DIV",{class:!0});var qm=i(Bo);v(ri.$$.fragment,qm),P1=p(qm),ao=r(qm,"DIV",{class:!0});var Hl=i(ao);v(ii.$$.fragment,Hl),D1=p(Hl),Ro=r(Hl,"P",{});var Ol=i(Ro);L1=s(Ol,"The "),$l=r(Ol,"A",{href:!0});var sj=i($l);H1=s(sj,"FlaxT5EncoderModel"),sj.forEach(t),O1=s(Ol," forward method, overrides the "),Tp=r(Ol,"CODE",{});var aj=i(Tp);Q1=s(aj,"__call__"),aj.forEach(t),Y1=s(Ol," special method."),Ol.forEach(t),K1=p(Hl),v(On.$$.fragment,Hl),Hl.forEach(t),qm.forEach(t),this.h()},h(){l(m,"name","hf:doc:metadata"),l(m,"content",JSON.stringify(Zj)),l(g,"id","t5"),l(g,"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"),l(g,"href","#t5"),l(_,"class","relative group"),l(H,"alt","Models"),dM(H.src,$="https://img.shields.io/badge/All_model_pages-t5-blueviolet")||l(H,"src",$),l(ye,"href","https://huggingface.co/models?filter=t5"),l(be,"alt","Spaces"),dM(be.src,et="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(be,"src",et),l(V,"href","https://huggingface.co/spaces/docs-demos/t5-base"),l(ke,"alt","Paper page"),dM(ke.src,ne="https://img.shields.io/badge/Paper%20page-1910.10683-green")||l(ke,"src",ne),l(ve,"href","https://huggingface.co/papers/1910.10683"),l(Z,"class","flex flex-wrap space-x-1"),l(B,"id","overview"),l(B,"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"),l(B,"href","#overview"),l(Q,"class","relative group"),l(ce,"href","https://arxiv.org/pdf/1910.10683.pdf"),l(ce,"rel","nofollow"),l(pe,"href","https://huggingface.co/craffel"),l(pe,"rel","nofollow"),l(he,"href","https://huggingface.co/adarob"),l(he,"rel","nofollow"),l(N,"href","https://huggingface.co/peterjliu"),l(N,"rel","nofollow"),l(fi,"href","#training"),l(gi,"href","#inference"),l(_i,"href","#scripts"),l(hs,"href","https://huggingface.co/t5-small"),l(hs,"rel","nofollow"),l(us,"href","https://huggingface.co/t5-base"),l(us,"rel","nofollow"),l(ms,"href","https://huggingface.co/t5-large"),l(ms,"rel","nofollow"),l(fs,"href","https://huggingface.co/t5-3b"),l(fs,"rel","nofollow"),l(gs,"href","https://huggingface.co/t5-11b"),l(gs,"rel","nofollow"),l(vi,"href","t5v1.1"),l(ki,"href","mt5"),l(wi,"href","byt5"),l(ji,"href","umt5"),l(_s,"href","https://huggingface.co/models?search=t5"),l(_s,"rel","nofollow"),l(Ts,"href","https://huggingface.co/thomwolf"),l(Ts,"rel","nofollow"),l(ys,"href","https://github.com/google-research/text-to-text-transfer-transformer"),l(ys,"rel","nofollow"),l(zi,"id","training"),l(Ho,"id","training"),l(Ho,"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"),l(Ho,"href","#training"),l(co,"class","relative group"),l($i,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5ForConditionalGeneration"),l(xi,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Tokenizer"),l(ks,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling"),l(ks,"rel","nofollow"),l(Ms,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/summarization"),l(Ms,"rel","nofollow"),l(zs,"href","https://discuss.huggingface.co/t/t5-finetuning-tips/684"),l(zs,"rel","nofollow"),l($s,"href","https://arxiv.org/pdf/1910.10683.pdf"),l($s,"rel","nofollow"),l(Gi,"id","inference"),l(Ko,"id","inference"),l(Ko,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ko,"href","#inference"),l(po,"class","relative group"),l(Zi,"href","/docs/transformers/v4.31.0/en/main_classes/text_generation#transformers.GenerationMixin.generate"),l(xs,"href","https://huggingface.co/blog/how-to-generate"),l(xs,"rel","nofollow"),l(Us,"href","https://huggingface.co/blog/encoder-decoder#encoder-decoder"),l(Us,"rel","nofollow"),l(Wi,"href","/docs/transformers/v4.31.0/en/main_classes/text_generation#transformers.GenerationMixin.generate"),l(Ni,"id","scripts"),l(en,"id","performance"),l(en,"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"),l(en,"href","#performance"),l(ho,"class","relative group"),l(Gs,"href","https://github.com/NVIDIA/apex#quick-start"),l(Gs,"rel","nofollow"),l(tn,"id","resources"),l(tn,"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"),l(tn,"href","#resources"),l(uo,"class","relative group"),l(Rs,"href","https://colab.research.google.com/github/patil-suraj/exploring-T5/blob/master/t5_fine_tuning.ipynb"),l(Rs,"rel","nofollow"),l(As,"href","https://colab.research.google.com/github/enzoampil/t5-intro/blob/master/t5_qa_training_pytorch_span_extraction.ipynb"),l(As,"rel","nofollow"),l(Ss,"href","https://colab.research.google.com/drive/1obr78FY_cBmWY5ODViCmzdY6O1KB65Vc?usp=sharing"),l(Ss,"rel","nofollow"),l(Ls,"href","https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/T5/Fine_tune_CodeT5_for_generating_docstrings_from_Ruby_code.ipynb"),l(Ls,"rel","nofollow"),l(Qs,"href","https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/T5/Fine_tuning_Dutch_T5_base_on_CNN_Daily_Mail_for_summarization_(on_TPU_using_HuggingFace_Accelerate).ipynb"),l(Qs,"rel","nofollow"),l(Ks,"href","https://colab.research.google.com/github/abhimishra91/transformers-tutorials/blob/master/transformers_summarization_wandb.ipynb#scrollTo=OKRpFvYhBauC"),l(Ks,"rel","nofollow"),l(ta,"href","https://huggingface.co/blog/sagemaker-distributed-training-seq2seq"),l(ta,"rel","nofollow"),l(Si,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5ForConditionalGeneration"),l(oa,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization"),l(oa,"rel","nofollow"),l(na,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization.ipynb"),l(na,"rel","nofollow"),l(Pi,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.TFT5ForConditionalGeneration"),l(sa,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/summarization"),l(sa,"rel","nofollow"),l(aa,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization-tf.ipynb"),l(aa,"rel","nofollow"),l(Di,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.FlaxT5ForConditionalGeneration"),l(ra,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/summarization"),l(ra,"rel","nofollow"),l(ia,"href","https://huggingface.co/course/chapter7/5?fw=pt#summarization"),l(ia,"rel","nofollow"),l(Hi,"href","../tasks/summarization"),l(Qi,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.FlaxT5ForConditionalGeneration"),l(da,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#t5-like-span-masked-language-modeling"),l(da,"rel","nofollow"),l(Yi,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.FlaxT5ForConditionalGeneration"),l(ca,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/masked_language_modeling_flax.ipynb"),l(ca,"rel","nofollow"),l(Ki,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5ForConditionalGeneration"),l(ha,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/translation"),l(ha,"rel","nofollow"),l(ua,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation.ipynb"),l(ua,"rel","nofollow"),l(el,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.TFT5ForConditionalGeneration"),l(ma,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/translation"),l(ma,"rel","nofollow"),l(fa,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation-tf.ipynb"),l(fa,"rel","nofollow"),l(tl,"href","../tasks/translation"),l(Ta,"href","https://colab.research.google.com/github/snapthat/TF-T5-text-to-text/blob/master/snapthatT5/notebooks/TF-T5-Datasets%20Training.ipynb"),l(Ta,"rel","nofollow"),l(ba,"href","https://colab.research.google.com/github/patil-suraj/exploring-T5/blob/master/T5_on_TPU.ipynb#scrollTo=QLGiFCDqvuil"),l(ba,"rel","nofollow"),l(wa,"href","https://www.philschmid.de/deploy-t5-11b"),l(wa,"rel","nofollow"),l(an,"id","transformers.T5Config"),l(an,"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"),l(an,"href","#transformers.T5Config"),l(mo,"class","relative group"),l(nl,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Model"),l(sl,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.TFT5Model"),l(ja,"href","https://huggingface.co/t5-small"),l(ja,"rel","nofollow"),l(al,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(rl,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(rn,"id","transformers.T5Tokenizer"),l(rn,"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"),l(rn,"href","#transformers.T5Tokenizer"),l(go,"class","relative group"),l(xa,"href","https://github.com/google/sentencepiece"),l(xa,"rel","nofollow"),l(il,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(oo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ln,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(cl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(cn,"id","transformers.T5TokenizerFast"),l(cn,"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"),l(cn,"href","#transformers.T5TokenizerFast"),l(_o,"class","relative group"),l(Ra,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=unigram#models"),l(Ra,"rel","nofollow"),l(pl,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(no,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(hn,"id","transformers.T5Model"),l(hn,"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"),l(hn,"href","#transformers.T5Model"),l(yo,"class","relative group"),l(La,"href","https://arxiv.org/abs/1910.10683"),l(La,"rel","nofollow"),l(ml,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(Qa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Qa,"rel","nofollow"),l(fl,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5Model"),l(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(fn,"id","transformers.T5ForConditionalGeneration"),l(fn,"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"),l(fn,"href","#transformers.T5ForConditionalGeneration"),l(vo,"class","relative group"),l(nr,"href","https://arxiv.org/abs/1910.10683"),l(nr,"rel","nofollow"),l(gl,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(rr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(rr,"rel","nofollow"),l(_l,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5ForConditionalGeneration"),l(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Tn,"id","transformers.T5EncoderModel"),l(Tn,"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"),l(Tn,"href","#transformers.T5EncoderModel"),l(wo,"class","relative group"),l(pr,"href","https://arxiv.org/abs/1910.10683"),l(pr,"rel","nofollow"),l(Tl,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(mr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(mr,"rel","nofollow"),l(yl,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5EncoderModel"),l(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(vn,"id","transformers.T5ForQuestionAnswering"),l(vn,"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"),l(vn,"href","#transformers.T5ForQuestionAnswering"),l(Eo,"class","relative group"),l(yr,"href","https://arxiv.org/abs/1910.10683"),l(yr,"rel","nofollow"),l(bl,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),l(kr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(kr,"rel","nofollow"),l(vl,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.T5ForQuestionAnswering"),l(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(wn,"id","transformers.TFT5Model"),l(wn,"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"),l(wn,"href","#transformers.TFT5Model"),l($o,"class","relative group"),l(zr,"href","https://arxiv.org/abs/1910.10683"),l(zr,"rel","nofollow"),l(kl,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),l(xr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(xr,"rel","nofollow"),l(wl,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.TFT5Model"),l(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(zn,"id","transformers.TFT5ForConditionalGeneration"),l(zn,"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"),l(zn,"href","#transformers.TFT5ForConditionalGeneration"),l(xo,"class","relative group"),l(Gr,"href","https://arxiv.org/abs/1910.10683"),l(Gr,"rel","nofollow"),l(Ml,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),l(Br,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(Br,"rel","nofollow"),l(El,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.TFT5ForConditionalGeneration"),l(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Un,"id","transformers.TFT5EncoderModel"),l(Un,"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"),l(Un,"href","#transformers.TFT5EncoderModel"),l(Jo,"class","relative group"),l(Xr,"href","https://arxiv.org/abs/1910.10683"),l(Xr,"rel","nofollow"),l(jl,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),l(Dr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(Dr,"rel","nofollow"),l(zl,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.TFT5EncoderModel"),l(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(In,"id","transformers.FlaxT5Model"),l(In,"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"),l(In,"href","#transformers.FlaxT5Model"),l(qo,"class","relative group"),l(Wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Wn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Rn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(An,"id","transformers.FlaxT5ForConditionalGeneration"),l(An,"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"),l(An,"href","#transformers.FlaxT5ForConditionalGeneration"),l(Go,"class","relative group"),l(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Sn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Hn,"id","transformers.FlaxT5EncoderModel"),l(Hn,"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"),l(Hn,"href","#transformers.FlaxT5EncoderModel"),l(Wo,"class","relative group"),l($l,"href","/docs/transformers/v4.31.0/en/model_doc/t5#transformers.FlaxT5EncoderModel"),l(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,h){e(document.head,m),u(o,y,h),u(o,_,h),e(_,g),e(g,T),k(d,T,null),e(_,f),e(_,z),e(z,Ne),u(o,Ze,h),u(o,Z,h),e(Z,ye),e(ye,H),e(Z,Ae),e(Z,V),e(V,be),e(Z,O),e(Z,ve),e(ve,ke),u(o,We,h),u(o,Q,h),e(Q,B),e(B,xe),k(le,xe,null),e(Q,Y),e(Q,Ue),e(Ue,Ve),u(o,de,h),u(o,U,h),e(U,I),e(U,ce),e(ce,K),e(U,Xe),e(U,pe),e(pe,ee),e(U,Se),e(U,he),e(he,G),e(U,Pe),e(U,N),e(N,De),e(U,Le),u(o,L,h),u(o,we,h),e(we,He),u(o,A,h),u(o,Me,h),e(Me,P),e(P,Oe),u(o,ue,h),u(o,C,h),e(C,Qe),u(o,W,h),u(o,R,h),e(R,Je),e(Je,j),e(j,x),e(j,tt),e(tt,Ee),e(j,kt),e(j,ot),e(ot,J),e(j,wt),e(R,Mt),e(R,nt),e(nt,st),e(st,Et),e(R,X),e(R,D),e(D,at),e(at,jt),e(R,te),e(R,rt),e(rt,it),e(it,Ye),e(R,zt),e(R,se),e(se,ae),e(ae,Im),e(ae,fi),e(fi,Gm),e(ae,Zm),e(ae,gi),e(gi,Wm),e(ae,Bm),e(ae,_i),e(_i,Rm),e(ae,Nm),u(o,Vp,h),u(o,Ti,h),e(Ti,Am),u(o,Xp,h),u(o,lt,h),e(lt,Ql),e(Ql,Yl),e(Yl,hs),e(hs,Vm),e(lt,Xm),e(lt,Kl),e(Kl,ed),e(ed,us),e(us,Sm),e(lt,Pm),e(lt,td),e(td,od),e(od,ms),e(ms,Dm),e(lt,Lm),e(lt,nd),e(nd,sd),e(sd,fs),e(fs,Hm),e(lt,Om),e(lt,ad),e(ad,yi),e(yi,gs),e(gs,Qm),e(yi,Ym),u(o,Sp,h),u(o,bi,h),e(bi,Km),u(o,Pp,h),u(o,je,h),e(je,rd),e(rd,Xo),e(Xo,id),e(id,ef),e(Xo,tf),e(Xo,vi),e(vi,of),e(Xo,nf),e(je,sf),e(je,ld),e(ld,So),e(So,dd),e(dd,af),e(So,rf),e(So,ki),e(ki,lf),e(So,df),e(je,cf),e(je,cd),e(cd,Po),e(Po,pd),e(pd,pf),e(Po,hf),e(Po,wi),e(wi,uf),e(Po,mf),e(je,ff),e(je,hd),e(hd,Mi),e(Mi,ud),e(ud,gf),e(Mi,_f),e(je,Tf),e(je,md),e(md,S),e(S,fd),e(fd,yf),e(S,bf),e(S,gd),e(gd,vf),e(S,kf),e(S,_d),e(_d,wf),e(S,Mf),e(S,Td),e(Td,Ef),e(S,jf),e(S,yd),e(yd,zf),e(S,$f),e(S,bd),e(bd,Ff),e(S,xf),e(S,vd),e(vd,Uf),e(S,Jf),e(S,kd),e(kd,Cf),e(S,qf),e(S,wd),e(wd,If),e(S,Gf),e(S,Md),e(Md,Zf),e(S,Wf),e(je,Bf),e(je,Ed),e(Ed,Ei),e(Ei,jd),e(jd,Rf),e(Ei,Nf),e(je,Af),e(je,zd),e(zd,Do),e(Do,$d),e($d,Vf),e(Do,Xf),e(Do,ji),e(ji,Sf),e(Do,Pf),u(o,Dp,h),u(o,Lo,h),e(Lo,Df),e(Lo,_s),e(_s,Lf),e(Lo,Hf),u(o,Lp,h),u(o,Lt,h),e(Lt,Of),e(Lt,Ts),e(Ts,Qf),e(Lt,Yf),e(Lt,ys),e(ys,Kf),e(Lt,eg),u(o,Hp,h),u(o,zi,h),u(o,Op,h),u(o,co,h),e(co,Ho),e(Ho,Fd),k(bs,Fd,null),e(co,tg),e(co,xd),e(xd,og),u(o,Qp,h),u(o,$t,h),e($t,ng),e($t,Ud),e(Ud,sg),e($t,ag),e($t,Jd),e(Jd,rg),e($t,ig),e($t,Cd),e(Cd,lg),e($t,dg),u(o,Yp,h),u(o,Oo,h),e(Oo,cg),e(Oo,$i),e($i,pg),e(Oo,hg),u(o,Kp,h),u(o,Fi,h),e(Fi,qd),e(qd,ug),u(o,eh,h),u(o,ze,h),e(ze,mg),e(ze,Id),e(Id,fg),e(ze,gg),e(ze,Gd),e(Gd,_g),e(ze,Tg),e(ze,Zd),e(Zd,yg),e(ze,bg),e(ze,Wd),e(Wd,vg),e(ze,kg),e(ze,Bd),e(Bd,wg),e(ze,Mg),e(ze,xi),e(xi,Eg),e(ze,jg),u(o,th,h),u(o,Ui,h),e(Ui,zg),u(o,oh,h),k(vs,o,h),u(o,nh,h),u(o,Qo,h),e(Qo,$g),e(Qo,ks),e(ks,Fg),e(Qo,xg),u(o,sh,h),u(o,Ji,h),e(Ji,Rd),e(Rd,Ug),u(o,ah,h),u(o,Ci,h),e(Ci,Jg),u(o,rh,h),k(ws,o,h),u(o,ih,h),u(o,re,h),e(re,Cg),e(re,Nd),e(Nd,qg),e(re,Ig),e(re,Ad),e(Ad,Gg),e(re,Zg),e(re,Vd),e(Vd,Wg),e(re,Bg),e(re,Xd),e(Xd,Rg),e(re,Ng),e(re,Sd),e(Sd,Ag),e(re,Vg),e(re,Pd),e(Pd,Xg),e(re,Sg),e(re,Dd),e(Dd,Pg),e(re,Dg),u(o,lh,h),u(o,Ht,h),e(Ht,Lg),e(Ht,Ld),e(Ld,Hg),e(Ht,Og),e(Ht,Hd),e(Hd,Qg),e(Ht,Yg),u(o,dh,h),u(o,$e,h),e($e,Kg),e($e,Od),e(Od,e_),e($e,t_),e($e,Qd),e(Qd,o_),e($e,n_),e($e,Yd),e(Yd,s_),e($e,a_),e($e,Kd),e(Kd,r_),e($e,i_),e($e,Ms),e(Ms,l_),e($e,d_),e($e,ec),e(ec,c_),e($e,p_),u(o,ch,h),k(Es,o,h),u(o,ph,h),u(o,qi,h),e(qi,h_),u(o,hh,h),u(o,Ii,h),e(Ii,js),e(js,u_),e(js,tc),e(tc,m_),e(js,f_),u(o,uh,h),u(o,Ot,h),e(Ot,g_),e(Ot,zs),e(zs,__),e(Ot,T_),e(Ot,$s),e($s,y_),e(Ot,b_),u(o,mh,h),u(o,Yo,h),e(Yo,v_),e(Yo,oc),e(oc,k_),e(Yo,w_),u(o,fh,h),u(o,Gi,h),u(o,gh,h),u(o,po,h),e(po,Ko),e(Ko,nc),k(Fs,nc,null),e(po,M_),e(po,sc),e(sc,E_),u(o,_h,h),u(o,Ft,h),e(Ft,j_),e(Ft,Zi),e(Zi,z_),e(Ft,$_),e(Ft,xs),e(xs,F_),e(Ft,x_),e(Ft,Us),e(Us,U_),e(Ft,J_),u(o,Th,h),k(Js,o,h),u(o,yh,h),u(o,dt,h),e(dt,C_),e(dt,ac),e(ac,q_),e(dt,I_),e(dt,rc),e(rc,G_),e(dt,Z_),e(dt,Wi),e(Wi,W_),e(dt,B_),e(dt,ic),e(ic,R_),e(dt,N_),u(o,bh,h),u(o,Bi,h),e(Bi,A_),u(o,vh,h),k(Cs,o,h),u(o,kh,h),u(o,Ri,h),e(Ri,V_),u(o,wh,h),k(qs,o,h),u(o,Mh,h),u(o,Ni,h),u(o,Eh,h),u(o,ho,h),e(ho,en),e(en,lc),k(Is,lc,null),e(ho,X_),e(ho,dc),e(dc,S_),u(o,jh,h),u(o,xt,h),e(xt,P_),e(xt,Gs),e(Gs,D_),e(xt,L_),e(xt,cc),e(cc,H_),e(xt,O_),e(xt,pc),e(pc,Q_),e(xt,Y_),u(o,zh,h),u(o,uo,h),e(uo,tn),e(tn,hc),k(Zs,hc,null),e(uo,K_),e(uo,uc),e(uc,eT),u(o,$h,h),u(o,Ai,h),e(Ai,tT),u(o,Fh,h),k(Ws,o,h),u(o,xh,h),u(o,on,h),e(on,Bs),e(Bs,oT),e(Bs,Rs),e(Rs,nT),e(Bs,sT),e(on,aT),e(on,Ns),e(Ns,rT),e(Ns,As),e(As,iT),e(Ns,lT),u(o,Uh,h),k(Vs,o,h),u(o,Jh,h),u(o,Vi,h),e(Vi,Xs),e(Xs,dT),e(Xs,Ss),e(Ss,cT),e(Xs,pT),u(o,Ch,h),k(Ps,o,h),u(o,qh,h),u(o,Xi,h),e(Xi,Ds),e(Ds,hT),e(Ds,Ls),e(Ls,uT),e(Ds,mT),u(o,Ih,h),k(Hs,o,h),u(o,Gh,h),u(o,ie,h),e(ie,Os),e(Os,fT),e(Os,Qs),e(Qs,gT),e(Os,_T),e(ie,TT),e(ie,Ys),e(Ys,yT),e(Ys,Ks),e(Ks,bT),e(Ys,vT),e(ie,kT),e(ie,ea),e(ea,wT),e(ea,ta),e(ta,MT),e(ea,ET),e(ie,jT),e(ie,Qt),e(Qt,Si),e(Si,zT),e(Qt,$T),e(Qt,oa),e(oa,FT),e(Qt,xT),e(Qt,na),e(na,UT),e(Qt,JT),e(ie,CT),e(ie,Yt),e(Yt,Pi),e(Pi,qT),e(Yt,IT),e(Yt,sa),e(sa,GT),e(Yt,ZT),e(Yt,aa),e(aa,WT),e(Yt,BT),e(ie,RT),e(ie,nn),e(nn,Di),e(Di,NT),e(nn,AT),e(nn,ra),e(ra,VT),e(nn,XT),e(ie,ST),e(ie,Li),e(Li,ia),e(ia,PT),e(Li,DT),e(ie,LT),e(ie,mc),e(mc,Hi),e(Hi,HT),u(o,Zh,h),k(la,o,h),u(o,Wh,h),u(o,Oi,h),e(Oi,Ut),e(Ut,Qi),e(Qi,OT),e(Ut,QT),e(Ut,da),e(da,YT),e(Ut,KT),e(Ut,Yi),e(Yi,ey),e(Ut,ty),e(Ut,ca),e(ca,oy),e(Ut,ny),u(o,Bh,h),k(pa,o,h),u(o,Rh,h),u(o,Kt,h),e(Kt,eo),e(eo,Ki),e(Ki,sy),e(eo,ay),e(eo,ha),e(ha,ry),e(eo,iy),e(eo,ua),e(ua,ly),e(eo,dy),e(Kt,cy),e(Kt,to),e(to,el),e(el,py),e(to,hy),e(to,ma),e(ma,uy),e(to,my),e(to,fa),e(fa,fy),e(to,gy),e(Kt,_y),e(Kt,fc),e(fc,tl),e(tl,Ty),u(o,Nh,h),k(ga,o,h),u(o,Ah,h),u(o,sn,h),e(sn,_a),e(_a,yy),e(_a,Ta),e(Ta,by),e(_a,vy),e(sn,ky),e(sn,ya),e(ya,wy),e(ya,ba),e(ba,My),e(ya,Ey),u(o,Vh,h),u(o,va,h),e(va,jy),e(va,gc),e(gc,zy),u(o,Xh,h),u(o,ol,h),e(ol,ka),e(ka,$y),e(ka,wa),e(wa,Fy),e(ka,xy),u(o,Sh,h),u(o,mo,h),e(mo,an),e(an,_c),k(Ma,_c,null),e(mo,Uy),e(mo,Tc),e(Tc,Jy),u(o,Ph,h),u(o,Pt,h),k(Ea,Pt,null),e(Pt,Cy),e(Pt,Dt),e(Dt,qy),e(Dt,nl),e(nl,Iy),e(Dt,Gy),e(Dt,sl),e(sl,Zy),e(Dt,Wy),e(Dt,ja),e(ja,By),e(Dt,Ry),e(Pt,Ny),e(Pt,fo),e(fo,Ay),e(fo,al),e(al,Vy),e(fo,Xy),e(fo,rl),e(rl,Sy),e(fo,Py),u(o,Dh,h),u(o,go,h),e(go,rn),e(rn,yc),k(za,yc,null),e(go,Dy),e(go,bc),e(bc,Ly),u(o,Lh,h),u(o,me,h),k($a,me,null),e(me,Hy),e(me,Fa),e(Fa,Oy),e(Fa,xa),e(xa,Qy),e(Fa,Yy),e(me,Ky),e(me,Ua),e(Ua,eb),e(Ua,il),e(il,tb),e(Ua,ob),e(me,nb),e(me,oo),k(Ja,oo,null),e(oo,sb),e(oo,vc),e(vc,ab),e(oo,rb),e(oo,Ca),e(Ca,ll),e(ll,ib),e(ll,kc),e(kc,lb),e(Ca,db),e(Ca,dl),e(dl,cb),e(dl,wc),e(wc,pb),e(me,hb),e(me,ln),k(qa,ln,null),e(ln,ub),e(ln,Ia),e(Ia,mb),e(Ia,Mc),e(Mc,fb),e(Ia,gb),e(me,_b),e(me,dn),k(Ga,dn,null),e(dn,Tb),e(dn,Ec),e(Ec,yb),e(me,bb),e(me,cl),k(Za,cl,null),u(o,Hh,h),u(o,_o,h),e(_o,cn),e(cn,jc),k(Wa,jc,null),e(_o,vb),e(_o,zc),e(zc,kb),u(o,Oh,h),u(o,Ke,h),k(Ba,Ke,null),e(Ke,wb),e(Ke,To),e(To,Mb),e(To,$c),e($c,Eb),e(To,jb),e(To,Ra),e(Ra,zb),e(To,$b),e(Ke,Fb),e(Ke,Na),e(Na,xb),e(Na,pl),e(pl,Ub),e(Na,Jb),e(Ke,Cb),e(Ke,no),k(Aa,no,null),e(no,qb),e(no,Fc),e(Fc,Ib),e(no,Gb),e(no,Va),e(Va,hl),e(hl,Zb),e(hl,xc),e(xc,Wb),e(Va,Bb),e(Va,ul),e(ul,Rb),e(ul,Uc),e(Uc,Nb),e(Ke,Ab),e(Ke,pn),k(Xa,pn,null),e(pn,Vb),e(pn,Jc),e(Jc,Xb),u(o,Qh,h),u(o,yo,h),e(yo,hn),e(hn,Cc),k(Sa,Cc,null),e(yo,Sb),e(yo,qc),e(qc,Pb),u(o,Yh,h),u(o,Ce,h),k(Pa,Ce,null),e(Ce,Db),e(Ce,Ic),e(Ic,Lb),e(Ce,Hb),e(Ce,Da),e(Da,Ob),e(Da,La),e(La,Qb),e(Da,Yb),e(Ce,Kb),e(Ce,Ha),e(Ha,ev),e(Ha,ml),e(ml,tv),e(Ha,ov),e(Ce,nv),e(Ce,Oa),e(Oa,sv),e(Oa,Qa),e(Qa,av),e(Oa,rv),e(Ce,iv),e(Ce,Jt),k(Ya,Jt,null),e(Jt,lv),e(Jt,bo),e(bo,dv),e(bo,fl),e(fl,cv),e(bo,pv),e(bo,Gc),e(Gc,hv),e(bo,uv),e(Jt,mv),k(un,Jt,null),e(Jt,fv),k(mn,Jt,null),u(o,Kh,h),u(o,vo,h),e(vo,fn),e(fn,Zc),k(Ka,Zc,null),e(vo,gv),e(vo,Wc),e(Wc,_v),u(o,eu,h),u(o,qe,h),k(er,qe,null),e(qe,Tv),e(qe,tr),e(tr,yv),e(tr,Bc),e(Bc,bv),e(tr,vv),e(qe,kv),e(qe,or),e(or,wv),e(or,nr),e(nr,Mv),e(or,Ev),e(qe,jv),e(qe,sr),e(sr,zv),e(sr,gl),e(gl,$v),e(sr,Fv),e(qe,xv),e(qe,ar),e(ar,Uv),e(ar,rr),e(rr,Jv),e(ar,Cv),e(qe,qv),e(qe,Ct),k(ir,Ct,null),e(Ct,Iv),e(Ct,ko),e(ko,Gv),e(ko,_l),e(_l,Zv),e(ko,Wv),e(ko,Rc),e(Rc,Bv),e(ko,Rv),e(Ct,Nv),k(gn,Ct,null),e(Ct,Av),k(_n,Ct,null),u(o,tu,h),u(o,wo,h),e(wo,Tn),e(Tn,Nc),k(lr,Nc,null),e(wo,Vv),e(wo,Ac),e(Ac,Xv),u(o,ou,h),u(o,Ie,h),k(dr,Ie,null),e(Ie,Sv),e(Ie,Vc),e(Vc,Pv),e(Ie,Dv),e(Ie,cr),e(cr,Lv),e(cr,pr),e(pr,Hv),e(cr,Ov),e(Ie,Qv),e(Ie,hr),e(hr,Yv),e(hr,Tl),e(Tl,Kv),e(hr,ek),e(Ie,tk),e(Ie,ur),e(ur,ok),e(ur,mr),e(mr,nk),e(ur,sk),e(Ie,ak),e(Ie,qt),k(fr,qt,null),e(qt,rk),e(qt,Mo),e(Mo,ik),e(Mo,yl),e(yl,lk),e(Mo,dk),e(Mo,Xc),e(Xc,ck),e(Mo,pk),e(qt,hk),k(yn,qt,null),e(qt,uk),k(bn,qt,null),u(o,nu,h),u(o,Eo,h),e(Eo,vn),e(vn,Sc),k(gr,Sc,null),e(Eo,mk),e(Eo,Pc),e(Pc,fk),u(o,su,h),u(o,Ge,h),k(_r,Ge,null),e(Ge,gk),e(Ge,jo),e(jo,_k),e(jo,Dc),e(Dc,Tk),e(jo,yk),e(jo,Lc),e(Lc,bk),e(jo,vk),e(Ge,kk),e(Ge,Tr),e(Tr,wk),e(Tr,yr),e(yr,Mk),e(Tr,Ek),e(Ge,jk),e(Ge,br),e(br,zk),e(br,bl),e(bl,$k),e(br,Fk),e(Ge,xk),e(Ge,vr),e(vr,Uk),e(vr,kr),e(kr,Jk),e(vr,Ck),e(Ge,qk),e(Ge,so),k(wr,so,null),e(so,Ik),e(so,zo),e(zo,Gk),e(zo,vl),e(vl,Zk),e(zo,Wk),e(zo,Hc),e(Hc,Bk),e(zo,Rk),e(so,Nk),k(kn,so,null),u(o,au,h),u(o,$o,h),e($o,wn),e(wn,Oc),k(Mr,Oc,null),e($o,Ak),e($o,Qc),e(Qc,Vk),u(o,ru,h),u(o,fe,h),k(Er,fe,null),e(fe,Xk),e(fe,Yc),e(Yc,Sk),e(fe,Pk),e(fe,jr),e(jr,Dk),e(jr,zr),e(zr,Lk),e(jr,Hk),e(fe,Ok),e(fe,$r),e($r,Qk),e($r,kl),e(kl,Yk),e($r,Kk),e(fe,ew),e(fe,Fr),e(Fr,tw),e(Fr,xr),e(xr,ow),e(Fr,nw),e(fe,sw),k(Mn,fe,null),e(fe,aw),e(fe,It),k(Ur,It,null),e(It,rw),e(It,Fo),e(Fo,iw),e(Fo,wl),e(wl,lw),e(Fo,dw),e(Fo,Kc),e(Kc,cw),e(Fo,pw),e(It,hw),k(En,It,null),e(It,uw),k(jn,It,null),u(o,iu,h),u(o,xo,h),e(xo,zn),e(zn,ep),k(Jr,ep,null),e(xo,mw),e(xo,tp),e(tp,fw),u(o,lu,h),u(o,ge,h),k(Cr,ge,null),e(ge,gw),e(ge,qr),e(qr,_w),e(qr,op),e(op,Tw),e(qr,yw),e(ge,bw),e(ge,Ir),e(Ir,vw),e(Ir,Gr),e(Gr,kw),e(Ir,ww),e(ge,Mw),e(ge,Zr),e(Zr,Ew),e(Zr,Ml),e(Ml,jw),e(Zr,zw),e(ge,$w),e(ge,Wr),e(Wr,Fw),e(Wr,Br),e(Br,xw),e(Wr,Uw),e(ge,Jw),k($n,ge,null),e(ge,Cw),e(ge,Gt),k(Rr,Gt,null),e(Gt,qw),e(Gt,Uo),e(Uo,Iw),e(Uo,El),e(El,Gw),e(Uo,Zw),e(Uo,np),e(np,Ww),e(Uo,Bw),e(Gt,Rw),k(Fn,Gt,null),e(Gt,Nw),k(xn,Gt,null),u(o,du,h),u(o,Jo,h),e(Jo,Un),e(Un,sp),k(Nr,sp,null),e(Jo,Aw),e(Jo,ap),e(ap,Vw),u(o,cu,h),u(o,_e,h),k(Ar,_e,null),e(_e,Xw),e(_e,rp),e(rp,Sw),e(_e,Pw),e(_e,Vr),e(Vr,Dw),e(Vr,Xr),e(Xr,Lw),e(Vr,Hw),e(_e,Ow),e(_e,Sr),e(Sr,Qw),e(Sr,jl),e(jl,Yw),e(Sr,Kw),e(_e,e1),e(_e,Pr),e(Pr,t1),e(Pr,Dr),e(Dr,o1),e(Pr,n1),e(_e,s1),k(Jn,_e,null),e(_e,a1),e(_e,Zt),k(Lr,Zt,null),e(Zt,r1),e(Zt,Co),e(Co,i1),e(Co,zl),e(zl,l1),e(Co,d1),e(Co,ip),e(ip,c1),e(Co,p1),e(Zt,h1),k(Cn,Zt,null),e(Zt,u1),k(qn,Zt,null),u(o,pu,h),u(o,qo,h),e(qo,In),e(In,lp),k(Hr,lp,null),e(qo,m1),e(qo,dp),e(dp,f1),u(o,hu,h),u(o,_t,h),k(Or,_t,null),e(_t,g1),e(_t,Wt),k(Qr,Wt,null),e(Wt,_1),e(Wt,Io),e(Io,T1),e(Io,cp),e(cp,y1),e(Io,b1),e(Io,pp),e(pp,v1),e(Io,k1),e(Wt,w1),k(Gn,Wt,null),e(Wt,M1),k(Zn,Wt,null),e(_t,E1),e(_t,Wn),k(Yr,Wn,null),e(Wn,j1),k(Bn,Wn,null),e(_t,z1),e(_t,Rn),k(Kr,Rn,null),e(Rn,$1),k(Nn,Rn,null),u(o,uu,h),u(o,Go,h),e(Go,An),e(An,hp),k(ei,hp,null),e(Go,F1),e(Go,up),e(up,x1),u(o,mu,h),u(o,Tt,h),k(ti,Tt,null),e(Tt,U1),e(Tt,Bt),k(oi,Bt,null),e(Bt,J1),e(Bt,Zo),e(Zo,C1),e(Zo,mp),e(mp,q1),e(Zo,I1),e(Zo,fp),e(fp,G1),e(Zo,Z1),e(Bt,W1),k(Vn,Bt,null),e(Bt,B1),k(Xn,Bt,null),e(Tt,R1),e(Tt,Sn),k(ni,Sn,null),e(Sn,N1),k(Pn,Sn,null),e(Tt,A1),e(Tt,Dn),k(si,Dn,null),e(Dn,V1),k(Ln,Dn,null),u(o,fu,h),u(o,Wo,h),e(Wo,Hn),e(Hn,gp),k(ai,gp,null),e(Wo,X1),e(Wo,_p),e(_p,S1),u(o,gu,h),u(o,Bo,h),k(ri,Bo,null),e(Bo,P1),e(Bo,ao),k(ii,ao,null),e(ao,D1),e(ao,Ro),e(Ro,L1),e(Ro,$l),e($l,H1),e(Ro,O1),e(Ro,Tp),e(Tp,Q1),e(Ro,Y1),e(ao,K1),k(On,ao,null),_u=!0},p(o,[h]){const li={};h&2&&(li.$$scope={dirty:h,ctx:o}),un.$set(li);const yp={};h&2&&(yp.$$scope={dirty:h,ctx:o}),mn.$set(yp);const bp={};h&2&&(bp.$$scope={dirty:h,ctx:o}),gn.$set(bp);const vp={};h&2&&(vp.$$scope={dirty:h,ctx:o}),_n.$set(vp);const No={};h&2&&(No.$$scope={dirty:h,ctx:o}),yn.$set(No);const kp={};h&2&&(kp.$$scope={dirty:h,ctx:o}),bn.$set(kp);const wp={};h&2&&(wp.$$scope={dirty:h,ctx:o}),kn.$set(wp);const Mp={};h&2&&(Mp.$$scope={dirty:h,ctx:o}),Mn.$set(Mp);const di={};h&2&&(di.$$scope={dirty:h,ctx:o}),En.$set(di);const Ep={};h&2&&(Ep.$$scope={dirty:h,ctx:o}),jn.$set(Ep);const jp={};h&2&&(jp.$$scope={dirty:h,ctx:o}),$n.$set(jp);const zp={};h&2&&(zp.$$scope={dirty:h,ctx:o}),Fn.$set(zp);const yt={};h&2&&(yt.$$scope={dirty:h,ctx:o}),xn.$set(yt);const $p={};h&2&&($p.$$scope={dirty:h,ctx:o}),Jn.$set($p);const Fp={};h&2&&(Fp.$$scope={dirty:h,ctx:o}),Cn.$set(Fp);const xp={};h&2&&(xp.$$scope={dirty:h,ctx:o}),qn.$set(xp);const Up={};h&2&&(Up.$$scope={dirty:h,ctx:o}),Gn.$set(Up);const Jp={};h&2&&(Jp.$$scope={dirty:h,ctx:o}),Zn.$set(Jp);const Cp={};h&2&&(Cp.$$scope={dirty:h,ctx:o}),Bn.$set(Cp);const qp={};h&2&&(qp.$$scope={dirty:h,ctx:o}),Nn.$set(qp);const Ip={};h&2&&(Ip.$$scope={dirty:h,ctx:o}),Vn.$set(Ip);const bt={};h&2&&(bt.$$scope={dirty:h,ctx:o}),Xn.$set(bt);const Gp={};h&2&&(Gp.$$scope={dirty:h,ctx:o}),Pn.$set(Gp);const Ao={};h&2&&(Ao.$$scope={dirty:h,ctx:o}),Ln.$set(Ao);const Zp={};h&2&&(Zp.$$scope={dirty:h,ctx:o}),On.$set(Zp)},i(o){_u||(w(d.$$.fragment,o),w(le.$$.fragment,o),w(bs.$$.fragment,o),w(vs.$$.fragment,o),w(ws.$$.fragment,o),w(Es.$$.fragment,o),w(Fs.$$.fragment,o),w(Js.$$.fragment,o),w(Cs.$$.fragment,o),w(qs.$$.fragment,o),w(Is.$$.fragment,o),w(Zs.$$.fragment,o),w(Ws.$$.fragment,o),w(Vs.$$.fragment,o),w(Ps.$$.fragment,o),w(Hs.$$.fragment,o),w(la.$$.fragment,o),w(pa.$$.fragment,o),w(ga.$$.fragment,o),w(Ma.$$.fragment,o),w(Ea.$$.fragment,o),w(za.$$.fragment,o),w($a.$$.fragment,o),w(Ja.$$.fragment,o),w(qa.$$.fragment,o),w(Ga.$$.fragment,o),w(Za.$$.fragment,o),w(Wa.$$.fragment,o),w(Ba.$$.fragment,o),w(Aa.$$.fragment,o),w(Xa.$$.fragment,o),w(Sa.$$.fragment,o),w(Pa.$$.fragment,o),w(Ya.$$.fragment,o),w(un.$$.fragment,o),w(mn.$$.fragment,o),w(Ka.$$.fragment,o),w(er.$$.fragment,o),w(ir.$$.fragment,o),w(gn.$$.fragment,o),w(_n.$$.fragment,o),w(lr.$$.fragment,o),w(dr.$$.fragment,o),w(fr.$$.fragment,o),w(yn.$$.fragment,o),w(bn.$$.fragment,o),w(gr.$$.fragment,o),w(_r.$$.fragment,o),w(wr.$$.fragment,o),w(kn.$$.fragment,o),w(Mr.$$.fragment,o),w(Er.$$.fragment,o),w(Mn.$$.fragment,o),w(Ur.$$.fragment,o),w(En.$$.fragment,o),w(jn.$$.fragment,o),w(Jr.$$.fragment,o),w(Cr.$$.fragment,o),w($n.$$.fragment,o),w(Rr.$$.fragment,o),w(Fn.$$.fragment,o),w(xn.$$.fragment,o),w(Nr.$$.fragment,o),w(Ar.$$.fragment,o),w(Jn.$$.fragment,o),w(Lr.$$.fragment,o),w(Cn.$$.fragment,o),w(qn.$$.fragment,o),w(Hr.$$.fragment,o),w(Or.$$.fragment,o),w(Qr.$$.fragment,o),w(Gn.$$.fragment,o),w(Zn.$$.fragment,o),w(Yr.$$.fragment,o),w(Bn.$$.fragment,o),w(Kr.$$.fragment,o),w(Nn.$$.fragment,o),w(ei.$$.fragment,o),w(ti.$$.fragment,o),w(oi.$$.fragment,o),w(Vn.$$.fragment,o),w(Xn.$$.fragment,o),w(ni.$$.fragment,o),w(Pn.$$.fragment,o),w(si.$$.fragment,o),w(Ln.$$.fragment,o),w(ai.$$.fragment,o),w(ri.$$.fragment,o),w(ii.$$.fragment,o),w(On.$$.fragment,o),_u=!0)},o(o){M(d.$$.fragment,o),M(le.$$.fragment,o),M(bs.$$.fragment,o),M(vs.$$.fragment,o),M(ws.$$.fragment,o),M(Es.$$.fragment,o),M(Fs.$$.fragment,o),M(Js.$$.fragment,o),M(Cs.$$.fragment,o),M(qs.$$.fragment,o),M(Is.$$.fragment,o),M(Zs.$$.fragment,o),M(Ws.$$.fragment,o),M(Vs.$$.fragment,o),M(Ps.$$.fragment,o),M(Hs.$$.fragment,o),M(la.$$.fragment,o),M(pa.$$.fragment,o),M(ga.$$.fragment,o),M(Ma.$$.fragment,o),M(Ea.$$.fragment,o),M(za.$$.fragment,o),M($a.$$.fragment,o),M(Ja.$$.fragment,o),M(qa.$$.fragment,o),M(Ga.$$.fragment,o),M(Za.$$.fragment,o),M(Wa.$$.fragment,o),M(Ba.$$.fragment,o),M(Aa.$$.fragment,o),M(Xa.$$.fragment,o),M(Sa.$$.fragment,o),M(Pa.$$.fragment,o),M(Ya.$$.fragment,o),M(un.$$.fragment,o),M(mn.$$.fragment,o),M(Ka.$$.fragment,o),M(er.$$.fragment,o),M(ir.$$.fragment,o),M(gn.$$.fragment,o),M(_n.$$.fragment,o),M(lr.$$.fragment,o),M(dr.$$.fragment,o),M(fr.$$.fragment,o),M(yn.$$.fragment,o),M(bn.$$.fragment,o),M(gr.$$.fragment,o),M(_r.$$.fragment,o),M(wr.$$.fragment,o),M(kn.$$.fragment,o),M(Mr.$$.fragment,o),M(Er.$$.fragment,o),M(Mn.$$.fragment,o),M(Ur.$$.fragment,o),M(En.$$.fragment,o),M(jn.$$.fragment,o),M(Jr.$$.fragment,o),M(Cr.$$.fragment,o),M($n.$$.fragment,o),M(Rr.$$.fragment,o),M(Fn.$$.fragment,o),M(xn.$$.fragment,o),M(Nr.$$.fragment,o),M(Ar.$$.fragment,o),M(Jn.$$.fragment,o),M(Lr.$$.fragment,o),M(Cn.$$.fragment,o),M(qn.$$.fragment,o),M(Hr.$$.fragment,o),M(Or.$$.fragment,o),M(Qr.$$.fragment,o),M(Gn.$$.fragment,o),M(Zn.$$.fragment,o),M(Yr.$$.fragment,o),M(Bn.$$.fragment,o),M(Kr.$$.fragment,o),M(Nn.$$.fragment,o),M(ei.$$.fragment,o),M(ti.$$.fragment,o),M(oi.$$.fragment,o),M(Vn.$$.fragment,o),M(Xn.$$.fragment,o),M(ni.$$.fragment,o),M(Pn.$$.fragment,o),M(si.$$.fragment,o),M(Ln.$$.fragment,o),M(ai.$$.fragment,o),M(ri.$$.fragment,o),M(ii.$$.fragment,o),M(On.$$.fragment,o),_u=!1},d(o){t(m),o&&t(y),o&&t(_),E(d),o&&t(Ze),o&&t(Z),o&&t(We),o&&t(Q),E(le),o&&t(de),o&&t(U),o&&t(L),o&&t(we),o&&t(A),o&&t(Me),o&&t(ue),o&&t(C),o&&t(W),o&&t(R),o&&t(Vp),o&&t(Ti),o&&t(Xp),o&&t(lt),o&&t(Sp),o&&t(bi),o&&t(Pp),o&&t(je),o&&t(Dp),o&&t(Lo),o&&t(Lp),o&&t(Lt),o&&t(Hp),o&&t(zi),o&&t(Op),o&&t(co),E(bs),o&&t(Qp),o&&t($t),o&&t(Yp),o&&t(Oo),o&&t(Kp),o&&t(Fi),o&&t(eh),o&&t(ze),o&&t(th),o&&t(Ui),o&&t(oh),E(vs,o),o&&t(nh),o&&t(Qo),o&&t(sh),o&&t(Ji),o&&t(ah),o&&t(Ci),o&&t(rh),E(ws,o),o&&t(ih),o&&t(re),o&&t(lh),o&&t(Ht),o&&t(dh),o&&t($e),o&&t(ch),E(Es,o),o&&t(ph),o&&t(qi),o&&t(hh),o&&t(Ii),o&&t(uh),o&&t(Ot),o&&t(mh),o&&t(Yo),o&&t(fh),o&&t(Gi),o&&t(gh),o&&t(po),E(Fs),o&&t(_h),o&&t(Ft),o&&t(Th),E(Js,o),o&&t(yh),o&&t(dt),o&&t(bh),o&&t(Bi),o&&t(vh),E(Cs,o),o&&t(kh),o&&t(Ri),o&&t(wh),E(qs,o),o&&t(Mh),o&&t(Ni),o&&t(Eh),o&&t(ho),E(Is),o&&t(jh),o&&t(xt),o&&t(zh),o&&t(uo),E(Zs),o&&t($h),o&&t(Ai),o&&t(Fh),E(Ws,o),o&&t(xh),o&&t(on),o&&t(Uh),E(Vs,o),o&&t(Jh),o&&t(Vi),o&&t(Ch),E(Ps,o),o&&t(qh),o&&t(Xi),o&&t(Ih),E(Hs,o),o&&t(Gh),o&&t(ie),o&&t(Zh),E(la,o),o&&t(Wh),o&&t(Oi),o&&t(Bh),E(pa,o),o&&t(Rh),o&&t(Kt),o&&t(Nh),E(ga,o),o&&t(Ah),o&&t(sn),o&&t(Vh),o&&t(va),o&&t(Xh),o&&t(ol),o&&t(Sh),o&&t(mo),E(Ma),o&&t(Ph),o&&t(Pt),E(Ea),o&&t(Dh),o&&t(go),E(za),o&&t(Lh),o&&t(me),E($a),E(Ja),E(qa),E(Ga),E(Za),o&&t(Hh),o&&t(_o),E(Wa),o&&t(Oh),o&&t(Ke),E(Ba),E(Aa),E(Xa),o&&t(Qh),o&&t(yo),E(Sa),o&&t(Yh),o&&t(Ce),E(Pa),E(Ya),E(un),E(mn),o&&t(Kh),o&&t(vo),E(Ka),o&&t(eu),o&&t(qe),E(er),E(ir),E(gn),E(_n),o&&t(tu),o&&t(wo),E(lr),o&&t(ou),o&&t(Ie),E(dr),E(fr),E(yn),E(bn),o&&t(nu),o&&t(Eo),E(gr),o&&t(su),o&&t(Ge),E(_r),E(wr),E(kn),o&&t(au),o&&t($o),E(Mr),o&&t(ru),o&&t(fe),E(Er),E(Mn),E(Ur),E(En),E(jn),o&&t(iu),o&&t(xo),E(Jr),o&&t(lu),o&&t(ge),E(Cr),E($n),E(Rr),E(Fn),E(xn),o&&t(du),o&&t(Jo),E(Nr),o&&t(cu),o&&t(_e),E(Ar),E(Jn),E(Lr),E(Cn),E(qn),o&&t(pu),o&&t(qo),E(Hr),o&&t(hu),o&&t(_t),E(Or),E(Qr),E(Gn),E(Zn),E(Yr),E(Bn),E(Kr),E(Nn),o&&t(uu),o&&t(Go),E(ei),o&&t(mu),o&&t(Tt),E(ti),E(oi),E(Vn),E(Xn),E(ni),E(Pn),E(si),E(Ln),o&&t(fu),o&&t(Wo),E(ai),o&&t(gu),o&&t(Bo),E(ri),E(ii),E(On)}}}const Zj={local:"t5",sections:[{local:"overview",title:"Overview"},{local:"training",title:"Training"},{local:"inference",title:"Inference"},{local:"performance",title:"Performance"},{local:"resources",title:"Resources"},{local:"transformers.T5Config",title:"T5Config"},{local:"transformers.T5Tokenizer",title:"T5Tokenizer"},{local:"transformers.T5TokenizerFast",title:"T5TokenizerFast"},{local:"transformers.T5Model",title:"T5Model"},{local:"transformers.T5ForConditionalGeneration",title:"T5ForConditionalGeneration"},{local:"transformers.T5EncoderModel",title:"T5EncoderModel"},{local:"transformers.T5ForQuestionAnswering",title:"T5ForQuestionAnswering"},{local:"transformers.TFT5Model",title:"TFT5Model"},{local:"transformers.TFT5ForConditionalGeneration",title:"TFT5ForConditionalGeneration"},{local:"transformers.TFT5EncoderModel",title:"TFT5EncoderModel"},{local:"transformers.FlaxT5Model",title:"FlaxT5Model"},{local:"transformers.FlaxT5ForConditionalGeneration",title:"FlaxT5ForConditionalGeneration"},{local:"transformers.FlaxT5EncoderModel",title:"FlaxT5EncoderModel"}],title:"T5"};function Wj(F){return cj(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pj extends rj{constructor(m){super();ij(this,m,Wj,Gj,lj,{})}}export{Pj as default,Zj as metadata};
