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