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

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = T5Model.from_pretrained("t5-small")

input_ids = tokenizer(
    "Studies have been shown that owning a dog is good for you", return_tensors="pt"
).input_ids  # Batch size 1
decoder_input_ids = tokenizer("Studies show that", return_tensors="pt").input_ids  # Batch size 1

# preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.
# This is not needed for torch's T5ForConditionalGeneration as it does this internally using labels arg.
decoder_input_ids = model._shift_right(decoder_input_ids)

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

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = T5ForConditionalGeneration.from_pretrained("t5-small")

# training
input_ids = tokenizer("The <extra_id_0> walks in <extra_id_1> park", return_tensors="pt").input_ids
labels = tokenizer("<extra_id_0> cute dog <extra_id_1> the <extra_id_2>", return_tensors="pt").input_ids
outputs = model(input_ids=input_ids, labels=labels)
loss = outputs.loss
logits = outputs.logits

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

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

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = TFT5Model.from_pretrained("t5-small")

input_ids = tokenizer(
    "Studies have been shown that owning a dog is good for you", return_tensors="tf"
).input_ids  # Batch size 1
decoder_input_ids = tokenizer("Studies show that", return_tensors="tf").input_ids  # Batch size 1

# preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.
# This is not needed for torch's T5ForConditionalGeneration as it does this internally using labels arg.
decoder_input_ids = model._shift_right(decoder_input_ids)

# forward pass
outputs = model(input_ids, decoder_input_ids=decoder_input_ids)
last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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(){f=a("p"),k=n("Examples:"),g=c(),v(_.$$.fragment)},l(d){f=r(d,"P",{});var m=i(f);k=s(m,"Examples:"),m.forEach(t),g=p(d),b(_.$$.fragment,d)},m(d,m){u(d,f,m),e(f,k),u(d,g,m),y(_,d,m),T=!0},p:Ut,i(d){T||(w(_.$$.fragment,d),T=!0)},o(d){$(_.$$.fragment,d),T=!1},d(d){d&&t(f),d&&t(g),x(_,d)}}}function qx(q){let f,k,g,_,T,d,m,F,De,Ce,I,me,X,E,Se,U,_e,ot,Z,Q,ae,H,le,Ge,K,Ue,Ae,S,Be,ce,ge,C,P,Te,ee,Pe,ke,V,We,Oe,A,Re,J,G,ze,D,He,Ee,B,Ke,Y,Ve,ve,L,qe,N,Ye,Ze;return{c(){f=a("p"),k=n("TensorFlow models and layers in "),g=a("code"),_=n("transformers"),T=n(" accept two formats as input:"),d=c(),m=a("ul"),F=a("li"),De=n("having all inputs as keyword arguments (like PyTorch models), or"),Ce=c(),I=a("li"),me=n("having all inputs as a list, tuple or dict in the first positional argument."),X=c(),E=a("p"),Se=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 `),U=a("code"),_e=n("model.fit()"),ot=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=a("code"),Q=n("model.fit()"),ae=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),H=a("code"),le=n("fit()"),Ge=n(" and "),K=a("code"),Ue=n("predict()"),Ae=n(`, such as when creating your own layers or models with
the Keras `),S=a("code"),Be=n("Functional"),ce=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ge=c(),C=a("ul"),P=a("li"),Te=n("a single Tensor with "),ee=a("code"),Pe=n("input_ids"),ke=n(" only and nothing else: "),V=a("code"),We=n("model(input_ids)"),Oe=c(),A=a("li"),Re=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),J=a("code"),G=n("model([input_ids, attention_mask])"),ze=n(" or "),D=a("code"),He=n("model([input_ids, attention_mask, token_type_ids])"),Ee=c(),B=a("li"),Ke=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Y=a("code"),Ve=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve=c(),L=a("p"),qe=n(`Note that when creating models and layers with
`),N=a("a"),Ye=n("subclassing"),Ze=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){f=r(z,"P",{});var j=i(f);k=s(j,"TensorFlow models and layers in "),g=r(j,"CODE",{});var Tt=i(g);_=s(Tt,"transformers"),Tt.forEach(t),T=s(j," accept two formats as input:"),j.forEach(t),d=p(z),m=r(z,"UL",{});var be=i(m);F=r(be,"LI",{});var nt=i(F);De=s(nt,"having all inputs as keyword arguments (like PyTorch models), or"),nt.forEach(t),Ce=p(be),I=r(be,"LI",{});var st=i(I);me=s(st,"having all inputs as a list, tuple or dict in the first positional argument."),st.forEach(t),be.forEach(t),X=p(z),E=r(z,"P",{});var M=i(E);Se=s(M,`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 `),U=r(M,"CODE",{});var kt=i(U);_e=s(kt,"model.fit()"),kt.forEach(t),ot=s(M,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=r(M,"CODE",{});var at=i(Z);Q=s(at,"model.fit()"),at.forEach(t),ae=s(M,` supports! If, however, you want to use the second
format outside of Keras methods like `),H=r(M,"CODE",{});var re=i(H);le=s(re,"fit()"),re.forEach(t),Ge=s(M," and "),K=r(M,"CODE",{});var vt=i(K);Ue=s(vt,"predict()"),vt.forEach(t),Ae=s(M,`, such as when creating your own layers or models with
the Keras `),S=r(M,"CODE",{});var Je=i(S);Be=s(Je,"Functional"),Je.forEach(t),ce=s(M,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),M.forEach(t),ge=p(z),C=r(z,"UL",{});var W=i(C);P=r(W,"LI",{});var te=i(P);Te=s(te,"a single Tensor with "),ee=r(te,"CODE",{});var Xe=i(ee);Pe=s(Xe,"input_ids"),Xe.forEach(t),ke=s(te," only and nothing else: "),V=r(te,"CODE",{});var bt=i(V);We=s(bt,"model(input_ids)"),bt.forEach(t),te.forEach(t),Oe=p(W),A=r(W,"LI",{});var oe=i(A);Re=s(oe,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),J=r(oe,"CODE",{});var Qe=i(J);G=s(Qe,"model([input_ids, attention_mask])"),Qe.forEach(t),ze=s(oe," or "),D=r(oe,"CODE",{});var yt=i(D);He=s(yt,"model([input_ids, attention_mask, token_type_ids])"),yt.forEach(t),oe.forEach(t),Ee=p(W),B=r(W,"LI",{});var et=i(B);Ke=s(et,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Y=r(et,"CODE",{});var ft=i(Y);Ve=s(ft,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ft.forEach(t),et.forEach(t),W.forEach(t),ve=p(z),L=r(z,"P",{});var ne=i(L);qe=s(ne,`Note that when creating models and layers with
`),N=r(ne,"A",{href:!0,rel:!0});var wt=i(N);Ye=s(wt,"subclassing"),wt.forEach(t),Ze=s(ne,` 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!`),ne.forEach(t),this.h()},h(){l(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),l(N,"rel","nofollow")},m(z,j){u(z,f,j),e(f,k),e(f,g),e(g,_),e(f,T),u(z,d,j),u(z,m,j),e(m,F),e(F,De),e(m,Ce),e(m,I),e(I,me),u(z,X,j),u(z,E,j),e(E,Se),e(E,U),e(U,_e),e(E,ot),e(E,Z),e(Z,Q),e(E,ae),e(E,H),e(H,le),e(E,Ge),e(E,K),e(K,Ue),e(E,Ae),e(E,S),e(S,Be),e(E,ce),u(z,ge,j),u(z,C,j),e(C,P),e(P,Te),e(P,ee),e(ee,Pe),e(P,ke),e(P,V),e(V,We),e(C,Oe),e(C,A),e(A,Re),e(A,J),e(J,G),e(A,ze),e(A,D),e(D,He),e(C,Ee),e(C,B),e(B,Ke),e(B,Y),e(Y,Ve),u(z,ve,j),u(z,L,j),e(L,qe),e(L,N),e(N,Ye),e(L,Ze)},d(z){z&&t(f),z&&t(d),z&&t(m),z&&t(X),z&&t(E),z&&t(ge),z&&t(C),z&&t(ve),z&&t(L)}}}function Fx(q){let f,k,g,_,T;return{c(){f=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=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){f=r(d,"P",{});var m=i(f);k=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=i(g);_=s(F,"Module"),F.forEach(t),T=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(d,m){u(d,f,m),e(f,k),e(f,g),e(g,_),e(f,T)},d(d){d&&t(f)}}}function jx(q){let f,k,g,_,T;return _=new xe({props:{code:`from transformers import AutoTokenizer, TFT5ForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = TFT5ForConditionalGeneration.from_pretrained("t5-small")

# training
inputs = tokenizer("The <extra_id_0> walks in <extra_id_1> park", return_tensors="tf").input_ids
labels = tokenizer("<extra_id_0> cute dog <extra_id_1> the <extra_id_2>", return_tensors="tf").input_ids
outputs = model(inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits

# inference
inputs = tokenizer(
    "summarize: studies have shown that owning a dog is good for you", return_tensors="tf"
).input_ids  # Batch size 1
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# studies have shown that owning a dog is good for you`,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(){f=a("p"),k=n("Examples:"),g=c(),v(_.$$.fragment)},l(d){f=r(d,"P",{});var m=i(f);k=s(m,"Examples:"),m.forEach(t),g=p(d),b(_.$$.fragment,d)},m(d,m){u(d,f,m),e(f,k),u(d,g,m),y(_,d,m),T=!0},p:Ut,i(d){T||(w(_.$$.fragment,d),T=!0)},o(d){$(_.$$.fragment,d),T=!1},d(d){d&&t(f),d&&t(g),x(_,d)}}}function Mx(q){let f,k,g,_,T,d,m,F,De,Ce,I,me,X,E,Se,U,_e,ot,Z,Q,ae,H,le,Ge,K,Ue,Ae,S,Be,ce,ge,C,P,Te,ee,Pe,ke,V,We,Oe,A,Re,J,G,ze,D,He,Ee,B,Ke,Y,Ve,ve,L,qe,N,Ye,Ze;return{c(){f=a("p"),k=n("TensorFlow models and layers in "),g=a("code"),_=n("transformers"),T=n(" accept two formats as input:"),d=c(),m=a("ul"),F=a("li"),De=n("having all inputs as keyword arguments (like PyTorch models), or"),Ce=c(),I=a("li"),me=n("having all inputs as a list, tuple or dict in the first positional argument."),X=c(),E=a("p"),Se=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 `),U=a("code"),_e=n("model.fit()"),ot=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=a("code"),Q=n("model.fit()"),ae=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),H=a("code"),le=n("fit()"),Ge=n(" and "),K=a("code"),Ue=n("predict()"),Ae=n(`, such as when creating your own layers or models with
the Keras `),S=a("code"),Be=n("Functional"),ce=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ge=c(),C=a("ul"),P=a("li"),Te=n("a single Tensor with "),ee=a("code"),Pe=n("input_ids"),ke=n(" only and nothing else: "),V=a("code"),We=n("model(input_ids)"),Oe=c(),A=a("li"),Re=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),J=a("code"),G=n("model([input_ids, attention_mask])"),ze=n(" or "),D=a("code"),He=n("model([input_ids, attention_mask, token_type_ids])"),Ee=c(),B=a("li"),Ke=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Y=a("code"),Ve=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve=c(),L=a("p"),qe=n(`Note that when creating models and layers with
`),N=a("a"),Ye=n("subclassing"),Ze=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){f=r(z,"P",{});var j=i(f);k=s(j,"TensorFlow models and layers in "),g=r(j,"CODE",{});var Tt=i(g);_=s(Tt,"transformers"),Tt.forEach(t),T=s(j," accept two formats as input:"),j.forEach(t),d=p(z),m=r(z,"UL",{});var be=i(m);F=r(be,"LI",{});var nt=i(F);De=s(nt,"having all inputs as keyword arguments (like PyTorch models), or"),nt.forEach(t),Ce=p(be),I=r(be,"LI",{});var st=i(I);me=s(st,"having all inputs as a list, tuple or dict in the first positional argument."),st.forEach(t),be.forEach(t),X=p(z),E=r(z,"P",{});var M=i(E);Se=s(M,`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 `),U=r(M,"CODE",{});var kt=i(U);_e=s(kt,"model.fit()"),kt.forEach(t),ot=s(M,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=r(M,"CODE",{});var at=i(Z);Q=s(at,"model.fit()"),at.forEach(t),ae=s(M,` supports! If, however, you want to use the second
format outside of Keras methods like `),H=r(M,"CODE",{});var re=i(H);le=s(re,"fit()"),re.forEach(t),Ge=s(M," and "),K=r(M,"CODE",{});var vt=i(K);Ue=s(vt,"predict()"),vt.forEach(t),Ae=s(M,`, such as when creating your own layers or models with
the Keras `),S=r(M,"CODE",{});var Je=i(S);Be=s(Je,"Functional"),Je.forEach(t),ce=s(M,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),M.forEach(t),ge=p(z),C=r(z,"UL",{});var W=i(C);P=r(W,"LI",{});var te=i(P);Te=s(te,"a single Tensor with "),ee=r(te,"CODE",{});var Xe=i(ee);Pe=s(Xe,"input_ids"),Xe.forEach(t),ke=s(te," only and nothing else: "),V=r(te,"CODE",{});var bt=i(V);We=s(bt,"model(input_ids)"),bt.forEach(t),te.forEach(t),Oe=p(W),A=r(W,"LI",{});var oe=i(A);Re=s(oe,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),J=r(oe,"CODE",{});var Qe=i(J);G=s(Qe,"model([input_ids, attention_mask])"),Qe.forEach(t),ze=s(oe," or "),D=r(oe,"CODE",{});var yt=i(D);He=s(yt,"model([input_ids, attention_mask, token_type_ids])"),yt.forEach(t),oe.forEach(t),Ee=p(W),B=r(W,"LI",{});var et=i(B);Ke=s(et,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Y=r(et,"CODE",{});var ft=i(Y);Ve=s(ft,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ft.forEach(t),et.forEach(t),W.forEach(t),ve=p(z),L=r(z,"P",{});var ne=i(L);qe=s(ne,`Note that when creating models and layers with
`),N=r(ne,"A",{href:!0,rel:!0});var wt=i(N);Ye=s(wt,"subclassing"),wt.forEach(t),Ze=s(ne,` 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!`),ne.forEach(t),this.h()},h(){l(N,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),l(N,"rel","nofollow")},m(z,j){u(z,f,j),e(f,k),e(f,g),e(g,_),e(f,T),u(z,d,j),u(z,m,j),e(m,F),e(F,De),e(m,Ce),e(m,I),e(I,me),u(z,X,j),u(z,E,j),e(E,Se),e(E,U),e(U,_e),e(E,ot),e(E,Z),e(Z,Q),e(E,ae),e(E,H),e(H,le),e(E,Ge),e(E,K),e(K,Ue),e(E,Ae),e(E,S),e(S,Be),e(E,ce),u(z,ge,j),u(z,C,j),e(C,P),e(P,Te),e(P,ee),e(ee,Pe),e(P,ke),e(P,V),e(V,We),e(C,Oe),e(C,A),e(A,Re),e(A,J),e(J,G),e(A,ze),e(A,D),e(D,He),e(C,Ee),e(C,B),e(B,Ke),e(B,Y),e(Y,Ve),u(z,ve,j),u(z,L,j),e(L,qe),e(L,N),e(N,Ye),e(L,Ze)},d(z){z&&t(f),z&&t(d),z&&t(m),z&&t(X),z&&t(E),z&&t(ge),z&&t(C),z&&t(ve),z&&t(L)}}}function Cx(q){let f,k,g,_,T;return{c(){f=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=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){f=r(d,"P",{});var m=i(f);k=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=i(g);_=s(F,"Module"),F.forEach(t),T=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(d,m){u(d,f,m),e(f,k),e(f,g),e(g,_),e(f,T)},d(d){d&&t(f)}}}function Ax(q){let f,k,g,_,T;return _=new xe({props:{code:`from transformers import AutoTokenizer, TFT5EncoderModel

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = TFT5EncoderModel.from_pretrained("t5-small")

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

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = FlaxT5Model.from_pretrained("t5-small")

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

# preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.
# This is not needed for torch's T5ForConditionalGeneration as it does this internally using labels arg.
decoder_input_ids = model._shift_right(decoder_input_ids)

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

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = FlaxT5ForConditionalGeneration.from_pretrained("t5-small")

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

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = FlaxT5ForConditionalGeneration.from_pretrained("t5-small")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, return_tensors="np")
encoder_outputs = model.encode(**inputs)

decoder_start_token_id = model.config.decoder_start_token_id
decoder_input_ids = jnp.ones((inputs.input_ids.shape[0], 1), dtype="i4") * decoder_start_token_id

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

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = FlaxT5ForConditionalGeneration.from_pretrained("t5-small")

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

# Generate Summary
summary_ids = model.generate(inputs["input_ids"]).sequences
print(tokenizer.decode(summary_ids[0], skip_special_tokens=True, clean_up_tokenization_spaces=False))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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(){f=a("p"),k=n("Example:"),g=c(),v(_.$$.fragment)},l(d){f=r(d,"P",{});var m=i(f);k=s(m,"Example:"),m.forEach(t),g=p(d),b(_.$$.fragment,d)},m(d,m){u(d,f,m),e(f,k),u(d,g,m),y(_,d,m),T=!0},p:Ut,i(d){T||(w(_.$$.fragment,d),T=!0)},o(d){$(_.$$.fragment,d),T=!1},d(d){d&&t(f),d&&t(g),x(_,d)}}}function Sx(q){let f,k,g,_,T;return _=new xe({props:{code:`from transformers import AutoTokenizer, FlaxT5ForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = FlaxT5ForConditionalGeneration.from_pretrained("t5-small")

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

tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = FlaxT5ForConditionalGeneration.from_pretrained("t5-small")

text = "summarize: My friends are cool but they eat too many carbs."
inputs = tokenizer(text, return_tensors="np")
encoder_outputs = model.encode(**inputs)

decoder_start_token_id = model.config.decoder_start_token_id
decoder_input_ids = jnp.ones((inputs.input_ids.shape[0], 1), dtype="i4") * decoder_start_token_id

outputs = model.decode(decoder_input_ids, encoder_outputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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(){f=a("p"),k=n("Example:"),g=c(),v(_.$$.fragment)},l(d){f=r(d,"P",{});var m=i(f);k=s(m,"Example:"),m.forEach(t),g=p(d),b(_.$$.fragment,d)},m(d,m){u(d,f,m),e(f,k),u(d,g,m),y(_,d,m),T=!0},p:Ut,i(d){T||(w(_.$$.fragment,d),T=!0)},o(d){$(_.$$.fragment,d),T=!1},d(d){d&&t(f),d&&t(g),x(_,d)}}}function Ux(q){let f,k,g,_,T;return{c(){f=a("p"),k=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),_=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){f=r(d,"P",{});var m=i(f);k=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var F=i(g);_=s(F,"Module"),F.forEach(t),T=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(d,m){u(d,f,m),e(f,k),e(f,g),e(g,_),e(f,T)},d(d){d&&t(f)}}}function Bx(q){let f,k,g,_,T,d,m,F,De,Ce,I,me,X,E,Se,U,_e,ot,Z,Q,ae,H,le,Ge,K,Ue,Ae,S,Be,ce,ge,C,P,Te,ee,Pe,ke,V,We,Oe,A,Re,J,G,ze,D,He,Ee,B,Ke,Y,Ve,ve,L,qe,N,Ye,Ze,z,j,Tt,be,nt,st,M,kt,at,re,vt,Je,W,te,Xe,bt,oe,Qe,yt,et,ft,ne,wt,ip,rt,$d,xd,ts,Hu,Ku,zd,Ed,os,Vu,Yu,qd,Fd,ns,Zu,Ju,jd,Md,ss,Xu,Qu,Cd,Xr,as,ef,tf,dp,Qr,of,lp,Le,Ad,Lo,Pd,nf,sf,ei,af,rf,df,Od,No,Ld,lf,cf,ti,pf,hf,uf,Nd,Io,Id,ff,mf,oi,_f,gf,Tf,Dd,ni,Sd,kf,vf,bf,Gd,R,Ud,yf,wf,Bd,$f,xf,Wd,zf,Ef,Rd,qf,Ff,Hd,jf,Mf,Kd,Cf,Af,Vd,Pf,Of,Yd,Lf,Nf,Zd,If,Df,Jd,Sf,Gf,Uf,Xd,si,Qd,Bf,Wf,cp,Do,Rf,rs,Hf,Kf,pp,Rt,Vf,is,Yf,Zf,ds,Jf,Xf,hp,ai,up,ao,So,el,ls,Qf,tl,em,fp,$t,tm,ol,om,nm,nl,sm,am,sl,rm,im,mp,Go,dm,ri,lm,cm,_p,ii,al,pm,gp,ye,hm,rl,um,fm,il,mm,_m,dl,gm,Tm,ll,km,vm,cl,bm,ym,di,wm,$m,Tp,li,xm,kp,cs,vp,Uo,zm,ps,Em,qm,bp,ci,pl,Fm,yp,pi,jm,wp,hs,$p,ie,Mm,hl,Cm,Am,ul,Pm,Om,fl,Lm,Nm,ml,Im,Dm,_l,Sm,Gm,gl,Um,Bm,Tl,Wm,Rm,xp,Ht,Hm,kl,Km,Vm,vl,Ym,Zm,zp,we,Jm,bl,Xm,Qm,yl,e_,t_,wl,o_,n_,$l,s_,a_,us,r_,i_,xl,d_,l_,Ep,fs,qp,hi,c_,Fp,ui,ms,p_,zl,h_,u_,jp,Kt,f_,_s,m_,__,gs,g_,T_,Mp,Bo,k_,El,v_,b_,Cp,fi,Ap,ro,Wo,ql,Ts,y_,Fl,w_,Pp,xt,$_,mi,x_,z_,ks,E_,q_,vs,F_,j_,Op,bs,Lp,it,M_,jl,C_,A_,Ml,P_,O_,_i,L_,N_,Cl,I_,D_,Np,gi,S_,Ip,ys,Dp,Ti,G_,Sp,ws,Gp,ki,Up,io,Ro,Al,$s,U_,Pl,B_,Bp,zt,W_,xs,R_,H_,Ol,K_,V_,Ll,Y_,Z_,Wp,lo,Ho,Nl,zs,J_,Il,X_,Rp,vi,Q_,Hp,Es,Kp,Ko,qs,eg,Fs,tg,og,ng,js,sg,Ms,ag,rg,Vp,Cs,Yp,bi,As,ig,Ps,dg,lg,Zp,Os,Jp,yi,Ls,cg,Ns,pg,hg,Xp,Is,Qp,de,Ds,ug,Ss,fg,mg,_g,Gs,gg,Us,Tg,kg,vg,Bs,bg,Ws,yg,wg,$g,Vt,wi,xg,zg,Rs,Eg,qg,Hs,Fg,jg,Mg,Yt,$i,Cg,Ag,Ks,Pg,Og,Vs,Lg,Ng,Ig,Vo,xi,Dg,Sg,Ys,Gg,Ug,Bg,zi,Zs,Wg,Rg,Hg,Dl,Ei,Kg,eh,Js,th,qi,Et,Fi,Vg,Yg,Xs,Zg,Jg,ji,Xg,Qg,Qs,eT,tT,oh,ea,nh,Zt,Jt,Mi,oT,nT,ta,sT,aT,oa,rT,iT,dT,Xt,Ci,lT,cT,na,pT,hT,sa,uT,fT,mT,Sl,Ai,_T,sh,aa,ah,Yo,ra,gT,ia,TT,kT,vT,da,bT,la,yT,wT,rh,ca,$T,Gl,xT,ih,Pi,pa,zT,ha,ET,qT,dh,co,Zo,Ul,ua,FT,Bl,jT,lh,Bt,fa,MT,Wt,CT,Oi,AT,PT,Li,OT,LT,ma,NT,IT,DT,po,ST,Ni,GT,UT,Ii,BT,WT,ch,ho,Jo,Wl,_a,RT,Rl,HT,ph,pe,ga,KT,Ta,VT,ka,YT,ZT,JT,va,XT,Di,QT,ek,tk,Qt,ba,ok,Hl,nk,sk,ya,Si,ak,Kl,rk,ik,Gi,dk,Vl,lk,ck,Xo,wa,pk,$a,hk,Yl,uk,fk,mk,Qo,xa,_k,Zl,gk,Tk,Ui,za,hh,uo,en,Jl,Ea,kk,Xl,vk,uh,tt,qa,bk,fo,yk,Ql,wk,$k,Fa,xk,zk,Ek,ja,qk,Bi,Fk,jk,Mk,eo,Ma,Ck,ec,Ak,Pk,Ca,Wi,Ok,tc,Lk,Nk,Ri,Ik,oc,Dk,Sk,tn,Aa,Gk,nc,Uk,fh,mo,on,sc,Pa,Bk,ac,Wk,mh,Fe,Oa,Rk,rc,Hk,Kk,La,Vk,Na,Yk,Zk,Jk,Ia,Xk,Hi,Qk,ev,tv,Da,ov,Sa,nv,sv,av,qt,Ga,rv,_o,iv,Ki,dv,lv,ic,cv,pv,hv,nn,uv,sn,_h,go,an,dc,Ua,fv,lc,mv,gh,je,Ba,_v,Wa,gv,cc,Tv,kv,vv,Ra,bv,Ha,yv,wv,$v,Ka,xv,Vi,zv,Ev,qv,Va,Fv,Ya,jv,Mv,Cv,Ft,Za,Av,To,Pv,Yi,Ov,Lv,pc,Nv,Iv,Dv,rn,Sv,dn,Th,ko,ln,hc,Ja,Gv,uc,Uv,kh,Me,Xa,Bv,fc,Wv,Rv,Qa,Hv,er,Kv,Vv,Yv,tr,Zv,Zi,Jv,Xv,Qv,or,eb,nr,tb,ob,nb,jt,sr,sb,vo,ab,Ji,rb,ib,mc,db,lb,cb,cn,pb,pn,vh,bo,hn,_c,ar,hb,gc,ub,bh,he,rr,fb,Tc,mb,_b,ir,gb,dr,Tb,kb,vb,lr,bb,Xi,yb,wb,$b,cr,xb,pr,zb,Eb,qb,un,Fb,Mt,hr,jb,yo,Mb,Qi,Cb,Ab,kc,Pb,Ob,Lb,fn,Nb,mn,yh,wo,_n,vc,ur,Ib,bc,Db,wh,ue,fr,Sb,mr,Gb,yc,Ub,Bb,Wb,_r,Rb,gr,Hb,Kb,Vb,Tr,Yb,ed,Zb,Jb,Xb,kr,Qb,vr,ey,ty,oy,gn,ny,Ct,br,sy,$o,ay,td,ry,iy,wc,dy,ly,cy,Tn,py,kn,$h,xo,vn,$c,yr,hy,xc,uy,xh,fe,wr,fy,zc,my,_y,$r,gy,xr,Ty,ky,vy,zr,by,od,yy,wy,$y,Er,xy,qr,zy,Ey,qy,bn,Fy,At,Fr,jy,zo,My,nd,Cy,Ay,Ec,Py,Oy,Ly,yn,Ny,wn,zh,Eo,$n,qc,jr,Iy,Fc,Dy,Eh,mt,Mr,Sy,Pt,Cr,Gy,qo,Uy,jc,By,Wy,Mc,Ry,Hy,Ky,xn,Vy,zn,Yy,En,Ar,Zy,qn,Jy,Fn,Pr,Xy,jn,qh,Fo,Mn,Cc,Or,Qy,Ac,e5,Fh,_t,Lr,t5,Ot,Nr,o5,jo,n5,Pc,s5,a5,Oc,r5,i5,d5,Cn,l5,An,c5,Pn,Ir,p5,On,h5,Ln,Dr,u5,Nn,jh,Mo,In,Lc,Sr,f5,Nc,m5,Mh,Co,Gr,_5,to,Ur,g5,Ao,T5,sd,k5,v5,Ic,b5,y5,w5,Dn,Ch;return d=new $e({}),le=new $e({}),ls=new $e({}),cs=new xe({props:{code:`from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("t5-small")
model = T5ForConditionalGeneration.from_pretrained("t5-small")

input_ids = tokenizer("The <extra_id_0> walks in <extra_id_1> park", return_tensors="pt").input_ids
labels = tokenizer("<extra_id_0> cute dog <extra_id_1> the <extra_id_2>", return_tensors="pt").input_ids

# the forward function automatically creates the correct decoder_input_ids
loss = model(input_ids=input_ids, labels=labels).loss
loss.item()`,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>`}}),hs=new xe({props:{code:`from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("t5-small")
model = T5ForConditionalGeneration.from_pretrained("t5-small")

input_ids = tokenizer("translate English to German: The house is wonderful.", return_tensors="pt").input_ids
labels = tokenizer("Das Haus ist wunderbar.", return_tensors="pt").input_ids

# the forward function automatically creates the correct decoder_input_ids
loss = model(input_ids=input_ids, labels=labels).loss
loss.item()`,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>`}}),fs=new xe({props:{code:`from transformers import T5Tokenizer, T5ForConditionalGeneration
import torch

tokenizer = T5Tokenizer.from_pretrained("t5-small")
model = T5ForConditionalGeneration.from_pretrained("t5-small")

# the following 2 hyperparameters are task-specific
max_source_length = 512
max_target_length = 128

# Suppose we have the following 2 training examples:
input_sequence_1 = "Welcome to NYC"
output_sequence_1 = "Bienvenue \xE0 NYC"

input_sequence_2 = "HuggingFace is a company"
output_sequence_2 = "HuggingFace est une entreprise"

# encode the inputs
task_prefix = "translate English to French: "
input_sequences = [input_sequence_1, input_sequence_2]

encoding = tokenizer(
    [task_prefix + sequence for sequence in input_sequences],
    padding="longest",
    max_length=max_source_length,
    truncation=True,
    return_tensors="pt",
)

input_ids, attention_mask = encoding.input_ids, encoding.attention_mask

# encode the targets
target_encoding = tokenizer(
    [output_sequence_1, output_sequence_2],
    padding="longest",
    max_length=max_target_length,
    truncation=True,
    return_tensors="pt",
)
labels = target_encoding.input_ids

# replace padding token id's of the labels by -100 so it's ignored by the loss
labels[labels == tokenizer.pad_token_id] = -100

# forward pass
loss = model(input_ids=input_ids, attention_mask=attention_mask, labels=labels).loss
loss.item()`,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>`}}),Ts=new $e({}),bs=new xe({props:{code:`from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("t5-small")
model = T5ForConditionalGeneration.from_pretrained("t5-small")

input_ids = tokenizer("translate English to German: The house is wonderful.", return_tensors="pt").input_ids
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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.`}}),ys=new xe({props:{code:`from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("t5-small")
model = T5ForConditionalGeneration.from_pretrained("t5-small")

task_prefix = "translate English to German: "
# use different length sentences to test batching
sentences = ["The house is wonderful.", "I like to work in NYC."]

inputs = tokenizer([task_prefix + sentence for sentence in sentences], return_tensors="pt", padding=True)

output_sequences = model.generate(
    input_ids=inputs["input_ids"],
    attention_mask=inputs["attention_mask"],
    do_sample=False,  # disable sampling to test if batching affects output
)

print(tokenizer.batch_decode(output_sequences, skip_special_tokens=True))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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>]`}}),ws=new xe({props:{code:`from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("t5-small")
model = T5ForConditionalGeneration.from_pretrained("t5-small")

input_ids = tokenizer("The <extra_id_0> walks in <extra_id_1> park", return_tensors="pt").input_ids

sequence_ids = model.generate(input_ids)
sequences = tokenizer.batch_decode(sequence_ids)
sequences`,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>]`}}),$s=new $e({}),zs=new $e({}),Es=new Jr({props:{pipeline:"text-classification"}}),Cs=new Jr({props:{pipeline:"token-classification"}}),Os=new Jr({props:{pipeline:"text-generation"}}),Is=new Jr({props:{pipeline:"summarization"}}),Js=new Jr({props:{pipeline:"fill-mask"}}),ea=new Jr({props:{pipeline:"translation"}}),aa=new Jr({props:{pipeline:"question-answering"}}),ua=new $e({}),fa=new O({props:{name:"class transformers.T5Config",anchor:"transformers.T5Config",parameters:[{name:"vocab_size",val:" = 32128"},{name:"d_model",val:" = 512"},{name:"d_kv",val:" = 64"},{name:"d_ff",val:" = 2048"},{name:"num_layers",val:" = 6"},{name:"num_decoder_layers",val:" = None"},{name:"num_heads",val:" = 8"},{name:"relative_attention_num_buckets",val:" = 32"},{name:"relative_attention_max_distance",val:" = 128"},{name:"dropout_rate",val:" = 0.1"},{name:"layer_norm_epsilon",val:" = 1e-06"},{name:"initializer_factor",val:" = 1.0"},{name:"feed_forward_proj",val:" = 'relu'"},{name:"is_encoder_decoder",val:" = True"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.T5Config.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32128) &#x2014;
Vocabulary size of the T5 model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/t5#transformers.T5Model">T5Model</a> or <a href="/docs/transformers/v4.27.1/en/model_doc/t5#transformers.TFT5Model">TFT5Model</a>.`,name:"vocab_size"},{anchor:"transformers.T5Config.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Size of the encoder layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.T5Config.d_kv",description:`<strong>d_kv</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Size of the key, query, value projections per attention head. The <code>inner_dim</code> of the projection layer will
be defined as <code>num_heads * d_kv</code>.`,name:"d_kv"},{anchor:"transformers.T5Config.d_ff",description:`<strong>d_ff</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Size of the intermediate feed forward layer in each <code>T5Block</code>.`,name:"d_ff"},{anchor:"transformers.T5Config.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_layers"},{anchor:"transformers.T5Config.num_decoder_layers",description:`<strong>num_decoder_layers</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of hidden layers in the Transformer decoder. Will use the same value as <code>num_layers</code> if not set.`,name:"num_decoder_layers"},{anchor:"transformers.T5Config.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.T5Config.relative_attention_num_buckets",description:`<strong>relative_attention_num_buckets</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The number of buckets to use for each attention layer.`,name:"relative_attention_num_buckets"},{anchor:"transformers.T5Config.relative_attention_max_distance",description:`<strong>relative_attention_max_distance</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
The maximum distance of the longer sequences for the bucket separation.`,name:"relative_attention_max_distance"},{anchor:"transformers.T5Config.dropout_rate",description:`<strong>dropout_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The ratio for all dropout layers.`,name:"dropout_rate"},{anchor:"transformers.T5Config.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-6) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.T5Config.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.T5Config.feed_forward_proj",description:`<strong>feed_forward_proj</strong> (<code>string</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
Type of feed forward layer to be used. Should be one of <code>&quot;relu&quot;</code> or <code>&quot;gated-gelu&quot;</code>. T5v1.1 uses the
<code>&quot;gated-gelu&quot;</code> feed forward projection. Original T5 uses <code>&quot;relu&quot;</code>.`,name:"feed_forward_proj"},{anchor:"transformers.T5Config.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/t5/configuration_t5.py#L34"}}),_a=new $e({}),ga=new O({props:{name:"class transformers.T5Tokenizer",anchor:"transformers.T5Tokenizer",parameters:[{name:"vocab_file",val:""},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"extra_ids",val:" = 100"},{name:"additional_special_tokens",val:" = None"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.T5Tokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.T5Tokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

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

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