import{S as FM,i as qM,s as BM,e as a,k as p,w as y,t as i,M as jM,c as s,d as t,m as u,a as r,x as v,h as d,b as m,G as e,g as k,y as T,q as w,o as $,B as x,v as EM,L as P}from"../../chunks/vendor-hf-doc-builder.js";import{T as mt}from"../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../chunks/Docstring-hf-doc-builder.js";import{C as E}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as V}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as A}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function CM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import MBartConfig, MBartModel

# Initializing a MBART facebook/mbart-large-cc25 style configuration
configuration = MBartConfig()

# Initializing a model (with random weights) from the facebook/mbart-large-cc25 style configuration
model = MBartModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MBartConfig, MBartModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a MBART facebook/mbart-large-cc25 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MBartConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/mbart-large-cc25 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){l=a("p"),b=i("Example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function AM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import MBartTokenizer

tokenizer = MBartTokenizer.from_pretrained("facebook/mbart-large-en-ro", src_lang="en_XX", tgt_lang="ro_RO")
example_english_phrase = " UN Chief Says There Is No Military Solution in Syria"
expected_translation_romanian = "\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria"
inputs = tokenizer(example_english_phrase, text_target=expected_translation_romanian, return_tensors="pt")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MBartTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MBartTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-en-ro&quot;</span>, src_lang=<span class="hljs-string">&quot;en_XX&quot;</span>, tgt_lang=<span class="hljs-string">&quot;ro_RO&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example_english_phrase = <span class="hljs-string">&quot; UN Chief Says There Is No Military Solution in Syria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_translation_romanian = <span class="hljs-string">&quot;\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(example_english_phrase, text_target=expected_translation_romanian, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`}}),{c(){l=a("p"),b=i("Examples:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Examples:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function PM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import MBartTokenizerFast

tokenizer = MBartTokenizerFast.from_pretrained(
    "facebook/mbart-large-en-ro", src_lang="en_XX", tgt_lang="ro_RO"
)
example_english_phrase = " UN Chief Says There Is No Military Solution in Syria"
expected_translation_romanian = "\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria"
inputs = tokenizer(example_english_phrase, text_target=expected_translation_romanian, return_tensors="pt")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MBartTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MBartTokenizerFast.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/mbart-large-en-ro&quot;</span>, src_lang=<span class="hljs-string">&quot;en_XX&quot;</span>, tgt_lang=<span class="hljs-string">&quot;ro_RO&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example_english_phrase = <span class="hljs-string">&quot; UN Chief Says There Is No Military Solution in Syria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_translation_romanian = <span class="hljs-string">&quot;\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(example_english_phrase, text_target=expected_translation_romanian, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`}}),{c(){l=a("p"),b=i("Examples:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Examples:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function SM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import MBart50Tokenizer

tokenizer = MBart50Tokenizer.from_pretrained("facebook/mbart-large-50", src_lang="en_XX", tgt_lang="ro_RO")
src_text = " UN Chief Says There Is No Military Solution in Syria"
tgt_text = "\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria"
model_inputs = tokenizer(src_text, text_target=tgt_text, return_tensors="pt")
# model(**model_inputs) should work`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MBart50Tokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MBart50Tokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-50&quot;</span>, src_lang=<span class="hljs-string">&quot;en_XX&quot;</span>, tgt_lang=<span class="hljs-string">&quot;ro_RO&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>src_text = <span class="hljs-string">&quot; UN Chief Says There Is No Military Solution in Syria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tgt_text = <span class="hljs-string">&quot;\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model_inputs = tokenizer(src_text, text_target=tgt_text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model(**model_inputs) should work</span>`}}),{c(){l=a("p"),b=i("Examples:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Examples:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function OM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import MBart50TokenizerFast

tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50", src_lang="en_XX", tgt_lang="ro_RO")
src_text = " UN Chief Says There Is No Military Solution in Syria"
tgt_text = "\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria"
model_inputs = tokenizer(src_text, text_target=tgt_text, return_tensors="pt")
# model(**model_inputs) should work`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MBart50TokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MBart50TokenizerFast.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-50&quot;</span>, src_lang=<span class="hljs-string">&quot;en_XX&quot;</span>, tgt_lang=<span class="hljs-string">&quot;ro_RO&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>src_text = <span class="hljs-string">&quot; UN Chief Says There Is No Military Solution in Syria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tgt_text = <span class="hljs-string">&quot;\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model_inputs = tokenizer(src_text, text_target=tgt_text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model(**model_inputs) should work</span>`}}),{c(){l=a("p"),b=i("Examples:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Examples:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function IM(M){let l,b,f,h,g;return{c(){l=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=i("Module"),g=i(`
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(n){l=s(n,"P",{});var c=r(l);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(c,"CODE",{});var q=r(f);h=d(q,"Module"),q.forEach(t),g=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){k(n,l,c),e(l,b),e(l,f),e(f,h),e(l,g)},d(n){n&&t(l)}}}function NM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, MBartModel
import torch

tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
model = MBartModel.from_pretrained("facebook/mbart-large-cc25")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

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, MBartModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartModel.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, 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>last_hidden_states = outputs.last_hidden_state`}}),{c(){l=a("p"),b=i("Example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function DM(M){let l,b,f,h,g;return{c(){l=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=i("Module"),g=i(`
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(n){l=s(n,"P",{});var c=r(l);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(c,"CODE",{});var q=r(f);h=d(q,"Module"),q.forEach(t),g=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){k(n,l,c),e(l,b),e(l,f),e(f,h),e(l,g)},d(n){n&&t(l)}}}function LM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, MBartForConditionalGeneration

model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-en-ro")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-en-ro")

example_english_phrase = "42 is the answer"
inputs = tokenizer(example_english_phrase, return_tensors="pt")

# Translate
generated_ids = model.generate(inputs["input_ids"], num_beams=4, max_length=5)
tokenizer.batch_decode(generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-en-ro&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-en-ro&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>example_english_phrase = <span class="hljs-string">&quot;42 is the answer&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(example_english_phrase, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Translate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], num_beams=<span class="hljs-number">4</span>, max_length=<span class="hljs-number">5</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;42 este r\u0103spuns&#x27;</span>`}}),{c(){l=a("p"),b=i("Translation example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Translation example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function GM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, MBartForConditionalGeneration

model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

# de_DE is the language symbol id <LID> for German
TXT = "</s> Meine Freunde sind <mask> nett aber sie essen zu viel Kuchen. </s> de_DE"

input_ids = tokenizer([TXT], add_special_tokens=False, return_tensors="pt")["input_ids"]
logits = model(input_ids).logits

masked_index = (input_ids[0] == tokenizer.mask_token_id).nonzero().item()
probs = logits[0, masked_index].softmax(dim=0)
values, predictions = probs.topk(5)

tokenizer.decode(predictions).split()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># de_DE is the language symbol id &lt;LID&gt; for German</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;&lt;/s&gt; Meine Freunde sind &lt;mask&gt; nett aber sie essen zu viel Kuchen. &lt;/s&gt; de_DE&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_ids).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>masked_index = (input_ids[<span class="hljs-number">0</span>] == tokenizer.mask_token_id).nonzero().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits[<span class="hljs-number">0</span>, masked_index].softmax(dim=<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>values, predictions = probs.topk(<span class="hljs-number">5</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predictions).split()
[<span class="hljs-string">&#x27;nett&#x27;</span>, <span class="hljs-string">&#x27;sehr&#x27;</span>, <span class="hljs-string">&#x27;ganz&#x27;</span>, <span class="hljs-string">&#x27;nicht&#x27;</span>, <span class="hljs-string">&#x27;so&#x27;</span>]`}}),{c(){l=a("p"),b=i("Mask filling example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Mask filling example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function WM(M){let l,b,f,h,g;return{c(){l=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=i("Module"),g=i(`
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(n){l=s(n,"P",{});var c=r(l);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(c,"CODE",{});var q=r(f);h=d(q,"Module"),q.forEach(t),g=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){k(n,l,c),e(l,b),e(l,f),e(f,h),e(l,g)},d(n){n&&t(l)}}}function RM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, MBartForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
model = MBartForQuestionAnswering.from_pretrained("facebook/mbart-large-cc25")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
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> AutoTokenizer, MBartForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){l=a("p"),b=i("Example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function UM(M){let l,b,f,h,g;return{c(){l=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=i("Module"),g=i(`
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(n){l=s(n,"P",{});var c=r(l);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(c,"CODE",{});var q=r(f);h=d(q,"Module"),q.forEach(t),g=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){k(n,l,c),e(l,b),e(l,f),e(f,h),e(l,g)},d(n){n&&t(l)}}}function XM(M){let l,b,f,h,g;return h=new E({props:{code:`import torch
from transformers import AutoTokenizer, MBartForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
model = MBartForSequenceClassification.from_pretrained("facebook/mbart-large-cc25")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = MBartForSequenceClassification.from_pretrained("facebook/mbart-large-cc25", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MBartForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){l=a("p"),b=i("Example of single-label classification:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example of single-label classification:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function QM(M){let l,b,f,h,g;return h=new E({props:{code:`import torch
from transformers import AutoTokenizer, MBartForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
model = MBartForSequenceClassification.from_pretrained("facebook/mbart-large-cc25", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = MBartForSequenceClassification.from_pretrained(
    "facebook/mbart-large-cc25", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MBartForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){l=a("p"),b=i("Example of multi-label classification:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example of multi-label classification:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function HM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, MBartForCausalLM

tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
model = MBartForCausalLM.from_pretrained("facebook/mbart-large-cc25", add_cross_attention=False)
assert model.config.is_decoder, f"{model.__class__} has to be configured as a decoder."
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

logits = outputs.logits
expected_shape = [1, inputs.input_ids.shape[-1], model.config.vocab_size]
list(logits.shape) == expected_shape`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MBartForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>, add_cross_attention=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> model.config.is_decoder, <span class="hljs-string">f&quot;<span class="hljs-subst">{model.__class__}</span> has to be configured as a decoder.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, 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>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_shape = [<span class="hljs-number">1</span>, inputs.input_ids.shape[-<span class="hljs-number">1</span>], model.config.vocab_size]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape) == expected_shape
<span class="hljs-literal">True</span>`}}),{c(){l=a("p"),b=i("Example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function VM(M){let l,b,f,h,g,n,c,q,ft,Ye,U,De,Le,B,be,ye,_t,et,X,pe,Ge,K,gt,We,ve,tt,ue,Te,we,kt,Re,S,I,bt,he,re,yt,J,vt,Tt,O,wt,me,ie,fe,de,$e,$t,Z,xt,_e,R,Ue,N,Mt,Y,Xe,zt;return{c(){l=a("p"),b=i("TensorFlow models and layers in "),f=a("code"),h=i("transformers"),g=i(" accept two formats as input:"),n=p(),c=a("ul"),q=a("li"),ft=i("having all inputs as keyword arguments (like PyTorch models), or"),Ye=p(),U=a("li"),De=i("having all inputs as a list, tuple or dict in the first positional argument."),Le=p(),B=a("p"),be=i(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),ye=a("code"),_t=i("model.fit()"),et=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),X=a("code"),pe=i("model.fit()"),Ge=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),K=a("code"),gt=i("fit()"),We=i(" and "),ve=a("code"),tt=i("predict()"),ue=i(`, such as when creating your own layers or models with
the Keras `),Te=a("code"),we=i("Functional"),kt=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Re=p(),S=a("ul"),I=a("li"),bt=i("a single Tensor with "),he=a("code"),re=i("input_ids"),yt=i(" only and nothing else: "),J=a("code"),vt=i("model(input_ids)"),Tt=p(),O=a("li"),wt=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),me=a("code"),ie=i("model([input_ids, attention_mask])"),fe=i(" or "),de=a("code"),$e=i("model([input_ids, attention_mask, token_type_ids])"),$t=p(),Z=a("li"),xt=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),_e=a("code"),R=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ue=p(),N=a("p"),Mt=i(`Note that when creating models and layers with
`),Y=a("a"),Xe=i("subclassing"),zt=i(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(z){l=s(z,"P",{});var j=r(l);b=d(j,"TensorFlow models and layers in "),f=s(j,"CODE",{});var Jt=r(f);h=d(Jt,"transformers"),Jt.forEach(t),g=d(j," accept two formats as input:"),j.forEach(t),n=u(z),c=s(z,"UL",{});var Qe=r(c);q=s(Qe,"LI",{});var Ft=r(q);ft=d(Ft,"having all inputs as keyword arguments (like PyTorch models), or"),Ft.forEach(t),Ye=u(Qe),U=s(Qe,"LI",{});var Zt=r(U);De=d(Zt,"having all inputs as a list, tuple or dict in the first positional argument."),Zt.forEach(t),Qe.forEach(t),Le=u(z),B=s(z,"P",{});var C=r(B);be=d(C,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),ye=s(C,"CODE",{});var Nt=r(ye);_t=d(Nt,"model.fit()"),Nt.forEach(t),et=d(C,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),X=s(C,"CODE",{});var te=r(X);pe=d(te,"model.fit()"),te.forEach(t),Ge=d(C,` supports! If, however, you want to use the second
format outside of Keras methods like `),K=s(C,"CODE",{});var Yt=r(K);gt=d(Yt,"fit()"),Yt.forEach(t),We=d(C," and "),ve=s(C,"CODE",{});var He=r(ve);tt=d(He,"predict()"),He.forEach(t),ue=d(C,`, such as when creating your own layers or models with
the Keras `),Te=s(C,"CODE",{});var qt=r(Te);we=d(qt,"Functional"),qt.forEach(t),kt=d(C,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),C.forEach(t),Re=u(z),S=s(z,"UL",{});var le=r(S);I=s(le,"LI",{});var xe=r(I);bt=d(xe,"a single Tensor with "),he=s(xe,"CODE",{});var eo=r(he);re=d(eo,"input_ids"),eo.forEach(t),yt=d(xe," only and nothing else: "),J=s(xe,"CODE",{});var Bt=r(J);vt=d(Bt,"model(input_ids)"),Bt.forEach(t),xe.forEach(t),Tt=u(le),O=s(le,"LI",{});var Me=r(O);wt=d(Me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),me=s(Me,"CODE",{});var to=r(me);ie=d(to,"model([input_ids, attention_mask])"),to.forEach(t),fe=d(Me," or "),de=s(Me,"CODE",{});var jt=r(de);$e=d(jt,"model([input_ids, attention_mask, token_type_ids])"),jt.forEach(t),Me.forEach(t),$t=u(le),Z=s(le,"LI",{});var Et=r(Z);xt=d(Et,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),_e=s(Et,"CODE",{});var oo=r(_e);R=d(oo,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oo.forEach(t),Et.forEach(t),le.forEach(t),Ue=u(z),N=s(z,"P",{});var Ee=r(N);Mt=d(Ee,`Note that when creating models and layers with
`),Y=s(Ee,"A",{href:!0,rel:!0});var ot=r(Y);Xe=d(ot,"subclassing"),ot.forEach(t),zt=d(Ee,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Ee.forEach(t),this.h()},h(){m(Y,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(Y,"rel","nofollow")},m(z,j){k(z,l,j),e(l,b),e(l,f),e(f,h),e(l,g),k(z,n,j),k(z,c,j),e(c,q),e(q,ft),e(c,Ye),e(c,U),e(U,De),k(z,Le,j),k(z,B,j),e(B,be),e(B,ye),e(ye,_t),e(B,et),e(B,X),e(X,pe),e(B,Ge),e(B,K),e(K,gt),e(B,We),e(B,ve),e(ve,tt),e(B,ue),e(B,Te),e(Te,we),e(B,kt),k(z,Re,j),k(z,S,j),e(S,I),e(I,bt),e(I,he),e(he,re),e(I,yt),e(I,J),e(J,vt),e(S,Tt),e(S,O),e(O,wt),e(O,me),e(me,ie),e(O,fe),e(O,de),e(de,$e),e(S,$t),e(S,Z),e(Z,xt),e(Z,_e),e(_e,R),k(z,Ue,j),k(z,N,j),e(N,Mt),e(N,Y),e(Y,Xe),e(N,zt)},d(z){z&&t(l),z&&t(n),z&&t(c),z&&t(Le),z&&t(B),z&&t(Re),z&&t(S),z&&t(Ue),z&&t(N)}}}function KM(M){let l,b,f,h,g;return{c(){l=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=i("Module"),g=i(`
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(n){l=s(n,"P",{});var c=r(l);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(c,"CODE",{});var q=r(f);h=d(q,"Module"),q.forEach(t),g=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){k(n,l,c),e(l,b),e(l,f),e(f,h),e(l,g)},d(n){n&&t(l)}}}function JM(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, TFMBartModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
model = TFMBartModel.from_pretrained("facebook/mbart-large-cc25")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)

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, TFMBartModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMBartModel.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, 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>last_hidden_states = outputs.last_hidden_state`}}),{c(){l=a("p"),b=i("Example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function ZM(M){let l,b,f,h,g,n,c,q,ft,Ye,U,De,Le,B,be,ye,_t,et,X,pe,Ge,K,gt,We,ve,tt,ue,Te,we,kt,Re,S,I,bt,he,re,yt,J,vt,Tt,O,wt,me,ie,fe,de,$e,$t,Z,xt,_e,R,Ue,N,Mt,Y,Xe,zt;return{c(){l=a("p"),b=i("TensorFlow models and layers in "),f=a("code"),h=i("transformers"),g=i(" accept two formats as input:"),n=p(),c=a("ul"),q=a("li"),ft=i("having all inputs as keyword arguments (like PyTorch models), or"),Ye=p(),U=a("li"),De=i("having all inputs as a list, tuple or dict in the first positional argument."),Le=p(),B=a("p"),be=i(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),ye=a("code"),_t=i("model.fit()"),et=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),X=a("code"),pe=i("model.fit()"),Ge=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),K=a("code"),gt=i("fit()"),We=i(" and "),ve=a("code"),tt=i("predict()"),ue=i(`, such as when creating your own layers or models with
the Keras `),Te=a("code"),we=i("Functional"),kt=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Re=p(),S=a("ul"),I=a("li"),bt=i("a single Tensor with "),he=a("code"),re=i("input_ids"),yt=i(" only and nothing else: "),J=a("code"),vt=i("model(input_ids)"),Tt=p(),O=a("li"),wt=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),me=a("code"),ie=i("model([input_ids, attention_mask])"),fe=i(" or "),de=a("code"),$e=i("model([input_ids, attention_mask, token_type_ids])"),$t=p(),Z=a("li"),xt=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),_e=a("code"),R=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ue=p(),N=a("p"),Mt=i(`Note that when creating models and layers with
`),Y=a("a"),Xe=i("subclassing"),zt=i(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(z){l=s(z,"P",{});var j=r(l);b=d(j,"TensorFlow models and layers in "),f=s(j,"CODE",{});var Jt=r(f);h=d(Jt,"transformers"),Jt.forEach(t),g=d(j," accept two formats as input:"),j.forEach(t),n=u(z),c=s(z,"UL",{});var Qe=r(c);q=s(Qe,"LI",{});var Ft=r(q);ft=d(Ft,"having all inputs as keyword arguments (like PyTorch models), or"),Ft.forEach(t),Ye=u(Qe),U=s(Qe,"LI",{});var Zt=r(U);De=d(Zt,"having all inputs as a list, tuple or dict in the first positional argument."),Zt.forEach(t),Qe.forEach(t),Le=u(z),B=s(z,"P",{});var C=r(B);be=d(C,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),ye=s(C,"CODE",{});var Nt=r(ye);_t=d(Nt,"model.fit()"),Nt.forEach(t),et=d(C,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),X=s(C,"CODE",{});var te=r(X);pe=d(te,"model.fit()"),te.forEach(t),Ge=d(C,` supports! If, however, you want to use the second
format outside of Keras methods like `),K=s(C,"CODE",{});var Yt=r(K);gt=d(Yt,"fit()"),Yt.forEach(t),We=d(C," and "),ve=s(C,"CODE",{});var He=r(ve);tt=d(He,"predict()"),He.forEach(t),ue=d(C,`, such as when creating your own layers or models with
the Keras `),Te=s(C,"CODE",{});var qt=r(Te);we=d(qt,"Functional"),qt.forEach(t),kt=d(C,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),C.forEach(t),Re=u(z),S=s(z,"UL",{});var le=r(S);I=s(le,"LI",{});var xe=r(I);bt=d(xe,"a single Tensor with "),he=s(xe,"CODE",{});var eo=r(he);re=d(eo,"input_ids"),eo.forEach(t),yt=d(xe," only and nothing else: "),J=s(xe,"CODE",{});var Bt=r(J);vt=d(Bt,"model(input_ids)"),Bt.forEach(t),xe.forEach(t),Tt=u(le),O=s(le,"LI",{});var Me=r(O);wt=d(Me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),me=s(Me,"CODE",{});var to=r(me);ie=d(to,"model([input_ids, attention_mask])"),to.forEach(t),fe=d(Me," or "),de=s(Me,"CODE",{});var jt=r(de);$e=d(jt,"model([input_ids, attention_mask, token_type_ids])"),jt.forEach(t),Me.forEach(t),$t=u(le),Z=s(le,"LI",{});var Et=r(Z);xt=d(Et,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),_e=s(Et,"CODE",{});var oo=r(_e);R=d(oo,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oo.forEach(t),Et.forEach(t),le.forEach(t),Ue=u(z),N=s(z,"P",{});var Ee=r(N);Mt=d(Ee,`Note that when creating models and layers with
`),Y=s(Ee,"A",{href:!0,rel:!0});var ot=r(Y);Xe=d(ot,"subclassing"),ot.forEach(t),zt=d(Ee,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Ee.forEach(t),this.h()},h(){m(Y,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(Y,"rel","nofollow")},m(z,j){k(z,l,j),e(l,b),e(l,f),e(f,h),e(l,g),k(z,n,j),k(z,c,j),e(c,q),e(q,ft),e(c,Ye),e(c,U),e(U,De),k(z,Le,j),k(z,B,j),e(B,be),e(B,ye),e(ye,_t),e(B,et),e(B,X),e(X,pe),e(B,Ge),e(B,K),e(K,gt),e(B,We),e(B,ve),e(ve,tt),e(B,ue),e(B,Te),e(Te,we),e(B,kt),k(z,Re,j),k(z,S,j),e(S,I),e(I,bt),e(I,he),e(he,re),e(I,yt),e(I,J),e(J,vt),e(S,Tt),e(S,O),e(O,wt),e(O,me),e(me,ie),e(O,fe),e(O,de),e(de,$e),e(S,$t),e(S,Z),e(Z,xt),e(Z,_e),e(_e,R),k(z,Ue,j),k(z,N,j),e(N,Mt),e(N,Y),e(Y,Xe),e(N,zt)},d(z){z&&t(l),z&&t(n),z&&t(c),z&&t(Le),z&&t(B),z&&t(Re),z&&t(S),z&&t(Ue),z&&t(N)}}}function YM(M){let l,b,f,h,g;return{c(){l=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=i("Module"),g=i(`
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(n){l=s(n,"P",{});var c=r(l);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(c,"CODE",{});var q=r(f);h=d(q,"Module"),q.forEach(t),g=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){k(n,l,c),e(l,b),e(l,f),e(f,h),e(l,g)},d(n){n&&t(l)}}}function e1(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, TFMBartForConditionalGeneration, MBartConfig

model = TFMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

ARTICLE_TO_SUMMARIZE = "Meine Freunde sind cool, aber sie essen zu viel Kuchen."
inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors="tf")

# Generate Summary
summary_ids = model.generate(inputs["input_ids"], num_beams=4, max_length=5)
print(tokenizer.batch_decode(summary_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFMBartForConditionalGeneration, MBartConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = <span class="hljs-string">&quot;Meine Freunde sind cool, aber sie essen zu viel Kuchen.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=<span class="hljs-number">1024</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate Summary</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], num_beams=<span class="hljs-number">4</span>, max_length=<span class="hljs-number">5</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>))`}}),{c(){l=a("p"),b=i("Summarization example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Summarization example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function t1(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, TFMBartForConditionalGeneration

model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

# de_DE is the language symbol id <LID> for German
TXT = "</s> Meine Freunde sind <mask> nett aber sie essen zu viel Kuchen. </s> de_DE"
input_ids = tokenizer([TXT], add_special_tokens=False, return_tensors="tf")["input_ids"]

logits = model(input_ids).logits
probs = tf.nn.softmax(logits[0])
# probs[5] is associated with the mask token`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># de_DE is the language symbol id &lt;LID&gt; for German</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;&lt;/s&gt; Meine Freunde sind &lt;mask&gt; nett aber sie essen zu viel Kuchen. &lt;/s&gt; de_DE&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_ids).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = tf.nn.softmax(logits[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># probs[5] is associated with the mask token</span>`}}),{c(){l=a("p"),b=i("Mask filling example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Mask filling example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function o1(M){let l,b,f,h,g;return{c(){l=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=i("Module"),g=i(`
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(n){l=s(n,"P",{});var c=r(l);b=d(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(c,"CODE",{});var q=r(f);h=d(q,"Module"),q.forEach(t),g=d(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){k(n,l,c),e(l,b),e(l,f),e(f,h),e(l,g)},d(n){n&&t(l)}}}function n1(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, FlaxMBartModel

tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
model = FlaxMBartModel.from_pretrained("facebook/mbart-large-cc25")

inputs = tokenizer("Hello, my dog is cute", return_tensors="jax")
outputs = model(**inputs)

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, FlaxMBartModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartModel.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){l=a("p"),b=i("Example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function a1(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, FlaxMBartForConditionalGeneration

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, max_length=1024, return_tensors="jax")
encoder_outputs = model.encode(**inputs)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

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

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

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

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

outputs = model.decode(decoder_input_ids, encoder_outputs)
last_decoder_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, FlaxMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

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

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

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

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

ARTICLE_TO_SUMMARIZE = "Meine Freunde sind cool, aber sie essen zu viel Kuchen."
inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors="np")

# Generate Summary
summary_ids = model.generate(inputs["input_ids"], num_beams=4, max_length=5).sequences
print(tokenizer.batch_decode(summary_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxMBartForConditionalGeneration, MBartConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = <span class="hljs-string">&quot;Meine Freunde sind cool, aber sie essen zu viel Kuchen.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=<span class="hljs-number">1024</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate Summary</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], num_beams=<span class="hljs-number">4</span>, max_length=<span class="hljs-number">5</span>).sequences
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>))`}}),{c(){l=a("p"),b=i("Summarization example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Summarization example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function d1(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, FlaxMBartForConditionalGeneration

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

# de_DE is the language symbol id <LID> for German
TXT = "</s> Meine Freunde sind <mask> nett aber sie essen zu viel Kuchen. </s> de_DE"
input_ids = tokenizer([TXT], add_special_tokens=False, return_tensors="np")["input_ids"]

logits = model(input_ids).logits
masked_index = (input_ids[0] == tokenizer.mask_token_id).nonzero()[0].item()
probs = logits[0, masked_index].softmax(dim=0)
values, predictions = probs.topk(5)

tokenizer.decode(predictions).split()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># de_DE is the language symbol id &lt;LID&gt; for German</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;&lt;/s&gt; Meine Freunde sind &lt;mask&gt; nett aber sie essen zu viel Kuchen. &lt;/s&gt; de_DE&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_ids).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>masked_index = (input_ids[<span class="hljs-number">0</span>] == tokenizer.mask_token_id).nonzero()[<span class="hljs-number">0</span>].item()
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits[<span class="hljs-number">0</span>, masked_index].softmax(dim=<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>values, predictions = probs.topk(<span class="hljs-number">5</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predictions).split()`}}),{c(){l=a("p"),b=i("Mask filling example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Mask filling example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function l1(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, FlaxMBartForConditionalGeneration

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, max_length=1024, return_tensors="jax")
encoder_outputs = model.encode(**inputs)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

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

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

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

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

outputs = model.decode(decoder_input_ids, encoder_outputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

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

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

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

tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
model = FlaxMBartForSequenceClassification.from_pretrained("facebook/mbart-large-cc25")

inputs = tokenizer("Hello, my dog is cute", return_tensors="jax")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)

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

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, max_length=1024, return_tensors="jax")
encoder_outputs = model.encode(**inputs)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

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

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

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

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

outputs = model.decode(decoder_input_ids, encoder_outputs)
last_decoder_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, FlaxMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

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

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

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

tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
model = FlaxMBartForQuestionAnswering.from_pretrained("facebook/mbart-large-cc25")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="jax")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits`}}),{c(){l=a("p"),b=i("Example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function g1(M){let l,b,f,h,g;return h=new E({props:{code:`from transformers import AutoTokenizer, FlaxMBartForConditionalGeneration

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

text = "My friends are cool but they eat too many carbs."
inputs = tokenizer(text, max_length=1024, return_tensors="jax")
encoder_outputs = model.encode(**inputs)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

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

model = FlaxMBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

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

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

outputs = model.decode(decoder_input_ids, encoder_outputs)
last_decoder_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, FlaxMBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-cc25&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.decode(decoder_input_ids, encoder_outputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_decoder_hidden_states = outputs.last_hidden_state`}}),{c(){l=a("p"),b=i("Example:"),f=p(),y(h.$$.fragment)},l(n){l=s(n,"P",{});var c=r(l);b=d(c,"Example:"),c.forEach(t),f=u(n),v(h.$$.fragment,n)},m(n,c){k(n,l,c),e(l,b),k(n,f,c),T(h,n,c),g=!0},p:P,i(n){g||(w(h.$$.fragment,n),g=!0)},o(n){$(h.$$.fragment,n),g=!1},d(n){n&&t(l),n&&t(f),x(h,n)}}}function b1(M){let l,b,f,h,g,n,c,q,ft,Ye,U,De,Le,B,be,ye,_t,et,X,pe,Ge,K,gt,We,ve,tt,ue,Te,we,kt,Re,S,I,bt,he,re,yt,J,vt,Tt,O,wt,me,ie,fe,de,$e,$t,Z,xt,_e,R,Ue,N,Mt,Y,Xe,zt,z,j,Jt,Qe,Ft,Zt,C,Nt,te,Yt,He,qt,le,xe,eo,Bt,Me,to,jt,Et,oo,Ee,ot,gd,Ph,gp,Ea,kp,vi,Ca,kd,Sh,Oh,no,Ih,bd,Nh,Dh,yd,Lh,Gh,bp,Aa,yp,ao,Wo,vd,Pa,Wh,Td,Rh,vp,Dt,Uh,Sa,Xh,Qh,wd,Hh,Vh,Tp,Ti,Kh,wp,wi,$d,Jh,$p,so,Ro,xd,Oa,Zh,Md,Yh,xp,nt,em,zd,tm,om,Fd,nm,am,qd,sm,rm,Mp,Uo,im,$i,dm,lm,zp,xi,Bd,cm,Fp,Ia,qp,Mi,Na,jd,pm,um,ze,hm,Ed,mm,fm,Cd,_m,gm,Ad,km,bm,Pd,ym,vm,Sd,Tm,wm,Bp,Da,jp,ro,Xo,Od,La,$m,Id,xm,Ep,Ve,Ga,Mm,io,zm,zi,Fm,qm,Wa,Bm,jm,Em,lo,Cm,Fi,Am,Pm,qi,Sm,Om,Im,Qo,Cp,co,Ho,Nd,Ra,Nm,Dd,Dm,Ap,ce,Ua,Lm,Ld,Gm,Wm,Ct,Rm,Bi,Um,Xm,ji,Qm,Hm,Xa,Vm,Km,Jm,po,Zm,Gd,Ym,ef,Wd,tf,of,nf,Vo,af,at,Qa,sf,Ha,rf,Rd,df,lf,cf,Va,Ka,Ud,pf,uf,Xd,hf,mf,Ja,Qd,ff,_f,Hd,gf,kf,Vd,bf,Pp,uo,Ko,Kd,Za,yf,Jd,vf,Sp,D,Ya,Tf,ho,wf,Zd,$f,xf,es,Mf,zf,Ff,ts,qf,Ei,Bf,jf,Ef,mo,Cf,Yd,Af,Pf,el,Sf,Of,If,Jo,Nf,Ce,os,Df,tl,Lf,Gf,ns,Wf,ol,Rf,Uf,Xf,as,ss,nl,Qf,Hf,al,Vf,Kf,rs,sl,Jf,Zf,rl,Yf,e_,il,t_,o_,Zo,is,n_,dl,a_,s_,Yo,ds,r_,ll,i_,d_,en,ls,l_,cl,c_,Op,fo,tn,pl,cs,p_,ul,u_,Ip,L,ps,h_,us,m_,hs,f_,__,g_,ms,k_,Ci,b_,y_,v_,on,T_,st,fs,w_,_s,$_,hl,x_,M_,z_,gs,ks,ml,F_,q_,fl,B_,j_,bs,_l,E_,C_,gl,A_,P_,kl,S_,O_,nn,ys,I_,bl,N_,D_,an,vs,L_,Ts,G_,yl,W_,R_,U_,sn,ws,X_,vl,Q_,H_,rn,$s,V_,Tl,K_,Np,_o,dn,wl,xs,J_,$l,Z_,Dp,ee,Ms,Y_,go,eg,xl,tg,og,zs,ng,ag,sg,Fs,rg,Ai,ig,dg,lg,ln,cg,Ae,qs,pg,Ml,ug,hg,Bs,mg,zl,fg,_g,gg,js,Es,Fl,kg,bg,ql,yg,vg,Cs,Bl,Tg,wg,jl,$g,xg,El,Mg,zg,cn,As,Fg,Cl,qg,Bg,pn,Ps,jg,Al,Eg,Lp,ko,un,Pl,Ss,Cg,Sl,Ag,Gp,Ke,Os,Pg,Is,Sg,Pi,Og,Ig,Ng,Ns,Dg,Ds,Lg,Gg,Wg,rt,Ls,Rg,bo,Ug,Si,Xg,Qg,Ol,Hg,Vg,Kg,hn,Jg,mn,Wp,yo,fn,Il,Gs,Zg,Nl,Yg,Rp,Je,Ws,ek,Rs,tk,Oi,ok,nk,ak,Us,sk,Xs,rk,ik,dk,Pe,Qs,lk,vo,ck,Ii,pk,uk,Dl,hk,mk,fk,_n,_k,gn,gk,kn,Up,To,bn,Ll,Hs,kk,Gl,bk,Xp,Fe,Vs,yk,wo,vk,Wl,Tk,wk,Rl,$k,xk,Mk,Ks,zk,Ni,Fk,qk,Bk,Js,jk,Zs,Ek,Ck,Ak,it,Ys,Pk,$o,Sk,Di,Ok,Ik,Ul,Nk,Dk,Lk,yn,Gk,vn,Qp,xo,Tn,Xl,er,Wk,Ql,Rk,Hp,qe,tr,Uk,Hl,Xk,Qk,or,Hk,Li,Vk,Kk,Jk,nr,Zk,ar,Yk,eb,tb,Se,sr,ob,Mo,nb,Gi,ab,sb,Vl,rb,ib,db,wn,lb,$n,cb,xn,Vp,zo,Mn,Kl,rr,pb,Jl,ub,Kp,Fo,ir,hb,zn,dr,mb,Fn,Jp,qo,qn,Zl,lr,fb,Yl,_b,Zp,Be,cr,gb,pr,kb,Wi,bb,yb,vb,ur,Tb,hr,wb,$b,xb,Bn,Mb,dt,mr,zb,Bo,Fb,Ri,qb,Bb,ec,jb,Eb,Cb,jn,Ab,En,Yp,jo,Cn,tc,fr,Pb,oc,Sb,eu,je,_r,Ob,gr,Ib,Ui,Nb,Db,Lb,kr,Gb,br,Wb,Rb,Ub,An,Xb,Oe,yr,Qb,Eo,Hb,Xi,Vb,Kb,nc,Jb,Zb,Yb,Pn,ey,Sn,ty,On,tu,Co,In,ac,vr,oy,sc,ny,ou,Q,Tr,ay,wr,sy,Qi,ry,iy,dy,$r,ly,xr,cy,py,uy,rc,hy,my,At,ic,Mr,fy,_y,dc,zr,gy,ky,lc,Fr,by,yy,cc,qr,vy,Ty,lt,Br,wy,Ao,$y,pc,xy,My,uc,zy,Fy,qy,Nn,By,Dn,jy,Ln,jr,Ey,Gn,Cy,Wn,Er,Ay,Rn,nu,Po,Un,hc,Cr,Py,mc,Sy,au,H,Ar,Oy,Pr,Iy,Hi,Ny,Dy,Ly,Sr,Gy,Or,Wy,Ry,Uy,fc,Xy,Qy,Pt,_c,Ir,Hy,Vy,gc,Nr,Ky,Jy,kc,Dr,Zy,Yy,bc,Lr,ev,tv,Ie,Gr,ov,So,nv,yc,av,sv,vc,rv,iv,dv,Xn,lv,Qn,cv,Hn,pv,Vn,Wr,uv,Kn,hv,Jn,Rr,mv,Zn,su,Oo,Yn,Tc,Ur,fv,wc,_v,ru,G,Xr,gv,$c,kv,bv,Qr,yv,Vi,vv,Tv,wv,Hr,$v,Vr,xv,Mv,zv,xc,Fv,qv,St,Mc,Kr,Bv,jv,zc,Jr,Ev,Cv,Fc,Zr,Av,Pv,qc,Yr,Sv,Ov,ct,ei,Iv,Io,Nv,Bc,Dv,Lv,jc,Gv,Wv,Rv,ea,Uv,ta,Xv,oa,ti,Qv,na,Hv,aa,oi,Vv,sa,iu,No,ra,Ec,ni,Kv,Cc,Jv,du,W,ai,Zv,Do,Yv,Ac,eT,tT,Pc,oT,nT,aT,si,sT,Ki,rT,iT,dT,ri,lT,ii,cT,pT,uT,Sc,hT,mT,Ot,Oc,di,fT,_T,Ic,li,gT,kT,Nc,ci,bT,yT,Dc,pi,vT,TT,pt,ui,wT,Lo,$T,Lc,xT,MT,Gc,zT,FT,qT,ia,BT,da,jT,la,hi,ET,ca,CT,pa,mi,AT,ua,lu;return n=new V({}),K=new V({}),$e=new V({}),Ea=new E({props:{code:`from transformers import MBartForConditionalGeneration, MBartTokenizer

tokenizer = MBartTokenizer.from_pretrained("facebook/mbart-large-en-ro", src_lang="en_XX", tgt_lang="ro_RO")
example_english_phrase = "UN Chief Says There Is No Military Solution in Syria"
expected_translation_romanian = "\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria"

inputs = tokenizer(example_english_phrase, text_target=expected_translation_romanian, return_tensors="pt")

model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-en-ro")
# forward pass
model(**inputs)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MBartForConditionalGeneration, MBartTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MBartTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-en-ro&quot;</span>, src_lang=<span class="hljs-string">&quot;en_XX&quot;</span>, tgt_lang=<span class="hljs-string">&quot;ro_RO&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example_english_phrase = <span class="hljs-string">&quot;UN Chief Says There Is No Military Solution in Syria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_translation_romanian = <span class="hljs-string">&quot;\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(example_english_phrase, text_target=expected_translation_romanian, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-en-ro&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model(**inputs)`}}),Aa=new E({props:{code:`from transformers import MBartForConditionalGeneration, MBartTokenizer

tokenizer = MBartTokenizer.from_pretrained("facebook/mbart-large-en-ro", src_lang="en_XX")
article = "UN Chief Says There Is No Military Solution in Syria"
inputs = tokenizer(article, return_tensors="pt")
translated_tokens = model.generate(**inputs, decoder_start_token_id=tokenizer.lang_code_to_id["ro_RO"])
tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MBartForConditionalGeneration, MBartTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MBartTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-en-ro&quot;</span>, src_lang=<span class="hljs-string">&quot;en_XX&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Chief Says There Is No Military Solution in Syria&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>translated_tokens = model.generate(**inputs, decoder_start_token_id=tokenizer.lang_code_to_id[<span class="hljs-string">&quot;ro_RO&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(translated_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria&quot;</span>`}}),Pa=new V({}),Oa=new V({}),Ia=new E({props:{code:`from transformers import MBartForConditionalGeneration, MBart50TokenizerFast

model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50")
tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50", src_lang="en_XX", tgt_lang="ro_RO")

src_text = " UN Chief Says There Is No Military Solution in Syria"
tgt_text = "\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria"

model_inputs = tokenizer(src_text, text_target=tgt_text, return_tensors="pt")

model(**model_inputs)  # forward pass`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MBartForConditionalGeneration, MBart50TokenizerFast

model = MBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-50&quot;</span>)
tokenizer = MBart50TokenizerFast.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-50&quot;</span>, src_lang=<span class="hljs-string">&quot;en_XX&quot;</span>, tgt_lang=<span class="hljs-string">&quot;ro_RO&quot;</span>)

src_text = <span class="hljs-string">&quot; UN Chief Says There Is No Military Solution in Syria&quot;</span>
tgt_text = <span class="hljs-string">&quot;\u015Eeful ONU declar\u0103 c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn Siria&quot;</span>

model_inputs = tokenizer(src_text, text_target=tgt_text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

model(**model_inputs)  <span class="hljs-comment"># forward pass</span>`}}),Da=new E({props:{code:`from transformers import MBartForConditionalGeneration, MBart50TokenizerFast

article_hi = "\u0938\u0902\u092F\u0941\u0915\u094D\u0924 \u0930\u093E\u0937\u094D\u091F\u094D\u0930 \u0915\u0947 \u092A\u094D\u0930\u092E\u0941\u0916 \u0915\u093E \u0915\u0939\u0928\u093E \u0939\u0948 \u0915\u093F \u0938\u0940\u0930\u093F\u092F\u093E \u092E\u0947\u0902 \u0915\u094B\u0908 \u0938\u0948\u0928\u094D\u092F \u0938\u092E\u093E\u0927\u093E\u0928 \u0928\u0939\u0940\u0902 \u0939\u0948"
article_ar = "\u0627\u0644\u0623\u0645\u064A\u0646 \u0627\u0644\u0639\u0627\u0645 \u0644\u0644\u0623\u0645\u0645 \u0627\u0644\u0645\u062A\u062D\u062F\u0629 \u064A\u0642\u0648\u0644 \u0625\u0646\u0647 \u0644\u0627 \u064A\u0648\u062C\u062F \u062D\u0644 \u0639\u0633\u0643\u0631\u064A \u0641\u064A \u0633\u0648\u0631\u064A\u0627."

model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50-many-to-many-mmt")
tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50-many-to-many-mmt")

# translate Hindi to French
tokenizer.src_lang = "hi_IN"
encoded_hi = tokenizer(article_hi, return_tensors="pt")
generated_tokens = model.generate(**encoded_hi, forced_bos_token_id=tokenizer.lang_code_to_id["fr_XX"])
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
# => "Le chef de l 'ONU affirme qu 'il n 'y a pas de solution militaire en Syria."

# translate Arabic to English
tokenizer.src_lang = "ar_AR"
encoded_ar = tokenizer(article_ar, return_tensors="pt")
generated_tokens = model.generate(**encoded_ar, forced_bos_token_id=tokenizer.lang_code_to_id["en_XX"])
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
# => "The Secretary-General of the United Nations says there is no military solution in Syria."`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MBartForConditionalGeneration, MBart50TokenizerFast

article_hi = <span class="hljs-string">&quot;\u0938\u0902\u092F\u0941\u0915\u094D\u0924 \u0930\u093E\u0937\u094D\u091F\u094D\u0930 \u0915\u0947 \u092A\u094D\u0930\u092E\u0941\u0916 \u0915\u093E \u0915\u0939\u0928\u093E \u0939\u0948 \u0915\u093F \u0938\u0940\u0930\u093F\u092F\u093E \u092E\u0947\u0902 \u0915\u094B\u0908 \u0938\u0948\u0928\u094D\u092F \u0938\u092E\u093E\u0927\u093E\u0928 \u0928\u0939\u0940\u0902 \u0939\u0948&quot;</span>
article_ar = <span class="hljs-string">&quot;\u0627\u0644\u0623\u0645\u064A\u0646 \u0627\u0644\u0639\u0627\u0645 \u0644\u0644\u0623\u0645\u0645 \u0627\u0644\u0645\u062A\u062D\u062F\u0629 \u064A\u0642\u0648\u0644 \u0625\u0646\u0647 \u0644\u0627 \u064A\u0648\u062C\u062F \u062D\u0644 \u0639\u0633\u0643\u0631\u064A \u0641\u064A \u0633\u0648\u0631\u064A\u0627.&quot;</span>

model = MBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-50-many-to-many-mmt&quot;</span>)
tokenizer = MBart50TokenizerFast.from_pretrained(<span class="hljs-string">&quot;facebook/mbart-large-50-many-to-many-mmt&quot;</span>)

<span class="hljs-comment"># translate Hindi to French</span>
tokenizer.src_lang = <span class="hljs-string">&quot;hi_IN&quot;</span>
encoded_hi = tokenizer(article_hi, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
generated_tokens = model.generate(**encoded_hi, forced_bos_token_id=tokenizer.lang_code_to_id[<span class="hljs-string">&quot;fr_XX&quot;</span>])
tokenizer.batch_decode(generated_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-comment"># =&gt; &quot;Le chef de l &#x27;ONU affirme qu &#x27;il n &#x27;y a pas de solution militaire en Syria.&quot;</span>

<span class="hljs-comment"># translate Arabic to English</span>
tokenizer.src_lang = <span class="hljs-string">&quot;ar_AR&quot;</span>
encoded_ar = tokenizer(article_ar, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
generated_tokens = model.generate(**encoded_ar, forced_bos_token_id=tokenizer.lang_code_to_id[<span class="hljs-string">&quot;en_XX&quot;</span>])
tokenizer.batch_decode(generated_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-comment"># =&gt; &quot;The Secretary-General of the United Nations says there is no military solution in Syria.&quot;</span>`}}),La=new V({}),Ga=new F({props:{name:"class transformers.MBartConfig",anchor:"transformers.MBartConfig",parameters:[{name:"vocab_size",val:" = 50265"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 12"},{name:"encoder_ffn_dim",val:" = 4096"},{name:"encoder_attention_heads",val:" = 16"},{name:"decoder_layers",val:" = 12"},{name:"decoder_ffn_dim",val:" = 4096"},{name:"decoder_attention_heads",val:" = 16"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"use_cache",val:" = True"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'gelu'"},{name:"d_model",val:" = 1024"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"classifier_dropout",val:" = 0.0"},{name:"scale_embedding",val:" = False"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"forced_eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MBartConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the MBART 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/mbart#transformers.MBartModel">MBartModel</a> or <a href="/docs/transformers/main/en/model_doc/mbart#transformers.TFMBartModel">TFMBartModel</a>.`,name:"vocab_size"},{anchor:"transformers.MBartConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.MBartConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.MBartConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.MBartConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.MBartConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.MBartConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.MBartConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.MBartConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.MBartConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.MBartConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.MBartConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.MBartConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for classifier.`,name:"classifier_dropout"},{anchor:"transformers.MBartConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.MBartConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.MBartConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.MBartConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.MBartConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.MBartConfig.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"},{anchor:"transformers.MBartConfig.forced_eos_token_id",description:`<strong>forced_eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Usually set to
<code>eos_token_id</code>.`,name:"forced_eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/configuration_mbart.py#L34"}}),Qo=new A({props:{anchor:"transformers.MBartConfig.example",$$slots:{default:[CM]},$$scope:{ctx:M}}}),Ra=new V({}),Ua=new F({props:{name:"class transformers.MBartTokenizer",anchor:"transformers.MBartTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"tokenizer_file",val:" = None"},{name:"src_lang",val:" = None"},{name:"tgt_lang",val:" = None"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"additional_special_tokens",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/tokenization_mbart.py#L53"}}),Vo=new A({props:{anchor:"transformers.MBartTokenizer.example",$$slots:{default:[AM]},$$scope:{ctx:M}}}),Qa=new F({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MBartTokenizer.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.MBartTokenizer.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.MBartTokenizer.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/mbart/tokenization_mbart.py#L218",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>
`}}),Za=new V({}),Ya=new F({props:{name:"class transformers.MBartTokenizerFast",anchor:"transformers.MBartTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"src_lang",val:" = None"},{name:"tgt_lang",val:" = None"},{name:"additional_special_tokens",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/tokenization_mbart_fast.py#L63"}}),Jo=new A({props:{anchor:"transformers.MBartTokenizerFast.example",$$slots:{default:[PM]},$$scope:{ctx:M}}}),os=new F({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MBartTokenizerFast.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.MBartTokenizerFast.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.MBartTokenizerFast.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/mbart/tokenization_mbart_fast.py#L161",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>
`}}),is=new F({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.MBartTokenizerFast.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.MBartTokenizerFast.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.MBartTokenizerFast.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/mbart/tokenization_mbart_fast.py#L190",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ds=new F({props:{name:"set_src_lang_special_tokens",anchor:"transformers.MBartTokenizerFast.set_src_lang_special_tokens",parameters:[{name:"src_lang",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/tokenization_mbart_fast.py#L245"}}),ls=new F({props:{name:"set_tgt_lang_special_tokens",anchor:"transformers.MBartTokenizerFast.set_tgt_lang_special_tokens",parameters:[{name:"lang",val:": str"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/tokenization_mbart_fast.py#L260"}}),cs=new V({}),ps=new F({props:{name:"class transformers.MBart50Tokenizer",anchor:"transformers.MBart50Tokenizer",parameters:[{name:"vocab_file",val:""},{name:"src_lang",val:" = None"},{name:"tgt_lang",val:" = None"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MBart50Tokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.MBart50Tokenizer.src_lang",description:`<strong>src_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string representing the source language.`,name:"src_lang"},{anchor:"transformers.MBart50Tokenizer.tgt_lang",description:`<strong>tgt_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string representing the target language.`,name:"tgt_lang"},{anchor:"transformers.MBart50Tokenizer.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.`,name:"eos_token"},{anchor:"transformers.MBart50Tokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.MBart50Tokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.MBart50Tokenizer.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.MBart50Tokenizer.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.MBart50Tokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.MBart50Tokenizer.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart50/tokenization_mbart50.py#L49"}}),on=new A({props:{anchor:"transformers.MBart50Tokenizer.example",$$slots:{default:[SM]},$$scope:{ctx:M}}}),fs=new F({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MBart50Tokenizer.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.MBart50Tokenizer.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.MBart50Tokenizer.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/mbart50/tokenization_mbart50.py#L301",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>
`}}),ys=new F({props:{name:"convert_tokens_to_string",anchor:"transformers.MBart50Tokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart50/tokenization_mbart50.py#L235"}}),vs=new F({props:{name:"get_special_tokens_mask",anchor:"transformers.MBart50Tokenizer.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.MBart50Tokenizer.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.MBart50Tokenizer.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.MBart50Tokenizer.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/mbart50/tokenization_mbart50.py#L271",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>
`}}),ws=new F({props:{name:"set_src_lang_special_tokens",anchor:"transformers.MBart50Tokenizer.set_src_lang_special_tokens",parameters:[{name:"src_lang",val:": str"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart50/tokenization_mbart50.py#L358"}}),$s=new F({props:{name:"set_tgt_lang_special_tokens",anchor:"transformers.MBart50Tokenizer.set_tgt_lang_special_tokens",parameters:[{name:"tgt_lang",val:": str"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart50/tokenization_mbart50.py#L364"}}),xs=new V({}),Ms=new F({props:{name:"class transformers.MBart50TokenizerFast",anchor:"transformers.MBart50TokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"src_lang",val:" = None"},{name:"tgt_lang",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MBart50TokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.MBart50TokenizerFast.src_lang",description:`<strong>src_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string representing the source language.`,name:"src_lang"},{anchor:"transformers.MBart50TokenizerFast.tgt_lang",description:`<strong>tgt_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string representing the target language.`,name:"tgt_lang"},{anchor:"transformers.MBart50TokenizerFast.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.`,name:"eos_token"},{anchor:"transformers.MBart50TokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.MBart50TokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.MBart50TokenizerFast.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.MBart50TokenizerFast.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.MBart50TokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart50/tokenization_mbart50_fast.py#L59"}}),ln=new A({props:{anchor:"transformers.MBart50TokenizerFast.example",$$slots:{default:[OM]},$$scope:{ctx:M}}}),qs=new F({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MBart50TokenizerFast.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.MBart50TokenizerFast.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.MBart50TokenizerFast.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/mbart50/tokenization_mbart50_fast.py#L170",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>
`}}),As=new F({props:{name:"set_src_lang_special_tokens",anchor:"transformers.MBart50TokenizerFast.set_src_lang_special_tokens",parameters:[{name:"src_lang",val:": str"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart50/tokenization_mbart50_fast.py#L217"}}),Ps=new F({props:{name:"set_tgt_lang_special_tokens",anchor:"transformers.MBart50TokenizerFast.set_tgt_lang_special_tokens",parameters:[{name:"tgt_lang",val:": str"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart50/tokenization_mbart50_fast.py#L232"}}),Ss=new V({}),Os=new F({props:{name:"class transformers.MBartModel",anchor:"transformers.MBartModel",parameters:[{name:"config",val:": MBartConfig"}],parametersDescription:[{anchor:"transformers.MBartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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/mbart/modeling_mbart.py#L1147"}}),Ls=new F({props:{name:"forward",anchor:"transformers.MBartModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.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.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MBartModel.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. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MBartModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MBartModel.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>MBart uses a specific language id token as the starting token for <code>decoder_input_ids</code> generation that
varies according to source and target language, <em>e.g.</em> 25004 for <em>en_XX</em>, and 25003 for <em>de_DE</em>. 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>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.MBartModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</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.MBartModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.MBartModel.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.MBartModel.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_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.MBartModel.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>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.MBartModel.forward.past_key_values",description:`<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>) &#x2014;
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>
<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>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.MBartModel.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.MBartModel.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.MBartModel.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.MBartModel.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.MBartModel.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/mbart/modeling_mbart.py#L1176",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/mbart#transformers.MBartConfig"
>MBartConfig</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>
`}}),hn=new mt({props:{$$slots:{default:[IM]},$$scope:{ctx:M}}}),mn=new A({props:{anchor:"transformers.MBartModel.forward.example",$$slots:{default:[NM]},$$scope:{ctx:M}}}),Gs=new V({}),Ws=new F({props:{name:"class transformers.MBartForConditionalGeneration",anchor:"transformers.MBartForConditionalGeneration",parameters:[{name:"config",val:": MBartConfig"}],parametersDescription:[{anchor:"transformers.MBartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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/mbart/modeling_mbart.py#L1265"}}),Qs=new F({props:{name:"forward",anchor:"transformers.MBartForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.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.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.MBartForConditionalGeneration.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. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MBartForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MBartForConditionalGeneration.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>MBart uses a specific language id token as the starting token for <code>decoder_input_ids</code> generation that
varies according to source and target language, <em>e.g.</em> 25004 for <em>en_XX</em>, and 25003 for <em>de_DE</em>. 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>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.MBartForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</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.MBartForConditionalGeneration.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.MBartForConditionalGeneration.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.MBartForConditionalGeneration.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_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.MBartForConditionalGeneration.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>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.MBartForConditionalGeneration.forward.past_key_values",description:`<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>) &#x2014;
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>
<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>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.MBartForConditionalGeneration.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.MBartForConditionalGeneration.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.MBartForConditionalGeneration.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.MBartForConditionalGeneration.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.MBartForConditionalGeneration.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.MBartForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_mbart.py#L1311",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/mbart#transformers.MBartConfig"
>MBartConfig</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>
`}}),_n=new mt({props:{$$slots:{default:[DM]},$$scope:{ctx:M}}}),gn=new A({props:{anchor:"transformers.MBartForConditionalGeneration.forward.example",$$slots:{default:[LM]},$$scope:{ctx:M}}}),kn=new A({props:{anchor:"transformers.MBartForConditionalGeneration.forward.example-2",$$slots:{default:[GM]},$$scope:{ctx:M}}}),Hs=new V({}),Vs=new F({props:{name:"class transformers.MBartForQuestionAnswering",anchor:"transformers.MBartForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MBartForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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/mbart/modeling_mbart.py#L1567"}}),Ys=new F({props:{name:"forward",anchor:"transformers.MBartForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": Tensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MBartForQuestionAnswering.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. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MBartForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MBartForQuestionAnswering.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>MBart uses a specific language id token as the starting token for <code>decoder_input_ids</code> generation that
varies according to source and target language, <em>e.g.</em> 25004 for <em>en_XX</em>, and 25003 for <em>de_DE</em>. 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>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.MBartForQuestionAnswering.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</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.MBartForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.MBartForQuestionAnswering.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.MBartForQuestionAnswering.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_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.MBartForQuestionAnswering.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>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.MBartForQuestionAnswering.forward.past_key_values",description:`<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>) &#x2014;
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>
<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>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.MBartForQuestionAnswering.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.MBartForQuestionAnswering.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.MBartForQuestionAnswering.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.MBartForQuestionAnswering.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.MBartForQuestionAnswering.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.MBartForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.MBartForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_mbart.py#L1581",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig"
>MBartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yn=new mt({props:{$$slots:{default:[WM]},$$scope:{ctx:M}}}),vn=new A({props:{anchor:"transformers.MBartForQuestionAnswering.forward.example",$$slots:{default:[RM]},$$scope:{ctx:M}}}),er=new V({}),tr=new F({props:{name:"class transformers.MBartForSequenceClassification",anchor:"transformers.MBartForSequenceClassification",parameters:[{name:"config",val:": MBartConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MBartForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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/mbart/modeling_mbart.py#L1440"}}),sr=new F({props:{name:"forward",anchor:"transformers.MBartForSequenceClassification.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MBartForSequenceClassification.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. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MBartForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MBartForSequenceClassification.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>MBart uses a specific language id token as the starting token for <code>decoder_input_ids</code> generation that
varies according to source and target language, <em>e.g.</em> 25004 for <em>en_XX</em>, and 25003 for <em>de_DE</em>. 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>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.MBartForSequenceClassification.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</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.MBartForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.MBartForSequenceClassification.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.MBartForSequenceClassification.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_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.MBartForSequenceClassification.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>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.MBartForSequenceClassification.forward.past_key_values",description:`<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>) &#x2014;
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>
<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>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): 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:"past_key_values"},{anchor:"transformers.MBartForSequenceClassification.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.MBartForSequenceClassification.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.MBartForSequenceClassification.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.MBartForSequenceClassification.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.MBartForSequenceClassification.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.MBartForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_mbart.py#L1455",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig"
>MBartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),wn=new mt({props:{$$slots:{default:[UM]},$$scope:{ctx:M}}}),$n=new A({props:{anchor:"transformers.MBartForSequenceClassification.forward.example",$$slots:{default:[XM]},$$scope:{ctx:M}}}),xn=new A({props:{anchor:"transformers.MBartForSequenceClassification.forward.example-2",$$slots:{default:[QM]},$$scope:{ctx:M}}}),rr=new V({}),ir=new F({props:{name:"class transformers.MBartForCausalLM",anchor:"transformers.MBartForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_mbart.py#L1699"}}),dr=new F({props:{name:"forward",anchor:"transformers.MBartForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"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.MBartForCausalLM.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. Padding will be ignored by default should you
provide it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MBartForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MBartForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention
if the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.MBartForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_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 the padding token indices of the encoder input. This mask is used
in the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:`,name:"encoder_attention_mask"},{anchor:"transformers.MBartForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.MBartForCausalLM.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-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:"cross_attn_head_mask"},{anchor:"transformers.MBartForCausalLM.forward.past_key_values",description:`<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>) &#x2014;
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>. The two additional
tensors are only required when the model is used as a decoder in a Sequence to Sequence model.</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>
<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.MBartForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.MBartForCausalLM.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>).</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"use_cache"},{anchor:"transformers.MBartForCausalLM.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.MBartForCausalLM.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.MBartForCausalLM.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/mbart/modeling_mbart.py#L1732",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</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/mbart#transformers.MBartConfig"
>MBartConfig</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 (for next-token prediction).</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>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>
<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>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(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>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fn=new A({props:{anchor:"transformers.MBartForCausalLM.forward.example",$$slots:{default:[HM]},$$scope:{ctx:M}}}),lr=new V({}),cr=new F({props:{name:"class transformers.TFMBartModel",anchor:"transformers.TFMBartModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMBartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_tf_mbart.py#L1202"}}),Bn=new mt({props:{$$slots:{default:[VM]},$$scope:{ctx:M}}}),mr=new F({props:{name:"call",anchor:"transformers.TFMBartModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor] = None"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_position_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"encoder_outputs",val:": typing.Union[typing.Tuple, transformers.modeling_tf_outputs.TFBaseModelOutput, NoneType] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.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"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMBartModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFMBartModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMBartModel.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
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>MBart uses a specific language id token as the starting token for <code>decoder_input_ids</code> generation that
varies according to source and target language, <em>e.g.</em> 25004 for <em>en_XX</em>, and 25003 for <em>de_DE</em>. 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>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.TFMBartModel.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFMBartModel.call.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.TFMBartModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.TFMBartModel.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.TFMBartModel.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-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:"cross_attn_head_mask"},{anchor:"transformers.TFMBartModel.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFMBartModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
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.TFMBartModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFMBartModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFMBartModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMBartModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMBartModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_tf_mbart.py#L1214",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig"
>MBartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),jn=new mt({props:{$$slots:{default:[KM]},$$scope:{ctx:M}}}),En=new A({props:{anchor:"transformers.TFMBartModel.call.example",$$slots:{default:[JM]},$$scope:{ctx:M}}}),fr=new V({}),_r=new F({props:{name:"class transformers.TFMBartForConditionalGeneration",anchor:"transformers.TFMBartForConditionalGeneration",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMBartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_tf_mbart.py#L1308"}}),An=new mt({props:{$$slots:{default:[ZM]},$$scope:{ctx:M}}}),yr=new F({props:{name:"call",anchor:"transformers.TFMBartForConditionalGeneration.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor] = None"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_position_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[transformers.modeling_tf_outputs.TFBaseModelOutput] = None"},{name:"past_key_values",val:": typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.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"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFMBartForConditionalGeneration.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>) &#x2014;
Indices of 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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFMBartForConditionalGeneration.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</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.TFMBartForConditionalGeneration.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
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>MBart uses a specific language id token as the starting token for <code>decoder_input_ids</code> generation that
varies according to source and target language, <em>e.g.</em> 25004 for <em>en_XX</em>, and 25003 for <em>de_DE</em>. 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>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.TFMBartForConditionalGeneration.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFMBartForConditionalGeneration.call.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.TFMBartForConditionalGeneration.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.TFMBartForConditionalGeneration.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.TFMBartForConditionalGeneration.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-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:"cross_attn_head_mask"},{anchor:"transformers.TFMBartForConditionalGeneration.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFMBartForConditionalGeneration.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
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.TFMBartForConditionalGeneration.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFMBartForConditionalGeneration.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFMBartForConditionalGeneration.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMBartForConditionalGeneration.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMBartForConditionalGeneration.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFMBartForConditionalGeneration.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_tf_mbart.py#L1346",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig"
>MBartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Pn=new mt({props:{$$slots:{default:[YM]},$$scope:{ctx:M}}}),Sn=new A({props:{anchor:"transformers.TFMBartForConditionalGeneration.call.example",$$slots:{default:[e1]},$$scope:{ctx:M}}}),On=new A({props:{anchor:"transformers.TFMBartForConditionalGeneration.call.example-2",$$slots:{default:[t1]},$$scope:{ctx:M}}}),vr=new V({}),Tr=new F({props:{name:"class transformers.FlaxMBartModel",anchor:"transformers.FlaxMBartModel",parameters:[{name:"config",val:": MBartConfig"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxMBartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxMBartModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1278"}}),Br=new F({props:{name:"__call__",anchor:"transformers.FlaxMBartModel.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMBartModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMBartModel.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMBartModel.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMBartModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMBartModel.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMBartModel.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartModel.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1215",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</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/mbart#transformers.MBartConfig"
>MBartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the 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(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Nn=new mt({props:{$$slots:{default:[o1]},$$scope:{ctx:M}}}),Dn=new A({props:{anchor:"transformers.FlaxMBartModel.__call__.example",$$slots:{default:[n1]},$$scope:{ctx:M}}}),jr=new F({props:{name:"encode",anchor:"transformers.FlaxMBartModel.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartModel.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMBartModel.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMBartModel.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMBartModel.encode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartModel.encode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartModel.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1039",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mbart.configuration_mbart.MBartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Gn=new A({props:{anchor:"transformers.FlaxMBartModel.encode.example",$$slots:{default:[a1]},$$scope:{ctx:M}}}),Er=new F({props:{name:"decode",anchor:"transformers.FlaxMBartModel.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartModel.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMBartModel.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FlaxMBartModel.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"encoder_attention_mask"},{anchor:"transformers.FlaxMBartModel.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMBartModel.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMBartModel.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxMBartModel.decode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartModel.decode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartModel.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1102",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mbart.configuration_mbart.MBartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Rn=new A({props:{anchor:"transformers.FlaxMBartModel.decode.example",$$slots:{default:[s1]},$$scope:{ctx:M}}}),Cr=new V({}),Ar=new F({props:{name:"class transformers.FlaxMBartForConditionalGeneration",anchor:"transformers.FlaxMBartForConditionalGeneration",parameters:[{name:"config",val:": MBartConfig"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxMBartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxMBartForConditionalGeneration.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1363"}}),Gr=new F({props:{name:"__call__",anchor:"transformers.FlaxMBartForConditionalGeneration.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1215",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig"
>MBartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xn=new mt({props:{$$slots:{default:[r1]},$$scope:{ctx:M}}}),Qn=new A({props:{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.example",$$slots:{default:[i1]},$$scope:{ctx:M}}}),Hn=new A({props:{anchor:"transformers.FlaxMBartForConditionalGeneration.__call__.example-2",$$slots:{default:[d1]},$$scope:{ctx:M}}}),Wr=new F({props:{name:"encode",anchor:"transformers.FlaxMBartForConditionalGeneration.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartForConditionalGeneration.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMBartForConditionalGeneration.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMBartForConditionalGeneration.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMBartForConditionalGeneration.encode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartForConditionalGeneration.encode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartForConditionalGeneration.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1039",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mbart.configuration_mbart.MBartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Kn=new A({props:{anchor:"transformers.FlaxMBartForConditionalGeneration.encode.example",$$slots:{default:[l1]},$$scope:{ctx:M}}}),Rr=new F({props:{name:"decode",anchor:"transformers.FlaxMBartForConditionalGeneration.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"encoder_attention_mask"},{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1367",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mbart.configuration_mbart.MBartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Zn=new A({props:{anchor:"transformers.FlaxMBartForConditionalGeneration.decode.example",$$slots:{default:[c1]},$$scope:{ctx:M}}}),Ur=new V({}),Xr=new F({props:{name:"class transformers.FlaxMBartForSequenceClassification",anchor:"transformers.FlaxMBartForSequenceClassification",parameters:[{name:"config",val:": MBartConfig"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxMBartForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxMBartForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1676"}}),ei=new F({props:{name:"__call__",anchor:"transformers.FlaxMBartForSequenceClassification.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1215",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput</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/mbart#transformers.MBartConfig"
>MBartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ea=new mt({props:{$$slots:{default:[p1]},$$scope:{ctx:M}}}),ta=new A({props:{anchor:"transformers.FlaxMBartForSequenceClassification.__call__.example",$$slots:{default:[u1]},$$scope:{ctx:M}}}),ti=new F({props:{name:"encode",anchor:"transformers.FlaxMBartForSequenceClassification.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartForSequenceClassification.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMBartForSequenceClassification.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMBartForSequenceClassification.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMBartForSequenceClassification.encode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartForSequenceClassification.encode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartForSequenceClassification.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1039",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mbart.configuration_mbart.MBartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),na=new A({props:{anchor:"transformers.FlaxMBartForSequenceClassification.encode.example",$$slots:{default:[h1]},$$scope:{ctx:M}}}),oi=new F({props:{name:"decode",anchor:"transformers.FlaxMBartForSequenceClassification.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartForSequenceClassification.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMBartForSequenceClassification.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FlaxMBartForSequenceClassification.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"encoder_attention_mask"},{anchor:"transformers.FlaxMBartForSequenceClassification.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMBartForSequenceClassification.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMBartForSequenceClassification.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxMBartForSequenceClassification.decode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartForSequenceClassification.decode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartForSequenceClassification.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1102",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mbart.configuration_mbart.MBartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),sa=new A({props:{anchor:"transformers.FlaxMBartForSequenceClassification.decode.example",$$slots:{default:[m1]},$$scope:{ctx:M}}}),ni=new V({}),ai=new F({props:{name:"class transformers.FlaxMBartForQuestionAnswering",anchor:"transformers.FlaxMBartForQuestionAnswering",parameters:[{name:"config",val:": MBartConfig"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxMBartForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mbart#transformers.MBartConfig">MBartConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxMBartForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1763"}}),ui=new F({props:{name:"__call__",anchor:"transformers.FlaxMBartForQuestionAnswering.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1215",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput</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/mbart#transformers.MBartConfig"
>MBartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ia=new mt({props:{$$slots:{default:[f1]},$$scope:{ctx:M}}}),da=new A({props:{anchor:"transformers.FlaxMBartForQuestionAnswering.__call__.example",$$slots:{default:[_1]},$$scope:{ctx:M}}}),hi=new F({props:{name:"encode",anchor:"transformers.FlaxMBartForQuestionAnswering.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartForQuestionAnswering.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMBartForQuestionAnswering.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMBartForQuestionAnswering.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMBartForQuestionAnswering.encode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartForQuestionAnswering.encode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartForQuestionAnswering.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1039",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mbart.configuration_mbart.MBartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ca=new A({props:{anchor:"transformers.FlaxMBartForQuestionAnswering.encode.example",$$slots:{default:[g1]},$$scope:{ctx:M}}}),mi=new F({props:{name:"decode",anchor:"transformers.FlaxMBartForQuestionAnswering.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"encoder_attention_mask"},{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mbart/modeling_flax_mbart.py#L1102",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mbart.configuration_mbart.MBartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ua=new A({props:{anchor:"transformers.FlaxMBartForQuestionAnswering.decode.example",$$slots:{default:[k1]},$$scope:{ctx:M}}}),{c(){l=a("meta"),b=p(),f=a("h1"),h=a("a"),g=a("span"),y(n.$$.fragment),c=p(),q=a("span"),ft=i("MBart and MBart-50"),Ye=p(),U=a("p"),De=a("strong"),Le=i("DISCLAIMER:"),B=i(" If you see something strange, file a "),be=a("a"),ye=i("Github Issue"),_t=i(` and assign
@patrickvonplaten`),et=p(),X=a("h2"),pe=a("a"),Ge=a("span"),y(K.$$.fragment),gt=p(),We=a("span"),ve=i("Overview of MBart"),tt=p(),ue=a("p"),Te=i("The MBart model was presented in "),we=a("a"),kt=i("Multilingual Denoising Pre-training for Neural Machine Translation"),Re=i(` by Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov Marjan
Ghazvininejad, Mike Lewis, Luke Zettlemoyer.`),S=p(),I=a("p"),bt=i(`According to the abstract, MBART is a sequence-to-sequence denoising auto-encoder pretrained on large-scale monolingual
corpora in many languages using the BART objective. mBART is one of the first methods for pretraining a complete
sequence-to-sequence model by denoising full texts in multiple languages, while previous approaches have focused only
on the encoder, decoder, or reconstructing parts of the text.`),he=p(),re=a("p"),yt=i("This model was contributed by "),J=a("a"),vt=i("valhalla"),Tt=i(". The Authors\u2019 code can be found "),O=a("a"),wt=i("here"),me=p(),ie=a("h3"),fe=a("a"),de=a("span"),y($e.$$.fragment),$t=p(),Z=a("span"),xt=i("Training of MBart"),_e=p(),R=a("p"),Ue=i(`MBart is a multilingual encoder-decoder (sequence-to-sequence) model primarily intended for translation task. As the
model is multilingual it expects the sequences in a different format. A special language id token is added in both the
source and target text. The source text format is `),N=a("code"),Mt=i("X [eos, src_lang_code]"),Y=i(" where "),Xe=a("code"),zt=i("X"),z=i(` is the source text. The
target text format is `),j=a("code"),Jt=i("[tgt_lang_code] X [eos]"),Qe=i(". "),Ft=a("code"),Zt=i("bos"),C=i(" is never used."),Nt=p(),te=a("p"),Yt=i("The regular "),He=a("a"),qt=a("strong"),le=i("call"),xe=i("()"),eo=i(" will encode source text format passed as first argument or with the "),Bt=a("code"),Me=i("text"),to=i(`
keyword, and target text format passed with the `),jt=a("code"),Et=i("text_label"),oo=i(" keyword argument."),Ee=p(),ot=a("ul"),gd=a("li"),Ph=i("Supervised training"),gp=p(),y(Ea.$$.fragment),kp=p(),vi=a("ul"),Ca=a("li"),kd=a("p"),Sh=i("Generation"),Oh=p(),no=a("p"),Ih=i("While generating the target text set the "),bd=a("code"),Nh=i("decoder_start_token_id"),Dh=i(` to the target language id. The following
example shows how to translate English to Romanian using the `),yd=a("em"),Lh=i("facebook/mbart-large-en-ro"),Gh=i(" model."),bp=p(),y(Aa.$$.fragment),yp=p(),ao=a("h2"),Wo=a("a"),vd=a("span"),y(Pa.$$.fragment),Wh=p(),Td=a("span"),Rh=i("Overview of MBart-50"),vp=p(),Dt=a("p"),Uh=i("MBart-50 was introduced in the "),Sa=a("a"),Xh=i("Multilingual Translation with Extensible Multilingual Pretraining and Finetuning"),Qh=i(` paper by Yuqing Tang, Chau Tran, Xian Li, Peng-Jen Chen, Naman Goyal, Vishrav
Chaudhary, Jiatao Gu, Angela Fan. MBart-50 is created using the original `),wd=a("em"),Hh=i("mbart-large-cc25"),Vh=i(` checkpoint by extendeding
its embedding layers with randomly initialized vectors for an extra set of 25 language tokens and then pretrained on 50
languages.`),Tp=p(),Ti=a("p"),Kh=i("According to the abstract"),wp=p(),wi=a("p"),$d=a("em"),Jh=i(`Multilingual translation models can be created through multilingual finetuning. Instead of finetuning on one
direction, a pretrained model is finetuned on many directions at the same time. It demonstrates that pretrained models
can be extended to incorporate additional languages without loss of performance. Multilingual finetuning improves on
average 1 BLEU over the strongest baselines (being either multilingual from scratch or bilingual finetuning) while
improving 9.3 BLEU on average over bilingual baselines from scratch.`),$p=p(),so=a("h3"),Ro=a("a"),xd=a("span"),y(Oa.$$.fragment),Zh=p(),Md=a("span"),Yh=i("Training of MBart-50"),xp=p(),nt=a("p"),em=i(`The text format for MBart-50 is slightly different from mBART. For MBart-50 the language id token is used as a prefix
for both source and target text i.e the text format is `),zd=a("code"),tm=i("[lang_code] X [eos]"),om=i(", where "),Fd=a("code"),nm=i("lang_code"),am=i(` is source
language id for source text and target language id for target text, with `),qd=a("code"),sm=i("X"),rm=i(` being the source or target text
respectively.`),Mp=p(),Uo=a("p"),im=i("MBart-50 has its own tokenizer "),$i=a("a"),dm=i("MBart50Tokenizer"),lm=i("."),zp=p(),xi=a("ul"),Bd=a("li"),cm=i("Supervised training"),Fp=p(),y(Ia.$$.fragment),qp=p(),Mi=a("ul"),Na=a("li"),jd=a("p"),pm=i("Generation"),um=p(),ze=a("p"),hm=i("To generate using the mBART-50 multilingual translation models, "),Ed=a("code"),mm=i("eos_token_id"),fm=i(` is used as the
`),Cd=a("code"),_m=i("decoder_start_token_id"),gm=i(` and the target language id is forced as the first generated token. To force the
target language id as the first generated token, pass the `),Ad=a("em"),km=i("forced_bos_token_id"),bm=i(" parameter to the "),Pd=a("em"),ym=i("generate"),vm=i(` method.
The following example shows how to translate between Hindi to French and Arabic to English using the
`),Sd=a("em"),Tm=i("facebook/mbart-50-large-many-to-many"),wm=i(" checkpoint."),Bp=p(),y(Da.$$.fragment),jp=p(),ro=a("h2"),Xo=a("a"),Od=a("span"),y(La.$$.fragment),$m=p(),Id=a("span"),xm=i("MBartConfig"),Ep=p(),Ve=a("div"),y(Ga.$$.fragment),Mm=p(),io=a("p"),zm=i("This is the configuration class to store the configuration of a "),zi=a("a"),Fm=i("MBartModel"),qm=i(`. It is used to instantiate an MBART
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 MBART
`),Wa=a("a"),Bm=i("facebook/mbart-large-cc25"),jm=i(" architecture."),Em=p(),lo=a("p"),Cm=i("Configuration objects inherit from "),Fi=a("a"),Am=i("PretrainedConfig"),Pm=i(` and can be used to control the model outputs. Read the
documentation from `),qi=a("a"),Sm=i("PretrainedConfig"),Om=i(" for more information."),Im=p(),y(Qo.$$.fragment),Cp=p(),co=a("h2"),Ho=a("a"),Nd=a("span"),y(Ra.$$.fragment),Nm=p(),Dd=a("span"),Dm=i("MBartTokenizer"),Ap=p(),ce=a("div"),y(Ua.$$.fragment),Lm=p(),Ld=a("p"),Gm=i("Construct an MBART tokenizer."),Wm=p(),Ct=a("p"),Rm=i("Adapted from "),Bi=a("a"),Um=i("RobertaTokenizer"),Xm=i(" and "),ji=a("a"),Qm=i("XLNetTokenizer"),Hm=i(`. Based on
`),Xa=a("a"),Vm=i("SentencePiece"),Km=i("."),Jm=p(),po=a("p"),Zm=i("The tokenization method is "),Gd=a("code"),Ym=i("<tokens> <eos> <language code>"),ef=i(" for source language documents, and "),Wd=a("code"),tf=i("<language code> <tokens> <eos>"),of=i(" for target language documents."),nf=p(),y(Vo.$$.fragment),af=p(),at=a("div"),y(Qa.$$.fragment),sf=p(),Ha=a("p"),rf=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An MBART sequence has the following format, where `),Rd=a("code"),df=i("X"),lf=i(" represents the sequence:"),cf=p(),Va=a("ul"),Ka=a("li"),Ud=a("code"),pf=i("input_ids"),uf=i(" (for encoder) "),Xd=a("code"),hf=i("X [eos, src_lang_code]"),mf=p(),Ja=a("li"),Qd=a("code"),ff=i("decoder_input_ids"),_f=i(": (for decoder) "),Hd=a("code"),gf=i("X [eos, tgt_lang_code]"),kf=p(),Vd=a("p"),bf=i(`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),Pp=p(),uo=a("h2"),Ko=a("a"),Kd=a("span"),y(Za.$$.fragment),yf=p(),Jd=a("span"),vf=i("MBartTokenizerFast"),Sp=p(),D=a("div"),y(Ya.$$.fragment),Tf=p(),ho=a("p"),wf=i("Construct a \u201Cfast\u201D MBART tokenizer (backed by HuggingFace\u2019s "),Zd=a("em"),$f=i("tokenizers"),xf=i(` library). Based on
`),es=a("a"),Mf=i("BPE"),zf=i("."),Ff=p(),ts=a("p"),qf=i("This tokenizer inherits from "),Ei=a("a"),Bf=i("PreTrainedTokenizerFast"),jf=i(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Ef=p(),mo=a("p"),Cf=i("The tokenization method is "),Yd=a("code"),Af=i("<tokens> <eos> <language code>"),Pf=i(" for source language documents, and "),el=a("code"),Sf=i("<language code> <tokens> <eos>"),Of=i(" for target language documents."),If=p(),y(Jo.$$.fragment),Nf=p(),Ce=a("div"),y(os.$$.fragment),Df=p(),tl=a("p"),Lf=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. The special tokens depend on calling set_lang.`),Gf=p(),ns=a("p"),Wf=i("An MBART sequence has the following format, where "),ol=a("code"),Rf=i("X"),Uf=i(" represents the sequence:"),Xf=p(),as=a("ul"),ss=a("li"),nl=a("code"),Qf=i("input_ids"),Hf=i(" (for encoder) "),al=a("code"),Vf=i("X [eos, src_lang_code]"),Kf=p(),rs=a("li"),sl=a("code"),Jf=i("decoder_input_ids"),Zf=i(": (for decoder) "),rl=a("code"),Yf=i("X [eos, tgt_lang_code]"),e_=p(),il=a("p"),t_=i(`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),o_=p(),Zo=a("div"),y(is.$$.fragment),n_=p(),dl=a("p"),a_=i(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. mBART does not
make use of token type ids, therefore a list of zeros is returned.`),s_=p(),Yo=a("div"),y(ds.$$.fragment),r_=p(),ll=a("p"),i_=i("Reset the special tokens to the source lang setting. No prefix and suffix=[eos, src_lang_code]."),d_=p(),en=a("div"),y(ls.$$.fragment),l_=p(),cl=a("p"),c_=i("Reset the special tokens to the target language setting. No prefix and suffix=[eos, tgt_lang_code]."),Op=p(),fo=a("h2"),tn=a("a"),pl=a("span"),y(cs.$$.fragment),p_=p(),ul=a("span"),u_=i("MBart50Tokenizer"),Ip=p(),L=a("div"),y(ps.$$.fragment),h_=p(),us=a("p"),m_=i("Construct a MBart50 tokenizer. Based on "),hs=a("a"),f_=i("SentencePiece"),__=i("."),g_=p(),ms=a("p"),k_=i("This tokenizer inherits from "),Ci=a("a"),b_=i("PreTrainedTokenizer"),y_=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),v_=p(),y(on.$$.fragment),T_=p(),st=a("div"),y(fs.$$.fragment),w_=p(),_s=a("p"),$_=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An MBART-50 sequence has the following format, where `),hl=a("code"),x_=i("X"),M_=i(" represents the sequence:"),z_=p(),gs=a("ul"),ks=a("li"),ml=a("code"),F_=i("input_ids"),q_=i(" (for encoder) "),fl=a("code"),B_=i("[src_lang_code] X [eos]"),j_=p(),bs=a("li"),_l=a("code"),E_=i("labels"),C_=i(": (for decoder) "),gl=a("code"),A_=i("[tgt_lang_code] X [eos]"),P_=p(),kl=a("p"),S_=i(`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),O_=p(),nn=a("div"),y(ys.$$.fragment),I_=p(),bl=a("p"),N_=i("Converts a sequence of tokens (string) in a single string."),D_=p(),an=a("div"),y(vs.$$.fragment),L_=p(),Ts=a("p"),G_=i(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),yl=a("code"),W_=i("prepare_for_model"),R_=i(" method."),U_=p(),sn=a("div"),y(ws.$$.fragment),X_=p(),vl=a("p"),Q_=i("Reset the special tokens to the source lang setting. prefix=[src_lang_code] and suffix=[eos]."),H_=p(),rn=a("div"),y($s.$$.fragment),V_=p(),Tl=a("p"),K_=i("Reset the special tokens to the target language setting. prefix=[tgt_lang_code] and suffix=[eos]."),Np=p(),_o=a("h2"),dn=a("a"),wl=a("span"),y(xs.$$.fragment),J_=p(),$l=a("span"),Z_=i("MBart50TokenizerFast"),Dp=p(),ee=a("div"),y(Ms.$$.fragment),Y_=p(),go=a("p"),eg=i("Construct a \u201Cfast\u201D MBART tokenizer for mBART-50 (backed by HuggingFace\u2019s "),xl=a("em"),tg=i("tokenizers"),og=i(` library). Based on
`),zs=a("a"),ng=i("BPE"),ag=i("."),sg=p(),Fs=a("p"),rg=i("This tokenizer inherits from "),Ai=a("a"),ig=i("PreTrainedTokenizerFast"),dg=i(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),lg=p(),y(ln.$$.fragment),cg=p(),Ae=a("div"),y(qs.$$.fragment),pg=p(),Ml=a("p"),ug=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. The special tokens depend on calling set_lang.`),hg=p(),Bs=a("p"),mg=i("An MBART-50 sequence has the following format, where "),zl=a("code"),fg=i("X"),_g=i(" represents the sequence:"),gg=p(),js=a("ul"),Es=a("li"),Fl=a("code"),kg=i("input_ids"),bg=i(" (for encoder) "),ql=a("code"),yg=i("[src_lang_code] X [eos]"),vg=p(),Cs=a("li"),Bl=a("code"),Tg=i("labels"),wg=i(": (for decoder) "),jl=a("code"),$g=i("[tgt_lang_code] X [eos]"),xg=p(),El=a("p"),Mg=i(`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),zg=p(),cn=a("div"),y(As.$$.fragment),Fg=p(),Cl=a("p"),qg=i("Reset the special tokens to the source lang setting. prefix=[src_lang_code] and suffix=[eos]."),Bg=p(),pn=a("div"),y(Ps.$$.fragment),jg=p(),Al=a("p"),Eg=i("Reset the special tokens to the target language setting. prefix=[src_lang_code] and suffix=[eos]."),Lp=p(),ko=a("h2"),un=a("a"),Pl=a("span"),y(Ss.$$.fragment),Cg=p(),Sl=a("span"),Ag=i("MBartModel"),Gp=p(),Ke=a("div"),y(Os.$$.fragment),Pg=p(),Is=a("p"),Sg=i(`The bare MBART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Pi=a("a"),Og=i("PreTrainedModel"),Ig=i(`. 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.)`),Ng=p(),Ns=a("p"),Dg=i("This model is also a PyTorch "),Ds=a("a"),Lg=i("torch.nn.Module"),Gg=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Wg=p(),rt=a("div"),y(Ls.$$.fragment),Rg=p(),bo=a("p"),Ug=i("The "),Si=a("a"),Xg=i("MBartModel"),Qg=i(" forward method, overrides the "),Ol=a("code"),Hg=i("__call__"),Vg=i(" special method."),Kg=p(),y(hn.$$.fragment),Jg=p(),y(mn.$$.fragment),Wp=p(),yo=a("h2"),fn=a("a"),Il=a("span"),y(Gs.$$.fragment),Zg=p(),Nl=a("span"),Yg=i("MBartForConditionalGeneration"),Rp=p(),Je=a("div"),y(Ws.$$.fragment),ek=p(),Rs=a("p"),tk=i(`The MBART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Oi=a("a"),ok=i("PreTrainedModel"),nk=i(`. 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.)`),ak=p(),Us=a("p"),sk=i("This model is also a PyTorch "),Xs=a("a"),rk=i("torch.nn.Module"),ik=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dk=p(),Pe=a("div"),y(Qs.$$.fragment),lk=p(),vo=a("p"),ck=i("The "),Ii=a("a"),pk=i("MBartForConditionalGeneration"),uk=i(" forward method, overrides the "),Dl=a("code"),hk=i("__call__"),mk=i(" special method."),fk=p(),y(_n.$$.fragment),_k=p(),y(gn.$$.fragment),gk=p(),y(kn.$$.fragment),Up=p(),To=a("h2"),bn=a("a"),Ll=a("span"),y(Hs.$$.fragment),kk=p(),Gl=a("span"),bk=i("MBartForQuestionAnswering"),Xp=p(),Fe=a("div"),y(Vs.$$.fragment),yk=p(),wo=a("p"),vk=i(`MBART Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),Wl=a("code"),Tk=i("span start logits"),wk=i(" and "),Rl=a("code"),$k=i("span end logits"),xk=i(")."),Mk=p(),Ks=a("p"),zk=i("This model inherits from "),Ni=a("a"),Fk=i("PreTrainedModel"),qk=i(`. 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.)`),Bk=p(),Js=a("p"),jk=i("This model is also a PyTorch "),Zs=a("a"),Ek=i("torch.nn.Module"),Ck=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ak=p(),it=a("div"),y(Ys.$$.fragment),Pk=p(),$o=a("p"),Sk=i("The "),Di=a("a"),Ok=i("MBartForQuestionAnswering"),Ik=i(" forward method, overrides the "),Ul=a("code"),Nk=i("__call__"),Dk=i(" special method."),Lk=p(),y(yn.$$.fragment),Gk=p(),y(vn.$$.fragment),Qp=p(),xo=a("h2"),Tn=a("a"),Xl=a("span"),y(er.$$.fragment),Wk=p(),Ql=a("span"),Rk=i("MBartForSequenceClassification"),Hp=p(),qe=a("div"),y(tr.$$.fragment),Uk=p(),Hl=a("p"),Xk=i(`MBart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),Qk=p(),or=a("p"),Hk=i("This model inherits from "),Li=a("a"),Vk=i("PreTrainedModel"),Kk=i(`. 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.)`),Jk=p(),nr=a("p"),Zk=i("This model is also a PyTorch "),ar=a("a"),Yk=i("torch.nn.Module"),eb=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),tb=p(),Se=a("div"),y(sr.$$.fragment),ob=p(),Mo=a("p"),nb=i("The "),Gi=a("a"),ab=i("MBartForSequenceClassification"),sb=i(" forward method, overrides the "),Vl=a("code"),rb=i("__call__"),ib=i(" special method."),db=p(),y(wn.$$.fragment),lb=p(),y($n.$$.fragment),cb=p(),y(xn.$$.fragment),Vp=p(),zo=a("h2"),Mn=a("a"),Kl=a("span"),y(rr.$$.fragment),pb=p(),Jl=a("span"),ub=i("MBartForCausalLM"),Kp=p(),Fo=a("div"),y(ir.$$.fragment),hb=p(),zn=a("div"),y(dr.$$.fragment),mb=p(),y(Fn.$$.fragment),Jp=p(),qo=a("h2"),qn=a("a"),Zl=a("span"),y(lr.$$.fragment),fb=p(),Yl=a("span"),_b=i("TFMBartModel"),Zp=p(),Be=a("div"),y(cr.$$.fragment),gb=p(),pr=a("p"),kb=i(`The bare MBART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Wi=a("a"),bb=i("TFPreTrainedModel"),yb=i(`. 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.)`),vb=p(),ur=a("p"),Tb=i("This model is also a "),hr=a("a"),wb=i("tf.keras.Model"),$b=i(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),xb=p(),y(Bn.$$.fragment),Mb=p(),dt=a("div"),y(mr.$$.fragment),zb=p(),Bo=a("p"),Fb=i("The "),Ri=a("a"),qb=i("TFMBartModel"),Bb=i(" forward method, overrides the "),ec=a("code"),jb=i("__call__"),Eb=i(" special method."),Cb=p(),y(jn.$$.fragment),Ab=p(),y(En.$$.fragment),Yp=p(),jo=a("h2"),Cn=a("a"),tc=a("span"),y(fr.$$.fragment),Pb=p(),oc=a("span"),Sb=i("TFMBartForConditionalGeneration"),eu=p(),je=a("div"),y(_r.$$.fragment),Ob=p(),gr=a("p"),Ib=i(`The MBART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Ui=a("a"),Nb=i("TFPreTrainedModel"),Db=i(`. 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.)`),Lb=p(),kr=a("p"),Gb=i("This model is also a "),br=a("a"),Wb=i("tf.keras.Model"),Rb=i(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Ub=p(),y(An.$$.fragment),Xb=p(),Oe=a("div"),y(yr.$$.fragment),Qb=p(),Eo=a("p"),Hb=i("The "),Xi=a("a"),Vb=i("TFMBartForConditionalGeneration"),Kb=i(" forward method, overrides the "),nc=a("code"),Jb=i("__call__"),Zb=i(" special method."),Yb=p(),y(Pn.$$.fragment),ey=p(),y(Sn.$$.fragment),ty=p(),y(On.$$.fragment),tu=p(),Co=a("h2"),In=a("a"),ac=a("span"),y(vr.$$.fragment),oy=p(),sc=a("span"),ny=i("FlaxMBartModel"),ou=p(),Q=a("div"),y(Tr.$$.fragment),ay=p(),wr=a("p"),sy=i(`The bare MBart Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Qi=a("a"),ry=i("FlaxPreTrainedModel"),iy=i(`. 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.)`),dy=p(),$r=a("p"),ly=i(`This model is also a Flax Linen
`),xr=a("a"),cy=i("flax.nn.Module"),py=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),uy=p(),rc=a("p"),hy=i("Finally, this model supports inherent JAX features such as:"),my=p(),At=a("ul"),ic=a("li"),Mr=a("a"),fy=i("Just-In-Time (JIT) compilation"),_y=p(),dc=a("li"),zr=a("a"),gy=i("Automatic Differentiation"),ky=p(),lc=a("li"),Fr=a("a"),by=i("Vectorization"),yy=p(),cc=a("li"),qr=a("a"),vy=i("Parallelization"),Ty=p(),lt=a("div"),y(Br.$$.fragment),wy=p(),Ao=a("p"),$y=i("The "),pc=a("code"),xy=i("FlaxMBartPreTrainedModel"),My=i(" forward method, overrides the "),uc=a("code"),zy=i("__call__"),Fy=i(" special method."),qy=p(),y(Nn.$$.fragment),By=p(),y(Dn.$$.fragment),jy=p(),Ln=a("div"),y(jr.$$.fragment),Ey=p(),y(Gn.$$.fragment),Cy=p(),Wn=a("div"),y(Er.$$.fragment),Ay=p(),y(Rn.$$.fragment),nu=p(),Po=a("h2"),Un=a("a"),hc=a("span"),y(Cr.$$.fragment),Py=p(),mc=a("span"),Sy=i("FlaxMBartForConditionalGeneration"),au=p(),H=a("div"),y(Ar.$$.fragment),Oy=p(),Pr=a("p"),Iy=i(`The MMBart Model with a language modeling head. Can be used for summarization.
This model inherits from `),Hi=a("a"),Ny=i("FlaxPreTrainedModel"),Dy=i(`. 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.)`),Ly=p(),Sr=a("p"),Gy=i(`This model is also a Flax Linen
`),Or=a("a"),Wy=i("flax.nn.Module"),Ry=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Uy=p(),fc=a("p"),Xy=i("Finally, this model supports inherent JAX features such as:"),Qy=p(),Pt=a("ul"),_c=a("li"),Ir=a("a"),Hy=i("Just-In-Time (JIT) compilation"),Vy=p(),gc=a("li"),Nr=a("a"),Ky=i("Automatic Differentiation"),Jy=p(),kc=a("li"),Dr=a("a"),Zy=i("Vectorization"),Yy=p(),bc=a("li"),Lr=a("a"),ev=i("Parallelization"),tv=p(),Ie=a("div"),y(Gr.$$.fragment),ov=p(),So=a("p"),nv=i("The "),yc=a("code"),av=i("FlaxMBartPreTrainedModel"),sv=i(" forward method, overrides the "),vc=a("code"),rv=i("__call__"),iv=i(" special method."),dv=p(),y(Xn.$$.fragment),lv=p(),y(Qn.$$.fragment),cv=p(),y(Hn.$$.fragment),pv=p(),Vn=a("div"),y(Wr.$$.fragment),uv=p(),y(Kn.$$.fragment),hv=p(),Jn=a("div"),y(Rr.$$.fragment),mv=p(),y(Zn.$$.fragment),su=p(),Oo=a("h2"),Yn=a("a"),Tc=a("span"),y(Ur.$$.fragment),fv=p(),wc=a("span"),_v=i("FlaxMBartForSequenceClassification"),ru=p(),G=a("div"),y(Xr.$$.fragment),gv=p(),$c=a("p"),kv=i(`MBart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),bv=p(),Qr=a("p"),yv=i("This model inherits from "),Vi=a("a"),vv=i("FlaxPreTrainedModel"),Tv=i(`. 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.)`),wv=p(),Hr=a("p"),$v=i(`This model is also a Flax Linen
`),Vr=a("a"),xv=i("flax.nn.Module"),Mv=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),zv=p(),xc=a("p"),Fv=i("Finally, this model supports inherent JAX features such as:"),qv=p(),St=a("ul"),Mc=a("li"),Kr=a("a"),Bv=i("Just-In-Time (JIT) compilation"),jv=p(),zc=a("li"),Jr=a("a"),Ev=i("Automatic Differentiation"),Cv=p(),Fc=a("li"),Zr=a("a"),Av=i("Vectorization"),Pv=p(),qc=a("li"),Yr=a("a"),Sv=i("Parallelization"),Ov=p(),ct=a("div"),y(ei.$$.fragment),Iv=p(),Io=a("p"),Nv=i("The "),Bc=a("code"),Dv=i("FlaxMBartPreTrainedModel"),Lv=i(" forward method, overrides the "),jc=a("code"),Gv=i("__call__"),Wv=i(" special method."),Rv=p(),y(ea.$$.fragment),Uv=p(),y(ta.$$.fragment),Xv=p(),oa=a("div"),y(ti.$$.fragment),Qv=p(),y(na.$$.fragment),Hv=p(),aa=a("div"),y(oi.$$.fragment),Vv=p(),y(sa.$$.fragment),iu=p(),No=a("h2"),ra=a("a"),Ec=a("span"),y(ni.$$.fragment),Kv=p(),Cc=a("span"),Jv=i("FlaxMBartForQuestionAnswering"),du=p(),W=a("div"),y(ai.$$.fragment),Zv=p(),Do=a("p"),Yv=i(`MBart Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),Ac=a("code"),eT=i("span start logits"),tT=i(" and "),Pc=a("code"),oT=i("span end logits"),nT=i(")."),aT=p(),si=a("p"),sT=i("This model inherits from "),Ki=a("a"),rT=i("FlaxPreTrainedModel"),iT=i(`. 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.)`),dT=p(),ri=a("p"),lT=i(`This model is also a Flax Linen
`),ii=a("a"),cT=i("flax.nn.Module"),pT=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),uT=p(),Sc=a("p"),hT=i("Finally, this model supports inherent JAX features such as:"),mT=p(),Ot=a("ul"),Oc=a("li"),di=a("a"),fT=i("Just-In-Time (JIT) compilation"),_T=p(),Ic=a("li"),li=a("a"),gT=i("Automatic Differentiation"),kT=p(),Nc=a("li"),ci=a("a"),bT=i("Vectorization"),yT=p(),Dc=a("li"),pi=a("a"),vT=i("Parallelization"),TT=p(),pt=a("div"),y(ui.$$.fragment),wT=p(),Lo=a("p"),$T=i("The "),Lc=a("code"),xT=i("FlaxMBartPreTrainedModel"),MT=i(" forward method, overrides the "),Gc=a("code"),zT=i("__call__"),FT=i(" special method."),qT=p(),y(ia.$$.fragment),BT=p(),y(da.$$.fragment),jT=p(),la=a("div"),y(hi.$$.fragment),ET=p(),y(ca.$$.fragment),CT=p(),pa=a("div"),y(mi.$$.fragment),AT=p(),y(ua.$$.fragment),this.h()},l(o){const _=jM('[data-svelte="svelte-1phssyn"]',document.head);l=s(_,"META",{name:!0,content:!0}),_.forEach(t),b=u(o),f=s(o,"H1",{class:!0});var fi=r(f);h=s(fi,"A",{id:!0,class:!0,href:!0});var Wc=r(h);g=s(Wc,"SPAN",{});var Rc=r(g);v(n.$$.fragment,Rc),Rc.forEach(t),Wc.forEach(t),c=u(fi),q=s(fi,"SPAN",{});var Uc=r(q);ft=d(Uc,"MBart and MBart-50"),Uc.forEach(t),fi.forEach(t),Ye=u(o),U=s(o,"P",{});var ha=r(U);De=s(ha,"STRONG",{});var Xc=r(De);Le=d(Xc,"DISCLAIMER:"),Xc.forEach(t),B=d(ha," If you see something strange, file a "),be=s(ha,"A",{href:!0,rel:!0});var Qc=r(be);ye=d(Qc,"Github Issue"),Qc.forEach(t),_t=d(ha,` and assign
@patrickvonplaten`),ha.forEach(t),et=u(o),X=s(o,"H2",{class:!0});var _i=r(X);pe=s(_i,"A",{id:!0,class:!0,href:!0});var Hc=r(pe);Ge=s(Hc,"SPAN",{});var Vc=r(Ge);v(K.$$.fragment,Vc),Vc.forEach(t),Hc.forEach(t),gt=u(_i),We=s(_i,"SPAN",{});var Kc=r(We);ve=d(Kc,"Overview of MBart"),Kc.forEach(t),_i.forEach(t),tt=u(o),ue=s(o,"P",{});var gi=r(ue);Te=d(gi,"The MBart model was presented in "),we=s(gi,"A",{href:!0,rel:!0});var Jc=r(we);kt=d(Jc,"Multilingual Denoising Pre-training for Neural Machine Translation"),Jc.forEach(t),Re=d(gi,` by Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov Marjan
Ghazvininejad, Mike Lewis, Luke Zettlemoyer.`),gi.forEach(t),S=u(o),I=s(o,"P",{});var Zc=r(I);bt=d(Zc,`According to the abstract, MBART is a sequence-to-sequence denoising auto-encoder pretrained on large-scale monolingual
corpora in many languages using the BART objective. mBART is one of the first methods for pretraining a complete
sequence-to-sequence model by denoising full texts in multiple languages, while previous approaches have focused only
on the encoder, decoder, or reconstructing parts of the text.`),Zc.forEach(t),he=u(o),re=s(o,"P",{});var ma=r(re);yt=d(ma,"This model was contributed by "),J=s(ma,"A",{href:!0,rel:!0});var Yc=r(J);vt=d(Yc,"valhalla"),Yc.forEach(t),Tt=d(ma,". The Authors\u2019 code can be found "),O=s(ma,"A",{href:!0,rel:!0});var ep=r(O);wt=d(ep,"here"),ep.forEach(t),ma.forEach(t),me=u(o),ie=s(o,"H3",{class:!0});var ki=r(ie);fe=s(ki,"A",{id:!0,class:!0,href:!0});var tp=r(fe);de=s(tp,"SPAN",{});var op=r(de);v($e.$$.fragment,op),op.forEach(t),tp.forEach(t),$t=u(ki),Z=s(ki,"SPAN",{});var np=r(Z);xt=d(np,"Training of MBart"),np.forEach(t),ki.forEach(t),_e=u(o),R=s(o,"P",{});var Ze=r(R);Ue=d(Ze,`MBart is a multilingual encoder-decoder (sequence-to-sequence) model primarily intended for translation task. As the
model is multilingual it expects the sequences in a different format. A special language id token is added in both the
source and target text. The source text format is `),N=s(Ze,"CODE",{});var ap=r(N);Mt=d(ap,"X [eos, src_lang_code]"),ap.forEach(t),Y=d(Ze," where "),Xe=s(Ze,"CODE",{});var sp=r(Xe);zt=d(sp,"X"),sp.forEach(t),z=d(Ze,` is the source text. The
target text format is `),j=s(Ze,"CODE",{});var rp=r(j);Jt=d(rp,"[tgt_lang_code] X [eos]"),rp.forEach(t),Qe=d(Ze,". "),Ft=s(Ze,"CODE",{});var ip=r(Ft);Zt=d(ip,"bos"),ip.forEach(t),C=d(Ze," is never used."),Ze.forEach(t),Nt=u(o),te=s(o,"P",{});var It=r(te);Yt=d(It,"The regular "),He=s(It,"A",{href:!0});var Ji=r(He);qt=s(Ji,"STRONG",{});var dp=r(qt);le=d(dp,"call"),dp.forEach(t),xe=d(Ji,"()"),Ji.forEach(t),eo=d(It," will encode source text format passed as first argument or with the "),Bt=s(It,"CODE",{});var lp=r(Bt);Me=d(lp,"text"),lp.forEach(t),to=d(It,`
keyword, and target text format passed with the `),jt=s(It,"CODE",{});var cp=r(jt);Et=d(cp,"text_label"),cp.forEach(t),oo=d(It," keyword argument."),It.forEach(t),Ee=u(o),ot=s(o,"UL",{});var pp=r(ot);gd=s(pp,"LI",{});var up=r(gd);Ph=d(up,"Supervised training"),up.forEach(t),pp.forEach(t),gp=u(o),v(Ea.$$.fragment,o),kp=u(o),vi=s(o,"UL",{});var hp=r(vi);Ca=s(hp,"LI",{});var bi=r(Ca);kd=s(bi,"P",{});var mp=r(kd);Sh=d(mp,"Generation"),mp.forEach(t),Oh=u(bi),no=s(bi,"P",{});var Go=r(no);Ih=d(Go,"While generating the target text set the "),bd=s(Go,"CODE",{});var fp=r(bd);Nh=d(fp,"decoder_start_token_id"),fp.forEach(t),Dh=d(Go,` to the target language id. The following
example shows how to translate English to Romanian using the `),yd=s(Go,"EM",{});var _p=r(yd);Lh=d(_p,"facebook/mbart-large-en-ro"),_p.forEach(t),Gh=d(Go," model."),Go.forEach(t),bi.forEach(t),hp.forEach(t),bp=u(o),v(Aa.$$.fragment,o),yp=u(o),ao=s(o,"H2",{class:!0});var yi=r(ao);Wo=s(yi,"A",{id:!0,class:!0,href:!0});var PT=r(Wo);vd=s(PT,"SPAN",{});var ST=r(vd);v(Pa.$$.fragment,ST),ST.forEach(t),PT.forEach(t),Wh=u(yi),Td=s(yi,"SPAN",{});var OT=r(Td);Rh=d(OT,"Overview of MBart-50"),OT.forEach(t),yi.forEach(t),vp=u(o),Dt=s(o,"P",{});var Zi=r(Dt);Uh=d(Zi,"MBart-50 was introduced in the "),Sa=s(Zi,"A",{href:!0,rel:!0});var IT=r(Sa);Xh=d(IT,"Multilingual Translation with Extensible Multilingual Pretraining and Finetuning"),IT.forEach(t),Qh=d(Zi,` paper by Yuqing Tang, Chau Tran, Xian Li, Peng-Jen Chen, Naman Goyal, Vishrav
Chaudhary, Jiatao Gu, Angela Fan. MBart-50 is created using the original `),wd=s(Zi,"EM",{});var NT=r(wd);Hh=d(NT,"mbart-large-cc25"),NT.forEach(t),Vh=d(Zi,` checkpoint by extendeding
its embedding layers with randomly initialized vectors for an extra set of 25 language tokens and then pretrained on 50
languages.`),Zi.forEach(t),Tp=u(o),Ti=s(o,"P",{});var DT=r(Ti);Kh=d(DT,"According to the abstract"),DT.forEach(t),wp=u(o),wi=s(o,"P",{});var LT=r(wi);$d=s(LT,"EM",{});var GT=r($d);Jh=d(GT,`Multilingual translation models can be created through multilingual finetuning. Instead of finetuning on one
direction, a pretrained model is finetuned on many directions at the same time. It demonstrates that pretrained models
can be extended to incorporate additional languages without loss of performance. Multilingual finetuning improves on
average 1 BLEU over the strongest baselines (being either multilingual from scratch or bilingual finetuning) while
improving 9.3 BLEU on average over bilingual baselines from scratch.`),GT.forEach(t),LT.forEach(t),$p=u(o),so=s(o,"H3",{class:!0});var cu=r(so);Ro=s(cu,"A",{id:!0,class:!0,href:!0});var WT=r(Ro);xd=s(WT,"SPAN",{});var RT=r(xd);v(Oa.$$.fragment,RT),RT.forEach(t),WT.forEach(t),Zh=u(cu),Md=s(cu,"SPAN",{});var UT=r(Md);Yh=d(UT,"Training of MBart-50"),UT.forEach(t),cu.forEach(t),xp=u(o),nt=s(o,"P",{});var fa=r(nt);em=d(fa,`The text format for MBart-50 is slightly different from mBART. For MBart-50 the language id token is used as a prefix
for both source and target text i.e the text format is `),zd=s(fa,"CODE",{});var XT=r(zd);tm=d(XT,"[lang_code] X [eos]"),XT.forEach(t),om=d(fa,", where "),Fd=s(fa,"CODE",{});var QT=r(Fd);nm=d(QT,"lang_code"),QT.forEach(t),am=d(fa,` is source
language id for source text and target language id for target text, with `),qd=s(fa,"CODE",{});var HT=r(qd);sm=d(HT,"X"),HT.forEach(t),rm=d(fa,` being the source or target text
respectively.`),fa.forEach(t),Mp=u(o),Uo=s(o,"P",{});var pu=r(Uo);im=d(pu,"MBart-50 has its own tokenizer "),$i=s(pu,"A",{href:!0});var VT=r($i);dm=d(VT,"MBart50Tokenizer"),VT.forEach(t),lm=d(pu,"."),pu.forEach(t),zp=u(o),xi=s(o,"UL",{});var KT=r(xi);Bd=s(KT,"LI",{});var JT=r(Bd);cm=d(JT,"Supervised training"),JT.forEach(t),KT.forEach(t),Fp=u(o),v(Ia.$$.fragment,o),qp=u(o),Mi=s(o,"UL",{});var ZT=r(Mi);Na=s(ZT,"LI",{});var uu=r(Na);jd=s(uu,"P",{});var YT=r(jd);pm=d(YT,"Generation"),YT.forEach(t),um=u(uu),ze=s(uu,"P",{});var ut=r(ze);hm=d(ut,"To generate using the mBART-50 multilingual translation models, "),Ed=s(ut,"CODE",{});var ew=r(Ed);mm=d(ew,"eos_token_id"),ew.forEach(t),fm=d(ut,` is used as the
`),Cd=s(ut,"CODE",{});var tw=r(Cd);_m=d(tw,"decoder_start_token_id"),tw.forEach(t),gm=d(ut,` and the target language id is forced as the first generated token. To force the
target language id as the first generated token, pass the `),Ad=s(ut,"EM",{});var ow=r(Ad);km=d(ow,"forced_bos_token_id"),ow.forEach(t),bm=d(ut," parameter to the "),Pd=s(ut,"EM",{});var nw=r(Pd);ym=d(nw,"generate"),nw.forEach(t),vm=d(ut,` method.
The following example shows how to translate between Hindi to French and Arabic to English using the
`),Sd=s(ut,"EM",{});var aw=r(Sd);Tm=d(aw,"facebook/mbart-50-large-many-to-many"),aw.forEach(t),wm=d(ut," checkpoint."),ut.forEach(t),uu.forEach(t),ZT.forEach(t),Bp=u(o),v(Da.$$.fragment,o),jp=u(o),ro=s(o,"H2",{class:!0});var hu=r(ro);Xo=s(hu,"A",{id:!0,class:!0,href:!0});var sw=r(Xo);Od=s(sw,"SPAN",{});var rw=r(Od);v(La.$$.fragment,rw),rw.forEach(t),sw.forEach(t),$m=u(hu),Id=s(hu,"SPAN",{});var iw=r(Id);xm=d(iw,"MBartConfig"),iw.forEach(t),hu.forEach(t),Ep=u(o),Ve=s(o,"DIV",{class:!0});var _a=r(Ve);v(Ga.$$.fragment,_a),Mm=u(_a),io=s(_a,"P",{});var Yi=r(io);zm=d(Yi,"This is the configuration class to store the configuration of a "),zi=s(Yi,"A",{href:!0});var dw=r(zi);Fm=d(dw,"MBartModel"),dw.forEach(t),qm=d(Yi,`. It is used to instantiate an MBART
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 MBART
`),Wa=s(Yi,"A",{href:!0,rel:!0});var lw=r(Wa);Bm=d(lw,"facebook/mbart-large-cc25"),lw.forEach(t),jm=d(Yi," architecture."),Yi.forEach(t),Em=u(_a),lo=s(_a,"P",{});var ed=r(lo);Cm=d(ed,"Configuration objects inherit from "),Fi=s(ed,"A",{href:!0});var cw=r(Fi);Am=d(cw,"PretrainedConfig"),cw.forEach(t),Pm=d(ed,` and can be used to control the model outputs. Read the
documentation from `),qi=s(ed,"A",{href:!0});var pw=r(qi);Sm=d(pw,"PretrainedConfig"),pw.forEach(t),Om=d(ed," for more information."),ed.forEach(t),Im=u(_a),v(Qo.$$.fragment,_a),_a.forEach(t),Cp=u(o),co=s(o,"H2",{class:!0});var mu=r(co);Ho=s(mu,"A",{id:!0,class:!0,href:!0});var uw=r(Ho);Nd=s(uw,"SPAN",{});var hw=r(Nd);v(Ra.$$.fragment,hw),hw.forEach(t),uw.forEach(t),Nm=u(mu),Dd=s(mu,"SPAN",{});var mw=r(Dd);Dm=d(mw,"MBartTokenizer"),mw.forEach(t),mu.forEach(t),Ap=u(o),ce=s(o,"DIV",{class:!0});var ht=r(ce);v(Ua.$$.fragment,ht),Lm=u(ht),Ld=s(ht,"P",{});var fw=r(Ld);Gm=d(fw,"Construct an MBART tokenizer."),fw.forEach(t),Wm=u(ht),Ct=s(ht,"P",{});var ga=r(Ct);Rm=d(ga,"Adapted from "),Bi=s(ga,"A",{href:!0});var _w=r(Bi);Um=d(_w,"RobertaTokenizer"),_w.forEach(t),Xm=d(ga," and "),ji=s(ga,"A",{href:!0});var gw=r(ji);Qm=d(gw,"XLNetTokenizer"),gw.forEach(t),Hm=d(ga,`. Based on
`),Xa=s(ga,"A",{href:!0,rel:!0});var kw=r(Xa);Vm=d(kw,"SentencePiece"),kw.forEach(t),Km=d(ga,"."),ga.forEach(t),Jm=u(ht),po=s(ht,"P",{});var td=r(po);Zm=d(td,"The tokenization method is "),Gd=s(td,"CODE",{});var bw=r(Gd);Ym=d(bw,"<tokens> <eos> <language code>"),bw.forEach(t),ef=d(td," for source language documents, and "),Wd=s(td,"CODE",{});var yw=r(Wd);tf=d(yw,"<language code> <tokens> <eos>"),yw.forEach(t),of=d(td," for target language documents."),td.forEach(t),nf=u(ht),v(Vo.$$.fragment,ht),af=u(ht),at=s(ht,"DIV",{class:!0});var ka=r(at);v(Qa.$$.fragment,ka),sf=u(ka),Ha=s(ka,"P",{});var fu=r(Ha);rf=d(fu,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An MBART sequence has the following format, where `),Rd=s(fu,"CODE",{});var vw=r(Rd);df=d(vw,"X"),vw.forEach(t),lf=d(fu," represents the sequence:"),fu.forEach(t),cf=u(ka),Va=s(ka,"UL",{});var _u=r(Va);Ka=s(_u,"LI",{});var gu=r(Ka);Ud=s(gu,"CODE",{});var Tw=r(Ud);pf=d(Tw,"input_ids"),Tw.forEach(t),uf=d(gu," (for encoder) "),Xd=s(gu,"CODE",{});var ww=r(Xd);hf=d(ww,"X [eos, src_lang_code]"),ww.forEach(t),gu.forEach(t),mf=u(_u),Ja=s(_u,"LI",{});var ku=r(Ja);Qd=s(ku,"CODE",{});var $w=r(Qd);ff=d($w,"decoder_input_ids"),$w.forEach(t),_f=d(ku,": (for decoder) "),Hd=s(ku,"CODE",{});var xw=r(Hd);gf=d(xw,"X [eos, tgt_lang_code]"),xw.forEach(t),ku.forEach(t),_u.forEach(t),kf=u(ka),Vd=s(ka,"P",{});var Mw=r(Vd);bf=d(Mw,`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),Mw.forEach(t),ka.forEach(t),ht.forEach(t),Pp=u(o),uo=s(o,"H2",{class:!0});var bu=r(uo);Ko=s(bu,"A",{id:!0,class:!0,href:!0});var zw=r(Ko);Kd=s(zw,"SPAN",{});var Fw=r(Kd);v(Za.$$.fragment,Fw),Fw.forEach(t),zw.forEach(t),yf=u(bu),Jd=s(bu,"SPAN",{});var qw=r(Jd);vf=d(qw,"MBartTokenizerFast"),qw.forEach(t),bu.forEach(t),Sp=u(o),D=s(o,"DIV",{class:!0});var oe=r(D);v(Ya.$$.fragment,oe),Tf=u(oe),ho=s(oe,"P",{});var od=r(ho);wf=d(od,"Construct a \u201Cfast\u201D MBART tokenizer (backed by HuggingFace\u2019s "),Zd=s(od,"EM",{});var Bw=r(Zd);$f=d(Bw,"tokenizers"),Bw.forEach(t),xf=d(od,` library). Based on
`),es=s(od,"A",{href:!0,rel:!0});var jw=r(es);Mf=d(jw,"BPE"),jw.forEach(t),zf=d(od,"."),od.forEach(t),Ff=u(oe),ts=s(oe,"P",{});var yu=r(ts);qf=d(yu,"This tokenizer inherits from "),Ei=s(yu,"A",{href:!0});var Ew=r(Ei);Bf=d(Ew,"PreTrainedTokenizerFast"),Ew.forEach(t),jf=d(yu,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),yu.forEach(t),Ef=u(oe),mo=s(oe,"P",{});var nd=r(mo);Cf=d(nd,"The tokenization method is "),Yd=s(nd,"CODE",{});var Cw=r(Yd);Af=d(Cw,"<tokens> <eos> <language code>"),Cw.forEach(t),Pf=d(nd," for source language documents, and "),el=s(nd,"CODE",{});var Aw=r(el);Sf=d(Aw,"<language code> <tokens> <eos>"),Aw.forEach(t),Of=d(nd," for target language documents."),nd.forEach(t),If=u(oe),v(Jo.$$.fragment,oe),Nf=u(oe),Ce=s(oe,"DIV",{class:!0});var Lt=r(Ce);v(os.$$.fragment,Lt),Df=u(Lt),tl=s(Lt,"P",{});var Pw=r(tl);Lf=d(Pw,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. The special tokens depend on calling set_lang.`),Pw.forEach(t),Gf=u(Lt),ns=s(Lt,"P",{});var vu=r(ns);Wf=d(vu,"An MBART sequence has the following format, where "),ol=s(vu,"CODE",{});var Sw=r(ol);Rf=d(Sw,"X"),Sw.forEach(t),Uf=d(vu," represents the sequence:"),vu.forEach(t),Xf=u(Lt),as=s(Lt,"UL",{});var Tu=r(as);ss=s(Tu,"LI",{});var wu=r(ss);nl=s(wu,"CODE",{});var Ow=r(nl);Qf=d(Ow,"input_ids"),Ow.forEach(t),Hf=d(wu," (for encoder) "),al=s(wu,"CODE",{});var Iw=r(al);Vf=d(Iw,"X [eos, src_lang_code]"),Iw.forEach(t),wu.forEach(t),Kf=u(Tu),rs=s(Tu,"LI",{});var $u=r(rs);sl=s($u,"CODE",{});var Nw=r(sl);Jf=d(Nw,"decoder_input_ids"),Nw.forEach(t),Zf=d($u,": (for decoder) "),rl=s($u,"CODE",{});var Dw=r(rl);Yf=d(Dw,"X [eos, tgt_lang_code]"),Dw.forEach(t),$u.forEach(t),Tu.forEach(t),e_=u(Lt),il=s(Lt,"P",{});var Lw=r(il);t_=d(Lw,`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),Lw.forEach(t),Lt.forEach(t),o_=u(oe),Zo=s(oe,"DIV",{class:!0});var xu=r(Zo);v(is.$$.fragment,xu),n_=u(xu),dl=s(xu,"P",{});var Gw=r(dl);a_=d(Gw,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. mBART does not
make use of token type ids, therefore a list of zeros is returned.`),Gw.forEach(t),xu.forEach(t),s_=u(oe),Yo=s(oe,"DIV",{class:!0});var Mu=r(Yo);v(ds.$$.fragment,Mu),r_=u(Mu),ll=s(Mu,"P",{});var Ww=r(ll);i_=d(Ww,"Reset the special tokens to the source lang setting. No prefix and suffix=[eos, src_lang_code]."),Ww.forEach(t),Mu.forEach(t),d_=u(oe),en=s(oe,"DIV",{class:!0});var zu=r(en);v(ls.$$.fragment,zu),l_=u(zu),cl=s(zu,"P",{});var Rw=r(cl);c_=d(Rw,"Reset the special tokens to the target language setting. No prefix and suffix=[eos, tgt_lang_code]."),Rw.forEach(t),zu.forEach(t),oe.forEach(t),Op=u(o),fo=s(o,"H2",{class:!0});var Fu=r(fo);tn=s(Fu,"A",{id:!0,class:!0,href:!0});var Uw=r(tn);pl=s(Uw,"SPAN",{});var Xw=r(pl);v(cs.$$.fragment,Xw),Xw.forEach(t),Uw.forEach(t),p_=u(Fu),ul=s(Fu,"SPAN",{});var Qw=r(ul);u_=d(Qw,"MBart50Tokenizer"),Qw.forEach(t),Fu.forEach(t),Ip=u(o),L=s(o,"DIV",{class:!0});var ne=r(L);v(ps.$$.fragment,ne),h_=u(ne),us=s(ne,"P",{});var qu=r(us);m_=d(qu,"Construct a MBart50 tokenizer. Based on "),hs=s(qu,"A",{href:!0,rel:!0});var Hw=r(hs);f_=d(Hw,"SentencePiece"),Hw.forEach(t),__=d(qu,"."),qu.forEach(t),g_=u(ne),ms=s(ne,"P",{});var Bu=r(ms);k_=d(Bu,"This tokenizer inherits from "),Ci=s(Bu,"A",{href:!0});var Vw=r(Ci);b_=d(Vw,"PreTrainedTokenizer"),Vw.forEach(t),y_=d(Bu,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Bu.forEach(t),v_=u(ne),v(on.$$.fragment,ne),T_=u(ne),st=s(ne,"DIV",{class:!0});var ba=r(st);v(fs.$$.fragment,ba),w_=u(ba),_s=s(ba,"P",{});var ju=r(_s);$_=d(ju,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An MBART-50 sequence has the following format, where `),hl=s(ju,"CODE",{});var Kw=r(hl);x_=d(Kw,"X"),Kw.forEach(t),M_=d(ju," represents the sequence:"),ju.forEach(t),z_=u(ba),gs=s(ba,"UL",{});var Eu=r(gs);ks=s(Eu,"LI",{});var Cu=r(ks);ml=s(Cu,"CODE",{});var Jw=r(ml);F_=d(Jw,"input_ids"),Jw.forEach(t),q_=d(Cu," (for encoder) "),fl=s(Cu,"CODE",{});var Zw=r(fl);B_=d(Zw,"[src_lang_code] X [eos]"),Zw.forEach(t),Cu.forEach(t),j_=u(Eu),bs=s(Eu,"LI",{});var Au=r(bs);_l=s(Au,"CODE",{});var Yw=r(_l);E_=d(Yw,"labels"),Yw.forEach(t),C_=d(Au,": (for decoder) "),gl=s(Au,"CODE",{});var e$=r(gl);A_=d(e$,"[tgt_lang_code] X [eos]"),e$.forEach(t),Au.forEach(t),Eu.forEach(t),P_=u(ba),kl=s(ba,"P",{});var t$=r(kl);S_=d(t$,`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),t$.forEach(t),ba.forEach(t),O_=u(ne),nn=s(ne,"DIV",{class:!0});var Pu=r(nn);v(ys.$$.fragment,Pu),I_=u(Pu),bl=s(Pu,"P",{});var o$=r(bl);N_=d(o$,"Converts a sequence of tokens (string) in a single string."),o$.forEach(t),Pu.forEach(t),D_=u(ne),an=s(ne,"DIV",{class:!0});var Su=r(an);v(vs.$$.fragment,Su),L_=u(Su),Ts=s(Su,"P",{});var Ou=r(Ts);G_=d(Ou,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),yl=s(Ou,"CODE",{});var n$=r(yl);W_=d(n$,"prepare_for_model"),n$.forEach(t),R_=d(Ou," method."),Ou.forEach(t),Su.forEach(t),U_=u(ne),sn=s(ne,"DIV",{class:!0});var Iu=r(sn);v(ws.$$.fragment,Iu),X_=u(Iu),vl=s(Iu,"P",{});var a$=r(vl);Q_=d(a$,"Reset the special tokens to the source lang setting. prefix=[src_lang_code] and suffix=[eos]."),a$.forEach(t),Iu.forEach(t),H_=u(ne),rn=s(ne,"DIV",{class:!0});var Nu=r(rn);v($s.$$.fragment,Nu),V_=u(Nu),Tl=s(Nu,"P",{});var s$=r(Tl);K_=d(s$,"Reset the special tokens to the target language setting. prefix=[tgt_lang_code] and suffix=[eos]."),s$.forEach(t),Nu.forEach(t),ne.forEach(t),Np=u(o),_o=s(o,"H2",{class:!0});var Du=r(_o);dn=s(Du,"A",{id:!0,class:!0,href:!0});var r$=r(dn);wl=s(r$,"SPAN",{});var i$=r(wl);v(xs.$$.fragment,i$),i$.forEach(t),r$.forEach(t),J_=u(Du),$l=s(Du,"SPAN",{});var d$=r($l);Z_=d(d$,"MBart50TokenizerFast"),d$.forEach(t),Du.forEach(t),Dp=u(o),ee=s(o,"DIV",{class:!0});var Ne=r(ee);v(Ms.$$.fragment,Ne),Y_=u(Ne),go=s(Ne,"P",{});var ad=r(go);eg=d(ad,"Construct a \u201Cfast\u201D MBART tokenizer for mBART-50 (backed by HuggingFace\u2019s "),xl=s(ad,"EM",{});var l$=r(xl);tg=d(l$,"tokenizers"),l$.forEach(t),og=d(ad,` library). Based on
`),zs=s(ad,"A",{href:!0,rel:!0});var c$=r(zs);ng=d(c$,"BPE"),c$.forEach(t),ag=d(ad,"."),ad.forEach(t),sg=u(Ne),Fs=s(Ne,"P",{});var Lu=r(Fs);rg=d(Lu,"This tokenizer inherits from "),Ai=s(Lu,"A",{href:!0});var p$=r(Ai);ig=d(p$,"PreTrainedTokenizerFast"),p$.forEach(t),dg=d(Lu,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Lu.forEach(t),lg=u(Ne),v(ln.$$.fragment,Ne),cg=u(Ne),Ae=s(Ne,"DIV",{class:!0});var Gt=r(Ae);v(qs.$$.fragment,Gt),pg=u(Gt),Ml=s(Gt,"P",{});var u$=r(Ml);ug=d(u$,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. The special tokens depend on calling set_lang.`),u$.forEach(t),hg=u(Gt),Bs=s(Gt,"P",{});var Gu=r(Bs);mg=d(Gu,"An MBART-50 sequence has the following format, where "),zl=s(Gu,"CODE",{});var h$=r(zl);fg=d(h$,"X"),h$.forEach(t),_g=d(Gu," represents the sequence:"),Gu.forEach(t),gg=u(Gt),js=s(Gt,"UL",{});var Wu=r(js);Es=s(Wu,"LI",{});var Ru=r(Es);Fl=s(Ru,"CODE",{});var m$=r(Fl);kg=d(m$,"input_ids"),m$.forEach(t),bg=d(Ru," (for encoder) "),ql=s(Ru,"CODE",{});var f$=r(ql);yg=d(f$,"[src_lang_code] X [eos]"),f$.forEach(t),Ru.forEach(t),vg=u(Wu),Cs=s(Wu,"LI",{});var Uu=r(Cs);Bl=s(Uu,"CODE",{});var _$=r(Bl);Tg=d(_$,"labels"),_$.forEach(t),wg=d(Uu,": (for decoder) "),jl=s(Uu,"CODE",{});var g$=r(jl);$g=d(g$,"[tgt_lang_code] X [eos]"),g$.forEach(t),Uu.forEach(t),Wu.forEach(t),xg=u(Gt),El=s(Gt,"P",{});var k$=r(El);Mg=d(k$,`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),k$.forEach(t),Gt.forEach(t),zg=u(Ne),cn=s(Ne,"DIV",{class:!0});var Xu=r(cn);v(As.$$.fragment,Xu),Fg=u(Xu),Cl=s(Xu,"P",{});var b$=r(Cl);qg=d(b$,"Reset the special tokens to the source lang setting. prefix=[src_lang_code] and suffix=[eos]."),b$.forEach(t),Xu.forEach(t),Bg=u(Ne),pn=s(Ne,"DIV",{class:!0});var Qu=r(pn);v(Ps.$$.fragment,Qu),jg=u(Qu),Al=s(Qu,"P",{});var y$=r(Al);Eg=d(y$,"Reset the special tokens to the target language setting. prefix=[src_lang_code] and suffix=[eos]."),y$.forEach(t),Qu.forEach(t),Ne.forEach(t),Lp=u(o),ko=s(o,"H2",{class:!0});var Hu=r(ko);un=s(Hu,"A",{id:!0,class:!0,href:!0});var v$=r(un);Pl=s(v$,"SPAN",{});var T$=r(Pl);v(Ss.$$.fragment,T$),T$.forEach(t),v$.forEach(t),Cg=u(Hu),Sl=s(Hu,"SPAN",{});var w$=r(Sl);Ag=d(w$,"MBartModel"),w$.forEach(t),Hu.forEach(t),Gp=u(o),Ke=s(o,"DIV",{class:!0});var ya=r(Ke);v(Os.$$.fragment,ya),Pg=u(ya),Is=s(ya,"P",{});var Vu=r(Is);Sg=d(Vu,`The bare MBART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Pi=s(Vu,"A",{href:!0});var $$=r(Pi);Og=d($$,"PreTrainedModel"),$$.forEach(t),Ig=d(Vu,`. 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.)`),Vu.forEach(t),Ng=u(ya),Ns=s(ya,"P",{});var Ku=r(Ns);Dg=d(Ku,"This model is also a PyTorch "),Ds=s(Ku,"A",{href:!0,rel:!0});var x$=r(Ds);Lg=d(x$,"torch.nn.Module"),x$.forEach(t),Gg=d(Ku,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ku.forEach(t),Wg=u(ya),rt=s(ya,"DIV",{class:!0});var va=r(rt);v(Ls.$$.fragment,va),Rg=u(va),bo=s(va,"P",{});var sd=r(bo);Ug=d(sd,"The "),Si=s(sd,"A",{href:!0});var M$=r(Si);Xg=d(M$,"MBartModel"),M$.forEach(t),Qg=d(sd," forward method, overrides the "),Ol=s(sd,"CODE",{});var z$=r(Ol);Hg=d(z$,"__call__"),z$.forEach(t),Vg=d(sd," special method."),sd.forEach(t),Kg=u(va),v(hn.$$.fragment,va),Jg=u(va),v(mn.$$.fragment,va),va.forEach(t),ya.forEach(t),Wp=u(o),yo=s(o,"H2",{class:!0});var Ju=r(yo);fn=s(Ju,"A",{id:!0,class:!0,href:!0});var F$=r(fn);Il=s(F$,"SPAN",{});var q$=r(Il);v(Gs.$$.fragment,q$),q$.forEach(t),F$.forEach(t),Zg=u(Ju),Nl=s(Ju,"SPAN",{});var B$=r(Nl);Yg=d(B$,"MBartForConditionalGeneration"),B$.forEach(t),Ju.forEach(t),Rp=u(o),Je=s(o,"DIV",{class:!0});var Ta=r(Je);v(Ws.$$.fragment,Ta),ek=u(Ta),Rs=s(Ta,"P",{});var Zu=r(Rs);tk=d(Zu,`The MBART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Oi=s(Zu,"A",{href:!0});var j$=r(Oi);ok=d(j$,"PreTrainedModel"),j$.forEach(t),nk=d(Zu,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zu.forEach(t),ak=u(Ta),Us=s(Ta,"P",{});var Yu=r(Us);sk=d(Yu,"This model is also a PyTorch "),Xs=s(Yu,"A",{href:!0,rel:!0});var E$=r(Xs);rk=d(E$,"torch.nn.Module"),E$.forEach(t),ik=d(Yu,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Yu.forEach(t),dk=u(Ta),Pe=s(Ta,"DIV",{class:!0});var Wt=r(Pe);v(Qs.$$.fragment,Wt),lk=u(Wt),vo=s(Wt,"P",{});var rd=r(vo);ck=d(rd,"The "),Ii=s(rd,"A",{href:!0});var C$=r(Ii);pk=d(C$,"MBartForConditionalGeneration"),C$.forEach(t),uk=d(rd," forward method, overrides the "),Dl=s(rd,"CODE",{});var A$=r(Dl);hk=d(A$,"__call__"),A$.forEach(t),mk=d(rd," special method."),rd.forEach(t),fk=u(Wt),v(_n.$$.fragment,Wt),_k=u(Wt),v(gn.$$.fragment,Wt),gk=u(Wt),v(kn.$$.fragment,Wt),Wt.forEach(t),Ta.forEach(t),Up=u(o),To=s(o,"H2",{class:!0});var eh=r(To);bn=s(eh,"A",{id:!0,class:!0,href:!0});var P$=r(bn);Ll=s(P$,"SPAN",{});var S$=r(Ll);v(Hs.$$.fragment,S$),S$.forEach(t),P$.forEach(t),kk=u(eh),Gl=s(eh,"SPAN",{});var O$=r(Gl);bk=d(O$,"MBartForQuestionAnswering"),O$.forEach(t),eh.forEach(t),Xp=u(o),Fe=s(o,"DIV",{class:!0});var Rt=r(Fe);v(Vs.$$.fragment,Rt),yk=u(Rt),wo=s(Rt,"P",{});var id=r(wo);vk=d(id,`MBART Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),Wl=s(id,"CODE",{});var I$=r(Wl);Tk=d(I$,"span start logits"),I$.forEach(t),wk=d(id," and "),Rl=s(id,"CODE",{});var N$=r(Rl);$k=d(N$,"span end logits"),N$.forEach(t),xk=d(id,")."),id.forEach(t),Mk=u(Rt),Ks=s(Rt,"P",{});var th=r(Ks);zk=d(th,"This model inherits from "),Ni=s(th,"A",{href:!0});var D$=r(Ni);Fk=d(D$,"PreTrainedModel"),D$.forEach(t),qk=d(th,`. 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.)`),th.forEach(t),Bk=u(Rt),Js=s(Rt,"P",{});var oh=r(Js);jk=d(oh,"This model is also a PyTorch "),Zs=s(oh,"A",{href:!0,rel:!0});var L$=r(Zs);Ek=d(L$,"torch.nn.Module"),L$.forEach(t),Ck=d(oh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),oh.forEach(t),Ak=u(Rt),it=s(Rt,"DIV",{class:!0});var wa=r(it);v(Ys.$$.fragment,wa),Pk=u(wa),$o=s(wa,"P",{});var dd=r($o);Sk=d(dd,"The "),Di=s(dd,"A",{href:!0});var G$=r(Di);Ok=d(G$,"MBartForQuestionAnswering"),G$.forEach(t),Ik=d(dd," forward method, overrides the "),Ul=s(dd,"CODE",{});var W$=r(Ul);Nk=d(W$,"__call__"),W$.forEach(t),Dk=d(dd," special method."),dd.forEach(t),Lk=u(wa),v(yn.$$.fragment,wa),Gk=u(wa),v(vn.$$.fragment,wa),wa.forEach(t),Rt.forEach(t),Qp=u(o),xo=s(o,"H2",{class:!0});var nh=r(xo);Tn=s(nh,"A",{id:!0,class:!0,href:!0});var R$=r(Tn);Xl=s(R$,"SPAN",{});var U$=r(Xl);v(er.$$.fragment,U$),U$.forEach(t),R$.forEach(t),Wk=u(nh),Ql=s(nh,"SPAN",{});var X$=r(Ql);Rk=d(X$,"MBartForSequenceClassification"),X$.forEach(t),nh.forEach(t),Hp=u(o),qe=s(o,"DIV",{class:!0});var Ut=r(qe);v(tr.$$.fragment,Ut),Uk=u(Ut),Hl=s(Ut,"P",{});var Q$=r(Hl);Xk=d(Q$,`MBart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),Q$.forEach(t),Qk=u(Ut),or=s(Ut,"P",{});var ah=r(or);Hk=d(ah,"This model inherits from "),Li=s(ah,"A",{href:!0});var H$=r(Li);Vk=d(H$,"PreTrainedModel"),H$.forEach(t),Kk=d(ah,`. 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.)`),ah.forEach(t),Jk=u(Ut),nr=s(Ut,"P",{});var sh=r(nr);Zk=d(sh,"This model is also a PyTorch "),ar=s(sh,"A",{href:!0,rel:!0});var V$=r(ar);Yk=d(V$,"torch.nn.Module"),V$.forEach(t),eb=d(sh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sh.forEach(t),tb=u(Ut),Se=s(Ut,"DIV",{class:!0});var Xt=r(Se);v(sr.$$.fragment,Xt),ob=u(Xt),Mo=s(Xt,"P",{});var ld=r(Mo);nb=d(ld,"The "),Gi=s(ld,"A",{href:!0});var K$=r(Gi);ab=d(K$,"MBartForSequenceClassification"),K$.forEach(t),sb=d(ld," forward method, overrides the "),Vl=s(ld,"CODE",{});var J$=r(Vl);rb=d(J$,"__call__"),J$.forEach(t),ib=d(ld," special method."),ld.forEach(t),db=u(Xt),v(wn.$$.fragment,Xt),lb=u(Xt),v($n.$$.fragment,Xt),cb=u(Xt),v(xn.$$.fragment,Xt),Xt.forEach(t),Ut.forEach(t),Vp=u(o),zo=s(o,"H2",{class:!0});var rh=r(zo);Mn=s(rh,"A",{id:!0,class:!0,href:!0});var Z$=r(Mn);Kl=s(Z$,"SPAN",{});var Y$=r(Kl);v(rr.$$.fragment,Y$),Y$.forEach(t),Z$.forEach(t),pb=u(rh),Jl=s(rh,"SPAN",{});var ex=r(Jl);ub=d(ex,"MBartForCausalLM"),ex.forEach(t),rh.forEach(t),Kp=u(o),Fo=s(o,"DIV",{class:!0});var ih=r(Fo);v(ir.$$.fragment,ih),hb=u(ih),zn=s(ih,"DIV",{class:!0});var dh=r(zn);v(dr.$$.fragment,dh),mb=u(dh),v(Fn.$$.fragment,dh),dh.forEach(t),ih.forEach(t),Jp=u(o),qo=s(o,"H2",{class:!0});var lh=r(qo);qn=s(lh,"A",{id:!0,class:!0,href:!0});var tx=r(qn);Zl=s(tx,"SPAN",{});var ox=r(Zl);v(lr.$$.fragment,ox),ox.forEach(t),tx.forEach(t),fb=u(lh),Yl=s(lh,"SPAN",{});var nx=r(Yl);_b=d(nx,"TFMBartModel"),nx.forEach(t),lh.forEach(t),Zp=u(o),Be=s(o,"DIV",{class:!0});var Qt=r(Be);v(cr.$$.fragment,Qt),gb=u(Qt),pr=s(Qt,"P",{});var ch=r(pr);kb=d(ch,`The bare MBART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Wi=s(ch,"A",{href:!0});var ax=r(Wi);bb=d(ax,"TFPreTrainedModel"),ax.forEach(t),yb=d(ch,`. 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.)`),ch.forEach(t),vb=u(Qt),ur=s(Qt,"P",{});var ph=r(ur);Tb=d(ph,"This model is also a "),hr=s(ph,"A",{href:!0,rel:!0});var sx=r(hr);wb=d(sx,"tf.keras.Model"),sx.forEach(t),$b=d(ph,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ph.forEach(t),xb=u(Qt),v(Bn.$$.fragment,Qt),Mb=u(Qt),dt=s(Qt,"DIV",{class:!0});var $a=r(dt);v(mr.$$.fragment,$a),zb=u($a),Bo=s($a,"P",{});var cd=r(Bo);Fb=d(cd,"The "),Ri=s(cd,"A",{href:!0});var rx=r(Ri);qb=d(rx,"TFMBartModel"),rx.forEach(t),Bb=d(cd," forward method, overrides the "),ec=s(cd,"CODE",{});var ix=r(ec);jb=d(ix,"__call__"),ix.forEach(t),Eb=d(cd," special method."),cd.forEach(t),Cb=u($a),v(jn.$$.fragment,$a),Ab=u($a),v(En.$$.fragment,$a),$a.forEach(t),Qt.forEach(t),Yp=u(o),jo=s(o,"H2",{class:!0});var uh=r(jo);Cn=s(uh,"A",{id:!0,class:!0,href:!0});var dx=r(Cn);tc=s(dx,"SPAN",{});var lx=r(tc);v(fr.$$.fragment,lx),lx.forEach(t),dx.forEach(t),Pb=u(uh),oc=s(uh,"SPAN",{});var cx=r(oc);Sb=d(cx,"TFMBartForConditionalGeneration"),cx.forEach(t),uh.forEach(t),eu=u(o),je=s(o,"DIV",{class:!0});var Ht=r(je);v(_r.$$.fragment,Ht),Ob=u(Ht),gr=s(Ht,"P",{});var hh=r(gr);Ib=d(hh,`The MBART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Ui=s(hh,"A",{href:!0});var px=r(Ui);Nb=d(px,"TFPreTrainedModel"),px.forEach(t),Db=d(hh,`. 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.)`),hh.forEach(t),Lb=u(Ht),kr=s(Ht,"P",{});var mh=r(kr);Gb=d(mh,"This model is also a "),br=s(mh,"A",{href:!0,rel:!0});var ux=r(br);Wb=d(ux,"tf.keras.Model"),ux.forEach(t),Rb=d(mh,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),mh.forEach(t),Ub=u(Ht),v(An.$$.fragment,Ht),Xb=u(Ht),Oe=s(Ht,"DIV",{class:!0});var Vt=r(Oe);v(yr.$$.fragment,Vt),Qb=u(Vt),Eo=s(Vt,"P",{});var pd=r(Eo);Hb=d(pd,"The "),Xi=s(pd,"A",{href:!0});var hx=r(Xi);Vb=d(hx,"TFMBartForConditionalGeneration"),hx.forEach(t),Kb=d(pd," forward method, overrides the "),nc=s(pd,"CODE",{});var mx=r(nc);Jb=d(mx,"__call__"),mx.forEach(t),Zb=d(pd," special method."),pd.forEach(t),Yb=u(Vt),v(Pn.$$.fragment,Vt),ey=u(Vt),v(Sn.$$.fragment,Vt),ty=u(Vt),v(On.$$.fragment,Vt),Vt.forEach(t),Ht.forEach(t),tu=u(o),Co=s(o,"H2",{class:!0});var fh=r(Co);In=s(fh,"A",{id:!0,class:!0,href:!0});var fx=r(In);ac=s(fx,"SPAN",{});var _x=r(ac);v(vr.$$.fragment,_x),_x.forEach(t),fx.forEach(t),oy=u(fh),sc=s(fh,"SPAN",{});var gx=r(sc);ny=d(gx,"FlaxMBartModel"),gx.forEach(t),fh.forEach(t),ou=u(o),Q=s(o,"DIV",{class:!0});var ge=r(Q);v(Tr.$$.fragment,ge),ay=u(ge),wr=s(ge,"P",{});var _h=r(wr);sy=d(_h,`The bare MBart Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Qi=s(_h,"A",{href:!0});var kx=r(Qi);ry=d(kx,"FlaxPreTrainedModel"),kx.forEach(t),iy=d(_h,`. 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.)`),_h.forEach(t),dy=u(ge),$r=s(ge,"P",{});var gh=r($r);ly=d(gh,`This model is also a Flax Linen
`),xr=s(gh,"A",{href:!0,rel:!0});var bx=r(xr);cy=d(bx,"flax.nn.Module"),bx.forEach(t),py=d(gh,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),gh.forEach(t),uy=u(ge),rc=s(ge,"P",{});var yx=r(rc);hy=d(yx,"Finally, this model supports inherent JAX features such as:"),yx.forEach(t),my=u(ge),At=s(ge,"UL",{});var xa=r(At);ic=s(xa,"LI",{});var vx=r(ic);Mr=s(vx,"A",{href:!0,rel:!0});var Tx=r(Mr);fy=d(Tx,"Just-In-Time (JIT) compilation"),Tx.forEach(t),vx.forEach(t),_y=u(xa),dc=s(xa,"LI",{});var wx=r(dc);zr=s(wx,"A",{href:!0,rel:!0});var $x=r(zr);gy=d($x,"Automatic Differentiation"),$x.forEach(t),wx.forEach(t),ky=u(xa),lc=s(xa,"LI",{});var xx=r(lc);Fr=s(xx,"A",{href:!0,rel:!0});var Mx=r(Fr);by=d(Mx,"Vectorization"),Mx.forEach(t),xx.forEach(t),yy=u(xa),cc=s(xa,"LI",{});var zx=r(cc);qr=s(zx,"A",{href:!0,rel:!0});var Fx=r(qr);vy=d(Fx,"Parallelization"),Fx.forEach(t),zx.forEach(t),xa.forEach(t),Ty=u(ge),lt=s(ge,"DIV",{class:!0});var Ma=r(lt);v(Br.$$.fragment,Ma),wy=u(Ma),Ao=s(Ma,"P",{});var ud=r(Ao);$y=d(ud,"The "),pc=s(ud,"CODE",{});var qx=r(pc);xy=d(qx,"FlaxMBartPreTrainedModel"),qx.forEach(t),My=d(ud," forward method, overrides the "),uc=s(ud,"CODE",{});var Bx=r(uc);zy=d(Bx,"__call__"),Bx.forEach(t),Fy=d(ud," special method."),ud.forEach(t),qy=u(Ma),v(Nn.$$.fragment,Ma),By=u(Ma),v(Dn.$$.fragment,Ma),Ma.forEach(t),jy=u(ge),Ln=s(ge,"DIV",{class:!0});var kh=r(Ln);v(jr.$$.fragment,kh),Ey=u(kh),v(Gn.$$.fragment,kh),kh.forEach(t),Cy=u(ge),Wn=s(ge,"DIV",{class:!0});var bh=r(Wn);v(Er.$$.fragment,bh),Ay=u(bh),v(Rn.$$.fragment,bh),bh.forEach(t),ge.forEach(t),nu=u(o),Po=s(o,"H2",{class:!0});var yh=r(Po);Un=s(yh,"A",{id:!0,class:!0,href:!0});var jx=r(Un);hc=s(jx,"SPAN",{});var Ex=r(hc);v(Cr.$$.fragment,Ex),Ex.forEach(t),jx.forEach(t),Py=u(yh),mc=s(yh,"SPAN",{});var Cx=r(mc);Sy=d(Cx,"FlaxMBartForConditionalGeneration"),Cx.forEach(t),yh.forEach(t),au=u(o),H=s(o,"DIV",{class:!0});var ke=r(H);v(Ar.$$.fragment,ke),Oy=u(ke),Pr=s(ke,"P",{});var vh=r(Pr);Iy=d(vh,`The MMBart Model with a language modeling head. Can be used for summarization.
This model inherits from `),Hi=s(vh,"A",{href:!0});var Ax=r(Hi);Ny=d(Ax,"FlaxPreTrainedModel"),Ax.forEach(t),Dy=d(vh,`. 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.)`),vh.forEach(t),Ly=u(ke),Sr=s(ke,"P",{});var Th=r(Sr);Gy=d(Th,`This model is also a Flax Linen
`),Or=s(Th,"A",{href:!0,rel:!0});var Px=r(Or);Wy=d(Px,"flax.nn.Module"),Px.forEach(t),Ry=d(Th,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Th.forEach(t),Uy=u(ke),fc=s(ke,"P",{});var Sx=r(fc);Xy=d(Sx,"Finally, this model supports inherent JAX features such as:"),Sx.forEach(t),Qy=u(ke),Pt=s(ke,"UL",{});var za=r(Pt);_c=s(za,"LI",{});var Ox=r(_c);Ir=s(Ox,"A",{href:!0,rel:!0});var Ix=r(Ir);Hy=d(Ix,"Just-In-Time (JIT) compilation"),Ix.forEach(t),Ox.forEach(t),Vy=u(za),gc=s(za,"LI",{});var Nx=r(gc);Nr=s(Nx,"A",{href:!0,rel:!0});var Dx=r(Nr);Ky=d(Dx,"Automatic Differentiation"),Dx.forEach(t),Nx.forEach(t),Jy=u(za),kc=s(za,"LI",{});var Lx=r(kc);Dr=s(Lx,"A",{href:!0,rel:!0});var Gx=r(Dr);Zy=d(Gx,"Vectorization"),Gx.forEach(t),Lx.forEach(t),Yy=u(za),bc=s(za,"LI",{});var Wx=r(bc);Lr=s(Wx,"A",{href:!0,rel:!0});var Rx=r(Lr);ev=d(Rx,"Parallelization"),Rx.forEach(t),Wx.forEach(t),za.forEach(t),tv=u(ke),Ie=s(ke,"DIV",{class:!0});var Kt=r(Ie);v(Gr.$$.fragment,Kt),ov=u(Kt),So=s(Kt,"P",{});var hd=r(So);nv=d(hd,"The "),yc=s(hd,"CODE",{});var Ux=r(yc);av=d(Ux,"FlaxMBartPreTrainedModel"),Ux.forEach(t),sv=d(hd," forward method, overrides the "),vc=s(hd,"CODE",{});var Xx=r(vc);rv=d(Xx,"__call__"),Xx.forEach(t),iv=d(hd," special method."),hd.forEach(t),dv=u(Kt),v(Xn.$$.fragment,Kt),lv=u(Kt),v(Qn.$$.fragment,Kt),cv=u(Kt),v(Hn.$$.fragment,Kt),Kt.forEach(t),pv=u(ke),Vn=s(ke,"DIV",{class:!0});var wh=r(Vn);v(Wr.$$.fragment,wh),uv=u(wh),v(Kn.$$.fragment,wh),wh.forEach(t),hv=u(ke),Jn=s(ke,"DIV",{class:!0});var $h=r(Jn);v(Rr.$$.fragment,$h),mv=u($h),v(Zn.$$.fragment,$h),$h.forEach(t),ke.forEach(t),su=u(o),Oo=s(o,"H2",{class:!0});var xh=r(Oo);Yn=s(xh,"A",{id:!0,class:!0,href:!0});var Qx=r(Yn);Tc=s(Qx,"SPAN",{});var Hx=r(Tc);v(Ur.$$.fragment,Hx),Hx.forEach(t),Qx.forEach(t),fv=u(xh),wc=s(xh,"SPAN",{});var Vx=r(wc);_v=d(Vx,"FlaxMBartForSequenceClassification"),Vx.forEach(t),xh.forEach(t),ru=u(o),G=s(o,"DIV",{class:!0});var ae=r(G);v(Xr.$$.fragment,ae),gv=u(ae),$c=s(ae,"P",{});var Kx=r($c);kv=d(Kx,`MBart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),Kx.forEach(t),bv=u(ae),Qr=s(ae,"P",{});var Mh=r(Qr);yv=d(Mh,"This model inherits from "),Vi=s(Mh,"A",{href:!0});var Jx=r(Vi);vv=d(Jx,"FlaxPreTrainedModel"),Jx.forEach(t),Tv=d(Mh,`. 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.)`),Mh.forEach(t),wv=u(ae),Hr=s(ae,"P",{});var zh=r(Hr);$v=d(zh,`This model is also a Flax Linen
`),Vr=s(zh,"A",{href:!0,rel:!0});var Zx=r(Vr);xv=d(Zx,"flax.nn.Module"),Zx.forEach(t),Mv=d(zh,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),zh.forEach(t),zv=u(ae),xc=s(ae,"P",{});var Yx=r(xc);Fv=d(Yx,"Finally, this model supports inherent JAX features such as:"),Yx.forEach(t),qv=u(ae),St=s(ae,"UL",{});var Fa=r(St);Mc=s(Fa,"LI",{});var eM=r(Mc);Kr=s(eM,"A",{href:!0,rel:!0});var tM=r(Kr);Bv=d(tM,"Just-In-Time (JIT) compilation"),tM.forEach(t),eM.forEach(t),jv=u(Fa),zc=s(Fa,"LI",{});var oM=r(zc);Jr=s(oM,"A",{href:!0,rel:!0});var nM=r(Jr);Ev=d(nM,"Automatic Differentiation"),nM.forEach(t),oM.forEach(t),Cv=u(Fa),Fc=s(Fa,"LI",{});var aM=r(Fc);Zr=s(aM,"A",{href:!0,rel:!0});var sM=r(Zr);Av=d(sM,"Vectorization"),sM.forEach(t),aM.forEach(t),Pv=u(Fa),qc=s(Fa,"LI",{});var rM=r(qc);Yr=s(rM,"A",{href:!0,rel:!0});var iM=r(Yr);Sv=d(iM,"Parallelization"),iM.forEach(t),rM.forEach(t),Fa.forEach(t),Ov=u(ae),ct=s(ae,"DIV",{class:!0});var qa=r(ct);v(ei.$$.fragment,qa),Iv=u(qa),Io=s(qa,"P",{});var md=r(Io);Nv=d(md,"The "),Bc=s(md,"CODE",{});var dM=r(Bc);Dv=d(dM,"FlaxMBartPreTrainedModel"),dM.forEach(t),Lv=d(md," forward method, overrides the "),jc=s(md,"CODE",{});var lM=r(jc);Gv=d(lM,"__call__"),lM.forEach(t),Wv=d(md," special method."),md.forEach(t),Rv=u(qa),v(ea.$$.fragment,qa),Uv=u(qa),v(ta.$$.fragment,qa),qa.forEach(t),Xv=u(ae),oa=s(ae,"DIV",{class:!0});var Fh=r(oa);v(ti.$$.fragment,Fh),Qv=u(Fh),v(na.$$.fragment,Fh),Fh.forEach(t),Hv=u(ae),aa=s(ae,"DIV",{class:!0});var qh=r(aa);v(oi.$$.fragment,qh),Vv=u(qh),v(sa.$$.fragment,qh),qh.forEach(t),ae.forEach(t),iu=u(o),No=s(o,"H2",{class:!0});var Bh=r(No);ra=s(Bh,"A",{id:!0,class:!0,href:!0});var cM=r(ra);Ec=s(cM,"SPAN",{});var pM=r(Ec);v(ni.$$.fragment,pM),pM.forEach(t),cM.forEach(t),Kv=u(Bh),Cc=s(Bh,"SPAN",{});var uM=r(Cc);Jv=d(uM,"FlaxMBartForQuestionAnswering"),uM.forEach(t),Bh.forEach(t),du=u(o),W=s(o,"DIV",{class:!0});var se=r(W);v(ai.$$.fragment,se),Zv=u(se),Do=s(se,"P",{});var fd=r(Do);Yv=d(fd,`MBart Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),Ac=s(fd,"CODE",{});var hM=r(Ac);eT=d(hM,"span start logits"),hM.forEach(t),tT=d(fd," and "),Pc=s(fd,"CODE",{});var mM=r(Pc);oT=d(mM,"span end logits"),mM.forEach(t),nT=d(fd,")."),fd.forEach(t),aT=u(se),si=s(se,"P",{});var jh=r(si);sT=d(jh,"This model inherits from "),Ki=s(jh,"A",{href:!0});var fM=r(Ki);rT=d(fM,"FlaxPreTrainedModel"),fM.forEach(t),iT=d(jh,`. 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.)`),jh.forEach(t),dT=u(se),ri=s(se,"P",{});var Eh=r(ri);lT=d(Eh,`This model is also a Flax Linen
`),ii=s(Eh,"A",{href:!0,rel:!0});var _M=r(ii);cT=d(_M,"flax.nn.Module"),_M.forEach(t),pT=d(Eh,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Eh.forEach(t),uT=u(se),Sc=s(se,"P",{});var gM=r(Sc);hT=d(gM,"Finally, this model supports inherent JAX features such as:"),gM.forEach(t),mT=u(se),Ot=s(se,"UL",{});var Ba=r(Ot);Oc=s(Ba,"LI",{});var kM=r(Oc);di=s(kM,"A",{href:!0,rel:!0});var bM=r(di);fT=d(bM,"Just-In-Time (JIT) compilation"),bM.forEach(t),kM.forEach(t),_T=u(Ba),Ic=s(Ba,"LI",{});var yM=r(Ic);li=s(yM,"A",{href:!0,rel:!0});var vM=r(li);gT=d(vM,"Automatic Differentiation"),vM.forEach(t),yM.forEach(t),kT=u(Ba),Nc=s(Ba,"LI",{});var TM=r(Nc);ci=s(TM,"A",{href:!0,rel:!0});var wM=r(ci);bT=d(wM,"Vectorization"),wM.forEach(t),TM.forEach(t),yT=u(Ba),Dc=s(Ba,"LI",{});var $M=r(Dc);pi=s($M,"A",{href:!0,rel:!0});var xM=r(pi);vT=d(xM,"Parallelization"),xM.forEach(t),$M.forEach(t),Ba.forEach(t),TT=u(se),pt=s(se,"DIV",{class:!0});var ja=r(pt);v(ui.$$.fragment,ja),wT=u(ja),Lo=s(ja,"P",{});var _d=r(Lo);$T=d(_d,"The "),Lc=s(_d,"CODE",{});var MM=r(Lc);xT=d(MM,"FlaxMBartPreTrainedModel"),MM.forEach(t),MT=d(_d," forward method, overrides the "),Gc=s(_d,"CODE",{});var zM=r(Gc);zT=d(zM,"__call__"),zM.forEach(t),FT=d(_d," special method."),_d.forEach(t),qT=u(ja),v(ia.$$.fragment,ja),BT=u(ja),v(da.$$.fragment,ja),ja.forEach(t),jT=u(se),la=s(se,"DIV",{class:!0});var Ch=r(la);v(hi.$$.fragment,Ch),ET=u(Ch),v(ca.$$.fragment,Ch),Ch.forEach(t),CT=u(se),pa=s(se,"DIV",{class:!0});var Ah=r(pa);v(mi.$$.fragment,Ah),AT=u(Ah),v(ua.$$.fragment,Ah),Ah.forEach(t),se.forEach(t),this.h()},h(){m(l,"name","hf:doc:metadata"),m(l,"content",JSON.stringify(y1)),m(h,"id","mbart-and-mbart50"),m(h,"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"),m(h,"href","#mbart-and-mbart50"),m(f,"class","relative group"),m(be,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),m(be,"rel","nofollow"),m(pe,"id","overview-of-mbart"),m(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"),m(pe,"href","#overview-of-mbart"),m(X,"class","relative group"),m(we,"href","https://arxiv.org/abs/2001.08210"),m(we,"rel","nofollow"),m(J,"href","https://huggingface.co/valhalla"),m(J,"rel","nofollow"),m(O,"href","https://github.com/pytorch/fairseq/tree/master/examples/mbart"),m(O,"rel","nofollow"),m(fe,"id","training-of-mbart"),m(fe,"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"),m(fe,"href","#training-of-mbart"),m(ie,"class","relative group"),m(He,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),m(Wo,"id","overview-of-mbart50"),m(Wo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Wo,"href","#overview-of-mbart50"),m(ao,"class","relative group"),m(Sa,"href","https://arxiv.org/abs/2008.00401"),m(Sa,"rel","nofollow"),m(Ro,"id","training-of-mbart50"),m(Ro,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ro,"href","#training-of-mbart50"),m(so,"class","relative group"),m($i,"href","/docs/transformers/main/en/model_doc/mbart#transformers.MBart50Tokenizer"),m(Xo,"id","transformers.MBartConfig"),m(Xo,"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"),m(Xo,"href","#transformers.MBartConfig"),m(ro,"class","relative group"),m(zi,"href","/docs/transformers/main/en/model_doc/mbart#transformers.MBartModel"),m(Wa,"href","https://huggingface.co/facebook/mbart-large-cc25"),m(Wa,"rel","nofollow"),m(Fi,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(qi,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ho,"id","transformers.MBartTokenizer"),m(Ho,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ho,"href","#transformers.MBartTokenizer"),m(co,"class","relative group"),m(Bi,"href","/docs/transformers/main/en/model_doc/roberta#transformers.RobertaTokenizer"),m(ji,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetTokenizer"),m(Xa,"href","https://github.com/google/sentencepiece"),m(Xa,"rel","nofollow"),m(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ko,"id","transformers.MBartTokenizerFast"),m(Ko,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ko,"href","#transformers.MBartTokenizerFast"),m(uo,"class","relative group"),m(es,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=BPE#models"),m(es,"rel","nofollow"),m(Ei,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Zo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(en,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(tn,"id","transformers.MBart50Tokenizer"),m(tn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(tn,"href","#transformers.MBart50Tokenizer"),m(fo,"class","relative group"),m(hs,"href","https://github.com/google/sentencepiece"),m(hs,"rel","nofollow"),m(Ci,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(nn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(an,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(sn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(rn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(dn,"id","transformers.MBart50TokenizerFast"),m(dn,"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"),m(dn,"href","#transformers.MBart50TokenizerFast"),m(_o,"class","relative group"),m(zs,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=BPE#models"),m(zs,"rel","nofollow"),m(Ai,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(cn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(pn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(un,"id","transformers.MBartModel"),m(un,"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"),m(un,"href","#transformers.MBartModel"),m(ko,"class","relative group"),m(Pi,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Ds,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Ds,"rel","nofollow"),m(Si,"href","/docs/transformers/main/en/model_doc/mbart#transformers.MBartModel"),m(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(fn,"id","transformers.MBartForConditionalGeneration"),m(fn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(fn,"href","#transformers.MBartForConditionalGeneration"),m(yo,"class","relative group"),m(Oi,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Xs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Xs,"rel","nofollow"),m(Ii,"href","/docs/transformers/main/en/model_doc/mbart#transformers.MBartForConditionalGeneration"),m(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(bn,"id","transformers.MBartForQuestionAnswering"),m(bn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(bn,"href","#transformers.MBartForQuestionAnswering"),m(To,"class","relative group"),m(Ni,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Zs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Zs,"rel","nofollow"),m(Di,"href","/docs/transformers/main/en/model_doc/mbart#transformers.MBartForQuestionAnswering"),m(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Tn,"id","transformers.MBartForSequenceClassification"),m(Tn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Tn,"href","#transformers.MBartForSequenceClassification"),m(xo,"class","relative group"),m(Li,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(ar,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(ar,"rel","nofollow"),m(Gi,"href","/docs/transformers/main/en/model_doc/mbart#transformers.MBartForSequenceClassification"),m(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(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Mn,"id","transformers.MBartForCausalLM"),m(Mn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Mn,"href","#transformers.MBartForCausalLM"),m(zo,"class","relative group"),m(zn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(qn,"id","transformers.TFMBartModel"),m(qn,"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"),m(qn,"href","#transformers.TFMBartModel"),m(qo,"class","relative group"),m(Wi,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(hr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(hr,"rel","nofollow"),m(Ri,"href","/docs/transformers/main/en/model_doc/mbart#transformers.TFMBartModel"),m(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Cn,"id","transformers.TFMBartForConditionalGeneration"),m(Cn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Cn,"href","#transformers.TFMBartForConditionalGeneration"),m(jo,"class","relative group"),m(Ui,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),m(br,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(br,"rel","nofollow"),m(Xi,"href","/docs/transformers/main/en/model_doc/mbart#transformers.TFMBartForConditionalGeneration"),m(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(In,"id","transformers.FlaxMBartModel"),m(In,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(In,"href","#transformers.FlaxMBartModel"),m(Co,"class","relative group"),m(Qi,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(xr,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(xr,"rel","nofollow"),m(Mr,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Mr,"rel","nofollow"),m(zr,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(zr,"rel","nofollow"),m(Fr,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Fr,"rel","nofollow"),m(qr,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(qr,"rel","nofollow"),m(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ln,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Wn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Un,"id","transformers.FlaxMBartForConditionalGeneration"),m(Un,"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"),m(Un,"href","#transformers.FlaxMBartForConditionalGeneration"),m(Po,"class","relative group"),m(Hi,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Or,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Or,"rel","nofollow"),m(Ir,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Ir,"rel","nofollow"),m(Nr,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(Nr,"rel","nofollow"),m(Dr,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Dr,"rel","nofollow"),m(Lr,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(Lr,"rel","nofollow"),m(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Vn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Jn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Yn,"id","transformers.FlaxMBartForSequenceClassification"),m(Yn,"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"),m(Yn,"href","#transformers.FlaxMBartForSequenceClassification"),m(Oo,"class","relative group"),m(Vi,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(Vr,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(Vr,"rel","nofollow"),m(Kr,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(Kr,"rel","nofollow"),m(Jr,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(Jr,"rel","nofollow"),m(Zr,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(Zr,"rel","nofollow"),m(Yr,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(Yr,"rel","nofollow"),m(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(oa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ra,"id","transformers.FlaxMBartForQuestionAnswering"),m(ra,"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"),m(ra,"href","#transformers.FlaxMBartForQuestionAnswering"),m(No,"class","relative group"),m(Ki,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),m(ii,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),m(ii,"rel","nofollow"),m(di,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),m(di,"rel","nofollow"),m(li,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),m(li,"rel","nofollow"),m(ci,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),m(ci,"rel","nofollow"),m(pi,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),m(pi,"rel","nofollow"),m(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(la,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(pa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,_){e(document.head,l),k(o,b,_),k(o,f,_),e(f,h),e(h,g),T(n,g,null),e(f,c),e(f,q),e(q,ft),k(o,Ye,_),k(o,U,_),e(U,De),e(De,Le),e(U,B),e(U,be),e(be,ye),e(U,_t),k(o,et,_),k(o,X,_),e(X,pe),e(pe,Ge),T(K,Ge,null),e(X,gt),e(X,We),e(We,ve),k(o,tt,_),k(o,ue,_),e(ue,Te),e(ue,we),e(we,kt),e(ue,Re),k(o,S,_),k(o,I,_),e(I,bt),k(o,he,_),k(o,re,_),e(re,yt),e(re,J),e(J,vt),e(re,Tt),e(re,O),e(O,wt),k(o,me,_),k(o,ie,_),e(ie,fe),e(fe,de),T($e,de,null),e(ie,$t),e(ie,Z),e(Z,xt),k(o,_e,_),k(o,R,_),e(R,Ue),e(R,N),e(N,Mt),e(R,Y),e(R,Xe),e(Xe,zt),e(R,z),e(R,j),e(j,Jt),e(R,Qe),e(R,Ft),e(Ft,Zt),e(R,C),k(o,Nt,_),k(o,te,_),e(te,Yt),e(te,He),e(He,qt),e(qt,le),e(He,xe),e(te,eo),e(te,Bt),e(Bt,Me),e(te,to),e(te,jt),e(jt,Et),e(te,oo),k(o,Ee,_),k(o,ot,_),e(ot,gd),e(gd,Ph),k(o,gp,_),T(Ea,o,_),k(o,kp,_),k(o,vi,_),e(vi,Ca),e(Ca,kd),e(kd,Sh),e(Ca,Oh),e(Ca,no),e(no,Ih),e(no,bd),e(bd,Nh),e(no,Dh),e(no,yd),e(yd,Lh),e(no,Gh),k(o,bp,_),T(Aa,o,_),k(o,yp,_),k(o,ao,_),e(ao,Wo),e(Wo,vd),T(Pa,vd,null),e(ao,Wh),e(ao,Td),e(Td,Rh),k(o,vp,_),k(o,Dt,_),e(Dt,Uh),e(Dt,Sa),e(Sa,Xh),e(Dt,Qh),e(Dt,wd),e(wd,Hh),e(Dt,Vh),k(o,Tp,_),k(o,Ti,_),e(Ti,Kh),k(o,wp,_),k(o,wi,_),e(wi,$d),e($d,Jh),k(o,$p,_),k(o,so,_),e(so,Ro),e(Ro,xd),T(Oa,xd,null),e(so,Zh),e(so,Md),e(Md,Yh),k(o,xp,_),k(o,nt,_),e(nt,em),e(nt,zd),e(zd,tm),e(nt,om),e(nt,Fd),e(Fd,nm),e(nt,am),e(nt,qd),e(qd,sm),e(nt,rm),k(o,Mp,_),k(o,Uo,_),e(Uo,im),e(Uo,$i),e($i,dm),e(Uo,lm),k(o,zp,_),k(o,xi,_),e(xi,Bd),e(Bd,cm),k(o,Fp,_),T(Ia,o,_),k(o,qp,_),k(o,Mi,_),e(Mi,Na),e(Na,jd),e(jd,pm),e(Na,um),e(Na,ze),e(ze,hm),e(ze,Ed),e(Ed,mm),e(ze,fm),e(ze,Cd),e(Cd,_m),e(ze,gm),e(ze,Ad),e(Ad,km),e(ze,bm),e(ze,Pd),e(Pd,ym),e(ze,vm),e(ze,Sd),e(Sd,Tm),e(ze,wm),k(o,Bp,_),T(Da,o,_),k(o,jp,_),k(o,ro,_),e(ro,Xo),e(Xo,Od),T(La,Od,null),e(ro,$m),e(ro,Id),e(Id,xm),k(o,Ep,_),k(o,Ve,_),T(Ga,Ve,null),e(Ve,Mm),e(Ve,io),e(io,zm),e(io,zi),e(zi,Fm),e(io,qm),e(io,Wa),e(Wa,Bm),e(io,jm),e(Ve,Em),e(Ve,lo),e(lo,Cm),e(lo,Fi),e(Fi,Am),e(lo,Pm),e(lo,qi),e(qi,Sm),e(lo,Om),e(Ve,Im),T(Qo,Ve,null),k(o,Cp,_),k(o,co,_),e(co,Ho),e(Ho,Nd),T(Ra,Nd,null),e(co,Nm),e(co,Dd),e(Dd,Dm),k(o,Ap,_),k(o,ce,_),T(Ua,ce,null),e(ce,Lm),e(ce,Ld),e(Ld,Gm),e(ce,Wm),e(ce,Ct),e(Ct,Rm),e(Ct,Bi),e(Bi,Um),e(Ct,Xm),e(Ct,ji),e(ji,Qm),e(Ct,Hm),e(Ct,Xa),e(Xa,Vm),e(Ct,Km),e(ce,Jm),e(ce,po),e(po,Zm),e(po,Gd),e(Gd,Ym),e(po,ef),e(po,Wd),e(Wd,tf),e(po,of),e(ce,nf),T(Vo,ce,null),e(ce,af),e(ce,at),T(Qa,at,null),e(at,sf),e(at,Ha),e(Ha,rf),e(Ha,Rd),e(Rd,df),e(Ha,lf),e(at,cf),e(at,Va),e(Va,Ka),e(Ka,Ud),e(Ud,pf),e(Ka,uf),e(Ka,Xd),e(Xd,hf),e(Va,mf),e(Va,Ja),e(Ja,Qd),e(Qd,ff),e(Ja,_f),e(Ja,Hd),e(Hd,gf),e(at,kf),e(at,Vd),e(Vd,bf),k(o,Pp,_),k(o,uo,_),e(uo,Ko),e(Ko,Kd),T(Za,Kd,null),e(uo,yf),e(uo,Jd),e(Jd,vf),k(o,Sp,_),k(o,D,_),T(Ya,D,null),e(D,Tf),e(D,ho),e(ho,wf),e(ho,Zd),e(Zd,$f),e(ho,xf),e(ho,es),e(es,Mf),e(ho,zf),e(D,Ff),e(D,ts),e(ts,qf),e(ts,Ei),e(Ei,Bf),e(ts,jf),e(D,Ef),e(D,mo),e(mo,Cf),e(mo,Yd),e(Yd,Af),e(mo,Pf),e(mo,el),e(el,Sf),e(mo,Of),e(D,If),T(Jo,D,null),e(D,Nf),e(D,Ce),T(os,Ce,null),e(Ce,Df),e(Ce,tl),e(tl,Lf),e(Ce,Gf),e(Ce,ns),e(ns,Wf),e(ns,ol),e(ol,Rf),e(ns,Uf),e(Ce,Xf),e(Ce,as),e(as,ss),e(ss,nl),e(nl,Qf),e(ss,Hf),e(ss,al),e(al,Vf),e(as,Kf),e(as,rs),e(rs,sl),e(sl,Jf),e(rs,Zf),e(rs,rl),e(rl,Yf),e(Ce,e_),e(Ce,il),e(il,t_),e(D,o_),e(D,Zo),T(is,Zo,null),e(Zo,n_),e(Zo,dl),e(dl,a_),e(D,s_),e(D,Yo),T(ds,Yo,null),e(Yo,r_),e(Yo,ll),e(ll,i_),e(D,d_),e(D,en),T(ls,en,null),e(en,l_),e(en,cl),e(cl,c_),k(o,Op,_),k(o,fo,_),e(fo,tn),e(tn,pl),T(cs,pl,null),e(fo,p_),e(fo,ul),e(ul,u_),k(o,Ip,_),k(o,L,_),T(ps,L,null),e(L,h_),e(L,us),e(us,m_),e(us,hs),e(hs,f_),e(us,__),e(L,g_),e(L,ms),e(ms,k_),e(ms,Ci),e(Ci,b_),e(ms,y_),e(L,v_),T(on,L,null),e(L,T_),e(L,st),T(fs,st,null),e(st,w_),e(st,_s),e(_s,$_),e(_s,hl),e(hl,x_),e(_s,M_),e(st,z_),e(st,gs),e(gs,ks),e(ks,ml),e(ml,F_),e(ks,q_),e(ks,fl),e(fl,B_),e(gs,j_),e(gs,bs),e(bs,_l),e(_l,E_),e(bs,C_),e(bs,gl),e(gl,A_),e(st,P_),e(st,kl),e(kl,S_),e(L,O_),e(L,nn),T(ys,nn,null),e(nn,I_),e(nn,bl),e(bl,N_),e(L,D_),e(L,an),T(vs,an,null),e(an,L_),e(an,Ts),e(Ts,G_),e(Ts,yl),e(yl,W_),e(Ts,R_),e(L,U_),e(L,sn),T(ws,sn,null),e(sn,X_),e(sn,vl),e(vl,Q_),e(L,H_),e(L,rn),T($s,rn,null),e(rn,V_),e(rn,Tl),e(Tl,K_),k(o,Np,_),k(o,_o,_),e(_o,dn),e(dn,wl),T(xs,wl,null),e(_o,J_),e(_o,$l),e($l,Z_),k(o,Dp,_),k(o,ee,_),T(Ms,ee,null),e(ee,Y_),e(ee,go),e(go,eg),e(go,xl),e(xl,tg),e(go,og),e(go,zs),e(zs,ng),e(go,ag),e(ee,sg),e(ee,Fs),e(Fs,rg),e(Fs,Ai),e(Ai,ig),e(Fs,dg),e(ee,lg),T(ln,ee,null),e(ee,cg),e(ee,Ae),T(qs,Ae,null),e(Ae,pg),e(Ae,Ml),e(Ml,ug),e(Ae,hg),e(Ae,Bs),e(Bs,mg),e(Bs,zl),e(zl,fg),e(Bs,_g),e(Ae,gg),e(Ae,js),e(js,Es),e(Es,Fl),e(Fl,kg),e(Es,bg),e(Es,ql),e(ql,yg),e(js,vg),e(js,Cs),e(Cs,Bl),e(Bl,Tg),e(Cs,wg),e(Cs,jl),e(jl,$g),e(Ae,xg),e(Ae,El),e(El,Mg),e(ee,zg),e(ee,cn),T(As,cn,null),e(cn,Fg),e(cn,Cl),e(Cl,qg),e(ee,Bg),e(ee,pn),T(Ps,pn,null),e(pn,jg),e(pn,Al),e(Al,Eg),k(o,Lp,_),k(o,ko,_),e(ko,un),e(un,Pl),T(Ss,Pl,null),e(ko,Cg),e(ko,Sl),e(Sl,Ag),k(o,Gp,_),k(o,Ke,_),T(Os,Ke,null),e(Ke,Pg),e(Ke,Is),e(Is,Sg),e(Is,Pi),e(Pi,Og),e(Is,Ig),e(Ke,Ng),e(Ke,Ns),e(Ns,Dg),e(Ns,Ds),e(Ds,Lg),e(Ns,Gg),e(Ke,Wg),e(Ke,rt),T(Ls,rt,null),e(rt,Rg),e(rt,bo),e(bo,Ug),e(bo,Si),e(Si,Xg),e(bo,Qg),e(bo,Ol),e(Ol,Hg),e(bo,Vg),e(rt,Kg),T(hn,rt,null),e(rt,Jg),T(mn,rt,null),k(o,Wp,_),k(o,yo,_),e(yo,fn),e(fn,Il),T(Gs,Il,null),e(yo,Zg),e(yo,Nl),e(Nl,Yg),k(o,Rp,_),k(o,Je,_),T(Ws,Je,null),e(Je,ek),e(Je,Rs),e(Rs,tk),e(Rs,Oi),e(Oi,ok),e(Rs,nk),e(Je,ak),e(Je,Us),e(Us,sk),e(Us,Xs),e(Xs,rk),e(Us,ik),e(Je,dk),e(Je,Pe),T(Qs,Pe,null),e(Pe,lk),e(Pe,vo),e(vo,ck),e(vo,Ii),e(Ii,pk),e(vo,uk),e(vo,Dl),e(Dl,hk),e(vo,mk),e(Pe,fk),T(_n,Pe,null),e(Pe,_k),T(gn,Pe,null),e(Pe,gk),T(kn,Pe,null),k(o,Up,_),k(o,To,_),e(To,bn),e(bn,Ll),T(Hs,Ll,null),e(To,kk),e(To,Gl),e(Gl,bk),k(o,Xp,_),k(o,Fe,_),T(Vs,Fe,null),e(Fe,yk),e(Fe,wo),e(wo,vk),e(wo,Wl),e(Wl,Tk),e(wo,wk),e(wo,Rl),e(Rl,$k),e(wo,xk),e(Fe,Mk),e(Fe,Ks),e(Ks,zk),e(Ks,Ni),e(Ni,Fk),e(Ks,qk),e(Fe,Bk),e(Fe,Js),e(Js,jk),e(Js,Zs),e(Zs,Ek),e(Js,Ck),e(Fe,Ak),e(Fe,it),T(Ys,it,null),e(it,Pk),e(it,$o),e($o,Sk),e($o,Di),e(Di,Ok),e($o,Ik),e($o,Ul),e(Ul,Nk),e($o,Dk),e(it,Lk),T(yn,it,null),e(it,Gk),T(vn,it,null),k(o,Qp,_),k(o,xo,_),e(xo,Tn),e(Tn,Xl),T(er,Xl,null),e(xo,Wk),e(xo,Ql),e(Ql,Rk),k(o,Hp,_),k(o,qe,_),T(tr,qe,null),e(qe,Uk),e(qe,Hl),e(Hl,Xk),e(qe,Qk),e(qe,or),e(or,Hk),e(or,Li),e(Li,Vk),e(or,Kk),e(qe,Jk),e(qe,nr),e(nr,Zk),e(nr,ar),e(ar,Yk),e(nr,eb),e(qe,tb),e(qe,Se),T(sr,Se,null),e(Se,ob),e(Se,Mo),e(Mo,nb),e(Mo,Gi),e(Gi,ab),e(Mo,sb),e(Mo,Vl),e(Vl,rb),e(Mo,ib),e(Se,db),T(wn,Se,null),e(Se,lb),T($n,Se,null),e(Se,cb),T(xn,Se,null),k(o,Vp,_),k(o,zo,_),e(zo,Mn),e(Mn,Kl),T(rr,Kl,null),e(zo,pb),e(zo,Jl),e(Jl,ub),k(o,Kp,_),k(o,Fo,_),T(ir,Fo,null),e(Fo,hb),e(Fo,zn),T(dr,zn,null),e(zn,mb),T(Fn,zn,null),k(o,Jp,_),k(o,qo,_),e(qo,qn),e(qn,Zl),T(lr,Zl,null),e(qo,fb),e(qo,Yl),e(Yl,_b),k(o,Zp,_),k(o,Be,_),T(cr,Be,null),e(Be,gb),e(Be,pr),e(pr,kb),e(pr,Wi),e(Wi,bb),e(pr,yb),e(Be,vb),e(Be,ur),e(ur,Tb),e(ur,hr),e(hr,wb),e(ur,$b),e(Be,xb),T(Bn,Be,null),e(Be,Mb),e(Be,dt),T(mr,dt,null),e(dt,zb),e(dt,Bo),e(Bo,Fb),e(Bo,Ri),e(Ri,qb),e(Bo,Bb),e(Bo,ec),e(ec,jb),e(Bo,Eb),e(dt,Cb),T(jn,dt,null),e(dt,Ab),T(En,dt,null),k(o,Yp,_),k(o,jo,_),e(jo,Cn),e(Cn,tc),T(fr,tc,null),e(jo,Pb),e(jo,oc),e(oc,Sb),k(o,eu,_),k(o,je,_),T(_r,je,null),e(je,Ob),e(je,gr),e(gr,Ib),e(gr,Ui),e(Ui,Nb),e(gr,Db),e(je,Lb),e(je,kr),e(kr,Gb),e(kr,br),e(br,Wb),e(kr,Rb),e(je,Ub),T(An,je,null),e(je,Xb),e(je,Oe),T(yr,Oe,null),e(Oe,Qb),e(Oe,Eo),e(Eo,Hb),e(Eo,Xi),e(Xi,Vb),e(Eo,Kb),e(Eo,nc),e(nc,Jb),e(Eo,Zb),e(Oe,Yb),T(Pn,Oe,null),e(Oe,ey),T(Sn,Oe,null),e(Oe,ty),T(On,Oe,null),k(o,tu,_),k(o,Co,_),e(Co,In),e(In,ac),T(vr,ac,null),e(Co,oy),e(Co,sc),e(sc,ny),k(o,ou,_),k(o,Q,_),T(Tr,Q,null),e(Q,ay),e(Q,wr),e(wr,sy),e(wr,Qi),e(Qi,ry),e(wr,iy),e(Q,dy),e(Q,$r),e($r,ly),e($r,xr),e(xr,cy),e($r,py),e(Q,uy),e(Q,rc),e(rc,hy),e(Q,my),e(Q,At),e(At,ic),e(ic,Mr),e(Mr,fy),e(At,_y),e(At,dc),e(dc,zr),e(zr,gy),e(At,ky),e(At,lc),e(lc,Fr),e(Fr,by),e(At,yy),e(At,cc),e(cc,qr),e(qr,vy),e(Q,Ty),e(Q,lt),T(Br,lt,null),e(lt,wy),e(lt,Ao),e(Ao,$y),e(Ao,pc),e(pc,xy),e(Ao,My),e(Ao,uc),e(uc,zy),e(Ao,Fy),e(lt,qy),T(Nn,lt,null),e(lt,By),T(Dn,lt,null),e(Q,jy),e(Q,Ln),T(jr,Ln,null),e(Ln,Ey),T(Gn,Ln,null),e(Q,Cy),e(Q,Wn),T(Er,Wn,null),e(Wn,Ay),T(Rn,Wn,null),k(o,nu,_),k(o,Po,_),e(Po,Un),e(Un,hc),T(Cr,hc,null),e(Po,Py),e(Po,mc),e(mc,Sy),k(o,au,_),k(o,H,_),T(Ar,H,null),e(H,Oy),e(H,Pr),e(Pr,Iy),e(Pr,Hi),e(Hi,Ny),e(Pr,Dy),e(H,Ly),e(H,Sr),e(Sr,Gy),e(Sr,Or),e(Or,Wy),e(Sr,Ry),e(H,Uy),e(H,fc),e(fc,Xy),e(H,Qy),e(H,Pt),e(Pt,_c),e(_c,Ir),e(Ir,Hy),e(Pt,Vy),e(Pt,gc),e(gc,Nr),e(Nr,Ky),e(Pt,Jy),e(Pt,kc),e(kc,Dr),e(Dr,Zy),e(Pt,Yy),e(Pt,bc),e(bc,Lr),e(Lr,ev),e(H,tv),e(H,Ie),T(Gr,Ie,null),e(Ie,ov),e(Ie,So),e(So,nv),e(So,yc),e(yc,av),e(So,sv),e(So,vc),e(vc,rv),e(So,iv),e(Ie,dv),T(Xn,Ie,null),e(Ie,lv),T(Qn,Ie,null),e(Ie,cv),T(Hn,Ie,null),e(H,pv),e(H,Vn),T(Wr,Vn,null),e(Vn,uv),T(Kn,Vn,null),e(H,hv),e(H,Jn),T(Rr,Jn,null),e(Jn,mv),T(Zn,Jn,null),k(o,su,_),k(o,Oo,_),e(Oo,Yn),e(Yn,Tc),T(Ur,Tc,null),e(Oo,fv),e(Oo,wc),e(wc,_v),k(o,ru,_),k(o,G,_),T(Xr,G,null),e(G,gv),e(G,$c),e($c,kv),e(G,bv),e(G,Qr),e(Qr,yv),e(Qr,Vi),e(Vi,vv),e(Qr,Tv),e(G,wv),e(G,Hr),e(Hr,$v),e(Hr,Vr),e(Vr,xv),e(Hr,Mv),e(G,zv),e(G,xc),e(xc,Fv),e(G,qv),e(G,St),e(St,Mc),e(Mc,Kr),e(Kr,Bv),e(St,jv),e(St,zc),e(zc,Jr),e(Jr,Ev),e(St,Cv),e(St,Fc),e(Fc,Zr),e(Zr,Av),e(St,Pv),e(St,qc),e(qc,Yr),e(Yr,Sv),e(G,Ov),e(G,ct),T(ei,ct,null),e(ct,Iv),e(ct,Io),e(Io,Nv),e(Io,Bc),e(Bc,Dv),e(Io,Lv),e(Io,jc),e(jc,Gv),e(Io,Wv),e(ct,Rv),T(ea,ct,null),e(ct,Uv),T(ta,ct,null),e(G,Xv),e(G,oa),T(ti,oa,null),e(oa,Qv),T(na,oa,null),e(G,Hv),e(G,aa),T(oi,aa,null),e(aa,Vv),T(sa,aa,null),k(o,iu,_),k(o,No,_),e(No,ra),e(ra,Ec),T(ni,Ec,null),e(No,Kv),e(No,Cc),e(Cc,Jv),k(o,du,_),k(o,W,_),T(ai,W,null),e(W,Zv),e(W,Do),e(Do,Yv),e(Do,Ac),e(Ac,eT),e(Do,tT),e(Do,Pc),e(Pc,oT),e(Do,nT),e(W,aT),e(W,si),e(si,sT),e(si,Ki),e(Ki,rT),e(si,iT),e(W,dT),e(W,ri),e(ri,lT),e(ri,ii),e(ii,cT),e(ri,pT),e(W,uT),e(W,Sc),e(Sc,hT),e(W,mT),e(W,Ot),e(Ot,Oc),e(Oc,di),e(di,fT),e(Ot,_T),e(Ot,Ic),e(Ic,li),e(li,gT),e(Ot,kT),e(Ot,Nc),e(Nc,ci),e(ci,bT),e(Ot,yT),e(Ot,Dc),e(Dc,pi),e(pi,vT),e(W,TT),e(W,pt),T(ui,pt,null),e(pt,wT),e(pt,Lo),e(Lo,$T),e(Lo,Lc),e(Lc,xT),e(Lo,MT),e(Lo,Gc),e(Gc,zT),e(Lo,FT),e(pt,qT),T(ia,pt,null),e(pt,BT),T(da,pt,null),e(W,jT),e(W,la),T(hi,la,null),e(la,ET),T(ca,la,null),e(W,CT),e(W,pa),T(mi,pa,null),e(pa,AT),T(ua,pa,null),lu=!0},p(o,[_]){const fi={};_&2&&(fi.$$scope={dirty:_,ctx:o}),Qo.$set(fi);const Wc={};_&2&&(Wc.$$scope={dirty:_,ctx:o}),Vo.$set(Wc);const Rc={};_&2&&(Rc.$$scope={dirty:_,ctx:o}),Jo.$set(Rc);const Uc={};_&2&&(Uc.$$scope={dirty:_,ctx:o}),on.$set(Uc);const ha={};_&2&&(ha.$$scope={dirty:_,ctx:o}),ln.$set(ha);const Xc={};_&2&&(Xc.$$scope={dirty:_,ctx:o}),hn.$set(Xc);const Qc={};_&2&&(Qc.$$scope={dirty:_,ctx:o}),mn.$set(Qc);const _i={};_&2&&(_i.$$scope={dirty:_,ctx:o}),_n.$set(_i);const Hc={};_&2&&(Hc.$$scope={dirty:_,ctx:o}),gn.$set(Hc);const Vc={};_&2&&(Vc.$$scope={dirty:_,ctx:o}),kn.$set(Vc);const Kc={};_&2&&(Kc.$$scope={dirty:_,ctx:o}),yn.$set(Kc);const gi={};_&2&&(gi.$$scope={dirty:_,ctx:o}),vn.$set(gi);const Jc={};_&2&&(Jc.$$scope={dirty:_,ctx:o}),wn.$set(Jc);const Zc={};_&2&&(Zc.$$scope={dirty:_,ctx:o}),$n.$set(Zc);const ma={};_&2&&(ma.$$scope={dirty:_,ctx:o}),xn.$set(ma);const Yc={};_&2&&(Yc.$$scope={dirty:_,ctx:o}),Fn.$set(Yc);const ep={};_&2&&(ep.$$scope={dirty:_,ctx:o}),Bn.$set(ep);const ki={};_&2&&(ki.$$scope={dirty:_,ctx:o}),jn.$set(ki);const tp={};_&2&&(tp.$$scope={dirty:_,ctx:o}),En.$set(tp);const op={};_&2&&(op.$$scope={dirty:_,ctx:o}),An.$set(op);const np={};_&2&&(np.$$scope={dirty:_,ctx:o}),Pn.$set(np);const Ze={};_&2&&(Ze.$$scope={dirty:_,ctx:o}),Sn.$set(Ze);const ap={};_&2&&(ap.$$scope={dirty:_,ctx:o}),On.$set(ap);const sp={};_&2&&(sp.$$scope={dirty:_,ctx:o}),Nn.$set(sp);const rp={};_&2&&(rp.$$scope={dirty:_,ctx:o}),Dn.$set(rp);const ip={};_&2&&(ip.$$scope={dirty:_,ctx:o}),Gn.$set(ip);const It={};_&2&&(It.$$scope={dirty:_,ctx:o}),Rn.$set(It);const Ji={};_&2&&(Ji.$$scope={dirty:_,ctx:o}),Xn.$set(Ji);const dp={};_&2&&(dp.$$scope={dirty:_,ctx:o}),Qn.$set(dp);const lp={};_&2&&(lp.$$scope={dirty:_,ctx:o}),Hn.$set(lp);const cp={};_&2&&(cp.$$scope={dirty:_,ctx:o}),Kn.$set(cp);const pp={};_&2&&(pp.$$scope={dirty:_,ctx:o}),Zn.$set(pp);const up={};_&2&&(up.$$scope={dirty:_,ctx:o}),ea.$set(up);const hp={};_&2&&(hp.$$scope={dirty:_,ctx:o}),ta.$set(hp);const bi={};_&2&&(bi.$$scope={dirty:_,ctx:o}),na.$set(bi);const mp={};_&2&&(mp.$$scope={dirty:_,ctx:o}),sa.$set(mp);const Go={};_&2&&(Go.$$scope={dirty:_,ctx:o}),ia.$set(Go);const fp={};_&2&&(fp.$$scope={dirty:_,ctx:o}),da.$set(fp);const _p={};_&2&&(_p.$$scope={dirty:_,ctx:o}),ca.$set(_p);const yi={};_&2&&(yi.$$scope={dirty:_,ctx:o}),ua.$set(yi)},i(o){lu||(w(n.$$.fragment,o),w(K.$$.fragment,o),w($e.$$.fragment,o),w(Ea.$$.fragment,o),w(Aa.$$.fragment,o),w(Pa.$$.fragment,o),w(Oa.$$.fragment,o),w(Ia.$$.fragment,o),w(Da.$$.fragment,o),w(La.$$.fragment,o),w(Ga.$$.fragment,o),w(Qo.$$.fragment,o),w(Ra.$$.fragment,o),w(Ua.$$.fragment,o),w(Vo.$$.fragment,o),w(Qa.$$.fragment,o),w(Za.$$.fragment,o),w(Ya.$$.fragment,o),w(Jo.$$.fragment,o),w(os.$$.fragment,o),w(is.$$.fragment,o),w(ds.$$.fragment,o),w(ls.$$.fragment,o),w(cs.$$.fragment,o),w(ps.$$.fragment,o),w(on.$$.fragment,o),w(fs.$$.fragment,o),w(ys.$$.fragment,o),w(vs.$$.fragment,o),w(ws.$$.fragment,o),w($s.$$.fragment,o),w(xs.$$.fragment,o),w(Ms.$$.fragment,o),w(ln.$$.fragment,o),w(qs.$$.fragment,o),w(As.$$.fragment,o),w(Ps.$$.fragment,o),w(Ss.$$.fragment,o),w(Os.$$.fragment,o),w(Ls.$$.fragment,o),w(hn.$$.fragment,o),w(mn.$$.fragment,o),w(Gs.$$.fragment,o),w(Ws.$$.fragment,o),w(Qs.$$.fragment,o),w(_n.$$.fragment,o),w(gn.$$.fragment,o),w(kn.$$.fragment,o),w(Hs.$$.fragment,o),w(Vs.$$.fragment,o),w(Ys.$$.fragment,o),w(yn.$$.fragment,o),w(vn.$$.fragment,o),w(er.$$.fragment,o),w(tr.$$.fragment,o),w(sr.$$.fragment,o),w(wn.$$.fragment,o),w($n.$$.fragment,o),w(xn.$$.fragment,o),w(rr.$$.fragment,o),w(ir.$$.fragment,o),w(dr.$$.fragment,o),w(Fn.$$.fragment,o),w(lr.$$.fragment,o),w(cr.$$.fragment,o),w(Bn.$$.fragment,o),w(mr.$$.fragment,o),w(jn.$$.fragment,o),w(En.$$.fragment,o),w(fr.$$.fragment,o),w(_r.$$.fragment,o),w(An.$$.fragment,o),w(yr.$$.fragment,o),w(Pn.$$.fragment,o),w(Sn.$$.fragment,o),w(On.$$.fragment,o),w(vr.$$.fragment,o),w(Tr.$$.fragment,o),w(Br.$$.fragment,o),w(Nn.$$.fragment,o),w(Dn.$$.fragment,o),w(jr.$$.fragment,o),w(Gn.$$.fragment,o),w(Er.$$.fragment,o),w(Rn.$$.fragment,o),w(Cr.$$.fragment,o),w(Ar.$$.fragment,o),w(Gr.$$.fragment,o),w(Xn.$$.fragment,o),w(Qn.$$.fragment,o),w(Hn.$$.fragment,o),w(Wr.$$.fragment,o),w(Kn.$$.fragment,o),w(Rr.$$.fragment,o),w(Zn.$$.fragment,o),w(Ur.$$.fragment,o),w(Xr.$$.fragment,o),w(ei.$$.fragment,o),w(ea.$$.fragment,o),w(ta.$$.fragment,o),w(ti.$$.fragment,o),w(na.$$.fragment,o),w(oi.$$.fragment,o),w(sa.$$.fragment,o),w(ni.$$.fragment,o),w(ai.$$.fragment,o),w(ui.$$.fragment,o),w(ia.$$.fragment,o),w(da.$$.fragment,o),w(hi.$$.fragment,o),w(ca.$$.fragment,o),w(mi.$$.fragment,o),w(ua.$$.fragment,o),lu=!0)},o(o){$(n.$$.fragment,o),$(K.$$.fragment,o),$($e.$$.fragment,o),$(Ea.$$.fragment,o),$(Aa.$$.fragment,o),$(Pa.$$.fragment,o),$(Oa.$$.fragment,o),$(Ia.$$.fragment,o),$(Da.$$.fragment,o),$(La.$$.fragment,o),$(Ga.$$.fragment,o),$(Qo.$$.fragment,o),$(Ra.$$.fragment,o),$(Ua.$$.fragment,o),$(Vo.$$.fragment,o),$(Qa.$$.fragment,o),$(Za.$$.fragment,o),$(Ya.$$.fragment,o),$(Jo.$$.fragment,o),$(os.$$.fragment,o),$(is.$$.fragment,o),$(ds.$$.fragment,o),$(ls.$$.fragment,o),$(cs.$$.fragment,o),$(ps.$$.fragment,o),$(on.$$.fragment,o),$(fs.$$.fragment,o),$(ys.$$.fragment,o),$(vs.$$.fragment,o),$(ws.$$.fragment,o),$($s.$$.fragment,o),$(xs.$$.fragment,o),$(Ms.$$.fragment,o),$(ln.$$.fragment,o),$(qs.$$.fragment,o),$(As.$$.fragment,o),$(Ps.$$.fragment,o),$(Ss.$$.fragment,o),$(Os.$$.fragment,o),$(Ls.$$.fragment,o),$(hn.$$.fragment,o),$(mn.$$.fragment,o),$(Gs.$$.fragment,o),$(Ws.$$.fragment,o),$(Qs.$$.fragment,o),$(_n.$$.fragment,o),$(gn.$$.fragment,o),$(kn.$$.fragment,o),$(Hs.$$.fragment,o),$(Vs.$$.fragment,o),$(Ys.$$.fragment,o),$(yn.$$.fragment,o),$(vn.$$.fragment,o),$(er.$$.fragment,o),$(tr.$$.fragment,o),$(sr.$$.fragment,o),$(wn.$$.fragment,o),$($n.$$.fragment,o),$(xn.$$.fragment,o),$(rr.$$.fragment,o),$(ir.$$.fragment,o),$(dr.$$.fragment,o),$(Fn.$$.fragment,o),$(lr.$$.fragment,o),$(cr.$$.fragment,o),$(Bn.$$.fragment,o),$(mr.$$.fragment,o),$(jn.$$.fragment,o),$(En.$$.fragment,o),$(fr.$$.fragment,o),$(_r.$$.fragment,o),$(An.$$.fragment,o),$(yr.$$.fragment,o),$(Pn.$$.fragment,o),$(Sn.$$.fragment,o),$(On.$$.fragment,o),$(vr.$$.fragment,o),$(Tr.$$.fragment,o),$(Br.$$.fragment,o),$(Nn.$$.fragment,o),$(Dn.$$.fragment,o),$(jr.$$.fragment,o),$(Gn.$$.fragment,o),$(Er.$$.fragment,o),$(Rn.$$.fragment,o),$(Cr.$$.fragment,o),$(Ar.$$.fragment,o),$(Gr.$$.fragment,o),$(Xn.$$.fragment,o),$(Qn.$$.fragment,o),$(Hn.$$.fragment,o),$(Wr.$$.fragment,o),$(Kn.$$.fragment,o),$(Rr.$$.fragment,o),$(Zn.$$.fragment,o),$(Ur.$$.fragment,o),$(Xr.$$.fragment,o),$(ei.$$.fragment,o),$(ea.$$.fragment,o),$(ta.$$.fragment,o),$(ti.$$.fragment,o),$(na.$$.fragment,o),$(oi.$$.fragment,o),$(sa.$$.fragment,o),$(ni.$$.fragment,o),$(ai.$$.fragment,o),$(ui.$$.fragment,o),$(ia.$$.fragment,o),$(da.$$.fragment,o),$(hi.$$.fragment,o),$(ca.$$.fragment,o),$(mi.$$.fragment,o),$(ua.$$.fragment,o),lu=!1},d(o){t(l),o&&t(b),o&&t(f),x(n),o&&t(Ye),o&&t(U),o&&t(et),o&&t(X),x(K),o&&t(tt),o&&t(ue),o&&t(S),o&&t(I),o&&t(he),o&&t(re),o&&t(me),o&&t(ie),x($e),o&&t(_e),o&&t(R),o&&t(Nt),o&&t(te),o&&t(Ee),o&&t(ot),o&&t(gp),x(Ea,o),o&&t(kp),o&&t(vi),o&&t(bp),x(Aa,o),o&&t(yp),o&&t(ao),x(Pa),o&&t(vp),o&&t(Dt),o&&t(Tp),o&&t(Ti),o&&t(wp),o&&t(wi),o&&t($p),o&&t(so),x(Oa),o&&t(xp),o&&t(nt),o&&t(Mp),o&&t(Uo),o&&t(zp),o&&t(xi),o&&t(Fp),x(Ia,o),o&&t(qp),o&&t(Mi),o&&t(Bp),x(Da,o),o&&t(jp),o&&t(ro),x(La),o&&t(Ep),o&&t(Ve),x(Ga),x(Qo),o&&t(Cp),o&&t(co),x(Ra),o&&t(Ap),o&&t(ce),x(Ua),x(Vo),x(Qa),o&&t(Pp),o&&t(uo),x(Za),o&&t(Sp),o&&t(D),x(Ya),x(Jo),x(os),x(is),x(ds),x(ls),o&&t(Op),o&&t(fo),x(cs),o&&t(Ip),o&&t(L),x(ps),x(on),x(fs),x(ys),x(vs),x(ws),x($s),o&&t(Np),o&&t(_o),x(xs),o&&t(Dp),o&&t(ee),x(Ms),x(ln),x(qs),x(As),x(Ps),o&&t(Lp),o&&t(ko),x(Ss),o&&t(Gp),o&&t(Ke),x(Os),x(Ls),x(hn),x(mn),o&&t(Wp),o&&t(yo),x(Gs),o&&t(Rp),o&&t(Je),x(Ws),x(Qs),x(_n),x(gn),x(kn),o&&t(Up),o&&t(To),x(Hs),o&&t(Xp),o&&t(Fe),x(Vs),x(Ys),x(yn),x(vn),o&&t(Qp),o&&t(xo),x(er),o&&t(Hp),o&&t(qe),x(tr),x(sr),x(wn),x($n),x(xn),o&&t(Vp),o&&t(zo),x(rr),o&&t(Kp),o&&t(Fo),x(ir),x(dr),x(Fn),o&&t(Jp),o&&t(qo),x(lr),o&&t(Zp),o&&t(Be),x(cr),x(Bn),x(mr),x(jn),x(En),o&&t(Yp),o&&t(jo),x(fr),o&&t(eu),o&&t(je),x(_r),x(An),x(yr),x(Pn),x(Sn),x(On),o&&t(tu),o&&t(Co),x(vr),o&&t(ou),o&&t(Q),x(Tr),x(Br),x(Nn),x(Dn),x(jr),x(Gn),x(Er),x(Rn),o&&t(nu),o&&t(Po),x(Cr),o&&t(au),o&&t(H),x(Ar),x(Gr),x(Xn),x(Qn),x(Hn),x(Wr),x(Kn),x(Rr),x(Zn),o&&t(su),o&&t(Oo),x(Ur),o&&t(ru),o&&t(G),x(Xr),x(ei),x(ea),x(ta),x(ti),x(na),x(oi),x(sa),o&&t(iu),o&&t(No),x(ni),o&&t(du),o&&t(W),x(ai),x(ui),x(ia),x(da),x(hi),x(ca),x(mi),x(ua)}}}const y1={local:"mbart-and-mbart50",sections:[{local:"overview-of-mbart",sections:[{local:"training-of-mbart",title:"Training of MBart"}],title:"Overview of MBart"},{local:"overview-of-mbart50",sections:[{local:"training-of-mbart50",title:"Training of MBart-50"}],title:"Overview of MBart-50"},{local:"transformers.MBartConfig",title:"MBartConfig"},{local:"transformers.MBartTokenizer",title:"MBartTokenizer"},{local:"transformers.MBartTokenizerFast",title:"MBartTokenizerFast"},{local:"transformers.MBart50Tokenizer",title:"MBart50Tokenizer"},{local:"transformers.MBart50TokenizerFast",title:"MBart50TokenizerFast"},{local:"transformers.MBartModel",title:"MBartModel"},{local:"transformers.MBartForConditionalGeneration",title:"MBartForConditionalGeneration"},{local:"transformers.MBartForQuestionAnswering",title:"MBartForQuestionAnswering"},{local:"transformers.MBartForSequenceClassification",title:"MBartForSequenceClassification"},{local:"transformers.MBartForCausalLM",title:"MBartForCausalLM"},{local:"transformers.TFMBartModel",title:"TFMBartModel"},{local:"transformers.TFMBartForConditionalGeneration",title:"TFMBartForConditionalGeneration"},{local:"transformers.FlaxMBartModel",title:"FlaxMBartModel"},{local:"transformers.FlaxMBartForConditionalGeneration",title:"FlaxMBartForConditionalGeneration"},{local:"transformers.FlaxMBartForSequenceClassification",title:"FlaxMBartForSequenceClassification"},{local:"transformers.FlaxMBartForQuestionAnswering",title:"FlaxMBartForQuestionAnswering"}],title:"MBart and MBart-50"};function v1(M){return EM(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class F1 extends FM{constructor(l){super();qM(this,l,v1,b1,BM,{})}}export{F1 as default,y1 as metadata};
