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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Studies have been shown that owning a dog is good for you&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>).input_ids  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(<span class="hljs-string">&quot;Studies show that&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This is not needed for torch&#x27;s T5ForConditionalGeneration as it does this internally using labels arg.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = model._shift_right(decoder_input_ids)

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Studies have been shown that owning a dog is good for you&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>
<span class="hljs-meta">... </span>).input_ids  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(<span class="hljs-string">&quot;Studies show that&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_ids  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This is not needed for torch&#x27;s T5ForConditionalGeneration as it does this internally using labels arg.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = model._shift_right(decoder_input_ids)

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Studies have been shown that owning a dog is good for you&quot;</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>
<span class="hljs-meta">... </span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(<span class="hljs-string">&quot;Studies show that&quot;</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This is not needed for torch&#x27;s T5ForConditionalGeneration as it does this internally using labels arg.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = model._shift_right(decoder_input_ids)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:Lt,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function B$(F){let m,y,_,g,T;return g=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBdGV4dCUyMCUzRCUyMCUyMk15JTIwZnJpZW5kcyUyMGFyZSUyMGNvb2wlMjBidXQlMjB0aGV5JTIwZWF0JTIwdG9vJTIwbWFueSUyMGNhcmJzLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcih0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFlbmNvZGVyX291dHB1dHMlMjAlM0QlMjBtb2RlbC5lbmNvZGUoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5ForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)`}}),{c(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:Lt,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function W$(F){let m,y,_,g,T;return g=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEFpbXBvcnQlMjBqYXgubnVtcHklMjBhcyUyMGpucCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheFQ1Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyKSUwQWVuY29kZXJfb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmVuY29kZSgqKmlucHV0cyklMEElMEFkZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTIwJTNEJTIwbW9kZWwuY29uZmlnLmRlY29kZXJfc3RhcnRfdG9rZW5faWQlMEFkZWNvZGVyX2lucHV0X2lkcyUyMCUzRCUyMGpucC5vbmVzKChpbnB1dHMuaW5wdXRfaWRzLnNoYXBlJTVCMCU1RCUyQyUyMDEpJTJDJTIwZHR5cGUlM0QlMjJpNCUyMiklMjAqJTIwZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5kZWNvZGUoZGVjb2Rlcl9pbnB1dF9pZHMlMkMlMjBlbmNvZGVyX291dHB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5ForConditionalGeneration
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_start_token_id = model.config.decoder_start_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = jnp.ones((inputs.input_ids.shape[<span class="hljs-number">0</span>], <span class="hljs-number">1</span>), dtype=<span class="hljs-string">&quot;i4&quot;</span>) * decoder_start_token_id

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = <span class="hljs-string">&quot;summarize: My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([ARTICLE_TO_SUMMARIZE], return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate Summary</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>]).sequences
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(summary_ids[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>))`}}),{c(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:Lt,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function A$(F){let m,y,_,g,T;return g=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBdGV4dCUyMCUzRCUyMCUyMk15JTIwZnJpZW5kcyUyMGFyZSUyMGNvb2wlMjBidXQlMjB0aGV5JTIwZWF0JTIwdG9vJTIwbWFueSUyMGNhcmJzLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcih0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFlbmNvZGVyX291dHB1dHMlMjAlM0QlMjBtb2RlbC5lbmNvZGUoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5ForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)`}}),{c(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:Lt,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function V$(F){let m,y,_,g,T;return g=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4VDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEFpbXBvcnQlMjBqYXgubnVtcHklMjBhcyUyMGpucCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LXNtYWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheFQ1Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ0NS1zbWFsbCUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyc3VtbWFyaXplJTNBJTIwTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyKSUwQWVuY29kZXJfb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmVuY29kZSgqKmlucHV0cyklMEElMEFkZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTIwJTNEJTIwbW9kZWwuY29uZmlnLmRlY29kZXJfc3RhcnRfdG9rZW5faWQlMEFkZWNvZGVyX2lucHV0X2lkcyUyMCUzRCUyMGpucC5vbmVzKChpbnB1dHMuaW5wdXRfaWRzLnNoYXBlJTVCMCU1RCUyQyUyMDEpJTJDJTIwZHR5cGUlM0QlMjJpNCUyMiklMjAqJTIwZGVjb2Rlcl9zdGFydF90b2tlbl9pZCUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5kZWNvZGUoZGVjb2Rlcl9pbnB1dF9pZHMlMkMlMjBlbmNvZGVyX291dHB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxT5ForConditionalGeneration
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;summarize: My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoder_outputs = model.encode(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_start_token_id = model.config.decoder_start_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = jnp.ones((inputs.input_ids.shape[<span class="hljs-number">0</span>], <span class="hljs-number">1</span>), dtype=<span class="hljs-string">&quot;i4&quot;</span>) * decoder_start_token_id

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.decode(decoder_input_ids, encoder_outputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){m=a("p"),y=n("Example:"),_=c(),b(g.$$.fragment)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Example:"),f.forEach(t),_=p(d),v(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),k(g,d,f),T=!0},p:Lt,i(d){T||(w(g.$$.fragment,d),T=!0)},o(d){M(g.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(_),E(g,d)}}}function X$(F){let m,y,_,g,T;return{c(){m=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=n("Module"),T=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=r(d,"P",{});var f=i(m);y=s(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var $=i(_);g=s($,"Module"),$.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 S$(F){let m,y,_,g,T,d,f,$,Ae,Be,Z,ye,O,j,Ve,V,be,tt,H,ve,ke,ne,We,Q,W,xe,de,Y,Ue,Xe,ce,U,I,pe,K,Se,he,ee,Pe,ue,G,Le,N,De,Oe,D,we,He,A,Me,P,Qe,me,C,Ye,B,R,Je,z,x,ot,Ee,wt,nt,J,Mt,Et,st,at,zt,X,L,rt,$t,te,it,lt,Ke,Ft,se,ae,hf,xi,uf,mf,Ui,ff,gf,Ji,_f,Tf,uh,qi,yf,mh,dt,gd,_d,ys,bf,vf,Td,yd,bs,kf,wf,bd,vd,vs,Mf,Ef,kd,wd,ks,zf,$f,Md,Ci,ws,Ff,jf,fh,Ii,xf,gh,ze,Ed,Oo,zd,Uf,Jf,Gi,qf,Cf,If,$d,Ho,Fd,Gf,Zf,Zi,Bf,Wf,Rf,jd,Qo,xd,Nf,Af,Bi,Vf,Xf,Sf,Ud,Wi,Jd,Pf,Lf,Df,qd,S,Cd,Of,Hf,Id,Qf,Yf,Gd,Kf,eg,Zd,tg,og,Bd,ng,sg,Wd,ag,rg,Rd,ig,lg,Nd,dg,cg,Ad,pg,hg,Vd,ug,mg,fg,Xd,Ri,Sd,gg,_g,Tg,Pd,Yo,Ld,yg,bg,Ni,vg,kg,_h,Ko,wg,Ms,Mg,Eg,Th,Ht,zg,Es,$g,Fg,zs,jg,xg,yh,Ai,bh,uo,en,Dd,$s,Ug,Od,Jg,vh,jt,qg,Hd,Cg,Ig,Qd,Gg,Zg,Yd,Bg,Wg,kh,tn,Rg,Vi,Ng,Ag,wh,Xi,Kd,Vg,Mh,$e,Xg,ec,Sg,Pg,tc,Lg,Dg,oc,Og,Hg,nc,Qg,Yg,sc,Kg,e_,Si,t_,o_,Eh,Pi,n_,zh,Fs,$h,on,s_,js,a_,r_,Fh,Li,ac,i_,jh,Di,l_,xh,xs,Uh,re,d_,rc,c_,p_,ic,h_,u_,lc,m_,f_,dc,g_,__,cc,T_,y_,pc,b_,v_,hc,k_,w_,Jh,Qt,M_,uc,E_,z_,mc,$_,F_,qh,Fe,j_,fc,x_,U_,gc,J_,q_,_c,C_,I_,Tc,G_,Z_,Us,B_,W_,yc,R_,N_,Ch,Js,Ih,Oi,A_,Gh,Hi,qs,V_,bc,X_,S_,Zh,Yt,P_,Cs,L_,D_,Is,O_,H_,Bh,nn,Q_,vc,Y_,K_,Wh,Qi,Rh,mo,sn,kc,Gs,eT,wc,tT,Nh,xt,oT,Yi,nT,sT,Zs,aT,rT,Bs,iT,lT,Ah,Ws,Vh,ct,dT,Mc,cT,pT,Ec,hT,uT,Ki,mT,fT,zc,gT,_T,Xh,el,TT,Sh,Rs,Ph,tl,yT,Lh,Ns,Dh,ol,Oh,fo,an,$c,As,bT,Fc,vT,Hh,Ut,kT,Vs,wT,MT,jc,ET,zT,xc,$T,FT,Qh,go,rn,Uc,Xs,jT,Jc,xT,Yh,nl,UT,Kh,Ss,eu,ln,Ps,JT,Ls,qT,CT,IT,Ds,GT,Os,ZT,BT,tu,Hs,ou,sl,Qs,WT,Ys,RT,NT,nu,Ks,su,al,ea,AT,ta,VT,XT,au,oa,ru,ie,na,ST,sa,PT,LT,DT,aa,OT,ra,HT,QT,YT,ia,KT,la,ey,ty,oy,Kt,rl,ny,sy,da,ay,ry,ca,iy,ly,dy,eo,il,cy,py,pa,hy,uy,ha,my,fy,gy,dn,ll,_y,Ty,ua,yy,by,vy,dl,ma,ky,wy,My,qc,cl,Ey,iu,fa,lu,pl,Jt,hl,zy,$y,ga,Fy,jy,ul,xy,Uy,_a,Jy,qy,du,Ta,cu,to,oo,ml,Cy,Iy,ya,Gy,Zy,ba,By,Wy,Ry,no,fl,Ny,Ay,va,Vy,Xy,ka,Sy,Py,Ly,Cc,gl,Dy,pu,wa,hu,cn,Ma,Oy,Ea,Hy,Qy,Yy,za,Ky,$a,eb,tb,uu,Fa,ob,Ic,nb,mu,_l,ja,sb,xa,ab,rb,fu,_o,pn,Gc,Ua,ib,Zc,lb,gu,Dt,Ja,db,Ot,cb,Tl,pb,hb,yl,ub,mb,qa,fb,gb,_b,To,Tb,bl,yb,bb,vl,vb,kb,_u,yo,hn,Bc,Ca,wb,Wc,Mb,Tu,fe,Ia,Eb,Ga,zb,Za,$b,Fb,jb,Ba,xb,kl,Ub,Jb,qb,so,Wa,Cb,Rc,Ib,Gb,Ra,wl,Zb,Nc,Bb,Wb,Ml,Rb,Ac,Nb,Ab,un,Na,Vb,Aa,Xb,Vc,Sb,Pb,Lb,mn,Va,Db,Xc,Ob,Hb,El,Xa,yu,bo,fn,Sc,Sa,Qb,Pc,Yb,bu,et,Pa,Kb,vo,ev,Lc,tv,ov,La,nv,sv,av,Da,rv,zl,iv,lv,dv,ao,Oa,cv,Dc,pv,hv,Ha,$l,uv,Oc,mv,fv,Fl,gv,Hc,_v,Tv,gn,Qa,yv,Qc,bv,vu,ko,_n,Yc,Ya,vv,Kc,kv,ku,qe,Ka,wv,ep,Mv,Ev,er,zv,tr,$v,Fv,jv,or,xv,jl,Uv,Jv,qv,nr,Cv,sr,Iv,Gv,Zv,qt,ar,Bv,wo,Wv,xl,Rv,Nv,tp,Av,Vv,Xv,Tn,Sv,yn,wu,Mo,bn,op,rr,Pv,np,Lv,Mu,Ce,ir,Dv,lr,Ov,sp,Hv,Qv,Yv,dr,Kv,cr,ek,tk,ok,pr,nk,Ul,sk,ak,rk,hr,ik,ur,lk,dk,ck,Ct,mr,pk,Eo,hk,Jl,uk,mk,ap,fk,gk,_k,vn,Tk,kn,Eu,zo,wn,rp,fr,yk,ip,bk,zu,Ie,gr,vk,lp,kk,wk,_r,Mk,Tr,Ek,zk,$k,yr,Fk,ql,jk,xk,Uk,br,Jk,vr,qk,Ck,Ik,It,kr,Gk,$o,Zk,Cl,Bk,Wk,dp,Rk,Nk,Ak,Mn,Vk,En,$u,Fo,zn,cp,wr,Xk,pp,Sk,Fu,Ge,Mr,Pk,hp,Lk,Dk,Er,Ok,zr,Hk,Qk,Yk,$r,Kk,Il,ew,tw,ow,Fr,nw,jr,sw,aw,rw,ro,xr,iw,jo,lw,Gl,dw,cw,up,pw,hw,uw,$n,ju,xo,Fn,mp,Ur,mw,fp,fw,xu,Ze,Jr,gw,Uo,_w,gp,Tw,yw,_p,bw,vw,kw,qr,ww,Cr,Mw,Ew,zw,Ir,$w,Zl,Fw,jw,xw,Gr,Uw,Zr,Jw,qw,Cw,io,Br,Iw,Jo,Gw,Bl,Zw,Bw,Tp,Ww,Rw,Nw,jn,Uu,qo,xn,yp,Wr,Aw,bp,Vw,Ju,ge,Rr,Xw,vp,Sw,Pw,Nr,Lw,Ar,Dw,Ow,Hw,Vr,Qw,Wl,Yw,Kw,e5,Xr,t5,Sr,o5,n5,s5,Un,a5,Gt,Pr,r5,Co,i5,Rl,l5,d5,kp,c5,p5,h5,Jn,u5,qn,qu,Io,Cn,wp,Lr,m5,Mp,f5,Cu,_e,Dr,g5,Or,_5,Ep,T5,y5,b5,Hr,v5,Qr,k5,w5,M5,Yr,E5,Nl,z5,$5,F5,Kr,j5,ei,x5,U5,J5,In,q5,Zt,ti,C5,Go,I5,Al,G5,Z5,zp,B5,W5,R5,Gn,N5,Zn,Iu,Zo,Bn,$p,oi,A5,Fp,V5,Gu,Te,ni,X5,jp,S5,P5,si,L5,ai,D5,O5,H5,ri,Q5,Vl,Y5,K5,e2,ii,t2,li,o2,n2,s2,Wn,a2,Bt,di,r2,Bo,i2,Xl,l2,d2,xp,c2,p2,h2,Rn,u2,Nn,Zu,Wo,An,Up,ci,m2,Jp,f2,Bu,yt,pi,g2,Wt,hi,_2,Ro,T2,qp,y2,b2,Cp,v2,k2,w2,Vn,M2,Xn,E2,Sn,ui,z2,Pn,$2,Ln,mi,F2,Dn,Wu,No,On,Ip,fi,j2,Gp,x2,Ru,bt,gi,U2,Rt,_i,J2,Ao,q2,Zp,C2,I2,Bp,G2,Z2,B2,Hn,W2,Qn,R2,Yn,Ti,N2,Kn,A2,es,yi,V2,ts,Nu,Vo,os,Wp,bi,X2,Rp,S2,Au,Xo,vi,P2,lo,ki,L2,So,D2,Sl,O2,H2,Np,Q2,Y2,K2,ns,Vu;return d=new le({}),de=new le({}),$s=new le({}),Fs=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1VG9rZW5pemVyJTJDJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBUNVRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBbW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydDUtc21hbGwlMjIpJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMCUzQ2V4dHJhX2lkXzAlM0UlMjB3YWxrcyUyMGluJTIwJTNDZXh0cmFfaWRfMSUzRSUyMHBhcmslMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyJTNDZXh0cmFfaWRfMCUzRSUyMGN1dGUlMjBkb2clMjAlM0NleHRyYV9pZF8xJTNFJTIwdGhlJTIwJTNDZXh0cmFfaWRfMiUzRSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQSUwQSUyMyUyMHRoZSUyMGZvcndhcmQlMjBmdW5jdGlvbiUyMGF1dG9tYXRpY2FsbHklMjBjcmVhdGVzJTIwdGhlJTIwY29ycmVjdCUyMGRlY29kZXJfaW5wdXRfaWRzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcyUzRGlucHV0X2lkcyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcyUwQWxvc3MuaXRlbSgp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5Tokenizer, T5ForConditionalGeneration

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

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

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(input_ids=input_ids, attention_mask=attention_mask, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span>loss.item()
<span class="hljs-number">0.188</span>`}}),Gs=new le({}),Ws=new je({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.`}}),Rs=new je({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>]`}}),Ns=new je({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>]`}}),As=new le({}),Xs=new le({}),Ss=new ji({props:{pipeline:"text-classification"}}),Hs=new ji({props:{pipeline:"token-classification"}}),Ks=new ji({props:{pipeline:"text-generation"}}),oa=new ji({props:{pipeline:"summarization"}}),fa=new ji({props:{pipeline:"fill-mask"}}),Ta=new ji({props:{pipeline:"translation"}}),wa=new ji({props:{pipeline:"question-answering"}}),Ua=new le({}),Ja=new q({props:{name:"class transformers.T5Config",anchor:"transformers.T5Config",parameters:[{name:"vocab_size",val:" = 32128"},{name:"d_model",val:" = 512"},{name:"d_kv",val:" = 64"},{name:"d_ff",val:" = 2048"},{name:"num_layers",val:" = 6"},{name:"num_decoder_layers",val:" = None"},{name:"num_heads",val:" = 8"},{name:"relative_attention_num_buckets",val:" = 32"},{name:"relative_attention_max_distance",val:" = 128"},{name:"dropout_rate",val:" = 0.1"},{name:"layer_norm_epsilon",val:" = 1e-06"},{name:"initializer_factor",val:" = 1.0"},{name:"feed_forward_proj",val:" = 'relu'"},{name:"is_encoder_decoder",val:" = True"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"classifier_dropout",val:" = 0.0"},{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.32.0/en/model_doc/t5#transformers.T5Model">T5Model</a> or <a href="/docs/transformers/v4.32.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.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for classifier.`,name:"classifier_dropout"},{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.32.0/src/transformers/models/t5/configuration_t5.py#L34"}}),Ca=new le({}),Ia=new q({props:{name:"class transformers.T5Tokenizer",anchor:"transformers.T5Tokenizer",parameters:[{name:"vocab_file",val:""},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"extra_ids",val:" = 100"},{name:"additional_special_tokens",val:" = None"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"legacy",val:" = 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.legacy",description:`<strong>legacy</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the <code>legacy</code> behaviour of the tokenizer should be used. Legacy is before the merge of #24622
and #25224 which includes fixes to properly handle tokens that appear after special tokens. A simple
example:</p>
<ul>
<li><code>legacy=True</code>:</li>
</ul>`,name:"legacy"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/t5/tokenization_t5.py#L62"}}),Wa=new q({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.T5Tokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5Tokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.T5Tokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/t5/tokenization_t5.py#L310",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>
`}}),Na=new q({props:{name:"get_special_tokens_mask",anchor:"transformers.T5Tokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.T5Tokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.T5Tokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.T5Tokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/t5/tokenization_t5.py#L241",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>
`}}),Va=new q({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.T5Tokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5Tokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.T5Tokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/t5/tokenization_t5.py#L288",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Xa=new q({props:{name:"save_vocabulary",anchor:"transformers.T5Tokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/t5/tokenization_t5.py#L426"}}),Sa=new le({}),Pa=new q({props:{name:"class transformers.T5TokenizerFast",anchor:"transformers.T5TokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"extra_ids",val:" = 100"},{name:"additional_special_tokens",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.T5TokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.T5TokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

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