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 k,h as s,b as l,N as d1,G as e,g as u,y as v,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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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 k$(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 v$(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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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,ke,ve,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"),ke=n("model.fit()"),ve=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);ke=s(Et,"model.fit()"),Et.forEach(t),ve=s(J,` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=r(J,"CODE",{});var 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,ke),e(j,ve),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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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,ke,ve,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"),ke=n("model.fit()"),ve=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);ke=s(Et,"model.fit()"),Et.forEach(t),ve=s(J,` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=r(J,"CODE",{});var 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,ke),e(j,ve),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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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,ke,ve,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"),ke=n("model.fit()"),ve=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);ke=s(Et,"model.fit()"),Et.forEach(t),ve=s(J,` supports! If, however, you want to use the second
format outside of Keras methods like `),ne=r(J,"CODE",{});var 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,ke),e(j,ve),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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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),k(g.$$.fragment,d)},m(d,f){u(d,m,f),e(m,y),u(d,_,f),v(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,ke,ve,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,kf,Td,yd,bs,vf,wf,bd,kd,ks,Mf,Ef,vd,wd,vs,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,kg,vg,_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,kh,jt,qg,Hd,Cg,Ig,Qd,Gg,Zg,Yd,Bg,Wg,vh,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_,k_,hc,v_,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_,kc,Y_,K_,Wh,Qi,Rh,mo,sn,vc,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,kT,Hh,Ut,vT,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,ky,dl,ma,vy,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,ka,Vy,Xy,va,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,kl,kb,vb,_u,yo,hn,Bc,Ca,wb,Wc,Mb,Tu,fe,Ia,Eb,Ga,zb,Za,$b,Fb,jb,Ba,xb,vl,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,ko,ek,Lc,tk,ok,La,nk,sk,ak,Da,rk,zl,ik,lk,dk,ao,Oa,ck,Dc,pk,hk,Ha,$l,uk,Oc,mk,fk,Fl,gk,Hc,_k,Tk,gn,Qa,yk,Qc,bk,ku,vo,_n,Yc,Ya,kk,Kc,vk,vu,qe,Ka,wk,ep,Mk,Ek,er,zk,tr,$k,Fk,jk,or,xk,jl,Uk,Jk,qk,nr,Ck,sr,Ik,Gk,Zk,qt,ar,Bk,wo,Wk,xl,Rk,Nk,tp,Ak,Vk,Xk,Tn,Sk,yn,wu,Mo,bn,op,rr,Pk,np,Lk,Mu,Ce,ir,Dk,lr,Ok,sp,Hk,Qk,Yk,dr,Kk,cr,ev,tv,ov,pr,nv,Ul,sv,av,rv,hr,iv,ur,lv,dv,cv,Ct,mr,pv,Eo,hv,Jl,uv,mv,ap,fv,gv,_v,kn,Tv,vn,Eu,zo,wn,rp,fr,yv,ip,bv,zu,Ie,gr,kv,lp,vv,wv,_r,Mv,Tr,Ev,zv,$v,yr,Fv,ql,jv,xv,Uv,br,Jv,kr,qv,Cv,Iv,It,vr,Gv,$o,Zv,Cl,Bv,Wv,dp,Rv,Nv,Av,Mn,Vv,En,$u,Fo,zn,cp,wr,Xv,pp,Sv,Fu,Ge,Mr,Pv,hp,Lv,Dv,Er,Ov,zr,Hv,Qv,Yv,$r,Kv,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,kw,vw,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,kp,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,vp,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,k5,Qr,v5,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,eM,ii,tM,li,oM,nM,sM,Wn,aM,Bt,di,rM,Bo,iM,Xl,lM,dM,xp,cM,pM,hM,Rn,uM,Nn,Zu,Wo,An,Up,ci,mM,Jp,fM,Bu,yt,pi,gM,Wt,hi,_M,Ro,TM,qp,yM,bM,Cp,kM,vM,wM,Vn,MM,Xn,EM,Sn,ui,zM,Pn,$M,Ln,mi,FM,Dn,Wu,No,On,Ip,fi,jM,Gp,xM,Ru,bt,gi,UM,Rt,_i,JM,Ao,qM,Zp,CM,IM,Bp,GM,ZM,BM,Hn,WM,Qn,RM,Yn,Ti,NM,Kn,AM,es,yi,VM,ts,Nu,Vo,os,Wp,bi,XM,Rp,SM,Au,Xo,ki,PM,lo,vi,LM,So,DM,Sl,OM,HM,Np,QM,YM,KM,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/main/en/model_doc/t5#transformers.T5Model">T5Model</a> or <a href="/docs/transformers/main/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/main/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/main/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/main/src/transformers/models/t5/tokenization_t5.py#L313",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/main/src/transformers/models/t5/tokenization_t5.py#L244",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/main/src/transformers/models/t5/tokenization_t5.py#L291",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/main/src/transformers/models/t5/tokenization_t5.py#L429"}}),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/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py#L1441",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/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/main/src/transformers/models/t5/modeling_t5.py#L1645",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),kn=new Tt({props:{$$slots:{default:[k$]},$$scope:{ctx:F}}}),vn=new Pt({props:{anchor:"transformers.T5ForConditionalGeneration.forward.example",$$slots:{default:[v$]},$$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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py#L1867"}}),vr=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py#L1934",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/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/main/src/transformers/models/t5/modeling_t5.py#L1998",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/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/main/src/transformers/models/t5/modeling_t5.py#L2161",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.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/main/src/transformers/models/t5/modeling_tf_t5.py#L1121",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.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/main/src/transformers/models/t5/modeling_tf_t5.py#L1281",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/t5/modeling_tf_t5.py#L1498",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/src/transformers/models/t5/modeling_flax_t5.py#L986",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_flax_t5.py#L1072",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.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/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_flax_t5.py#L1130",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.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/main/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/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/src/transformers/models/t5/modeling_flax_t5.py#L986",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_flax_t5.py#L1072",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.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/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_flax_t5.py#L1608",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.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/main/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({}),ki=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/main/src/transformers/models/t5/modeling_flax_t5.py#L1454"}}),vi=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for 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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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(),ke=a("a"),ve=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"),kf=c(),Td=a("li"),yd=a("p"),bs=a("a"),vf=n("t5-base"),wf=c(),bd=a("li"),kd=a("p"),ks=a("a"),Mf=n("t5-large"),Ef=c(),vd=a("li"),wd=a("p"),vs=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"),kg=n("here"),vg=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"),kh=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.`),vh=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"),k_=n(`, by
shifting them one position to the right and prepending the `),hc=a("code"),v_=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
`),kc=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"),vc=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"),kT=n("Performance"),Hh=c(),Ut=a("p"),vT=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("."),ky=c(),dl=a("li"),ma=a("a"),vy=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 "),ka=a("a"),Vy=n("example script"),Xy=n(" and "),va=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 `),kl=a("a"),kb=n("PretrainedConfig"),vb=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 "),vl=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(),ko=a("p"),ek=n("Construct a \u201Cfast\u201D T5 tokenizer (backed by HuggingFace\u2019s "),Lc=a("em"),tk=n("tokenizers"),ok=n(` library). Based on
`),La=a("a"),nk=n("Unigram"),sk=n("."),ak=c(),Da=a("p"),rk=n("This tokenizer inherits from "),zl=a("a"),ik=n("PreTrainedTokenizerFast"),lk=n(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),dk=c(),ao=a("div"),b(Oa.$$.fragment),ck=c(),Dc=a("p"),pk=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:`),hk=c(),Ha=a("ul"),$l=a("li"),uk=n("single sequence: "),Oc=a("code"),mk=n("X </s>"),fk=c(),Fl=a("li"),gk=n("pair of sequences: "),Hc=a("code"),_k=n("A </s> B </s>"),Tk=c(),gn=a("div"),b(Qa.$$.fragment),yk=c(),Qc=a("p"),bk=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.`),ku=c(),vo=a("h2"),_n=a("a"),Yc=a("span"),b(Ya.$$.fragment),kk=c(),Kc=a("span"),vk=n("T5Model"),vu=c(),qe=a("div"),b(Ka.$$.fragment),wk=c(),ep=a("p"),Mk=n("The bare T5 Model transformer outputting raw hidden-states without any specific head on top."),Ek=c(),er=a("p"),zk=n("The T5 model was proposed in "),tr=a("a"),$k=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Fk=n(` by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan
Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. It\u2019s an encoder decoder transformer pre-trained in a
text-to-text denoising generative setting.`),jk=c(),or=a("p"),xk=n("This model inherits from "),jl=a("a"),Uk=n("PreTrainedModel"),Jk=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.)`),qk=c(),nr=a("p"),Ck=n("This model is also a PyTorch "),sr=a("a"),Ik=n("torch.nn.Module"),Gk=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zk=c(),qt=a("div"),b(ar.$$.fragment),Bk=c(),wo=a("p"),Wk=n("The "),xl=a("a"),Rk=n("T5Model"),Nk=n(" forward method, overrides the "),tp=a("code"),Ak=n("__call__"),Vk=n(" special method."),Xk=c(),b(Tn.$$.fragment),Sk=c(),b(yn.$$.fragment),wu=c(),Mo=a("h2"),bn=a("a"),op=a("span"),b(rr.$$.fragment),Pk=c(),np=a("span"),Lk=n("T5ForConditionalGeneration"),Mu=c(),Ce=a("div"),b(ir.$$.fragment),Dk=c(),lr=a("p"),Ok=n("T5 Model with a "),sp=a("code"),Hk=n("language modeling"),Qk=n(" head on top."),Yk=c(),dr=a("p"),Kk=n("The T5 model was proposed in "),cr=a("a"),ev=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),tv=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.`),ov=c(),pr=a("p"),nv=n("This model inherits from "),Ul=a("a"),sv=n("PreTrainedModel"),av=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.)`),rv=c(),hr=a("p"),iv=n("This model is also a PyTorch "),ur=a("a"),lv=n("torch.nn.Module"),dv=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),cv=c(),Ct=a("div"),b(mr.$$.fragment),pv=c(),Eo=a("p"),hv=n("The "),Jl=a("a"),uv=n("T5ForConditionalGeneration"),mv=n(" forward method, overrides the "),ap=a("code"),fv=n("__call__"),gv=n(" special method."),_v=c(),b(kn.$$.fragment),Tv=c(),b(vn.$$.fragment),Eu=c(),zo=a("h2"),wn=a("a"),rp=a("span"),b(fr.$$.fragment),yv=c(),ip=a("span"),bv=n("T5EncoderModel"),zu=c(),Ie=a("div"),b(gr.$$.fragment),kv=c(),lp=a("p"),vv=n("The bare T5 Model transformer outputting encoder\u2019s raw hidden-states without any specific head on top."),wv=c(),_r=a("p"),Mv=n("The T5 model was proposed in "),Tr=a("a"),Ev=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),zv=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.`),$v=c(),yr=a("p"),Fv=n("This model inherits from "),ql=a("a"),jv=n("PreTrainedModel"),xv=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.)`),Uv=c(),br=a("p"),Jv=n("This model is also a PyTorch "),kr=a("a"),qv=n("torch.nn.Module"),Cv=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Iv=c(),It=a("div"),b(vr.$$.fragment),Gv=c(),$o=a("p"),Zv=n("The "),Cl=a("a"),Bv=n("T5EncoderModel"),Wv=n(" forward method, overrides the "),dp=a("code"),Rv=n("__call__"),Nv=n(" special method."),Av=c(),b(Mn.$$.fragment),Vv=c(),b(En.$$.fragment),$u=c(),Fo=a("h2"),zn=a("a"),cp=a("span"),b(wr.$$.fragment),Xv=c(),pp=a("span"),Sv=n("T5ForSequenceClassification"),Fu=c(),Ge=a("div"),b(Mr.$$.fragment),Pv=c(),hp=a("p"),Lv=n(`T5 model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),Dv=c(),Er=a("p"),Ov=n("The T5 model was proposed in "),zr=a("a"),Hv=n(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Qv=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.`),Yv=c(),$r=a("p"),Kv=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"),kw=n(")."),vw=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(),kp=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 "),vp=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"),k5=n("The T5 model was proposed in "),Qr=a("a"),v5=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.)`),eM=c(),ii=a("p"),tM=n("This model is also a "),li=a("a"),oM=n("tf.keras.Model"),nM=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.`),sM=c(),b(Wn.$$.fragment),aM=c(),Bt=a("div"),b(di.$$.fragment),rM=c(),Bo=a("p"),iM=n("The "),Xl=a("a"),lM=n("TFT5EncoderModel"),dM=n(" forward method, overrides the "),xp=a("code"),cM=n("__call__"),pM=n(" special method."),hM=c(),b(Rn.$$.fragment),uM=c(),b(Nn.$$.fragment),Zu=c(),Wo=a("h2"),An=a("a"),Up=a("span"),b(ci.$$.fragment),mM=c(),Jp=a("span"),fM=n("FlaxT5Model"),Bu=c(),yt=a("div"),b(pi.$$.fragment),gM=c(),Wt=a("div"),b(hi.$$.fragment),_M=c(),Ro=a("p"),TM=n("The "),qp=a("code"),yM=n("FlaxT5PreTrainedModel"),bM=n(" forward method, overrides the "),Cp=a("code"),kM=n("__call__"),vM=n(" special method."),wM=c(),b(Vn.$$.fragment),MM=c(),b(Xn.$$.fragment),EM=c(),Sn=a("div"),b(ui.$$.fragment),zM=c(),b(Pn.$$.fragment),$M=c(),Ln=a("div"),b(mi.$$.fragment),FM=c(),b(Dn.$$.fragment),Wu=c(),No=a("h2"),On=a("a"),Ip=a("span"),b(fi.$$.fragment),jM=c(),Gp=a("span"),xM=n("FlaxT5ForConditionalGeneration"),Ru=c(),bt=a("div"),b(gi.$$.fragment),UM=c(),Rt=a("div"),b(_i.$$.fragment),JM=c(),Ao=a("p"),qM=n("The "),Zp=a("code"),CM=n("FlaxT5PreTrainedModel"),IM=n(" forward method, overrides the "),Bp=a("code"),GM=n("__call__"),ZM=n(" special method."),BM=c(),b(Hn.$$.fragment),WM=c(),b(Qn.$$.fragment),RM=c(),Yn=a("div"),b(Ti.$$.fragment),NM=c(),b(Kn.$$.fragment),AM=c(),es=a("div"),b(yi.$$.fragment),VM=c(),b(ts.$$.fragment),Nu=c(),Vo=a("h2"),os=a("a"),Wp=a("span"),b(bi.$$.fragment),XM=c(),Rp=a("span"),SM=n("FlaxT5EncoderModel"),Au=c(),Xo=a("div"),b(ki.$$.fragment),PM=c(),lo=a("div"),b(vi.$$.fragment),LM=c(),So=a("p"),DM=n("The "),Sl=a("a"),OM=n("FlaxT5EncoderModel"),HM=n(" forward method, overrides the "),Np=a("code"),QM=n("__call__"),YM=n(" special method."),KM=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);k(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),ke=r(Po,"A",{href:!0});var Lp=i(ke);ve=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);k(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 kt=i(U);I=s(kt,"The T5 model was presented in "),pe=r(kt,"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(kt," by "),he=r(kt,"A",{href:!0,rel:!0});var Yp=i(he);ee=s(Yp,"Colin Raffel"),Yp.forEach(t),Pe=s(kt,", Noam Shazeer, "),ue=r(kt,"A",{href:!0,rel:!0});var Kp=i(ue);G=s(Kp,"Adam Roberts"),Kp.forEach(t),Le=s(kt,`, Katherine Lee, Sharan Narang,
Michael Matena, Yanqi Zhou, Wei Li, `),N=r(kt,"A",{href:!0,rel:!0});var eh=i(N);De=s(eh,"Peter J. Liu"),eh.forEach(t),Oe=s(kt,"."),kt.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 vt=i(R);Je=r(vt,"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(vt),st=r(vt,"LI",{});var c1=i(st);at=r(c1,"P",{});var p1=i(at);zt=s(p1,"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)."),p1.forEach(t),c1.forEach(t),X=p(vt),L=r(vt,"LI",{});var h1=i(L);rt=r(h1,"P",{});var u1=i(rt);$t=s(u1,"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."),u1.forEach(t),h1.forEach(t),te=p(vt),it=r(vt,"LI",{});var m1=i(it);lt=r(m1,"P",{});var f1=i(lt);Ke=s(f1,"T5 uses relative scalar embeddings. Encoder input padding can be done on the left and on the right."),f1.forEach(t),m1.forEach(t),Ft=p(vt),se=r(vt,"LI",{});var g1=i(se);ae=r(g1,"P",{});var ss=i(ae);hf=s(ss,"See the "),xi=r(ss,"A",{href:!0});var _1=i(xi);uf=s(_1,"training"),_1.forEach(t),mf=s(ss,", "),Ui=r(ss,"A",{href:!0});var T1=i(Ui);ff=s(T1,"inference"),T1.forEach(t),gf=s(ss," and "),Ji=r(ss,"A",{href:!0});var y1=i(Ji);_f=s(y1,"scripts"),y1.forEach(t),Tf=s(ss," sections below for all details regarding usage."),ss.forEach(t),g1.forEach(t),vt.forEach(t),uh=p(o),qi=r(o,"P",{});var b1=i(qi);yf=s(b1,"T5 comes in different sizes:"),b1.forEach(t),mh=p(o),dt=r(o,"UL",{});var co=i(dt);gd=r(co,"LI",{});var k1=i(gd);_d=r(k1,"P",{});var v1=i(_d);ys=r(v1,"A",{href:!0,rel:!0});var w1=i(ys);bf=s(w1,"t5-small"),w1.forEach(t),v1.forEach(t),k1.forEach(t),kf=p(co),Td=r(co,"LI",{});var M1=i(Td);yd=r(M1,"P",{});var E1=i(yd);bs=r(E1,"A",{href:!0,rel:!0});var z1=i(bs);vf=s(z1,"t5-base"),z1.forEach(t),E1.forEach(t),M1.forEach(t),wf=p(co),bd=r(co,"LI",{});var $1=i(bd);kd=r($1,"P",{});var F1=i(kd);ks=r(F1,"A",{href:!0,rel:!0});var j1=i(ks);Mf=s(j1,"t5-large"),j1.forEach(t),F1.forEach(t),$1.forEach(t),Ef=p(co),vd=r(co,"LI",{});var x1=i(vd);wd=r(x1,"P",{});var U1=i(wd);vs=r(U1,"A",{href:!0,rel:!0});var J1=i(vs);zf=s(J1,"t5-3b"),J1.forEach(t),U1.forEach(t),x1.forEach(t),$f=p(co),Md=r(co,"LI",{});var q1=i(Md);Ci=r(q1,"P",{});var e1=i(Ci);ws=r(e1,"A",{href:!0,rel:!0});var C1=i(ws);Ff=s(C1,"t5-11b"),C1.forEach(t),jf=s(e1,"."),e1.forEach(t),q1.forEach(t),co.forEach(t),fh=p(o),Ii=r(o,"P",{});var I1=i(Ii);xf=s(I1,"Based on the original T5 model, Google has released some follow-up works:"),I1.forEach(t),gh=p(o),ze=r(o,"UL",{});var pt=i(ze);Ed=r(pt,"LI",{});var G1=i(Ed);Oo=r(G1,"P",{});var lh=i(Oo);zd=r(lh,"STRONG",{});var Z1=i(zd);Uf=s(Z1,"T5v1.1"),Z1.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 B1=i(Gi);qf=s(B1,"here"),B1.forEach(t),Cf=s(lh,"."),lh.forEach(t),G1.forEach(t),If=p(pt),$d=r(pt,"LI",{});var W1=i($d);Ho=r(W1,"P",{});var dh=i(Ho);Fd=r(dh,"STRONG",{});var R1=i(Fd);Gf=s(R1,"mT5"),R1.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 N1=i(Zi);Bf=s(N1,"here"),N1.forEach(t),Wf=s(dh,"."),dh.forEach(t),W1.forEach(t),Rf=p(pt),jd=r(pt,"LI",{});var A1=i(jd);Qo=r(A1,"P",{});var ch=i(Qo);xd=r(ch,"STRONG",{});var V1=i(xd);Nf=s(V1,"byT5"),V1.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 X1=i(Bi);Vf=s(X1,"here"),X1.forEach(t),Xf=s(ch,"."),ch.forEach(t),A1.forEach(t),Sf=p(pt),Ud=r(pt,"LI",{});var S1=i(Ud);Wi=r(S1,"P",{});var t1=i(Wi);Jd=r(t1,"STRONG",{});var P1=i(Jd);Pf=s(P1,"UL2"),P1.forEach(t),Lf=s(t1,": UL2 is a T5 like model pretrained on various denoising objectives"),t1.forEach(t),S1.forEach(t),Df=p(pt),qd=r(pt,"LI",{});var L1=i(qd);S=r(L1,"P",{});var oe=i(S);Cd=r(oe,"STRONG",{});var D1=i(Cd);Of=s(D1,"Flan-T5"),D1.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 O1=i(Id);Qf=s(O1,"taskmaster2"),O1.forEach(t),Yf=s(oe,", "),Gd=r(oe,"CODE",{});var H1=i(Gd);Kf=s(H1,"djaym7/wiki_dialog"),H1.forEach(t),eg=s(oe,", "),Zd=r(oe,"CODE",{});var Q1=i(Zd);tg=s(Q1,"deepmind/code_contests"),Q1.forEach(t),og=s(oe,", "),Bd=r(oe,"CODE",{});var Y1=i(Bd);ng=s(Y1,"lambada"),Y1.forEach(t),sg=s(oe,", "),Wd=r(oe,"CODE",{});var K1=i(Wd);ag=s(K1,"gsm8k"),K1.forEach(t),rg=s(oe,", "),Rd=r(oe,"CODE",{});var e2=i(Rd);ig=s(e2,"aqua_rat"),e2.forEach(t),lg=s(oe,", "),Nd=r(oe,"CODE",{});var t2=i(Nd);dg=s(t2,"esnli"),t2.forEach(t),cg=s(oe,", "),Ad=r(oe,"CODE",{});var o2=i(Ad);pg=s(o2,"quasc"),o2.forEach(t),hg=s(oe," and "),Vd=r(oe,"CODE",{});var n2=i(Vd);ug=s(n2,"qed"),n2.forEach(t),mg=s(oe,"."),oe.forEach(t),L1.forEach(t),fg=p(pt),Xd=r(pt,"LI",{});var s2=i(Xd);Ri=r(s2,"P",{});var o1=i(Ri);Sd=r(o1,"STRONG",{});var a2=i(Sd);gg=s(a2,"FLan-UL2"),a2.forEach(t),_g=s(o1," : the UL2 model finetuned using the \u201CFlan\u201D prompt tuning and dataset collection."),o1.forEach(t),s2.forEach(t),Tg=p(pt),Pd=r(pt,"LI",{});var r2=i(Pd);Yo=r(r2,"P",{});var ph=i(Yo);Ld=r(ph,"STRONG",{});var i2=i(Ld);yg=s(i2,"UMT5"),i2.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 l2=i(Ni);kg=s(l2,"here"),l2.forEach(t),vg=s(ph,"."),ph.forEach(t),r2.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 d2=i(Ms);Mg=s(d2,"hub"),d2.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 c2=i(Es);$g=s(c2,"thomwolf"),c2.forEach(t),Fg=s(Pl,". The original code can be found "),zs=r(Pl,"A",{href:!0,rel:!0});var p2=i(zs);jg=s(p2,"here"),p2.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 h2=i(en);Dd=r(h2,"SPAN",{});var u2=i(Dd);k($s.$$.fragment,u2),u2.forEach(t),h2.forEach(t),Ug=p(Su),Od=r(Su,"SPAN",{});var m2=i(Od);Jg=s(m2,"Training"),m2.forEach(t),Su.forEach(t),kh=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 f2=i(Hd);Cg=s(f2,"input_ids"),f2.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 g2=i(Qd);Gg=s(g2,"decoder_input_ids"),g2.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 _2=i(Yd);Bg=s(_2,"labels"),_2.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),vh=p(o),tn=r(o,"P",{});var Pu=i(tn);Rg=s(Pu,"One can use "),Vi=r(Pu,"A",{href:!0});var T2=i(Vi);Ng=s(T2,"T5ForConditionalGeneration"),T2.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 y2=i(Xi);Kd=r(y2,"LI",{});var b2=i(Kd);Vg=s(b2,"Unsupervised denoising training"),b2.forEach(t),y2.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 k2=i(ec);Sg=s(k2,"a.k.a"),k2.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 v2=i(tc);Lg=s(v2,"real"),v2.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 w2=i(oc);Og=s(w2,"<extra_id_0>"),w2.forEach(t),Hg=s(ht,`,
`),nc=r(ht,"CODE",{});var M2=i(nc);Qg=s(M2,"<extra_id_1>"),M2.forEach(t),Yg=s(ht,", \u2026 up to "),sc=r(ht,"CODE",{});var E2=i(sc);Kg=s(E2,"<extra_id_99>"),E2.forEach(t),e_=s(ht,`. As a default, 100 sentinel tokens are available in
`),Si=r(ht,"A",{href:!0});var z2=i(Si);t_=s(z2,"T5Tokenizer"),z2.forEach(t),o_=s(ht,"."),ht.forEach(t),Eh=p(o),Pi=r(o,"P",{});var $2=i(Pi);n_=s($2,`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:`),$2.forEach(t),zh=p(o),k(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 F2=i(js);a_=s(F2,"run_t5_mlm_flax.py"),F2.forEach(t),r_=s(Lu,` script in the Examples
directory.`),Lu.forEach(t),Fh=p(o),Li=r(o,"UL",{});var j2=i(Li);ac=r(j2,"LI",{});var x2=i(ac);i_=s(x2,"Supervised training"),x2.forEach(t),j2.forEach(t),jh=p(o),Di=r(o,"P",{});var U2=i(Di);l_=s(U2,`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:`),U2.forEach(t),xh=p(o),k(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 J2=i(rc);c_=s(J2,"input_ids"),J2.forEach(t),p_=s(Re,` (which are the
`),ic=r(Re,"CODE",{});var q2=i(ic);h_=s(q2,"input_ids"),q2.forEach(t),u_=s(Re," of the encoded input sequence) and "),lc=r(Re,"CODE",{});var C2=i(lc);m_=s(C2,"labels"),C2.forEach(t),f_=s(Re," (which are the "),dc=r(Re,"CODE",{});var I2=i(dc);g_=s(I2,"input_ids"),I2.forEach(t),__=s(Re,` of the encoded
target sequence). The model will automatically create the `),cc=r(Re,"CODE",{});var G2=i(cc);T_=s(G2,"decoder_input_ids"),G2.forEach(t),y_=s(Re," based on the "),pc=r(Re,"CODE",{});var Z2=i(pc);b_=s(Z2,"labels"),Z2.forEach(t),k_=s(Re,`, by
shifting them one position to the right and prepending the `),hc=r(Re,"CODE",{});var B2=i(hc);v_=s(B2,"config.decoder_start_token_id"),B2.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 W2=i(uc);E_=s(W2,"max_source_length"),W2.forEach(t),z_=s(Ll," and "),mc=r(Ll,"CODE",{});var R2=i(mc);$_=s(R2,"max_target_length"),R2.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 N2=i(fc);x_=s(N2,"labels"),N2.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 A2=i(gc);J_=s(A2,"ignore_index"),A2.forEach(t),q_=s(ut,`
of the `),_c=r(ut,"CODE",{});var V2=i(_c);C_=s(V2,"CrossEntropyLoss"),V2.forEach(t),I_=s(ut,". In Flax, one can use the "),Tc=r(ut,"CODE",{});var X2=i(Tc);G_=s(X2,"decoder_attention_mask"),X2.forEach(t),Z_=s(ut,` to ignore padded tokens from
the loss (see the `),Us=r(ut,"A",{href:!0,rel:!0});var S2=i(Us);B_=s(S2,"Flax summarization script"),S2.forEach(t),W_=s(ut,` for details). We also pass
`),yc=r(ut,"CODE",{});var P2=i(yc);R_=s(P2,"attention_mask"),P2.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),k(Js.$$.fragment,o),Ih=p(o),Oi=r(o,"P",{});var L2=i(Oi);A_=s(L2,"Additional training tips:"),L2.forEach(t),Gh=p(o),Hi=r(o,"UL",{});var D2=i(Hi);qs=r(D2,"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 O2=i(bc);X_=s(O2,"Trainer"),O2.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),D2.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 H2=i(Cs);L_=s(H2,"this forum post"),H2.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 Q2=i(Is);O_=s(Q2,"paper"),Q2.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
`),kc=r(Ou,"EM",{});var Y2=i(kc);Y_=s(Y2,"pad_to_multiple_of"),Y2.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 K2=i(sn);vc=r(K2,"SPAN",{});var e0=i(vc);k(Gs.$$.fragment,e0),e0.forEach(t),K2.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),k(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),k(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),k(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);k(As.$$.fragment,h0),h0.forEach(t),p0.forEach(t),bT=p(Qu),Fc=r(Qu,"SPAN",{});var u0=i(Fc);kT=s(u0,"Performance"),u0.forEach(t),Qu.forEach(t),Hh=p(o),Ut=r(o,"P",{});var is=i(Ut);vT=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);k(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),k(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 k0=i(Ls);qT=s(k0,"finetune T5 for classification and multiple choice"),k0.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 v0=i(Os);ZT=s(v0,"finetune T5 for sentiment span extraction"),v0.forEach(t),BT=s(tm,". \u{1F30E}"),tm.forEach(t),Ku.forEach(t),tu=p(o),k(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),k(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),k(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),ky=p(Ne),dl=r(Ne,"LI",{});var n1=i(dl);ma=r(n1,"A",{href:!0,rel:!0});var B0=i(ma);vy=s(B0,"Summarization"),B0.forEach(t),wy=s(n1," chapter of the \u{1F917} Hugging Face course."),n1.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),k(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),k(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 "),ka=r(Fi,"A",{href:!0,rel:!0});var H0=i(ka);Vy=s(H0,"example script"),H0.forEach(t),Xy=s(Fi," and "),va=r(Fi,"A",{href:!0,rel:!0});var Q0=i(va);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),k(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 s1=i(Fa);ob=s(s1,"\u{1F680} "),Ic=r(s1,"STRONG",{});var oE=i(Ic);nb=s(oE,"Deploy"),oE.forEach(t),s1.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);k(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);k(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 `),kl=r(Ql,"A",{href:!0});var hE=i(kl);kb=s(hE,"PretrainedConfig"),hE.forEach(t),vb=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);k(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);k(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 "),vl=r(mm,"A",{href:!0});var _E=i(vl);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);k(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 a1=i(wl);Zb=s(a1,"single sequence: "),Nc=r(a1,"CODE",{});var yE=i(Nc);Bb=s(yE,"X </s>"),yE.forEach(t),a1.forEach(t),Wb=p(fm),Ml=r(fm,"LI",{});var r1=i(Ml);Rb=s(r1,"pair of sequences: "),Ac=r(r1,"CODE",{});var bE=i(Ac);Nb=s(bE,"A </s> B </s>"),bE.forEach(t),r1.forEach(t),fm.forEach(t),Yl.forEach(t),Ab=p(mt),un=r(mt,"DIV",{class:!0});var gm=i(un);k(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 kE=i(Vc);Sb=s(kE,"prepare_for_model"),kE.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);k(Va.$$.fragment,Tm),Db=p(Tm),Xc=r(Tm,"P",{});var vE=i(Xc);Ob=s(vE,`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.`),vE.forEach(t),Tm.forEach(t),Hb=p(mt),El=r(mt,"DIV",{class:!0});var wE=i(El);k(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);k(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);k(Pa.$$.fragment,ho),Kb=p(ho),ko=r(ho,"P",{});var Kl=i(ko);ek=s(Kl,"Construct a \u201Cfast\u201D T5 tokenizer (backed by HuggingFace\u2019s "),Lc=r(Kl,"EM",{});var $E=i(Lc);tk=s($E,"tokenizers"),$E.forEach(t),ok=s(Kl,` library). Based on
`),La=r(Kl,"A",{href:!0,rel:!0});var FE=i(La);nk=s(FE,"Unigram"),FE.forEach(t),sk=s(Kl,"."),Kl.forEach(t),ak=p(ho),Da=r(ho,"P",{});var bm=i(Da);rk=s(bm,"This tokenizer inherits from "),zl=r(bm,"A",{href:!0});var jE=i(zl);ik=s(jE,"PreTrainedTokenizerFast"),jE.forEach(t),lk=s(bm,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),bm.forEach(t),dk=p(ho),ao=r(ho,"DIV",{class:!0});var ed=i(ao);k(Oa.$$.fragment,ed),ck=p(ed),Dc=r(ed,"P",{});var xE=i(Dc);pk=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),hk=p(ed),Ha=r(ed,"UL",{});var km=i(Ha);$l=r(km,"LI",{});var i1=i($l);uk=s(i1,"single sequence: "),Oc=r(i1,"CODE",{});var UE=i(Oc);mk=s(UE,"X </s>"),UE.forEach(t),i1.forEach(t),fk=p(km),Fl=r(km,"LI",{});var l1=i(Fl);gk=s(l1,"pair of sequences: "),Hc=r(l1,"CODE",{});var JE=i(Hc);_k=s(JE,"A </s> B </s>"),JE.forEach(t),l1.forEach(t),km.forEach(t),ed.forEach(t),Tk=p(ho),gn=r(ho,"DIV",{class:!0});var vm=i(gn);k(Qa.$$.fragment,vm),yk=p(vm),Qc=r(vm,"P",{});var qE=i(Qc);bk=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),vm.forEach(t),ho.forEach(t),ku=p(o),vo=r(o,"H2",{class:!0});var wm=i(vo);_n=r(wm,"A",{id:!0,class:!0,href:!0});var CE=i(_n);Yc=r(CE,"SPAN",{});var IE=i(Yc);k(Ya.$$.fragment,IE),IE.forEach(t),CE.forEach(t),kk=p(wm),Kc=r(wm,"SPAN",{});var GE=i(Kc);vk=s(GE,"T5Model"),GE.forEach(t),wm.forEach(t),vu=p(o),qe=r(o,"DIV",{class:!0});var Nt=i(qe);k(Ka.$$.fragment,Nt),wk=p(Nt),ep=r(Nt,"P",{});var ZE=i(ep);Mk=s(ZE,"The bare T5 Model transformer outputting raw hidden-states without any specific head on top."),ZE.forEach(t),Ek=p(Nt),er=r(Nt,"P",{});var Mm=i(er);zk=s(Mm,"The T5 model was proposed in "),tr=r(Mm,"A",{href:!0,rel:!0});var BE=i(tr);$k=s(BE,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),BE.forEach(t),Fk=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),jk=p(Nt),or=r(Nt,"P",{});var Em=i(or);xk=s(Em,"This model inherits from "),jl=r(Em,"A",{href:!0});var WE=i(jl);Uk=s(WE,"PreTrainedModel"),WE.forEach(t),Jk=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),qk=p(Nt),nr=r(Nt,"P",{});var zm=i(nr);Ck=s(zm,"This model is also a PyTorch "),sr=r(zm,"A",{href:!0,rel:!0});var RE=i(sr);Ik=s(RE,"torch.nn.Module"),RE.forEach(t),Gk=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),Zk=p(Nt),qt=r(Nt,"DIV",{class:!0});var ds=i(qt);k(ar.$$.fragment,ds),Bk=p(ds),wo=r(ds,"P",{});var td=i(wo);Wk=s(td,"The "),xl=r(td,"A",{href:!0});var NE=i(xl);Rk=s(NE,"T5Model"),NE.forEach(t),Nk=s(td," forward method, overrides the "),tp=r(td,"CODE",{});var AE=i(tp);Ak=s(AE,"__call__"),AE.forEach(t),Vk=s(td," special method."),td.forEach(t),Xk=p(ds),k(Tn.$$.fragment,ds),Sk=p(ds),k(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);k(rr.$$.fragment,XE),XE.forEach(t),VE.forEach(t),Pk=p($m),np=r($m,"SPAN",{});var SE=i(np);Lk=s(SE,"T5ForConditionalGeneration"),SE.forEach(t),$m.forEach(t),Mu=p(o),Ce=r(o,"DIV",{class:!0});var At=i(Ce);k(ir.$$.fragment,At),Dk=p(At),lr=r(At,"P",{});var Fm=i(lr);Ok=s(Fm,"T5 Model with a "),sp=r(Fm,"CODE",{});var PE=i(sp);Hk=s(PE,"language modeling"),PE.forEach(t),Qk=s(Fm," head on top."),Fm.forEach(t),Yk=p(At),dr=r(At,"P",{});var jm=i(dr);Kk=s(jm,"The T5 model was proposed in "),cr=r(jm,"A",{href:!0,rel:!0});var LE=i(cr);ev=s(LE,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),LE.forEach(t),tv=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),ov=p(At),pr=r(At,"P",{});var xm=i(pr);nv=s(xm,"This model inherits from "),Ul=r(xm,"A",{href:!0});var DE=i(Ul);sv=s(DE,"PreTrainedModel"),DE.forEach(t),av=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),rv=p(At),hr=r(At,"P",{});var Um=i(hr);iv=s(Um,"This model is also a PyTorch "),ur=r(Um,"A",{href:!0,rel:!0});var OE=i(ur);lv=s(OE,"torch.nn.Module"),OE.forEach(t),dv=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),cv=p(At),Ct=r(At,"DIV",{class:!0});var cs=i(Ct);k(mr.$$.fragment,cs),pv=p(cs),Eo=r(cs,"P",{});var od=i(Eo);hv=s(od,"The "),Jl=r(od,"A",{href:!0});var HE=i(Jl);uv=s(HE,"T5ForConditionalGeneration"),HE.forEach(t),mv=s(od," forward method, overrides the "),ap=r(od,"CODE",{});var QE=i(ap);fv=s(QE,"__call__"),QE.forEach(t),gv=s(od," special method."),od.forEach(t),_v=p(cs),k(kn.$$.fragment,cs),Tv=p(cs),k(vn.$$.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);k(fr.$$.fragment,KE),KE.forEach(t),YE.forEach(t),yv=p(Jm),ip=r(Jm,"SPAN",{});var ez=i(ip);bv=s(ez,"T5EncoderModel"),ez.forEach(t),Jm.forEach(t),zu=p(o),Ie=r(o,"DIV",{class:!0});var Vt=i(Ie);k(gr.$$.fragment,Vt),kv=p(Vt),lp=r(Vt,"P",{});var tz=i(lp);vv=s(tz,"The bare T5 Model transformer outputting encoder\u2019s raw hidden-states without any specific head on top."),tz.forEach(t),wv=p(Vt),_r=r(Vt,"P",{});var qm=i(_r);Mv=s(qm,"The T5 model was proposed in "),Tr=r(qm,"A",{href:!0,rel:!0});var oz=i(Tr);Ev=s(oz,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),oz.forEach(t),zv=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),$v=p(Vt),yr=r(Vt,"P",{});var Cm=i(yr);Fv=s(Cm,"This model inherits from "),ql=r(Cm,"A",{href:!0});var nz=i(ql);jv=s(nz,"PreTrainedModel"),nz.forEach(t),xv=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),Uv=p(Vt),br=r(Vt,"P",{});var Im=i(br);Jv=s(Im,"This model is also a PyTorch "),kr=r(Im,"A",{href:!0,rel:!0});var sz=i(kr);qv=s(sz,"torch.nn.Module"),sz.forEach(t),Cv=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),Iv=p(Vt),It=r(Vt,"DIV",{class:!0});var ps=i(It);k(vr.$$.fragment,ps),Gv=p(ps),$o=r(ps,"P",{});var nd=i($o);Zv=s(nd,"The "),Cl=r(nd,"A",{href:!0});var az=i(Cl);Bv=s(az,"T5EncoderModel"),az.forEach(t),Wv=s(nd," forward method, overrides the "),dp=r(nd,"CODE",{});var rz=i(dp);Rv=s(rz,"__call__"),rz.forEach(t),Nv=s(nd," special method."),nd.forEach(t),Av=p(ps),k(Mn.$$.fragment,ps),Vv=p(ps),k(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);k(wr.$$.fragment,lz),lz.forEach(t),iz.forEach(t),Xv=p(Gm),pp=r(Gm,"SPAN",{});var dz=i(pp);Sv=s(dz,"T5ForSequenceClassification"),dz.forEach(t),Gm.forEach(t),Fu=p(o),Ge=r(o,"DIV",{class:!0});var Xt=i(Ge);k(Mr.$$.fragment,Xt),Pv=p(Xt),hp=r(Xt,"P",{});var cz=i(hp);Lv=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),Dv=p(Xt),Er=r(Xt,"P",{});var Zm=i(Er);Ov=s(Zm,"The T5 model was proposed in "),zr=r(Zm,"A",{href:!0,rel:!0});var pz=i(zr);Hv=s(pz,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),pz.forEach(t),Qv=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),Yv=p(Xt),$r=r(Xt,"P",{});var Bm=i($r);Kv=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);k(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),k($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);k(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);k(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),kw=s(rd,")."),rd.forEach(t),vw=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 kz=i(Cr);Mw=s(kz,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),kz.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 vz=i(Zl);Fw=s(vz,"PreTrainedModel"),vz.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);k(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),k(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);k(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);k(Rr.$$.fragment,ft),Xw=p(ft),kp=r(ft,"P",{});var jz=i(kp);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),k(Un.$$.fragment,ft),a5=p(ft),Gt=r(ft,"DIV",{class:!0});var hs=i(Gt);k(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 "),vp=r(dd,"CODE",{});var Cz=i(vp);c5=s(Cz,"__call__"),Cz.forEach(t),p5=s(dd," special method."),dd.forEach(t),h5=p(hs),k(Jn.$$.fragment,hs),u5=p(hs),k(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);k(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);k(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);k5=s(Hm,"The T5 model was proposed in "),Qr=r(Hm,"A",{href:!0,rel:!0});var Wz=i(Qr);v5=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),k(In.$$.fragment,gt),q5=p(gt),Zt=r(gt,"DIV",{class:!0});var us=i(Zt);k(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),k(Gn.$$.fragment,us),N5=p(us),k(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);k(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);k(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),eM=p(_t),ii=r(_t,"P",{});var of=i(ii);tM=s(of,"This model is also a "),li=r(of,"A",{href:!0,rel:!0});var Hz=i(li);oM=s(Hz,"tf.keras.Model"),Hz.forEach(t),nM=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),sM=p(_t),k(Wn.$$.fragment,_t),aM=p(_t),Bt=r(_t,"DIV",{class:!0});var ms=i(Bt);k(di.$$.fragment,ms),rM=p(ms),Bo=r(ms,"P",{});var pd=i(Bo);iM=s(pd,"The "),Xl=r(pd,"A",{href:!0});var Qz=i(Xl);lM=s(Qz,"TFT5EncoderModel"),Qz.forEach(t),dM=s(pd," forward method, overrides the "),xp=r(pd,"CODE",{});var Yz=i(xp);cM=s(Yz,"__call__"),Yz.forEach(t),pM=s(pd," special method."),pd.forEach(t),hM=p(ms),k(Rn.$$.fragment,ms),uM=p(ms),k(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);k(ci.$$.fragment,e$),e$.forEach(t),Kz.forEach(t),mM=p(nf),Jp=r(nf,"SPAN",{});var t$=i(Jp);fM=s(t$,"FlaxT5Model"),t$.forEach(t),nf.forEach(t),Bu=p(o),yt=r(o,"DIV",{class:!0});var fs=i(yt);k(pi.$$.fragment,fs),gM=p(fs),Wt=r(fs,"DIV",{class:!0});var gs=i(Wt);k(hi.$$.fragment,gs),_M=p(gs),Ro=r(gs,"P",{});var hd=i(Ro);TM=s(hd,"The "),qp=r(hd,"CODE",{});var o$=i(qp);yM=s(o$,"FlaxT5PreTrainedModel"),o$.forEach(t),bM=s(hd," forward method, overrides the "),Cp=r(hd,"CODE",{});var n$=i(Cp);kM=s(n$,"__call__"),n$.forEach(t),vM=s(hd," special method."),hd.forEach(t),wM=p(gs),k(Vn.$$.fragment,gs),MM=p(gs),k(Xn.$$.fragment,gs),gs.forEach(t),EM=p(fs),Sn=r(fs,"DIV",{class:!0});var sf=i(Sn);k(ui.$$.fragment,sf),zM=p(sf),k(Pn.$$.fragment,sf),sf.forEach(t),$M=p(fs),Ln=r(fs,"DIV",{class:!0});var af=i(Ln);k(mi.$$.fragment,af),FM=p(af),k(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);k(fi.$$.fragment,a$),a$.forEach(t),s$.forEach(t),jM=p(rf),Gp=r(rf,"SPAN",{});var r$=i(Gp);xM=s(r$,"FlaxT5ForConditionalGeneration"),r$.forEach(t),rf.forEach(t),Ru=p(o),bt=r(o,"DIV",{class:!0});var _s=i(bt);k(gi.$$.fragment,_s),UM=p(_s),Rt=r(_s,"DIV",{class:!0});var Ts=i(Rt);k(_i.$$.fragment,Ts),JM=p(Ts),Ao=r(Ts,"P",{});var ud=i(Ao);qM=s(ud,"The "),Zp=r(ud,"CODE",{});var i$=i(Zp);CM=s(i$,"FlaxT5PreTrainedModel"),i$.forEach(t),IM=s(ud," forward method, overrides the "),Bp=r(ud,"CODE",{});var l$=i(Bp);GM=s(l$,"__call__"),l$.forEach(t),ZM=s(ud," special method."),ud.forEach(t),BM=p(Ts),k(Hn.$$.fragment,Ts),WM=p(Ts),k(Qn.$$.fragment,Ts),Ts.forEach(t),RM=p(_s),Yn=r(_s,"DIV",{class:!0});var lf=i(Yn);k(Ti.$$.fragment,lf),NM=p(lf),k(Kn.$$.fragment,lf),lf.forEach(t),AM=p(_s),es=r(_s,"DIV",{class:!0});var df=i(es);k(yi.$$.fragment,df),VM=p(df),k(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);k(bi.$$.fragment,c$),c$.forEach(t),d$.forEach(t),XM=p(cf),Rp=r(cf,"SPAN",{});var p$=i(Rp);SM=s(p$,"FlaxT5EncoderModel"),p$.forEach(t),cf.forEach(t),Au=p(o),Xo=r(o,"DIV",{class:!0});var pf=i(Xo);k(ki.$$.fragment,pf),PM=p(pf),lo=r(pf,"DIV",{class:!0});var md=i(lo);k(vi.$$.fragment,md),LM=p(md),So=r(md,"P",{});var fd=i(So);DM=s(fd,"The "),Sl=r(fd,"A",{href:!0});var h$=i(Sl);OM=s(h$,"FlaxT5EncoderModel"),h$.forEach(t),HM=s(fd," forward method, overrides the "),Np=r(fd,"CODE",{});var u$=i(Np);QM=s(u$,"__call__"),u$.forEach(t),YM=s(fd," special method."),fd.forEach(t),KM=p(md),k(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"),d1(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"),d1(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(ve,"alt","Paper page"),d1(ve.src,ne="https://img.shields.io/badge/Paper%20page-1910.10683-green")||l(ve,"src",ne),l(ke,"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(ks,"href","https://huggingface.co/t5-large"),l(ks,"rel","nofollow"),l(vs,"href","https://huggingface.co/t5-3b"),l(vs,"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/main/en/model_doc/t5#transformers.T5ForConditionalGeneration"),l(Si,"href","/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/en/model_doc/t5#transformers.TFT5ForConditionalGeneration"),l(ka,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/translation"),l(ka,"rel","nofollow"),l(va,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation-tf.ipynb"),l(va,"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/main/en/model_doc/t5#transformers.T5Model"),l(yl,"href","/docs/transformers/main/en/model_doc/t5#transformers.TFT5Model"),l(qa,"href","https://huggingface.co/t5-small"),l(qa,"rel","nofollow"),l(bl,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(kl,"href","/docs/transformers/main/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(vl,"href","/docs/transformers/main/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/main/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(vo,"class","relative group"),l(tr,"href","https://arxiv.org/abs/1910.10683"),l(tr,"rel","nofollow"),l(jl,"href","/docs/transformers/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel"),l(kr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(kr,"rel","nofollow"),l(Cl,"href","/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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),v(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,ke),e(ke,ve),u(o,We,h),u(o,Q,h),e(Q,W),e(W,xe),v(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,kf),e(dt,Td),e(Td,yd),e(yd,bs),e(bs,vf),e(dt,wf),e(dt,bd),e(bd,kd),e(kd,ks),e(ks,Mf),e(dt,Ef),e(dt,vd),e(vd,wd),e(wd,vs),e(vs,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,kg),e(Yo,vg),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),v($s,Dd,null),e(uo,Ug),e(uo,Od),e(Od,Jg),u(o,kh,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,vh,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),v(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),v(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,k_),e(re,hc),e(hc,v_),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),v(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,kc),e(kc,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,vc),v(Gs,vc,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),v(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),v(Rs,o,h),u(o,Ph,h),u(o,tl,h),e(tl,yT),u(o,Lh,h),v(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),v(As,$c,null),e(fo,bT),e(fo,Fc),e(Fc,kT),u(o,Hh,h),u(o,Ut,h),e(Ut,vT),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),v(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),v(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),v(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),v(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),v(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,ky),e(ie,dl),e(dl,ma),e(ma,vy),e(dl,wy),e(ie,My),e(ie,qc),e(qc,cl),e(cl,Ey),u(o,iu,h),v(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),v(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,ka),e(ka,Vy),e(no,Xy),e(no,va),e(va,Sy),e(no,Py),e(to,Ly),e(to,Cc),e(Cc,gl),e(gl,Dy),u(o,pu,h),v(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),v(Ua,Gc,null),e(_o,ib),e(_o,Zc),e(Zc,lb),u(o,gu,h),u(o,Dt,h),v(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,kl),e(kl,kb),e(To,vb),u(o,_u,h),u(o,yo,h),e(yo,hn),e(hn,Bc),v(Ca,Bc,null),e(yo,wb),e(yo,Wc),e(Wc,Mb),u(o,Tu,h),u(o,fe,h),v(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,vl),e(vl,Ub),e(Ba,Jb),e(fe,qb),e(fe,so),v(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),v(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),v(Va,mn,null),e(mn,Db),e(mn,Xc),e(Xc,Ob),e(fe,Hb),e(fe,El),v(Xa,El,null),u(o,yu,h),u(o,bo,h),e(bo,fn),e(fn,Sc),v(Sa,Sc,null),e(bo,Qb),e(bo,Pc),e(Pc,Yb),u(o,bu,h),u(o,et,h),v(Pa,et,null),e(et,Kb),e(et,ko),e(ko,ek),e(ko,Lc),e(Lc,tk),e(ko,ok),e(ko,La),e(La,nk),e(ko,sk),e(et,ak),e(et,Da),e(Da,rk),e(Da,zl),e(zl,ik),e(Da,lk),e(et,dk),e(et,ao),v(Oa,ao,null),e(ao,ck),e(ao,Dc),e(Dc,pk),e(ao,hk),e(ao,Ha),e(Ha,$l),e($l,uk),e($l,Oc),e(Oc,mk),e(Ha,fk),e(Ha,Fl),e(Fl,gk),e(Fl,Hc),e(Hc,_k),e(et,Tk),e(et,gn),v(Qa,gn,null),e(gn,yk),e(gn,Qc),e(Qc,bk),u(o,ku,h),u(o,vo,h),e(vo,_n),e(_n,Yc),v(Ya,Yc,null),e(vo,kk),e(vo,Kc),e(Kc,vk),u(o,vu,h),u(o,qe,h),v(Ka,qe,null),e(qe,wk),e(qe,ep),e(ep,Mk),e(qe,Ek),e(qe,er),e(er,zk),e(er,tr),e(tr,$k),e(er,Fk),e(qe,jk),e(qe,or),e(or,xk),e(or,jl),e(jl,Uk),e(or,Jk),e(qe,qk),e(qe,nr),e(nr,Ck),e(nr,sr),e(sr,Ik),e(nr,Gk),e(qe,Zk),e(qe,qt),v(ar,qt,null),e(qt,Bk),e(qt,wo),e(wo,Wk),e(wo,xl),e(xl,Rk),e(wo,Nk),e(wo,tp),e(tp,Ak),e(wo,Vk),e(qt,Xk),v(Tn,qt,null),e(qt,Sk),v(yn,qt,null),u(o,wu,h),u(o,Mo,h),e(Mo,bn),e(bn,op),v(rr,op,null),e(Mo,Pk),e(Mo,np),e(np,Lk),u(o,Mu,h),u(o,Ce,h),v(ir,Ce,null),e(Ce,Dk),e(Ce,lr),e(lr,Ok),e(lr,sp),e(sp,Hk),e(lr,Qk),e(Ce,Yk),e(Ce,dr),e(dr,Kk),e(dr,cr),e(cr,ev),e(dr,tv),e(Ce,ov),e(Ce,pr),e(pr,nv),e(pr,Ul),e(Ul,sv),e(pr,av),e(Ce,rv),e(Ce,hr),e(hr,iv),e(hr,ur),e(ur,lv),e(hr,dv),e(Ce,cv),e(Ce,Ct),v(mr,Ct,null),e(Ct,pv),e(Ct,Eo),e(Eo,hv),e(Eo,Jl),e(Jl,uv),e(Eo,mv),e(Eo,ap),e(ap,fv),e(Eo,gv),e(Ct,_v),v(kn,Ct,null),e(Ct,Tv),v(vn,Ct,null),u(o,Eu,h),u(o,zo,h),e(zo,wn),e(wn,rp),v(fr,rp,null),e(zo,yv),e(zo,ip),e(ip,bv),u(o,zu,h),u(o,Ie,h),v(gr,Ie,null),e(Ie,kv),e(Ie,lp),e(lp,vv),e(Ie,wv),e(Ie,_r),e(_r,Mv),e(_r,Tr),e(Tr,Ev),e(_r,zv),e(Ie,$v),e(Ie,yr),e(yr,Fv),e(yr,ql),e(ql,jv),e(yr,xv),e(Ie,Uv),e(Ie,br),e(br,Jv),e(br,kr),e(kr,qv),e(br,Cv),e(Ie,Iv),e(Ie,It),v(vr,It,null),e(It,Gv),e(It,$o),e($o,Zv),e($o,Cl),e(Cl,Bv),e($o,Wv),e($o,dp),e(dp,Rv),e($o,Nv),e(It,Av),v(Mn,It,null),e(It,Vv),v(En,It,null),u(o,$u,h),u(o,Fo,h),e(Fo,zn),e(zn,cp),v(wr,cp,null),e(Fo,Xv),e(Fo,pp),e(pp,Sv),u(o,Fu,h),u(o,Ge,h),v(Mr,Ge,null),e(Ge,Pv),e(Ge,hp),e(hp,Lv),e(Ge,Dv),e(Ge,Er),e(Er,Ov),e(Er,zr),e(zr,Hv),e(Er,Qv),e(Ge,Yv),e(Ge,$r),e($r,Kv),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),v(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),v($n,ro,null),u(o,ju,h),u(o,xo,h),e(xo,Fn),e(Fn,mp),v(Ur,mp,null),e(xo,mw),e(xo,fp),e(fp,fw),u(o,xu,h),u(o,Ze,h),v(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,kw),e(Ze,vw),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),v(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),v(jn,io,null),u(o,Uu,h),u(o,qo,h),e(qo,xn),e(xn,yp),v(Wr,yp,null),e(qo,Aw),e(qo,bp),e(bp,Vw),u(o,Ju,h),u(o,ge,h),v(Rr,ge,null),e(ge,Xw),e(ge,kp),e(kp,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),v(Un,ge,null),e(ge,a5),e(ge,Gt),v(Pr,Gt,null),e(Gt,r5),e(Gt,Co),e(Co,i5),e(Co,Rl),e(Rl,l5),e(Co,d5),e(Co,vp),e(vp,c5),e(Co,p5),e(Gt,h5),v(Jn,Gt,null),e(Gt,u5),v(qn,Gt,null),u(o,qu,h),u(o,Io,h),e(Io,Cn),e(Cn,wp),v(Lr,wp,null),e(Io,m5),e(Io,Mp),e(Mp,f5),u(o,Cu,h),u(o,_e,h),v(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,k5),e(Hr,Qr),e(Qr,v5),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),v(In,_e,null),e(_e,q5),e(_e,Zt),v(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),v(Gn,Zt,null),e(Zt,N5),v(Zn,Zt,null),u(o,Iu,h),u(o,Zo,h),e(Zo,Bn),e(Bn,$p),v(oi,$p,null),e(Zo,A5),e(Zo,Fp),e(Fp,V5),u(o,Gu,h),u(o,Te,h),v(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,eM),e(Te,ii),e(ii,tM),e(ii,li),e(li,oM),e(ii,nM),e(Te,sM),v(Wn,Te,null),e(Te,aM),e(Te,Bt),v(di,Bt,null),e(Bt,rM),e(Bt,Bo),e(Bo,iM),e(Bo,Xl),e(Xl,lM),e(Bo,dM),e(Bo,xp),e(xp,cM),e(Bo,pM),e(Bt,hM),v(Rn,Bt,null),e(Bt,uM),v(Nn,Bt,null),u(o,Zu,h),u(o,Wo,h),e(Wo,An),e(An,Up),v(ci,Up,null),e(Wo,mM),e(Wo,Jp),e(Jp,fM),u(o,Bu,h),u(o,yt,h),v(pi,yt,null),e(yt,gM),e(yt,Wt),v(hi,Wt,null),e(Wt,_M),e(Wt,Ro),e(Ro,TM),e(Ro,qp),e(qp,yM),e(Ro,bM),e(Ro,Cp),e(Cp,kM),e(Ro,vM),e(Wt,wM),v(Vn,Wt,null),e(Wt,MM),v(Xn,Wt,null),e(yt,EM),e(yt,Sn),v(ui,Sn,null),e(Sn,zM),v(Pn,Sn,null),e(yt,$M),e(yt,Ln),v(mi,Ln,null),e(Ln,FM),v(Dn,Ln,null),u(o,Wu,h),u(o,No,h),e(No,On),e(On,Ip),v(fi,Ip,null),e(No,jM),e(No,Gp),e(Gp,xM),u(o,Ru,h),u(o,bt,h),v(gi,bt,null),e(bt,UM),e(bt,Rt),v(_i,Rt,null),e(Rt,JM),e(Rt,Ao),e(Ao,qM),e(Ao,Zp),e(Zp,CM),e(Ao,IM),e(Ao,Bp),e(Bp,GM),e(Ao,ZM),e(Rt,BM),v(Hn,Rt,null),e(Rt,WM),v(Qn,Rt,null),e(bt,RM),e(bt,Yn),v(Ti,Yn,null),e(Yn,NM),v(Kn,Yn,null),e(bt,AM),e(bt,es),v(yi,es,null),e(es,VM),v(ts,es,null),u(o,Nu,h),u(o,Vo,h),e(Vo,os),e(os,Wp),v(bi,Wp,null),e(Vo,XM),e(Vo,Rp),e(Rp,SM),u(o,Au,h),u(o,Xo,h),v(ki,Xo,null),e(Xo,PM),e(Xo,lo),v(vi,lo,null),e(lo,LM),e(lo,So),e(So,DM),e(So,Sl),e(Sl,OM),e(So,HM),e(So,Np),e(Np,QM),e(So,YM),e(lo,KM),v(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}),kn.$set(Vp);const Xp={};h&2&&(Xp.$$scope={dirty:h,ctx:o}),vn.$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 kt={};h&2&&(kt.$$scope={dirty:h,ctx:o}),Gn.$set(kt);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 vt={};h&2&&(vt.$$scope={dirty:h,ctx:o}),Hn.$set(vt);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(kn.$$.fragment,o),w(vn.$$.fragment,o),w(fr.$$.fragment,o),w(gr.$$.fragment,o),w(vr.$$.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(ki.$$.fragment,o),w(vi.$$.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(kn.$$.fragment,o),M(vn.$$.fragment,o),M(fr.$$.fragment,o),M(gr.$$.fragment,o),M(vr.$$.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(ki.$$.fragment,o),M(vi.$$.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(kh),o&&t(jt),o&&t(vh),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(ku),o&&t(vo),E(Ya),o&&t(vu),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(kn),E(vn),o&&t(Eu),o&&t(zo),E(fr),o&&t(zu),o&&t(Ie),E(gr),E(vr),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(ki),E(vi),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};
