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