import{S as qF,i as jF,s as BF,e as n,k as c,w as y,t as i,M as EF,c as a,d as t,m as p,a as s,x as v,h as d,b as u,N as zF,G as e,g,y as T,q as w,o as x,B as $,v as CF,L as W}from"../../chunks/vendor-hf-doc-builder.js";import{T as Se}from"../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../chunks/Docstring-hf-doc-builder.js";import{C as O}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ae}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as G}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as o1}from"../../chunks/PipelineTag-hf-doc-builder.js";function AF(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import BartConfig, BartModel

# Initializing a BART facebook/bart-large style configuration
configuration = BartConfig()

# Initializing a model (with random weights) from the facebook/bart-large style configuration
model = BartModel(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> BartConfig, BartModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BART facebook/bart-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BartConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/bart-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BartModel(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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function MF(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import BartTokenizer

tokenizer = BartTokenizer.from_pretrained("facebook/bart-base")
tokenizer("Hello world")["input_ids"]

tokenizer(" Hello world")["input_ids"]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BartTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BartTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">31414</span>, <span class="hljs-number">232</span>, <span class="hljs-number">2</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">20920</span>, <span class="hljs-number">232</span>, <span class="hljs-number">2</span>]`}}),{c(){l=n("p"),k=i("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function PF(z){let l,k,f,m,b;return{c(){l=n("p"),k=i("When used with "),f=n("code"),m=i("is_split_into_words=True"),b=i(", this tokenizer will add a space before each word (even the first one).")},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"When used with "),f=a(h,"CODE",{});var q=s(f);m=d(q,"is_split_into_words=True"),q.forEach(t),b=d(h,", this tokenizer will add a space before each word (even the first one)."),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function SF(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import BartTokenizerFast

tokenizer = BartTokenizerFast.from_pretrained("facebook/bart-base")
tokenizer("Hello world")["input_ids"]

tokenizer(" Hello world")["input_ids"]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BartTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BartTokenizerFast.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">31414</span>, <span class="hljs-number">232</span>, <span class="hljs-number">2</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">0</span>, <span class="hljs-number">20920</span>, <span class="hljs-number">232</span>, <span class="hljs-number">2</span>]`}}),{c(){l=n("p"),k=i("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function IF(z){let l,k,f,m,b,r,h,q;return{c(){l=n("p"),k=i("When used with "),f=n("code"),m=i("is_split_into_words=True"),b=i(", this tokenizer needs to be instantiated with "),r=n("code"),h=i("add_prefix_space=True"),q=i(".")},l(se){l=a(se,"P",{});var H=s(l);k=d(H,"When used with "),f=a(H,"CODE",{});var I=s(f);m=d(I,"is_split_into_words=True"),I.forEach(t),b=d(H,", this tokenizer needs to be instantiated with "),r=a(H,"CODE",{});var re=s(r);h=d(re,"add_prefix_space=True"),re.forEach(t),q=d(H,"."),H.forEach(t)},m(se,H){g(se,l,H),e(l,k),e(l,f),e(f,m),e(l,b),e(l,r),e(r,h),e(l,q)},d(se){se&&t(l)}}}function OF(z){let l,k,f,m,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=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(r){l=a(r,"P",{});var h=s(l);k=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var q=s(f);m=d(q,"Module"),q.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function NF(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, BartModel
import torch

tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
model = BartModel.from_pretrained("facebook/bart-base")

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

model = BartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

ARTICLE_TO_SUMMARIZE = (
    "PG&E stated it scheduled the blackouts in response to forecasts for high winds "
    "amid dry conditions. The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were "
    "scheduled to be affected by the shutoffs which were expected to last through at least midday tomorrow."
)
inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors="pt")

# Generate Summary
summary_ids = model.generate(inputs["input_ids"], num_beams=2, min_length=0, max_length=20)
tokenizer.batch_decode(summary_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, BartForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = (
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;PG&amp;E stated it scheduled the blackouts in response to forecasts for high winds &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;amid dry conditions. The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were &quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;scheduled to be affected by the shutoffs which were expected to last through at least midday tomorrow.&quot;</span>
<span class="hljs-meta">... </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;pt&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">2</span>, min_length=<span class="hljs-number">0</span>, max_length=<span class="hljs-number">20</span>)
<span class="hljs-meta">&gt;&gt;&gt; </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>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;PG&amp;E scheduled the blackouts in response to forecasts for high winds amid dry conditions&#x27;</span>`}}),{c(){l=n("p"),k=i("Summarization example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Summarization example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function GF(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, BartForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
model = BartForConditionalGeneration.from_pretrained("facebook/bart-base")

TXT = "My friends are <mask> but they eat too many carbs."
input_ids = tokenizer([TXT], 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, BartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;My friends are &lt;mask&gt; but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], 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;not&#x27;</span>, <span class="hljs-string">&#x27;good&#x27;</span>, <span class="hljs-string">&#x27;healthy&#x27;</span>, <span class="hljs-string">&#x27;great&#x27;</span>, <span class="hljs-string">&#x27;very&#x27;</span>]`}}),{c(){l=n("p"),k=i("Mask filling example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Mask filling example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function WF(z){let l,k,f,m,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=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(r){l=a(r,"P",{});var h=s(l);k=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var q=s(f);m=d(q,"Module"),q.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function UF(z){let l,k,f,m,b;return m=new O({props:{code:`import torch
from transformers import AutoTokenizer, BartForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("valhalla/bart-large-sst2")
model = BartForSequenceClassification.from_pretrained("valhalla/bart-large-sst2")

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

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

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]

# 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 = BartForSequenceClassification.from_pretrained("valhalla/bart-large-sst2", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,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, BartForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;valhalla/bart-large-sst2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;valhalla/bart-large-sst2&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>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;POSITIVE&#x27;</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 = BartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;valhalla/bart-large-sst2&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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.0</span>`}}),{c(){l=n("p"),k=i("Example of single-label classification:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example of single-label classification:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function RF(z){let l,k,f,m,b;return m=new O({props:{code:`import torch
from transformers import AutoTokenizer, BartForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("valhalla/bart-large-sst2")
model = BartForSequenceClassification.from_pretrained("valhalla/bart-large-sst2", 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 = BartForSequenceClassification.from_pretrained(
    "valhalla/bart-large-sst2", 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, BartForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;valhalla/bart-large-sst2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;valhalla/bart-large-sst2&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 = BartForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;valhalla/bart-large-sst2&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=n("p"),k=i("Example of multi-label classification:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example of multi-label classification:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function HF(z){let l,k,f,m,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=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(r){l=a(r,"P",{});var h=s(l);k=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var q=s(f);m=d(q,"Module"),q.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function QF(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, BartForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("valhalla/bart-large-finetuned-squadv1")
model = BartForQuestionAnswering.from_pretrained("valhalla/bart-large-finetuned-squadv1")

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]
tokenizer.decode(predict_answer_tokens, skip_special_tokens=True)

# 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
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BartForQuestionAnswering
<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;valhalla/bart-large-finetuned-squadv1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BartForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;valhalla/bart-large-finetuned-squadv1&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>tokenizer.decode(predict_answer_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27; nice puppet&#x27;</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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.59</span>`}}),{c(){l=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function VF(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, BartForCausalLM

tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
model = BartForCausalLM.from_pretrained("facebook/bart-base", 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, BartForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BartForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function KF(z){let l,k,f,m,b,r,h,q,se,H,I,re,ie,j,Re,V,$e,it,Z,de,Ce,le,He,we,ce,Qe,Ie,N,be,Ae,Y,A,M,Ve,ee,ke,Ke,Q,Je,Xe,P,Fe,pe,Oe,te,K,Ze,Ye,U,et,ue,Me,ze,S,qe,L,Ne,ye;return{c(){l=n("p"),k=i("TensorFlow models and layers in "),f=n("code"),m=i("transformers"),b=i(" accept two formats as input:"),r=c(),h=n("ul"),q=n("li"),se=i("having all inputs as keyword arguments (like PyTorch models), or"),H=c(),I=n("li"),re=i("having all inputs as a list, tuple or dict in the first positional argument."),ie=c(),j=n("p"),Re=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 `),V=n("code"),$e=i("model.fit()"),it=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=n("code"),de=i("model.fit()"),Ce=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),He=i("fit()"),we=i(" and "),ce=n("code"),Qe=i("predict()"),Ie=i(`, such as when creating your own layers or models with
the Keras `),N=n("code"),be=i("Functional"),Ae=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Y=c(),A=n("ul"),M=n("li"),Ve=i("a single Tensor with "),ee=n("code"),ke=i("input_ids"),Ke=i(" only and nothing else: "),Q=n("code"),Je=i("model(input_ids)"),Xe=c(),P=n("li"),Fe=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=n("code"),Oe=i("model([input_ids, attention_mask])"),te=i(" or "),K=n("code"),Ze=i("model([input_ids, attention_mask, token_type_ids])"),Ye=c(),U=n("li"),et=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=n("code"),Me=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ze=c(),S=n("p"),qe=i(`Note that when creating models and layers with
`),L=n("a"),Ne=i("subclassing"),ye=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(F){l=a(F,"P",{});var B=s(l);k=d(B,"TensorFlow models and layers in "),f=a(B,"CODE",{});var wt=s(f);m=d(wt,"transformers"),wt.forEach(t),b=d(B," accept two formats as input:"),B.forEach(t),r=p(F),h=a(F,"UL",{});var je=s(h);q=a(je,"LI",{});var Le=s(q);se=d(Le,"having all inputs as keyword arguments (like PyTorch models), or"),Le.forEach(t),H=p(je),I=a(je,"LI",{});var dt=s(I);re=d(dt,"having all inputs as a list, tuple or dict in the first positional argument."),dt.forEach(t),je.forEach(t),ie=p(F),j=a(F,"P",{});var E=s(j);Re=d(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),V=a(E,"CODE",{});var xt=s(V);$e=d(xt,"model.fit()"),xt.forEach(t),it=d(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=a(E,"CODE",{});var oe=s(Z);de=d(oe,"model.fit()"),oe.forEach(t),Ce=d(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=a(E,"CODE",{});var lt=s(le);He=d(lt,"fit()"),lt.forEach(t),we=d(E," and "),ce=a(E,"CODE",{});var $t=s(ce);Qe=d($t,"predict()"),$t.forEach(t),Ie=d(E,`, such as when creating your own layers or models with
the Keras `),N=a(E,"CODE",{});var Ft=s(N);be=d(Ft,"Functional"),Ft.forEach(t),Ae=d(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),Y=p(F),A=a(F,"UL",{});var R=s(A);M=a(R,"LI",{});var he=s(M);Ve=d(he,"a single Tensor with "),ee=a(he,"CODE",{});var zt=s(ee);ke=d(zt,"input_ids"),zt.forEach(t),Ke=d(he," only and nothing else: "),Q=a(he,"CODE",{});var ct=s(Q);Je=d(ct,"model(input_ids)"),ct.forEach(t),he.forEach(t),Xe=p(R),P=a(R,"LI",{});var me=s(P);Fe=d(me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=a(me,"CODE",{});var qt=s(pe);Oe=d(qt,"model([input_ids, attention_mask])"),qt.forEach(t),te=d(me," or "),K=a(me,"CODE",{});var pt=s(K);Ze=d(pt,"model([input_ids, attention_mask, token_type_ids])"),pt.forEach(t),me.forEach(t),Ye=p(R),U=a(R,"LI",{});var tt=s(U);et=d(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=a(tt,"CODE",{});var jt=s(ue);Me=d(jt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),jt.forEach(t),tt.forEach(t),R.forEach(t),ze=p(F),S=a(F,"P",{});var ve=s(S);qe=d(ve,`Note that when creating models and layers with
`),L=a(ve,"A",{href:!0,rel:!0});var Bt=s(L);Ne=d(Bt,"subclassing"),Bt.forEach(t),ye=d(ve,` 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!`),ve.forEach(t),this.h()},h(){u(L,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),u(L,"rel","nofollow")},m(F,B){g(F,l,B),e(l,k),e(l,f),e(f,m),e(l,b),g(F,r,B),g(F,h,B),e(h,q),e(q,se),e(h,H),e(h,I),e(I,re),g(F,ie,B),g(F,j,B),e(j,Re),e(j,V),e(V,$e),e(j,it),e(j,Z),e(Z,de),e(j,Ce),e(j,le),e(le,He),e(j,we),e(j,ce),e(ce,Qe),e(j,Ie),e(j,N),e(N,be),e(j,Ae),g(F,Y,B),g(F,A,B),e(A,M),e(M,Ve),e(M,ee),e(ee,ke),e(M,Ke),e(M,Q),e(Q,Je),e(A,Xe),e(A,P),e(P,Fe),e(P,pe),e(pe,Oe),e(P,te),e(P,K),e(K,Ze),e(A,Ye),e(A,U),e(U,et),e(U,ue),e(ue,Me),g(F,ze,B),g(F,S,B),e(S,qe),e(S,L),e(L,Ne),e(S,ye)},d(F){F&&t(l),F&&t(r),F&&t(h),F&&t(ie),F&&t(j),F&&t(Y),F&&t(A),F&&t(ze),F&&t(S)}}}function JF(z){let l,k,f,m,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=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(r){l=a(r,"P",{});var h=s(l);k=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var q=s(f);m=d(q,"Module"),q.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function XF(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, TFBartModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large")
model = TFBartModel.from_pretrained("facebook/bart-large")

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, TFBartModel
<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/bart-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBartModel.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large&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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function ZF(z){let l,k,f,m,b,r,h,q,se,H,I,re,ie,j,Re,V,$e,it,Z,de,Ce,le,He,we,ce,Qe,Ie,N,be,Ae,Y,A,M,Ve,ee,ke,Ke,Q,Je,Xe,P,Fe,pe,Oe,te,K,Ze,Ye,U,et,ue,Me,ze,S,qe,L,Ne,ye;return{c(){l=n("p"),k=i("TensorFlow models and layers in "),f=n("code"),m=i("transformers"),b=i(" accept two formats as input:"),r=c(),h=n("ul"),q=n("li"),se=i("having all inputs as keyword arguments (like PyTorch models), or"),H=c(),I=n("li"),re=i("having all inputs as a list, tuple or dict in the first positional argument."),ie=c(),j=n("p"),Re=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 `),V=n("code"),$e=i("model.fit()"),it=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=n("code"),de=i("model.fit()"),Ce=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),He=i("fit()"),we=i(" and "),ce=n("code"),Qe=i("predict()"),Ie=i(`, such as when creating your own layers or models with
the Keras `),N=n("code"),be=i("Functional"),Ae=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Y=c(),A=n("ul"),M=n("li"),Ve=i("a single Tensor with "),ee=n("code"),ke=i("input_ids"),Ke=i(" only and nothing else: "),Q=n("code"),Je=i("model(input_ids)"),Xe=c(),P=n("li"),Fe=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=n("code"),Oe=i("model([input_ids, attention_mask])"),te=i(" or "),K=n("code"),Ze=i("model([input_ids, attention_mask, token_type_ids])"),Ye=c(),U=n("li"),et=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=n("code"),Me=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ze=c(),S=n("p"),qe=i(`Note that when creating models and layers with
`),L=n("a"),Ne=i("subclassing"),ye=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(F){l=a(F,"P",{});var B=s(l);k=d(B,"TensorFlow models and layers in "),f=a(B,"CODE",{});var wt=s(f);m=d(wt,"transformers"),wt.forEach(t),b=d(B," accept two formats as input:"),B.forEach(t),r=p(F),h=a(F,"UL",{});var je=s(h);q=a(je,"LI",{});var Le=s(q);se=d(Le,"having all inputs as keyword arguments (like PyTorch models), or"),Le.forEach(t),H=p(je),I=a(je,"LI",{});var dt=s(I);re=d(dt,"having all inputs as a list, tuple or dict in the first positional argument."),dt.forEach(t),je.forEach(t),ie=p(F),j=a(F,"P",{});var E=s(j);Re=d(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),V=a(E,"CODE",{});var xt=s(V);$e=d(xt,"model.fit()"),xt.forEach(t),it=d(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=a(E,"CODE",{});var oe=s(Z);de=d(oe,"model.fit()"),oe.forEach(t),Ce=d(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=a(E,"CODE",{});var lt=s(le);He=d(lt,"fit()"),lt.forEach(t),we=d(E," and "),ce=a(E,"CODE",{});var $t=s(ce);Qe=d($t,"predict()"),$t.forEach(t),Ie=d(E,`, such as when creating your own layers or models with
the Keras `),N=a(E,"CODE",{});var Ft=s(N);be=d(Ft,"Functional"),Ft.forEach(t),Ae=d(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),Y=p(F),A=a(F,"UL",{});var R=s(A);M=a(R,"LI",{});var he=s(M);Ve=d(he,"a single Tensor with "),ee=a(he,"CODE",{});var zt=s(ee);ke=d(zt,"input_ids"),zt.forEach(t),Ke=d(he," only and nothing else: "),Q=a(he,"CODE",{});var ct=s(Q);Je=d(ct,"model(input_ids)"),ct.forEach(t),he.forEach(t),Xe=p(R),P=a(R,"LI",{});var me=s(P);Fe=d(me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=a(me,"CODE",{});var qt=s(pe);Oe=d(qt,"model([input_ids, attention_mask])"),qt.forEach(t),te=d(me," or "),K=a(me,"CODE",{});var pt=s(K);Ze=d(pt,"model([input_ids, attention_mask, token_type_ids])"),pt.forEach(t),me.forEach(t),Ye=p(R),U=a(R,"LI",{});var tt=s(U);et=d(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=a(tt,"CODE",{});var jt=s(ue);Me=d(jt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),jt.forEach(t),tt.forEach(t),R.forEach(t),ze=p(F),S=a(F,"P",{});var ve=s(S);qe=d(ve,`Note that when creating models and layers with
`),L=a(ve,"A",{href:!0,rel:!0});var Bt=s(L);Ne=d(Bt,"subclassing"),Bt.forEach(t),ye=d(ve,` 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!`),ve.forEach(t),this.h()},h(){u(L,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),u(L,"rel","nofollow")},m(F,B){g(F,l,B),e(l,k),e(l,f),e(f,m),e(l,b),g(F,r,B),g(F,h,B),e(h,q),e(q,se),e(h,H),e(h,I),e(I,re),g(F,ie,B),g(F,j,B),e(j,Re),e(j,V),e(V,$e),e(j,it),e(j,Z),e(Z,de),e(j,Ce),e(j,le),e(le,He),e(j,we),e(j,ce),e(ce,Qe),e(j,Ie),e(j,N),e(N,be),e(j,Ae),g(F,Y,B),g(F,A,B),e(A,M),e(M,Ve),e(M,ee),e(ee,ke),e(M,Ke),e(M,Q),e(Q,Je),e(A,Xe),e(A,P),e(P,Fe),e(P,pe),e(pe,Oe),e(P,te),e(P,K),e(K,Ze),e(A,Ye),e(A,U),e(U,et),e(U,ue),e(ue,Me),g(F,ze,B),g(F,S,B),e(S,qe),e(S,L),e(L,Ne),e(S,ye)},d(F){F&&t(l),F&&t(r),F&&t(h),F&&t(ie),F&&t(j),F&&t(Y),F&&t(A),F&&t(ze),F&&t(S)}}}function YF(z){let l,k,f,m,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=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(r){l=a(r,"P",{});var h=s(l);k=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var q=s(f);m=d(q,"Module"),q.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function ez(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, TFBartForConditionalGeneration

model = TFBartForConditionalGeneration.from_pretrained("facebook/bart-large")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large")

ARTICLE_TO_SUMMARIZE = "My friends are cool but they eat too many carbs."
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, TFBartForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = <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([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=n("p"),k=i("Summarization example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Summarization example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function tz(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, TFBartForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large")
TXT = "My friends are <mask> but they eat too many carbs."

model = TFBartForConditionalGeneration.from_pretrained("facebook/bart-large")
input_ids = tokenizer([TXT], 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, TFBartForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;My friends are &lt;mask&gt; but they eat too many carbs.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], 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=n("p"),k=i("Mask filling example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Mask filling example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function oz(z){let l,k,f,m,b,r,h,q,se,H,I,re,ie,j,Re,V,$e,it,Z,de,Ce,le,He,we,ce,Qe,Ie,N,be,Ae,Y,A,M,Ve,ee,ke,Ke,Q,Je,Xe,P,Fe,pe,Oe,te,K,Ze,Ye,U,et,ue,Me,ze,S,qe,L,Ne,ye;return{c(){l=n("p"),k=i("TensorFlow models and layers in "),f=n("code"),m=i("transformers"),b=i(" accept two formats as input:"),r=c(),h=n("ul"),q=n("li"),se=i("having all inputs as keyword arguments (like PyTorch models), or"),H=c(),I=n("li"),re=i("having all inputs as a list, tuple or dict in the first positional argument."),ie=c(),j=n("p"),Re=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 `),V=n("code"),$e=i("model.fit()"),it=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=n("code"),de=i("model.fit()"),Ce=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),He=i("fit()"),we=i(" and "),ce=n("code"),Qe=i("predict()"),Ie=i(`, such as when creating your own layers or models with
the Keras `),N=n("code"),be=i("Functional"),Ae=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Y=c(),A=n("ul"),M=n("li"),Ve=i("a single Tensor with "),ee=n("code"),ke=i("input_ids"),Ke=i(" only and nothing else: "),Q=n("code"),Je=i("model(input_ids)"),Xe=c(),P=n("li"),Fe=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=n("code"),Oe=i("model([input_ids, attention_mask])"),te=i(" or "),K=n("code"),Ze=i("model([input_ids, attention_mask, token_type_ids])"),Ye=c(),U=n("li"),et=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=n("code"),Me=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ze=c(),S=n("p"),qe=i(`Note that when creating models and layers with
`),L=n("a"),Ne=i("subclassing"),ye=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(F){l=a(F,"P",{});var B=s(l);k=d(B,"TensorFlow models and layers in "),f=a(B,"CODE",{});var wt=s(f);m=d(wt,"transformers"),wt.forEach(t),b=d(B," accept two formats as input:"),B.forEach(t),r=p(F),h=a(F,"UL",{});var je=s(h);q=a(je,"LI",{});var Le=s(q);se=d(Le,"having all inputs as keyword arguments (like PyTorch models), or"),Le.forEach(t),H=p(je),I=a(je,"LI",{});var dt=s(I);re=d(dt,"having all inputs as a list, tuple or dict in the first positional argument."),dt.forEach(t),je.forEach(t),ie=p(F),j=a(F,"P",{});var E=s(j);Re=d(E,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),V=a(E,"CODE",{});var xt=s(V);$e=d(xt,"model.fit()"),xt.forEach(t),it=d(E,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Z=a(E,"CODE",{});var oe=s(Z);de=d(oe,"model.fit()"),oe.forEach(t),Ce=d(E,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=a(E,"CODE",{});var lt=s(le);He=d(lt,"fit()"),lt.forEach(t),we=d(E," and "),ce=a(E,"CODE",{});var $t=s(ce);Qe=d($t,"predict()"),$t.forEach(t),Ie=d(E,`, such as when creating your own layers or models with
the Keras `),N=a(E,"CODE",{});var Ft=s(N);be=d(Ft,"Functional"),Ft.forEach(t),Ae=d(E,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),E.forEach(t),Y=p(F),A=a(F,"UL",{});var R=s(A);M=a(R,"LI",{});var he=s(M);Ve=d(he,"a single Tensor with "),ee=a(he,"CODE",{});var zt=s(ee);ke=d(zt,"input_ids"),zt.forEach(t),Ke=d(he," only and nothing else: "),Q=a(he,"CODE",{});var ct=s(Q);Je=d(ct,"model(input_ids)"),ct.forEach(t),he.forEach(t),Xe=p(R),P=a(R,"LI",{});var me=s(P);Fe=d(me,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),pe=a(me,"CODE",{});var qt=s(pe);Oe=d(qt,"model([input_ids, attention_mask])"),qt.forEach(t),te=d(me," or "),K=a(me,"CODE",{});var pt=s(K);Ze=d(pt,"model([input_ids, attention_mask, token_type_ids])"),pt.forEach(t),me.forEach(t),Ye=p(R),U=a(R,"LI",{});var tt=s(U);et=d(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=a(tt,"CODE",{});var jt=s(ue);Me=d(jt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),jt.forEach(t),tt.forEach(t),R.forEach(t),ze=p(F),S=a(F,"P",{});var ve=s(S);qe=d(ve,`Note that when creating models and layers with
`),L=a(ve,"A",{href:!0,rel:!0});var Bt=s(L);Ne=d(Bt,"subclassing"),Bt.forEach(t),ye=d(ve,` 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!`),ve.forEach(t),this.h()},h(){u(L,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),u(L,"rel","nofollow")},m(F,B){g(F,l,B),e(l,k),e(l,f),e(f,m),e(l,b),g(F,r,B),g(F,h,B),e(h,q),e(q,se),e(h,H),e(h,I),e(I,re),g(F,ie,B),g(F,j,B),e(j,Re),e(j,V),e(V,$e),e(j,it),e(j,Z),e(Z,de),e(j,Ce),e(j,le),e(le,He),e(j,we),e(j,ce),e(ce,Qe),e(j,Ie),e(j,N),e(N,be),e(j,Ae),g(F,Y,B),g(F,A,B),e(A,M),e(M,Ve),e(M,ee),e(ee,ke),e(M,Ke),e(M,Q),e(Q,Je),e(A,Xe),e(A,P),e(P,Fe),e(P,pe),e(pe,Oe),e(P,te),e(P,K),e(K,Ze),e(A,Ye),e(A,U),e(U,et),e(U,ue),e(ue,Me),g(F,ze,B),g(F,S,B),e(S,qe),e(S,L),e(L,Ne),e(S,ye)},d(F){F&&t(l),F&&t(r),F&&t(h),F&&t(ie),F&&t(j),F&&t(Y),F&&t(A),F&&t(ze),F&&t(S)}}}function nz(z){let l,k,f,m,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=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(r){l=a(r,"P",{});var h=s(l);k=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var q=s(f);m=d(q,"Module"),q.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function az(z){let l,k,f,m,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=i("Module"),b=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(r){l=a(r,"P",{});var h=s(l);k=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(h,"CODE",{});var q=s(f);m=d(q,"Module"),q.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,f),e(f,m),e(l,b)},d(r){r&&t(l)}}}function sz(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, FlaxBartModel

tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
model = FlaxBartModel.from_pretrained("facebook/bart-base")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBartModel.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function rz(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, FlaxBartForConditionalGeneration

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large-cnn&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large-cnn&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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function iz(z){let l,k,f,m,b;return m=new O({props:{code:`import jax.numpy as jnp
from transformers import AutoTokenizer, FlaxBartForConditionalGeneration

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

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">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBartForConditionalGeneration

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

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

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

# Generate Summary
summary_ids = model.generate(inputs["input_ids"]).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, FlaxBartForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = <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([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>]).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=n("p"),k=i("Summarization example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Summarization example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function cz(z){let l,k,f,m,b;return m=new O({props:{code:`import jax
from transformers import AutoTokenizer, FlaxBartForConditionalGeneration

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large")

TXT = "My friends are <mask> but they eat too many carbs."
input_ids = tokenizer([TXT], return_tensors="jax")["input_ids"]

logits = model(input_ids).logits
masked_index = (input_ids[0] == tokenizer.mask_token_id).nonzero()[0].item()
probs = jax.nn.softmax(logits[0, masked_index], axis=0)
values, predictions = jax.lax.top_k(probs, k=1)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;My friends are &lt;mask&gt; but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], return_tensors=<span class="hljs-string">&quot;jax&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 = jax.nn.softmax(logits[<span class="hljs-number">0</span>, masked_index], axis=<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>values, predictions = jax.lax.top_k(probs, k=<span class="hljs-number">1</span>)

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

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large-cnn&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large-cnn&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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function uz(z){let l,k,f,m,b;return m=new O({props:{code:`import jax.numpy as jnp
from transformers import AutoTokenizer, FlaxBartForConditionalGeneration

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

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">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBartForConditionalGeneration

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

tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
model = FlaxBartForSequenceClassification.from_pretrained("facebook/bart-base")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function fz(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, FlaxBartForConditionalGeneration

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large-cnn&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large-cnn&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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function _z(z){let l,k,f,m,b;return m=new O({props:{code:`import jax.numpy as jnp
from transformers import AutoTokenizer, FlaxBartForConditionalGeneration

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

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">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBartForConditionalGeneration

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

tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
model = FlaxBartForQuestionAnswering.from_pretrained("facebook/bart-base")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBartForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function kz(z){let l,k,f,m,b;return m=new O({props:{code:`from transformers import AutoTokenizer, FlaxBartForConditionalGeneration

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large-cnn&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large-cnn&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=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function yz(z){let l,k,f,m,b;return m=new O({props:{code:`import jax.numpy as jnp
from transformers import AutoTokenizer, FlaxBartForConditionalGeneration

model = FlaxBartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

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">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBartForConditionalGeneration

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

tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
model = FlaxBartForCausalLM.from_pretrained("facebook/bart-base")

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

# retrieve logts for next token
next_token_logits = outputs.logits[:, -1]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBartForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBartForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&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;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve logts for next token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs.logits[:, -<span class="hljs-number">1</span>]`}}),{c(){l=n("p"),k=i("Example:"),f=c(),y(m.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),f=p(r),v(m.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,f,h),T(m,r,h),b=!0},p:W,i(r){b||(w(m.$$.fragment,r),b=!0)},o(r){x(m.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(f),$(m,r)}}}function wz(z){let l,k,f,m,b,r,h,q,se,H,I,re,ie,j,Re,V,$e,it,Z,de,Ce,le,He,we,ce,Qe,Ie,N,be,Ae,Y,A,M,Ve,ee,ke,Ke,Q,Je,Xe,P,Fe,pe,Oe,te,K,Ze,Ye,U,et,ue,Me,ze,S,qe,L,Ne,ye,F,B,wt,je,Le,dt,E,xt,oe,lt,$t,Ft,R,he,zt,ct,me,qt,pt,tt,jt,ve,Bt,xu,Vt,Sm,Xa,Im,Om,Za,Nm,Lm,$u,ko,dn,Pl,Ya,Dm,Sl,Gm,Fu,Kt,es,Wm,ts,Um,Rm,Hm,Lt,Qm,fd,Vm,Km,Il,Jm,Xm,os,Zm,Ym,ef,ln,ns,tf,of,as,nf,af,zu,yo,cn,Ol,ss,sf,Nl,rf,qu,ut,Dt,df,Ll,lf,cf,_d,pf,uf,gd,hf,mf,ff,vo,_f,bd,gf,bf,Dl,kf,yf,vf,To,Tf,Gl,wf,xf,Wl,$f,Ff,zf,kd,yd,qf,jf,Bf,wo,Ef,Ul,Cf,Af,Rl,Mf,Pf,ju,xo,pn,Hl,rs,Sf,Ql,If,Bu,Jt,Of,Vl,Nf,Lf,Kl,Df,Gf,Eu,is,Cu,$o,un,Jl,ds,Wf,Xl,Uf,Au,vd,Rf,Mu,ls,Pu,Te,cs,Hf,ps,Qf,Vf,Kf,us,Jf,hs,Xf,Zf,Yf,ms,e_,fs,t_,o_,n_,Xt,Td,a_,s_,_s,r_,i_,gs,d_,l_,c_,Zt,wd,p_,u_,bs,h_,m_,ks,f_,__,g_,hn,xd,b_,k_,ys,y_,v_,T_,$d,vs,w_,x_,$_,Zl,Fd,F_,Su,Ts,Iu,ht,Yt,zd,z_,q_,ws,j_,B_,xs,E_,C_,A_,eo,qd,M_,P_,$s,S_,I_,Fs,O_,N_,L_,to,jd,D_,G_,zs,W_,U_,qs,R_,H_,Q_,Bd,js,V_,K_,J_,Yl,Ed,X_,Ou,Bs,Nu,Et,Es,Z_,Cs,Y_,eg,tg,oo,Cd,og,ng,As,ag,sg,Ms,rg,ig,dg,no,Ad,lg,cg,Ps,pg,ug,Ss,hg,mg,fg,ec,Md,_g,Lu,Pd,gg,Du,ao,tc,Sd,bg,kg,oc,Id,yg,vg,nc,Od,Tg,Gu,Fo,mn,ac,Is,wg,sc,xg,Wu,kt,Os,$g,zo,Fg,Nd,zg,qg,Ns,jg,Bg,Eg,qo,Cg,Ld,Ag,Mg,Dd,Pg,Sg,Ig,fn,Uu,jo,_n,rc,Ls,Og,ic,Ng,Ru,D,Ds,Lg,dc,Dg,Gg,lc,Wg,Ug,gn,Rg,Gs,Hg,cc,Qg,Vg,Kg,bn,Jg,Ws,Xg,Gd,Zg,Yg,eb,so,Us,tb,pc,ob,nb,Rs,Wd,ab,uc,sb,rb,Ud,ib,hc,db,lb,kn,Hs,cb,mc,pb,ub,yn,Qs,hb,fc,mb,fb,vn,Vs,_b,Ks,gb,_c,bb,kb,Hu,Bo,Tn,gc,Js,yb,bc,vb,Qu,fe,Xs,Tb,Zs,wb,kc,xb,$b,Fb,yc,zb,qb,wn,jb,Ys,Bb,vc,Eb,Cb,Ab,xn,Mb,er,Pb,Rd,Sb,Ib,Ob,$n,tr,Nb,Tc,Lb,Vu,Eo,Fn,wc,or,Db,xc,Gb,Ku,yt,nr,Wb,ar,Ub,Hd,Rb,Hb,Qb,sr,Vb,rr,Kb,Jb,Xb,Ct,ir,Zb,Co,Yb,Qd,ek,tk,$c,ok,nk,ak,zn,sk,qn,Ju,Ao,jn,Fc,dr,rk,zc,ik,Xu,vt,lr,dk,cr,lk,Vd,ck,pk,uk,pr,hk,ur,mk,fk,_k,mt,hr,gk,Mo,bk,Kd,kk,yk,qc,vk,Tk,wk,Bn,xk,En,$k,Cn,Zu,Po,An,jc,mr,Fk,Bc,zk,Yu,ot,fr,qk,Ec,jk,Bk,_r,Ek,Jd,Ck,Ak,Mk,gr,Pk,br,Sk,Ik,Ok,ft,kr,Nk,So,Lk,Xd,Dk,Gk,Cc,Wk,Uk,Rk,Mn,Hk,Pn,Qk,Sn,eh,Io,In,Ac,yr,Vk,Mc,Kk,th,nt,vr,Jk,Oo,Xk,Pc,Zk,Yk,Sc,ey,ty,oy,Tr,ny,Zd,ay,sy,ry,wr,iy,xr,dy,ly,cy,At,$r,py,No,uy,Yd,hy,my,Ic,fy,_y,gy,On,by,Nn,oh,Lo,Ln,Oc,Fr,ky,Nc,yy,nh,at,zr,vy,Lc,Ty,wy,qr,xy,el,$y,Fy,zy,jr,qy,Br,jy,By,Ey,Dn,Er,Cy,Gn,ah,Do,Wn,Dc,Cr,Ay,Gc,My,sh,st,Ar,Py,Mr,Sy,tl,Iy,Oy,Ny,Pr,Ly,Sr,Dy,Gy,Wy,Un,Uy,Mt,Ir,Ry,Go,Hy,ol,Qy,Vy,Wc,Ky,Jy,Xy,Rn,Zy,Hn,rh,Wo,Qn,Uc,Or,Yy,Rc,ev,ih,rt,Nr,tv,Lr,ov,nl,nv,av,sv,Dr,rv,Gr,iv,dv,lv,Vn,cv,_t,Wr,pv,Uo,uv,al,hv,mv,Hc,fv,_v,gv,Kn,bv,Jn,kv,Xn,dh,Ro,Zn,Qc,Ur,yv,Vc,vv,lh,Pe,Rr,Tv,Kc,wv,xv,Hr,$v,sl,Fv,zv,qv,Qr,jv,Vr,Bv,Ev,Cv,Yn,Av,ro,Kr,Mv,Ho,Pv,rl,Sv,Iv,Jc,Ov,Nv,Lv,ea,ch,Qo,ta,Xc,Jr,Dv,Zc,Gv,ph,_e,Xr,Wv,Zr,Uv,il,Rv,Hv,Qv,Yr,Vv,ei,Kv,Jv,Xv,Yc,Zv,Yv,Gt,ep,ti,eT,tT,tp,oi,oT,nT,op,ni,aT,sT,np,ai,rT,iT,Pt,si,dT,Vo,lT,ap,cT,pT,sp,uT,hT,mT,oa,fT,na,_T,aa,ri,gT,sa,bT,ra,ii,kT,ia,uh,Ko,da,rp,di,yT,ip,vT,hh,ge,li,TT,ci,wT,dl,xT,$T,FT,pi,zT,ui,qT,jT,BT,dp,ET,CT,Wt,lp,hi,AT,MT,cp,mi,PT,ST,pp,fi,IT,OT,up,_i,NT,LT,gt,gi,DT,Jo,GT,hp,WT,UT,mp,RT,HT,QT,la,VT,ca,KT,pa,JT,ua,bi,XT,ha,ZT,ma,ki,YT,fa,mh,Xo,_a,fp,yi,ew,_p,tw,fh,J,vi,ow,gp,nw,aw,Ti,sw,ll,rw,iw,dw,wi,lw,xi,cw,pw,uw,bp,hw,mw,Ut,kp,$i,fw,_w,yp,Fi,gw,bw,vp,zi,kw,yw,Tp,qi,vw,Tw,St,ji,ww,Zo,xw,wp,$w,Fw,xp,zw,qw,jw,ga,Bw,ba,Ew,ka,Bi,Cw,ya,Aw,va,Ei,Mw,Ta,_h,Yo,wa,$p,Ci,Pw,Fp,Sw,gh,X,Ai,Iw,en,Ow,zp,Nw,Lw,qp,Dw,Gw,Ww,Mi,Uw,cl,Rw,Hw,Qw,Pi,Vw,Si,Kw,Jw,Xw,jp,Zw,Yw,Rt,Bp,Ii,e2,t2,Ep,Oi,o2,n2,Cp,Ni,a2,s2,Ap,Li,r2,i2,It,Di,d2,tn,l2,Mp,c2,p2,Pp,u2,h2,m2,xa,f2,$a,_2,Fa,Gi,g2,za,b2,qa,Wi,k2,ja,bh,on,Ba,Sp,Ui,y2,Ip,v2,kh,xe,Ri,T2,Op,w2,x2,Hi,$2,pl,F2,z2,q2,Qi,j2,Vi,B2,E2,C2,Np,A2,M2,Ht,Lp,Ki,P2,S2,Dp,Ji,I2,O2,Gp,Xi,N2,L2,Wp,Zi,D2,G2,Ot,Yi,W2,nn,U2,Up,R2,H2,Rp,Q2,V2,K2,Ea,J2,Ca,yh;return r=new ae({}),Y=new ae({}),Ya=new ae({}),ss=new ae({}),rs=new ae({}),is=new O({props:{code:`from transformers import BartForConditionalGeneration, BartTokenizer

model = BartForConditionalGeneration.from_pretrained("facebook/bart-large", forced_bos_token_id=0)
tok = BartTokenizer.from_pretrained("facebook/bart-large")
example_english_phrase = "UN Chief Says There Is No <mask> in Syria"
batch = tok(example_english_phrase, return_tensors="pt")
generated_ids = model.generate(batch["input_ids"])
assert tok.batch_decode(generated_ids, skip_special_tokens=True) == [
    "UN Chief Says There Is No Plan to Stop Chemical Weapons in Syria"
]`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BartForConditionalGeneration, BartTokenizer

model = BartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large&quot;</span>, forced_bos_token_id=<span class="hljs-number">0</span>)
tok = BartTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large&quot;</span>)
example_english_phrase = <span class="hljs-string">&quot;UN Chief Says There Is No &lt;mask&gt; in Syria&quot;</span>
batch = tok(example_english_phrase, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
generated_ids = model.generate(batch[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-keyword">assert</span> tok.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>) == [
    <span class="hljs-string">&quot;UN Chief Says There Is No Plan to Stop Chemical Weapons in Syria&quot;</span>
]`}}),ds=new ae({}),ls=new o1({props:{pipeline:"summarization"}}),Ts=new o1({props:{pipeline:"fill-mask"}}),Bs=new o1({props:{pipeline:"translation"}}),Is=new ae({}),Os=new C({props:{name:"class transformers.BartConfig",anchor:"transformers.BartConfig",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:"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:"use_cache",val:" = True"},{name:"num_labels",val:" = 3"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"is_encoder_decoder",val:" = True"},{name:"decoder_start_token_id",val:" = 2"},{name:"forced_eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BartConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the BART model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartModel">BartModel</a> or <a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.TFBartModel">TFBartModel</a>.`,name:"vocab_size"},{anchor:"transformers.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.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.BartConfig.num_labels",description:`<strong>num_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of labels to use in <a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartForSequenceClassification">BartForSequenceClassification</a>.`,name:"num_labels"},{anchor:"transformers.BartConfig.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/v4.29.0/src/transformers/models/bart/configuration_bart.py#L35"}}),fn=new G({props:{anchor:"transformers.BartConfig.example",$$slots:{default:[AF]},$$scope:{ctx:z}}}),Ls=new ae({}),Ds=new C({props:{name:"class transformers.BartTokenizer",anchor:"transformers.BartTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"errors",val:" = 'replace'"},{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:"add_prefix_space",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BartTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.BartTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.BartTokenizer.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.BartTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.BartTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.BartTokenizer.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.BartTokenizer.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.BartTokenizer.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.BartTokenizer.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.BartTokenizer.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.BartTokenizer.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (BART tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/tokenization_bart.py#L101"}}),gn=new G({props:{anchor:"transformers.BartTokenizer.example",$$slots:{default:[MF]},$$scope:{ctx:z}}}),bn=new Se({props:{$$slots:{default:[PF]},$$scope:{ctx:z}}}),Us=new C({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BartTokenizer.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.BartTokenizer.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.BartTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/tokenization_bart.py#L340",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>
`}}),Hs=new C({props:{name:"convert_tokens_to_string",anchor:"transformers.BartTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/tokenization_bart.py#L305"}}),Qs=new C({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BartTokenizer.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.BartTokenizer.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.BartTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/tokenization_bart.py#L392",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Vs=new C({props:{name:"get_special_tokens_mask",anchor:"transformers.BartTokenizer.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.BartTokenizer.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.BartTokenizer.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.BartTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/tokenization_bart.py#L365",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>
`}}),Js=new ae({}),Xs=new C({props:{name:"class transformers.BartTokenizerFast",anchor:"transformers.BartTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"errors",val:" = 'replace'"},{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:"add_prefix_space",val:" = False"},{name:"trim_offsets",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BartTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.BartTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.BartTokenizerFast.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.BartTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.BartTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.BartTokenizerFast.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.BartTokenizerFast.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.BartTokenizerFast.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.BartTokenizerFast.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.BartTokenizerFast.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.BartTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (BART tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"},{anchor:"transformers.BartTokenizerFast.trim_offsets",description:`<strong>trim_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the post processing step should trim offsets to avoid including whitespaces.`,name:"trim_offsets"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/tokenization_bart_fast.py#L70"}}),wn=new G({props:{anchor:"transformers.BartTokenizerFast.example",$$slots:{default:[SF]},$$scope:{ctx:z}}}),xn=new Se({props:{$$slots:{default:[IF]},$$scope:{ctx:z}}}),tr=new C({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BartTokenizerFast.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.BartTokenizerFast.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.BartTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/tokenization_bart_fast.py#L285",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),or=new ae({}),nr=new C({props:{name:"class transformers.BartModel",anchor:"transformers.BartModel",parameters:[{name:"config",val:": BartConfig"}],parametersDescription:[{anchor:"transformers.BartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1166"}}),ir=new C({props:{name:"forward",anchor:"transformers.BartModel.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:"past_key_values",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:"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.BartModel.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.BartModel.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.BartModel.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>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.BartModel.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.</p>
<p>If you want to change padding behavior, you should read <code>modeling_bart._prepare_decoder_attention_mask</code>
and 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.BartModel.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.BartModel.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.BartModel.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.BartModel.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.BartModel.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.BartModel.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.BartModel.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.BartModel.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.BartModel.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.BartModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1195",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),zn=new Se({props:{$$slots:{default:[OF]},$$scope:{ctx:z}}}),qn=new G({props:{anchor:"transformers.BartModel.forward.example",$$slots:{default:[NF]},$$scope:{ctx:z}}}),dr=new ae({}),lr=new C({props:{name:"class transformers.BartForConditionalGeneration",anchor:"transformers.BartForConditionalGeneration",parameters:[{name:"config",val:": BartConfig"}],parametersDescription:[{anchor:"transformers.BartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1293"}}),hr=new C({props:{name:"forward",anchor:"transformers.BartForConditionalGeneration.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:"past_key_values",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.BartForConditionalGeneration.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.BartForConditionalGeneration.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.BartForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>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.BartForConditionalGeneration.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.</p>
<p>If you want to change padding behavior, you should read <code>modeling_bart._prepare_decoder_attention_mask</code>
and 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.BartForConditionalGeneration.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.BartForConditionalGeneration.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.BartForConditionalGeneration.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.BartForConditionalGeneration.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.BartForConditionalGeneration.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.BartForConditionalGeneration.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.BartForConditionalGeneration.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.BartForConditionalGeneration.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.BartForConditionalGeneration.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.BartForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BartForConditionalGeneration.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/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1337",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Bn=new Se({props:{$$slots:{default:[LF]},$$scope:{ctx:z}}}),En=new G({props:{anchor:"transformers.BartForConditionalGeneration.forward.example",$$slots:{default:[DF]},$$scope:{ctx:z}}}),Cn=new G({props:{anchor:"transformers.BartForConditionalGeneration.forward.example-2",$$slots:{default:[GF]},$$scope:{ctx:z}}}),mr=new ae({}),fr=new C({props:{name:"class transformers.BartForSequenceClassification",anchor:"transformers.BartForSequenceClassification",parameters:[{name:"config",val:": BartConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BartForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1472"}}),kr=new C({props:{name:"forward",anchor:"transformers.BartForSequenceClassification.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.BartForSequenceClassification.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.BartForSequenceClassification.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.BartForSequenceClassification.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>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.BartForSequenceClassification.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.</p>
<p>If you want to change padding behavior, you should read <code>modeling_bart._prepare_decoder_attention_mask</code>
and 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.BartForSequenceClassification.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.BartForSequenceClassification.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.BartForSequenceClassification.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.BartForSequenceClassification.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.BartForSequenceClassification.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.BartForSequenceClassification.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.BartForSequenceClassification.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.BartForSequenceClassification.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.BartForSequenceClassification.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.BartForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BartForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1488",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Mn=new Se({props:{$$slots:{default:[WF]},$$scope:{ctx:z}}}),Pn=new G({props:{anchor:"transformers.BartForSequenceClassification.forward.example",$$slots:{default:[UF]},$$scope:{ctx:z}}}),Sn=new G({props:{anchor:"transformers.BartForSequenceClassification.forward.example-2",$$slots:{default:[RF]},$$scope:{ctx:z}}}),yr=new ae({}),vr=new C({props:{name:"class transformers.BartForQuestionAnswering",anchor:"transformers.BartForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BartForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1602"}}),$r=new C({props:{name:"forward",anchor:"transformers.BartForQuestionAnswering.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.BartForQuestionAnswering.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.BartForQuestionAnswering.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.BartForQuestionAnswering.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>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.BartForQuestionAnswering.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.</p>
<p>If you want to change padding behavior, you should read <code>modeling_bart._prepare_decoder_attention_mask</code>
and 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.BartForQuestionAnswering.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.BartForQuestionAnswering.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.BartForQuestionAnswering.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.BartForQuestionAnswering.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.BartForQuestionAnswering.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.BartForQuestionAnswering.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.BartForQuestionAnswering.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.BartForQuestionAnswering.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.BartForQuestionAnswering.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.BartForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BartForQuestionAnswering.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.BartForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1617",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),On=new Se({props:{$$slots:{default:[HF]},$$scope:{ctx:z}}}),Nn=new G({props:{anchor:"transformers.BartForQuestionAnswering.forward.example",$$slots:{default:[QF]},$$scope:{ctx:z}}}),Fr=new ae({}),zr=new C({props:{name:"class transformers.BartForCausalLM",anchor:"transformers.BartForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BartForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1740"}}),Er=new C({props:{name:"forward",anchor:"transformers.BartForCausalLM.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.BartForCausalLM.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.BartForCausalLM.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.BartForCausalLM.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.BartForCausalLM.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.BartForCausalLM.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.BartForCausalLM.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.BartForCausalLM.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.BartForCausalLM.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.BartForCausalLM.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.BartForCausalLM.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.BartForCausalLM.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.BartForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_bart.py#L1773",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Gn=new G({props:{anchor:"transformers.BartForCausalLM.forward.example",$$slots:{default:[VF]},$$scope:{ctx:z}}}),Cr=new ae({}),Ar=new C({props:{name:"class transformers.TFBartModel",anchor:"transformers.TFBartModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/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/v4.29.0/src/transformers/models/bart/modeling_tf_bart.py#L1185"}}),Un=new Se({props:{$$slots:{default:[KF]},$$scope:{ctx:z}}}),Ir=new C({props:{name:"call",anchor:"transformers.TFBartModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_input_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_outputs",val:": typing.Union[typing.Tuple, transformers.modeling_tf_outputs.TFBaseModelOutput, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBartModel.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/v4.29.0/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.TFBartModel.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.TFBartModel.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>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.TFBartModel.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.TFBartModel.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.TFBartModel.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.TFBartModel.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.TFBartModel.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.TFBartModel.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.TFBartModel.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.TFBartModel.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.TFBartModel.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.TFBartModel.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.TFBartModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBartModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_tf_bart.py#L1199",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Rn=new Se({props:{$$slots:{default:[JF]},$$scope:{ctx:z}}}),Hn=new G({props:{anchor:"transformers.TFBartModel.call.example",$$slots:{default:[XF]},$$scope:{ctx:z}}}),Or=new ae({}),Nr=new C({props:{name:"class transformers.TFBartForConditionalGeneration",anchor:"transformers.TFBartForConditionalGeneration",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/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/v4.29.0/src/transformers/models/bart/modeling_tf_bart.py#L1290"}}),Vn=new Se({props:{$$slots:{default:[ZF]},$$scope:{ctx:z}}}),Wr=new C({props:{name:"call",anchor:"transformers.TFBartForConditionalGeneration.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_input_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_outputs",val:": typing.Optional[transformers.modeling_tf_outputs.TFBaseModelOutput] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBartForConditionalGeneration.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/v4.29.0/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBartForConditionalGeneration.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.TFBartForConditionalGeneration.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/v4.29.0/src/transformers/models/bart/modeling_tf_bart.py#L1326",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Kn=new Se({props:{$$slots:{default:[YF]},$$scope:{ctx:z}}}),Jn=new G({props:{anchor:"transformers.TFBartForConditionalGeneration.call.example",$$slots:{default:[ez]},$$scope:{ctx:z}}}),Xn=new G({props:{anchor:"transformers.TFBartForConditionalGeneration.call.example-2",$$slots:{default:[tz]},$$scope:{ctx:z}}}),Ur=new ae({}),Rr=new C({props:{name:"class transformers.TFBartForSequenceClassification",anchor:"transformers.TFBartForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBartForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/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/v4.29.0/src/transformers/models/bart/modeling_tf_bart.py#L1479"}}),Yn=new Se({props:{$$slots:{default:[oz]},$$scope:{ctx:z}}}),Kr=new C({props:{name:"call",anchor:"transformers.TFBartForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_input_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_outputs",val:": typing.Optional[transformers.modeling_tf_outputs.TFBaseModelOutput] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBartForSequenceClassification.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/v4.29.0/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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.TFBartForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBartForSequenceClassification.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.TFBartForSequenceClassification.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 sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_tf_bart.py#L1497",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</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>tf.Tensor</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>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>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ea=new Se({props:{$$slots:{default:[nz]},$$scope:{ctx:z}}}),Jr=new ae({}),Xr=new C({props:{name:"class transformers.FlaxBartModel",anchor:"transformers.FlaxBartModel",parameters:[{name:"config",val:": BartConfig"},{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.FlaxBartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartModel.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/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1242"}}),si=new C({props:{name:"__call__",anchor:"transformers.FlaxBartModel.__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.FlaxBartModel.__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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartModel.__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.FlaxBartModel.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartModel.__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.FlaxBartModel.__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.FlaxBartModel.__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.FlaxBartModel.__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.FlaxBartModel.__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.FlaxBartModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1177",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oa=new Se({props:{$$slots:{default:[az]},$$scope:{ctx:z}}}),na=new G({props:{anchor:"transformers.FlaxBartModel.__call__.example",$$slots:{default:[sz]},$$scope:{ctx:z}}}),ri=new C({props:{name:"encode",anchor:"transformers.FlaxBartModel.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.FlaxBartModel.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartModel.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.FlaxBartModel.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.FlaxBartModel.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.FlaxBartModel.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.FlaxBartModel.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),sa=new G({props:{anchor:"transformers.FlaxBartModel.encode.example",$$slots:{default:[rz]},$$scope:{ctx:z}}}),ii=new C({props:{name:"decode",anchor:"transformers.FlaxBartModel.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.FlaxBartModel.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartModel.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.FlaxBartModel.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.FlaxBartModel.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.FlaxBartModel.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.FlaxBartModel.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.FlaxBartModel.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.FlaxBartModel.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.FlaxBartModel.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1063",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ia=new G({props:{anchor:"transformers.FlaxBartModel.decode.example",$$slots:{default:[iz]},$$scope:{ctx:z}}}),di=new ae({}),li=new C({props:{name:"class transformers.FlaxBartForConditionalGeneration",anchor:"transformers.FlaxBartForConditionalGeneration",parameters:[{name:"config",val:": BartConfig"},{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.FlaxBartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForConditionalGeneration.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/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1326"}}),gi=new C({props:{name:"__call__",anchor:"transformers.FlaxBartForConditionalGeneration.__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.FlaxBartForConditionalGeneration.__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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForConditionalGeneration.__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.FlaxBartForConditionalGeneration.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForConditionalGeneration.__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.FlaxBartForConditionalGeneration.__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.FlaxBartForConditionalGeneration.__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.FlaxBartForConditionalGeneration.__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.FlaxBartForConditionalGeneration.__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.FlaxBartForConditionalGeneration.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1177",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),la=new Se({props:{$$slots:{default:[dz]},$$scope:{ctx:z}}}),ca=new G({props:{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.example",$$slots:{default:[lz]},$$scope:{ctx:z}}}),pa=new G({props:{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.example-2",$$slots:{default:[cz]},$$scope:{ctx:z}}}),bi=new C({props:{name:"encode",anchor:"transformers.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ha=new G({props:{anchor:"transformers.FlaxBartForConditionalGeneration.encode.example",$$slots:{default:[pz]},$$scope:{ctx:z}}}),ki=new C({props:{name:"decode",anchor:"transformers.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.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.FlaxBartForConditionalGeneration.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1330",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fa=new G({props:{anchor:"transformers.FlaxBartForConditionalGeneration.decode.example",$$slots:{default:[uz]},$$scope:{ctx:z}}}),yi=new ae({}),vi=new C({props:{name:"class transformers.FlaxBartForSequenceClassification",anchor:"transformers.FlaxBartForSequenceClassification",parameters:[{name:"config",val:": BartConfig"},{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.FlaxBartForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForSequenceClassification.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/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1639"}}),ji=new C({props:{name:"__call__",anchor:"transformers.FlaxBartForSequenceClassification.__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.FlaxBartForSequenceClassification.__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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForSequenceClassification.__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.FlaxBartForSequenceClassification.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForSequenceClassification.__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.FlaxBartForSequenceClassification.__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.FlaxBartForSequenceClassification.__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.FlaxBartForSequenceClassification.__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.FlaxBartForSequenceClassification.__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.FlaxBartForSequenceClassification.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1177",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ga=new Se({props:{$$slots:{default:[hz]},$$scope:{ctx:z}}}),ba=new G({props:{anchor:"transformers.FlaxBartForSequenceClassification.__call__.example",$$slots:{default:[mz]},$$scope:{ctx:z}}}),Bi=new C({props:{name:"encode",anchor:"transformers.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ya=new G({props:{anchor:"transformers.FlaxBartForSequenceClassification.encode.example",$$slots:{default:[fz]},$$scope:{ctx:z}}}),Ei=new C({props:{name:"decode",anchor:"transformers.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.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.FlaxBartForSequenceClassification.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1063",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ta=new G({props:{anchor:"transformers.FlaxBartForSequenceClassification.decode.example",$$slots:{default:[_z]},$$scope:{ctx:z}}}),Ci=new ae({}),Ai=new C({props:{name:"class transformers.FlaxBartForQuestionAnswering",anchor:"transformers.FlaxBartForQuestionAnswering",parameters:[{name:"config",val:": BartConfig"},{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.FlaxBartForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForQuestionAnswering.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/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1725"}}),Di=new C({props:{name:"__call__",anchor:"transformers.FlaxBartForQuestionAnswering.__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.FlaxBartForQuestionAnswering.__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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForQuestionAnswering.__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.FlaxBartForQuestionAnswering.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForQuestionAnswering.__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.FlaxBartForQuestionAnswering.__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.FlaxBartForQuestionAnswering.__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.FlaxBartForQuestionAnswering.__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.FlaxBartForQuestionAnswering.__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.FlaxBartForQuestionAnswering.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1177",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</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/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xa=new Se({props:{$$slots:{default:[gz]},$$scope:{ctx:z}}}),$a=new G({props:{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.example",$$slots:{default:[bz]},$$scope:{ctx:z}}}),Gi=new C({props:{name:"encode",anchor:"transformers.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),za=new G({props:{anchor:"transformers.FlaxBartForQuestionAnswering.encode.example",$$slots:{default:[kz]},$$scope:{ctx:z}}}),Wi=new C({props:{name:"decode",anchor:"transformers.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.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.FlaxBartForQuestionAnswering.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1063",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ja=new G({props:{anchor:"transformers.FlaxBartForQuestionAnswering.decode.example",$$slots:{default:[yz]},$$scope:{ctx:z}}}),Ui=new ae({}),Ri=new C({props:{name:"class transformers.FlaxBartForCausalLM",anchor:"transformers.FlaxBartForCausalLM",parameters:[{name:"config",val:": BartConfig"},{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.FlaxBartForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForCausalLM.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/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1961"}}),Yi=new C({props:{name:"__call__",anchor:"transformers.FlaxBartForCausalLM.__call__",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:"encoder_hidden_states",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForCausalLM.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.FlaxBartForCausalLM.__call__.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.FlaxBartForCausalLM.__call__.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.FlaxBartForCausalLM.__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.FlaxBartForCausalLM.__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.FlaxBartForCausalLM.__call__.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.FlaxBartForCausalLM.__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.FlaxBartForCausalLM.__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.FlaxBartForCausalLM.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/bart/modeling_flax_bart.py#L1799",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartConfig"
>BartConfig</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>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ea=new Se({props:{$$slots:{default:[vz]},$$scope:{ctx:z}}}),Ca=new G({props:{anchor:"transformers.FlaxBartForCausalLM.__call__.example",$$slots:{default:[Tz]},$$scope:{ctx:z}}}),{c(){l=n("meta"),k=c(),f=n("h1"),m=n("a"),b=n("span"),y(r.$$.fragment),h=c(),q=n("span"),se=i("BART"),H=c(),I=n("div"),re=n("a"),ie=n("img"),Re=c(),V=n("a"),$e=n("img"),Z=c(),de=n("p"),Ce=n("strong"),le=i("DISCLAIMER:"),He=i(" If you see something strange, file a "),we=n("a"),ce=i("Github Issue"),Qe=i(` and assign
@patrickvonplaten`),Ie=c(),N=n("h2"),be=n("a"),Ae=n("span"),y(Y.$$.fragment),A=c(),M=n("span"),Ve=i("Overview"),ee=c(),ke=n("p"),Ke=i("The Bart model was proposed in "),Q=n("a"),Je=i(`BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation,
Translation, and Comprehension`),Xe=i(` by Mike Lewis, Yinhan Liu, Naman Goyal, Marjan
Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov and Luke Zettlemoyer on 29 Oct, 2019.`),P=c(),Fe=n("p"),pe=i("According to the abstract,"),Oe=c(),te=n("ul"),K=n("li"),Ze=i(`Bart uses a standard seq2seq/machine translation architecture with a bidirectional encoder (like BERT) and a
left-to-right decoder (like GPT).`),Ye=c(),U=n("li"),et=i(`The pretraining task involves randomly shuffling the order of the original sentences and a novel in-filling scheme,
where spans of text are replaced with a single mask token.`),ue=c(),Me=n("li"),ze=i(`BART is particularly effective when fine tuned for text generation but also works well for comprehension tasks. It
matches the performance of RoBERTa with comparable training resources on GLUE and SQuAD, achieves new
state-of-the-art results on a range of abstractive dialogue, question answering, and summarization tasks, with gains
of up to 6 ROUGE.`),S=c(),qe=n("p"),L=i("Tips:"),Ne=c(),ye=n("ul"),F=n("li"),B=n("p"),wt=i(`BART is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),je=c(),Le=n("li"),dt=n("p"),E=i("Sequence-to-sequence model with an encoder and a decoder. Encoder is fed a corrupted version of the tokens, decoder is fed the original tokens (but has a mask to hide the future words like a regular transformers decoder). A composition of the following transformations are applied on the pretraining tasks for the encoder:"),xt=c(),oe=n("ul"),lt=n("li"),$t=i("mask random tokens (like in BERT)"),Ft=c(),R=n("li"),he=i("delete random tokens"),zt=c(),ct=n("li"),me=i("mask a span of k tokens with a single mask token (a span of 0 tokens is an insertion of a mask token)"),qt=c(),pt=n("li"),tt=i("permute sentences"),jt=c(),ve=n("li"),Bt=i("rotate the document to make it start at a specific token"),xu=c(),Vt=n("p"),Sm=i("This model was contributed by "),Xa=n("a"),Im=i("sshleifer"),Om=i(". The Authors\u2019 code can be found "),Za=n("a"),Nm=i("here"),Lm=i("."),$u=c(),ko=n("h3"),dn=n("a"),Pl=n("span"),y(Ya.$$.fragment),Dm=c(),Sl=n("span"),Gm=i("Examples"),Fu=c(),Kt=n("ul"),es=n("li"),Wm=i(`Examples and scripts for fine-tuning BART and other models for sequence to sequence tasks can be found in
`),ts=n("a"),Um=i("examples/pytorch/summarization/"),Rm=i("."),Hm=c(),Lt=n("li"),Qm=i("An example of how to train "),fd=n("a"),Vm=i("BartForConditionalGeneration"),Km=i(" with a Hugging Face "),Il=n("code"),Jm=i("datasets"),Xm=i(`
object can be found in this `),os=n("a"),Zm=i("forum discussion"),Ym=i("."),ef=c(),ln=n("li"),ns=n("a"),tf=i("Distilled checkpoints"),of=i(" are described in this "),as=n("a"),nf=i("paper"),af=i("."),zu=c(),yo=n("h2"),cn=n("a"),Ol=n("span"),y(ss.$$.fragment),sf=c(),Nl=n("span"),rf=i("Implementation Notes"),qu=c(),ut=n("ul"),Dt=n("li"),df=i("Bart doesn\u2019t use "),Ll=n("code"),lf=i("token_type_ids"),cf=i(" for sequence classification. Use "),_d=n("a"),pf=i("BartTokenizer"),uf=i(` or
`),gd=n("a"),hf=i("encode()"),mf=i(" to get the proper splitting."),ff=c(),vo=n("li"),_f=i("The forward pass of "),bd=n("a"),gf=i("BartModel"),bf=i(" will create the "),Dl=n("code"),kf=i("decoder_input_ids"),yf=i(` if they are not passed.
This is different than some other modeling APIs. A typical use case of this feature is mask filling.`),vf=c(),To=n("li"),Tf=i(`Model predictions are intended to be identical to the original implementation when
`),Gl=n("code"),wf=i("forced_bos_token_id=0"),xf=i(`. This only works, however, if the string you pass to
`),Wl=n("code"),$f=i("fairseq.encode"),Ff=i(" starts with a space."),zf=c(),kd=n("li"),yd=n("a"),qf=i("generate()"),jf=i(` should be used for conditional generation tasks like
summarization, see the example in that docstrings.`),Bf=c(),wo=n("li"),Ef=i("Models that load the "),Ul=n("em"),Cf=i("facebook/bart-large-cnn"),Af=i(" weights will not have a "),Rl=n("code"),Mf=i("mask_token_id"),Pf=i(`, or be able to perform
mask-filling tasks.`),ju=c(),xo=n("h2"),pn=n("a"),Hl=n("span"),y(rs.$$.fragment),Sf=c(),Ql=n("span"),If=i("Mask Filling"),Bu=c(),Jt=n("p"),Of=i("The "),Vl=n("code"),Nf=i("facebook/bart-base"),Lf=i(" and "),Kl=n("code"),Df=i("facebook/bart-large"),Gf=i(" checkpoints can be used to fill multi-token masks."),Eu=c(),y(is.$$.fragment),Cu=c(),$o=n("h2"),un=n("a"),Jl=n("span"),y(ds.$$.fragment),Wf=c(),Xl=n("span"),Uf=i("Resources"),Au=c(),vd=n("p"),Rf=i("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BART. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Mu=c(),y(ls.$$.fragment),Pu=c(),Te=n("ul"),cs=n("li"),Hf=i("A blog post on "),ps=n("a"),Qf=i("Distributed Training: Train BART/T5 for Summarization using \u{1F917} Transformers and Amazon SageMaker"),Vf=i("."),Kf=c(),us=n("li"),Jf=i("A notebook on how to "),hs=n("a"),Xf=i("finetune BART for summarization with fastai using blurr"),Zf=i(". \u{1F30E}"),Yf=c(),ms=n("li"),e_=i("A notebook on how to "),fs=n("a"),t_=i("finetune BART for summarization in two languages with Trainer class"),o_=i(". \u{1F30E}"),n_=c(),Xt=n("li"),Td=n("a"),a_=i("BartForConditionalGeneration"),s_=i(" is supported by this "),_s=n("a"),r_=i("example script"),i_=i(" and "),gs=n("a"),d_=i("notebook"),l_=i("."),c_=c(),Zt=n("li"),wd=n("a"),p_=i("TFBartForConditionalGeneration"),u_=i(" is supported by this "),bs=n("a"),h_=i("example script"),m_=i(" and "),ks=n("a"),f_=i("notebook"),__=i("."),g_=c(),hn=n("li"),xd=n("a"),b_=i("FlaxBartForConditionalGeneration"),k_=i(" is supported by this "),ys=n("a"),y_=i("example script"),v_=i("."),T_=c(),$d=n("li"),vs=n("a"),w_=i("Summarization"),x_=i(" chapter of the \u{1F917} Hugging Face course."),$_=c(),Zl=n("li"),Fd=n("a"),F_=i("Summarization task guide"),Su=c(),y(Ts.$$.fragment),Iu=c(),ht=n("ul"),Yt=n("li"),zd=n("a"),z_=i("BartForConditionalGeneration"),q_=i(" is supported by this "),ws=n("a"),j_=i("example script"),B_=i(" and "),xs=n("a"),E_=i("notebook"),C_=i("."),A_=c(),eo=n("li"),qd=n("a"),M_=i("TFBartForConditionalGeneration"),P_=i(" is supported by this "),$s=n("a"),S_=i("example script"),I_=i(" and "),Fs=n("a"),O_=i("notebook"),N_=i("."),L_=c(),to=n("li"),jd=n("a"),D_=i("FlaxBartForConditionalGeneration"),G_=i(" is supported by this "),zs=n("a"),W_=i("example script"),U_=i(" and "),qs=n("a"),R_=i("notebook"),H_=i("."),Q_=c(),Bd=n("li"),js=n("a"),V_=i("Masked language modeling"),K_=i(" chapter of the \u{1F917} Hugging Face Course."),J_=c(),Yl=n("li"),Ed=n("a"),X_=i("Masked language modeling task guide"),Ou=c(),y(Bs.$$.fragment),Nu=c(),Et=n("ul"),Es=n("li"),Z_=i("A notebook on how to "),Cs=n("a"),Y_=i("finetune mBART using Seq2SeqTrainer for Hindi to English translation"),eg=i(". \u{1F30E}"),tg=c(),oo=n("li"),Cd=n("a"),og=i("BartForConditionalGeneration"),ng=i(" is supported by this "),As=n("a"),ag=i("example script"),sg=i(" and "),Ms=n("a"),rg=i("notebook"),ig=i("."),dg=c(),no=n("li"),Ad=n("a"),lg=i("TFBartForConditionalGeneration"),cg=i(" is supported by this "),Ps=n("a"),pg=i("example script"),ug=i(" and "),Ss=n("a"),hg=i("notebook"),mg=i("."),fg=c(),ec=n("li"),Md=n("a"),_g=i("Translation task guide"),Lu=c(),Pd=n("p"),gg=i("See also:"),Du=c(),ao=n("ul"),tc=n("li"),Sd=n("a"),bg=i("Text classification task guide"),kg=c(),oc=n("li"),Id=n("a"),yg=i("Question answering task guide"),vg=c(),nc=n("li"),Od=n("a"),Tg=i("Causal language modeling task guide"),Gu=c(),Fo=n("h2"),mn=n("a"),ac=n("span"),y(Is.$$.fragment),wg=c(),sc=n("span"),xg=i("BartConfig"),Wu=c(),kt=n("div"),y(Os.$$.fragment),$g=c(),zo=n("p"),Fg=i("This is the configuration class to store the configuration of a "),Nd=n("a"),zg=i("BartModel"),qg=i(`. It is used to instantiate a BART
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 BART
`),Ns=n("a"),jg=i("facebook/bart-large"),Bg=i(" architecture."),Eg=c(),qo=n("p"),Cg=i("Configuration objects inherit from "),Ld=n("a"),Ag=i("PretrainedConfig"),Mg=i(` and can be used to control the model outputs. Read the
documentation from `),Dd=n("a"),Pg=i("PretrainedConfig"),Sg=i(" for more information."),Ig=c(),y(fn.$$.fragment),Uu=c(),jo=n("h2"),_n=n("a"),rc=n("span"),y(Ls.$$.fragment),Og=c(),ic=n("span"),Ng=i("BartTokenizer"),Ru=c(),D=n("div"),y(Ds.$$.fragment),Lg=c(),dc=n("p"),Dg=i("Constructs a BART tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),Gg=c(),lc=n("p"),Wg=i("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Ug=c(),y(gn.$$.fragment),Rg=c(),Gs=n("p"),Hg=i("You can get around that behavior by passing "),cc=n("code"),Qg=i("add_prefix_space=True"),Vg=i(` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),Kg=c(),y(bn.$$.fragment),Jg=c(),Ws=n("p"),Xg=i("This tokenizer inherits from "),Gd=n("a"),Zg=i("PreTrainedTokenizer"),Yg=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),eb=c(),so=n("div"),y(Us.$$.fragment),tb=c(),pc=n("p"),ob=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BART sequence has the following format:`),nb=c(),Rs=n("ul"),Wd=n("li"),ab=i("single sequence: "),uc=n("code"),sb=i("<s> X </s>"),rb=c(),Ud=n("li"),ib=i("pair of sequences: "),hc=n("code"),db=i("<s> A </s></s> B </s>"),lb=c(),kn=n("div"),y(Hs.$$.fragment),cb=c(),mc=n("p"),pb=i("Converts a sequence of tokens (string) in a single string."),ub=c(),yn=n("div"),y(Qs.$$.fragment),hb=c(),fc=n("p"),mb=i(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. BART does not
make use of token type ids, therefore a list of zeros is returned.`),fb=c(),vn=n("div"),y(Vs.$$.fragment),_b=c(),Ks=n("p"),gb=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 `),_c=n("code"),bb=i("prepare_for_model"),kb=i(" method."),Hu=c(),Bo=n("h2"),Tn=n("a"),gc=n("span"),y(Js.$$.fragment),yb=c(),bc=n("span"),vb=i("BartTokenizerFast"),Qu=c(),fe=n("div"),y(Xs.$$.fragment),Tb=c(),Zs=n("p"),wb=i("Construct a \u201Cfast\u201D BART tokenizer (backed by HuggingFace\u2019s "),kc=n("em"),xb=i("tokenizers"),$b=i(` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),Fb=c(),yc=n("p"),zb=i("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),qb=c(),y(wn.$$.fragment),jb=c(),Ys=n("p"),Bb=i("You can get around that behavior by passing "),vc=n("code"),Eb=i("add_prefix_space=True"),Cb=i(` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),Ab=c(),y(xn.$$.fragment),Mb=c(),er=n("p"),Pb=i("This tokenizer inherits from "),Rd=n("a"),Sb=i("PreTrainedTokenizerFast"),Ib=i(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Ob=c(),$n=n("div"),y(tr.$$.fragment),Nb=c(),Tc=n("p"),Lb=i(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. BART does not
make use of token type ids, therefore a list of zeros is returned.`),Vu=c(),Eo=n("h2"),Fn=n("a"),wc=n("span"),y(or.$$.fragment),Db=c(),xc=n("span"),Gb=i("BartModel"),Ku=c(),yt=n("div"),y(nr.$$.fragment),Wb=c(),ar=n("p"),Ub=i(`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Hd=n("a"),Rb=i("PreTrainedModel"),Hb=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.)`),Qb=c(),sr=n("p"),Vb=i("This model is also a PyTorch "),rr=n("a"),Kb=i("torch.nn.Module"),Jb=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xb=c(),Ct=n("div"),y(ir.$$.fragment),Zb=c(),Co=n("p"),Yb=i("The "),Qd=n("a"),ek=i("BartModel"),tk=i(" forward method, overrides the "),$c=n("code"),ok=i("__call__"),nk=i(" special method."),ak=c(),y(zn.$$.fragment),sk=c(),y(qn.$$.fragment),Ju=c(),Ao=n("h2"),jn=n("a"),Fc=n("span"),y(dr.$$.fragment),rk=c(),zc=n("span"),ik=i("BartForConditionalGeneration"),Xu=c(),vt=n("div"),y(lr.$$.fragment),dk=c(),cr=n("p"),lk=i(`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Vd=n("a"),ck=i("PreTrainedModel"),pk=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.)`),uk=c(),pr=n("p"),hk=i("This model is also a PyTorch "),ur=n("a"),mk=i("torch.nn.Module"),fk=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_k=c(),mt=n("div"),y(hr.$$.fragment),gk=c(),Mo=n("p"),bk=i("The "),Kd=n("a"),kk=i("BartForConditionalGeneration"),yk=i(" forward method, overrides the "),qc=n("code"),vk=i("__call__"),Tk=i(" special method."),wk=c(),y(Bn.$$.fragment),xk=c(),y(En.$$.fragment),$k=c(),y(Cn.$$.fragment),Zu=c(),Po=n("h2"),An=n("a"),jc=n("span"),y(mr.$$.fragment),Fk=c(),Bc=n("span"),zk=i("BartForSequenceClassification"),Yu=c(),ot=n("div"),y(fr.$$.fragment),qk=c(),Ec=n("p"),jk=i(`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),Bk=c(),_r=n("p"),Ek=i("This model inherits from "),Jd=n("a"),Ck=i("PreTrainedModel"),Ak=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.)`),Mk=c(),gr=n("p"),Pk=i("This model is also a PyTorch "),br=n("a"),Sk=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.`),Ok=c(),ft=n("div"),y(kr.$$.fragment),Nk=c(),So=n("p"),Lk=i("The "),Xd=n("a"),Dk=i("BartForSequenceClassification"),Gk=i(" forward method, overrides the "),Cc=n("code"),Wk=i("__call__"),Uk=i(" special method."),Rk=c(),y(Mn.$$.fragment),Hk=c(),y(Pn.$$.fragment),Qk=c(),y(Sn.$$.fragment),eh=c(),Io=n("h2"),In=n("a"),Ac=n("span"),y(yr.$$.fragment),Vk=c(),Mc=n("span"),Kk=i("BartForQuestionAnswering"),th=c(),nt=n("div"),y(vr.$$.fragment),Jk=c(),Oo=n("p"),Xk=i(`BART 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 `),Pc=n("code"),Zk=i("span start logits"),Yk=i(" and "),Sc=n("code"),ey=i("span end logits"),ty=i(")."),oy=c(),Tr=n("p"),ny=i("This model inherits from "),Zd=n("a"),ay=i("PreTrainedModel"),sy=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.)`),ry=c(),wr=n("p"),iy=i("This model is also a PyTorch "),xr=n("a"),dy=i("torch.nn.Module"),ly=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),cy=c(),At=n("div"),y($r.$$.fragment),py=c(),No=n("p"),uy=i("The "),Yd=n("a"),hy=i("BartForQuestionAnswering"),my=i(" forward method, overrides the "),Ic=n("code"),fy=i("__call__"),_y=i(" special method."),gy=c(),y(On.$$.fragment),by=c(),y(Nn.$$.fragment),oh=c(),Lo=n("h2"),Ln=n("a"),Oc=n("span"),y(Fr.$$.fragment),ky=c(),Nc=n("span"),yy=i("BartForCausalLM"),nh=c(),at=n("div"),y(zr.$$.fragment),vy=c(),Lc=n("p"),Ty=i("BART decoder with with a language modeling head on top (linear layer with weights tied to the input embeddings)."),wy=c(),qr=n("p"),xy=i("This model inherits from "),el=n("a"),$y=i("PreTrainedModel"),Fy=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.)`),zy=c(),jr=n("p"),qy=i("This model is also a PyTorch "),Br=n("a"),jy=i("torch.nn.Module"),By=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ey=c(),Dn=n("div"),y(Er.$$.fragment),Cy=c(),y(Gn.$$.fragment),ah=c(),Do=n("h2"),Wn=n("a"),Dc=n("span"),y(Cr.$$.fragment),Ay=c(),Gc=n("span"),My=i("TFBartModel"),sh=c(),st=n("div"),y(Ar.$$.fragment),Py=c(),Mr=n("p"),Sy=i(`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),tl=n("a"),Iy=i("TFPreTrainedModel"),Oy=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.)`),Ny=c(),Pr=n("p"),Ly=i("This model is also a "),Sr=n("a"),Dy=i("tf.keras.Model"),Gy=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.`),Wy=c(),y(Un.$$.fragment),Uy=c(),Mt=n("div"),y(Ir.$$.fragment),Ry=c(),Go=n("p"),Hy=i("The "),ol=n("a"),Qy=i("TFBartModel"),Vy=i(" forward method, overrides the "),Wc=n("code"),Ky=i("__call__"),Jy=i(" special method."),Xy=c(),y(Rn.$$.fragment),Zy=c(),y(Hn.$$.fragment),rh=c(),Wo=n("h2"),Qn=n("a"),Uc=n("span"),y(Or.$$.fragment),Yy=c(),Rc=n("span"),ev=i("TFBartForConditionalGeneration"),ih=c(),rt=n("div"),y(Nr.$$.fragment),tv=c(),Lr=n("p"),ov=i(`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),nl=n("a"),nv=i("TFPreTrainedModel"),av=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.)`),sv=c(),Dr=n("p"),rv=i("This model is also a "),Gr=n("a"),iv=i("tf.keras.Model"),dv=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.`),lv=c(),y(Vn.$$.fragment),cv=c(),_t=n("div"),y(Wr.$$.fragment),pv=c(),Uo=n("p"),uv=i("The "),al=n("a"),hv=i("TFBartForConditionalGeneration"),mv=i(" forward method, overrides the "),Hc=n("code"),fv=i("__call__"),_v=i(" special method."),gv=c(),y(Kn.$$.fragment),bv=c(),y(Jn.$$.fragment),kv=c(),y(Xn.$$.fragment),dh=c(),Ro=n("h2"),Zn=n("a"),Qc=n("span"),y(Ur.$$.fragment),yv=c(),Vc=n("span"),vv=i("TFBartForSequenceClassification"),lh=c(),Pe=n("div"),y(Rr.$$.fragment),Tv=c(),Kc=n("p"),wv=i(`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),xv=c(),Hr=n("p"),$v=i("This model inherits from "),sl=n("a"),Fv=i("TFPreTrainedModel"),zv=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.)`),qv=c(),Qr=n("p"),jv=i("This model is also a "),Vr=n("a"),Bv=i("tf.keras.Model"),Ev=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.`),Cv=c(),y(Yn.$$.fragment),Av=c(),ro=n("div"),y(Kr.$$.fragment),Mv=c(),Ho=n("p"),Pv=i("The "),rl=n("a"),Sv=i("TFBartForSequenceClassification"),Iv=i(" forward method, overrides the "),Jc=n("code"),Ov=i("__call__"),Nv=i(" special method."),Lv=c(),y(ea.$$.fragment),ch=c(),Qo=n("h2"),ta=n("a"),Xc=n("span"),y(Jr.$$.fragment),Dv=c(),Zc=n("span"),Gv=i("FlaxBartModel"),ph=c(),_e=n("div"),y(Xr.$$.fragment),Wv=c(),Zr=n("p"),Uv=i(`The bare Bart Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),il=n("a"),Rv=i("FlaxPreTrainedModel"),Hv=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.)`),Qv=c(),Yr=n("p"),Vv=i(`This model is also a Flax Linen
`),ei=n("a"),Kv=i("flax.nn.Module"),Jv=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Xv=c(),Yc=n("p"),Zv=i("Finally, this model supports inherent JAX features such as:"),Yv=c(),Gt=n("ul"),ep=n("li"),ti=n("a"),eT=i("Just-In-Time (JIT) compilation"),tT=c(),tp=n("li"),oi=n("a"),oT=i("Automatic Differentiation"),nT=c(),op=n("li"),ni=n("a"),aT=i("Vectorization"),sT=c(),np=n("li"),ai=n("a"),rT=i("Parallelization"),iT=c(),Pt=n("div"),y(si.$$.fragment),dT=c(),Vo=n("p"),lT=i("The "),ap=n("code"),cT=i("FlaxBartPreTrainedModel"),pT=i(" forward method, overrides the "),sp=n("code"),uT=i("__call__"),hT=i(" special method."),mT=c(),y(oa.$$.fragment),fT=c(),y(na.$$.fragment),_T=c(),aa=n("div"),y(ri.$$.fragment),gT=c(),y(sa.$$.fragment),bT=c(),ra=n("div"),y(ii.$$.fragment),kT=c(),y(ia.$$.fragment),uh=c(),Ko=n("h2"),da=n("a"),rp=n("span"),y(di.$$.fragment),yT=c(),ip=n("span"),vT=i("FlaxBartForConditionalGeneration"),hh=c(),ge=n("div"),y(li.$$.fragment),TT=c(),ci=n("p"),wT=i(`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),dl=n("a"),xT=i("FlaxPreTrainedModel"),$T=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.)`),FT=c(),pi=n("p"),zT=i(`This model is also a Flax Linen
`),ui=n("a"),qT=i("flax.nn.Module"),jT=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),BT=c(),dp=n("p"),ET=i("Finally, this model supports inherent JAX features such as:"),CT=c(),Wt=n("ul"),lp=n("li"),hi=n("a"),AT=i("Just-In-Time (JIT) compilation"),MT=c(),cp=n("li"),mi=n("a"),PT=i("Automatic Differentiation"),ST=c(),pp=n("li"),fi=n("a"),IT=i("Vectorization"),OT=c(),up=n("li"),_i=n("a"),NT=i("Parallelization"),LT=c(),gt=n("div"),y(gi.$$.fragment),DT=c(),Jo=n("p"),GT=i("The "),hp=n("code"),WT=i("FlaxBartPreTrainedModel"),UT=i(" forward method, overrides the "),mp=n("code"),RT=i("__call__"),HT=i(" special method."),QT=c(),y(la.$$.fragment),VT=c(),y(ca.$$.fragment),KT=c(),y(pa.$$.fragment),JT=c(),ua=n("div"),y(bi.$$.fragment),XT=c(),y(ha.$$.fragment),ZT=c(),ma=n("div"),y(ki.$$.fragment),YT=c(),y(fa.$$.fragment),mh=c(),Xo=n("h2"),_a=n("a"),fp=n("span"),y(yi.$$.fragment),ew=c(),_p=n("span"),tw=i("FlaxBartForSequenceClassification"),fh=c(),J=n("div"),y(vi.$$.fragment),ow=c(),gp=n("p"),nw=i(`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),aw=c(),Ti=n("p"),sw=i("This model inherits from "),ll=n("a"),rw=i("FlaxPreTrainedModel"),iw=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.)`),dw=c(),wi=n("p"),lw=i(`This model is also a Flax Linen
`),xi=n("a"),cw=i("flax.nn.Module"),pw=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),uw=c(),bp=n("p"),hw=i("Finally, this model supports inherent JAX features such as:"),mw=c(),Ut=n("ul"),kp=n("li"),$i=n("a"),fw=i("Just-In-Time (JIT) compilation"),_w=c(),yp=n("li"),Fi=n("a"),gw=i("Automatic Differentiation"),bw=c(),vp=n("li"),zi=n("a"),kw=i("Vectorization"),yw=c(),Tp=n("li"),qi=n("a"),vw=i("Parallelization"),Tw=c(),St=n("div"),y(ji.$$.fragment),ww=c(),Zo=n("p"),xw=i("The "),wp=n("code"),$w=i("FlaxBartPreTrainedModel"),Fw=i(" forward method, overrides the "),xp=n("code"),zw=i("__call__"),qw=i(" special method."),jw=c(),y(ga.$$.fragment),Bw=c(),y(ba.$$.fragment),Ew=c(),ka=n("div"),y(Bi.$$.fragment),Cw=c(),y(ya.$$.fragment),Aw=c(),va=n("div"),y(Ei.$$.fragment),Mw=c(),y(Ta.$$.fragment),_h=c(),Yo=n("h2"),wa=n("a"),$p=n("span"),y(Ci.$$.fragment),Pw=c(),Fp=n("span"),Sw=i("FlaxBartForQuestionAnswering"),gh=c(),X=n("div"),y(Ai.$$.fragment),Iw=c(),en=n("p"),Ow=i(`BART 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 `),zp=n("code"),Nw=i("span start logits"),Lw=i(" and "),qp=n("code"),Dw=i("span end logits"),Gw=i(")."),Ww=c(),Mi=n("p"),Uw=i("This model inherits from "),cl=n("a"),Rw=i("FlaxPreTrainedModel"),Hw=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.)`),Qw=c(),Pi=n("p"),Vw=i(`This model is also a Flax Linen
`),Si=n("a"),Kw=i("flax.nn.Module"),Jw=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Xw=c(),jp=n("p"),Zw=i("Finally, this model supports inherent JAX features such as:"),Yw=c(),Rt=n("ul"),Bp=n("li"),Ii=n("a"),e2=i("Just-In-Time (JIT) compilation"),t2=c(),Ep=n("li"),Oi=n("a"),o2=i("Automatic Differentiation"),n2=c(),Cp=n("li"),Ni=n("a"),a2=i("Vectorization"),s2=c(),Ap=n("li"),Li=n("a"),r2=i("Parallelization"),i2=c(),It=n("div"),y(Di.$$.fragment),d2=c(),tn=n("p"),l2=i("The "),Mp=n("code"),c2=i("FlaxBartPreTrainedModel"),p2=i(" forward method, overrides the "),Pp=n("code"),u2=i("__call__"),h2=i(" special method."),m2=c(),y(xa.$$.fragment),f2=c(),y($a.$$.fragment),_2=c(),Fa=n("div"),y(Gi.$$.fragment),g2=c(),y(za.$$.fragment),b2=c(),qa=n("div"),y(Wi.$$.fragment),k2=c(),y(ja.$$.fragment),bh=c(),on=n("h2"),Ba=n("a"),Sp=n("span"),y(Ui.$$.fragment),y2=c(),Ip=n("span"),v2=i("FlaxBartForCausalLM"),kh=c(),xe=n("div"),y(Ri.$$.fragment),T2=c(),Op=n("p"),w2=i(`Bart Decoder Model with a language modeling head on top (linear layer with weights tied to the input embeddings)
e.g for autoregressive tasks.`),x2=c(),Hi=n("p"),$2=i("This model inherits from "),pl=n("a"),F2=i("FlaxPreTrainedModel"),z2=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.)`),q2=c(),Qi=n("p"),j2=i(`This model is also a Flax Linen
`),Vi=n("a"),B2=i("flax.nn.Module"),E2=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),C2=c(),Np=n("p"),A2=i("Finally, this model supports inherent JAX features such as:"),M2=c(),Ht=n("ul"),Lp=n("li"),Ki=n("a"),P2=i("Just-In-Time (JIT) compilation"),S2=c(),Dp=n("li"),Ji=n("a"),I2=i("Automatic Differentiation"),O2=c(),Gp=n("li"),Xi=n("a"),N2=i("Vectorization"),L2=c(),Wp=n("li"),Zi=n("a"),D2=i("Parallelization"),G2=c(),Ot=n("div"),y(Yi.$$.fragment),W2=c(),nn=n("p"),U2=i("The "),Up=n("code"),R2=i("FlaxBartDecoderPreTrainedModel"),H2=i(" forward method, overrides the "),Rp=n("code"),Q2=i("__call__"),V2=i(" special method."),K2=c(),y(Ea.$$.fragment),J2=c(),y(Ca.$$.fragment),this.h()},l(o){const _=EF('[data-svelte="svelte-1phssyn"]',document.head);l=a(_,"META",{name:!0,content:!0}),_.forEach(t),k=p(o),f=a(o,"H1",{class:!0});var ed=s(f);m=a(ed,"A",{id:!0,class:!0,href:!0});var Hp=s(m);b=a(Hp,"SPAN",{});var Qp=s(b);v(r.$$.fragment,Qp),Qp.forEach(t),Hp.forEach(t),h=p(ed),q=a(ed,"SPAN",{});var Vp=s(q);se=d(Vp,"BART"),Vp.forEach(t),ed.forEach(t),H=p(o),I=a(o,"DIV",{class:!0});var td=s(I);re=a(td,"A",{href:!0});var Kp=s(re);ie=a(Kp,"IMG",{alt:!0,src:!0}),Kp.forEach(t),Re=p(td),V=a(td,"A",{href:!0});var Jp=s(V);$e=a(Jp,"IMG",{alt:!0,src:!0}),Jp.forEach(t),td.forEach(t),Z=p(o),de=a(o,"P",{});var Aa=s(de);Ce=a(Aa,"STRONG",{});var Xp=s(Ce);le=d(Xp,"DISCLAIMER:"),Xp.forEach(t),He=d(Aa," If you see something strange, file a "),we=a(Aa,"A",{href:!0,rel:!0});var Zp=s(we);ce=d(Zp,"Github Issue"),Zp.forEach(t),Qe=d(Aa,` and assign
@patrickvonplaten`),Aa.forEach(t),Ie=p(o),N=a(o,"H2",{class:!0});var od=s(N);be=a(od,"A",{id:!0,class:!0,href:!0});var Yp=s(be);Ae=a(Yp,"SPAN",{});var eu=s(Ae);v(Y.$$.fragment,eu),eu.forEach(t),Yp.forEach(t),A=p(od),M=a(od,"SPAN",{});var tu=s(M);Ve=d(tu,"Overview"),tu.forEach(t),od.forEach(t),ee=p(o),ke=a(o,"P",{});var nd=s(ke);Ke=d(nd,"The Bart model was proposed in "),Q=a(nd,"A",{href:!0,rel:!0});var ou=s(Q);Je=d(ou,`BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation,
Translation, and Comprehension`),ou.forEach(t),Xe=d(nd,` by Mike Lewis, Yinhan Liu, Naman Goyal, Marjan
Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov and Luke Zettlemoyer on 29 Oct, 2019.`),nd.forEach(t),P=p(o),Fe=a(o,"P",{});var nu=s(Fe);pe=d(nu,"According to the abstract,"),nu.forEach(t),Oe=p(o),te=a(o,"UL",{});var an=s(te);K=a(an,"LI",{});var au=s(K);Ze=d(au,`Bart uses a standard seq2seq/machine translation architecture with a bidirectional encoder (like BERT) and a
left-to-right decoder (like GPT).`),au.forEach(t),Ye=p(an),U=a(an,"LI",{});var su=s(U);et=d(su,`The pretraining task involves randomly shuffling the order of the original sentences and a novel in-filling scheme,
where spans of text are replaced with a single mask token.`),su.forEach(t),ue=p(an),Me=a(an,"LI",{});var ru=s(Me);ze=d(ru,`BART is particularly effective when fine tuned for text generation but also works well for comprehension tasks. It
matches the performance of RoBERTa with comparable training resources on GLUE and SQuAD, achieves new
state-of-the-art results on a range of abstractive dialogue, question answering, and summarization tasks, with gains
of up to 6 ROUGE.`),ru.forEach(t),an.forEach(t),S=p(o),qe=a(o,"P",{});var iu=s(qe);L=d(iu,"Tips:"),iu.forEach(t),Ne=p(o),ye=a(o,"UL",{});var ad=s(ye);F=a(ad,"LI",{});var du=s(F);B=a(du,"P",{});var lu=s(B);wt=d(lu,`BART is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),lu.forEach(t),du.forEach(t),je=p(ad),Le=a(ad,"LI",{});var sd=s(Le);dt=a(sd,"P",{});var cu=s(dt);E=d(cu,"Sequence-to-sequence model with an encoder and a decoder. Encoder is fed a corrupted version of the tokens, decoder is fed the original tokens (but has a mask to hide the future words like a regular transformers decoder). A composition of the following transformations are applied on the pretraining tasks for the encoder:"),cu.forEach(t),xt=p(sd),oe=a(sd,"UL",{});var Tt=s(oe);lt=a(Tt,"LI",{});var pu=s(lt);$t=d(pu,"mask random tokens (like in BERT)"),pu.forEach(t),Ft=p(Tt),R=a(Tt,"LI",{});var uu=s(R);he=d(uu,"delete random tokens"),uu.forEach(t),zt=p(Tt),ct=a(Tt,"LI",{});var hu=s(ct);me=d(hu,"mask a span of k tokens with a single mask token (a span of 0 tokens is an insertion of a mask token)"),hu.forEach(t),qt=p(Tt),pt=a(Tt,"LI",{});var mu=s(pt);tt=d(mu,"permute sentences"),mu.forEach(t),jt=p(Tt),ve=a(Tt,"LI",{});var fu=s(ve);Bt=d(fu,"rotate the document to make it start at a specific token"),fu.forEach(t),Tt.forEach(t),sd.forEach(t),ad.forEach(t),xu=p(o),Vt=a(o,"P",{});var sn=s(Vt);Sm=d(sn,"This model was contributed by "),Xa=a(sn,"A",{href:!0,rel:!0});var _u=s(Xa);Im=d(_u,"sshleifer"),_u.forEach(t),Om=d(sn,". The Authors\u2019 code can be found "),Za=a(sn,"A",{href:!0,rel:!0});var gu=s(Za);Nm=d(gu,"here"),gu.forEach(t),Lm=d(sn,"."),sn.forEach(t),$u=p(o),ko=a(o,"H3",{class:!0});var rd=s(ko);dn=a(rd,"A",{id:!0,class:!0,href:!0});var bu=s(dn);Pl=a(bu,"SPAN",{});var ku=s(Pl);v(Ya.$$.fragment,ku),ku.forEach(t),bu.forEach(t),Dm=p(rd),Sl=a(rd,"SPAN",{});var yu=s(Sl);Gm=d(yu,"Examples"),yu.forEach(t),rd.forEach(t),Fu=p(o),Kt=a(o,"UL",{});var rn=s(Kt);es=a(rn,"LI",{});var id=s(es);Wm=d(id,`Examples and scripts for fine-tuning BART and other models for sequence to sequence tasks can be found in
`),ts=a(id,"A",{href:!0,rel:!0});var vu=s(ts);Um=d(vu,"examples/pytorch/summarization/"),vu.forEach(t),Rm=d(id,"."),id.forEach(t),Hm=p(rn),Lt=a(rn,"LI",{});var Qt=s(Lt);Qm=d(Qt,"An example of how to train "),fd=a(Qt,"A",{href:!0});var n1=s(fd);Vm=d(n1,"BartForConditionalGeneration"),n1.forEach(t),Km=d(Qt," with a Hugging Face "),Il=a(Qt,"CODE",{});var a1=s(Il);Jm=d(a1,"datasets"),a1.forEach(t),Xm=d(Qt,`
object can be found in this `),os=a(Qt,"A",{href:!0,rel:!0});var s1=s(os);Zm=d(s1,"forum discussion"),s1.forEach(t),Ym=d(Qt,"."),Qt.forEach(t),ef=p(rn),ln=a(rn,"LI",{});var Tu=s(ln);ns=a(Tu,"A",{href:!0,rel:!0});var r1=s(ns);tf=d(r1,"Distilled checkpoints"),r1.forEach(t),of=d(Tu," are described in this "),as=a(Tu,"A",{href:!0,rel:!0});var i1=s(as);nf=d(i1,"paper"),i1.forEach(t),af=d(Tu,"."),Tu.forEach(t),rn.forEach(t),zu=p(o),yo=a(o,"H2",{class:!0});var vh=s(yo);cn=a(vh,"A",{id:!0,class:!0,href:!0});var d1=s(cn);Ol=a(d1,"SPAN",{});var l1=s(Ol);v(ss.$$.fragment,l1),l1.forEach(t),d1.forEach(t),sf=p(vh),Nl=a(vh,"SPAN",{});var c1=s(Nl);rf=d(c1,"Implementation Notes"),c1.forEach(t),vh.forEach(t),qu=p(o),ut=a(o,"UL",{});var io=s(ut);Dt=a(io,"LI",{});var Ma=s(Dt);df=d(Ma,"Bart doesn\u2019t use "),Ll=a(Ma,"CODE",{});var p1=s(Ll);lf=d(p1,"token_type_ids"),p1.forEach(t),cf=d(Ma," for sequence classification. Use "),_d=a(Ma,"A",{href:!0});var u1=s(_d);pf=d(u1,"BartTokenizer"),u1.forEach(t),uf=d(Ma,` or
`),gd=a(Ma,"A",{href:!0});var h1=s(gd);hf=d(h1,"encode()"),h1.forEach(t),mf=d(Ma," to get the proper splitting."),Ma.forEach(t),ff=p(io),vo=a(io,"LI",{});var ul=s(vo);_f=d(ul,"The forward pass of "),bd=a(ul,"A",{href:!0});var m1=s(bd);gf=d(m1,"BartModel"),m1.forEach(t),bf=d(ul," will create the "),Dl=a(ul,"CODE",{});var f1=s(Dl);kf=d(f1,"decoder_input_ids"),f1.forEach(t),yf=d(ul,` if they are not passed.
This is different than some other modeling APIs. A typical use case of this feature is mask filling.`),ul.forEach(t),vf=p(io),To=a(io,"LI",{});var hl=s(To);Tf=d(hl,`Model predictions are intended to be identical to the original implementation when
`),Gl=a(hl,"CODE",{});var _1=s(Gl);wf=d(_1,"forced_bos_token_id=0"),_1.forEach(t),xf=d(hl,`. This only works, however, if the string you pass to
`),Wl=a(hl,"CODE",{});var g1=s(Wl);$f=d(g1,"fairseq.encode"),g1.forEach(t),Ff=d(hl," starts with a space."),hl.forEach(t),zf=p(io),kd=a(io,"LI",{});var X2=s(kd);yd=a(X2,"A",{href:!0});var b1=s(yd);qf=d(b1,"generate()"),b1.forEach(t),jf=d(X2,` should be used for conditional generation tasks like
summarization, see the example in that docstrings.`),X2.forEach(t),Bf=p(io),wo=a(io,"LI",{});var ml=s(wo);Ef=d(ml,"Models that load the "),Ul=a(ml,"EM",{});var k1=s(Ul);Cf=d(k1,"facebook/bart-large-cnn"),k1.forEach(t),Af=d(ml," weights will not have a "),Rl=a(ml,"CODE",{});var y1=s(Rl);Mf=d(y1,"mask_token_id"),y1.forEach(t),Pf=d(ml,`, or be able to perform
mask-filling tasks.`),ml.forEach(t),io.forEach(t),ju=p(o),xo=a(o,"H2",{class:!0});var Th=s(xo);pn=a(Th,"A",{id:!0,class:!0,href:!0});var v1=s(pn);Hl=a(v1,"SPAN",{});var T1=s(Hl);v(rs.$$.fragment,T1),T1.forEach(t),v1.forEach(t),Sf=p(Th),Ql=a(Th,"SPAN",{});var w1=s(Ql);If=d(w1,"Mask Filling"),w1.forEach(t),Th.forEach(t),Bu=p(o),Jt=a(o,"P",{});var fl=s(Jt);Of=d(fl,"The "),Vl=a(fl,"CODE",{});var x1=s(Vl);Nf=d(x1,"facebook/bart-base"),x1.forEach(t),Lf=d(fl," and "),Kl=a(fl,"CODE",{});var $1=s(Kl);Df=d($1,"facebook/bart-large"),$1.forEach(t),Gf=d(fl," checkpoints can be used to fill multi-token masks."),fl.forEach(t),Eu=p(o),v(is.$$.fragment,o),Cu=p(o),$o=a(o,"H2",{class:!0});var wh=s($o);un=a(wh,"A",{id:!0,class:!0,href:!0});var F1=s(un);Jl=a(F1,"SPAN",{});var z1=s(Jl);v(ds.$$.fragment,z1),z1.forEach(t),F1.forEach(t),Wf=p(wh),Xl=a(wh,"SPAN",{});var q1=s(Xl);Uf=d(q1,"Resources"),q1.forEach(t),wh.forEach(t),Au=p(o),vd=a(o,"P",{});var j1=s(vd);Rf=d(j1,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BART. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),j1.forEach(t),Mu=p(o),v(ls.$$.fragment,o),Pu=p(o),Te=a(o,"UL",{});var De=s(Te);cs=a(De,"LI",{});var xh=s(cs);Hf=d(xh,"A blog post on "),ps=a(xh,"A",{href:!0,rel:!0});var B1=s(ps);Qf=d(B1,"Distributed Training: Train BART/T5 for Summarization using \u{1F917} Transformers and Amazon SageMaker"),B1.forEach(t),Vf=d(xh,"."),xh.forEach(t),Kf=p(De),us=a(De,"LI",{});var $h=s(us);Jf=d($h,"A notebook on how to "),hs=a($h,"A",{href:!0,rel:!0});var E1=s(hs);Xf=d(E1,"finetune BART for summarization with fastai using blurr"),E1.forEach(t),Zf=d($h,". \u{1F30E}"),$h.forEach(t),Yf=p(De),ms=a(De,"LI",{});var Fh=s(ms);e_=d(Fh,"A notebook on how to "),fs=a(Fh,"A",{href:!0,rel:!0});var C1=s(fs);t_=d(C1,"finetune BART for summarization in two languages with Trainer class"),C1.forEach(t),o_=d(Fh,". \u{1F30E}"),Fh.forEach(t),n_=p(De),Xt=a(De,"LI",{});var dd=s(Xt);Td=a(dd,"A",{href:!0});var A1=s(Td);a_=d(A1,"BartForConditionalGeneration"),A1.forEach(t),s_=d(dd," is supported by this "),_s=a(dd,"A",{href:!0,rel:!0});var M1=s(_s);r_=d(M1,"example script"),M1.forEach(t),i_=d(dd," and "),gs=a(dd,"A",{href:!0,rel:!0});var P1=s(gs);d_=d(P1,"notebook"),P1.forEach(t),l_=d(dd,"."),dd.forEach(t),c_=p(De),Zt=a(De,"LI",{});var ld=s(Zt);wd=a(ld,"A",{href:!0});var S1=s(wd);p_=d(S1,"TFBartForConditionalGeneration"),S1.forEach(t),u_=d(ld," is supported by this "),bs=a(ld,"A",{href:!0,rel:!0});var I1=s(bs);h_=d(I1,"example script"),I1.forEach(t),m_=d(ld," and "),ks=a(ld,"A",{href:!0,rel:!0});var O1=s(ks);f_=d(O1,"notebook"),O1.forEach(t),__=d(ld,"."),ld.forEach(t),g_=p(De),hn=a(De,"LI",{});var wu=s(hn);xd=a(wu,"A",{href:!0});var N1=s(xd);b_=d(N1,"FlaxBartForConditionalGeneration"),N1.forEach(t),k_=d(wu," is supported by this "),ys=a(wu,"A",{href:!0,rel:!0});var L1=s(ys);y_=d(L1,"example script"),L1.forEach(t),v_=d(wu,"."),wu.forEach(t),T_=p(De),$d=a(De,"LI",{});var Z2=s($d);vs=a(Z2,"A",{href:!0,rel:!0});var D1=s(vs);w_=d(D1,"Summarization"),D1.forEach(t),x_=d(Z2," chapter of the \u{1F917} Hugging Face course."),Z2.forEach(t),$_=p(De),Zl=a(De,"LI",{});var G1=s(Zl);Fd=a(G1,"A",{href:!0});var W1=s(Fd);F_=d(W1,"Summarization task guide"),W1.forEach(t),G1.forEach(t),De.forEach(t),Su=p(o),v(Ts.$$.fragment,o),Iu=p(o),ht=a(o,"UL",{});var lo=s(ht);Yt=a(lo,"LI",{});var cd=s(Yt);zd=a(cd,"A",{href:!0});var U1=s(zd);z_=d(U1,"BartForConditionalGeneration"),U1.forEach(t),q_=d(cd," is supported by this "),ws=a(cd,"A",{href:!0,rel:!0});var R1=s(ws);j_=d(R1,"example script"),R1.forEach(t),B_=d(cd," and "),xs=a(cd,"A",{href:!0,rel:!0});var H1=s(xs);E_=d(H1,"notebook"),H1.forEach(t),C_=d(cd,"."),cd.forEach(t),A_=p(lo),eo=a(lo,"LI",{});var pd=s(eo);qd=a(pd,"A",{href:!0});var Q1=s(qd);M_=d(Q1,"TFBartForConditionalGeneration"),Q1.forEach(t),P_=d(pd," is supported by this "),$s=a(pd,"A",{href:!0,rel:!0});var V1=s($s);S_=d(V1,"example script"),V1.forEach(t),I_=d(pd," and "),Fs=a(pd,"A",{href:!0,rel:!0});var K1=s(Fs);O_=d(K1,"notebook"),K1.forEach(t),N_=d(pd,"."),pd.forEach(t),L_=p(lo),to=a(lo,"LI",{});var ud=s(to);jd=a(ud,"A",{href:!0});var J1=s(jd);D_=d(J1,"FlaxBartForConditionalGeneration"),J1.forEach(t),G_=d(ud," is supported by this "),zs=a(ud,"A",{href:!0,rel:!0});var X1=s(zs);W_=d(X1,"example script"),X1.forEach(t),U_=d(ud," and "),qs=a(ud,"A",{href:!0,rel:!0});var Z1=s(qs);R_=d(Z1,"notebook"),Z1.forEach(t),H_=d(ud,"."),ud.forEach(t),Q_=p(lo),Bd=a(lo,"LI",{});var Y2=s(Bd);js=a(Y2,"A",{href:!0,rel:!0});var Y1=s(js);V_=d(Y1,"Masked language modeling"),Y1.forEach(t),K_=d(Y2," chapter of the \u{1F917} Hugging Face Course."),Y2.forEach(t),J_=p(lo),Yl=a(lo,"LI",{});var e0=s(Yl);Ed=a(e0,"A",{href:!0});var t0=s(Ed);X_=d(t0,"Masked language modeling task guide"),t0.forEach(t),e0.forEach(t),lo.forEach(t),Ou=p(o),v(Bs.$$.fragment,o),Nu=p(o),Et=a(o,"UL",{});var Pa=s(Et);Es=a(Pa,"LI",{});var zh=s(Es);Z_=d(zh,"A notebook on how to "),Cs=a(zh,"A",{href:!0,rel:!0});var o0=s(Cs);Y_=d(o0,"finetune mBART using Seq2SeqTrainer for Hindi to English translation"),o0.forEach(t),eg=d(zh,". \u{1F30E}"),zh.forEach(t),tg=p(Pa),oo=a(Pa,"LI",{});var hd=s(oo);Cd=a(hd,"A",{href:!0});var n0=s(Cd);og=d(n0,"BartForConditionalGeneration"),n0.forEach(t),ng=d(hd," is supported by this "),As=a(hd,"A",{href:!0,rel:!0});var a0=s(As);ag=d(a0,"example script"),a0.forEach(t),sg=d(hd," and "),Ms=a(hd,"A",{href:!0,rel:!0});var s0=s(Ms);rg=d(s0,"notebook"),s0.forEach(t),ig=d(hd,"."),hd.forEach(t),dg=p(Pa),no=a(Pa,"LI",{});var md=s(no);Ad=a(md,"A",{href:!0});var r0=s(Ad);lg=d(r0,"TFBartForConditionalGeneration"),r0.forEach(t),cg=d(md," is supported by this "),Ps=a(md,"A",{href:!0,rel:!0});var i0=s(Ps);pg=d(i0,"example script"),i0.forEach(t),ug=d(md," and "),Ss=a(md,"A",{href:!0,rel:!0});var d0=s(Ss);hg=d(d0,"notebook"),d0.forEach(t),mg=d(md,"."),md.forEach(t),fg=p(Pa),ec=a(Pa,"LI",{});var l0=s(ec);Md=a(l0,"A",{href:!0});var c0=s(Md);_g=d(c0,"Translation task guide"),c0.forEach(t),l0.forEach(t),Pa.forEach(t),Lu=p(o),Pd=a(o,"P",{});var p0=s(Pd);gg=d(p0,"See also:"),p0.forEach(t),Du=p(o),ao=a(o,"UL",{});var _l=s(ao);tc=a(_l,"LI",{});var u0=s(tc);Sd=a(u0,"A",{href:!0});var h0=s(Sd);bg=d(h0,"Text classification task guide"),h0.forEach(t),u0.forEach(t),kg=p(_l),oc=a(_l,"LI",{});var m0=s(oc);Id=a(m0,"A",{href:!0});var f0=s(Id);yg=d(f0,"Question answering task guide"),f0.forEach(t),m0.forEach(t),vg=p(_l),nc=a(_l,"LI",{});var _0=s(nc);Od=a(_0,"A",{href:!0});var g0=s(Od);Tg=d(g0,"Causal language modeling task guide"),g0.forEach(t),_0.forEach(t),_l.forEach(t),Gu=p(o),Fo=a(o,"H2",{class:!0});var qh=s(Fo);mn=a(qh,"A",{id:!0,class:!0,href:!0});var b0=s(mn);ac=a(b0,"SPAN",{});var k0=s(ac);v(Is.$$.fragment,k0),k0.forEach(t),b0.forEach(t),wg=p(qh),sc=a(qh,"SPAN",{});var y0=s(sc);xg=d(y0,"BartConfig"),y0.forEach(t),qh.forEach(t),Wu=p(o),kt=a(o,"DIV",{class:!0});var Sa=s(kt);v(Os.$$.fragment,Sa),$g=p(Sa),zo=a(Sa,"P",{});var gl=s(zo);Fg=d(gl,"This is the configuration class to store the configuration of a "),Nd=a(gl,"A",{href:!0});var v0=s(Nd);zg=d(v0,"BartModel"),v0.forEach(t),qg=d(gl,`. It is used to instantiate a BART
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 BART
`),Ns=a(gl,"A",{href:!0,rel:!0});var T0=s(Ns);jg=d(T0,"facebook/bart-large"),T0.forEach(t),Bg=d(gl," architecture."),gl.forEach(t),Eg=p(Sa),qo=a(Sa,"P",{});var bl=s(qo);Cg=d(bl,"Configuration objects inherit from "),Ld=a(bl,"A",{href:!0});var w0=s(Ld);Ag=d(w0,"PretrainedConfig"),w0.forEach(t),Mg=d(bl,` and can be used to control the model outputs. Read the
documentation from `),Dd=a(bl,"A",{href:!0});var x0=s(Dd);Pg=d(x0,"PretrainedConfig"),x0.forEach(t),Sg=d(bl," for more information."),bl.forEach(t),Ig=p(Sa),v(fn.$$.fragment,Sa),Sa.forEach(t),Uu=p(o),jo=a(o,"H2",{class:!0});var jh=s(jo);_n=a(jh,"A",{id:!0,class:!0,href:!0});var $0=s(_n);rc=a($0,"SPAN",{});var F0=s(rc);v(Ls.$$.fragment,F0),F0.forEach(t),$0.forEach(t),Og=p(jh),ic=a(jh,"SPAN",{});var z0=s(ic);Ng=d(z0,"BartTokenizer"),z0.forEach(t),jh.forEach(t),Ru=p(o),D=a(o,"DIV",{class:!0});var ne=s(D);v(Ds.$$.fragment,ne),Lg=p(ne),dc=a(ne,"P",{});var q0=s(dc);Dg=d(q0,"Constructs a BART tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),q0.forEach(t),Gg=p(ne),lc=a(ne,"P",{});var j0=s(lc);Wg=d(j0,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),j0.forEach(t),Ug=p(ne),v(gn.$$.fragment,ne),Rg=p(ne),Gs=a(ne,"P",{});var Bh=s(Gs);Hg=d(Bh,"You can get around that behavior by passing "),cc=a(Bh,"CODE",{});var B0=s(cc);Qg=d(B0,"add_prefix_space=True"),B0.forEach(t),Vg=d(Bh,` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),Bh.forEach(t),Kg=p(ne),v(bn.$$.fragment,ne),Jg=p(ne),Ws=a(ne,"P",{});var Eh=s(Ws);Xg=d(Eh,"This tokenizer inherits from "),Gd=a(Eh,"A",{href:!0});var E0=s(Gd);Zg=d(E0,"PreTrainedTokenizer"),E0.forEach(t),Yg=d(Eh,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Eh.forEach(t),eb=p(ne),so=a(ne,"DIV",{class:!0});var kl=s(so);v(Us.$$.fragment,kl),tb=p(kl),pc=a(kl,"P",{});var C0=s(pc);ob=d(C0,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BART sequence has the following format:`),C0.forEach(t),nb=p(kl),Rs=a(kl,"UL",{});var Ch=s(Rs);Wd=a(Ch,"LI",{});var e1=s(Wd);ab=d(e1,"single sequence: "),uc=a(e1,"CODE",{});var A0=s(uc);sb=d(A0,"<s> X </s>"),A0.forEach(t),e1.forEach(t),rb=p(Ch),Ud=a(Ch,"LI",{});var t1=s(Ud);ib=d(t1,"pair of sequences: "),hc=a(t1,"CODE",{});var M0=s(hc);db=d(M0,"<s> A </s></s> B </s>"),M0.forEach(t),t1.forEach(t),Ch.forEach(t),kl.forEach(t),lb=p(ne),kn=a(ne,"DIV",{class:!0});var Ah=s(kn);v(Hs.$$.fragment,Ah),cb=p(Ah),mc=a(Ah,"P",{});var P0=s(mc);pb=d(P0,"Converts a sequence of tokens (string) in a single string."),P0.forEach(t),Ah.forEach(t),ub=p(ne),yn=a(ne,"DIV",{class:!0});var Mh=s(yn);v(Qs.$$.fragment,Mh),hb=p(Mh),fc=a(Mh,"P",{});var S0=s(fc);mb=d(S0,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. BART does not
make use of token type ids, therefore a list of zeros is returned.`),S0.forEach(t),Mh.forEach(t),fb=p(ne),vn=a(ne,"DIV",{class:!0});var Ph=s(vn);v(Vs.$$.fragment,Ph),_b=p(Ph),Ks=a(Ph,"P",{});var Sh=s(Ks);gb=d(Sh,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),_c=a(Sh,"CODE",{});var I0=s(_c);bb=d(I0,"prepare_for_model"),I0.forEach(t),kb=d(Sh," method."),Sh.forEach(t),Ph.forEach(t),ne.forEach(t),Hu=p(o),Bo=a(o,"H2",{class:!0});var Ih=s(Bo);Tn=a(Ih,"A",{id:!0,class:!0,href:!0});var O0=s(Tn);gc=a(O0,"SPAN",{});var N0=s(gc);v(Js.$$.fragment,N0),N0.forEach(t),O0.forEach(t),yb=p(Ih),bc=a(Ih,"SPAN",{});var L0=s(bc);vb=d(L0,"BartTokenizerFast"),L0.forEach(t),Ih.forEach(t),Qu=p(o),fe=a(o,"DIV",{class:!0});var Ge=s(fe);v(Xs.$$.fragment,Ge),Tb=p(Ge),Zs=a(Ge,"P",{});var Oh=s(Zs);wb=d(Oh,"Construct a \u201Cfast\u201D BART tokenizer (backed by HuggingFace\u2019s "),kc=a(Oh,"EM",{});var D0=s(kc);xb=d(D0,"tokenizers"),D0.forEach(t),$b=d(Oh,` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),Oh.forEach(t),Fb=p(Ge),yc=a(Ge,"P",{});var G0=s(yc);zb=d(G0,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),G0.forEach(t),qb=p(Ge),v(wn.$$.fragment,Ge),jb=p(Ge),Ys=a(Ge,"P",{});var Nh=s(Ys);Bb=d(Nh,"You can get around that behavior by passing "),vc=a(Nh,"CODE",{});var W0=s(vc);Eb=d(W0,"add_prefix_space=True"),W0.forEach(t),Cb=d(Nh,` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),Nh.forEach(t),Ab=p(Ge),v(xn.$$.fragment,Ge),Mb=p(Ge),er=a(Ge,"P",{});var Lh=s(er);Pb=d(Lh,"This tokenizer inherits from "),Rd=a(Lh,"A",{href:!0});var U0=s(Rd);Sb=d(U0,"PreTrainedTokenizerFast"),U0.forEach(t),Ib=d(Lh,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Lh.forEach(t),Ob=p(Ge),$n=a(Ge,"DIV",{class:!0});var Dh=s($n);v(tr.$$.fragment,Dh),Nb=p(Dh),Tc=a(Dh,"P",{});var R0=s(Tc);Lb=d(R0,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. BART does not
make use of token type ids, therefore a list of zeros is returned.`),R0.forEach(t),Dh.forEach(t),Ge.forEach(t),Vu=p(o),Eo=a(o,"H2",{class:!0});var Gh=s(Eo);Fn=a(Gh,"A",{id:!0,class:!0,href:!0});var H0=s(Fn);wc=a(H0,"SPAN",{});var Q0=s(wc);v(or.$$.fragment,Q0),Q0.forEach(t),H0.forEach(t),Db=p(Gh),xc=a(Gh,"SPAN",{});var V0=s(xc);Gb=d(V0,"BartModel"),V0.forEach(t),Gh.forEach(t),Ku=p(o),yt=a(o,"DIV",{class:!0});var Ia=s(yt);v(nr.$$.fragment,Ia),Wb=p(Ia),ar=a(Ia,"P",{});var Wh=s(ar);Ub=d(Wh,`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Hd=a(Wh,"A",{href:!0});var K0=s(Hd);Rb=d(K0,"PreTrainedModel"),K0.forEach(t),Hb=d(Wh,`. 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.)`),Wh.forEach(t),Qb=p(Ia),sr=a(Ia,"P",{});var Uh=s(sr);Vb=d(Uh,"This model is also a PyTorch "),rr=a(Uh,"A",{href:!0,rel:!0});var J0=s(rr);Kb=d(J0,"torch.nn.Module"),J0.forEach(t),Jb=d(Uh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Uh.forEach(t),Xb=p(Ia),Ct=a(Ia,"DIV",{class:!0});var Oa=s(Ct);v(ir.$$.fragment,Oa),Zb=p(Oa),Co=a(Oa,"P",{});var yl=s(Co);Yb=d(yl,"The "),Qd=a(yl,"A",{href:!0});var X0=s(Qd);ek=d(X0,"BartModel"),X0.forEach(t),tk=d(yl," forward method, overrides the "),$c=a(yl,"CODE",{});var Z0=s($c);ok=d(Z0,"__call__"),Z0.forEach(t),nk=d(yl," special method."),yl.forEach(t),ak=p(Oa),v(zn.$$.fragment,Oa),sk=p(Oa),v(qn.$$.fragment,Oa),Oa.forEach(t),Ia.forEach(t),Ju=p(o),Ao=a(o,"H2",{class:!0});var Rh=s(Ao);jn=a(Rh,"A",{id:!0,class:!0,href:!0});var Y0=s(jn);Fc=a(Y0,"SPAN",{});var ex=s(Fc);v(dr.$$.fragment,ex),ex.forEach(t),Y0.forEach(t),rk=p(Rh),zc=a(Rh,"SPAN",{});var tx=s(zc);ik=d(tx,"BartForConditionalGeneration"),tx.forEach(t),Rh.forEach(t),Xu=p(o),vt=a(o,"DIV",{class:!0});var Na=s(vt);v(lr.$$.fragment,Na),dk=p(Na),cr=a(Na,"P",{});var Hh=s(cr);lk=d(Hh,`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Vd=a(Hh,"A",{href:!0});var ox=s(Vd);ck=d(ox,"PreTrainedModel"),ox.forEach(t),pk=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),uk=p(Na),pr=a(Na,"P",{});var Qh=s(pr);hk=d(Qh,"This model is also a PyTorch "),ur=a(Qh,"A",{href:!0,rel:!0});var nx=s(ur);mk=d(nx,"torch.nn.Module"),nx.forEach(t),fk=d(Qh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Qh.forEach(t),_k=p(Na),mt=a(Na,"DIV",{class:!0});var co=s(mt);v(hr.$$.fragment,co),gk=p(co),Mo=a(co,"P",{});var vl=s(Mo);bk=d(vl,"The "),Kd=a(vl,"A",{href:!0});var ax=s(Kd);kk=d(ax,"BartForConditionalGeneration"),ax.forEach(t),yk=d(vl," forward method, overrides the "),qc=a(vl,"CODE",{});var sx=s(qc);vk=d(sx,"__call__"),sx.forEach(t),Tk=d(vl," special method."),vl.forEach(t),wk=p(co),v(Bn.$$.fragment,co),xk=p(co),v(En.$$.fragment,co),$k=p(co),v(Cn.$$.fragment,co),co.forEach(t),Na.forEach(t),Zu=p(o),Po=a(o,"H2",{class:!0});var Vh=s(Po);An=a(Vh,"A",{id:!0,class:!0,href:!0});var rx=s(An);jc=a(rx,"SPAN",{});var ix=s(jc);v(mr.$$.fragment,ix),ix.forEach(t),rx.forEach(t),Fk=p(Vh),Bc=a(Vh,"SPAN",{});var dx=s(Bc);zk=d(dx,"BartForSequenceClassification"),dx.forEach(t),Vh.forEach(t),Yu=p(o),ot=a(o,"DIV",{class:!0});var po=s(ot);v(fr.$$.fragment,po),qk=p(po),Ec=a(po,"P",{});var lx=s(Ec);jk=d(lx,`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),lx.forEach(t),Bk=p(po),_r=a(po,"P",{});var Kh=s(_r);Ek=d(Kh,"This model inherits from "),Jd=a(Kh,"A",{href:!0});var cx=s(Jd);Ck=d(cx,"PreTrainedModel"),cx.forEach(t),Ak=d(Kh,`. 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.)`),Kh.forEach(t),Mk=p(po),gr=a(po,"P",{});var Jh=s(gr);Pk=d(Jh,"This model is also a PyTorch "),br=a(Jh,"A",{href:!0,rel:!0});var px=s(br);Sk=d(px,"torch.nn.Module"),px.forEach(t),Ik=d(Jh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jh.forEach(t),Ok=p(po),ft=a(po,"DIV",{class:!0});var uo=s(ft);v(kr.$$.fragment,uo),Nk=p(uo),So=a(uo,"P",{});var Tl=s(So);Lk=d(Tl,"The "),Xd=a(Tl,"A",{href:!0});var ux=s(Xd);Dk=d(ux,"BartForSequenceClassification"),ux.forEach(t),Gk=d(Tl," forward method, overrides the "),Cc=a(Tl,"CODE",{});var hx=s(Cc);Wk=d(hx,"__call__"),hx.forEach(t),Uk=d(Tl," special method."),Tl.forEach(t),Rk=p(uo),v(Mn.$$.fragment,uo),Hk=p(uo),v(Pn.$$.fragment,uo),Qk=p(uo),v(Sn.$$.fragment,uo),uo.forEach(t),po.forEach(t),eh=p(o),Io=a(o,"H2",{class:!0});var Xh=s(Io);In=a(Xh,"A",{id:!0,class:!0,href:!0});var mx=s(In);Ac=a(mx,"SPAN",{});var fx=s(Ac);v(yr.$$.fragment,fx),fx.forEach(t),mx.forEach(t),Vk=p(Xh),Mc=a(Xh,"SPAN",{});var _x=s(Mc);Kk=d(_x,"BartForQuestionAnswering"),_x.forEach(t),Xh.forEach(t),th=p(o),nt=a(o,"DIV",{class:!0});var ho=s(nt);v(vr.$$.fragment,ho),Jk=p(ho),Oo=a(ho,"P",{});var wl=s(Oo);Xk=d(wl,`BART 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 `),Pc=a(wl,"CODE",{});var gx=s(Pc);Zk=d(gx,"span start logits"),gx.forEach(t),Yk=d(wl," and "),Sc=a(wl,"CODE",{});var bx=s(Sc);ey=d(bx,"span end logits"),bx.forEach(t),ty=d(wl,")."),wl.forEach(t),oy=p(ho),Tr=a(ho,"P",{});var Zh=s(Tr);ny=d(Zh,"This model inherits from "),Zd=a(Zh,"A",{href:!0});var kx=s(Zd);ay=d(kx,"PreTrainedModel"),kx.forEach(t),sy=d(Zh,`. 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.)`),Zh.forEach(t),ry=p(ho),wr=a(ho,"P",{});var Yh=s(wr);iy=d(Yh,"This model is also a PyTorch "),xr=a(Yh,"A",{href:!0,rel:!0});var yx=s(xr);dy=d(yx,"torch.nn.Module"),yx.forEach(t),ly=d(Yh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Yh.forEach(t),cy=p(ho),At=a(ho,"DIV",{class:!0});var La=s(At);v($r.$$.fragment,La),py=p(La),No=a(La,"P",{});var xl=s(No);uy=d(xl,"The "),Yd=a(xl,"A",{href:!0});var vx=s(Yd);hy=d(vx,"BartForQuestionAnswering"),vx.forEach(t),my=d(xl," forward method, overrides the "),Ic=a(xl,"CODE",{});var Tx=s(Ic);fy=d(Tx,"__call__"),Tx.forEach(t),_y=d(xl," special method."),xl.forEach(t),gy=p(La),v(On.$$.fragment,La),by=p(La),v(Nn.$$.fragment,La),La.forEach(t),ho.forEach(t),oh=p(o),Lo=a(o,"H2",{class:!0});var em=s(Lo);Ln=a(em,"A",{id:!0,class:!0,href:!0});var wx=s(Ln);Oc=a(wx,"SPAN",{});var xx=s(Oc);v(Fr.$$.fragment,xx),xx.forEach(t),wx.forEach(t),ky=p(em),Nc=a(em,"SPAN",{});var $x=s(Nc);yy=d($x,"BartForCausalLM"),$x.forEach(t),em.forEach(t),nh=p(o),at=a(o,"DIV",{class:!0});var mo=s(at);v(zr.$$.fragment,mo),vy=p(mo),Lc=a(mo,"P",{});var Fx=s(Lc);Ty=d(Fx,"BART decoder with with a language modeling head on top (linear layer with weights tied to the input embeddings)."),Fx.forEach(t),wy=p(mo),qr=a(mo,"P",{});var tm=s(qr);xy=d(tm,"This model inherits from "),el=a(tm,"A",{href:!0});var zx=s(el);$y=d(zx,"PreTrainedModel"),zx.forEach(t),Fy=d(tm,`. 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.)`),tm.forEach(t),zy=p(mo),jr=a(mo,"P",{});var om=s(jr);qy=d(om,"This model is also a PyTorch "),Br=a(om,"A",{href:!0,rel:!0});var qx=s(Br);jy=d(qx,"torch.nn.Module"),qx.forEach(t),By=d(om,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),om.forEach(t),Ey=p(mo),Dn=a(mo,"DIV",{class:!0});var nm=s(Dn);v(Er.$$.fragment,nm),Cy=p(nm),v(Gn.$$.fragment,nm),nm.forEach(t),mo.forEach(t),ah=p(o),Do=a(o,"H2",{class:!0});var am=s(Do);Wn=a(am,"A",{id:!0,class:!0,href:!0});var jx=s(Wn);Dc=a(jx,"SPAN",{});var Bx=s(Dc);v(Cr.$$.fragment,Bx),Bx.forEach(t),jx.forEach(t),Ay=p(am),Gc=a(am,"SPAN",{});var Ex=s(Gc);My=d(Ex,"TFBartModel"),Ex.forEach(t),am.forEach(t),sh=p(o),st=a(o,"DIV",{class:!0});var fo=s(st);v(Ar.$$.fragment,fo),Py=p(fo),Mr=a(fo,"P",{});var sm=s(Mr);Sy=d(sm,`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),tl=a(sm,"A",{href:!0});var Cx=s(tl);Iy=d(Cx,"TFPreTrainedModel"),Cx.forEach(t),Oy=d(sm,`. 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.)`),sm.forEach(t),Ny=p(fo),Pr=a(fo,"P",{});var rm=s(Pr);Ly=d(rm,"This model is also a "),Sr=a(rm,"A",{href:!0,rel:!0});var Ax=s(Sr);Dy=d(Ax,"tf.keras.Model"),Ax.forEach(t),Gy=d(rm,` 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.`),rm.forEach(t),Wy=p(fo),v(Un.$$.fragment,fo),Uy=p(fo),Mt=a(fo,"DIV",{class:!0});var Da=s(Mt);v(Ir.$$.fragment,Da),Ry=p(Da),Go=a(Da,"P",{});var $l=s(Go);Hy=d($l,"The "),ol=a($l,"A",{href:!0});var Mx=s(ol);Qy=d(Mx,"TFBartModel"),Mx.forEach(t),Vy=d($l," forward method, overrides the "),Wc=a($l,"CODE",{});var Px=s(Wc);Ky=d(Px,"__call__"),Px.forEach(t),Jy=d($l," special method."),$l.forEach(t),Xy=p(Da),v(Rn.$$.fragment,Da),Zy=p(Da),v(Hn.$$.fragment,Da),Da.forEach(t),fo.forEach(t),rh=p(o),Wo=a(o,"H2",{class:!0});var im=s(Wo);Qn=a(im,"A",{id:!0,class:!0,href:!0});var Sx=s(Qn);Uc=a(Sx,"SPAN",{});var Ix=s(Uc);v(Or.$$.fragment,Ix),Ix.forEach(t),Sx.forEach(t),Yy=p(im),Rc=a(im,"SPAN",{});var Ox=s(Rc);ev=d(Ox,"TFBartForConditionalGeneration"),Ox.forEach(t),im.forEach(t),ih=p(o),rt=a(o,"DIV",{class:!0});var _o=s(rt);v(Nr.$$.fragment,_o),tv=p(_o),Lr=a(_o,"P",{});var dm=s(Lr);ov=d(dm,`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),nl=a(dm,"A",{href:!0});var Nx=s(nl);nv=d(Nx,"TFPreTrainedModel"),Nx.forEach(t),av=d(dm,`. 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.)`),dm.forEach(t),sv=p(_o),Dr=a(_o,"P",{});var lm=s(Dr);rv=d(lm,"This model is also a "),Gr=a(lm,"A",{href:!0,rel:!0});var Lx=s(Gr);iv=d(Lx,"tf.keras.Model"),Lx.forEach(t),dv=d(lm,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),lm.forEach(t),lv=p(_o),v(Vn.$$.fragment,_o),cv=p(_o),_t=a(_o,"DIV",{class:!0});var go=s(_t);v(Wr.$$.fragment,go),pv=p(go),Uo=a(go,"P",{});var Fl=s(Uo);uv=d(Fl,"The "),al=a(Fl,"A",{href:!0});var Dx=s(al);hv=d(Dx,"TFBartForConditionalGeneration"),Dx.forEach(t),mv=d(Fl," forward method, overrides the "),Hc=a(Fl,"CODE",{});var Gx=s(Hc);fv=d(Gx,"__call__"),Gx.forEach(t),_v=d(Fl," special method."),Fl.forEach(t),gv=p(go),v(Kn.$$.fragment,go),bv=p(go),v(Jn.$$.fragment,go),kv=p(go),v(Xn.$$.fragment,go),go.forEach(t),_o.forEach(t),dh=p(o),Ro=a(o,"H2",{class:!0});var cm=s(Ro);Zn=a(cm,"A",{id:!0,class:!0,href:!0});var Wx=s(Zn);Qc=a(Wx,"SPAN",{});var Ux=s(Qc);v(Ur.$$.fragment,Ux),Ux.forEach(t),Wx.forEach(t),yv=p(cm),Vc=a(cm,"SPAN",{});var Rx=s(Vc);vv=d(Rx,"TFBartForSequenceClassification"),Rx.forEach(t),cm.forEach(t),lh=p(o),Pe=a(o,"DIV",{class:!0});var Nt=s(Pe);v(Rr.$$.fragment,Nt),Tv=p(Nt),Kc=a(Nt,"P",{});var Hx=s(Kc);wv=d(Hx,`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),Hx.forEach(t),xv=p(Nt),Hr=a(Nt,"P",{});var pm=s(Hr);$v=d(pm,"This model inherits from "),sl=a(pm,"A",{href:!0});var Qx=s(sl);Fv=d(Qx,"TFPreTrainedModel"),Qx.forEach(t),zv=d(pm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pm.forEach(t),qv=p(Nt),Qr=a(Nt,"P",{});var um=s(Qr);jv=d(um,"This model is also a "),Vr=a(um,"A",{href:!0,rel:!0});var Vx=s(Vr);Bv=d(Vx,"tf.keras.Model"),Vx.forEach(t),Ev=d(um,` 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.`),um.forEach(t),Cv=p(Nt),v(Yn.$$.fragment,Nt),Av=p(Nt),ro=a(Nt,"DIV",{class:!0});var zl=s(ro);v(Kr.$$.fragment,zl),Mv=p(zl),Ho=a(zl,"P",{});var ql=s(Ho);Pv=d(ql,"The "),rl=a(ql,"A",{href:!0});var Kx=s(rl);Sv=d(Kx,"TFBartForSequenceClassification"),Kx.forEach(t),Iv=d(ql," forward method, overrides the "),Jc=a(ql,"CODE",{});var Jx=s(Jc);Ov=d(Jx,"__call__"),Jx.forEach(t),Nv=d(ql," special method."),ql.forEach(t),Lv=p(zl),v(ea.$$.fragment,zl),zl.forEach(t),Nt.forEach(t),ch=p(o),Qo=a(o,"H2",{class:!0});var hm=s(Qo);ta=a(hm,"A",{id:!0,class:!0,href:!0});var Xx=s(ta);Xc=a(Xx,"SPAN",{});var Zx=s(Xc);v(Jr.$$.fragment,Zx),Zx.forEach(t),Xx.forEach(t),Dv=p(hm),Zc=a(hm,"SPAN",{});var Yx=s(Zc);Gv=d(Yx,"FlaxBartModel"),Yx.forEach(t),hm.forEach(t),ph=p(o),_e=a(o,"DIV",{class:!0});var We=s(_e);v(Xr.$$.fragment,We),Wv=p(We),Zr=a(We,"P",{});var mm=s(Zr);Uv=d(mm,`The bare Bart Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),il=a(mm,"A",{href:!0});var e$=s(il);Rv=d(e$,"FlaxPreTrainedModel"),e$.forEach(t),Hv=d(mm,`. 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.)`),mm.forEach(t),Qv=p(We),Yr=a(We,"P",{});var fm=s(Yr);Vv=d(fm,`This model is also a Flax Linen
`),ei=a(fm,"A",{href:!0,rel:!0});var t$=s(ei);Kv=d(t$,"flax.nn.Module"),t$.forEach(t),Jv=d(fm,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),fm.forEach(t),Xv=p(We),Yc=a(We,"P",{});var o$=s(Yc);Zv=d(o$,"Finally, this model supports inherent JAX features such as:"),o$.forEach(t),Yv=p(We),Gt=a(We,"UL",{});var Ga=s(Gt);ep=a(Ga,"LI",{});var n$=s(ep);ti=a(n$,"A",{href:!0,rel:!0});var a$=s(ti);eT=d(a$,"Just-In-Time (JIT) compilation"),a$.forEach(t),n$.forEach(t),tT=p(Ga),tp=a(Ga,"LI",{});var s$=s(tp);oi=a(s$,"A",{href:!0,rel:!0});var r$=s(oi);oT=d(r$,"Automatic Differentiation"),r$.forEach(t),s$.forEach(t),nT=p(Ga),op=a(Ga,"LI",{});var i$=s(op);ni=a(i$,"A",{href:!0,rel:!0});var d$=s(ni);aT=d(d$,"Vectorization"),d$.forEach(t),i$.forEach(t),sT=p(Ga),np=a(Ga,"LI",{});var l$=s(np);ai=a(l$,"A",{href:!0,rel:!0});var c$=s(ai);rT=d(c$,"Parallelization"),c$.forEach(t),l$.forEach(t),Ga.forEach(t),iT=p(We),Pt=a(We,"DIV",{class:!0});var Wa=s(Pt);v(si.$$.fragment,Wa),dT=p(Wa),Vo=a(Wa,"P",{});var jl=s(Vo);lT=d(jl,"The "),ap=a(jl,"CODE",{});var p$=s(ap);cT=d(p$,"FlaxBartPreTrainedModel"),p$.forEach(t),pT=d(jl," forward method, overrides the "),sp=a(jl,"CODE",{});var u$=s(sp);uT=d(u$,"__call__"),u$.forEach(t),hT=d(jl," special method."),jl.forEach(t),mT=p(Wa),v(oa.$$.fragment,Wa),fT=p(Wa),v(na.$$.fragment,Wa),Wa.forEach(t),_T=p(We),aa=a(We,"DIV",{class:!0});var _m=s(aa);v(ri.$$.fragment,_m),gT=p(_m),v(sa.$$.fragment,_m),_m.forEach(t),bT=p(We),ra=a(We,"DIV",{class:!0});var gm=s(ra);v(ii.$$.fragment,gm),kT=p(gm),v(ia.$$.fragment,gm),gm.forEach(t),We.forEach(t),uh=p(o),Ko=a(o,"H2",{class:!0});var bm=s(Ko);da=a(bm,"A",{id:!0,class:!0,href:!0});var h$=s(da);rp=a(h$,"SPAN",{});var m$=s(rp);v(di.$$.fragment,m$),m$.forEach(t),h$.forEach(t),yT=p(bm),ip=a(bm,"SPAN",{});var f$=s(ip);vT=d(f$,"FlaxBartForConditionalGeneration"),f$.forEach(t),bm.forEach(t),hh=p(o),ge=a(o,"DIV",{class:!0});var Ue=s(ge);v(li.$$.fragment,Ue),TT=p(Ue),ci=a(Ue,"P",{});var km=s(ci);wT=d(km,`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),dl=a(km,"A",{href:!0});var _$=s(dl);xT=d(_$,"FlaxPreTrainedModel"),_$.forEach(t),$T=d(km,`. 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.)`),km.forEach(t),FT=p(Ue),pi=a(Ue,"P",{});var ym=s(pi);zT=d(ym,`This model is also a Flax Linen
`),ui=a(ym,"A",{href:!0,rel:!0});var g$=s(ui);qT=d(g$,"flax.nn.Module"),g$.forEach(t),jT=d(ym,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ym.forEach(t),BT=p(Ue),dp=a(Ue,"P",{});var b$=s(dp);ET=d(b$,"Finally, this model supports inherent JAX features such as:"),b$.forEach(t),CT=p(Ue),Wt=a(Ue,"UL",{});var Ua=s(Wt);lp=a(Ua,"LI",{});var k$=s(lp);hi=a(k$,"A",{href:!0,rel:!0});var y$=s(hi);AT=d(y$,"Just-In-Time (JIT) compilation"),y$.forEach(t),k$.forEach(t),MT=p(Ua),cp=a(Ua,"LI",{});var v$=s(cp);mi=a(v$,"A",{href:!0,rel:!0});var T$=s(mi);PT=d(T$,"Automatic Differentiation"),T$.forEach(t),v$.forEach(t),ST=p(Ua),pp=a(Ua,"LI",{});var w$=s(pp);fi=a(w$,"A",{href:!0,rel:!0});var x$=s(fi);IT=d(x$,"Vectorization"),x$.forEach(t),w$.forEach(t),OT=p(Ua),up=a(Ua,"LI",{});var $$=s(up);_i=a($$,"A",{href:!0,rel:!0});var F$=s(_i);NT=d(F$,"Parallelization"),F$.forEach(t),$$.forEach(t),Ua.forEach(t),LT=p(Ue),gt=a(Ue,"DIV",{class:!0});var bo=s(gt);v(gi.$$.fragment,bo),DT=p(bo),Jo=a(bo,"P",{});var Bl=s(Jo);GT=d(Bl,"The "),hp=a(Bl,"CODE",{});var z$=s(hp);WT=d(z$,"FlaxBartPreTrainedModel"),z$.forEach(t),UT=d(Bl," forward method, overrides the "),mp=a(Bl,"CODE",{});var q$=s(mp);RT=d(q$,"__call__"),q$.forEach(t),HT=d(Bl," special method."),Bl.forEach(t),QT=p(bo),v(la.$$.fragment,bo),VT=p(bo),v(ca.$$.fragment,bo),KT=p(bo),v(pa.$$.fragment,bo),bo.forEach(t),JT=p(Ue),ua=a(Ue,"DIV",{class:!0});var vm=s(ua);v(bi.$$.fragment,vm),XT=p(vm),v(ha.$$.fragment,vm),vm.forEach(t),ZT=p(Ue),ma=a(Ue,"DIV",{class:!0});var Tm=s(ma);v(ki.$$.fragment,Tm),YT=p(Tm),v(fa.$$.fragment,Tm),Tm.forEach(t),Ue.forEach(t),mh=p(o),Xo=a(o,"H2",{class:!0});var wm=s(Xo);_a=a(wm,"A",{id:!0,class:!0,href:!0});var j$=s(_a);fp=a(j$,"SPAN",{});var B$=s(fp);v(yi.$$.fragment,B$),B$.forEach(t),j$.forEach(t),ew=p(wm),_p=a(wm,"SPAN",{});var E$=s(_p);tw=d(E$,"FlaxBartForSequenceClassification"),E$.forEach(t),wm.forEach(t),fh=p(o),J=a(o,"DIV",{class:!0});var Be=s(J);v(vi.$$.fragment,Be),ow=p(Be),gp=a(Be,"P",{});var C$=s(gp);nw=d(C$,`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),C$.forEach(t),aw=p(Be),Ti=a(Be,"P",{});var xm=s(Ti);sw=d(xm,"This model inherits from "),ll=a(xm,"A",{href:!0});var A$=s(ll);rw=d(A$,"FlaxPreTrainedModel"),A$.forEach(t),iw=d(xm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),xm.forEach(t),dw=p(Be),wi=a(Be,"P",{});var $m=s(wi);lw=d($m,`This model is also a Flax Linen
`),xi=a($m,"A",{href:!0,rel:!0});var M$=s(xi);cw=d(M$,"flax.nn.Module"),M$.forEach(t),pw=d($m,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),$m.forEach(t),uw=p(Be),bp=a(Be,"P",{});var P$=s(bp);hw=d(P$,"Finally, this model supports inherent JAX features such as:"),P$.forEach(t),mw=p(Be),Ut=a(Be,"UL",{});var Ra=s(Ut);kp=a(Ra,"LI",{});var S$=s(kp);$i=a(S$,"A",{href:!0,rel:!0});var I$=s($i);fw=d(I$,"Just-In-Time (JIT) compilation"),I$.forEach(t),S$.forEach(t),_w=p(Ra),yp=a(Ra,"LI",{});var O$=s(yp);Fi=a(O$,"A",{href:!0,rel:!0});var N$=s(Fi);gw=d(N$,"Automatic Differentiation"),N$.forEach(t),O$.forEach(t),bw=p(Ra),vp=a(Ra,"LI",{});var L$=s(vp);zi=a(L$,"A",{href:!0,rel:!0});var D$=s(zi);kw=d(D$,"Vectorization"),D$.forEach(t),L$.forEach(t),yw=p(Ra),Tp=a(Ra,"LI",{});var G$=s(Tp);qi=a(G$,"A",{href:!0,rel:!0});var W$=s(qi);vw=d(W$,"Parallelization"),W$.forEach(t),G$.forEach(t),Ra.forEach(t),Tw=p(Be),St=a(Be,"DIV",{class:!0});var Ha=s(St);v(ji.$$.fragment,Ha),ww=p(Ha),Zo=a(Ha,"P",{});var El=s(Zo);xw=d(El,"The "),wp=a(El,"CODE",{});var U$=s(wp);$w=d(U$,"FlaxBartPreTrainedModel"),U$.forEach(t),Fw=d(El," forward method, overrides the "),xp=a(El,"CODE",{});var R$=s(xp);zw=d(R$,"__call__"),R$.forEach(t),qw=d(El," special method."),El.forEach(t),jw=p(Ha),v(ga.$$.fragment,Ha),Bw=p(Ha),v(ba.$$.fragment,Ha),Ha.forEach(t),Ew=p(Be),ka=a(Be,"DIV",{class:!0});var Fm=s(ka);v(Bi.$$.fragment,Fm),Cw=p(Fm),v(ya.$$.fragment,Fm),Fm.forEach(t),Aw=p(Be),va=a(Be,"DIV",{class:!0});var zm=s(va);v(Ei.$$.fragment,zm),Mw=p(zm),v(Ta.$$.fragment,zm),zm.forEach(t),Be.forEach(t),_h=p(o),Yo=a(o,"H2",{class:!0});var qm=s(Yo);wa=a(qm,"A",{id:!0,class:!0,href:!0});var H$=s(wa);$p=a(H$,"SPAN",{});var Q$=s($p);v(Ci.$$.fragment,Q$),Q$.forEach(t),H$.forEach(t),Pw=p(qm),Fp=a(qm,"SPAN",{});var V$=s(Fp);Sw=d(V$,"FlaxBartForQuestionAnswering"),V$.forEach(t),qm.forEach(t),gh=p(o),X=a(o,"DIV",{class:!0});var Ee=s(X);v(Ai.$$.fragment,Ee),Iw=p(Ee),en=a(Ee,"P",{});var Cl=s(en);Ow=d(Cl,`BART 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 `),zp=a(Cl,"CODE",{});var K$=s(zp);Nw=d(K$,"span start logits"),K$.forEach(t),Lw=d(Cl," and "),qp=a(Cl,"CODE",{});var J$=s(qp);Dw=d(J$,"span end logits"),J$.forEach(t),Gw=d(Cl,")."),Cl.forEach(t),Ww=p(Ee),Mi=a(Ee,"P",{});var jm=s(Mi);Uw=d(jm,"This model inherits from "),cl=a(jm,"A",{href:!0});var X$=s(cl);Rw=d(X$,"FlaxPreTrainedModel"),X$.forEach(t),Hw=d(jm,`. 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.)`),jm.forEach(t),Qw=p(Ee),Pi=a(Ee,"P",{});var Bm=s(Pi);Vw=d(Bm,`This model is also a Flax Linen
`),Si=a(Bm,"A",{href:!0,rel:!0});var Z$=s(Si);Kw=d(Z$,"flax.nn.Module"),Z$.forEach(t),Jw=d(Bm,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Bm.forEach(t),Xw=p(Ee),jp=a(Ee,"P",{});var Y$=s(jp);Zw=d(Y$,"Finally, this model supports inherent JAX features such as:"),Y$.forEach(t),Yw=p(Ee),Rt=a(Ee,"UL",{});var Qa=s(Rt);Bp=a(Qa,"LI",{});var eF=s(Bp);Ii=a(eF,"A",{href:!0,rel:!0});var tF=s(Ii);e2=d(tF,"Just-In-Time (JIT) compilation"),tF.forEach(t),eF.forEach(t),t2=p(Qa),Ep=a(Qa,"LI",{});var oF=s(Ep);Oi=a(oF,"A",{href:!0,rel:!0});var nF=s(Oi);o2=d(nF,"Automatic Differentiation"),nF.forEach(t),oF.forEach(t),n2=p(Qa),Cp=a(Qa,"LI",{});var aF=s(Cp);Ni=a(aF,"A",{href:!0,rel:!0});var sF=s(Ni);a2=d(sF,"Vectorization"),sF.forEach(t),aF.forEach(t),s2=p(Qa),Ap=a(Qa,"LI",{});var rF=s(Ap);Li=a(rF,"A",{href:!0,rel:!0});var iF=s(Li);r2=d(iF,"Parallelization"),iF.forEach(t),rF.forEach(t),Qa.forEach(t),i2=p(Ee),It=a(Ee,"DIV",{class:!0});var Va=s(It);v(Di.$$.fragment,Va),d2=p(Va),tn=a(Va,"P",{});var Al=s(tn);l2=d(Al,"The "),Mp=a(Al,"CODE",{});var dF=s(Mp);c2=d(dF,"FlaxBartPreTrainedModel"),dF.forEach(t),p2=d(Al," forward method, overrides the "),Pp=a(Al,"CODE",{});var lF=s(Pp);u2=d(lF,"__call__"),lF.forEach(t),h2=d(Al," special method."),Al.forEach(t),m2=p(Va),v(xa.$$.fragment,Va),f2=p(Va),v($a.$$.fragment,Va),Va.forEach(t),_2=p(Ee),Fa=a(Ee,"DIV",{class:!0});var Em=s(Fa);v(Gi.$$.fragment,Em),g2=p(Em),v(za.$$.fragment,Em),Em.forEach(t),b2=p(Ee),qa=a(Ee,"DIV",{class:!0});var Cm=s(qa);v(Wi.$$.fragment,Cm),k2=p(Cm),v(ja.$$.fragment,Cm),Cm.forEach(t),Ee.forEach(t),bh=p(o),on=a(o,"H2",{class:!0});var Am=s(on);Ba=a(Am,"A",{id:!0,class:!0,href:!0});var cF=s(Ba);Sp=a(cF,"SPAN",{});var pF=s(Sp);v(Ui.$$.fragment,pF),pF.forEach(t),cF.forEach(t),y2=p(Am),Ip=a(Am,"SPAN",{});var uF=s(Ip);v2=d(uF,"FlaxBartForCausalLM"),uF.forEach(t),Am.forEach(t),kh=p(o),xe=a(o,"DIV",{class:!0});var bt=s(xe);v(Ri.$$.fragment,bt),T2=p(bt),Op=a(bt,"P",{});var hF=s(Op);w2=d(hF,`Bart Decoder Model with a language modeling head on top (linear layer with weights tied to the input embeddings)
e.g for autoregressive tasks.`),hF.forEach(t),x2=p(bt),Hi=a(bt,"P",{});var Mm=s(Hi);$2=d(Mm,"This model inherits from "),pl=a(Mm,"A",{href:!0});var mF=s(pl);F2=d(mF,"FlaxPreTrainedModel"),mF.forEach(t),z2=d(Mm,`. 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.)`),Mm.forEach(t),q2=p(bt),Qi=a(bt,"P",{});var Pm=s(Qi);j2=d(Pm,`This model is also a Flax Linen
`),Vi=a(Pm,"A",{href:!0,rel:!0});var fF=s(Vi);B2=d(fF,"flax.nn.Module"),fF.forEach(t),E2=d(Pm,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Pm.forEach(t),C2=p(bt),Np=a(bt,"P",{});var _F=s(Np);A2=d(_F,"Finally, this model supports inherent JAX features such as:"),_F.forEach(t),M2=p(bt),Ht=a(bt,"UL",{});var Ka=s(Ht);Lp=a(Ka,"LI",{});var gF=s(Lp);Ki=a(gF,"A",{href:!0,rel:!0});var bF=s(Ki);P2=d(bF,"Just-In-Time (JIT) compilation"),bF.forEach(t),gF.forEach(t),S2=p(Ka),Dp=a(Ka,"LI",{});var kF=s(Dp);Ji=a(kF,"A",{href:!0,rel:!0});var yF=s(Ji);I2=d(yF,"Automatic Differentiation"),yF.forEach(t),kF.forEach(t),O2=p(Ka),Gp=a(Ka,"LI",{});var vF=s(Gp);Xi=a(vF,"A",{href:!0,rel:!0});var TF=s(Xi);N2=d(TF,"Vectorization"),TF.forEach(t),vF.forEach(t),L2=p(Ka),Wp=a(Ka,"LI",{});var wF=s(Wp);Zi=a(wF,"A",{href:!0,rel:!0});var xF=s(Zi);D2=d(xF,"Parallelization"),xF.forEach(t),wF.forEach(t),Ka.forEach(t),G2=p(bt),Ot=a(bt,"DIV",{class:!0});var Ja=s(Ot);v(Yi.$$.fragment,Ja),W2=p(Ja),nn=a(Ja,"P",{});var Ml=s(nn);U2=d(Ml,"The "),Up=a(Ml,"CODE",{});var $F=s(Up);R2=d($F,"FlaxBartDecoderPreTrainedModel"),$F.forEach(t),H2=d(Ml," forward method, overrides the "),Rp=a(Ml,"CODE",{});var FF=s(Rp);Q2=d(FF,"__call__"),FF.forEach(t),V2=d(Ml," special method."),Ml.forEach(t),K2=p(Ja),v(Ea.$$.fragment,Ja),J2=p(Ja),v(Ca.$$.fragment,Ja),Ja.forEach(t),bt.forEach(t),this.h()},h(){u(l,"name","hf:doc:metadata"),u(l,"content",JSON.stringify(xz)),u(m,"id","bart"),u(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(m,"href","#bart"),u(f,"class","relative group"),u(ie,"alt","Models"),zF(ie.src,j="https://img.shields.io/badge/All_model_pages-bart-blueviolet")||u(ie,"src",j),u(re,"href","https://huggingface.co/models?filter=bart"),u($e,"alt","Spaces"),zF($e.src,it="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||u($e,"src",it),u(V,"href","https://huggingface.co/spaces/docs-demos/bart-large-mnli"),u(I,"class","flex flex-wrap space-x-1"),u(we,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),u(we,"rel","nofollow"),u(be,"id","overview"),u(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(be,"href","#overview"),u(N,"class","relative group"),u(Q,"href","https://arxiv.org/abs/1910.13461"),u(Q,"rel","nofollow"),u(Xa,"href","https://huggingface.co/sshleifer"),u(Xa,"rel","nofollow"),u(Za,"href","https://github.com/pytorch/fairseq/tree/master/examples/bart"),u(Za,"rel","nofollow"),u(dn,"id","examples"),u(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"),u(dn,"href","#examples"),u(ko,"class","relative group"),u(ts,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization/README.md"),u(ts,"rel","nofollow"),u(fd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(os,"href","https://discuss.huggingface.co/t/train-bart-for-conditional-generation-e-g-summarization/1904"),u(os,"rel","nofollow"),u(ns,"href","https://huggingface.co/models?search=distilbart"),u(ns,"rel","nofollow"),u(as,"href","https://arxiv.org/abs/2010.13002"),u(as,"rel","nofollow"),u(cn,"id","implementation-notes"),u(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"),u(cn,"href","#implementation-notes"),u(yo,"class","relative group"),u(_d,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartTokenizer"),u(gd,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode"),u(bd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartModel"),u(yd,"href","/docs/transformers/v4.29.0/en/main_classes/text_generation#transformers.GenerationMixin.generate"),u(pn,"id","mask-filling"),u(pn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(pn,"href","#mask-filling"),u(xo,"class","relative group"),u(un,"id","resources"),u(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"),u(un,"href","#resources"),u($o,"class","relative group"),u(ps,"href","https://huggingface.co/blog/sagemaker-distributed-training-seq2seq"),u(ps,"rel","nofollow"),u(hs,"href","https://colab.research.google.com/github/ohmeow/ohmeow_website/blob/master/posts/2021-05-25-mbart-sequence-classification-with-blurr.ipynb"),u(hs,"rel","nofollow"),u(fs,"href","https://colab.research.google.com/github/elsanns/xai-nlp-notebooks/blob/master/fine_tune_bart_summarization_two_langs.ipynb"),u(fs,"rel","nofollow"),u(Td,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(_s,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization"),u(_s,"rel","nofollow"),u(gs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization.ipynb"),u(gs,"rel","nofollow"),u(wd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),u(bs,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/summarization"),u(bs,"rel","nofollow"),u(ks,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization-tf.ipynb"),u(ks,"rel","nofollow"),u(xd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.FlaxBartForConditionalGeneration"),u(ys,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/summarization"),u(ys,"rel","nofollow"),u(vs,"href","https://huggingface.co/course/chapter7/5?fw=pt#summarization"),u(vs,"rel","nofollow"),u(Fd,"href","../tasks/summarization"),u(zd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(ws,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#robertabertdistilbert-and-masked-language-modeling"),u(ws,"rel","nofollow"),u(xs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb"),u(xs,"rel","nofollow"),u(qd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),u($s,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_mlmpy"),u($s,"rel","nofollow"),u(Fs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb"),u(Fs,"rel","nofollow"),u(jd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.FlaxBartForConditionalGeneration"),u(zs,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#masked-language-modeling"),u(zs,"rel","nofollow"),u(qs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/masked_language_modeling_flax.ipynb"),u(qs,"rel","nofollow"),u(js,"href","https://huggingface.co/course/chapter7/3?fw=pt"),u(js,"rel","nofollow"),u(Ed,"href","../tasks/masked_language_modeling"),u(Cs,"href","https://colab.research.google.com/github/vasudevgupta7/huggingface-tutorials/blob/main/translation_training.ipynb"),u(Cs,"rel","nofollow"),u(Cd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(As,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/translation"),u(As,"rel","nofollow"),u(Ms,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation.ipynb"),u(Ms,"rel","nofollow"),u(Ad,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),u(Ps,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/translation"),u(Ps,"rel","nofollow"),u(Ss,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation-tf.ipynb"),u(Ss,"rel","nofollow"),u(Md,"href","../tasks/translation"),u(Sd,"href","../tasks/sequence_classification"),u(Id,"href","../tasks/question_answering"),u(Od,"href","../tasks/language_modeling"),u(mn,"id","transformers.BartConfig"),u(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"),u(mn,"href","#transformers.BartConfig"),u(Fo,"class","relative group"),u(Nd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartModel"),u(Ns,"href","https://huggingface.co/facebook/bart-large"),u(Ns,"rel","nofollow"),u(Ld,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),u(Dd,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),u(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(_n,"id","transformers.BartTokenizer"),u(_n,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(_n,"href","#transformers.BartTokenizer"),u(jo,"class","relative group"),u(Gd,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),u(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(kn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(yn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(vn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Tn,"id","transformers.BartTokenizerFast"),u(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"),u(Tn,"href","#transformers.BartTokenizerFast"),u(Bo,"class","relative group"),u(Rd,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),u($n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Fn,"id","transformers.BartModel"),u(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"),u(Fn,"href","#transformers.BartModel"),u(Eo,"class","relative group"),u(Hd,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),u(rr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(rr,"rel","nofollow"),u(Qd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartModel"),u(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(jn,"id","transformers.BartForConditionalGeneration"),u(jn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(jn,"href","#transformers.BartForConditionalGeneration"),u(Ao,"class","relative group"),u(Vd,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),u(ur,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(ur,"rel","nofollow"),u(Kd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(An,"id","transformers.BartForSequenceClassification"),u(An,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(An,"href","#transformers.BartForSequenceClassification"),u(Po,"class","relative group"),u(Jd,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),u(br,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(br,"rel","nofollow"),u(Xd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartForSequenceClassification"),u(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(In,"id","transformers.BartForQuestionAnswering"),u(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"),u(In,"href","#transformers.BartForQuestionAnswering"),u(Io,"class","relative group"),u(Zd,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),u(xr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(xr,"rel","nofollow"),u(Yd,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.BartForQuestionAnswering"),u(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ln,"id","transformers.BartForCausalLM"),u(Ln,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Ln,"href","#transformers.BartForCausalLM"),u(Lo,"class","relative group"),u(el,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),u(Br,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(Br,"rel","nofollow"),u(Dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Wn,"id","transformers.TFBartModel"),u(Wn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Wn,"href","#transformers.TFBartModel"),u(Do,"class","relative group"),u(tl,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),u(Sr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Sr,"rel","nofollow"),u(ol,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.TFBartModel"),u(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Qn,"id","transformers.TFBartForConditionalGeneration"),u(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"),u(Qn,"href","#transformers.TFBartForConditionalGeneration"),u(Wo,"class","relative group"),u(nl,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),u(Gr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Gr,"rel","nofollow"),u(al,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),u(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Zn,"id","transformers.TFBartForSequenceClassification"),u(Zn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Zn,"href","#transformers.TFBartForSequenceClassification"),u(Ro,"class","relative group"),u(sl,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),u(Vr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Vr,"rel","nofollow"),u(rl,"href","/docs/transformers/v4.29.0/en/model_doc/bart#transformers.TFBartForSequenceClassification"),u(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ta,"id","transformers.FlaxBartModel"),u(ta,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(ta,"href","#transformers.FlaxBartModel"),u(Qo,"class","relative group"),u(il,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(ei,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(ei,"rel","nofollow"),u(ti,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(ti,"rel","nofollow"),u(oi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(oi,"rel","nofollow"),u(ni,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(ni,"rel","nofollow"),u(ai,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(ai,"rel","nofollow"),u(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ra,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(da,"id","transformers.FlaxBartForConditionalGeneration"),u(da,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(da,"href","#transformers.FlaxBartForConditionalGeneration"),u(Ko,"class","relative group"),u(dl,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(ui,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(ui,"rel","nofollow"),u(hi,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(hi,"rel","nofollow"),u(mi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(mi,"rel","nofollow"),u(fi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(fi,"rel","nofollow"),u(_i,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(_i,"rel","nofollow"),u(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ua,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ma,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(_a,"id","transformers.FlaxBartForSequenceClassification"),u(_a,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(_a,"href","#transformers.FlaxBartForSequenceClassification"),u(Xo,"class","relative group"),u(ll,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(xi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(xi,"rel","nofollow"),u($i,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u($i,"rel","nofollow"),u(Fi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Fi,"rel","nofollow"),u(zi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(zi,"rel","nofollow"),u(qi,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(qi,"rel","nofollow"),u(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ka,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(va,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(wa,"id","transformers.FlaxBartForQuestionAnswering"),u(wa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(wa,"href","#transformers.FlaxBartForQuestionAnswering"),u(Yo,"class","relative group"),u(cl,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(Si,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(Si,"rel","nofollow"),u(Ii,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(Ii,"rel","nofollow"),u(Oi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Oi,"rel","nofollow"),u(Ni,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(Ni,"rel","nofollow"),u(Li,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(Li,"rel","nofollow"),u(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Fa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(qa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ba,"id","transformers.FlaxBartForCausalLM"),u(Ba,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Ba,"href","#transformers.FlaxBartForCausalLM"),u(on,"class","relative group"),u(pl,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(Vi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(Vi,"rel","nofollow"),u(Ki,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(Ki,"rel","nofollow"),u(Ji,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Ji,"rel","nofollow"),u(Xi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(Xi,"rel","nofollow"),u(Zi,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(Zi,"rel","nofollow"),u(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(xe,"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),g(o,k,_),g(o,f,_),e(f,m),e(m,b),T(r,b,null),e(f,h),e(f,q),e(q,se),g(o,H,_),g(o,I,_),e(I,re),e(re,ie),e(I,Re),e(I,V),e(V,$e),g(o,Z,_),g(o,de,_),e(de,Ce),e(Ce,le),e(de,He),e(de,we),e(we,ce),e(de,Qe),g(o,Ie,_),g(o,N,_),e(N,be),e(be,Ae),T(Y,Ae,null),e(N,A),e(N,M),e(M,Ve),g(o,ee,_),g(o,ke,_),e(ke,Ke),e(ke,Q),e(Q,Je),e(ke,Xe),g(o,P,_),g(o,Fe,_),e(Fe,pe),g(o,Oe,_),g(o,te,_),e(te,K),e(K,Ze),e(te,Ye),e(te,U),e(U,et),e(te,ue),e(te,Me),e(Me,ze),g(o,S,_),g(o,qe,_),e(qe,L),g(o,Ne,_),g(o,ye,_),e(ye,F),e(F,B),e(B,wt),e(ye,je),e(ye,Le),e(Le,dt),e(dt,E),e(Le,xt),e(Le,oe),e(oe,lt),e(lt,$t),e(oe,Ft),e(oe,R),e(R,he),e(oe,zt),e(oe,ct),e(ct,me),e(oe,qt),e(oe,pt),e(pt,tt),e(oe,jt),e(oe,ve),e(ve,Bt),g(o,xu,_),g(o,Vt,_),e(Vt,Sm),e(Vt,Xa),e(Xa,Im),e(Vt,Om),e(Vt,Za),e(Za,Nm),e(Vt,Lm),g(o,$u,_),g(o,ko,_),e(ko,dn),e(dn,Pl),T(Ya,Pl,null),e(ko,Dm),e(ko,Sl),e(Sl,Gm),g(o,Fu,_),g(o,Kt,_),e(Kt,es),e(es,Wm),e(es,ts),e(ts,Um),e(es,Rm),e(Kt,Hm),e(Kt,Lt),e(Lt,Qm),e(Lt,fd),e(fd,Vm),e(Lt,Km),e(Lt,Il),e(Il,Jm),e(Lt,Xm),e(Lt,os),e(os,Zm),e(Lt,Ym),e(Kt,ef),e(Kt,ln),e(ln,ns),e(ns,tf),e(ln,of),e(ln,as),e(as,nf),e(ln,af),g(o,zu,_),g(o,yo,_),e(yo,cn),e(cn,Ol),T(ss,Ol,null),e(yo,sf),e(yo,Nl),e(Nl,rf),g(o,qu,_),g(o,ut,_),e(ut,Dt),e(Dt,df),e(Dt,Ll),e(Ll,lf),e(Dt,cf),e(Dt,_d),e(_d,pf),e(Dt,uf),e(Dt,gd),e(gd,hf),e(Dt,mf),e(ut,ff),e(ut,vo),e(vo,_f),e(vo,bd),e(bd,gf),e(vo,bf),e(vo,Dl),e(Dl,kf),e(vo,yf),e(ut,vf),e(ut,To),e(To,Tf),e(To,Gl),e(Gl,wf),e(To,xf),e(To,Wl),e(Wl,$f),e(To,Ff),e(ut,zf),e(ut,kd),e(kd,yd),e(yd,qf),e(kd,jf),e(ut,Bf),e(ut,wo),e(wo,Ef),e(wo,Ul),e(Ul,Cf),e(wo,Af),e(wo,Rl),e(Rl,Mf),e(wo,Pf),g(o,ju,_),g(o,xo,_),e(xo,pn),e(pn,Hl),T(rs,Hl,null),e(xo,Sf),e(xo,Ql),e(Ql,If),g(o,Bu,_),g(o,Jt,_),e(Jt,Of),e(Jt,Vl),e(Vl,Nf),e(Jt,Lf),e(Jt,Kl),e(Kl,Df),e(Jt,Gf),g(o,Eu,_),T(is,o,_),g(o,Cu,_),g(o,$o,_),e($o,un),e(un,Jl),T(ds,Jl,null),e($o,Wf),e($o,Xl),e(Xl,Uf),g(o,Au,_),g(o,vd,_),e(vd,Rf),g(o,Mu,_),T(ls,o,_),g(o,Pu,_),g(o,Te,_),e(Te,cs),e(cs,Hf),e(cs,ps),e(ps,Qf),e(cs,Vf),e(Te,Kf),e(Te,us),e(us,Jf),e(us,hs),e(hs,Xf),e(us,Zf),e(Te,Yf),e(Te,ms),e(ms,e_),e(ms,fs),e(fs,t_),e(ms,o_),e(Te,n_),e(Te,Xt),e(Xt,Td),e(Td,a_),e(Xt,s_),e(Xt,_s),e(_s,r_),e(Xt,i_),e(Xt,gs),e(gs,d_),e(Xt,l_),e(Te,c_),e(Te,Zt),e(Zt,wd),e(wd,p_),e(Zt,u_),e(Zt,bs),e(bs,h_),e(Zt,m_),e(Zt,ks),e(ks,f_),e(Zt,__),e(Te,g_),e(Te,hn),e(hn,xd),e(xd,b_),e(hn,k_),e(hn,ys),e(ys,y_),e(hn,v_),e(Te,T_),e(Te,$d),e($d,vs),e(vs,w_),e($d,x_),e(Te,$_),e(Te,Zl),e(Zl,Fd),e(Fd,F_),g(o,Su,_),T(Ts,o,_),g(o,Iu,_),g(o,ht,_),e(ht,Yt),e(Yt,zd),e(zd,z_),e(Yt,q_),e(Yt,ws),e(ws,j_),e(Yt,B_),e(Yt,xs),e(xs,E_),e(Yt,C_),e(ht,A_),e(ht,eo),e(eo,qd),e(qd,M_),e(eo,P_),e(eo,$s),e($s,S_),e(eo,I_),e(eo,Fs),e(Fs,O_),e(eo,N_),e(ht,L_),e(ht,to),e(to,jd),e(jd,D_),e(to,G_),e(to,zs),e(zs,W_),e(to,U_),e(to,qs),e(qs,R_),e(to,H_),e(ht,Q_),e(ht,Bd),e(Bd,js),e(js,V_),e(Bd,K_),e(ht,J_),e(ht,Yl),e(Yl,Ed),e(Ed,X_),g(o,Ou,_),T(Bs,o,_),g(o,Nu,_),g(o,Et,_),e(Et,Es),e(Es,Z_),e(Es,Cs),e(Cs,Y_),e(Es,eg),e(Et,tg),e(Et,oo),e(oo,Cd),e(Cd,og),e(oo,ng),e(oo,As),e(As,ag),e(oo,sg),e(oo,Ms),e(Ms,rg),e(oo,ig),e(Et,dg),e(Et,no),e(no,Ad),e(Ad,lg),e(no,cg),e(no,Ps),e(Ps,pg),e(no,ug),e(no,Ss),e(Ss,hg),e(no,mg),e(Et,fg),e(Et,ec),e(ec,Md),e(Md,_g),g(o,Lu,_),g(o,Pd,_),e(Pd,gg),g(o,Du,_),g(o,ao,_),e(ao,tc),e(tc,Sd),e(Sd,bg),e(ao,kg),e(ao,oc),e(oc,Id),e(Id,yg),e(ao,vg),e(ao,nc),e(nc,Od),e(Od,Tg),g(o,Gu,_),g(o,Fo,_),e(Fo,mn),e(mn,ac),T(Is,ac,null),e(Fo,wg),e(Fo,sc),e(sc,xg),g(o,Wu,_),g(o,kt,_),T(Os,kt,null),e(kt,$g),e(kt,zo),e(zo,Fg),e(zo,Nd),e(Nd,zg),e(zo,qg),e(zo,Ns),e(Ns,jg),e(zo,Bg),e(kt,Eg),e(kt,qo),e(qo,Cg),e(qo,Ld),e(Ld,Ag),e(qo,Mg),e(qo,Dd),e(Dd,Pg),e(qo,Sg),e(kt,Ig),T(fn,kt,null),g(o,Uu,_),g(o,jo,_),e(jo,_n),e(_n,rc),T(Ls,rc,null),e(jo,Og),e(jo,ic),e(ic,Ng),g(o,Ru,_),g(o,D,_),T(Ds,D,null),e(D,Lg),e(D,dc),e(dc,Dg),e(D,Gg),e(D,lc),e(lc,Wg),e(D,Ug),T(gn,D,null),e(D,Rg),e(D,Gs),e(Gs,Hg),e(Gs,cc),e(cc,Qg),e(Gs,Vg),e(D,Kg),T(bn,D,null),e(D,Jg),e(D,Ws),e(Ws,Xg),e(Ws,Gd),e(Gd,Zg),e(Ws,Yg),e(D,eb),e(D,so),T(Us,so,null),e(so,tb),e(so,pc),e(pc,ob),e(so,nb),e(so,Rs),e(Rs,Wd),e(Wd,ab),e(Wd,uc),e(uc,sb),e(Rs,rb),e(Rs,Ud),e(Ud,ib),e(Ud,hc),e(hc,db),e(D,lb),e(D,kn),T(Hs,kn,null),e(kn,cb),e(kn,mc),e(mc,pb),e(D,ub),e(D,yn),T(Qs,yn,null),e(yn,hb),e(yn,fc),e(fc,mb),e(D,fb),e(D,vn),T(Vs,vn,null),e(vn,_b),e(vn,Ks),e(Ks,gb),e(Ks,_c),e(_c,bb),e(Ks,kb),g(o,Hu,_),g(o,Bo,_),e(Bo,Tn),e(Tn,gc),T(Js,gc,null),e(Bo,yb),e(Bo,bc),e(bc,vb),g(o,Qu,_),g(o,fe,_),T(Xs,fe,null),e(fe,Tb),e(fe,Zs),e(Zs,wb),e(Zs,kc),e(kc,xb),e(Zs,$b),e(fe,Fb),e(fe,yc),e(yc,zb),e(fe,qb),T(wn,fe,null),e(fe,jb),e(fe,Ys),e(Ys,Bb),e(Ys,vc),e(vc,Eb),e(Ys,Cb),e(fe,Ab),T(xn,fe,null),e(fe,Mb),e(fe,er),e(er,Pb),e(er,Rd),e(Rd,Sb),e(er,Ib),e(fe,Ob),e(fe,$n),T(tr,$n,null),e($n,Nb),e($n,Tc),e(Tc,Lb),g(o,Vu,_),g(o,Eo,_),e(Eo,Fn),e(Fn,wc),T(or,wc,null),e(Eo,Db),e(Eo,xc),e(xc,Gb),g(o,Ku,_),g(o,yt,_),T(nr,yt,null),e(yt,Wb),e(yt,ar),e(ar,Ub),e(ar,Hd),e(Hd,Rb),e(ar,Hb),e(yt,Qb),e(yt,sr),e(sr,Vb),e(sr,rr),e(rr,Kb),e(sr,Jb),e(yt,Xb),e(yt,Ct),T(ir,Ct,null),e(Ct,Zb),e(Ct,Co),e(Co,Yb),e(Co,Qd),e(Qd,ek),e(Co,tk),e(Co,$c),e($c,ok),e(Co,nk),e(Ct,ak),T(zn,Ct,null),e(Ct,sk),T(qn,Ct,null),g(o,Ju,_),g(o,Ao,_),e(Ao,jn),e(jn,Fc),T(dr,Fc,null),e(Ao,rk),e(Ao,zc),e(zc,ik),g(o,Xu,_),g(o,vt,_),T(lr,vt,null),e(vt,dk),e(vt,cr),e(cr,lk),e(cr,Vd),e(Vd,ck),e(cr,pk),e(vt,uk),e(vt,pr),e(pr,hk),e(pr,ur),e(ur,mk),e(pr,fk),e(vt,_k),e(vt,mt),T(hr,mt,null),e(mt,gk),e(mt,Mo),e(Mo,bk),e(Mo,Kd),e(Kd,kk),e(Mo,yk),e(Mo,qc),e(qc,vk),e(Mo,Tk),e(mt,wk),T(Bn,mt,null),e(mt,xk),T(En,mt,null),e(mt,$k),T(Cn,mt,null),g(o,Zu,_),g(o,Po,_),e(Po,An),e(An,jc),T(mr,jc,null),e(Po,Fk),e(Po,Bc),e(Bc,zk),g(o,Yu,_),g(o,ot,_),T(fr,ot,null),e(ot,qk),e(ot,Ec),e(Ec,jk),e(ot,Bk),e(ot,_r),e(_r,Ek),e(_r,Jd),e(Jd,Ck),e(_r,Ak),e(ot,Mk),e(ot,gr),e(gr,Pk),e(gr,br),e(br,Sk),e(gr,Ik),e(ot,Ok),e(ot,ft),T(kr,ft,null),e(ft,Nk),e(ft,So),e(So,Lk),e(So,Xd),e(Xd,Dk),e(So,Gk),e(So,Cc),e(Cc,Wk),e(So,Uk),e(ft,Rk),T(Mn,ft,null),e(ft,Hk),T(Pn,ft,null),e(ft,Qk),T(Sn,ft,null),g(o,eh,_),g(o,Io,_),e(Io,In),e(In,Ac),T(yr,Ac,null),e(Io,Vk),e(Io,Mc),e(Mc,Kk),g(o,th,_),g(o,nt,_),T(vr,nt,null),e(nt,Jk),e(nt,Oo),e(Oo,Xk),e(Oo,Pc),e(Pc,Zk),e(Oo,Yk),e(Oo,Sc),e(Sc,ey),e(Oo,ty),e(nt,oy),e(nt,Tr),e(Tr,ny),e(Tr,Zd),e(Zd,ay),e(Tr,sy),e(nt,ry),e(nt,wr),e(wr,iy),e(wr,xr),e(xr,dy),e(wr,ly),e(nt,cy),e(nt,At),T($r,At,null),e(At,py),e(At,No),e(No,uy),e(No,Yd),e(Yd,hy),e(No,my),e(No,Ic),e(Ic,fy),e(No,_y),e(At,gy),T(On,At,null),e(At,by),T(Nn,At,null),g(o,oh,_),g(o,Lo,_),e(Lo,Ln),e(Ln,Oc),T(Fr,Oc,null),e(Lo,ky),e(Lo,Nc),e(Nc,yy),g(o,nh,_),g(o,at,_),T(zr,at,null),e(at,vy),e(at,Lc),e(Lc,Ty),e(at,wy),e(at,qr),e(qr,xy),e(qr,el),e(el,$y),e(qr,Fy),e(at,zy),e(at,jr),e(jr,qy),e(jr,Br),e(Br,jy),e(jr,By),e(at,Ey),e(at,Dn),T(Er,Dn,null),e(Dn,Cy),T(Gn,Dn,null),g(o,ah,_),g(o,Do,_),e(Do,Wn),e(Wn,Dc),T(Cr,Dc,null),e(Do,Ay),e(Do,Gc),e(Gc,My),g(o,sh,_),g(o,st,_),T(Ar,st,null),e(st,Py),e(st,Mr),e(Mr,Sy),e(Mr,tl),e(tl,Iy),e(Mr,Oy),e(st,Ny),e(st,Pr),e(Pr,Ly),e(Pr,Sr),e(Sr,Dy),e(Pr,Gy),e(st,Wy),T(Un,st,null),e(st,Uy),e(st,Mt),T(Ir,Mt,null),e(Mt,Ry),e(Mt,Go),e(Go,Hy),e(Go,ol),e(ol,Qy),e(Go,Vy),e(Go,Wc),e(Wc,Ky),e(Go,Jy),e(Mt,Xy),T(Rn,Mt,null),e(Mt,Zy),T(Hn,Mt,null),g(o,rh,_),g(o,Wo,_),e(Wo,Qn),e(Qn,Uc),T(Or,Uc,null),e(Wo,Yy),e(Wo,Rc),e(Rc,ev),g(o,ih,_),g(o,rt,_),T(Nr,rt,null),e(rt,tv),e(rt,Lr),e(Lr,ov),e(Lr,nl),e(nl,nv),e(Lr,av),e(rt,sv),e(rt,Dr),e(Dr,rv),e(Dr,Gr),e(Gr,iv),e(Dr,dv),e(rt,lv),T(Vn,rt,null),e(rt,cv),e(rt,_t),T(Wr,_t,null),e(_t,pv),e(_t,Uo),e(Uo,uv),e(Uo,al),e(al,hv),e(Uo,mv),e(Uo,Hc),e(Hc,fv),e(Uo,_v),e(_t,gv),T(Kn,_t,null),e(_t,bv),T(Jn,_t,null),e(_t,kv),T(Xn,_t,null),g(o,dh,_),g(o,Ro,_),e(Ro,Zn),e(Zn,Qc),T(Ur,Qc,null),e(Ro,yv),e(Ro,Vc),e(Vc,vv),g(o,lh,_),g(o,Pe,_),T(Rr,Pe,null),e(Pe,Tv),e(Pe,Kc),e(Kc,wv),e(Pe,xv),e(Pe,Hr),e(Hr,$v),e(Hr,sl),e(sl,Fv),e(Hr,zv),e(Pe,qv),e(Pe,Qr),e(Qr,jv),e(Qr,Vr),e(Vr,Bv),e(Qr,Ev),e(Pe,Cv),T(Yn,Pe,null),e(Pe,Av),e(Pe,ro),T(Kr,ro,null),e(ro,Mv),e(ro,Ho),e(Ho,Pv),e(Ho,rl),e(rl,Sv),e(Ho,Iv),e(Ho,Jc),e(Jc,Ov),e(Ho,Nv),e(ro,Lv),T(ea,ro,null),g(o,ch,_),g(o,Qo,_),e(Qo,ta),e(ta,Xc),T(Jr,Xc,null),e(Qo,Dv),e(Qo,Zc),e(Zc,Gv),g(o,ph,_),g(o,_e,_),T(Xr,_e,null),e(_e,Wv),e(_e,Zr),e(Zr,Uv),e(Zr,il),e(il,Rv),e(Zr,Hv),e(_e,Qv),e(_e,Yr),e(Yr,Vv),e(Yr,ei),e(ei,Kv),e(Yr,Jv),e(_e,Xv),e(_e,Yc),e(Yc,Zv),e(_e,Yv),e(_e,Gt),e(Gt,ep),e(ep,ti),e(ti,eT),e(Gt,tT),e(Gt,tp),e(tp,oi),e(oi,oT),e(Gt,nT),e(Gt,op),e(op,ni),e(ni,aT),e(Gt,sT),e(Gt,np),e(np,ai),e(ai,rT),e(_e,iT),e(_e,Pt),T(si,Pt,null),e(Pt,dT),e(Pt,Vo),e(Vo,lT),e(Vo,ap),e(ap,cT),e(Vo,pT),e(Vo,sp),e(sp,uT),e(Vo,hT),e(Pt,mT),T(oa,Pt,null),e(Pt,fT),T(na,Pt,null),e(_e,_T),e(_e,aa),T(ri,aa,null),e(aa,gT),T(sa,aa,null),e(_e,bT),e(_e,ra),T(ii,ra,null),e(ra,kT),T(ia,ra,null),g(o,uh,_),g(o,Ko,_),e(Ko,da),e(da,rp),T(di,rp,null),e(Ko,yT),e(Ko,ip),e(ip,vT),g(o,hh,_),g(o,ge,_),T(li,ge,null),e(ge,TT),e(ge,ci),e(ci,wT),e(ci,dl),e(dl,xT),e(ci,$T),e(ge,FT),e(ge,pi),e(pi,zT),e(pi,ui),e(ui,qT),e(pi,jT),e(ge,BT),e(ge,dp),e(dp,ET),e(ge,CT),e(ge,Wt),e(Wt,lp),e(lp,hi),e(hi,AT),e(Wt,MT),e(Wt,cp),e(cp,mi),e(mi,PT),e(Wt,ST),e(Wt,pp),e(pp,fi),e(fi,IT),e(Wt,OT),e(Wt,up),e(up,_i),e(_i,NT),e(ge,LT),e(ge,gt),T(gi,gt,null),e(gt,DT),e(gt,Jo),e(Jo,GT),e(Jo,hp),e(hp,WT),e(Jo,UT),e(Jo,mp),e(mp,RT),e(Jo,HT),e(gt,QT),T(la,gt,null),e(gt,VT),T(ca,gt,null),e(gt,KT),T(pa,gt,null),e(ge,JT),e(ge,ua),T(bi,ua,null),e(ua,XT),T(ha,ua,null),e(ge,ZT),e(ge,ma),T(ki,ma,null),e(ma,YT),T(fa,ma,null),g(o,mh,_),g(o,Xo,_),e(Xo,_a),e(_a,fp),T(yi,fp,null),e(Xo,ew),e(Xo,_p),e(_p,tw),g(o,fh,_),g(o,J,_),T(vi,J,null),e(J,ow),e(J,gp),e(gp,nw),e(J,aw),e(J,Ti),e(Ti,sw),e(Ti,ll),e(ll,rw),e(Ti,iw),e(J,dw),e(J,wi),e(wi,lw),e(wi,xi),e(xi,cw),e(wi,pw),e(J,uw),e(J,bp),e(bp,hw),e(J,mw),e(J,Ut),e(Ut,kp),e(kp,$i),e($i,fw),e(Ut,_w),e(Ut,yp),e(yp,Fi),e(Fi,gw),e(Ut,bw),e(Ut,vp),e(vp,zi),e(zi,kw),e(Ut,yw),e(Ut,Tp),e(Tp,qi),e(qi,vw),e(J,Tw),e(J,St),T(ji,St,null),e(St,ww),e(St,Zo),e(Zo,xw),e(Zo,wp),e(wp,$w),e(Zo,Fw),e(Zo,xp),e(xp,zw),e(Zo,qw),e(St,jw),T(ga,St,null),e(St,Bw),T(ba,St,null),e(J,Ew),e(J,ka),T(Bi,ka,null),e(ka,Cw),T(ya,ka,null),e(J,Aw),e(J,va),T(Ei,va,null),e(va,Mw),T(Ta,va,null),g(o,_h,_),g(o,Yo,_),e(Yo,wa),e(wa,$p),T(Ci,$p,null),e(Yo,Pw),e(Yo,Fp),e(Fp,Sw),g(o,gh,_),g(o,X,_),T(Ai,X,null),e(X,Iw),e(X,en),e(en,Ow),e(en,zp),e(zp,Nw),e(en,Lw),e(en,qp),e(qp,Dw),e(en,Gw),e(X,Ww),e(X,Mi),e(Mi,Uw),e(Mi,cl),e(cl,Rw),e(Mi,Hw),e(X,Qw),e(X,Pi),e(Pi,Vw),e(Pi,Si),e(Si,Kw),e(Pi,Jw),e(X,Xw),e(X,jp),e(jp,Zw),e(X,Yw),e(X,Rt),e(Rt,Bp),e(Bp,Ii),e(Ii,e2),e(Rt,t2),e(Rt,Ep),e(Ep,Oi),e(Oi,o2),e(Rt,n2),e(Rt,Cp),e(Cp,Ni),e(Ni,a2),e(Rt,s2),e(Rt,Ap),e(Ap,Li),e(Li,r2),e(X,i2),e(X,It),T(Di,It,null),e(It,d2),e(It,tn),e(tn,l2),e(tn,Mp),e(Mp,c2),e(tn,p2),e(tn,Pp),e(Pp,u2),e(tn,h2),e(It,m2),T(xa,It,null),e(It,f2),T($a,It,null),e(X,_2),e(X,Fa),T(Gi,Fa,null),e(Fa,g2),T(za,Fa,null),e(X,b2),e(X,qa),T(Wi,qa,null),e(qa,k2),T(ja,qa,null),g(o,bh,_),g(o,on,_),e(on,Ba),e(Ba,Sp),T(Ui,Sp,null),e(on,y2),e(on,Ip),e(Ip,v2),g(o,kh,_),g(o,xe,_),T(Ri,xe,null),e(xe,T2),e(xe,Op),e(Op,w2),e(xe,x2),e(xe,Hi),e(Hi,$2),e(Hi,pl),e(pl,F2),e(Hi,z2),e(xe,q2),e(xe,Qi),e(Qi,j2),e(Qi,Vi),e(Vi,B2),e(Qi,E2),e(xe,C2),e(xe,Np),e(Np,A2),e(xe,M2),e(xe,Ht),e(Ht,Lp),e(Lp,Ki),e(Ki,P2),e(Ht,S2),e(Ht,Dp),e(Dp,Ji),e(Ji,I2),e(Ht,O2),e(Ht,Gp),e(Gp,Xi),e(Xi,N2),e(Ht,L2),e(Ht,Wp),e(Wp,Zi),e(Zi,D2),e(xe,G2),e(xe,Ot),T(Yi,Ot,null),e(Ot,W2),e(Ot,nn),e(nn,U2),e(nn,Up),e(Up,R2),e(nn,H2),e(nn,Rp),e(Rp,Q2),e(nn,V2),e(Ot,K2),T(Ea,Ot,null),e(Ot,J2),T(Ca,Ot,null),yh=!0},p(o,[_]){const ed={};_&2&&(ed.$$scope={dirty:_,ctx:o}),fn.$set(ed);const Hp={};_&2&&(Hp.$$scope={dirty:_,ctx:o}),gn.$set(Hp);const Qp={};_&2&&(Qp.$$scope={dirty:_,ctx:o}),bn.$set(Qp);const Vp={};_&2&&(Vp.$$scope={dirty:_,ctx:o}),wn.$set(Vp);const td={};_&2&&(td.$$scope={dirty:_,ctx:o}),xn.$set(td);const Kp={};_&2&&(Kp.$$scope={dirty:_,ctx:o}),zn.$set(Kp);const Jp={};_&2&&(Jp.$$scope={dirty:_,ctx:o}),qn.$set(Jp);const Aa={};_&2&&(Aa.$$scope={dirty:_,ctx:o}),Bn.$set(Aa);const Xp={};_&2&&(Xp.$$scope={dirty:_,ctx:o}),En.$set(Xp);const Zp={};_&2&&(Zp.$$scope={dirty:_,ctx:o}),Cn.$set(Zp);const od={};_&2&&(od.$$scope={dirty:_,ctx:o}),Mn.$set(od);const Yp={};_&2&&(Yp.$$scope={dirty:_,ctx:o}),Pn.$set(Yp);const eu={};_&2&&(eu.$$scope={dirty:_,ctx:o}),Sn.$set(eu);const tu={};_&2&&(tu.$$scope={dirty:_,ctx:o}),On.$set(tu);const nd={};_&2&&(nd.$$scope={dirty:_,ctx:o}),Nn.$set(nd);const ou={};_&2&&(ou.$$scope={dirty:_,ctx:o}),Gn.$set(ou);const nu={};_&2&&(nu.$$scope={dirty:_,ctx:o}),Un.$set(nu);const an={};_&2&&(an.$$scope={dirty:_,ctx:o}),Rn.$set(an);const au={};_&2&&(au.$$scope={dirty:_,ctx:o}),Hn.$set(au);const su={};_&2&&(su.$$scope={dirty:_,ctx:o}),Vn.$set(su);const ru={};_&2&&(ru.$$scope={dirty:_,ctx:o}),Kn.$set(ru);const iu={};_&2&&(iu.$$scope={dirty:_,ctx:o}),Jn.$set(iu);const ad={};_&2&&(ad.$$scope={dirty:_,ctx:o}),Xn.$set(ad);const du={};_&2&&(du.$$scope={dirty:_,ctx:o}),Yn.$set(du);const lu={};_&2&&(lu.$$scope={dirty:_,ctx:o}),ea.$set(lu);const sd={};_&2&&(sd.$$scope={dirty:_,ctx:o}),oa.$set(sd);const cu={};_&2&&(cu.$$scope={dirty:_,ctx:o}),na.$set(cu);const Tt={};_&2&&(Tt.$$scope={dirty:_,ctx:o}),sa.$set(Tt);const pu={};_&2&&(pu.$$scope={dirty:_,ctx:o}),ia.$set(pu);const uu={};_&2&&(uu.$$scope={dirty:_,ctx:o}),la.$set(uu);const hu={};_&2&&(hu.$$scope={dirty:_,ctx:o}),ca.$set(hu);const mu={};_&2&&(mu.$$scope={dirty:_,ctx:o}),pa.$set(mu);const fu={};_&2&&(fu.$$scope={dirty:_,ctx:o}),ha.$set(fu);const sn={};_&2&&(sn.$$scope={dirty:_,ctx:o}),fa.$set(sn);const _u={};_&2&&(_u.$$scope={dirty:_,ctx:o}),ga.$set(_u);const gu={};_&2&&(gu.$$scope={dirty:_,ctx:o}),ba.$set(gu);const rd={};_&2&&(rd.$$scope={dirty:_,ctx:o}),ya.$set(rd);const bu={};_&2&&(bu.$$scope={dirty:_,ctx:o}),Ta.$set(bu);const ku={};_&2&&(ku.$$scope={dirty:_,ctx:o}),xa.$set(ku);const yu={};_&2&&(yu.$$scope={dirty:_,ctx:o}),$a.$set(yu);const rn={};_&2&&(rn.$$scope={dirty:_,ctx:o}),za.$set(rn);const id={};_&2&&(id.$$scope={dirty:_,ctx:o}),ja.$set(id);const vu={};_&2&&(vu.$$scope={dirty:_,ctx:o}),Ea.$set(vu);const Qt={};_&2&&(Qt.$$scope={dirty:_,ctx:o}),Ca.$set(Qt)},i(o){yh||(w(r.$$.fragment,o),w(Y.$$.fragment,o),w(Ya.$$.fragment,o),w(ss.$$.fragment,o),w(rs.$$.fragment,o),w(is.$$.fragment,o),w(ds.$$.fragment,o),w(ls.$$.fragment,o),w(Ts.$$.fragment,o),w(Bs.$$.fragment,o),w(Is.$$.fragment,o),w(Os.$$.fragment,o),w(fn.$$.fragment,o),w(Ls.$$.fragment,o),w(Ds.$$.fragment,o),w(gn.$$.fragment,o),w(bn.$$.fragment,o),w(Us.$$.fragment,o),w(Hs.$$.fragment,o),w(Qs.$$.fragment,o),w(Vs.$$.fragment,o),w(Js.$$.fragment,o),w(Xs.$$.fragment,o),w(wn.$$.fragment,o),w(xn.$$.fragment,o),w(tr.$$.fragment,o),w(or.$$.fragment,o),w(nr.$$.fragment,o),w(ir.$$.fragment,o),w(zn.$$.fragment,o),w(qn.$$.fragment,o),w(dr.$$.fragment,o),w(lr.$$.fragment,o),w(hr.$$.fragment,o),w(Bn.$$.fragment,o),w(En.$$.fragment,o),w(Cn.$$.fragment,o),w(mr.$$.fragment,o),w(fr.$$.fragment,o),w(kr.$$.fragment,o),w(Mn.$$.fragment,o),w(Pn.$$.fragment,o),w(Sn.$$.fragment,o),w(yr.$$.fragment,o),w(vr.$$.fragment,o),w($r.$$.fragment,o),w(On.$$.fragment,o),w(Nn.$$.fragment,o),w(Fr.$$.fragment,o),w(zr.$$.fragment,o),w(Er.$$.fragment,o),w(Gn.$$.fragment,o),w(Cr.$$.fragment,o),w(Ar.$$.fragment,o),w(Un.$$.fragment,o),w(Ir.$$.fragment,o),w(Rn.$$.fragment,o),w(Hn.$$.fragment,o),w(Or.$$.fragment,o),w(Nr.$$.fragment,o),w(Vn.$$.fragment,o),w(Wr.$$.fragment,o),w(Kn.$$.fragment,o),w(Jn.$$.fragment,o),w(Xn.$$.fragment,o),w(Ur.$$.fragment,o),w(Rr.$$.fragment,o),w(Yn.$$.fragment,o),w(Kr.$$.fragment,o),w(ea.$$.fragment,o),w(Jr.$$.fragment,o),w(Xr.$$.fragment,o),w(si.$$.fragment,o),w(oa.$$.fragment,o),w(na.$$.fragment,o),w(ri.$$.fragment,o),w(sa.$$.fragment,o),w(ii.$$.fragment,o),w(ia.$$.fragment,o),w(di.$$.fragment,o),w(li.$$.fragment,o),w(gi.$$.fragment,o),w(la.$$.fragment,o),w(ca.$$.fragment,o),w(pa.$$.fragment,o),w(bi.$$.fragment,o),w(ha.$$.fragment,o),w(ki.$$.fragment,o),w(fa.$$.fragment,o),w(yi.$$.fragment,o),w(vi.$$.fragment,o),w(ji.$$.fragment,o),w(ga.$$.fragment,o),w(ba.$$.fragment,o),w(Bi.$$.fragment,o),w(ya.$$.fragment,o),w(Ei.$$.fragment,o),w(Ta.$$.fragment,o),w(Ci.$$.fragment,o),w(Ai.$$.fragment,o),w(Di.$$.fragment,o),w(xa.$$.fragment,o),w($a.$$.fragment,o),w(Gi.$$.fragment,o),w(za.$$.fragment,o),w(Wi.$$.fragment,o),w(ja.$$.fragment,o),w(Ui.$$.fragment,o),w(Ri.$$.fragment,o),w(Yi.$$.fragment,o),w(Ea.$$.fragment,o),w(Ca.$$.fragment,o),yh=!0)},o(o){x(r.$$.fragment,o),x(Y.$$.fragment,o),x(Ya.$$.fragment,o),x(ss.$$.fragment,o),x(rs.$$.fragment,o),x(is.$$.fragment,o),x(ds.$$.fragment,o),x(ls.$$.fragment,o),x(Ts.$$.fragment,o),x(Bs.$$.fragment,o),x(Is.$$.fragment,o),x(Os.$$.fragment,o),x(fn.$$.fragment,o),x(Ls.$$.fragment,o),x(Ds.$$.fragment,o),x(gn.$$.fragment,o),x(bn.$$.fragment,o),x(Us.$$.fragment,o),x(Hs.$$.fragment,o),x(Qs.$$.fragment,o),x(Vs.$$.fragment,o),x(Js.$$.fragment,o),x(Xs.$$.fragment,o),x(wn.$$.fragment,o),x(xn.$$.fragment,o),x(tr.$$.fragment,o),x(or.$$.fragment,o),x(nr.$$.fragment,o),x(ir.$$.fragment,o),x(zn.$$.fragment,o),x(qn.$$.fragment,o),x(dr.$$.fragment,o),x(lr.$$.fragment,o),x(hr.$$.fragment,o),x(Bn.$$.fragment,o),x(En.$$.fragment,o),x(Cn.$$.fragment,o),x(mr.$$.fragment,o),x(fr.$$.fragment,o),x(kr.$$.fragment,o),x(Mn.$$.fragment,o),x(Pn.$$.fragment,o),x(Sn.$$.fragment,o),x(yr.$$.fragment,o),x(vr.$$.fragment,o),x($r.$$.fragment,o),x(On.$$.fragment,o),x(Nn.$$.fragment,o),x(Fr.$$.fragment,o),x(zr.$$.fragment,o),x(Er.$$.fragment,o),x(Gn.$$.fragment,o),x(Cr.$$.fragment,o),x(Ar.$$.fragment,o),x(Un.$$.fragment,o),x(Ir.$$.fragment,o),x(Rn.$$.fragment,o),x(Hn.$$.fragment,o),x(Or.$$.fragment,o),x(Nr.$$.fragment,o),x(Vn.$$.fragment,o),x(Wr.$$.fragment,o),x(Kn.$$.fragment,o),x(Jn.$$.fragment,o),x(Xn.$$.fragment,o),x(Ur.$$.fragment,o),x(Rr.$$.fragment,o),x(Yn.$$.fragment,o),x(Kr.$$.fragment,o),x(ea.$$.fragment,o),x(Jr.$$.fragment,o),x(Xr.$$.fragment,o),x(si.$$.fragment,o),x(oa.$$.fragment,o),x(na.$$.fragment,o),x(ri.$$.fragment,o),x(sa.$$.fragment,o),x(ii.$$.fragment,o),x(ia.$$.fragment,o),x(di.$$.fragment,o),x(li.$$.fragment,o),x(gi.$$.fragment,o),x(la.$$.fragment,o),x(ca.$$.fragment,o),x(pa.$$.fragment,o),x(bi.$$.fragment,o),x(ha.$$.fragment,o),x(ki.$$.fragment,o),x(fa.$$.fragment,o),x(yi.$$.fragment,o),x(vi.$$.fragment,o),x(ji.$$.fragment,o),x(ga.$$.fragment,o),x(ba.$$.fragment,o),x(Bi.$$.fragment,o),x(ya.$$.fragment,o),x(Ei.$$.fragment,o),x(Ta.$$.fragment,o),x(Ci.$$.fragment,o),x(Ai.$$.fragment,o),x(Di.$$.fragment,o),x(xa.$$.fragment,o),x($a.$$.fragment,o),x(Gi.$$.fragment,o),x(za.$$.fragment,o),x(Wi.$$.fragment,o),x(ja.$$.fragment,o),x(Ui.$$.fragment,o),x(Ri.$$.fragment,o),x(Yi.$$.fragment,o),x(Ea.$$.fragment,o),x(Ca.$$.fragment,o),yh=!1},d(o){t(l),o&&t(k),o&&t(f),$(r),o&&t(H),o&&t(I),o&&t(Z),o&&t(de),o&&t(Ie),o&&t(N),$(Y),o&&t(ee),o&&t(ke),o&&t(P),o&&t(Fe),o&&t(Oe),o&&t(te),o&&t(S),o&&t(qe),o&&t(Ne),o&&t(ye),o&&t(xu),o&&t(Vt),o&&t($u),o&&t(ko),$(Ya),o&&t(Fu),o&&t(Kt),o&&t(zu),o&&t(yo),$(ss),o&&t(qu),o&&t(ut),o&&t(ju),o&&t(xo),$(rs),o&&t(Bu),o&&t(Jt),o&&t(Eu),$(is,o),o&&t(Cu),o&&t($o),$(ds),o&&t(Au),o&&t(vd),o&&t(Mu),$(ls,o),o&&t(Pu),o&&t(Te),o&&t(Su),$(Ts,o),o&&t(Iu),o&&t(ht),o&&t(Ou),$(Bs,o),o&&t(Nu),o&&t(Et),o&&t(Lu),o&&t(Pd),o&&t(Du),o&&t(ao),o&&t(Gu),o&&t(Fo),$(Is),o&&t(Wu),o&&t(kt),$(Os),$(fn),o&&t(Uu),o&&t(jo),$(Ls),o&&t(Ru),o&&t(D),$(Ds),$(gn),$(bn),$(Us),$(Hs),$(Qs),$(Vs),o&&t(Hu),o&&t(Bo),$(Js),o&&t(Qu),o&&t(fe),$(Xs),$(wn),$(xn),$(tr),o&&t(Vu),o&&t(Eo),$(or),o&&t(Ku),o&&t(yt),$(nr),$(ir),$(zn),$(qn),o&&t(Ju),o&&t(Ao),$(dr),o&&t(Xu),o&&t(vt),$(lr),$(hr),$(Bn),$(En),$(Cn),o&&t(Zu),o&&t(Po),$(mr),o&&t(Yu),o&&t(ot),$(fr),$(kr),$(Mn),$(Pn),$(Sn),o&&t(eh),o&&t(Io),$(yr),o&&t(th),o&&t(nt),$(vr),$($r),$(On),$(Nn),o&&t(oh),o&&t(Lo),$(Fr),o&&t(nh),o&&t(at),$(zr),$(Er),$(Gn),o&&t(ah),o&&t(Do),$(Cr),o&&t(sh),o&&t(st),$(Ar),$(Un),$(Ir),$(Rn),$(Hn),o&&t(rh),o&&t(Wo),$(Or),o&&t(ih),o&&t(rt),$(Nr),$(Vn),$(Wr),$(Kn),$(Jn),$(Xn),o&&t(dh),o&&t(Ro),$(Ur),o&&t(lh),o&&t(Pe),$(Rr),$(Yn),$(Kr),$(ea),o&&t(ch),o&&t(Qo),$(Jr),o&&t(ph),o&&t(_e),$(Xr),$(si),$(oa),$(na),$(ri),$(sa),$(ii),$(ia),o&&t(uh),o&&t(Ko),$(di),o&&t(hh),o&&t(ge),$(li),$(gi),$(la),$(ca),$(pa),$(bi),$(ha),$(ki),$(fa),o&&t(mh),o&&t(Xo),$(yi),o&&t(fh),o&&t(J),$(vi),$(ji),$(ga),$(ba),$(Bi),$(ya),$(Ei),$(Ta),o&&t(_h),o&&t(Yo),$(Ci),o&&t(gh),o&&t(X),$(Ai),$(Di),$(xa),$($a),$(Gi),$(za),$(Wi),$(ja),o&&t(bh),o&&t(on),$(Ui),o&&t(kh),o&&t(xe),$(Ri),$(Yi),$(Ea),$(Ca)}}}const xz={local:"bart",sections:[{local:"overview",sections:[{local:"examples",title:"Examples"}],title:"Overview"},{local:"implementation-notes",title:"Implementation Notes"},{local:"mask-filling",title:"Mask Filling"},{local:"resources",title:"Resources"},{local:"transformers.BartConfig",title:"BartConfig"},{local:"transformers.BartTokenizer",title:"BartTokenizer"},{local:"transformers.BartTokenizerFast",title:"BartTokenizerFast"},{local:"transformers.BartModel",title:"BartModel"},{local:"transformers.BartForConditionalGeneration",title:"BartForConditionalGeneration"},{local:"transformers.BartForSequenceClassification",title:"BartForSequenceClassification"},{local:"transformers.BartForQuestionAnswering",title:"BartForQuestionAnswering"},{local:"transformers.BartForCausalLM",title:"BartForCausalLM"},{local:"transformers.TFBartModel",title:"TFBartModel"},{local:"transformers.TFBartForConditionalGeneration",title:"TFBartForConditionalGeneration"},{local:"transformers.TFBartForSequenceClassification",title:"TFBartForSequenceClassification"},{local:"transformers.FlaxBartModel",title:"FlaxBartModel"},{local:"transformers.FlaxBartForConditionalGeneration",title:"FlaxBartForConditionalGeneration"},{local:"transformers.FlaxBartForSequenceClassification",title:"FlaxBartForSequenceClassification"},{local:"transformers.FlaxBartForQuestionAnswering",title:"FlaxBartForQuestionAnswering"},{local:"transformers.FlaxBartForCausalLM",title:"FlaxBartForCausalLM"}],title:"BART"};function $z(z){return CF(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Az extends qF{constructor(l){super();jF(this,l,$z,wz,BF,{})}}export{Az as default,xz as metadata};
