import{S as Mh,i as xh,s as zh,e as o,k as p,w as v,t as l,M as jh,c as a,d as n,m,a as r,x as k,h as i,b as u,G as e,g as _,y as $,q as w,o as y,B as M,v as Eh,L}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ep}from"../../chunks/Tip-hf-doc-builder.js";import{D as z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as N}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as U}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as S}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function qh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import MT5Model, AutoTokenizer

model = MT5Model.from_pretrained("google/mt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")
article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
summary = "Weiter Verhandlung in Syrien."
inputs = tokenizer(article, return_tensors="pt")
labels = tokenizer(text_target=summary, return_tensors="pt")

outputs = model(input_ids=inputs["input_ids"], decoder_input_ids=labels["input_ids"])
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> MT5Model, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MT5Model.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Offizier sagt, dass weiter verhandelt werden muss in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary = <span class="hljs-string">&quot;Weiter Verhandlung in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(article, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(text_target=summary, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], decoder_input_ids=labels[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_states = outputs.last_hidden_state`}}),{c(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Fh(x){let c,b,f,d,T;return d=new N({props:{code:`# On a 4 GPU machine with mt5-xl:
model = MT5ForConditionalGeneration.from_pretrained("Mt5-xl")
device_map = {
    0: [0, 1, 2],
    1: [3, 4, 5, 6, 7, 8, 9],
    2: [10, 11, 12, 13, 14, 15, 16],
    3: [17, 18, 19, 20, 21, 22, 23],
}
model.parallelize(device_map)  # Splits the model across several devices
model.deparallelize()  # Put the model back on cpu and cleans memory by calling torch.cuda.empty_cache()`,highlighted:`<span class="hljs-comment"># On a 4 GPU machine with mt5-xl:</span>
model = MT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;Mt5-xl&quot;</span>)
device_map = {
    <span class="hljs-number">0</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>],
    <span class="hljs-number">1</span>: [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>],
    <span class="hljs-number">2</span>: [<span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">12</span>, <span class="hljs-number">13</span>, <span class="hljs-number">14</span>, <span class="hljs-number">15</span>, <span class="hljs-number">16</span>],
    <span class="hljs-number">3</span>: [<span class="hljs-number">17</span>, <span class="hljs-number">18</span>, <span class="hljs-number">19</span>, <span class="hljs-number">20</span>, <span class="hljs-number">21</span>, <span class="hljs-number">22</span>, <span class="hljs-number">23</span>],
}
model.parallelize(device_map)  <span class="hljs-comment"># Splits the model across several devices</span>
model.deparallelize()  <span class="hljs-comment"># Put the model back on cpu and cleans memory by calling torch.cuda.empty_cache()</span>`}}),{c(){c=o("p"),b=l("Example:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Example:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Ph(x){let c,b,f,d,T;return{c(){c=o("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=o("code"),d=l("Module"),T=l(`
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(s){c=a(s,"P",{});var h=r(c);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var G=r(f);d=i(G,"Module"),G.forEach(n),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(n)},m(s,h){_(s,c,h),e(c,b),e(c,f),e(f,d),e(c,T)},d(s){s&&n(c)}}}function Ch(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import AutoTokenizer, MT5Model

tokenizer = AutoTokenizer.from_pretrained("mt5-small")
model = MT5Model.from_pretrained("mt5-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 MT5Model.
# This is not needed for torch's MT5ForConditionalGeneration 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, MT5Model

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MT5Model.from_pretrained(<span class="hljs-string">&quot;mt5-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 MT5Model.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This is not needed for torch&#x27;s MT5ForConditionalGeneration 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(){c=o("p"),b=l("Example:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Example:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Ah(x){let c,b,f,d,T;return d=new N({props:{code:`# Here is an example of a device map on a machine with 4 GPUs using mt5-xl, which has a total of 24 attention modules:
model = MT5ForConditionalGeneration.from_pretrained("mt5-xl")
device_map = {
    0: [0, 1, 2],
    1: [3, 4, 5, 6, 7, 8, 9],
    2: [10, 11, 12, 13, 14, 15, 16],
    3: [17, 18, 19, 20, 21, 22, 23],
}
model.parallelize(device_map)`,highlighted:`<span class="hljs-comment"># Here is an example of a device map on a machine with 4 GPUs using mt5-xl, which has a total of 24 attention modules:</span>
model = MT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;mt5-xl&quot;</span>)
device_map = {
    <span class="hljs-number">0</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>],
    <span class="hljs-number">1</span>: [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>],
    <span class="hljs-number">2</span>: [<span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">12</span>, <span class="hljs-number">13</span>, <span class="hljs-number">14</span>, <span class="hljs-number">15</span>, <span class="hljs-number">16</span>],
    <span class="hljs-number">3</span>: [<span class="hljs-number">17</span>, <span class="hljs-number">18</span>, <span class="hljs-number">19</span>, <span class="hljs-number">20</span>, <span class="hljs-number">21</span>, <span class="hljs-number">22</span>, <span class="hljs-number">23</span>],
}
model.parallelize(device_map)`}}),{c(){c=o("p"),b=l("Example:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Example:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Sh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import MT5ForConditionalGeneration, AutoTokenizer

model = MT5ForConditionalGeneration.from_pretrained("google/mt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")
article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
summary = "Weiter Verhandlung in Syrien."
inputs = tokenizer(article, text_target=summary, return_tensors="pt")

outputs = model(**inputs)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MT5ForConditionalGeneration, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Offizier sagt, dass weiter verhandelt werden muss in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary = <span class="hljs-string">&quot;Weiter Verhandlung in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(article, text_target=summary, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Lh(x){let c,b,f,d,T;return d=new N({props:{code:`# On a 4 GPU machine with mt5-xl:
model = MT5ForConditionalGeneration.from_pretrained("Mt5-xl")
device_map = {
    0: [0, 1, 2],
    1: [3, 4, 5, 6, 7, 8, 9],
    2: [10, 11, 12, 13, 14, 15, 16],
    3: [17, 18, 19, 20, 21, 22, 23],
}
model.parallelize(device_map)  # Splits the model across several devices
model.deparallelize()  # Put the model back on cpu and cleans memory by calling torch.cuda.empty_cache()`,highlighted:`<span class="hljs-comment"># On a 4 GPU machine with mt5-xl:</span>
model = MT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;Mt5-xl&quot;</span>)
device_map = {
    <span class="hljs-number">0</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>],
    <span class="hljs-number">1</span>: [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>],
    <span class="hljs-number">2</span>: [<span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">12</span>, <span class="hljs-number">13</span>, <span class="hljs-number">14</span>, <span class="hljs-number">15</span>, <span class="hljs-number">16</span>],
    <span class="hljs-number">3</span>: [<span class="hljs-number">17</span>, <span class="hljs-number">18</span>, <span class="hljs-number">19</span>, <span class="hljs-number">20</span>, <span class="hljs-number">21</span>, <span class="hljs-number">22</span>, <span class="hljs-number">23</span>],
}
model.parallelize(device_map)  <span class="hljs-comment"># Splits the model across several devices</span>
model.deparallelize()  <span class="hljs-comment"># Put the model back on cpu and cleans memory by calling torch.cuda.empty_cache()</span>`}}),{c(){c=o("p"),b=l("Example:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Example:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Nh(x){let c,b,f,d,T;return{c(){c=o("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=o("code"),d=l("Module"),T=l(`
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(s){c=a(s,"P",{});var h=r(c);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var G=r(f);d=i(G,"Module"),G.forEach(n),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(n)},m(s,h){_(s,c,h),e(c,b),e(c,f),e(f,d),e(c,T)},d(s){s&&n(c)}}}function Oh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import AutoTokenizer, MT5ForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("mt5-small")
model = MT5ForConditionalGeneration.from_pretrained("mt5-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, MT5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;mt5-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(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Gh(x){let c,b,f,d,T;return d=new N({props:{code:`# Here is an example of a device map on a machine with 4 GPUs using mt5-xl, which has a total of 24 attention modules:
model = MT5ForConditionalGeneration.from_pretrained("mt5-xl")
device_map = {
    0: [0, 1, 2],
    1: [3, 4, 5, 6, 7, 8, 9],
    2: [10, 11, 12, 13, 14, 15, 16],
    3: [17, 18, 19, 20, 21, 22, 23],
}
model.parallelize(device_map)`,highlighted:`<span class="hljs-comment"># Here is an example of a device map on a machine with 4 GPUs using mt5-xl, which has a total of 24 attention modules:</span>
model = MT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;mt5-xl&quot;</span>)
device_map = {
    <span class="hljs-number">0</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>],
    <span class="hljs-number">1</span>: [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>],
    <span class="hljs-number">2</span>: [<span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">12</span>, <span class="hljs-number">13</span>, <span class="hljs-number">14</span>, <span class="hljs-number">15</span>, <span class="hljs-number">16</span>],
    <span class="hljs-number">3</span>: [<span class="hljs-number">17</span>, <span class="hljs-number">18</span>, <span class="hljs-number">19</span>, <span class="hljs-number">20</span>, <span class="hljs-number">21</span>, <span class="hljs-number">22</span>, <span class="hljs-number">23</span>],
}
model.parallelize(device_map)`}}),{c(){c=o("p"),b=l("Example:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Example:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Ih(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import MT5EncoderModel, AutoTokenizer

model = MT5EncoderModel.from_pretrained("google/mt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")
article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
input_ids = tokenizer(article, return_tensors="pt").input_ids
outputs = model(input_ids)
hidden_state = 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> MT5EncoderModel, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MT5EncoderModel.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Offizier sagt, dass weiter verhandelt werden muss in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(article, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_state = outputs.last_hidden_state`}}),{c(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Dh(x){let c,b,f,d,T;return d=new N({props:{code:`# On a 4 GPU machine with mt5-xl:
model = MT5ForConditionalGeneration.from_pretrained("Mt5-xl")
device_map = {
    0: [0, 1, 2],
    1: [3, 4, 5, 6, 7, 8, 9],
    2: [10, 11, 12, 13, 14, 15, 16],
    3: [17, 18, 19, 20, 21, 22, 23],
}
model.parallelize(device_map)  # Splits the model across several devices
model.deparallelize()  # Put the model back on cpu and cleans memory by calling torch.cuda.empty_cache()`,highlighted:`<span class="hljs-comment"># On a 4 GPU machine with mt5-xl:</span>
model = MT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;Mt5-xl&quot;</span>)
device_map = {
    <span class="hljs-number">0</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>],
    <span class="hljs-number">1</span>: [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>],
    <span class="hljs-number">2</span>: [<span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">12</span>, <span class="hljs-number">13</span>, <span class="hljs-number">14</span>, <span class="hljs-number">15</span>, <span class="hljs-number">16</span>],
    <span class="hljs-number">3</span>: [<span class="hljs-number">17</span>, <span class="hljs-number">18</span>, <span class="hljs-number">19</span>, <span class="hljs-number">20</span>, <span class="hljs-number">21</span>, <span class="hljs-number">22</span>, <span class="hljs-number">23</span>],
}
model.parallelize(device_map)  <span class="hljs-comment"># Splits the model across several devices</span>
model.deparallelize()  <span class="hljs-comment"># Put the model back on cpu and cleans memory by calling torch.cuda.empty_cache()</span>`}}),{c(){c=o("p"),b=l("Example:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Example:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Uh(x){let c,b,f,d,T;return{c(){c=o("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=o("code"),d=l("Module"),T=l(`
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(s){c=a(s,"P",{});var h=r(c);b=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var G=r(f);d=i(G,"Module"),G.forEach(n),T=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(n)},m(s,h){_(s,c,h),e(c,b),e(c,f),e(f,d),e(c,T)},d(s){s&&n(c)}}}function Bh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import AutoTokenizer, MT5EncoderModel

tokenizer = AutoTokenizer.from_pretrained("mt5-small")
model = MT5EncoderModel.from_pretrained("mt5-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, MT5EncoderModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MT5EncoderModel.from_pretrained(<span class="hljs-string">&quot;mt5-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(){c=o("p"),b=l("Example:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Example:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Wh(x){let c,b,f,d,T;return d=new N({props:{code:`# Here is an example of a device map on a machine with 4 GPUs using mt5-xl, which has a total of 24 attention modules:
model = MT5ForConditionalGeneration.from_pretrained("mt5-xl")
device_map = {
    0: [0, 1, 2],
    1: [3, 4, 5, 6, 7, 8, 9],
    2: [10, 11, 12, 13, 14, 15, 16],
    3: [17, 18, 19, 20, 21, 22, 23],
}
model.parallelize(device_map)`,highlighted:`<span class="hljs-comment"># Here is an example of a device map on a machine with 4 GPUs using mt5-xl, which has a total of 24 attention modules:</span>
model = MT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;mt5-xl&quot;</span>)
device_map = {
    <span class="hljs-number">0</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>],
    <span class="hljs-number">1</span>: [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>],
    <span class="hljs-number">2</span>: [<span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">12</span>, <span class="hljs-number">13</span>, <span class="hljs-number">14</span>, <span class="hljs-number">15</span>, <span class="hljs-number">16</span>],
    <span class="hljs-number">3</span>: [<span class="hljs-number">17</span>, <span class="hljs-number">18</span>, <span class="hljs-number">19</span>, <span class="hljs-number">20</span>, <span class="hljs-number">21</span>, <span class="hljs-number">22</span>, <span class="hljs-number">23</span>],
}
model.parallelize(device_map)`}}),{c(){c=o("p"),b=l("Example:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Example:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Vh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import TFMT5Model, AutoTokenizer

model = TFMT5Model.from_pretrained("google/mt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")
article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
summary = "Weiter Verhandlung in Syrien."
inputs = tokenizer(article, return_tensors="tf")
labels = tokenizer(text_target=summary, return_tensors="tf")

outputs = model(input_ids=inputs["input_ids"], decoder_input_ids=labels["input_ids"])
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> TFMT5Model, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMT5Model.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Offizier sagt, dass weiter verhandelt werden muss in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary = <span class="hljs-string">&quot;Weiter Verhandlung in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(article, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(text_target=summary, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], decoder_input_ids=labels[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_states = outputs.last_hidden_state`}}),{c(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Hh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import TFMT5ForConditionalGeneration, AutoTokenizer

model = TFMT5ForConditionalGeneration.from_pretrained("google/mt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")
article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
summary = "Weiter Verhandlung in Syrien."
inputs = tokenizer(article, text_target=summary, return_tensors="tf")

outputs = model(**inputs)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFMT5ForConditionalGeneration, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMT5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Offizier sagt, dass weiter verhandelt werden muss in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary = <span class="hljs-string">&quot;Weiter Verhandlung in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(article, text_target=summary, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Rh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import TFMT5EncoderModel, AutoTokenizer

model = TFMT5EncoderModel.from_pretrained("google/mt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")
article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
input_ids = tokenizer(article, return_tensors="tf").input_ids
outputs = model(input_ids)
hidden_state = 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> TFMT5EncoderModel, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMT5EncoderModel.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/mt5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Offizier sagt, dass weiter verhandelt werden muss in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(article, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_state = outputs.last_hidden_state`}}),{c(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Kh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import FlaxMT5Model, AutoTokenizer

model = FlaxMT5Model.from_pretrained("google/mt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")

article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
summary = "Weiter Verhandlung in Syrien."
inputs = tokenizer(article, return_tensors="np")

decoder_input_ids = tokenizer(text_target=summary, return_tensors="np").input_ids

outputs = model(input_ids=inputs["input_ids"], decoder_input_ids=decoder_input_ids)
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> FlaxMT5Model, AutoTokenizer

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

<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Offizier sagt, dass weiter verhandelt werden muss in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary = <span class="hljs-string">&quot;Weiter Verhandlung in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(article, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(text_target=summary, return_tensors=<span class="hljs-string">&quot;np&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], decoder_input_ids=decoder_input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_states = outputs.last_hidden_state`}}),{c(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Jh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import FlaxMT5ForConditionalGeneration, AutoTokenizer

model = FlaxMT5ForConditionalGeneration.from_pretrained("google/mt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")

article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
summary = "Weiter Verhandlung in Syrien."
inputs = tokenizer(article, return_tensors="np")

decoder_input_ids = tokenizer(text_target=summary, return_tensors="np").input_ids

outputs = model(**inputs, decoder_input_ids=decoder_input_ids)
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> FlaxMT5ForConditionalGeneration, AutoTokenizer

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

<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Offizier sagt, dass weiter verhandelt werden muss in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary = <span class="hljs-string">&quot;Weiter Verhandlung in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(article, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(text_target=summary, return_tensors=<span class="hljs-string">&quot;np&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, decoder_input_ids=decoder_input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Xh(x){let c,b,f,d,T;return d=new N({props:{code:`from transformers import FlaxT5EncoderModel, AutoTokenizer

model = FlaxT5EncoderModel.from_pretrained("google/mt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")

article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
summary = "Weiter Verhandlung in Syrien."
inputs = tokenizer(article, return_tensors="np")

decoder_input_ids = tokenizer(text_target=summary, return_tensors="np").input_ids

outputs = model(input_ids=inputs["input_ids"])
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> FlaxT5EncoderModel, AutoTokenizer

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

<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Offizier sagt, dass weiter verhandelt werden muss in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary = <span class="hljs-string">&quot;Weiter Verhandlung in Syrien.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(article, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(text_target=summary, return_tensors=<span class="hljs-string">&quot;np&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_states = outputs.last_hidden_state`}}),{c(){c=o("p"),b=l("Examples:"),f=p(),v(d.$$.fragment)},l(s){c=a(s,"P",{});var h=r(c);b=i(h,"Examples:"),h.forEach(n),f=m(s),k(d.$$.fragment,s)},m(s,h){_(s,c,h),e(c,b),_(s,f,h),$(d,s,h),T=!0},p:L,i(s){T||(w(d.$$.fragment,s),T=!0)},o(s){y(d.$$.fragment,s),T=!1},d(s){s&&n(c),s&&n(f),M(d,s)}}}function Yh(x){let c,b,f,d,T,s,h,G,Gr,Ta,pe,Ee,Rs,yt,Ir,Ks,Dr,ba,qe,Ur,Mt,Br,Wr,va,ts,Vr,ka,ns,Js,Hr,$a,Fe,Rr,xt,Kr,Jr,wa,ss,Xr,ya,I,Xs,Ys,zt,Yr,Zr,Zs,Qs,jt,Qr,el,eo,to,Et,tl,nl,no,so,qt,sl,ol,oo,os,Ft,al,rl,Ma,oe,ll,Pt,il,dl,Ct,cl,pl,xa,me,Pe,ao,At,ml,ro,hl,za,X,St,ul,Y,fl,as,gl,_l,rs,Tl,bl,Lt,vl,kl,$l,he,wl,ls,yl,Ml,is,xl,zl,ja,ue,Ce,lo,Nt,jl,io,El,Ea,F,Ot,ql,Gt,Fl,It,Pl,Cl,Al,Dt,Sl,ds,Ll,Nl,Ol,ae,Ut,Gl,co,Il,Dl,Bt,cs,Ul,po,Bl,Wl,ps,Vl,mo,Hl,Rl,Ae,Wt,Kl,ho,Jl,Xl,Se,Vt,Yl,uo,Zl,Ql,Le,Ht,ei,Rt,ti,fo,ni,si,qa,Ne,oi,ms,ai,ri,Fa,fe,Oe,go,Kt,li,_o,ii,Pa,O,Jt,di,ge,ci,To,pi,mi,Xt,hi,ui,fi,Yt,gi,hs,_i,Ti,bi,re,Zt,vi,bo,ki,$i,Qt,us,wi,vo,yi,Mi,fs,xi,ko,zi,ji,Ge,en,Ei,$o,qi,Ca,Ie,Fi,gs,Pi,Ci,Aa,_e,De,wo,tn,Ai,yo,Si,Sa,j,nn,Li,Mo,Ni,Oi,sn,Gi,on,Ii,Di,Ui,an,Bi,_s,Wi,Vi,Hi,rn,Ri,ln,Ki,Ji,Xi,Ue,Yi,le,dn,Zi,xo,Qi,ed,Be,td,W,cn,nd,Te,sd,Ts,od,ad,zo,rd,ld,id,We,dd,Ve,cd,V,pn,pd,jo,md,hd,Eo,ud,fd,He,La,be,Re,qo,mn,gd,Fo,_d,Na,E,hn,Td,un,bd,Po,vd,kd,$d,fn,wd,gn,yd,Md,xd,_n,zd,bs,jd,Ed,qd,Tn,Fd,bn,Pd,Cd,Ad,Ke,Sd,ie,vn,Ld,Co,Nd,Od,Je,Gd,H,kn,Id,ve,Dd,vs,Ud,Bd,Ao,Wd,Vd,Hd,Xe,Rd,Ye,Kd,R,$n,Jd,So,Xd,Yd,Lo,Zd,Qd,Ze,Oa,ke,Qe,No,wn,ec,Oo,tc,Ga,q,yn,nc,Go,sc,oc,Mn,ac,xn,rc,lc,ic,zn,dc,ks,cc,pc,mc,jn,hc,En,uc,fc,gc,et,_c,de,qn,Tc,Io,bc,vc,tt,kc,K,Fn,$c,$e,wc,$s,yc,Mc,Do,xc,zc,jc,nt,Ec,st,qc,J,Pn,Fc,Uo,Pc,Cc,Bo,Ac,Sc,ot,Ia,we,at,Wo,Cn,Lc,Vo,Nc,Da,Z,An,Oc,Sn,Gc,ws,Ic,Dc,Uc,rt,Ua,ye,lt,Ho,Ln,Bc,Ro,Wc,Ba,Q,Nn,Vc,On,Hc,ys,Rc,Kc,Jc,it,Wa,Me,dt,Ko,Gn,Xc,Jo,Yc,Va,ee,In,Zc,Dn,Qc,Ms,ep,tp,np,ct,Ha,xe,pt,Xo,Un,sp,Yo,op,Ra,te,Bn,ap,Wn,rp,xs,lp,ip,dp,mt,Ka,ze,ht,Zo,Vn,cp,Qo,pp,Ja,ne,Hn,mp,Rn,hp,zs,up,fp,gp,ut,Xa,je,ft,ea,Kn,_p,ta,Tp,Ya,se,Jn,bp,Xn,vp,js,kp,$p,wp,gt,Za;return s=new U({}),yt=new U({}),At=new U({}),St=new z({props:{name:"class transformers.MT5Config",anchor:"transformers.MT5Config",parameters:[{name:"vocab_size",val:" = 250112"},{name:"d_model",val:" = 512"},{name:"d_kv",val:" = 64"},{name:"d_ff",val:" = 1024"},{name:"num_layers",val:" = 8"},{name:"num_decoder_layers",val:" = None"},{name:"num_heads",val:" = 6"},{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:" = 'gated-gelu'"},{name:"is_encoder_decoder",val:" = True"},{name:"use_cache",val:" = True"},{name:"tokenizer_class",val:" = 'T5Tokenizer'"},{name:"tie_word_embeddings",val:" = False"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"decoder_start_token_id",val:" = 0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MT5Config.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 250112) &#x2014;
Vocabulary size of the T5 model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/t5#transformers.T5Model">T5Model</a> or <a href="/docs/transformers/main/en/model_doc/t5#transformers.TFT5Model">TFT5Model</a>.`,name:"vocab_size"},{anchor:"transformers.MT5Config.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.MT5Config.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. <code>d_kv</code> has to be equal to <code>d_model // num_heads</code>.`,name:"d_kv"},{anchor:"transformers.MT5Config.d_ff",description:`<strong>d_ff</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Size of the intermediate feed forward layer in each <code>T5Block</code>.`,name:"d_ff"},{anchor:"transformers.MT5Config.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_layers"},{anchor:"transformers.MT5Config.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.MT5Config.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.MT5Config.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.MT5Config.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.MT5Config.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.MT5Config.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.MT5Config.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.MT5Config.feed_forward_proj",description:`<strong>feed_forward_proj</strong> (<code>string</code>, <em>optional</em>, defaults to <code>&quot;gated-gelu&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>.`,name:"feed_forward_proj"},{anchor:"transformers.MT5Config.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/configuration_mt5.py#L26"}}),Nt=new U({}),Ot=new z({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/main/src/transformers/models/t5/tokenization_t5.py#L55"}}),Ut=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.T5Tokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5Tokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.T5Tokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/tokenization_t5.py#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>
`}}),Wt=new z({props:{name:"convert_tokens_to_string",anchor:"transformers.T5Tokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/tokenization_t5.py#L317"}}),Vt=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.T5Tokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5Tokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.T5Tokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/tokenization_t5.py#L234",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ht=new z({props:{name:"get_special_tokens_mask",anchor:"transformers.T5Tokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.T5Tokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.T5Tokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.T5Tokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/tokenization_t5.py#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>
`}}),Kt=new U({}),Jt=new z({props:{name:"class transformers.T5TokenizerFast",anchor:"transformers.T5TokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"extra_ids",val:" = 100"},{name:"additional_special_tokens",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.T5TokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.T5TokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.T5TokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.T5TokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.T5TokenizerFast.extra_ids",description:`<strong>extra_ids</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Add a number of extra ids added to the vocabulary for use as sentinels. These tokens are accessible as
&#x201C;<extra<em>id{%d}&gt;&#x201D; where &#x201D;{%d}&#x201D; is a number between 0 and extra_ids-1. These tokens can be retrieved by
calling get_sentinel_tokens method and token ids can be by calling get_sentinel_token_ids method</extra<em>`,name:"extra_ids"},{anchor:"transformers.T5TokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/tokenization_t5_fast.py#L66"}}),Zt=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.T5TokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5TokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.T5TokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/tokenization_t5_fast.py#L190",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),en=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.T5TokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.T5TokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.T5TokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/tokenization_t5_fast.py#L216",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),tn=new U({}),nn=new z({props:{name:"class transformers.MT5Model",anchor:"transformers.MT5Model",parameters:[{name:"config",val:": MT5Config"}],parametersDescription:[{anchor:"transformers.MT5Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mt5#transformers.MT5Config">MT5Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1260"}}),Ue=new S({props:{anchor:"transformers.MT5Model.example",$$slots:{default:[qh]},$$scope:{ctx:x}}}),dn=new z({props:{name:"deparallelize",anchor:"transformers.MT5Model.deparallelize",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1329"}}),Be=new S({props:{anchor:"transformers.MT5Model.deparallelize.example",$$slots:{default:[Fh]},$$scope:{ctx:x}}}),cn=new z({props:{name:"forward",anchor:"transformers.MT5Model.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.MT5Model.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. MT5 is a model with relative position embeddings so you
should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./mt5#training">MT5 Training</a>.`,name:"input_ids"},{anchor:"transformers.MT5Model.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.MT5Model.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>MT5 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="./mt5#training">MT5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.MT5Model.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.MT5Model.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.MT5Model.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.MT5Model.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.MT5Model.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.MT5Model.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.MT5Model.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.MT5Model.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.MT5Model.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.MT5Model.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.MT5Model.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.MT5Model.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1367",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mt5#transformers.MT5Config"
>MT5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),We=new Ep({props:{$$slots:{default:[Ph]},$$scope:{ctx:x}}}),Ve=new S({props:{anchor:"transformers.MT5Model.forward.example",$$slots:{default:[Ch]},$$scope:{ctx:x}}}),pn=new z({props:{name:"parallelize",anchor:"transformers.MT5Model.parallelize",parameters:[{name:"device_map",val:" = None"}],parametersDescription:[{anchor:"transformers.MT5Model.parallelize.device_map",description:`<strong>device_map</strong> (<code>Dict[int, list]</code>, optional, defaults to None) &#x2014;
A dictionary that maps attention modules to devices. Note that the embedding module and LMHead are always
automatically mapped to the first device (for esoteric reasons). That means that the first device should
have fewer attention modules mapped to it than other devices. For reference, the mt5 models have the
following number of attention modules:</p>
<ul>
<li>mt5-small: 6</li>
<li>mt5-base: 12</li>
<li>mt5-large: 24</li>
<li>mt5-xl: 24</li>
<li>mt5-xxl: 24</li>
</ul>`,name:"device_map"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1316"}}),He=new S({props:{anchor:"transformers.MT5Model.parallelize.example",$$slots:{default:[Ah]},$$scope:{ctx:x}}}),mn=new U({}),hn=new z({props:{name:"class transformers.MT5ForConditionalGeneration",anchor:"transformers.MT5ForConditionalGeneration",parameters:[{name:"config",val:": MT5Config"}],parametersDescription:[{anchor:"transformers.MT5ForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mt5#transformers.MT5Config">MT5Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1484"}}),Ke=new S({props:{anchor:"transformers.MT5ForConditionalGeneration.example",$$slots:{default:[Sh]},$$scope:{ctx:x}}}),vn=new z({props:{name:"deparallelize",anchor:"transformers.MT5ForConditionalGeneration.deparallelize",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1555"}}),Je=new S({props:{anchor:"transformers.MT5ForConditionalGeneration.deparallelize.example",$$slots:{default:[Lh]},$$scope:{ctx:x}}}),kn=new z({props:{name:"forward",anchor:"transformers.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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. MT5 is a model with relative position embeddings so you
should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./mt5#training">MT5 Training</a>.`,name:"input_ids"},{anchor:"transformers.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>MT5 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="./mt5#training">MT5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.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.MT5ForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MT5ForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[-100, 0, ..., config.vocab_size - 1]</code>. All labels set to <code>-100</code> are ignored (masked), the loss is only computed for
labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1593",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mt5#transformers.MT5Config"
>MT5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xe=new Ep({props:{$$slots:{default:[Nh]},$$scope:{ctx:x}}}),Ye=new S({props:{anchor:"transformers.MT5ForConditionalGeneration.forward.example",$$slots:{default:[Oh]},$$scope:{ctx:x}}}),$n=new z({props:{name:"parallelize",anchor:"transformers.MT5ForConditionalGeneration.parallelize",parameters:[{name:"device_map",val:" = None"}],parametersDescription:[{anchor:"transformers.MT5ForConditionalGeneration.parallelize.device_map",description:`<strong>device_map</strong> (<code>Dict[int, list]</code>, optional, defaults to None) &#x2014;
A dictionary that maps attention modules to devices. Note that the embedding module and LMHead are always
automatically mapped to the first device (for esoteric reasons). That means that the first device should
have fewer attention modules mapped to it than other devices. For reference, the mt5 models have the
following number of attention modules:</p>
<ul>
<li>mt5-small: 6</li>
<li>mt5-base: 12</li>
<li>mt5-large: 24</li>
<li>mt5-xl: 24</li>
<li>mt5-xxl: 24</li>
</ul>`,name:"device_map"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1541"}}),Ze=new S({props:{anchor:"transformers.MT5ForConditionalGeneration.parallelize.example",$$slots:{default:[Gh]},$$scope:{ctx:x}}}),wn=new U({}),yn=new z({props:{name:"class transformers.MT5EncoderModel",anchor:"transformers.MT5EncoderModel",parameters:[{name:"config",val:": MT5Config"}],parametersDescription:[{anchor:"transformers.MT5EncoderModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mt5#transformers.MT5Config">MT5Config</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1810"}}),et=new S({props:{anchor:"transformers.MT5EncoderModel.example",$$slots:{default:[Ih]},$$scope:{ctx:x}}}),qn=new z({props:{name:"deparallelize",anchor:"transformers.MT5EncoderModel.deparallelize",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1864"}}),tt=new S({props:{anchor:"transformers.MT5EncoderModel.deparallelize.example",$$slots:{default:[Dh]},$$scope:{ctx:x}}}),Fn=new z({props:{name:"forward",anchor:"transformers.MT5EncoderModel.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.MT5EncoderModel.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. MT5 is a model with relative position embeddings so you
should be able to pad the inputs on both the right and the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.</p>
<p>To know more on how to prepare <code>input_ids</code> for pretraining take a look a <a href="./mt5#training">MT5 Training</a>.`,name:"input_ids"},{anchor:"transformers.MT5EncoderModel.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.MT5EncoderModel.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.MT5EncoderModel.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.MT5EncoderModel.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.MT5EncoderModel.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.MT5EncoderModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1895",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mt5#transformers.MT5Config"
>MT5Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),nt=new Ep({props:{$$slots:{default:[Uh]},$$scope:{ctx:x}}}),st=new S({props:{anchor:"transformers.MT5EncoderModel.forward.example",$$slots:{default:[Bh]},$$scope:{ctx:x}}}),Pn=new z({props:{name:"parallelize",anchor:"transformers.MT5EncoderModel.parallelize",parameters:[{name:"device_map",val:" = None"}],parametersDescription:[{anchor:"transformers.MT5EncoderModel.parallelize.device_map",description:`<strong>device_map</strong> (<code>Dict[int, list]</code>, optional, defaults to None) &#x2014;
A dictionary that maps attention modules to devices. Note that the embedding module and LMHead are always
automatically mapped to the first device (for esoteric reasons). That means that the first device should
have fewer attention modules mapped to it than other devices. For reference, the mt5 models have the
following number of attention modules:</p>
<ul>
<li>mt5-small: 6</li>
<li>mt5-base: 12</li>
<li>mt5-large: 24</li>
<li>mt5-xl: 24</li>
<li>mt5-xxl: 24</li>
</ul>`,name:"device_map"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_mt5.py#L1852"}}),ot=new S({props:{anchor:"transformers.MT5EncoderModel.parallelize.example",$$slots:{default:[Wh]},$$scope:{ctx:x}}}),Cn=new U({}),An=new z({props:{name:"class transformers.TFMT5Model",anchor:"transformers.TFMT5Model",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_tf_mt5.py#L27"}}),rt=new S({props:{anchor:"transformers.TFMT5Model.example",$$slots:{default:[Vh]},$$scope:{ctx:x}}}),Ln=new U({}),Nn=new z({props:{name:"class transformers.TFMT5ForConditionalGeneration",anchor:"transformers.TFMT5ForConditionalGeneration",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_tf_mt5.py#L51"}}),it=new S({props:{anchor:"transformers.TFMT5ForConditionalGeneration.example",$$slots:{default:[Hh]},$$scope:{ctx:x}}}),Gn=new U({}),In=new z({props:{name:"class transformers.TFMT5EncoderModel",anchor:"transformers.TFMT5EncoderModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_tf_mt5.py#L75"}}),ct=new S({props:{anchor:"transformers.TFMT5EncoderModel.example",$$slots:{default:[Rh]},$$scope:{ctx:x}}}),Un=new U({}),Bn=new z({props:{name:"class transformers.FlaxMT5Model",anchor:"transformers.FlaxMT5Model",parameters:[{name:"config",val:": T5Config"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_flax_mt5.py#L42"}}),mt=new S({props:{anchor:"transformers.FlaxMT5Model.example",$$slots:{default:[Kh]},$$scope:{ctx:x}}}),Vn=new U({}),Hn=new z({props:{name:"class transformers.FlaxMT5ForConditionalGeneration",anchor:"transformers.FlaxMT5ForConditionalGeneration",parameters:[{name:"config",val:": T5Config"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_flax_mt5.py#L94"}}),ut=new S({props:{anchor:"transformers.FlaxMT5ForConditionalGeneration.example",$$slots:{default:[Jh]},$$scope:{ctx:x}}}),Kn=new U({}),Jn=new z({props:{name:"class transformers.FlaxMT5EncoderModel",anchor:"transformers.FlaxMT5EncoderModel",parameters:[{name:"config",val:": T5Config"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"gradient_checkpointing",val:": bool = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mt5/modeling_flax_mt5.py#L68"}}),gt=new S({props:{anchor:"transformers.FlaxMT5EncoderModel.example",$$slots:{default:[Xh]},$$scope:{ctx:x}}}),{c(){c=o("meta"),b=p(),f=o("h1"),d=o("a"),T=o("span"),v(s.$$.fragment),h=p(),G=o("span"),Gr=l("mT5"),Ta=p(),pe=o("h2"),Ee=o("a"),Rs=o("span"),v(yt.$$.fragment),Ir=p(),Ks=o("span"),Dr=l("Overview"),ba=p(),qe=o("p"),Ur=l("The mT5 model was presented in "),Mt=o("a"),Br=l("mT5: A massively multilingual pre-trained text-to-text transformer"),Wr=l(` by Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya
Siddhant, Aditya Barua, Colin Raffel.`),va=p(),ts=o("p"),Vr=l("The abstract from the paper is the following:"),ka=p(),ns=o("p"),Js=o("em"),Hr=l(`The recent \u201CText-to-Text Transfer Transformer\u201D (T5) leveraged a unified text-to-text format and scale to attain
state-of-the-art results on a wide variety of English-language NLP tasks. In this paper, we introduce mT5, a
multilingual variant of T5 that was pre-trained on a new Common Crawl-based dataset covering 101 languages. We detail
the design and modified training of mT5 and demonstrate its state-of-the-art performance on many multilingual
benchmarks. We also describe a simple technique to prevent \u201Caccidental translation\u201D in the zero-shot setting, where a
generative model chooses to (partially) translate its prediction into the wrong language. All of the code and model
checkpoints used in this work are publicly available.`),$a=p(),Fe=o("p"),Rr=l("Note: mT5 was only pre-trained on "),xt=o("a"),Kr=l("mC4"),Jr=l(` excluding any supervised training.
Therefore, this model has to be fine-tuned before it is usable on a downstream task, unlike the original T5 model.
Since mT5 was pre-trained unsupervisedly, there\u2019s no real advantage to using a task prefix during single-task
fine-tuning. If you are doing multi-task fine-tuning, you should use a prefix.`),wa=p(),ss=o("p"),Xr=l("Google has released the following variants:"),ya=p(),I=o("ul"),Xs=o("li"),Ys=o("p"),zt=o("a"),Yr=l("google/mt5-small"),Zr=p(),Zs=o("li"),Qs=o("p"),jt=o("a"),Qr=l("google/mt5-base"),el=p(),eo=o("li"),to=o("p"),Et=o("a"),tl=l("google/mt5-large"),nl=p(),no=o("li"),so=o("p"),qt=o("a"),sl=l("google/mt5-xl"),ol=p(),oo=o("li"),os=o("p"),Ft=o("a"),al=l("google/mt5-xxl"),rl=l("."),Ma=p(),oe=o("p"),ll=l("This model was contributed by "),Pt=o("a"),il=l("patrickvonplaten"),dl=l(`. The original code can be
found `),Ct=o("a"),cl=l("here"),pl=l("."),xa=p(),me=o("h2"),Pe=o("a"),ao=o("span"),v(At.$$.fragment),ml=p(),ro=o("span"),hl=l("MT5Config"),za=p(),X=o("div"),v(St.$$.fragment),ul=p(),Y=o("p"),fl=l("This is the configuration class to store the configuration of a "),as=o("a"),gl=l("MT5Model"),_l=l(" or a "),rs=o("a"),Tl=l("TFMT5Model"),bl=l(`. It is used to
instantiate a mT5 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 mT5
`),Lt=o("a"),vl=l("google/mt5-small"),kl=l(" architecture."),$l=p(),he=o("p"),wl=l("Configuration objects inherit from "),ls=o("a"),yl=l("PretrainedConfig"),Ml=l(` and can be used to control the model outputs. Read the
documentation from `),is=o("a"),xl=l("PretrainedConfig"),zl=l(" for more information."),ja=p(),ue=o("h2"),Ce=o("a"),lo=o("span"),v(Nt.$$.fragment),jl=p(),io=o("span"),El=l("MT5Tokenizer"),Ea=p(),F=o("div"),v(Ot.$$.fragment),ql=p(),Gt=o("p"),Fl=l("Construct a T5 tokenizer. Based on "),It=o("a"),Pl=l("SentencePiece"),Cl=l("."),Al=p(),Dt=o("p"),Sl=l("This tokenizer inherits from "),ds=o("a"),Ll=l("PreTrainedTokenizer"),Nl=l(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Ol=p(),ae=o("div"),v(Ut.$$.fragment),Gl=p(),co=o("p"),Il=l(`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:`),Dl=p(),Bt=o("ul"),cs=o("li"),Ul=l("single sequence: "),po=o("code"),Bl=l("X </s>"),Wl=p(),ps=o("li"),Vl=l("pair of sequences: "),mo=o("code"),Hl=l("A </s> B </s>"),Rl=p(),Ae=o("div"),v(Wt.$$.fragment),Kl=p(),ho=o("p"),Jl=l("Converts a sequence of tokens (string) in a single string."),Xl=p(),Se=o("div"),v(Vt.$$.fragment),Yl=p(),uo=o("p"),Zl=l(`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.`),Ql=p(),Le=o("div"),v(Ht.$$.fragment),ei=p(),Rt=o("p"),ti=l(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),fo=o("code"),ni=l("prepare_for_model"),si=l(" method."),qa=p(),Ne=o("p"),oi=l("See "),ms=o("a"),ai=l("T5Tokenizer"),ri=l(" for all details."),Fa=p(),fe=o("h2"),Oe=o("a"),go=o("span"),v(Kt.$$.fragment),li=p(),_o=o("span"),ii=l("MT5TokenizerFast"),Pa=p(),O=o("div"),v(Jt.$$.fragment),di=p(),ge=o("p"),ci=l("Construct a \u201Cfast\u201D T5 tokenizer (backed by HuggingFace\u2019s "),To=o("em"),pi=l("tokenizers"),mi=l(` library). Based on
`),Xt=o("a"),hi=l("Unigram"),ui=l("."),fi=p(),Yt=o("p"),gi=l("This tokenizer inherits from "),hs=o("a"),_i=l("PreTrainedTokenizerFast"),Ti=l(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),bi=p(),re=o("div"),v(Zt.$$.fragment),vi=p(),bo=o("p"),ki=l(`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:`),$i=p(),Qt=o("ul"),us=o("li"),wi=l("single sequence: "),vo=o("code"),yi=l("X </s>"),Mi=p(),fs=o("li"),xi=l("pair of sequences: "),ko=o("code"),zi=l("A </s> B </s>"),ji=p(),Ge=o("div"),v(en.$$.fragment),Ei=p(),$o=o("p"),qi=l(`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.`),Ca=p(),Ie=o("p"),Fi=l("See "),gs=o("a"),Pi=l("T5TokenizerFast"),Ci=l(" for all details."),Aa=p(),_e=o("h2"),De=o("a"),wo=o("span"),v(tn.$$.fragment),Ai=p(),yo=o("span"),Si=l("MT5Model"),Sa=p(),j=o("div"),v(nn.$$.fragment),Li=p(),Mo=o("p"),Ni=l("The bare MT5 Model transformer outputting raw hidden-states without any specific head on top."),Oi=p(),sn=o("p"),Gi=l("The MT5 model was proposed in "),on=o("a"),Ii=l(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Di=l(` 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.`),Ui=p(),an=o("p"),Bi=l("This model inherits from "),_s=o("a"),Wi=l("PreTrainedModel"),Vi=l(`. 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.)`),Hi=p(),rn=o("p"),Ri=l("This model is also a PyTorch "),ln=o("a"),Ki=l("torch.nn.Module"),Ji=l(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xi=p(),v(Ue.$$.fragment),Yi=p(),le=o("div"),v(dn.$$.fragment),Zi=p(),xo=o("p"),Qi=l("Moves the model to cpu from a model parallel state."),ed=p(),v(Be.$$.fragment),td=p(),W=o("div"),v(cn.$$.fragment),nd=p(),Te=o("p"),sd=l("The "),Ts=o("a"),od=l("MT5Model"),ad=l(" forward method, overrides the "),zo=o("code"),rd=l("__call__"),ld=l(" special method."),id=p(),v(We.$$.fragment),dd=p(),v(Ve.$$.fragment),cd=p(),V=o("div"),v(pn.$$.fragment),pd=p(),jo=o("p"),md=l("This is an experimental feature and is a subject to change at a moment\u2019s notice."),hd=p(),Eo=o("p"),ud=l(`Uses a device map to distribute attention modules of the model across several devices. If no device map is given,
it will evenly distribute blocks across all devices.`),fd=p(),v(He.$$.fragment),La=p(),be=o("h2"),Re=o("a"),qo=o("span"),v(mn.$$.fragment),gd=p(),Fo=o("span"),_d=l("MT5ForConditionalGeneration"),Na=p(),E=o("div"),v(hn.$$.fragment),Td=p(),un=o("p"),bd=l("MT5 Model with a "),Po=o("code"),vd=l("language modeling"),kd=l(" head on top."),$d=p(),fn=o("p"),wd=l("The MT5 model was proposed in "),gn=o("a"),yd=l(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Md=l(` 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.`),xd=p(),_n=o("p"),zd=l("This model inherits from "),bs=o("a"),jd=l("PreTrainedModel"),Ed=l(`. 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.)`),qd=p(),Tn=o("p"),Fd=l("This model is also a PyTorch "),bn=o("a"),Pd=l("torch.nn.Module"),Cd=l(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ad=p(),v(Ke.$$.fragment),Sd=p(),ie=o("div"),v(vn.$$.fragment),Ld=p(),Co=o("p"),Nd=l("Moves the model to cpu from a model parallel state."),Od=p(),v(Je.$$.fragment),Gd=p(),H=o("div"),v(kn.$$.fragment),Id=p(),ve=o("p"),Dd=l("The "),vs=o("a"),Ud=l("MT5ForConditionalGeneration"),Bd=l(" forward method, overrides the "),Ao=o("code"),Wd=l("__call__"),Vd=l(" special method."),Hd=p(),v(Xe.$$.fragment),Rd=p(),v(Ye.$$.fragment),Kd=p(),R=o("div"),v($n.$$.fragment),Jd=p(),So=o("p"),Xd=l("This is an experimental feature and is a subject to change at a moment\u2019s notice."),Yd=p(),Lo=o("p"),Zd=l(`Uses a device map to distribute attention modules of the model across several devices. If no device map is given,
it will evenly distribute blocks across all devices.`),Qd=p(),v(Ze.$$.fragment),Oa=p(),ke=o("h2"),Qe=o("a"),No=o("span"),v(wn.$$.fragment),ec=p(),Oo=o("span"),tc=l("MT5EncoderModel"),Ga=p(),q=o("div"),v(yn.$$.fragment),nc=p(),Go=o("p"),sc=l("The bare MT5 Model transformer outputting encoder\u2019s raw hidden-states without any specific head on top."),oc=p(),Mn=o("p"),ac=l("The MT5 model was proposed in "),xn=o("a"),rc=l(`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),lc=l(` 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.`),ic=p(),zn=o("p"),dc=l("This model inherits from "),ks=o("a"),cc=l("PreTrainedModel"),pc=l(`. 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.)`),mc=p(),jn=o("p"),hc=l("This model is also a PyTorch "),En=o("a"),uc=l("torch.nn.Module"),fc=l(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gc=p(),v(et.$$.fragment),_c=p(),de=o("div"),v(qn.$$.fragment),Tc=p(),Io=o("p"),bc=l("Moves the model to cpu from a model parallel state."),vc=p(),v(tt.$$.fragment),kc=p(),K=o("div"),v(Fn.$$.fragment),$c=p(),$e=o("p"),wc=l("The "),$s=o("a"),yc=l("MT5EncoderModel"),Mc=l(" forward method, overrides the "),Do=o("code"),xc=l("__call__"),zc=l(" special method."),jc=p(),v(nt.$$.fragment),Ec=p(),v(st.$$.fragment),qc=p(),J=o("div"),v(Pn.$$.fragment),Fc=p(),Uo=o("p"),Pc=l("This is an experimental feature and is a subject to change at a moment\u2019s notice."),Cc=p(),Bo=o("p"),Ac=l(`Uses a device map to distribute attention modules of the model across several devices. If no device map is given,
it will evenly distribute blocks across all devices.`),Sc=p(),v(ot.$$.fragment),Ia=p(),we=o("h2"),at=o("a"),Wo=o("span"),v(Cn.$$.fragment),Lc=p(),Vo=o("span"),Nc=l("TFMT5Model"),Da=p(),Z=o("div"),v(An.$$.fragment),Oc=p(),Sn=o("p"),Gc=l("This class overrides "),ws=o("a"),Ic=l("TFT5Model"),Dc=l(`. Please check the superclass for the appropriate documentation alongside usage
examples.`),Uc=p(),v(rt.$$.fragment),Ua=p(),ye=o("h2"),lt=o("a"),Ho=o("span"),v(Ln.$$.fragment),Bc=p(),Ro=o("span"),Wc=l("TFMT5ForConditionalGeneration"),Ba=p(),Q=o("div"),v(Nn.$$.fragment),Vc=p(),On=o("p"),Hc=l("This class overrides "),ys=o("a"),Rc=l("TFT5ForConditionalGeneration"),Kc=l(`. Please check the superclass for the appropriate
documentation alongside usage examples.`),Jc=p(),v(it.$$.fragment),Wa=p(),Me=o("h2"),dt=o("a"),Ko=o("span"),v(Gn.$$.fragment),Xc=p(),Jo=o("span"),Yc=l("TFMT5EncoderModel"),Va=p(),ee=o("div"),v(In.$$.fragment),Zc=p(),Dn=o("p"),Qc=l("This class overrides "),Ms=o("a"),ep=l("TFT5EncoderModel"),tp=l(`. Please check the superclass for the appropriate documentation alongside
usage examples.`),np=p(),v(ct.$$.fragment),Ha=p(),xe=o("h2"),pt=o("a"),Xo=o("span"),v(Un.$$.fragment),sp=p(),Yo=o("span"),op=l("FlaxMT5Model"),Ra=p(),te=o("div"),v(Bn.$$.fragment),ap=p(),Wn=o("p"),rp=l("This class overrides "),xs=o("a"),lp=l("FlaxT5Model"),ip=l(`. Please check the superclass for the appropriate documentation alongside usage
examples.`),dp=p(),v(mt.$$.fragment),Ka=p(),ze=o("h2"),ht=o("a"),Zo=o("span"),v(Vn.$$.fragment),cp=p(),Qo=o("span"),pp=l("FlaxMT5ForConditionalGeneration"),Ja=p(),ne=o("div"),v(Hn.$$.fragment),mp=p(),Rn=o("p"),hp=l("This class overrides "),zs=o("a"),up=l("FlaxT5ForConditionalGeneration"),fp=l(`. Please check the superclass for the appropriate
documentation alongside usage examples.`),gp=p(),v(ut.$$.fragment),Xa=p(),je=o("h2"),ft=o("a"),ea=o("span"),v(Kn.$$.fragment),_p=p(),ta=o("span"),Tp=l("FlaxMT5EncoderModel"),Ya=p(),se=o("div"),v(Jn.$$.fragment),bp=p(),Xn=o("p"),vp=l("This class overrides "),js=o("a"),kp=l("FlaxT5EncoderModel"),$p=l(`. Please check the superclass for the appropriate documentation
alongside usage examples.`),wp=p(),v(gt.$$.fragment),this.h()},l(t){const g=jh('[data-svelte="svelte-1phssyn"]',document.head);c=a(g,"META",{name:!0,content:!0}),g.forEach(n),b=m(t),f=a(t,"H1",{class:!0});var Yn=r(f);d=a(Yn,"A",{id:!0,class:!0,href:!0});var na=r(d);T=a(na,"SPAN",{});var sa=r(T);k(s.$$.fragment,sa),sa.forEach(n),na.forEach(n),h=m(Yn),G=a(Yn,"SPAN",{});var oa=r(G);Gr=i(oa,"mT5"),oa.forEach(n),Yn.forEach(n),Ta=m(t),pe=a(t,"H2",{class:!0});var Zn=r(pe);Ee=a(Zn,"A",{id:!0,class:!0,href:!0});var aa=r(Ee);Rs=a(aa,"SPAN",{});var ra=r(Rs);k(yt.$$.fragment,ra),ra.forEach(n),aa.forEach(n),Ir=m(Zn),Ks=a(Zn,"SPAN",{});var la=r(Ks);Dr=i(la,"Overview"),la.forEach(n),Zn.forEach(n),ba=m(t),qe=a(t,"P",{});var Qn=r(qe);Ur=i(Qn,"The mT5 model was presented in "),Mt=a(Qn,"A",{href:!0,rel:!0});var ia=r(Mt);Br=i(ia,"mT5: A massively multilingual pre-trained text-to-text transformer"),ia.forEach(n),Wr=i(Qn,` by Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya
Siddhant, Aditya Barua, Colin Raffel.`),Qn.forEach(n),va=m(t),ts=a(t,"P",{});var da=r(ts);Vr=i(da,"The abstract from the paper is the following:"),da.forEach(n),ka=m(t),ns=a(t,"P",{});var ca=r(ns);Js=a(ca,"EM",{});var pa=r(Js);Hr=i(pa,`The recent \u201CText-to-Text Transfer Transformer\u201D (T5) leveraged a unified text-to-text format and scale to attain
state-of-the-art results on a wide variety of English-language NLP tasks. In this paper, we introduce mT5, a
multilingual variant of T5 that was pre-trained on a new Common Crawl-based dataset covering 101 languages. We detail
the design and modified training of mT5 and demonstrate its state-of-the-art performance on many multilingual
benchmarks. We also describe a simple technique to prevent \u201Caccidental translation\u201D in the zero-shot setting, where a
generative model chooses to (partially) translate its prediction into the wrong language. All of the code and model
checkpoints used in this work are publicly available.`),pa.forEach(n),ca.forEach(n),$a=m(t),Fe=a(t,"P",{});var es=r(Fe);Rr=i(es,"Note: mT5 was only pre-trained on "),xt=a(es,"A",{href:!0,rel:!0});var ma=r(xt);Kr=i(ma,"mC4"),ma.forEach(n),Jr=i(es,` excluding any supervised training.
Therefore, this model has to be fine-tuned before it is usable on a downstream task, unlike the original T5 model.
Since mT5 was pre-trained unsupervisedly, there\u2019s no real advantage to using a task prefix during single-task
fine-tuning. If you are doing multi-task fine-tuning, you should use a prefix.`),es.forEach(n),wa=m(t),ss=a(t,"P",{});var ha=r(ss);Xr=i(ha,"Google has released the following variants:"),ha.forEach(n),ya=m(t),I=a(t,"UL",{});var B=r(I);Xs=a(B,"LI",{});var ua=r(Xs);Ys=a(ua,"P",{});var fa=r(Ys);zt=a(fa,"A",{href:!0,rel:!0});var ga=r(zt);Yr=i(ga,"google/mt5-small"),ga.forEach(n),fa.forEach(n),ua.forEach(n),Zr=m(B),Zs=a(B,"LI",{});var _a=r(Zs);Qs=a(_a,"P",{});var qp=r(Qs);jt=a(qp,"A",{href:!0,rel:!0});var Fp=r(jt);Qr=i(Fp,"google/mt5-base"),Fp.forEach(n),qp.forEach(n),_a.forEach(n),el=m(B),eo=a(B,"LI",{});var Pp=r(eo);to=a(Pp,"P",{});var Cp=r(to);Et=a(Cp,"A",{href:!0,rel:!0});var Ap=r(Et);tl=i(Ap,"google/mt5-large"),Ap.forEach(n),Cp.forEach(n),Pp.forEach(n),nl=m(B),no=a(B,"LI",{});var Sp=r(no);so=a(Sp,"P",{});var Lp=r(so);qt=a(Lp,"A",{href:!0,rel:!0});var Np=r(qt);sl=i(Np,"google/mt5-xl"),Np.forEach(n),Lp.forEach(n),Sp.forEach(n),ol=m(B),oo=a(B,"LI",{});var Op=r(oo);os=a(Op,"P",{});var yp=r(os);Ft=a(yp,"A",{href:!0,rel:!0});var Gp=r(Ft);al=i(Gp,"google/mt5-xxl"),Gp.forEach(n),rl=i(yp,"."),yp.forEach(n),Op.forEach(n),B.forEach(n),Ma=m(t),oe=a(t,"P",{});var Es=r(oe);ll=i(Es,"This model was contributed by "),Pt=a(Es,"A",{href:!0,rel:!0});var Ip=r(Pt);il=i(Ip,"patrickvonplaten"),Ip.forEach(n),dl=i(Es,`. The original code can be
found `),Ct=a(Es,"A",{href:!0,rel:!0});var Dp=r(Ct);cl=i(Dp,"here"),Dp.forEach(n),pl=i(Es,"."),Es.forEach(n),xa=m(t),me=a(t,"H2",{class:!0});var Qa=r(me);Pe=a(Qa,"A",{id:!0,class:!0,href:!0});var Up=r(Pe);ao=a(Up,"SPAN",{});var Bp=r(ao);k(At.$$.fragment,Bp),Bp.forEach(n),Up.forEach(n),ml=m(Qa),ro=a(Qa,"SPAN",{});var Wp=r(ro);hl=i(Wp,"MT5Config"),Wp.forEach(n),Qa.forEach(n),za=m(t),X=a(t,"DIV",{class:!0});var qs=r(X);k(St.$$.fragment,qs),ul=m(qs),Y=a(qs,"P",{});var _t=r(Y);fl=i(_t,"This is the configuration class to store the configuration of a "),as=a(_t,"A",{href:!0});var Vp=r(as);gl=i(Vp,"MT5Model"),Vp.forEach(n),_l=i(_t," or a "),rs=a(_t,"A",{href:!0});var Hp=r(rs);Tl=i(Hp,"TFMT5Model"),Hp.forEach(n),bl=i(_t,`. It is used to
instantiate a mT5 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 mT5
`),Lt=a(_t,"A",{href:!0,rel:!0});var Rp=r(Lt);vl=i(Rp,"google/mt5-small"),Rp.forEach(n),kl=i(_t," architecture."),_t.forEach(n),$l=m(qs),he=a(qs,"P",{});var Fs=r(he);wl=i(Fs,"Configuration objects inherit from "),ls=a(Fs,"A",{href:!0});var Kp=r(ls);yl=i(Kp,"PretrainedConfig"),Kp.forEach(n),Ml=i(Fs,` and can be used to control the model outputs. Read the
documentation from `),is=a(Fs,"A",{href:!0});var Jp=r(is);xl=i(Jp,"PretrainedConfig"),Jp.forEach(n),zl=i(Fs," for more information."),Fs.forEach(n),qs.forEach(n),ja=m(t),ue=a(t,"H2",{class:!0});var er=r(ue);Ce=a(er,"A",{id:!0,class:!0,href:!0});var Xp=r(Ce);lo=a(Xp,"SPAN",{});var Yp=r(lo);k(Nt.$$.fragment,Yp),Yp.forEach(n),Xp.forEach(n),jl=m(er),io=a(er,"SPAN",{});var Zp=r(io);El=i(Zp,"MT5Tokenizer"),Zp.forEach(n),er.forEach(n),Ea=m(t),F=a(t,"DIV",{class:!0});var D=r(F);k(Ot.$$.fragment,D),ql=m(D),Gt=a(D,"P",{});var tr=r(Gt);Fl=i(tr,"Construct a T5 tokenizer. Based on "),It=a(tr,"A",{href:!0,rel:!0});var Qp=r(It);Pl=i(Qp,"SentencePiece"),Qp.forEach(n),Cl=i(tr,"."),tr.forEach(n),Al=m(D),Dt=a(D,"P",{});var nr=r(Dt);Sl=i(nr,"This tokenizer inherits from "),ds=a(nr,"A",{href:!0});var em=r(ds);Ll=i(em,"PreTrainedTokenizer"),em.forEach(n),Nl=i(nr,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),nr.forEach(n),Ol=m(D),ae=a(D,"DIV",{class:!0});var Ps=r(ae);k(Ut.$$.fragment,Ps),Gl=m(Ps),co=a(Ps,"P",{});var tm=r(co);Il=i(tm,`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:`),tm.forEach(n),Dl=m(Ps),Bt=a(Ps,"UL",{});var sr=r(Bt);cs=a(sr,"LI",{});var Mp=r(cs);Ul=i(Mp,"single sequence: "),po=a(Mp,"CODE",{});var nm=r(po);Bl=i(nm,"X </s>"),nm.forEach(n),Mp.forEach(n),Wl=m(sr),ps=a(sr,"LI",{});var xp=r(ps);Vl=i(xp,"pair of sequences: "),mo=a(xp,"CODE",{});var sm=r(mo);Hl=i(sm,"A </s> B </s>"),sm.forEach(n),xp.forEach(n),sr.forEach(n),Ps.forEach(n),Rl=m(D),Ae=a(D,"DIV",{class:!0});var or=r(Ae);k(Wt.$$.fragment,or),Kl=m(or),ho=a(or,"P",{});var om=r(ho);Jl=i(om,"Converts a sequence of tokens (string) in a single string."),om.forEach(n),or.forEach(n),Xl=m(D),Se=a(D,"DIV",{class:!0});var ar=r(Se);k(Vt.$$.fragment,ar),Yl=m(ar),uo=a(ar,"P",{});var am=r(uo);Zl=i(am,`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.`),am.forEach(n),ar.forEach(n),Ql=m(D),Le=a(D,"DIV",{class:!0});var rr=r(Le);k(Ht.$$.fragment,rr),ei=m(rr),Rt=a(rr,"P",{});var lr=r(Rt);ti=i(lr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),fo=a(lr,"CODE",{});var rm=r(fo);ni=i(rm,"prepare_for_model"),rm.forEach(n),si=i(lr," method."),lr.forEach(n),rr.forEach(n),D.forEach(n),qa=m(t),Ne=a(t,"P",{});var ir=r(Ne);oi=i(ir,"See "),ms=a(ir,"A",{href:!0});var lm=r(ms);ai=i(lm,"T5Tokenizer"),lm.forEach(n),ri=i(ir," for all details."),ir.forEach(n),Fa=m(t),fe=a(t,"H2",{class:!0});var dr=r(fe);Oe=a(dr,"A",{id:!0,class:!0,href:!0});var im=r(Oe);go=a(im,"SPAN",{});var dm=r(go);k(Kt.$$.fragment,dm),dm.forEach(n),im.forEach(n),li=m(dr),_o=a(dr,"SPAN",{});var cm=r(_o);ii=i(cm,"MT5TokenizerFast"),cm.forEach(n),dr.forEach(n),Pa=m(t),O=a(t,"DIV",{class:!0});var ce=r(O);k(Jt.$$.fragment,ce),di=m(ce),ge=a(ce,"P",{});var Cs=r(ge);ci=i(Cs,"Construct a \u201Cfast\u201D T5 tokenizer (backed by HuggingFace\u2019s "),To=a(Cs,"EM",{});var pm=r(To);pi=i(pm,"tokenizers"),pm.forEach(n),mi=i(Cs,` library). Based on
`),Xt=a(Cs,"A",{href:!0,rel:!0});var mm=r(Xt);hi=i(mm,"Unigram"),mm.forEach(n),ui=i(Cs,"."),Cs.forEach(n),fi=m(ce),Yt=a(ce,"P",{});var cr=r(Yt);gi=i(cr,"This tokenizer inherits from "),hs=a(cr,"A",{href:!0});var hm=r(hs);_i=i(hm,"PreTrainedTokenizerFast"),hm.forEach(n),Ti=i(cr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),cr.forEach(n),bi=m(ce),re=a(ce,"DIV",{class:!0});var As=r(re);k(Zt.$$.fragment,As),vi=m(As),bo=a(As,"P",{});var um=r(bo);ki=i(um,`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:`),um.forEach(n),$i=m(As),Qt=a(As,"UL",{});var pr=r(Qt);us=a(pr,"LI",{});var zp=r(us);wi=i(zp,"single sequence: "),vo=a(zp,"CODE",{});var fm=r(vo);yi=i(fm,"X </s>"),fm.forEach(n),zp.forEach(n),Mi=m(pr),fs=a(pr,"LI",{});var jp=r(fs);xi=i(jp,"pair of sequences: "),ko=a(jp,"CODE",{});var gm=r(ko);zi=i(gm,"A </s> B </s>"),gm.forEach(n),jp.forEach(n),pr.forEach(n),As.forEach(n),ji=m(ce),Ge=a(ce,"DIV",{class:!0});var mr=r(Ge);k(en.$$.fragment,mr),Ei=m(mr),$o=a(mr,"P",{});var _m=r($o);qi=i(_m,`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.`),_m.forEach(n),mr.forEach(n),ce.forEach(n),Ca=m(t),Ie=a(t,"P",{});var hr=r(Ie);Fi=i(hr,"See "),gs=a(hr,"A",{href:!0});var Tm=r(gs);Pi=i(Tm,"T5TokenizerFast"),Tm.forEach(n),Ci=i(hr," for all details."),hr.forEach(n),Aa=m(t),_e=a(t,"H2",{class:!0});var ur=r(_e);De=a(ur,"A",{id:!0,class:!0,href:!0});var bm=r(De);wo=a(bm,"SPAN",{});var vm=r(wo);k(tn.$$.fragment,vm),vm.forEach(n),bm.forEach(n),Ai=m(ur),yo=a(ur,"SPAN",{});var km=r(yo);Si=i(km,"MT5Model"),km.forEach(n),ur.forEach(n),Sa=m(t),j=a(t,"DIV",{class:!0});var P=r(j);k(nn.$$.fragment,P),Li=m(P),Mo=a(P,"P",{});var $m=r(Mo);Ni=i($m,"The bare MT5 Model transformer outputting raw hidden-states without any specific head on top."),$m.forEach(n),Oi=m(P),sn=a(P,"P",{});var fr=r(sn);Gi=i(fr,"The MT5 model was proposed in "),on=a(fr,"A",{href:!0,rel:!0});var wm=r(on);Ii=i(wm,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),wm.forEach(n),Di=i(fr,` 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.`),fr.forEach(n),Ui=m(P),an=a(P,"P",{});var gr=r(an);Bi=i(gr,"This model inherits from "),_s=a(gr,"A",{href:!0});var ym=r(_s);Wi=i(ym,"PreTrainedModel"),ym.forEach(n),Vi=i(gr,`. 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.)`),gr.forEach(n),Hi=m(P),rn=a(P,"P",{});var _r=r(rn);Ri=i(_r,"This model is also a PyTorch "),ln=a(_r,"A",{href:!0,rel:!0});var Mm=r(ln);Ki=i(Mm,"torch.nn.Module"),Mm.forEach(n),Ji=i(_r,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_r.forEach(n),Xi=m(P),k(Ue.$$.fragment,P),Yi=m(P),le=a(P,"DIV",{class:!0});var Ss=r(le);k(dn.$$.fragment,Ss),Zi=m(Ss),xo=a(Ss,"P",{});var xm=r(xo);Qi=i(xm,"Moves the model to cpu from a model parallel state."),xm.forEach(n),ed=m(Ss),k(Be.$$.fragment,Ss),Ss.forEach(n),td=m(P),W=a(P,"DIV",{class:!0});var Tt=r(W);k(cn.$$.fragment,Tt),nd=m(Tt),Te=a(Tt,"P",{});var Ls=r(Te);sd=i(Ls,"The "),Ts=a(Ls,"A",{href:!0});var zm=r(Ts);od=i(zm,"MT5Model"),zm.forEach(n),ad=i(Ls," forward method, overrides the "),zo=a(Ls,"CODE",{});var jm=r(zo);rd=i(jm,"__call__"),jm.forEach(n),ld=i(Ls," special method."),Ls.forEach(n),id=m(Tt),k(We.$$.fragment,Tt),dd=m(Tt),k(Ve.$$.fragment,Tt),Tt.forEach(n),cd=m(P),V=a(P,"DIV",{class:!0});var bt=r(V);k(pn.$$.fragment,bt),pd=m(bt),jo=a(bt,"P",{});var Em=r(jo);md=i(Em,"This is an experimental feature and is a subject to change at a moment\u2019s notice."),Em.forEach(n),hd=m(bt),Eo=a(bt,"P",{});var qm=r(Eo);ud=i(qm,`Uses a device map to distribute attention modules of the model across several devices. If no device map is given,
it will evenly distribute blocks across all devices.`),qm.forEach(n),fd=m(bt),k(He.$$.fragment,bt),bt.forEach(n),P.forEach(n),La=m(t),be=a(t,"H2",{class:!0});var Tr=r(be);Re=a(Tr,"A",{id:!0,class:!0,href:!0});var Fm=r(Re);qo=a(Fm,"SPAN",{});var Pm=r(qo);k(mn.$$.fragment,Pm),Pm.forEach(n),Fm.forEach(n),gd=m(Tr),Fo=a(Tr,"SPAN",{});var Cm=r(Fo);_d=i(Cm,"MT5ForConditionalGeneration"),Cm.forEach(n),Tr.forEach(n),Na=m(t),E=a(t,"DIV",{class:!0});var C=r(E);k(hn.$$.fragment,C),Td=m(C),un=a(C,"P",{});var br=r(un);bd=i(br,"MT5 Model with a "),Po=a(br,"CODE",{});var Am=r(Po);vd=i(Am,"language modeling"),Am.forEach(n),kd=i(br," head on top."),br.forEach(n),$d=m(C),fn=a(C,"P",{});var vr=r(fn);wd=i(vr,"The MT5 model was proposed in "),gn=a(vr,"A",{href:!0,rel:!0});var Sm=r(gn);yd=i(Sm,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Sm.forEach(n),Md=i(vr,` 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.`),vr.forEach(n),xd=m(C),_n=a(C,"P",{});var kr=r(_n);zd=i(kr,"This model inherits from "),bs=a(kr,"A",{href:!0});var Lm=r(bs);jd=i(Lm,"PreTrainedModel"),Lm.forEach(n),Ed=i(kr,`. 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.)`),kr.forEach(n),qd=m(C),Tn=a(C,"P",{});var $r=r(Tn);Fd=i($r,"This model is also a PyTorch "),bn=a($r,"A",{href:!0,rel:!0});var Nm=r(bn);Pd=i(Nm,"torch.nn.Module"),Nm.forEach(n),Cd=i($r,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$r.forEach(n),Ad=m(C),k(Ke.$$.fragment,C),Sd=m(C),ie=a(C,"DIV",{class:!0});var Ns=r(ie);k(vn.$$.fragment,Ns),Ld=m(Ns),Co=a(Ns,"P",{});var Om=r(Co);Nd=i(Om,"Moves the model to cpu from a model parallel state."),Om.forEach(n),Od=m(Ns),k(Je.$$.fragment,Ns),Ns.forEach(n),Gd=m(C),H=a(C,"DIV",{class:!0});var vt=r(H);k(kn.$$.fragment,vt),Id=m(vt),ve=a(vt,"P",{});var Os=r(ve);Dd=i(Os,"The "),vs=a(Os,"A",{href:!0});var Gm=r(vs);Ud=i(Gm,"MT5ForConditionalGeneration"),Gm.forEach(n),Bd=i(Os," forward method, overrides the "),Ao=a(Os,"CODE",{});var Im=r(Ao);Wd=i(Im,"__call__"),Im.forEach(n),Vd=i(Os," special method."),Os.forEach(n),Hd=m(vt),k(Xe.$$.fragment,vt),Rd=m(vt),k(Ye.$$.fragment,vt),vt.forEach(n),Kd=m(C),R=a(C,"DIV",{class:!0});var kt=r(R);k($n.$$.fragment,kt),Jd=m(kt),So=a(kt,"P",{});var Dm=r(So);Xd=i(Dm,"This is an experimental feature and is a subject to change at a moment\u2019s notice."),Dm.forEach(n),Yd=m(kt),Lo=a(kt,"P",{});var Um=r(Lo);Zd=i(Um,`Uses a device map to distribute attention modules of the model across several devices. If no device map is given,
it will evenly distribute blocks across all devices.`),Um.forEach(n),Qd=m(kt),k(Ze.$$.fragment,kt),kt.forEach(n),C.forEach(n),Oa=m(t),ke=a(t,"H2",{class:!0});var wr=r(ke);Qe=a(wr,"A",{id:!0,class:!0,href:!0});var Bm=r(Qe);No=a(Bm,"SPAN",{});var Wm=r(No);k(wn.$$.fragment,Wm),Wm.forEach(n),Bm.forEach(n),ec=m(wr),Oo=a(wr,"SPAN",{});var Vm=r(Oo);tc=i(Vm,"MT5EncoderModel"),Vm.forEach(n),wr.forEach(n),Ga=m(t),q=a(t,"DIV",{class:!0});var A=r(q);k(yn.$$.fragment,A),nc=m(A),Go=a(A,"P",{});var Hm=r(Go);sc=i(Hm,"The bare MT5 Model transformer outputting encoder\u2019s raw hidden-states without any specific head on top."),Hm.forEach(n),oc=m(A),Mn=a(A,"P",{});var yr=r(Mn);ac=i(yr,"The MT5 model was proposed in "),xn=a(yr,"A",{href:!0,rel:!0});var Rm=r(xn);rc=i(Rm,`Exploring the Limits of Transfer Learning with a Unified Text-to-Text
Transformer`),Rm.forEach(n),lc=i(yr,` 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.`),yr.forEach(n),ic=m(A),zn=a(A,"P",{});var Mr=r(zn);dc=i(Mr,"This model inherits from "),ks=a(Mr,"A",{href:!0});var Km=r(ks);cc=i(Km,"PreTrainedModel"),Km.forEach(n),pc=i(Mr,`. 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.)`),Mr.forEach(n),mc=m(A),jn=a(A,"P",{});var xr=r(jn);hc=i(xr,"This model is also a PyTorch "),En=a(xr,"A",{href:!0,rel:!0});var Jm=r(En);uc=i(Jm,"torch.nn.Module"),Jm.forEach(n),fc=i(xr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xr.forEach(n),gc=m(A),k(et.$$.fragment,A),_c=m(A),de=a(A,"DIV",{class:!0});var Gs=r(de);k(qn.$$.fragment,Gs),Tc=m(Gs),Io=a(Gs,"P",{});var Xm=r(Io);bc=i(Xm,"Moves the model to cpu from a model parallel state."),Xm.forEach(n),vc=m(Gs),k(tt.$$.fragment,Gs),Gs.forEach(n),kc=m(A),K=a(A,"DIV",{class:!0});var $t=r(K);k(Fn.$$.fragment,$t),$c=m($t),$e=a($t,"P",{});var Is=r($e);wc=i(Is,"The "),$s=a(Is,"A",{href:!0});var Ym=r($s);yc=i(Ym,"MT5EncoderModel"),Ym.forEach(n),Mc=i(Is," forward method, overrides the "),Do=a(Is,"CODE",{});var Zm=r(Do);xc=i(Zm,"__call__"),Zm.forEach(n),zc=i(Is," special method."),Is.forEach(n),jc=m($t),k(nt.$$.fragment,$t),Ec=m($t),k(st.$$.fragment,$t),$t.forEach(n),qc=m(A),J=a(A,"DIV",{class:!0});var wt=r(J);k(Pn.$$.fragment,wt),Fc=m(wt),Uo=a(wt,"P",{});var Qm=r(Uo);Pc=i(Qm,"This is an experimental feature and is a subject to change at a moment\u2019s notice."),Qm.forEach(n),Cc=m(wt),Bo=a(wt,"P",{});var eh=r(Bo);Ac=i(eh,`Uses a device map to distribute attention modules of the model across several devices. If no device map is given,
it will evenly distribute blocks across all devices.`),eh.forEach(n),Sc=m(wt),k(ot.$$.fragment,wt),wt.forEach(n),A.forEach(n),Ia=m(t),we=a(t,"H2",{class:!0});var zr=r(we);at=a(zr,"A",{id:!0,class:!0,href:!0});var th=r(at);Wo=a(th,"SPAN",{});var nh=r(Wo);k(Cn.$$.fragment,nh),nh.forEach(n),th.forEach(n),Lc=m(zr),Vo=a(zr,"SPAN",{});var sh=r(Vo);Nc=i(sh,"TFMT5Model"),sh.forEach(n),zr.forEach(n),Da=m(t),Z=a(t,"DIV",{class:!0});var Ds=r(Z);k(An.$$.fragment,Ds),Oc=m(Ds),Sn=a(Ds,"P",{});var jr=r(Sn);Gc=i(jr,"This class overrides "),ws=a(jr,"A",{href:!0});var oh=r(ws);Ic=i(oh,"TFT5Model"),oh.forEach(n),Dc=i(jr,`. Please check the superclass for the appropriate documentation alongside usage
examples.`),jr.forEach(n),Uc=m(Ds),k(rt.$$.fragment,Ds),Ds.forEach(n),Ua=m(t),ye=a(t,"H2",{class:!0});var Er=r(ye);lt=a(Er,"A",{id:!0,class:!0,href:!0});var ah=r(lt);Ho=a(ah,"SPAN",{});var rh=r(Ho);k(Ln.$$.fragment,rh),rh.forEach(n),ah.forEach(n),Bc=m(Er),Ro=a(Er,"SPAN",{});var lh=r(Ro);Wc=i(lh,"TFMT5ForConditionalGeneration"),lh.forEach(n),Er.forEach(n),Ba=m(t),Q=a(t,"DIV",{class:!0});var Us=r(Q);k(Nn.$$.fragment,Us),Vc=m(Us),On=a(Us,"P",{});var qr=r(On);Hc=i(qr,"This class overrides "),ys=a(qr,"A",{href:!0});var ih=r(ys);Rc=i(ih,"TFT5ForConditionalGeneration"),ih.forEach(n),Kc=i(qr,`. Please check the superclass for the appropriate
documentation alongside usage examples.`),qr.forEach(n),Jc=m(Us),k(it.$$.fragment,Us),Us.forEach(n),Wa=m(t),Me=a(t,"H2",{class:!0});var Fr=r(Me);dt=a(Fr,"A",{id:!0,class:!0,href:!0});var dh=r(dt);Ko=a(dh,"SPAN",{});var ch=r(Ko);k(Gn.$$.fragment,ch),ch.forEach(n),dh.forEach(n),Xc=m(Fr),Jo=a(Fr,"SPAN",{});var ph=r(Jo);Yc=i(ph,"TFMT5EncoderModel"),ph.forEach(n),Fr.forEach(n),Va=m(t),ee=a(t,"DIV",{class:!0});var Bs=r(ee);k(In.$$.fragment,Bs),Zc=m(Bs),Dn=a(Bs,"P",{});var Pr=r(Dn);Qc=i(Pr,"This class overrides "),Ms=a(Pr,"A",{href:!0});var mh=r(Ms);ep=i(mh,"TFT5EncoderModel"),mh.forEach(n),tp=i(Pr,`. Please check the superclass for the appropriate documentation alongside
usage examples.`),Pr.forEach(n),np=m(Bs),k(ct.$$.fragment,Bs),Bs.forEach(n),Ha=m(t),xe=a(t,"H2",{class:!0});var Cr=r(xe);pt=a(Cr,"A",{id:!0,class:!0,href:!0});var hh=r(pt);Xo=a(hh,"SPAN",{});var uh=r(Xo);k(Un.$$.fragment,uh),uh.forEach(n),hh.forEach(n),sp=m(Cr),Yo=a(Cr,"SPAN",{});var fh=r(Yo);op=i(fh,"FlaxMT5Model"),fh.forEach(n),Cr.forEach(n),Ra=m(t),te=a(t,"DIV",{class:!0});var Ws=r(te);k(Bn.$$.fragment,Ws),ap=m(Ws),Wn=a(Ws,"P",{});var Ar=r(Wn);rp=i(Ar,"This class overrides "),xs=a(Ar,"A",{href:!0});var gh=r(xs);lp=i(gh,"FlaxT5Model"),gh.forEach(n),ip=i(Ar,`. Please check the superclass for the appropriate documentation alongside usage
examples.`),Ar.forEach(n),dp=m(Ws),k(mt.$$.fragment,Ws),Ws.forEach(n),Ka=m(t),ze=a(t,"H2",{class:!0});var Sr=r(ze);ht=a(Sr,"A",{id:!0,class:!0,href:!0});var _h=r(ht);Zo=a(_h,"SPAN",{});var Th=r(Zo);k(Vn.$$.fragment,Th),Th.forEach(n),_h.forEach(n),cp=m(Sr),Qo=a(Sr,"SPAN",{});var bh=r(Qo);pp=i(bh,"FlaxMT5ForConditionalGeneration"),bh.forEach(n),Sr.forEach(n),Ja=m(t),ne=a(t,"DIV",{class:!0});var Vs=r(ne);k(Hn.$$.fragment,Vs),mp=m(Vs),Rn=a(Vs,"P",{});var Lr=r(Rn);hp=i(Lr,"This class overrides "),zs=a(Lr,"A",{href:!0});var vh=r(zs);up=i(vh,"FlaxT5ForConditionalGeneration"),vh.forEach(n),fp=i(Lr,`. Please check the superclass for the appropriate
documentation alongside usage examples.`),Lr.forEach(n),gp=m(Vs),k(ut.$$.fragment,Vs),Vs.forEach(n),Xa=m(t),je=a(t,"H2",{class:!0});var Nr=r(je);ft=a(Nr,"A",{id:!0,class:!0,href:!0});var kh=r(ft);ea=a(kh,"SPAN",{});var $h=r(ea);k(Kn.$$.fragment,$h),$h.forEach(n),kh.forEach(n),_p=m(Nr),ta=a(Nr,"SPAN",{});var wh=r(ta);Tp=i(wh,"FlaxMT5EncoderModel"),wh.forEach(n),Nr.forEach(n),Ya=m(t),se=a(t,"DIV",{class:!0});var Hs=r(se);k(Jn.$$.fragment,Hs),bp=m(Hs),Xn=a(Hs,"P",{});var Or=r(Xn);vp=i(Or,"This class overrides "),js=a(Or,"A",{href:!0});var yh=r(js);kp=i(yh,"FlaxT5EncoderModel"),yh.forEach(n),$p=i(Or,`. Please check the superclass for the appropriate documentation
alongside usage examples.`),Or.forEach(n),wp=m(Hs),k(gt.$$.fragment,Hs),Hs.forEach(n),this.h()},h(){u(c,"name","hf:doc:metadata"),u(c,"content",JSON.stringify(Zh)),u(d,"id","mt5"),u(d,"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"),u(d,"href","#mt5"),u(f,"class","relative group"),u(Ee,"id","overview"),u(Ee,"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"),u(Ee,"href","#overview"),u(pe,"class","relative group"),u(Mt,"href","https://arxiv.org/abs/2010.11934"),u(Mt,"rel","nofollow"),u(xt,"href","https://huggingface.co/datasets/mc4"),u(xt,"rel","nofollow"),u(zt,"href","https://huggingface.co/google/mt5-small"),u(zt,"rel","nofollow"),u(jt,"href","https://huggingface.co/google/mt5-base"),u(jt,"rel","nofollow"),u(Et,"href","https://huggingface.co/google/mt5-large"),u(Et,"rel","nofollow"),u(qt,"href","https://huggingface.co/google/mt5-xl"),u(qt,"rel","nofollow"),u(Ft,"href","https://huggingface.co/google/mt5-xxl"),u(Ft,"rel","nofollow"),u(Pt,"href","https://huggingface.co/patrickvonplaten"),u(Pt,"rel","nofollow"),u(Ct,"href","https://github.com/google-research/multilingual-t5"),u(Ct,"rel","nofollow"),u(Pe,"id","transformers.MT5Config"),u(Pe,"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"),u(Pe,"href","#transformers.MT5Config"),u(me,"class","relative group"),u(as,"href","/docs/transformers/main/en/model_doc/mt5#transformers.MT5Model"),u(rs,"href","/docs/transformers/main/en/model_doc/mt5#transformers.TFMT5Model"),u(Lt,"href","https://huggingface.co/google/mt5-small"),u(Lt,"rel","nofollow"),u(ls,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),u(is,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),u(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ce,"id","transformers.T5Tokenizer"),u(Ce,"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"),u(Ce,"href","#transformers.T5Tokenizer"),u(ue,"class","relative group"),u(It,"href","https://github.com/google/sentencepiece"),u(It,"rel","nofollow"),u(ds,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),u(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ms,"href","/docs/transformers/main/en/model_doc/t5#transformers.T5Tokenizer"),u(Oe,"id","transformers.T5TokenizerFast"),u(Oe,"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"),u(Oe,"href","#transformers.T5TokenizerFast"),u(fe,"class","relative group"),u(Xt,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=unigram#models"),u(Xt,"rel","nofollow"),u(hs,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),u(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(gs,"href","/docs/transformers/main/en/model_doc/t5#transformers.T5TokenizerFast"),u(De,"id","transformers.MT5Model"),u(De,"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"),u(De,"href","#transformers.MT5Model"),u(_e,"class","relative group"),u(on,"href","https://arxiv.org/abs/1910.10683"),u(on,"rel","nofollow"),u(_s,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),u(ln,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(ln,"rel","nofollow"),u(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ts,"href","/docs/transformers/main/en/model_doc/mt5#transformers.MT5Model"),u(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Re,"id","transformers.MT5ForConditionalGeneration"),u(Re,"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"),u(Re,"href","#transformers.MT5ForConditionalGeneration"),u(be,"class","relative group"),u(gn,"href","https://arxiv.org/abs/1910.10683"),u(gn,"rel","nofollow"),u(bs,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),u(bn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(bn,"rel","nofollow"),u(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(vs,"href","/docs/transformers/main/en/model_doc/mt5#transformers.MT5ForConditionalGeneration"),u(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Qe,"id","transformers.MT5EncoderModel"),u(Qe,"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"),u(Qe,"href","#transformers.MT5EncoderModel"),u(ke,"class","relative group"),u(xn,"href","https://arxiv.org/abs/1910.10683"),u(xn,"rel","nofollow"),u(ks,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),u(En,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(En,"rel","nofollow"),u(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u($s,"href","/docs/transformers/main/en/model_doc/mt5#transformers.MT5EncoderModel"),u(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(at,"id","transformers.TFMT5Model"),u(at,"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"),u(at,"href","#transformers.TFMT5Model"),u(we,"class","relative group"),u(ws,"href","/docs/transformers/main/en/model_doc/t5#transformers.TFT5Model"),u(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(lt,"id","transformers.TFMT5ForConditionalGeneration"),u(lt,"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"),u(lt,"href","#transformers.TFMT5ForConditionalGeneration"),u(ye,"class","relative group"),u(ys,"href","/docs/transformers/main/en/model_doc/t5#transformers.TFT5ForConditionalGeneration"),u(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(dt,"id","transformers.TFMT5EncoderModel"),u(dt,"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"),u(dt,"href","#transformers.TFMT5EncoderModel"),u(Me,"class","relative group"),u(Ms,"href","/docs/transformers/main/en/model_doc/t5#transformers.TFT5EncoderModel"),u(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(pt,"id","transformers.FlaxMT5Model"),u(pt,"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"),u(pt,"href","#transformers.FlaxMT5Model"),u(xe,"class","relative group"),u(xs,"href","/docs/transformers/main/en/model_doc/t5#transformers.FlaxT5Model"),u(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ht,"id","transformers.FlaxMT5ForConditionalGeneration"),u(ht,"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"),u(ht,"href","#transformers.FlaxMT5ForConditionalGeneration"),u(ze,"class","relative group"),u(zs,"href","/docs/transformers/main/en/model_doc/t5#transformers.FlaxT5ForConditionalGeneration"),u(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ft,"id","transformers.FlaxMT5EncoderModel"),u(ft,"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"),u(ft,"href","#transformers.FlaxMT5EncoderModel"),u(je,"class","relative group"),u(js,"href","/docs/transformers/main/en/model_doc/t5#transformers.FlaxT5EncoderModel"),u(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,c),_(t,b,g),_(t,f,g),e(f,d),e(d,T),$(s,T,null),e(f,h),e(f,G),e(G,Gr),_(t,Ta,g),_(t,pe,g),e(pe,Ee),e(Ee,Rs),$(yt,Rs,null),e(pe,Ir),e(pe,Ks),e(Ks,Dr),_(t,ba,g),_(t,qe,g),e(qe,Ur),e(qe,Mt),e(Mt,Br),e(qe,Wr),_(t,va,g),_(t,ts,g),e(ts,Vr),_(t,ka,g),_(t,ns,g),e(ns,Js),e(Js,Hr),_(t,$a,g),_(t,Fe,g),e(Fe,Rr),e(Fe,xt),e(xt,Kr),e(Fe,Jr),_(t,wa,g),_(t,ss,g),e(ss,Xr),_(t,ya,g),_(t,I,g),e(I,Xs),e(Xs,Ys),e(Ys,zt),e(zt,Yr),e(I,Zr),e(I,Zs),e(Zs,Qs),e(Qs,jt),e(jt,Qr),e(I,el),e(I,eo),e(eo,to),e(to,Et),e(Et,tl),e(I,nl),e(I,no),e(no,so),e(so,qt),e(qt,sl),e(I,ol),e(I,oo),e(oo,os),e(os,Ft),e(Ft,al),e(os,rl),_(t,Ma,g),_(t,oe,g),e(oe,ll),e(oe,Pt),e(Pt,il),e(oe,dl),e(oe,Ct),e(Ct,cl),e(oe,pl),_(t,xa,g),_(t,me,g),e(me,Pe),e(Pe,ao),$(At,ao,null),e(me,ml),e(me,ro),e(ro,hl),_(t,za,g),_(t,X,g),$(St,X,null),e(X,ul),e(X,Y),e(Y,fl),e(Y,as),e(as,gl),e(Y,_l),e(Y,rs),e(rs,Tl),e(Y,bl),e(Y,Lt),e(Lt,vl),e(Y,kl),e(X,$l),e(X,he),e(he,wl),e(he,ls),e(ls,yl),e(he,Ml),e(he,is),e(is,xl),e(he,zl),_(t,ja,g),_(t,ue,g),e(ue,Ce),e(Ce,lo),$(Nt,lo,null),e(ue,jl),e(ue,io),e(io,El),_(t,Ea,g),_(t,F,g),$(Ot,F,null),e(F,ql),e(F,Gt),e(Gt,Fl),e(Gt,It),e(It,Pl),e(Gt,Cl),e(F,Al),e(F,Dt),e(Dt,Sl),e(Dt,ds),e(ds,Ll),e(Dt,Nl),e(F,Ol),e(F,ae),$(Ut,ae,null),e(ae,Gl),e(ae,co),e(co,Il),e(ae,Dl),e(ae,Bt),e(Bt,cs),e(cs,Ul),e(cs,po),e(po,Bl),e(Bt,Wl),e(Bt,ps),e(ps,Vl),e(ps,mo),e(mo,Hl),e(F,Rl),e(F,Ae),$(Wt,Ae,null),e(Ae,Kl),e(Ae,ho),e(ho,Jl),e(F,Xl),e(F,Se),$(Vt,Se,null),e(Se,Yl),e(Se,uo),e(uo,Zl),e(F,Ql),e(F,Le),$(Ht,Le,null),e(Le,ei),e(Le,Rt),e(Rt,ti),e(Rt,fo),e(fo,ni),e(Rt,si),_(t,qa,g),_(t,Ne,g),e(Ne,oi),e(Ne,ms),e(ms,ai),e(Ne,ri),_(t,Fa,g),_(t,fe,g),e(fe,Oe),e(Oe,go),$(Kt,go,null),e(fe,li),e(fe,_o),e(_o,ii),_(t,Pa,g),_(t,O,g),$(Jt,O,null),e(O,di),e(O,ge),e(ge,ci),e(ge,To),e(To,pi),e(ge,mi),e(ge,Xt),e(Xt,hi),e(ge,ui),e(O,fi),e(O,Yt),e(Yt,gi),e(Yt,hs),e(hs,_i),e(Yt,Ti),e(O,bi),e(O,re),$(Zt,re,null),e(re,vi),e(re,bo),e(bo,ki),e(re,$i),e(re,Qt),e(Qt,us),e(us,wi),e(us,vo),e(vo,yi),e(Qt,Mi),e(Qt,fs),e(fs,xi),e(fs,ko),e(ko,zi),e(O,ji),e(O,Ge),$(en,Ge,null),e(Ge,Ei),e(Ge,$o),e($o,qi),_(t,Ca,g),_(t,Ie,g),e(Ie,Fi),e(Ie,gs),e(gs,Pi),e(Ie,Ci),_(t,Aa,g),_(t,_e,g),e(_e,De),e(De,wo),$(tn,wo,null),e(_e,Ai),e(_e,yo),e(yo,Si),_(t,Sa,g),_(t,j,g),$(nn,j,null),e(j,Li),e(j,Mo),e(Mo,Ni),e(j,Oi),e(j,sn),e(sn,Gi),e(sn,on),e(on,Ii),e(sn,Di),e(j,Ui),e(j,an),e(an,Bi),e(an,_s),e(_s,Wi),e(an,Vi),e(j,Hi),e(j,rn),e(rn,Ri),e(rn,ln),e(ln,Ki),e(rn,Ji),e(j,Xi),$(Ue,j,null),e(j,Yi),e(j,le),$(dn,le,null),e(le,Zi),e(le,xo),e(xo,Qi),e(le,ed),$(Be,le,null),e(j,td),e(j,W),$(cn,W,null),e(W,nd),e(W,Te),e(Te,sd),e(Te,Ts),e(Ts,od),e(Te,ad),e(Te,zo),e(zo,rd),e(Te,ld),e(W,id),$(We,W,null),e(W,dd),$(Ve,W,null),e(j,cd),e(j,V),$(pn,V,null),e(V,pd),e(V,jo),e(jo,md),e(V,hd),e(V,Eo),e(Eo,ud),e(V,fd),$(He,V,null),_(t,La,g),_(t,be,g),e(be,Re),e(Re,qo),$(mn,qo,null),e(be,gd),e(be,Fo),e(Fo,_d),_(t,Na,g),_(t,E,g),$(hn,E,null),e(E,Td),e(E,un),e(un,bd),e(un,Po),e(Po,vd),e(un,kd),e(E,$d),e(E,fn),e(fn,wd),e(fn,gn),e(gn,yd),e(fn,Md),e(E,xd),e(E,_n),e(_n,zd),e(_n,bs),e(bs,jd),e(_n,Ed),e(E,qd),e(E,Tn),e(Tn,Fd),e(Tn,bn),e(bn,Pd),e(Tn,Cd),e(E,Ad),$(Ke,E,null),e(E,Sd),e(E,ie),$(vn,ie,null),e(ie,Ld),e(ie,Co),e(Co,Nd),e(ie,Od),$(Je,ie,null),e(E,Gd),e(E,H),$(kn,H,null),e(H,Id),e(H,ve),e(ve,Dd),e(ve,vs),e(vs,Ud),e(ve,Bd),e(ve,Ao),e(Ao,Wd),e(ve,Vd),e(H,Hd),$(Xe,H,null),e(H,Rd),$(Ye,H,null),e(E,Kd),e(E,R),$($n,R,null),e(R,Jd),e(R,So),e(So,Xd),e(R,Yd),e(R,Lo),e(Lo,Zd),e(R,Qd),$(Ze,R,null),_(t,Oa,g),_(t,ke,g),e(ke,Qe),e(Qe,No),$(wn,No,null),e(ke,ec),e(ke,Oo),e(Oo,tc),_(t,Ga,g),_(t,q,g),$(yn,q,null),e(q,nc),e(q,Go),e(Go,sc),e(q,oc),e(q,Mn),e(Mn,ac),e(Mn,xn),e(xn,rc),e(Mn,lc),e(q,ic),e(q,zn),e(zn,dc),e(zn,ks),e(ks,cc),e(zn,pc),e(q,mc),e(q,jn),e(jn,hc),e(jn,En),e(En,uc),e(jn,fc),e(q,gc),$(et,q,null),e(q,_c),e(q,de),$(qn,de,null),e(de,Tc),e(de,Io),e(Io,bc),e(de,vc),$(tt,de,null),e(q,kc),e(q,K),$(Fn,K,null),e(K,$c),e(K,$e),e($e,wc),e($e,$s),e($s,yc),e($e,Mc),e($e,Do),e(Do,xc),e($e,zc),e(K,jc),$(nt,K,null),e(K,Ec),$(st,K,null),e(q,qc),e(q,J),$(Pn,J,null),e(J,Fc),e(J,Uo),e(Uo,Pc),e(J,Cc),e(J,Bo),e(Bo,Ac),e(J,Sc),$(ot,J,null),_(t,Ia,g),_(t,we,g),e(we,at),e(at,Wo),$(Cn,Wo,null),e(we,Lc),e(we,Vo),e(Vo,Nc),_(t,Da,g),_(t,Z,g),$(An,Z,null),e(Z,Oc),e(Z,Sn),e(Sn,Gc),e(Sn,ws),e(ws,Ic),e(Sn,Dc),e(Z,Uc),$(rt,Z,null),_(t,Ua,g),_(t,ye,g),e(ye,lt),e(lt,Ho),$(Ln,Ho,null),e(ye,Bc),e(ye,Ro),e(Ro,Wc),_(t,Ba,g),_(t,Q,g),$(Nn,Q,null),e(Q,Vc),e(Q,On),e(On,Hc),e(On,ys),e(ys,Rc),e(On,Kc),e(Q,Jc),$(it,Q,null),_(t,Wa,g),_(t,Me,g),e(Me,dt),e(dt,Ko),$(Gn,Ko,null),e(Me,Xc),e(Me,Jo),e(Jo,Yc),_(t,Va,g),_(t,ee,g),$(In,ee,null),e(ee,Zc),e(ee,Dn),e(Dn,Qc),e(Dn,Ms),e(Ms,ep),e(Dn,tp),e(ee,np),$(ct,ee,null),_(t,Ha,g),_(t,xe,g),e(xe,pt),e(pt,Xo),$(Un,Xo,null),e(xe,sp),e(xe,Yo),e(Yo,op),_(t,Ra,g),_(t,te,g),$(Bn,te,null),e(te,ap),e(te,Wn),e(Wn,rp),e(Wn,xs),e(xs,lp),e(Wn,ip),e(te,dp),$(mt,te,null),_(t,Ka,g),_(t,ze,g),e(ze,ht),e(ht,Zo),$(Vn,Zo,null),e(ze,cp),e(ze,Qo),e(Qo,pp),_(t,Ja,g),_(t,ne,g),$(Hn,ne,null),e(ne,mp),e(ne,Rn),e(Rn,hp),e(Rn,zs),e(zs,up),e(Rn,fp),e(ne,gp),$(ut,ne,null),_(t,Xa,g),_(t,je,g),e(je,ft),e(ft,ea),$(Kn,ea,null),e(je,_p),e(je,ta),e(ta,Tp),_(t,Ya,g),_(t,se,g),$(Jn,se,null),e(se,bp),e(se,Xn),e(Xn,vp),e(Xn,js),e(js,kp),e(Xn,$p),e(se,wp),$(gt,se,null),Za=!0},p(t,[g]){const Yn={};g&2&&(Yn.$$scope={dirty:g,ctx:t}),Ue.$set(Yn);const na={};g&2&&(na.$$scope={dirty:g,ctx:t}),Be.$set(na);const sa={};g&2&&(sa.$$scope={dirty:g,ctx:t}),We.$set(sa);const oa={};g&2&&(oa.$$scope={dirty:g,ctx:t}),Ve.$set(oa);const Zn={};g&2&&(Zn.$$scope={dirty:g,ctx:t}),He.$set(Zn);const aa={};g&2&&(aa.$$scope={dirty:g,ctx:t}),Ke.$set(aa);const ra={};g&2&&(ra.$$scope={dirty:g,ctx:t}),Je.$set(ra);const la={};g&2&&(la.$$scope={dirty:g,ctx:t}),Xe.$set(la);const Qn={};g&2&&(Qn.$$scope={dirty:g,ctx:t}),Ye.$set(Qn);const ia={};g&2&&(ia.$$scope={dirty:g,ctx:t}),Ze.$set(ia);const da={};g&2&&(da.$$scope={dirty:g,ctx:t}),et.$set(da);const ca={};g&2&&(ca.$$scope={dirty:g,ctx:t}),tt.$set(ca);const pa={};g&2&&(pa.$$scope={dirty:g,ctx:t}),nt.$set(pa);const es={};g&2&&(es.$$scope={dirty:g,ctx:t}),st.$set(es);const ma={};g&2&&(ma.$$scope={dirty:g,ctx:t}),ot.$set(ma);const ha={};g&2&&(ha.$$scope={dirty:g,ctx:t}),rt.$set(ha);const B={};g&2&&(B.$$scope={dirty:g,ctx:t}),it.$set(B);const ua={};g&2&&(ua.$$scope={dirty:g,ctx:t}),ct.$set(ua);const fa={};g&2&&(fa.$$scope={dirty:g,ctx:t}),mt.$set(fa);const ga={};g&2&&(ga.$$scope={dirty:g,ctx:t}),ut.$set(ga);const _a={};g&2&&(_a.$$scope={dirty:g,ctx:t}),gt.$set(_a)},i(t){Za||(w(s.$$.fragment,t),w(yt.$$.fragment,t),w(At.$$.fragment,t),w(St.$$.fragment,t),w(Nt.$$.fragment,t),w(Ot.$$.fragment,t),w(Ut.$$.fragment,t),w(Wt.$$.fragment,t),w(Vt.$$.fragment,t),w(Ht.$$.fragment,t),w(Kt.$$.fragment,t),w(Jt.$$.fragment,t),w(Zt.$$.fragment,t),w(en.$$.fragment,t),w(tn.$$.fragment,t),w(nn.$$.fragment,t),w(Ue.$$.fragment,t),w(dn.$$.fragment,t),w(Be.$$.fragment,t),w(cn.$$.fragment,t),w(We.$$.fragment,t),w(Ve.$$.fragment,t),w(pn.$$.fragment,t),w(He.$$.fragment,t),w(mn.$$.fragment,t),w(hn.$$.fragment,t),w(Ke.$$.fragment,t),w(vn.$$.fragment,t),w(Je.$$.fragment,t),w(kn.$$.fragment,t),w(Xe.$$.fragment,t),w(Ye.$$.fragment,t),w($n.$$.fragment,t),w(Ze.$$.fragment,t),w(wn.$$.fragment,t),w(yn.$$.fragment,t),w(et.$$.fragment,t),w(qn.$$.fragment,t),w(tt.$$.fragment,t),w(Fn.$$.fragment,t),w(nt.$$.fragment,t),w(st.$$.fragment,t),w(Pn.$$.fragment,t),w(ot.$$.fragment,t),w(Cn.$$.fragment,t),w(An.$$.fragment,t),w(rt.$$.fragment,t),w(Ln.$$.fragment,t),w(Nn.$$.fragment,t),w(it.$$.fragment,t),w(Gn.$$.fragment,t),w(In.$$.fragment,t),w(ct.$$.fragment,t),w(Un.$$.fragment,t),w(Bn.$$.fragment,t),w(mt.$$.fragment,t),w(Vn.$$.fragment,t),w(Hn.$$.fragment,t),w(ut.$$.fragment,t),w(Kn.$$.fragment,t),w(Jn.$$.fragment,t),w(gt.$$.fragment,t),Za=!0)},o(t){y(s.$$.fragment,t),y(yt.$$.fragment,t),y(At.$$.fragment,t),y(St.$$.fragment,t),y(Nt.$$.fragment,t),y(Ot.$$.fragment,t),y(Ut.$$.fragment,t),y(Wt.$$.fragment,t),y(Vt.$$.fragment,t),y(Ht.$$.fragment,t),y(Kt.$$.fragment,t),y(Jt.$$.fragment,t),y(Zt.$$.fragment,t),y(en.$$.fragment,t),y(tn.$$.fragment,t),y(nn.$$.fragment,t),y(Ue.$$.fragment,t),y(dn.$$.fragment,t),y(Be.$$.fragment,t),y(cn.$$.fragment,t),y(We.$$.fragment,t),y(Ve.$$.fragment,t),y(pn.$$.fragment,t),y(He.$$.fragment,t),y(mn.$$.fragment,t),y(hn.$$.fragment,t),y(Ke.$$.fragment,t),y(vn.$$.fragment,t),y(Je.$$.fragment,t),y(kn.$$.fragment,t),y(Xe.$$.fragment,t),y(Ye.$$.fragment,t),y($n.$$.fragment,t),y(Ze.$$.fragment,t),y(wn.$$.fragment,t),y(yn.$$.fragment,t),y(et.$$.fragment,t),y(qn.$$.fragment,t),y(tt.$$.fragment,t),y(Fn.$$.fragment,t),y(nt.$$.fragment,t),y(st.$$.fragment,t),y(Pn.$$.fragment,t),y(ot.$$.fragment,t),y(Cn.$$.fragment,t),y(An.$$.fragment,t),y(rt.$$.fragment,t),y(Ln.$$.fragment,t),y(Nn.$$.fragment,t),y(it.$$.fragment,t),y(Gn.$$.fragment,t),y(In.$$.fragment,t),y(ct.$$.fragment,t),y(Un.$$.fragment,t),y(Bn.$$.fragment,t),y(mt.$$.fragment,t),y(Vn.$$.fragment,t),y(Hn.$$.fragment,t),y(ut.$$.fragment,t),y(Kn.$$.fragment,t),y(Jn.$$.fragment,t),y(gt.$$.fragment,t),Za=!1},d(t){n(c),t&&n(b),t&&n(f),M(s),t&&n(Ta),t&&n(pe),M(yt),t&&n(ba),t&&n(qe),t&&n(va),t&&n(ts),t&&n(ka),t&&n(ns),t&&n($a),t&&n(Fe),t&&n(wa),t&&n(ss),t&&n(ya),t&&n(I),t&&n(Ma),t&&n(oe),t&&n(xa),t&&n(me),M(At),t&&n(za),t&&n(X),M(St),t&&n(ja),t&&n(ue),M(Nt),t&&n(Ea),t&&n(F),M(Ot),M(Ut),M(Wt),M(Vt),M(Ht),t&&n(qa),t&&n(Ne),t&&n(Fa),t&&n(fe),M(Kt),t&&n(Pa),t&&n(O),M(Jt),M(Zt),M(en),t&&n(Ca),t&&n(Ie),t&&n(Aa),t&&n(_e),M(tn),t&&n(Sa),t&&n(j),M(nn),M(Ue),M(dn),M(Be),M(cn),M(We),M(Ve),M(pn),M(He),t&&n(La),t&&n(be),M(mn),t&&n(Na),t&&n(E),M(hn),M(Ke),M(vn),M(Je),M(kn),M(Xe),M(Ye),M($n),M(Ze),t&&n(Oa),t&&n(ke),M(wn),t&&n(Ga),t&&n(q),M(yn),M(et),M(qn),M(tt),M(Fn),M(nt),M(st),M(Pn),M(ot),t&&n(Ia),t&&n(we),M(Cn),t&&n(Da),t&&n(Z),M(An),M(rt),t&&n(Ua),t&&n(ye),M(Ln),t&&n(Ba),t&&n(Q),M(Nn),M(it),t&&n(Wa),t&&n(Me),M(Gn),t&&n(Va),t&&n(ee),M(In),M(ct),t&&n(Ha),t&&n(xe),M(Un),t&&n(Ra),t&&n(te),M(Bn),M(mt),t&&n(Ka),t&&n(ze),M(Vn),t&&n(Ja),t&&n(ne),M(Hn),M(ut),t&&n(Xa),t&&n(je),M(Kn),t&&n(Ya),t&&n(se),M(Jn),M(gt)}}}const Zh={local:"mt5",sections:[{local:"overview",title:"Overview"},{local:"transformers.MT5Config",title:"MT5Config"},{local:"transformers.T5Tokenizer",title:"MT5Tokenizer"},{local:"transformers.T5TokenizerFast",title:"MT5TokenizerFast"},{local:"transformers.MT5Model",title:"MT5Model"},{local:"transformers.MT5ForConditionalGeneration",title:"MT5ForConditionalGeneration"},{local:"transformers.MT5EncoderModel",title:"MT5EncoderModel"},{local:"transformers.TFMT5Model",title:"TFMT5Model"},{local:"transformers.TFMT5ForConditionalGeneration",title:"TFMT5ForConditionalGeneration"},{local:"transformers.TFMT5EncoderModel",title:"TFMT5EncoderModel"},{local:"transformers.FlaxMT5Model",title:"FlaxMT5Model"},{local:"transformers.FlaxMT5ForConditionalGeneration",title:"FlaxMT5ForConditionalGeneration"},{local:"transformers.FlaxMT5EncoderModel",title:"FlaxMT5EncoderModel"}],title:"mT5"};function Qh(x){return Eh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ru extends Mh{constructor(c){super();xh(this,c,Qh,Yh,zh,{})}}export{ru as default,Zh as metadata};
