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

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

# Initializing a model (with random weights) from the facebook/bart-large style configuration
model = BartModel(configuration)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){l=n("p"),k=i("Example:"),m=c(),y(f.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),m=p(r),v(f.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,m,h),T(f,r,h),b=!0},p:W,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){x(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(m),$(f,r)}}}function M0(z){let l,k,m,f,b;return f=new O({props:{code:`from transformers import BartTokenizer
tokenizer = BartTokenizer.from_pretrained("facebook/bart-base")
tokenizer("Hello world")['input_ids']
tokenizer(" Hello world")['input_ids']`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="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=n("p"),k=i("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),m=c(),y(f.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),h.forEach(t),m=p(r),v(f.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,m,h),T(f,r,h),b=!0},p:W,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){x(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(m),$(f,r)}}}function P0(z){let l,k,m,f,b;return{c(){l=n("p"),k=i("When used with "),m=n("code"),f=i("is_split_into_words=True"),b=i(", this tokenizer will add a space before each word (even the first one).")},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"When used with "),m=a(h,"CODE",{});var q=s(m);f=d(q,"is_split_into_words=True"),q.forEach(t),b=d(h,", this tokenizer will add a space before each word (even the first one)."),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,m),e(m,f),e(l,b)},d(r){r&&t(l)}}}function S0(z){let l,k,m,f,b;return f=new O({props:{code:`from transformers import BartTokenizerFast
tokenizer = BartTokenizerFast.from_pretrained("facebook/bart-base")
tokenizer("Hello world")['input_ids']
tokenizer(" Hello world")['input_ids']`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="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=n("p"),k=i("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),m=c(),y(f.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),h.forEach(t),m=p(r),v(f.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,m,h),T(f,r,h),b=!0},p:W,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){x(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(m),$(f,r)}}}function I0(z){let l,k,m,f,b,r,h,q;return{c(){l=n("p"),k=i("When used with "),m=n("code"),f=i("is_split_into_words=True"),b=i(", this tokenizer needs to be instantiated with "),r=n("code"),h=i("add_prefix_space=True"),q=i(".")},l(se){l=a(se,"P",{});var H=s(l);k=d(H,"When used with "),m=a(H,"CODE",{});var I=s(m);f=d(I,"is_split_into_words=True"),I.forEach(t),b=d(H,", this tokenizer needs to be instantiated with "),r=a(H,"CODE",{});var re=s(r);h=d(re,"add_prefix_space=True"),re.forEach(t),q=d(H,"."),H.forEach(t)},m(se,H){g(se,l,H),e(l,k),e(l,m),e(m,f),e(l,b),e(l,r),e(r,h),e(l,q)},d(se){se&&t(l)}}}function O0(z){let l,k,m,f,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),f=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(h,"CODE",{});var q=s(m);f=d(q,"Module"),q.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,m),e(m,f),e(l,b)},d(r){r&&t(l)}}}function N0(z){let l,k,m,f,b;return f=new O({props:{code:`from transformers import AutoTokenizer, BartModel
import torch

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

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BartModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate Summary</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], num_beams=<span class="hljs-number">2</span>, min_length=<span class="hljs-number">0</span>, max_length=<span class="hljs-number">20</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;PG&amp;E scheduled the blackouts in response to forecasts for high winds amid dry conditions&#x27;</span>`}}),{c(){l=n("p"),k=i("Summarization example:"),m=c(),y(f.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Summarization example:"),h.forEach(t),m=p(r),v(f.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,m,h),T(f,r,h),b=!0},p:W,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){x(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(m),$(f,r)}}}function G0(z){let l,k,m,f,b;return f=new O({props:{code:`from transformers import AutoTokenizer, BartForConditionalGeneration

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;My friends are &lt;mask&gt; but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_ids).logits

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

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

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

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

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

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

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = BartForSequenceClassification.from_pretrained("valhalla/bart-large-sst2", num_labels=num_labels)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;POSITIVE&#x27;</span>

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

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

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

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

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

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

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = BartForSequenceClassification.from_pretrained(
    "valhalla/bart-large-sst2", num_labels=num_labels, problem_type="multi_label_classification"
)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;valhalla/bart-large-sst2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BartForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;valhalla/bart-large-sst2&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){l=n("p"),k=i("Example of multi-label classification:"),m=c(),y(f.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example of multi-label classification:"),h.forEach(t),m=p(r),v(f.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,m,h),T(f,r,h),b=!0},p:W,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){x(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(m),$(f,r)}}}function H0(z){let l,k,m,f,b;return{c(){l=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),f=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(h,"CODE",{});var q=s(m);f=d(q,"Module"),q.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(r,h){g(r,l,h),e(l,k),e(l,m),e(m,f),e(l,b)},d(r){r&&t(l)}}}function Q0(z){let l,k,m,f,b;return f=new O({props:{code:`from transformers import AutoTokenizer, BartForQuestionAnswering
import torch

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

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

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

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

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens, skip_special_tokens=True)

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

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BartForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27; nice puppet&#x27;</span>

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.59</span>`}}),{c(){l=n("p"),k=i("Example:"),m=c(),y(f.$$.fragment)},l(r){l=a(r,"P",{});var h=s(l);k=d(h,"Example:"),h.forEach(t),m=p(r),v(f.$$.fragment,r)},m(r,h){g(r,l,h),e(l,k),g(r,m,h),T(f,r,h),b=!0},p:W,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){x(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(m),$(f,r)}}}function V0(z){let l,k,m,f,b;return f=new O({props:{code:`from transformers import AutoTokenizer, BartForCausalLM

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BartForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/bart-base&quot;</span>, add_cross_attention=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> model.config.is_decoder, <span class="hljs-string">f&quot;<span class="hljs-subst">{model.__class__}</span> has to be configured as a decoder.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

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

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

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFBartModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=<span class="hljs-number">1024</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

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

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

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

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

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

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

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBartModel

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

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

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

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

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

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

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

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

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

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

outputs = model.decode(decoder_input_ids, encoder_outputs)
last_decoder_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBartForConditionalGeneration

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>ARTICLE_TO_SUMMARIZE = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=<span class="hljs-number">1024</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>TXT = <span class="hljs-string">&quot;My friends are &lt;mask&gt; but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer([TXT], return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_ids).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>masked_index = (input_ids[<span class="hljs-number">0</span>] == tokenizer.mask_token_id).nonzero()[<span class="hljs-number">0</span>].item()
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = jax.nn.softmax(logits[<span class="hljs-number">0</span>, masked_index], axis=<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>values, predictions = jax.lax.top_k(probs, k=<span class="hljs-number">1</span>)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

outputs = model.decode(decoder_input_ids, encoder_outputs)
last_decoder_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBartForConditionalGeneration

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

outputs = model.decode(decoder_input_ids, encoder_outputs)
last_decoder_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxBartForConditionalGeneration

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

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

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

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

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

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

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

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

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

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

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

model = BartForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large&quot;</span>, forced_bos_token_id=<span class="hljs-number">0</span>)
tok = BartTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/bart-large&quot;</span>)
example_english_phrase = <span class="hljs-string">&quot;UN Chief Says There Is No &lt;mask&gt; in Syria&quot;</span>
batch = tok(example_english_phrase, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
generated_ids = model.generate(batch[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-keyword">assert</span> tok.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>) == [
    <span class="hljs-string">&quot;UN Chief Says There Is No Plan to Stop Chemical Weapons in Syria&quot;</span>
]`}}),ds=new ae({}),ls=new o2({props:{pipeline:"summarization"}}),Ts=new o2({props:{pipeline:"fill-mask"}}),js=new o2({props:{pipeline:"translation"}}),Is=new ae({}),Os=new C({props:{name:"class transformers.BartConfig",anchor:"transformers.BartConfig",parameters:[{name:"vocab_size",val:" = 50265"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 12"},{name:"encoder_ffn_dim",val:" = 4096"},{name:"encoder_attention_heads",val:" = 16"},{name:"decoder_layers",val:" = 12"},{name:"decoder_ffn_dim",val:" = 4096"},{name:"decoder_attention_heads",val:" = 16"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"activation_function",val:" = 'gelu'"},{name:"d_model",val:" = 1024"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"classifier_dropout",val:" = 0.0"},{name:"scale_embedding",val:" = False"},{name:"use_cache",val:" = True"},{name:"num_labels",val:" = 3"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"is_encoder_decoder",val:" = True"},{name:"decoder_start_token_id",val:" = 2"},{name:"forced_eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BartConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the BART model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartModel">BartModel</a> or <a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.TFBartModel">TFBartModel</a>.`,name:"vocab_size"},{anchor:"transformers.BartConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.BartConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.BartConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.BartConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.BartConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.BartConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.BartConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.BartConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.BartConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.BartConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.BartConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.BartConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for classifier.`,name:"classifier_dropout"},{anchor:"transformers.BartConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.BartConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.BartConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.BartConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.BartConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.BartConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"},{anchor:"transformers.BartConfig.num_labels",description:`<strong>num_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of labels to use in <a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartForSequenceClassification">BartForSequenceClassification</a>.`,name:"num_labels"},{anchor:"transformers.BartConfig.forced_eos_token_id",description:`<strong>forced_eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Usually set to
<code>eos_token_id</code>.`,name:"forced_eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/configuration_bart.py#L35"}}),mn=new G({props:{anchor:"transformers.BartConfig.example",$$slots:{default:[A0]},$$scope:{ctx:z}}}),Ls=new ae({}),Ds=new C({props:{name:"class transformers.BartTokenizer",anchor:"transformers.BartTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"errors",val:" = 'replace'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"add_prefix_space",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BartTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.BartTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.BartTokenizer.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.BartTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

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

					</div>`,name:"eos_token"},{anchor:"transformers.BartTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.BartTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.BartTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BartTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BartTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.BartTokenizer.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (BART tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/tokenization_bart.py#L101"}}),gn=new G({props:{anchor:"transformers.BartTokenizer.example",$$slots:{default:[M0]},$$scope:{ctx:z}}}),bn=new Se({props:{$$slots:{default:[P0]},$$scope:{ctx:z}}}),Us=new C({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BartTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.BartTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.BartTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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>
`}}),Hs=new C({props:{name:"convert_tokens_to_string",anchor:"transformers.BartTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/tokenization_bart.py#L303"}}),Qs=new C({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BartTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.BartTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BartTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/tokenization_bart.py#L390",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Vs=new C({props:{name:"get_special_tokens_mask",anchor:"transformers.BartTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.BartTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BartTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.BartTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/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>
`}}),Js=new ae({}),Xs=new C({props:{name:"class transformers.BartTokenizerFast",anchor:"transformers.BartTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"errors",val:" = 'replace'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"add_prefix_space",val:" = False"},{name:"trim_offsets",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BartTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.BartTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.BartTokenizerFast.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.BartTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

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

					</div>`,name:"eos_token"},{anchor:"transformers.BartTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.BartTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.BartTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BartTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BartTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.BartTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (BART tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"},{anchor:"transformers.BartTokenizerFast.trim_offsets",description:`<strong>trim_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the post processing step should trim offsets to avoid including whitespaces.`,name:"trim_offsets"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/tokenization_bart_fast.py#L70"}}),wn=new G({props:{anchor:"transformers.BartTokenizerFast.example",$$slots:{default:[S0]},$$scope:{ctx:z}}}),xn=new Se({props:{$$slots:{default:[I0]},$$scope:{ctx:z}}}),tr=new C({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.BartTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.BartTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.BartTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/tokenization_bart_fast.py#L283",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),or=new ae({}),nr=new C({props:{name:"class transformers.BartModel",anchor:"transformers.BartModel",parameters:[{name:"config",val:": BartConfig"}],parametersDescription:[{anchor:"transformers.BartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1161"}}),ir=new C({props:{name:"forward",anchor:"transformers.BartModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BartModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BartModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BartModel.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.BartModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read <code>modeling_bart._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.BartModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BartModel.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.BartModel.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.BartModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.BartModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing <code>input_ids</code> you
can choose to directly pass an embedded representation. This is useful if you want more control over how to
convert <code>input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"past_key_values"},{anchor:"transformers.BartModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.BartModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BartModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BartModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BartModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1190",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),zn=new Se({props:{$$slots:{default:[O0]},$$scope:{ctx:z}}}),qn=new G({props:{anchor:"transformers.BartModel.forward.example",$$slots:{default:[N0]},$$scope:{ctx:z}}}),dr=new ae({}),lr=new C({props:{name:"class transformers.BartForConditionalGeneration",anchor:"transformers.BartForConditionalGeneration",parameters:[{name:"config",val:": BartConfig"}],parametersDescription:[{anchor:"transformers.BartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1288"}}),hr=new C({props:{name:"forward",anchor:"transformers.BartForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BartForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BartForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BartForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.BartForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read <code>modeling_bart._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.BartForConditionalGeneration.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BartForConditionalGeneration.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.BartForConditionalGeneration.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.BartForConditionalGeneration.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.BartForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing <code>input_ids</code> you
can choose to directly pass an embedded representation. This is useful if you want more control over how to
convert <code>input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"past_key_values"},{anchor:"transformers.BartForConditionalGeneration.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.BartForConditionalGeneration.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BartForConditionalGeneration.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BartForConditionalGeneration.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BartForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BartForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1332",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),jn=new Se({props:{$$slots:{default:[L0]},$$scope:{ctx:z}}}),En=new G({props:{anchor:"transformers.BartForConditionalGeneration.forward.example",$$slots:{default:[D0]},$$scope:{ctx:z}}}),Cn=new G({props:{anchor:"transformers.BartForConditionalGeneration.forward.example-2",$$slots:{default:[G0]},$$scope:{ctx:z}}}),fr=new ae({}),mr=new C({props:{name:"class transformers.BartForSequenceClassification",anchor:"transformers.BartForSequenceClassification",parameters:[{name:"config",val:": BartConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BartForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1466"}}),kr=new C({props:{name:"forward",anchor:"transformers.BartForSequenceClassification.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BartForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BartForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BartForSequenceClassification.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.BartForSequenceClassification.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read <code>modeling_bart._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.BartForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BartForSequenceClassification.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.BartForSequenceClassification.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.BartForSequenceClassification.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.BartForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing <code>input_ids</code> you
can choose to directly pass an embedded representation. This is useful if you want more control over how to
convert <code>input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"past_key_values"},{anchor:"transformers.BartForSequenceClassification.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.BartForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BartForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BartForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BartForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BartForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1482",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput"
>transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Mn=new Se({props:{$$slots:{default:[W0]},$$scope:{ctx:z}}}),Pn=new G({props:{anchor:"transformers.BartForSequenceClassification.forward.example",$$slots:{default:[U0]},$$scope:{ctx:z}}}),Sn=new G({props:{anchor:"transformers.BartForSequenceClassification.forward.example-2",$$slots:{default:[R0]},$$scope:{ctx:z}}}),yr=new ae({}),vr=new C({props:{name:"class transformers.BartForQuestionAnswering",anchor:"transformers.BartForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BartForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1595"}}),$r=new C({props:{name:"forward",anchor:"transformers.BartForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": Tensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BartForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BartForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BartForQuestionAnswering.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.BartForQuestionAnswering.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read <code>modeling_bart._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.BartForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BartForQuestionAnswering.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.BartForQuestionAnswering.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.BartForQuestionAnswering.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.BartForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing <code>input_ids</code> you
can choose to directly pass an embedded representation. This is useful if you want more control over how to
convert <code>input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"past_key_values"},{anchor:"transformers.BartForQuestionAnswering.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.BartForQuestionAnswering.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BartForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BartForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BartForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BartForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.BartForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1610",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),On=new Se({props:{$$slots:{default:[H0]},$$scope:{ctx:z}}}),Nn=new G({props:{anchor:"transformers.BartForQuestionAnswering.forward.example",$$slots:{default:[Q0]},$$scope:{ctx:z}}}),Fr=new ae({}),zr=new C({props:{name:"class transformers.BartForCausalLM",anchor:"transformers.BartForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BartForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1733"}}),Er=new C({props:{name:"forward",anchor:"transformers.BartForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BartForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
provide it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BartForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BartForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention
if the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.BartForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used
in the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:`,name:"encoder_attention_mask"},{anchor:"transformers.BartForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BartForCausalLM.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.BartForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of
shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>. The two additional
tensors are only required when the model is used as a decoder in a Sequence to Sequence model.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
cross-attention blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those
that don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of
all <code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BartForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.BartForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding
(see <code>past_key_values</code>).</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"use_cache"},{anchor:"transformers.BartForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under
returned tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BartForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors
for more detail.`,name:"output_hidden_states"},{anchor:"transformers.BartForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_bart.py#L1766",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Gn=new G({props:{anchor:"transformers.BartForCausalLM.forward.example",$$slots:{default:[V0]},$$scope:{ctx:z}}}),Cr=new ae({}),Ar=new C({props:{name:"class transformers.TFBartModel",anchor:"transformers.TFBartModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_tf_bart.py#L1185"}}),Un=new Se({props:{$$slots:{default:[K0]},$$scope:{ctx:z}}}),Ir=new C({props:{name:"call",anchor:"transformers.TFBartModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_input_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_outputs",val:": typing.Union[typing.Tuple, transformers.modeling_tf_outputs.TFBaseModelOutput, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBartModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBartModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBartModel.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.TFBartModel.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFBartModel.call.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.TFBartModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBartModel.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.TFBartModel.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.TFBartModel.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFBartModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFBartModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFBartModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBartModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBartModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBartModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_tf_bart.py#L1199",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Rn=new Se({props:{$$slots:{default:[J0]},$$scope:{ctx:z}}}),Hn=new G({props:{anchor:"transformers.TFBartModel.call.example",$$slots:{default:[X0]},$$scope:{ctx:z}}}),Or=new ae({}),Nr=new C({props:{name:"class transformers.TFBartForConditionalGeneration",anchor:"transformers.TFBartForConditionalGeneration",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_tf_bart.py#L1290"}}),Vn=new Se({props:{$$slots:{default:[Z0]},$$scope:{ctx:z}}}),Wr=new C({props:{name:"call",anchor:"transformers.TFBartForConditionalGeneration.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_input_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_outputs",val:": typing.Optional[transformers.modeling_tf_outputs.TFBaseModelOutput] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBartForConditionalGeneration.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBartForConditionalGeneration.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBartForConditionalGeneration.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.TFBartForConditionalGeneration.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFBartForConditionalGeneration.call.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.TFBartForConditionalGeneration.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBartForConditionalGeneration.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.TFBartForConditionalGeneration.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.TFBartForConditionalGeneration.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFBartForConditionalGeneration.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFBartForConditionalGeneration.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFBartForConditionalGeneration.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBartForConditionalGeneration.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBartForConditionalGeneration.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBartForConditionalGeneration.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBartForConditionalGeneration.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_tf_bart.py#L1326",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Kn=new Se({props:{$$slots:{default:[Y0]},$$scope:{ctx:z}}}),Jn=new G({props:{anchor:"transformers.TFBartForConditionalGeneration.call.example",$$slots:{default:[ez]},$$scope:{ctx:z}}}),Xn=new G({props:{anchor:"transformers.TFBartForConditionalGeneration.call.example-2",$$slots:{default:[tz]},$$scope:{ctx:z}}}),Ur=new ae({}),Rr=new C({props:{name:"class transformers.TFBartForSequenceClassification",anchor:"transformers.TFBartForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBartForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_tf_bart.py#L1479"}}),Yn=new Se({props:{$$slots:{default:[oz]},$$scope:{ctx:z}}}),Kr=new C({props:{name:"call",anchor:"transformers.TFBartForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_input_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_outputs",val:": typing.Optional[transformers.modeling_tf_outputs.TFBaseModelOutput] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFBartForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBartForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBartForSequenceClassification.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.TFBartForSequenceClassification.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFBartForSequenceClassification.call.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.TFBartForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFBartForSequenceClassification.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.TFBartForSequenceClassification.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.TFBartForSequenceClassification.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFBartForSequenceClassification.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFBartForSequenceClassification.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFBartForSequenceClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFBartForSequenceClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFBartForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFBartForSequenceClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFBartForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_tf_bart.py#L1497",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code></p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ea=new Se({props:{$$slots:{default:[nz]},$$scope:{ctx:z}}}),Jr=new ae({}),Xr=new C({props:{name:"class transformers.FlaxBartModel",anchor:"transformers.FlaxBartModel",parameters:[{name:"config",val:": BartConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBartModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1242"}}),si=new C({props:{name:"__call__",anchor:"transformers.FlaxBartModel.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBartModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBartModel.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxBartModel.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxBartModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBartModel.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxBartModel.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartModel.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1177",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oa=new Se({props:{$$slots:{default:[az]},$$scope:{ctx:z}}}),na=new G({props:{anchor:"transformers.FlaxBartModel.__call__.example",$$slots:{default:[sz]},$$scope:{ctx:z}}}),ri=new C({props:{name:"encode",anchor:"transformers.FlaxBartModel.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartModel.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBartModel.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBartModel.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBartModel.encode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartModel.encode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartModel.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),sa=new G({props:{anchor:"transformers.FlaxBartModel.encode.example",$$slots:{default:[rz]},$$scope:{ctx:z}}}),ii=new C({props:{name:"decode",anchor:"transformers.FlaxBartModel.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartModel.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxBartModel.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FlaxBartModel.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"encoder_attention_mask"},{anchor:"transformers.FlaxBartModel.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxBartModel.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxBartModel.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxBartModel.decode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartModel.decode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartModel.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1063",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ia=new G({props:{anchor:"transformers.FlaxBartModel.decode.example",$$slots:{default:[iz]},$$scope:{ctx:z}}}),di=new ae({}),li=new C({props:{name:"class transformers.FlaxBartForConditionalGeneration",anchor:"transformers.FlaxBartForConditionalGeneration",parameters:[{name:"config",val:": BartConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBartForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForConditionalGeneration.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1326"}}),gi=new C({props:{name:"__call__",anchor:"transformers.FlaxBartForConditionalGeneration.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1177",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),la=new Se({props:{$$slots:{default:[dz]},$$scope:{ctx:z}}}),ca=new G({props:{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.example",$$slots:{default:[lz]},$$scope:{ctx:z}}}),pa=new G({props:{anchor:"transformers.FlaxBartForConditionalGeneration.__call__.example-2",$$slots:{default:[cz]},$$scope:{ctx:z}}}),bi=new C({props:{name:"encode",anchor:"transformers.FlaxBartForConditionalGeneration.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForConditionalGeneration.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBartForConditionalGeneration.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBartForConditionalGeneration.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBartForConditionalGeneration.encode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForConditionalGeneration.encode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForConditionalGeneration.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ha=new G({props:{anchor:"transformers.FlaxBartForConditionalGeneration.encode.example",$$slots:{default:[pz]},$$scope:{ctx:z}}}),ki=new C({props:{name:"decode",anchor:"transformers.FlaxBartForConditionalGeneration.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForConditionalGeneration.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxBartForConditionalGeneration.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FlaxBartForConditionalGeneration.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"encoder_attention_mask"},{anchor:"transformers.FlaxBartForConditionalGeneration.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxBartForConditionalGeneration.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxBartForConditionalGeneration.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxBartForConditionalGeneration.decode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForConditionalGeneration.decode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForConditionalGeneration.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1330",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ma=new G({props:{anchor:"transformers.FlaxBartForConditionalGeneration.decode.example",$$slots:{default:[uz]},$$scope:{ctx:z}}}),yi=new ae({}),vi=new C({props:{name:"class transformers.FlaxBartForSequenceClassification",anchor:"transformers.FlaxBartForSequenceClassification",parameters:[{name:"config",val:": BartConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBartForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForSequenceClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1639"}}),Bi=new C({props:{name:"__call__",anchor:"transformers.FlaxBartForSequenceClassification.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForSequenceClassification.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBartForSequenceClassification.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBartForSequenceClassification.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxBartForSequenceClassification.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxBartForSequenceClassification.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBartForSequenceClassification.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxBartForSequenceClassification.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForSequenceClassification.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForSequenceClassification.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1177",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ga=new Se({props:{$$slots:{default:[hz]},$$scope:{ctx:z}}}),ba=new G({props:{anchor:"transformers.FlaxBartForSequenceClassification.__call__.example",$$slots:{default:[fz]},$$scope:{ctx:z}}}),ji=new C({props:{name:"encode",anchor:"transformers.FlaxBartForSequenceClassification.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForSequenceClassification.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBartForSequenceClassification.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBartForSequenceClassification.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBartForSequenceClassification.encode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForSequenceClassification.encode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForSequenceClassification.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ya=new G({props:{anchor:"transformers.FlaxBartForSequenceClassification.encode.example",$$slots:{default:[mz]},$$scope:{ctx:z}}}),Ei=new C({props:{name:"decode",anchor:"transformers.FlaxBartForSequenceClassification.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForSequenceClassification.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxBartForSequenceClassification.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FlaxBartForSequenceClassification.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"encoder_attention_mask"},{anchor:"transformers.FlaxBartForSequenceClassification.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxBartForSequenceClassification.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxBartForSequenceClassification.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxBartForSequenceClassification.decode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForSequenceClassification.decode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForSequenceClassification.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1063",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ta=new G({props:{anchor:"transformers.FlaxBartForSequenceClassification.decode.example",$$slots:{default:[_z]},$$scope:{ctx:z}}}),Ci=new ae({}),Ai=new C({props:{name:"class transformers.FlaxBartForQuestionAnswering",anchor:"transformers.FlaxBartForQuestionAnswering",parameters:[{name:"config",val:": BartConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBartForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForQuestionAnswering.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1725"}}),Di=new C({props:{name:"__call__",anchor:"transformers.FlaxBartForQuestionAnswering.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1177",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqQuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xa=new Se({props:{$$slots:{default:[gz]},$$scope:{ctx:z}}}),$a=new G({props:{anchor:"transformers.FlaxBartForQuestionAnswering.__call__.example",$$slots:{default:[bz]},$$scope:{ctx:z}}}),Gi=new C({props:{name:"encode",anchor:"transformers.FlaxBartForQuestionAnswering.encode",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForQuestionAnswering.encode.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxBartForQuestionAnswering.encode.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxBartForQuestionAnswering.encode.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxBartForQuestionAnswering.encode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForQuestionAnswering.encode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForQuestionAnswering.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),za=new G({props:{anchor:"transformers.FlaxBartForQuestionAnswering.encode.example",$$slots:{default:[kz]},$$scope:{ctx:z}}}),Wi=new C({props:{name:"decode",anchor:"transformers.FlaxBartForQuestionAnswering.decode",parameters:[{name:"decoder_input_ids",val:""},{name:"encoder_outputs",val:""},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"past_key_values",val:": dict = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForQuestionAnswering.decode.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxBartForQuestionAnswering.decode.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FlaxBartForQuestionAnswering.decode.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"encoder_attention_mask"},{anchor:"transformers.FlaxBartForQuestionAnswering.decode.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxBartForQuestionAnswering.decode.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxBartForQuestionAnswering.decode.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxBartForQuestionAnswering.decode.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForQuestionAnswering.decode.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForQuestionAnswering.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1063",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.bart.configuration_bart.BartConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ba=new G({props:{anchor:"transformers.FlaxBartForQuestionAnswering.decode.example",$$slots:{default:[yz]},$$scope:{ctx:z}}}),Ui=new ae({}),Ri=new C({props:{name:"class transformers.FlaxBartForCausalLM",anchor:"transformers.FlaxBartForCausalLM",parameters:[{name:"config",val:": BartConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBartForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig">BartConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBartForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1961"}}),Yi=new C({props:{name:"__call__",anchor:"transformers.FlaxBartForCausalLM.__call__",parameters:[{name:"input_ids",val:": ndarray"},{name:"attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"position_ids",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"encoder_hidden_states",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"encoder_attention_mask",val:": typing.Optional[jax._src.numpy.ndarray.ndarray] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxBartForCausalLM.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxBartForCausalLM.__call__.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(jnp.ndarray)</code>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FlaxBartForCausalLM.__call__.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"encoder_attention_mask"},{anchor:"transformers.FlaxBartForCausalLM.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxBartForCausalLM.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxBartForCausalLM.__call__.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxBartForCausalLM.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxBartForCausalLM.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxBartForCausalLM.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bart/modeling_flax_bart.py#L1799",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartConfig"
>BartConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key, value
states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions"
>transformers.modeling_flax_outputs.FlaxCausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ea=new Se({props:{$$slots:{default:[vz]},$$scope:{ctx:z}}}),Ca=new G({props:{anchor:"transformers.FlaxBartForCausalLM.__call__.example",$$slots:{default:[Tz]},$$scope:{ctx:z}}}),{c(){l=n("meta"),k=c(),m=n("h1"),f=n("a"),b=n("span"),y(r.$$.fragment),h=c(),q=n("span"),se=i("BART"),H=c(),I=n("div"),re=n("a"),ie=n("img"),Re=c(),V=n("a"),$e=n("img"),Z=c(),de=n("p"),Ce=n("strong"),le=i("DISCLAIMER:"),He=i(" If you see something strange, file a "),we=n("a"),ce=i("Github Issue"),Qe=i(` and assign
@patrickvonplaten`),Ie=c(),N=n("h2"),be=n("a"),Ae=n("span"),y(Y.$$.fragment),A=c(),M=n("span"),Ve=i("Overview"),ee=c(),ke=n("p"),Ke=i("The Bart model was proposed in "),Q=n("a"),Je=i(`BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation,
Translation, and Comprehension`),Xe=i(` by Mike Lewis, Yinhan Liu, Naman Goyal, Marjan
Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov and Luke Zettlemoyer on 29 Oct, 2019.`),P=c(),Fe=n("p"),pe=i("According to the abstract,"),Oe=c(),te=n("ul"),K=n("li"),Ze=i(`Bart uses a standard seq2seq/machine translation architecture with a bidirectional encoder (like BERT) and a
left-to-right decoder (like GPT).`),Ye=c(),U=n("li"),et=i(`The pretraining task involves randomly shuffling the order of the original sentences and a novel in-filling scheme,
where spans of text are replaced with a single mask token.`),ue=c(),Me=n("li"),ze=i(`BART is particularly effective when fine tuned for text generation but also works well for comprehension tasks. It
matches the performance of RoBERTa with comparable training resources on GLUE and SQuAD, achieves new
state-of-the-art results on a range of abstractive dialogue, question answering, and summarization tasks, with gains
of up to 6 ROUGE.`),S=c(),qe=n("p"),L=i("Tips:"),Ne=c(),ye=n("ul"),F=n("li"),j=n("p"),wt=i(`BART is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),Be=c(),Le=n("li"),dt=n("p"),E=i("Sequence-to-sequence model with an encoder and a decoder. Encoder is fed a corrupted version of the tokens, decoder is fed the original tokens (but has a mask to hide the future words like a regular transformers decoder). A composition of the following transformations are applied on the pretraining tasks for the encoder:"),xt=c(),oe=n("ul"),lt=n("li"),$t=i("mask random tokens (like in BERT)"),Ft=c(),R=n("li"),he=i("delete random tokens"),zt=c(),ct=n("li"),fe=i("mask a span of k tokens with a single mask token (a span of 0 tokens is an insertion of a mask token)"),qt=c(),pt=n("li"),tt=i("permute sentences"),Bt=c(),ve=n("li"),jt=i("rotate the document to make it start at a specific token"),xu=c(),Vt=n("p"),If=i("This model was contributed by "),Xa=n("a"),Of=i("sshleifer"),Nf=i(". The Authors\u2019 code can be found "),Za=n("a"),Lf=i("here"),Df=i("."),$u=c(),ko=n("h3"),dn=n("a"),Pl=n("span"),y(Ya.$$.fragment),Gf=c(),Sl=n("span"),Wf=i("Examples"),Fu=c(),Kt=n("ul"),es=n("li"),Uf=i(`Examples and scripts for fine-tuning BART and other models for sequence to sequence tasks can be found in
`),ts=n("a"),Rf=i("examples/pytorch/summarization/"),Hf=i("."),Qf=c(),Lt=n("li"),Vf=i("An example of how to train "),md=n("a"),Kf=i("BartForConditionalGeneration"),Jf=i(" with a Hugging Face "),Il=n("code"),Xf=i("datasets"),Zf=i(`
object can be found in this `),os=n("a"),Yf=i("forum discussion"),em=i("."),tm=c(),ln=n("li"),ns=n("a"),om=i("Distilled checkpoints"),nm=i(" are described in this "),as=n("a"),am=i("paper"),sm=i("."),zu=c(),yo=n("h2"),cn=n("a"),Ol=n("span"),y(ss.$$.fragment),rm=c(),Nl=n("span"),im=i("Implementation Notes"),qu=c(),ut=n("ul"),Dt=n("li"),dm=i("Bart doesn\u2019t use "),Ll=n("code"),lm=i("token_type_ids"),cm=i(" for sequence classification. Use "),_d=n("a"),pm=i("BartTokenizer"),um=i(` or
`),gd=n("a"),hm=i("encode()"),fm=i(" to get the proper splitting."),mm=c(),vo=n("li"),_m=i("The forward pass of "),bd=n("a"),gm=i("BartModel"),bm=i(" will create the "),Dl=n("code"),km=i("decoder_input_ids"),ym=i(` if they are not passed.
This is different than some other modeling APIs. A typical use case of this feature is mask filling.`),vm=c(),To=n("li"),Tm=i(`Model predictions are intended to be identical to the original implementation when
`),Gl=n("code"),wm=i("forced_bos_token_id=0"),xm=i(`. This only works, however, if the string you pass to
`),Wl=n("code"),$m=i("fairseq.encode"),Fm=i(" starts with a space."),zm=c(),kd=n("li"),yd=n("a"),qm=i("generate()"),Bm=i(` should be used for conditional generation tasks like
summarization, see the example in that docstrings.`),jm=c(),wo=n("li"),Em=i("Models that load the "),Ul=n("em"),Cm=i("facebook/bart-large-cnn"),Am=i(" weights will not have a "),Rl=n("code"),Mm=i("mask_token_id"),Pm=i(`, or be able to perform
mask-filling tasks.`),Bu=c(),xo=n("h2"),pn=n("a"),Hl=n("span"),y(rs.$$.fragment),Sm=c(),Ql=n("span"),Im=i("Mask Filling"),ju=c(),Jt=n("p"),Om=i("The "),Vl=n("code"),Nm=i("facebook/bart-base"),Lm=i(" and "),Kl=n("code"),Dm=i("facebook/bart-large"),Gm=i(" checkpoints can be used to fill multi-token masks."),Eu=c(),y(is.$$.fragment),Cu=c(),$o=n("h2"),un=n("a"),Jl=n("span"),y(ds.$$.fragment),Wm=c(),Xl=n("span"),Um=i("Resources"),Au=c(),vd=n("p"),Rm=i("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BART. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Mu=c(),y(ls.$$.fragment),Pu=c(),Te=n("ul"),cs=n("li"),Hm=i("A blog post on "),ps=n("a"),Qm=i("Distributed Training: Train BART/T5 for Summarization using \u{1F917} Transformers and Amazon SageMaker"),Vm=i("."),Km=c(),us=n("li"),Jm=i("A notebook on how to "),hs=n("a"),Xm=i("finetune BART for summarization with fastai using blurr"),Zm=i(". \u{1F30E}"),Ym=c(),fs=n("li"),e_=i("A notebook on how to "),ms=n("a"),t_=i("finetune BART for summarization in two languages with Trainer class"),o_=i(". \u{1F30E}"),n_=c(),Xt=n("li"),Td=n("a"),a_=i("BartForConditionalGeneration"),s_=i(" is supported by this "),_s=n("a"),r_=i("example script"),i_=i(" and "),gs=n("a"),d_=i("notebook"),l_=i("."),c_=c(),Zt=n("li"),wd=n("a"),p_=i("TFBartForConditionalGeneration"),u_=i(" is supported by this "),bs=n("a"),h_=i("example script"),f_=i(" and "),ks=n("a"),m_=i("notebook"),__=i("."),g_=c(),hn=n("li"),xd=n("a"),b_=i("FlaxBartForConditionalGeneration"),k_=i(" is supported by this "),ys=n("a"),y_=i("example script"),v_=i("."),T_=c(),$d=n("li"),vs=n("a"),w_=i("Summarization"),x_=i(" chapter of the \u{1F917} Hugging Face course."),$_=c(),Zl=n("li"),Fd=n("a"),F_=i("Summarization task guide"),Su=c(),y(Ts.$$.fragment),Iu=c(),ht=n("ul"),Yt=n("li"),zd=n("a"),z_=i("BartForConditionalGeneration"),q_=i(" is supported by this "),ws=n("a"),B_=i("example script"),j_=i(" and "),xs=n("a"),E_=i("notebook"),C_=i("."),A_=c(),eo=n("li"),qd=n("a"),M_=i("TFBartForConditionalGeneration"),P_=i(" is supported by this "),$s=n("a"),S_=i("example script"),I_=i(" and "),Fs=n("a"),O_=i("notebook"),N_=i("."),L_=c(),to=n("li"),Bd=n("a"),D_=i("FlaxBartForConditionalGeneration"),G_=i(" is supported by this "),zs=n("a"),W_=i("example script"),U_=i(" and "),qs=n("a"),R_=i("notebook"),H_=i("."),Q_=c(),jd=n("li"),Bs=n("a"),V_=i("Masked language modeling"),K_=i(" chapter of the \u{1F917} Hugging Face Course."),J_=c(),Yl=n("li"),Ed=n("a"),X_=i("Masked language modeling task guide"),Ou=c(),y(js.$$.fragment),Nu=c(),Et=n("ul"),Es=n("li"),Z_=i("A notebook on how to "),Cs=n("a"),Y_=i("finetune mBART using Seq2SeqTrainer for Hindi to English translation"),eg=i(". \u{1F30E}"),tg=c(),oo=n("li"),Cd=n("a"),og=i("BartForConditionalGeneration"),ng=i(" is supported by this "),As=n("a"),ag=i("example script"),sg=i(" and "),Ms=n("a"),rg=i("notebook"),ig=i("."),dg=c(),no=n("li"),Ad=n("a"),lg=i("TFBartForConditionalGeneration"),cg=i(" is supported by this "),Ps=n("a"),pg=i("example script"),ug=i(" and "),Ss=n("a"),hg=i("notebook"),fg=i("."),mg=c(),ec=n("li"),Md=n("a"),_g=i("Translation task guide"),Lu=c(),Pd=n("p"),gg=i("See also:"),Du=c(),ao=n("ul"),tc=n("li"),Sd=n("a"),bg=i("Text classification task guide"),kg=c(),oc=n("li"),Id=n("a"),yg=i("Question answering task guide"),vg=c(),nc=n("li"),Od=n("a"),Tg=i("Causal language modeling task guide"),Gu=c(),Fo=n("h2"),fn=n("a"),ac=n("span"),y(Is.$$.fragment),wg=c(),sc=n("span"),xg=i("BartConfig"),Wu=c(),kt=n("div"),y(Os.$$.fragment),$g=c(),zo=n("p"),Fg=i("This is the configuration class to store the configuration of a "),Nd=n("a"),zg=i("BartModel"),qg=i(`. It is used to instantiate a BART
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the BART
`),Ns=n("a"),Bg=i("facebook/bart-large"),jg=i(" architecture."),Eg=c(),qo=n("p"),Cg=i("Configuration objects inherit from "),Ld=n("a"),Ag=i("PretrainedConfig"),Mg=i(` and can be used to control the model outputs. Read the
documentation from `),Dd=n("a"),Pg=i("PretrainedConfig"),Sg=i(" for more information."),Ig=c(),y(mn.$$.fragment),Uu=c(),Bo=n("h2"),_n=n("a"),rc=n("span"),y(Ls.$$.fragment),Og=c(),ic=n("span"),Ng=i("BartTokenizer"),Ru=c(),D=n("div"),y(Ds.$$.fragment),Lg=c(),dc=n("p"),Dg=i("Constructs a BART tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),Gg=c(),lc=n("p"),Wg=i("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Ug=c(),y(gn.$$.fragment),Rg=c(),Gs=n("p"),Hg=i("You can get around that behavior by passing "),cc=n("code"),Qg=i("add_prefix_space=True"),Vg=i(` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),Kg=c(),y(bn.$$.fragment),Jg=c(),Ws=n("p"),Xg=i("This tokenizer inherits from "),Gd=n("a"),Zg=i("PreTrainedTokenizer"),Yg=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),eb=c(),so=n("div"),y(Us.$$.fragment),tb=c(),pc=n("p"),ob=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BART sequence has the following format:`),nb=c(),Rs=n("ul"),Wd=n("li"),ab=i("single sequence: "),uc=n("code"),sb=i("<s> X </s>"),rb=c(),Ud=n("li"),ib=i("pair of sequences: "),hc=n("code"),db=i("<s> A </s></s> B </s>"),lb=c(),kn=n("div"),y(Hs.$$.fragment),cb=c(),fc=n("p"),pb=i("Converts a sequence of tokens (string) in a single string."),ub=c(),yn=n("div"),y(Qs.$$.fragment),hb=c(),mc=n("p"),fb=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.`),mb=c(),vn=n("div"),y(Vs.$$.fragment),_b=c(),Ks=n("p"),gb=i(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),_c=n("code"),bb=i("prepare_for_model"),kb=i(" method."),Hu=c(),jo=n("h2"),Tn=n("a"),gc=n("span"),y(Js.$$.fragment),yb=c(),bc=n("span"),vb=i("BartTokenizerFast"),Qu=c(),me=n("div"),y(Xs.$$.fragment),Tb=c(),Zs=n("p"),wb=i("Construct a \u201Cfast\u201D BART tokenizer (backed by HuggingFace\u2019s "),kc=n("em"),xb=i("tokenizers"),$b=i(` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),Fb=c(),yc=n("p"),zb=i("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),qb=c(),y(wn.$$.fragment),Bb=c(),Ys=n("p"),jb=i("You can get around that behavior by passing "),vc=n("code"),Eb=i("add_prefix_space=True"),Cb=i(` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),Ab=c(),y(xn.$$.fragment),Mb=c(),er=n("p"),Pb=i("This tokenizer inherits from "),Rd=n("a"),Sb=i("PreTrainedTokenizerFast"),Ib=i(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Ob=c(),$n=n("div"),y(tr.$$.fragment),Nb=c(),Tc=n("p"),Lb=i(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. BART does not
make use of token type ids, therefore a list of zeros is returned.`),Vu=c(),Eo=n("h2"),Fn=n("a"),wc=n("span"),y(or.$$.fragment),Db=c(),xc=n("span"),Gb=i("BartModel"),Ku=c(),yt=n("div"),y(nr.$$.fragment),Wb=c(),ar=n("p"),Ub=i(`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Hd=n("a"),Rb=i("PreTrainedModel"),Hb=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Qb=c(),sr=n("p"),Vb=i("This model is also a PyTorch "),rr=n("a"),Kb=i("torch.nn.Module"),Jb=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xb=c(),Ct=n("div"),y(ir.$$.fragment),Zb=c(),Co=n("p"),Yb=i("The "),Qd=n("a"),ek=i("BartModel"),tk=i(" forward method, overrides the "),$c=n("code"),ok=i("__call__"),nk=i(" special method."),ak=c(),y(zn.$$.fragment),sk=c(),y(qn.$$.fragment),Ju=c(),Ao=n("h2"),Bn=n("a"),Fc=n("span"),y(dr.$$.fragment),rk=c(),zc=n("span"),ik=i("BartForConditionalGeneration"),Xu=c(),vt=n("div"),y(lr.$$.fragment),dk=c(),cr=n("p"),lk=i(`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Vd=n("a"),ck=i("PreTrainedModel"),pk=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),uk=c(),pr=n("p"),hk=i("This model is also a PyTorch "),ur=n("a"),fk=i("torch.nn.Module"),mk=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_k=c(),ft=n("div"),y(hr.$$.fragment),gk=c(),Mo=n("p"),bk=i("The "),Kd=n("a"),kk=i("BartForConditionalGeneration"),yk=i(" forward method, overrides the "),qc=n("code"),vk=i("__call__"),Tk=i(" special method."),wk=c(),y(jn.$$.fragment),xk=c(),y(En.$$.fragment),$k=c(),y(Cn.$$.fragment),Zu=c(),Po=n("h2"),An=n("a"),Bc=n("span"),y(fr.$$.fragment),Fk=c(),jc=n("span"),zk=i("BartForSequenceClassification"),Yu=c(),ot=n("div"),y(mr.$$.fragment),qk=c(),Ec=n("p"),Bk=i(`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),jk=c(),_r=n("p"),Ek=i("This model inherits from "),Jd=n("a"),Ck=i("PreTrainedModel"),Ak=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Mk=c(),gr=n("p"),Pk=i("This model is also a PyTorch "),br=n("a"),Sk=i("torch.nn.Module"),Ik=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ok=c(),mt=n("div"),y(kr.$$.fragment),Nk=c(),So=n("p"),Lk=i("The "),Xd=n("a"),Dk=i("BartForSequenceClassification"),Gk=i(" forward method, overrides the "),Cc=n("code"),Wk=i("__call__"),Uk=i(" special method."),Rk=c(),y(Mn.$$.fragment),Hk=c(),y(Pn.$$.fragment),Qk=c(),y(Sn.$$.fragment),eh=c(),Io=n("h2"),In=n("a"),Ac=n("span"),y(yr.$$.fragment),Vk=c(),Mc=n("span"),Kk=i("BartForQuestionAnswering"),th=c(),nt=n("div"),y(vr.$$.fragment),Jk=c(),Oo=n("p"),Xk=i(`BART Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),Pc=n("code"),Zk=i("span start logits"),Yk=i(" and "),Sc=n("code"),ey=i("span end logits"),ty=i(")."),oy=c(),Tr=n("p"),ny=i("This model inherits from "),Zd=n("a"),ay=i("PreTrainedModel"),sy=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ry=c(),wr=n("p"),iy=i("This model is also a PyTorch "),xr=n("a"),dy=i("torch.nn.Module"),ly=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),cy=c(),At=n("div"),y($r.$$.fragment),py=c(),No=n("p"),uy=i("The "),Yd=n("a"),hy=i("BartForQuestionAnswering"),fy=i(" forward method, overrides the "),Ic=n("code"),my=i("__call__"),_y=i(" special method."),gy=c(),y(On.$$.fragment),by=c(),y(Nn.$$.fragment),oh=c(),Lo=n("h2"),Ln=n("a"),Oc=n("span"),y(Fr.$$.fragment),ky=c(),Nc=n("span"),yy=i("BartForCausalLM"),nh=c(),at=n("div"),y(zr.$$.fragment),vy=c(),Lc=n("p"),Ty=i("BART decoder with with a language modeling head on top (linear layer with weights tied to the input embeddings)."),wy=c(),qr=n("p"),xy=i("This model inherits from "),el=n("a"),$y=i("PreTrainedModel"),Fy=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),zy=c(),Br=n("p"),qy=i("This model is also a PyTorch "),jr=n("a"),By=i("torch.nn.Module"),jy=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ey=c(),Dn=n("div"),y(Er.$$.fragment),Cy=c(),y(Gn.$$.fragment),ah=c(),Do=n("h2"),Wn=n("a"),Dc=n("span"),y(Cr.$$.fragment),Ay=c(),Gc=n("span"),My=i("TFBartModel"),sh=c(),st=n("div"),y(Ar.$$.fragment),Py=c(),Mr=n("p"),Sy=i(`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),tl=n("a"),Iy=i("TFPreTrainedModel"),Oy=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ny=c(),Pr=n("p"),Ly=i("This model is also a "),Sr=n("a"),Dy=i("tf.keras.Model"),Gy=i(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Wy=c(),y(Un.$$.fragment),Uy=c(),Mt=n("div"),y(Ir.$$.fragment),Ry=c(),Go=n("p"),Hy=i("The "),ol=n("a"),Qy=i("TFBartModel"),Vy=i(" forward method, overrides the "),Wc=n("code"),Ky=i("__call__"),Jy=i(" special method."),Xy=c(),y(Rn.$$.fragment),Zy=c(),y(Hn.$$.fragment),rh=c(),Wo=n("h2"),Qn=n("a"),Uc=n("span"),y(Or.$$.fragment),Yy=c(),Rc=n("span"),ev=i("TFBartForConditionalGeneration"),ih=c(),rt=n("div"),y(Nr.$$.fragment),tv=c(),Lr=n("p"),ov=i(`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),nl=n("a"),nv=i("TFPreTrainedModel"),av=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),sv=c(),Dr=n("p"),rv=i("This model is also a "),Gr=n("a"),iv=i("tf.keras.Model"),dv=i(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),lv=c(),y(Vn.$$.fragment),cv=c(),_t=n("div"),y(Wr.$$.fragment),pv=c(),Uo=n("p"),uv=i("The "),al=n("a"),hv=i("TFBartForConditionalGeneration"),fv=i(" forward method, overrides the "),Hc=n("code"),mv=i("__call__"),_v=i(" special method."),gv=c(),y(Kn.$$.fragment),bv=c(),y(Jn.$$.fragment),kv=c(),y(Xn.$$.fragment),dh=c(),Ro=n("h2"),Zn=n("a"),Qc=n("span"),y(Ur.$$.fragment),yv=c(),Vc=n("span"),vv=i("TFBartForSequenceClassification"),lh=c(),Pe=n("div"),y(Rr.$$.fragment),Tv=c(),Kc=n("p"),wv=i(`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),xv=c(),Hr=n("p"),$v=i("This model inherits from "),sl=n("a"),Fv=i("TFPreTrainedModel"),zv=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qv=c(),Qr=n("p"),Bv=i("This model is also a "),Vr=n("a"),jv=i("tf.keras.Model"),Ev=i(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Cv=c(),y(Yn.$$.fragment),Av=c(),ro=n("div"),y(Kr.$$.fragment),Mv=c(),Ho=n("p"),Pv=i("The "),rl=n("a"),Sv=i("TFBartForSequenceClassification"),Iv=i(" forward method, overrides the "),Jc=n("code"),Ov=i("__call__"),Nv=i(" special method."),Lv=c(),y(ea.$$.fragment),ch=c(),Qo=n("h2"),ta=n("a"),Xc=n("span"),y(Jr.$$.fragment),Dv=c(),Zc=n("span"),Gv=i("FlaxBartModel"),ph=c(),_e=n("div"),y(Xr.$$.fragment),Wv=c(),Zr=n("p"),Uv=i(`The bare Bart Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),il=n("a"),Rv=i("FlaxPreTrainedModel"),Hv=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Qv=c(),Yr=n("p"),Vv=i(`This model is also a Flax Linen
`),ei=n("a"),Kv=i("flax.nn.Module"),Jv=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Xv=c(),Yc=n("p"),Zv=i("Finally, this model supports inherent JAX features such as:"),Yv=c(),Gt=n("ul"),ep=n("li"),ti=n("a"),eT=i("Just-In-Time (JIT) compilation"),tT=c(),tp=n("li"),oi=n("a"),oT=i("Automatic Differentiation"),nT=c(),op=n("li"),ni=n("a"),aT=i("Vectorization"),sT=c(),np=n("li"),ai=n("a"),rT=i("Parallelization"),iT=c(),Pt=n("div"),y(si.$$.fragment),dT=c(),Vo=n("p"),lT=i("The "),ap=n("code"),cT=i("FlaxBartPreTrainedModel"),pT=i(" forward method, overrides the "),sp=n("code"),uT=i("__call__"),hT=i(" special method."),fT=c(),y(oa.$$.fragment),mT=c(),y(na.$$.fragment),_T=c(),aa=n("div"),y(ri.$$.fragment),gT=c(),y(sa.$$.fragment),bT=c(),ra=n("div"),y(ii.$$.fragment),kT=c(),y(ia.$$.fragment),uh=c(),Ko=n("h2"),da=n("a"),rp=n("span"),y(di.$$.fragment),yT=c(),ip=n("span"),vT=i("FlaxBartForConditionalGeneration"),hh=c(),ge=n("div"),y(li.$$.fragment),TT=c(),ci=n("p"),wT=i(`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),dl=n("a"),xT=i("FlaxPreTrainedModel"),$T=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),FT=c(),pi=n("p"),zT=i(`This model is also a Flax Linen
`),ui=n("a"),qT=i("flax.nn.Module"),BT=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),jT=c(),dp=n("p"),ET=i("Finally, this model supports inherent JAX features such as:"),CT=c(),Wt=n("ul"),lp=n("li"),hi=n("a"),AT=i("Just-In-Time (JIT) compilation"),MT=c(),cp=n("li"),fi=n("a"),PT=i("Automatic Differentiation"),ST=c(),pp=n("li"),mi=n("a"),IT=i("Vectorization"),OT=c(),up=n("li"),_i=n("a"),NT=i("Parallelization"),LT=c(),gt=n("div"),y(gi.$$.fragment),DT=c(),Jo=n("p"),GT=i("The "),hp=n("code"),WT=i("FlaxBartPreTrainedModel"),UT=i(" forward method, overrides the "),fp=n("code"),RT=i("__call__"),HT=i(" special method."),QT=c(),y(la.$$.fragment),VT=c(),y(ca.$$.fragment),KT=c(),y(pa.$$.fragment),JT=c(),ua=n("div"),y(bi.$$.fragment),XT=c(),y(ha.$$.fragment),ZT=c(),fa=n("div"),y(ki.$$.fragment),YT=c(),y(ma.$$.fragment),fh=c(),Xo=n("h2"),_a=n("a"),mp=n("span"),y(yi.$$.fragment),e1=c(),_p=n("span"),t1=i("FlaxBartForSequenceClassification"),mh=c(),J=n("div"),y(vi.$$.fragment),o1=c(),gp=n("p"),n1=i(`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),a1=c(),Ti=n("p"),s1=i("This model inherits from "),ll=n("a"),r1=i("FlaxPreTrainedModel"),i1=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.)`),d1=c(),wi=n("p"),l1=i(`This model is also a Flax Linen
`),xi=n("a"),c1=i("flax.nn.Module"),p1=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),u1=c(),bp=n("p"),h1=i("Finally, this model supports inherent JAX features such as:"),f1=c(),Ut=n("ul"),kp=n("li"),$i=n("a"),m1=i("Just-In-Time (JIT) compilation"),_1=c(),yp=n("li"),Fi=n("a"),g1=i("Automatic Differentiation"),b1=c(),vp=n("li"),zi=n("a"),k1=i("Vectorization"),y1=c(),Tp=n("li"),qi=n("a"),v1=i("Parallelization"),T1=c(),St=n("div"),y(Bi.$$.fragment),w1=c(),Zo=n("p"),x1=i("The "),wp=n("code"),$1=i("FlaxBartPreTrainedModel"),F1=i(" forward method, overrides the "),xp=n("code"),z1=i("__call__"),q1=i(" special method."),B1=c(),y(ga.$$.fragment),j1=c(),y(ba.$$.fragment),E1=c(),ka=n("div"),y(ji.$$.fragment),C1=c(),y(ya.$$.fragment),A1=c(),va=n("div"),y(Ei.$$.fragment),M1=c(),y(Ta.$$.fragment),_h=c(),Yo=n("h2"),wa=n("a"),$p=n("span"),y(Ci.$$.fragment),P1=c(),Fp=n("span"),S1=i("FlaxBartForQuestionAnswering"),gh=c(),X=n("div"),y(Ai.$$.fragment),I1=c(),en=n("p"),O1=i(`BART Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),zp=n("code"),N1=i("span start logits"),L1=i(" and "),qp=n("code"),D1=i("span end logits"),G1=i(")."),W1=c(),Mi=n("p"),U1=i("This model inherits from "),cl=n("a"),R1=i("FlaxPreTrainedModel"),H1=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.)`),Q1=c(),Pi=n("p"),V1=i(`This model is also a Flax Linen
`),Si=n("a"),K1=i("flax.nn.Module"),J1=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),X1=c(),Bp=n("p"),Z1=i("Finally, this model supports inherent JAX features such as:"),Y1=c(),Rt=n("ul"),jp=n("li"),Ii=n("a"),ew=i("Just-In-Time (JIT) compilation"),tw=c(),Ep=n("li"),Oi=n("a"),ow=i("Automatic Differentiation"),nw=c(),Cp=n("li"),Ni=n("a"),aw=i("Vectorization"),sw=c(),Ap=n("li"),Li=n("a"),rw=i("Parallelization"),iw=c(),It=n("div"),y(Di.$$.fragment),dw=c(),tn=n("p"),lw=i("The "),Mp=n("code"),cw=i("FlaxBartPreTrainedModel"),pw=i(" forward method, overrides the "),Pp=n("code"),uw=i("__call__"),hw=i(" special method."),fw=c(),y(xa.$$.fragment),mw=c(),y($a.$$.fragment),_w=c(),Fa=n("div"),y(Gi.$$.fragment),gw=c(),y(za.$$.fragment),bw=c(),qa=n("div"),y(Wi.$$.fragment),kw=c(),y(Ba.$$.fragment),bh=c(),on=n("h2"),ja=n("a"),Sp=n("span"),y(Ui.$$.fragment),yw=c(),Ip=n("span"),vw=i("FlaxBartForCausalLM"),kh=c(),xe=n("div"),y(Ri.$$.fragment),Tw=c(),Op=n("p"),ww=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.`),xw=c(),Hi=n("p"),$w=i("This model inherits from "),pl=n("a"),Fw=i("FlaxPreTrainedModel"),zw=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qw=c(),Qi=n("p"),Bw=i(`This model is also a Flax Linen
`),Vi=n("a"),jw=i("flax.nn.Module"),Ew=i(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Cw=c(),Np=n("p"),Aw=i("Finally, this model supports inherent JAX features such as:"),Mw=c(),Ht=n("ul"),Lp=n("li"),Ki=n("a"),Pw=i("Just-In-Time (JIT) compilation"),Sw=c(),Dp=n("li"),Ji=n("a"),Iw=i("Automatic Differentiation"),Ow=c(),Gp=n("li"),Xi=n("a"),Nw=i("Vectorization"),Lw=c(),Wp=n("li"),Zi=n("a"),Dw=i("Parallelization"),Gw=c(),Ot=n("div"),y(Yi.$$.fragment),Ww=c(),nn=n("p"),Uw=i("The "),Up=n("code"),Rw=i("FlaxBartDecoderPreTrainedModel"),Hw=i(" forward method, overrides the "),Rp=n("code"),Qw=i("__call__"),Vw=i(" special method."),Kw=c(),y(Ea.$$.fragment),Jw=c(),y(Ca.$$.fragment),this.h()},l(o){const _=E0('[data-svelte="svelte-1phssyn"]',document.head);l=a(_,"META",{name:!0,content:!0}),_.forEach(t),k=p(o),m=a(o,"H1",{class:!0});var ed=s(m);f=a(ed,"A",{id:!0,class:!0,href:!0});var Hp=s(f);b=a(Hp,"SPAN",{});var Qp=s(b);v(r.$$.fragment,Qp),Qp.forEach(t),Hp.forEach(t),h=p(ed),q=a(ed,"SPAN",{});var Vp=s(q);se=d(Vp,"BART"),Vp.forEach(t),ed.forEach(t),H=p(o),I=a(o,"DIV",{class:!0});var td=s(I);re=a(td,"A",{href:!0});var Kp=s(re);ie=a(Kp,"IMG",{alt:!0,src:!0}),Kp.forEach(t),Re=p(td),V=a(td,"A",{href:!0});var Jp=s(V);$e=a(Jp,"IMG",{alt:!0,src:!0}),Jp.forEach(t),td.forEach(t),Z=p(o),de=a(o,"P",{});var Aa=s(de);Ce=a(Aa,"STRONG",{});var Xp=s(Ce);le=d(Xp,"DISCLAIMER:"),Xp.forEach(t),He=d(Aa," If you see something strange, file a "),we=a(Aa,"A",{href:!0,rel:!0});var Zp=s(we);ce=d(Zp,"Github Issue"),Zp.forEach(t),Qe=d(Aa,` and assign
@patrickvonplaten`),Aa.forEach(t),Ie=p(o),N=a(o,"H2",{class:!0});var od=s(N);be=a(od,"A",{id:!0,class:!0,href:!0});var Yp=s(be);Ae=a(Yp,"SPAN",{});var eu=s(Ae);v(Y.$$.fragment,eu),eu.forEach(t),Yp.forEach(t),A=p(od),M=a(od,"SPAN",{});var tu=s(M);Ve=d(tu,"Overview"),tu.forEach(t),od.forEach(t),ee=p(o),ke=a(o,"P",{});var nd=s(ke);Ke=d(nd,"The Bart model was proposed in "),Q=a(nd,"A",{href:!0,rel:!0});var ou=s(Q);Je=d(ou,`BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation,
Translation, and Comprehension`),ou.forEach(t),Xe=d(nd,` by Mike Lewis, Yinhan Liu, Naman Goyal, Marjan
Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov and Luke Zettlemoyer on 29 Oct, 2019.`),nd.forEach(t),P=p(o),Fe=a(o,"P",{});var nu=s(Fe);pe=d(nu,"According to the abstract,"),nu.forEach(t),Oe=p(o),te=a(o,"UL",{});var an=s(te);K=a(an,"LI",{});var au=s(K);Ze=d(au,`Bart uses a standard seq2seq/machine translation architecture with a bidirectional encoder (like BERT) and a
left-to-right decoder (like GPT).`),au.forEach(t),Ye=p(an),U=a(an,"LI",{});var su=s(U);et=d(su,`The pretraining task involves randomly shuffling the order of the original sentences and a novel in-filling scheme,
where spans of text are replaced with a single mask token.`),su.forEach(t),ue=p(an),Me=a(an,"LI",{});var ru=s(Me);ze=d(ru,`BART is particularly effective when fine tuned for text generation but also works well for comprehension tasks. It
matches the performance of RoBERTa with comparable training resources on GLUE and SQuAD, achieves new
state-of-the-art results on a range of abstractive dialogue, question answering, and summarization tasks, with gains
of up to 6 ROUGE.`),ru.forEach(t),an.forEach(t),S=p(o),qe=a(o,"P",{});var iu=s(qe);L=d(iu,"Tips:"),iu.forEach(t),Ne=p(o),ye=a(o,"UL",{});var ad=s(ye);F=a(ad,"LI",{});var du=s(F);j=a(du,"P",{});var lu=s(j);wt=d(lu,`BART is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than
the left.`),lu.forEach(t),du.forEach(t),Be=p(ad),Le=a(ad,"LI",{});var sd=s(Le);dt=a(sd,"P",{});var cu=s(dt);E=d(cu,"Sequence-to-sequence model with an encoder and a decoder. Encoder is fed a corrupted version of the tokens, decoder is fed the original tokens (but has a mask to hide the future words like a regular transformers decoder). A composition of the following transformations are applied on the pretraining tasks for the encoder:"),cu.forEach(t),xt=p(sd),oe=a(sd,"UL",{});var Tt=s(oe);lt=a(Tt,"LI",{});var pu=s(lt);$t=d(pu,"mask random tokens (like in BERT)"),pu.forEach(t),Ft=p(Tt),R=a(Tt,"LI",{});var uu=s(R);he=d(uu,"delete random tokens"),uu.forEach(t),zt=p(Tt),ct=a(Tt,"LI",{});var hu=s(ct);fe=d(hu,"mask a span of k tokens with a single mask token (a span of 0 tokens is an insertion of a mask token)"),hu.forEach(t),qt=p(Tt),pt=a(Tt,"LI",{});var fu=s(pt);tt=d(fu,"permute sentences"),fu.forEach(t),Bt=p(Tt),ve=a(Tt,"LI",{});var mu=s(ve);jt=d(mu,"rotate the document to make it start at a specific token"),mu.forEach(t),Tt.forEach(t),sd.forEach(t),ad.forEach(t),xu=p(o),Vt=a(o,"P",{});var sn=s(Vt);If=d(sn,"This model was contributed by "),Xa=a(sn,"A",{href:!0,rel:!0});var _u=s(Xa);Of=d(_u,"sshleifer"),_u.forEach(t),Nf=d(sn,". The Authors\u2019 code can be found "),Za=a(sn,"A",{href:!0,rel:!0});var gu=s(Za);Lf=d(gu,"here"),gu.forEach(t),Df=d(sn,"."),sn.forEach(t),$u=p(o),ko=a(o,"H3",{class:!0});var rd=s(ko);dn=a(rd,"A",{id:!0,class:!0,href:!0});var bu=s(dn);Pl=a(bu,"SPAN",{});var ku=s(Pl);v(Ya.$$.fragment,ku),ku.forEach(t),bu.forEach(t),Gf=p(rd),Sl=a(rd,"SPAN",{});var yu=s(Sl);Wf=d(yu,"Examples"),yu.forEach(t),rd.forEach(t),Fu=p(o),Kt=a(o,"UL",{});var rn=s(Kt);es=a(rn,"LI",{});var id=s(es);Uf=d(id,`Examples and scripts for fine-tuning BART and other models for sequence to sequence tasks can be found in
`),ts=a(id,"A",{href:!0,rel:!0});var vu=s(ts);Rf=d(vu,"examples/pytorch/summarization/"),vu.forEach(t),Hf=d(id,"."),id.forEach(t),Qf=p(rn),Lt=a(rn,"LI",{});var Qt=s(Lt);Vf=d(Qt,"An example of how to train "),md=a(Qt,"A",{href:!0});var n2=s(md);Kf=d(n2,"BartForConditionalGeneration"),n2.forEach(t),Jf=d(Qt," with a Hugging Face "),Il=a(Qt,"CODE",{});var a2=s(Il);Xf=d(a2,"datasets"),a2.forEach(t),Zf=d(Qt,`
object can be found in this `),os=a(Qt,"A",{href:!0,rel:!0});var s2=s(os);Yf=d(s2,"forum discussion"),s2.forEach(t),em=d(Qt,"."),Qt.forEach(t),tm=p(rn),ln=a(rn,"LI",{});var Tu=s(ln);ns=a(Tu,"A",{href:!0,rel:!0});var r2=s(ns);om=d(r2,"Distilled checkpoints"),r2.forEach(t),nm=d(Tu," are described in this "),as=a(Tu,"A",{href:!0,rel:!0});var i2=s(as);am=d(i2,"paper"),i2.forEach(t),sm=d(Tu,"."),Tu.forEach(t),rn.forEach(t),zu=p(o),yo=a(o,"H2",{class:!0});var vh=s(yo);cn=a(vh,"A",{id:!0,class:!0,href:!0});var d2=s(cn);Ol=a(d2,"SPAN",{});var l2=s(Ol);v(ss.$$.fragment,l2),l2.forEach(t),d2.forEach(t),rm=p(vh),Nl=a(vh,"SPAN",{});var c2=s(Nl);im=d(c2,"Implementation Notes"),c2.forEach(t),vh.forEach(t),qu=p(o),ut=a(o,"UL",{});var io=s(ut);Dt=a(io,"LI",{});var Ma=s(Dt);dm=d(Ma,"Bart doesn\u2019t use "),Ll=a(Ma,"CODE",{});var p2=s(Ll);lm=d(p2,"token_type_ids"),p2.forEach(t),cm=d(Ma," for sequence classification. Use "),_d=a(Ma,"A",{href:!0});var u2=s(_d);pm=d(u2,"BartTokenizer"),u2.forEach(t),um=d(Ma,` or
`),gd=a(Ma,"A",{href:!0});var h2=s(gd);hm=d(h2,"encode()"),h2.forEach(t),fm=d(Ma," to get the proper splitting."),Ma.forEach(t),mm=p(io),vo=a(io,"LI",{});var ul=s(vo);_m=d(ul,"The forward pass of "),bd=a(ul,"A",{href:!0});var f2=s(bd);gm=d(f2,"BartModel"),f2.forEach(t),bm=d(ul," will create the "),Dl=a(ul,"CODE",{});var m2=s(Dl);km=d(m2,"decoder_input_ids"),m2.forEach(t),ym=d(ul,` if they are not passed.
This is different than some other modeling APIs. A typical use case of this feature is mask filling.`),ul.forEach(t),vm=p(io),To=a(io,"LI",{});var hl=s(To);Tm=d(hl,`Model predictions are intended to be identical to the original implementation when
`),Gl=a(hl,"CODE",{});var _2=s(Gl);wm=d(_2,"forced_bos_token_id=0"),_2.forEach(t),xm=d(hl,`. This only works, however, if the string you pass to
`),Wl=a(hl,"CODE",{});var g2=s(Wl);$m=d(g2,"fairseq.encode"),g2.forEach(t),Fm=d(hl," starts with a space."),hl.forEach(t),zm=p(io),kd=a(io,"LI",{});var Xw=s(kd);yd=a(Xw,"A",{href:!0});var b2=s(yd);qm=d(b2,"generate()"),b2.forEach(t),Bm=d(Xw,` should be used for conditional generation tasks like
summarization, see the example in that docstrings.`),Xw.forEach(t),jm=p(io),wo=a(io,"LI",{});var fl=s(wo);Em=d(fl,"Models that load the "),Ul=a(fl,"EM",{});var k2=s(Ul);Cm=d(k2,"facebook/bart-large-cnn"),k2.forEach(t),Am=d(fl," weights will not have a "),Rl=a(fl,"CODE",{});var y2=s(Rl);Mm=d(y2,"mask_token_id"),y2.forEach(t),Pm=d(fl,`, or be able to perform
mask-filling tasks.`),fl.forEach(t),io.forEach(t),Bu=p(o),xo=a(o,"H2",{class:!0});var Th=s(xo);pn=a(Th,"A",{id:!0,class:!0,href:!0});var v2=s(pn);Hl=a(v2,"SPAN",{});var T2=s(Hl);v(rs.$$.fragment,T2),T2.forEach(t),v2.forEach(t),Sm=p(Th),Ql=a(Th,"SPAN",{});var w2=s(Ql);Im=d(w2,"Mask Filling"),w2.forEach(t),Th.forEach(t),ju=p(o),Jt=a(o,"P",{});var ml=s(Jt);Om=d(ml,"The "),Vl=a(ml,"CODE",{});var x2=s(Vl);Nm=d(x2,"facebook/bart-base"),x2.forEach(t),Lm=d(ml," and "),Kl=a(ml,"CODE",{});var $2=s(Kl);Dm=d($2,"facebook/bart-large"),$2.forEach(t),Gm=d(ml," checkpoints can be used to fill multi-token masks."),ml.forEach(t),Eu=p(o),v(is.$$.fragment,o),Cu=p(o),$o=a(o,"H2",{class:!0});var wh=s($o);un=a(wh,"A",{id:!0,class:!0,href:!0});var F2=s(un);Jl=a(F2,"SPAN",{});var z2=s(Jl);v(ds.$$.fragment,z2),z2.forEach(t),F2.forEach(t),Wm=p(wh),Xl=a(wh,"SPAN",{});var q2=s(Xl);Um=d(q2,"Resources"),q2.forEach(t),wh.forEach(t),Au=p(o),vd=a(o,"P",{});var B2=s(vd);Rm=d(B2,"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."),B2.forEach(t),Mu=p(o),v(ls.$$.fragment,o),Pu=p(o),Te=a(o,"UL",{});var De=s(Te);cs=a(De,"LI",{});var xh=s(cs);Hm=d(xh,"A blog post on "),ps=a(xh,"A",{href:!0,rel:!0});var j2=s(ps);Qm=d(j2,"Distributed Training: Train BART/T5 for Summarization using \u{1F917} Transformers and Amazon SageMaker"),j2.forEach(t),Vm=d(xh,"."),xh.forEach(t),Km=p(De),us=a(De,"LI",{});var $h=s(us);Jm=d($h,"A notebook on how to "),hs=a($h,"A",{href:!0,rel:!0});var E2=s(hs);Xm=d(E2,"finetune BART for summarization with fastai using blurr"),E2.forEach(t),Zm=d($h,". \u{1F30E}"),$h.forEach(t),Ym=p(De),fs=a(De,"LI",{});var Fh=s(fs);e_=d(Fh,"A notebook on how to "),ms=a(Fh,"A",{href:!0,rel:!0});var C2=s(ms);t_=d(C2,"finetune BART for summarization in two languages with Trainer class"),C2.forEach(t),o_=d(Fh,". \u{1F30E}"),Fh.forEach(t),n_=p(De),Xt=a(De,"LI",{});var dd=s(Xt);Td=a(dd,"A",{href:!0});var A2=s(Td);a_=d(A2,"BartForConditionalGeneration"),A2.forEach(t),s_=d(dd," is supported by this "),_s=a(dd,"A",{href:!0,rel:!0});var M2=s(_s);r_=d(M2,"example script"),M2.forEach(t),i_=d(dd," and "),gs=a(dd,"A",{href:!0,rel:!0});var P2=s(gs);d_=d(P2,"notebook"),P2.forEach(t),l_=d(dd,"."),dd.forEach(t),c_=p(De),Zt=a(De,"LI",{});var ld=s(Zt);wd=a(ld,"A",{href:!0});var S2=s(wd);p_=d(S2,"TFBartForConditionalGeneration"),S2.forEach(t),u_=d(ld," is supported by this "),bs=a(ld,"A",{href:!0,rel:!0});var I2=s(bs);h_=d(I2,"example script"),I2.forEach(t),f_=d(ld," and "),ks=a(ld,"A",{href:!0,rel:!0});var O2=s(ks);m_=d(O2,"notebook"),O2.forEach(t),__=d(ld,"."),ld.forEach(t),g_=p(De),hn=a(De,"LI",{});var wu=s(hn);xd=a(wu,"A",{href:!0});var N2=s(xd);b_=d(N2,"FlaxBartForConditionalGeneration"),N2.forEach(t),k_=d(wu," is supported by this "),ys=a(wu,"A",{href:!0,rel:!0});var L2=s(ys);y_=d(L2,"example script"),L2.forEach(t),v_=d(wu,"."),wu.forEach(t),T_=p(De),$d=a(De,"LI",{});var Zw=s($d);vs=a(Zw,"A",{href:!0,rel:!0});var D2=s(vs);w_=d(D2,"Summarization"),D2.forEach(t),x_=d(Zw," chapter of the \u{1F917} Hugging Face course."),Zw.forEach(t),$_=p(De),Zl=a(De,"LI",{});var G2=s(Zl);Fd=a(G2,"A",{href:!0});var W2=s(Fd);F_=d(W2,"Summarization task guide"),W2.forEach(t),G2.forEach(t),De.forEach(t),Su=p(o),v(Ts.$$.fragment,o),Iu=p(o),ht=a(o,"UL",{});var lo=s(ht);Yt=a(lo,"LI",{});var cd=s(Yt);zd=a(cd,"A",{href:!0});var U2=s(zd);z_=d(U2,"BartForConditionalGeneration"),U2.forEach(t),q_=d(cd," is supported by this "),ws=a(cd,"A",{href:!0,rel:!0});var R2=s(ws);B_=d(R2,"example script"),R2.forEach(t),j_=d(cd," and "),xs=a(cd,"A",{href:!0,rel:!0});var H2=s(xs);E_=d(H2,"notebook"),H2.forEach(t),C_=d(cd,"."),cd.forEach(t),A_=p(lo),eo=a(lo,"LI",{});var pd=s(eo);qd=a(pd,"A",{href:!0});var Q2=s(qd);M_=d(Q2,"TFBartForConditionalGeneration"),Q2.forEach(t),P_=d(pd," is supported by this "),$s=a(pd,"A",{href:!0,rel:!0});var V2=s($s);S_=d(V2,"example script"),V2.forEach(t),I_=d(pd," and "),Fs=a(pd,"A",{href:!0,rel:!0});var K2=s(Fs);O_=d(K2,"notebook"),K2.forEach(t),N_=d(pd,"."),pd.forEach(t),L_=p(lo),to=a(lo,"LI",{});var ud=s(to);Bd=a(ud,"A",{href:!0});var J2=s(Bd);D_=d(J2,"FlaxBartForConditionalGeneration"),J2.forEach(t),G_=d(ud," is supported by this "),zs=a(ud,"A",{href:!0,rel:!0});var X2=s(zs);W_=d(X2,"example script"),X2.forEach(t),U_=d(ud," and "),qs=a(ud,"A",{href:!0,rel:!0});var Z2=s(qs);R_=d(Z2,"notebook"),Z2.forEach(t),H_=d(ud,"."),ud.forEach(t),Q_=p(lo),jd=a(lo,"LI",{});var Yw=s(jd);Bs=a(Yw,"A",{href:!0,rel:!0});var Y2=s(Bs);V_=d(Y2,"Masked language modeling"),Y2.forEach(t),K_=d(Yw," chapter of the \u{1F917} Hugging Face Course."),Yw.forEach(t),J_=p(lo),Yl=a(lo,"LI",{});var ex=s(Yl);Ed=a(ex,"A",{href:!0});var tx=s(Ed);X_=d(tx,"Masked language modeling task guide"),tx.forEach(t),ex.forEach(t),lo.forEach(t),Ou=p(o),v(js.$$.fragment,o),Nu=p(o),Et=a(o,"UL",{});var Pa=s(Et);Es=a(Pa,"LI",{});var zh=s(Es);Z_=d(zh,"A notebook on how to "),Cs=a(zh,"A",{href:!0,rel:!0});var ox=s(Cs);Y_=d(ox,"finetune mBART using Seq2SeqTrainer for Hindi to English translation"),ox.forEach(t),eg=d(zh,". \u{1F30E}"),zh.forEach(t),tg=p(Pa),oo=a(Pa,"LI",{});var hd=s(oo);Cd=a(hd,"A",{href:!0});var nx=s(Cd);og=d(nx,"BartForConditionalGeneration"),nx.forEach(t),ng=d(hd," is supported by this "),As=a(hd,"A",{href:!0,rel:!0});var ax=s(As);ag=d(ax,"example script"),ax.forEach(t),sg=d(hd," and "),Ms=a(hd,"A",{href:!0,rel:!0});var sx=s(Ms);rg=d(sx,"notebook"),sx.forEach(t),ig=d(hd,"."),hd.forEach(t),dg=p(Pa),no=a(Pa,"LI",{});var fd=s(no);Ad=a(fd,"A",{href:!0});var rx=s(Ad);lg=d(rx,"TFBartForConditionalGeneration"),rx.forEach(t),cg=d(fd," is supported by this "),Ps=a(fd,"A",{href:!0,rel:!0});var ix=s(Ps);pg=d(ix,"example script"),ix.forEach(t),ug=d(fd," and "),Ss=a(fd,"A",{href:!0,rel:!0});var dx=s(Ss);hg=d(dx,"notebook"),dx.forEach(t),fg=d(fd,"."),fd.forEach(t),mg=p(Pa),ec=a(Pa,"LI",{});var lx=s(ec);Md=a(lx,"A",{href:!0});var cx=s(Md);_g=d(cx,"Translation task guide"),cx.forEach(t),lx.forEach(t),Pa.forEach(t),Lu=p(o),Pd=a(o,"P",{});var px=s(Pd);gg=d(px,"See also:"),px.forEach(t),Du=p(o),ao=a(o,"UL",{});var _l=s(ao);tc=a(_l,"LI",{});var ux=s(tc);Sd=a(ux,"A",{href:!0});var hx=s(Sd);bg=d(hx,"Text classification task guide"),hx.forEach(t),ux.forEach(t),kg=p(_l),oc=a(_l,"LI",{});var fx=s(oc);Id=a(fx,"A",{href:!0});var mx=s(Id);yg=d(mx,"Question answering task guide"),mx.forEach(t),fx.forEach(t),vg=p(_l),nc=a(_l,"LI",{});var _x=s(nc);Od=a(_x,"A",{href:!0});var gx=s(Od);Tg=d(gx,"Causal language modeling task guide"),gx.forEach(t),_x.forEach(t),_l.forEach(t),Gu=p(o),Fo=a(o,"H2",{class:!0});var qh=s(Fo);fn=a(qh,"A",{id:!0,class:!0,href:!0});var bx=s(fn);ac=a(bx,"SPAN",{});var kx=s(ac);v(Is.$$.fragment,kx),kx.forEach(t),bx.forEach(t),wg=p(qh),sc=a(qh,"SPAN",{});var yx=s(sc);xg=d(yx,"BartConfig"),yx.forEach(t),qh.forEach(t),Wu=p(o),kt=a(o,"DIV",{class:!0});var Sa=s(kt);v(Os.$$.fragment,Sa),$g=p(Sa),zo=a(Sa,"P",{});var gl=s(zo);Fg=d(gl,"This is the configuration class to store the configuration of a "),Nd=a(gl,"A",{href:!0});var vx=s(Nd);zg=d(vx,"BartModel"),vx.forEach(t),qg=d(gl,`. It is used to instantiate a BART
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the BART
`),Ns=a(gl,"A",{href:!0,rel:!0});var Tx=s(Ns);Bg=d(Tx,"facebook/bart-large"),Tx.forEach(t),jg=d(gl," architecture."),gl.forEach(t),Eg=p(Sa),qo=a(Sa,"P",{});var bl=s(qo);Cg=d(bl,"Configuration objects inherit from "),Ld=a(bl,"A",{href:!0});var wx=s(Ld);Ag=d(wx,"PretrainedConfig"),wx.forEach(t),Mg=d(bl,` and can be used to control the model outputs. Read the
documentation from `),Dd=a(bl,"A",{href:!0});var xx=s(Dd);Pg=d(xx,"PretrainedConfig"),xx.forEach(t),Sg=d(bl," for more information."),bl.forEach(t),Ig=p(Sa),v(mn.$$.fragment,Sa),Sa.forEach(t),Uu=p(o),Bo=a(o,"H2",{class:!0});var Bh=s(Bo);_n=a(Bh,"A",{id:!0,class:!0,href:!0});var $x=s(_n);rc=a($x,"SPAN",{});var Fx=s(rc);v(Ls.$$.fragment,Fx),Fx.forEach(t),$x.forEach(t),Og=p(Bh),ic=a(Bh,"SPAN",{});var zx=s(ic);Ng=d(zx,"BartTokenizer"),zx.forEach(t),Bh.forEach(t),Ru=p(o),D=a(o,"DIV",{class:!0});var ne=s(D);v(Ds.$$.fragment,ne),Lg=p(ne),dc=a(ne,"P",{});var qx=s(dc);Dg=d(qx,"Constructs a BART tokenizer, which is smilar to the ROBERTa tokenizer, using byte-level Byte-Pair-Encoding."),qx.forEach(t),Gg=p(ne),lc=a(ne,"P",{});var Bx=s(lc);Wg=d(Bx,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Bx.forEach(t),Ug=p(ne),v(gn.$$.fragment,ne),Rg=p(ne),Gs=a(ne,"P",{});var jh=s(Gs);Hg=d(jh,"You can get around that behavior by passing "),cc=a(jh,"CODE",{});var jx=s(cc);Qg=d(jx,"add_prefix_space=True"),jx.forEach(t),Vg=d(jh,` 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.`),jh.forEach(t),Kg=p(ne),v(bn.$$.fragment,ne),Jg=p(ne),Ws=a(ne,"P",{});var Eh=s(Ws);Xg=d(Eh,"This tokenizer inherits from "),Gd=a(Eh,"A",{href:!0});var Ex=s(Gd);Zg=d(Ex,"PreTrainedTokenizer"),Ex.forEach(t),Yg=d(Eh,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Eh.forEach(t),eb=p(ne),so=a(ne,"DIV",{class:!0});var kl=s(so);v(Us.$$.fragment,kl),tb=p(kl),pc=a(kl,"P",{});var Cx=s(pc);ob=d(Cx,`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:`),Cx.forEach(t),nb=p(kl),Rs=a(kl,"UL",{});var Ch=s(Rs);Wd=a(Ch,"LI",{});var e2=s(Wd);ab=d(e2,"single sequence: "),uc=a(e2,"CODE",{});var Ax=s(uc);sb=d(Ax,"<s> X </s>"),Ax.forEach(t),e2.forEach(t),rb=p(Ch),Ud=a(Ch,"LI",{});var t2=s(Ud);ib=d(t2,"pair of sequences: "),hc=a(t2,"CODE",{});var Mx=s(hc);db=d(Mx,"<s> A </s></s> B </s>"),Mx.forEach(t),t2.forEach(t),Ch.forEach(t),kl.forEach(t),lb=p(ne),kn=a(ne,"DIV",{class:!0});var Ah=s(kn);v(Hs.$$.fragment,Ah),cb=p(Ah),fc=a(Ah,"P",{});var Px=s(fc);pb=d(Px,"Converts a sequence of tokens (string) in a single string."),Px.forEach(t),Ah.forEach(t),ub=p(ne),yn=a(ne,"DIV",{class:!0});var Mh=s(yn);v(Qs.$$.fragment,Mh),hb=p(Mh),mc=a(Mh,"P",{});var Sx=s(mc);fb=d(Sx,`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.`),Sx.forEach(t),Mh.forEach(t),mb=p(ne),vn=a(ne,"DIV",{class:!0});var Ph=s(vn);v(Vs.$$.fragment,Ph),_b=p(Ph),Ks=a(Ph,"P",{});var Sh=s(Ks);gb=d(Sh,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),_c=a(Sh,"CODE",{});var Ix=s(_c);bb=d(Ix,"prepare_for_model"),Ix.forEach(t),kb=d(Sh," method."),Sh.forEach(t),Ph.forEach(t),ne.forEach(t),Hu=p(o),jo=a(o,"H2",{class:!0});var Ih=s(jo);Tn=a(Ih,"A",{id:!0,class:!0,href:!0});var Ox=s(Tn);gc=a(Ox,"SPAN",{});var Nx=s(gc);v(Js.$$.fragment,Nx),Nx.forEach(t),Ox.forEach(t),yb=p(Ih),bc=a(Ih,"SPAN",{});var Lx=s(bc);vb=d(Lx,"BartTokenizerFast"),Lx.forEach(t),Ih.forEach(t),Qu=p(o),me=a(o,"DIV",{class:!0});var Ge=s(me);v(Xs.$$.fragment,Ge),Tb=p(Ge),Zs=a(Ge,"P",{});var Oh=s(Zs);wb=d(Oh,"Construct a \u201Cfast\u201D BART tokenizer (backed by HuggingFace\u2019s "),kc=a(Oh,"EM",{});var Dx=s(kc);xb=d(Dx,"tokenizers"),Dx.forEach(t),$b=d(Oh,` library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.`),Oh.forEach(t),Fb=p(Ge),yc=a(Ge,"P",{});var Gx=s(yc);zb=d(Gx,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Gx.forEach(t),qb=p(Ge),v(wn.$$.fragment,Ge),Bb=p(Ge),Ys=a(Ge,"P",{});var Nh=s(Ys);jb=d(Nh,"You can get around that behavior by passing "),vc=a(Nh,"CODE",{});var Wx=s(vc);Eb=d(Wx,"add_prefix_space=True"),Wx.forEach(t),Cb=d(Nh,` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),Nh.forEach(t),Ab=p(Ge),v(xn.$$.fragment,Ge),Mb=p(Ge),er=a(Ge,"P",{});var Lh=s(er);Pb=d(Lh,"This tokenizer inherits from "),Rd=a(Lh,"A",{href:!0});var Ux=s(Rd);Sb=d(Ux,"PreTrainedTokenizerFast"),Ux.forEach(t),Ib=d(Lh,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Lh.forEach(t),Ob=p(Ge),$n=a(Ge,"DIV",{class:!0});var Dh=s($n);v(tr.$$.fragment,Dh),Nb=p(Dh),Tc=a(Dh,"P",{});var Rx=s(Tc);Lb=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),Dh.forEach(t),Ge.forEach(t),Vu=p(o),Eo=a(o,"H2",{class:!0});var Gh=s(Eo);Fn=a(Gh,"A",{id:!0,class:!0,href:!0});var Hx=s(Fn);wc=a(Hx,"SPAN",{});var Qx=s(wc);v(or.$$.fragment,Qx),Qx.forEach(t),Hx.forEach(t),Db=p(Gh),xc=a(Gh,"SPAN",{});var Vx=s(xc);Gb=d(Vx,"BartModel"),Vx.forEach(t),Gh.forEach(t),Ku=p(o),yt=a(o,"DIV",{class:!0});var Ia=s(yt);v(nr.$$.fragment,Ia),Wb=p(Ia),ar=a(Ia,"P",{});var Wh=s(ar);Ub=d(Wh,`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Hd=a(Wh,"A",{href:!0});var Kx=s(Hd);Rb=d(Kx,"PreTrainedModel"),Kx.forEach(t),Hb=d(Wh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Wh.forEach(t),Qb=p(Ia),sr=a(Ia,"P",{});var Uh=s(sr);Vb=d(Uh,"This model is also a PyTorch "),rr=a(Uh,"A",{href:!0,rel:!0});var Jx=s(rr);Kb=d(Jx,"torch.nn.Module"),Jx.forEach(t),Jb=d(Uh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Uh.forEach(t),Xb=p(Ia),Ct=a(Ia,"DIV",{class:!0});var Oa=s(Ct);v(ir.$$.fragment,Oa),Zb=p(Oa),Co=a(Oa,"P",{});var yl=s(Co);Yb=d(yl,"The "),Qd=a(yl,"A",{href:!0});var Xx=s(Qd);ek=d(Xx,"BartModel"),Xx.forEach(t),tk=d(yl," forward method, overrides the "),$c=a(yl,"CODE",{});var Zx=s($c);ok=d(Zx,"__call__"),Zx.forEach(t),nk=d(yl," special method."),yl.forEach(t),ak=p(Oa),v(zn.$$.fragment,Oa),sk=p(Oa),v(qn.$$.fragment,Oa),Oa.forEach(t),Ia.forEach(t),Ju=p(o),Ao=a(o,"H2",{class:!0});var Rh=s(Ao);Bn=a(Rh,"A",{id:!0,class:!0,href:!0});var Yx=s(Bn);Fc=a(Yx,"SPAN",{});var e$=s(Fc);v(dr.$$.fragment,e$),e$.forEach(t),Yx.forEach(t),rk=p(Rh),zc=a(Rh,"SPAN",{});var t$=s(zc);ik=d(t$,"BartForConditionalGeneration"),t$.forEach(t),Rh.forEach(t),Xu=p(o),vt=a(o,"DIV",{class:!0});var Na=s(vt);v(lr.$$.fragment,Na),dk=p(Na),cr=a(Na,"P",{});var Hh=s(cr);lk=d(Hh,`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),Vd=a(Hh,"A",{href:!0});var o$=s(Vd);ck=d(o$,"PreTrainedModel"),o$.forEach(t),pk=d(Hh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Hh.forEach(t),uk=p(Na),pr=a(Na,"P",{});var Qh=s(pr);hk=d(Qh,"This model is also a PyTorch "),ur=a(Qh,"A",{href:!0,rel:!0});var n$=s(ur);fk=d(n$,"torch.nn.Module"),n$.forEach(t),mk=d(Qh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Qh.forEach(t),_k=p(Na),ft=a(Na,"DIV",{class:!0});var co=s(ft);v(hr.$$.fragment,co),gk=p(co),Mo=a(co,"P",{});var vl=s(Mo);bk=d(vl,"The "),Kd=a(vl,"A",{href:!0});var a$=s(Kd);kk=d(a$,"BartForConditionalGeneration"),a$.forEach(t),yk=d(vl," forward method, overrides the "),qc=a(vl,"CODE",{});var s$=s(qc);vk=d(s$,"__call__"),s$.forEach(t),Tk=d(vl," special method."),vl.forEach(t),wk=p(co),v(jn.$$.fragment,co),xk=p(co),v(En.$$.fragment,co),$k=p(co),v(Cn.$$.fragment,co),co.forEach(t),Na.forEach(t),Zu=p(o),Po=a(o,"H2",{class:!0});var Vh=s(Po);An=a(Vh,"A",{id:!0,class:!0,href:!0});var r$=s(An);Bc=a(r$,"SPAN",{});var i$=s(Bc);v(fr.$$.fragment,i$),i$.forEach(t),r$.forEach(t),Fk=p(Vh),jc=a(Vh,"SPAN",{});var d$=s(jc);zk=d(d$,"BartForSequenceClassification"),d$.forEach(t),Vh.forEach(t),Yu=p(o),ot=a(o,"DIV",{class:!0});var po=s(ot);v(mr.$$.fragment,po),qk=p(po),Ec=a(po,"P",{});var l$=s(Ec);Bk=d(l$,`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),l$.forEach(t),jk=p(po),_r=a(po,"P",{});var Kh=s(_r);Ek=d(Kh,"This model inherits from "),Jd=a(Kh,"A",{href:!0});var c$=s(Jd);Ck=d(c$,"PreTrainedModel"),c$.forEach(t),Ak=d(Kh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Kh.forEach(t),Mk=p(po),gr=a(po,"P",{});var Jh=s(gr);Pk=d(Jh,"This model is also a PyTorch "),br=a(Jh,"A",{href:!0,rel:!0});var p$=s(br);Sk=d(p$,"torch.nn.Module"),p$.forEach(t),Ik=d(Jh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jh.forEach(t),Ok=p(po),mt=a(po,"DIV",{class:!0});var uo=s(mt);v(kr.$$.fragment,uo),Nk=p(uo),So=a(uo,"P",{});var Tl=s(So);Lk=d(Tl,"The "),Xd=a(Tl,"A",{href:!0});var u$=s(Xd);Dk=d(u$,"BartForSequenceClassification"),u$.forEach(t),Gk=d(Tl," forward method, overrides the "),Cc=a(Tl,"CODE",{});var h$=s(Cc);Wk=d(h$,"__call__"),h$.forEach(t),Uk=d(Tl," special method."),Tl.forEach(t),Rk=p(uo),v(Mn.$$.fragment,uo),Hk=p(uo),v(Pn.$$.fragment,uo),Qk=p(uo),v(Sn.$$.fragment,uo),uo.forEach(t),po.forEach(t),eh=p(o),Io=a(o,"H2",{class:!0});var Xh=s(Io);In=a(Xh,"A",{id:!0,class:!0,href:!0});var f$=s(In);Ac=a(f$,"SPAN",{});var m$=s(Ac);v(yr.$$.fragment,m$),m$.forEach(t),f$.forEach(t),Vk=p(Xh),Mc=a(Xh,"SPAN",{});var _$=s(Mc);Kk=d(_$,"BartForQuestionAnswering"),_$.forEach(t),Xh.forEach(t),th=p(o),nt=a(o,"DIV",{class:!0});var ho=s(nt);v(vr.$$.fragment,ho),Jk=p(ho),Oo=a(ho,"P",{});var wl=s(Oo);Xk=d(wl,`BART Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),Pc=a(wl,"CODE",{});var g$=s(Pc);Zk=d(g$,"span start logits"),g$.forEach(t),Yk=d(wl," and "),Sc=a(wl,"CODE",{});var b$=s(Sc);ey=d(b$,"span end logits"),b$.forEach(t),ty=d(wl,")."),wl.forEach(t),oy=p(ho),Tr=a(ho,"P",{});var Zh=s(Tr);ny=d(Zh,"This model inherits from "),Zd=a(Zh,"A",{href:!0});var k$=s(Zd);ay=d(k$,"PreTrainedModel"),k$.forEach(t),sy=d(Zh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zh.forEach(t),ry=p(ho),wr=a(ho,"P",{});var Yh=s(wr);iy=d(Yh,"This model is also a PyTorch "),xr=a(Yh,"A",{href:!0,rel:!0});var y$=s(xr);dy=d(y$,"torch.nn.Module"),y$.forEach(t),ly=d(Yh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Yh.forEach(t),cy=p(ho),At=a(ho,"DIV",{class:!0});var La=s(At);v($r.$$.fragment,La),py=p(La),No=a(La,"P",{});var xl=s(No);uy=d(xl,"The "),Yd=a(xl,"A",{href:!0});var v$=s(Yd);hy=d(v$,"BartForQuestionAnswering"),v$.forEach(t),fy=d(xl," forward method, overrides the "),Ic=a(xl,"CODE",{});var T$=s(Ic);my=d(T$,"__call__"),T$.forEach(t),_y=d(xl," special method."),xl.forEach(t),gy=p(La),v(On.$$.fragment,La),by=p(La),v(Nn.$$.fragment,La),La.forEach(t),ho.forEach(t),oh=p(o),Lo=a(o,"H2",{class:!0});var ef=s(Lo);Ln=a(ef,"A",{id:!0,class:!0,href:!0});var w$=s(Ln);Oc=a(w$,"SPAN",{});var x$=s(Oc);v(Fr.$$.fragment,x$),x$.forEach(t),w$.forEach(t),ky=p(ef),Nc=a(ef,"SPAN",{});var $$=s(Nc);yy=d($$,"BartForCausalLM"),$$.forEach(t),ef.forEach(t),nh=p(o),at=a(o,"DIV",{class:!0});var fo=s(at);v(zr.$$.fragment,fo),vy=p(fo),Lc=a(fo,"P",{});var F$=s(Lc);Ty=d(F$,"BART decoder with with a language modeling head on top (linear layer with weights tied to the input embeddings)."),F$.forEach(t),wy=p(fo),qr=a(fo,"P",{});var tf=s(qr);xy=d(tf,"This model inherits from "),el=a(tf,"A",{href:!0});var z$=s(el);$y=d(z$,"PreTrainedModel"),z$.forEach(t),Fy=d(tf,`. 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.)`),tf.forEach(t),zy=p(fo),Br=a(fo,"P",{});var of=s(Br);qy=d(of,"This model is also a PyTorch "),jr=a(of,"A",{href:!0,rel:!0});var q$=s(jr);By=d(q$,"torch.nn.Module"),q$.forEach(t),jy=d(of,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),of.forEach(t),Ey=p(fo),Dn=a(fo,"DIV",{class:!0});var nf=s(Dn);v(Er.$$.fragment,nf),Cy=p(nf),v(Gn.$$.fragment,nf),nf.forEach(t),fo.forEach(t),ah=p(o),Do=a(o,"H2",{class:!0});var af=s(Do);Wn=a(af,"A",{id:!0,class:!0,href:!0});var B$=s(Wn);Dc=a(B$,"SPAN",{});var j$=s(Dc);v(Cr.$$.fragment,j$),j$.forEach(t),B$.forEach(t),Ay=p(af),Gc=a(af,"SPAN",{});var E$=s(Gc);My=d(E$,"TFBartModel"),E$.forEach(t),af.forEach(t),sh=p(o),st=a(o,"DIV",{class:!0});var mo=s(st);v(Ar.$$.fragment,mo),Py=p(mo),Mr=a(mo,"P",{});var sf=s(Mr);Sy=d(sf,`The bare BART Model outputting raw hidden-states without any specific head on top.
This model inherits from `),tl=a(sf,"A",{href:!0});var C$=s(tl);Iy=d(C$,"TFPreTrainedModel"),C$.forEach(t),Oy=d(sf,`. 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.)`),sf.forEach(t),Ny=p(mo),Pr=a(mo,"P",{});var rf=s(Pr);Ly=d(rf,"This model is also a "),Sr=a(rf,"A",{href:!0,rel:!0});var A$=s(Sr);Dy=d(A$,"tf.keras.Model"),A$.forEach(t),Gy=d(rf,` 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.`),rf.forEach(t),Wy=p(mo),v(Un.$$.fragment,mo),Uy=p(mo),Mt=a(mo,"DIV",{class:!0});var Da=s(Mt);v(Ir.$$.fragment,Da),Ry=p(Da),Go=a(Da,"P",{});var $l=s(Go);Hy=d($l,"The "),ol=a($l,"A",{href:!0});var M$=s(ol);Qy=d(M$,"TFBartModel"),M$.forEach(t),Vy=d($l," forward method, overrides the "),Wc=a($l,"CODE",{});var P$=s(Wc);Ky=d(P$,"__call__"),P$.forEach(t),Jy=d($l," special method."),$l.forEach(t),Xy=p(Da),v(Rn.$$.fragment,Da),Zy=p(Da),v(Hn.$$.fragment,Da),Da.forEach(t),mo.forEach(t),rh=p(o),Wo=a(o,"H2",{class:!0});var df=s(Wo);Qn=a(df,"A",{id:!0,class:!0,href:!0});var S$=s(Qn);Uc=a(S$,"SPAN",{});var I$=s(Uc);v(Or.$$.fragment,I$),I$.forEach(t),S$.forEach(t),Yy=p(df),Rc=a(df,"SPAN",{});var O$=s(Rc);ev=d(O$,"TFBartForConditionalGeneration"),O$.forEach(t),df.forEach(t),ih=p(o),rt=a(o,"DIV",{class:!0});var _o=s(rt);v(Nr.$$.fragment,_o),tv=p(_o),Lr=a(_o,"P",{});var lf=s(Lr);ov=d(lf,`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),nl=a(lf,"A",{href:!0});var N$=s(nl);nv=d(N$,"TFPreTrainedModel"),N$.forEach(t),av=d(lf,`. 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.)`),lf.forEach(t),sv=p(_o),Dr=a(_o,"P",{});var cf=s(Dr);rv=d(cf,"This model is also a "),Gr=a(cf,"A",{href:!0,rel:!0});var L$=s(Gr);iv=d(L$,"tf.keras.Model"),L$.forEach(t),dv=d(cf,` 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.`),cf.forEach(t),lv=p(_o),v(Vn.$$.fragment,_o),cv=p(_o),_t=a(_o,"DIV",{class:!0});var go=s(_t);v(Wr.$$.fragment,go),pv=p(go),Uo=a(go,"P",{});var Fl=s(Uo);uv=d(Fl,"The "),al=a(Fl,"A",{href:!0});var D$=s(al);hv=d(D$,"TFBartForConditionalGeneration"),D$.forEach(t),fv=d(Fl," forward method, overrides the "),Hc=a(Fl,"CODE",{});var G$=s(Hc);mv=d(G$,"__call__"),G$.forEach(t),_v=d(Fl," special method."),Fl.forEach(t),gv=p(go),v(Kn.$$.fragment,go),bv=p(go),v(Jn.$$.fragment,go),kv=p(go),v(Xn.$$.fragment,go),go.forEach(t),_o.forEach(t),dh=p(o),Ro=a(o,"H2",{class:!0});var pf=s(Ro);Zn=a(pf,"A",{id:!0,class:!0,href:!0});var W$=s(Zn);Qc=a(W$,"SPAN",{});var U$=s(Qc);v(Ur.$$.fragment,U$),U$.forEach(t),W$.forEach(t),yv=p(pf),Vc=a(pf,"SPAN",{});var R$=s(Vc);vv=d(R$,"TFBartForSequenceClassification"),R$.forEach(t),pf.forEach(t),lh=p(o),Pe=a(o,"DIV",{class:!0});var Nt=s(Pe);v(Rr.$$.fragment,Nt),Tv=p(Nt),Kc=a(Nt,"P",{});var H$=s(Kc);wv=d(H$,`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),H$.forEach(t),xv=p(Nt),Hr=a(Nt,"P",{});var uf=s(Hr);$v=d(uf,"This model inherits from "),sl=a(uf,"A",{href:!0});var Q$=s(sl);Fv=d(Q$,"TFPreTrainedModel"),Q$.forEach(t),zv=d(uf,`. 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.)`),uf.forEach(t),qv=p(Nt),Qr=a(Nt,"P",{});var hf=s(Qr);Bv=d(hf,"This model is also a "),Vr=a(hf,"A",{href:!0,rel:!0});var V$=s(Vr);jv=d(V$,"tf.keras.Model"),V$.forEach(t),Ev=d(hf,` 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.`),hf.forEach(t),Cv=p(Nt),v(Yn.$$.fragment,Nt),Av=p(Nt),ro=a(Nt,"DIV",{class:!0});var zl=s(ro);v(Kr.$$.fragment,zl),Mv=p(zl),Ho=a(zl,"P",{});var ql=s(Ho);Pv=d(ql,"The "),rl=a(ql,"A",{href:!0});var K$=s(rl);Sv=d(K$,"TFBartForSequenceClassification"),K$.forEach(t),Iv=d(ql," forward method, overrides the "),Jc=a(ql,"CODE",{});var J$=s(Jc);Ov=d(J$,"__call__"),J$.forEach(t),Nv=d(ql," special method."),ql.forEach(t),Lv=p(zl),v(ea.$$.fragment,zl),zl.forEach(t),Nt.forEach(t),ch=p(o),Qo=a(o,"H2",{class:!0});var ff=s(Qo);ta=a(ff,"A",{id:!0,class:!0,href:!0});var X$=s(ta);Xc=a(X$,"SPAN",{});var Z$=s(Xc);v(Jr.$$.fragment,Z$),Z$.forEach(t),X$.forEach(t),Dv=p(ff),Zc=a(ff,"SPAN",{});var Y$=s(Zc);Gv=d(Y$,"FlaxBartModel"),Y$.forEach(t),ff.forEach(t),ph=p(o),_e=a(o,"DIV",{class:!0});var We=s(_e);v(Xr.$$.fragment,We),Wv=p(We),Zr=a(We,"P",{});var mf=s(Zr);Uv=d(mf,`The bare Bart Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),il=a(mf,"A",{href:!0});var eF=s(il);Rv=d(eF,"FlaxPreTrainedModel"),eF.forEach(t),Hv=d(mf,`. 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.)`),mf.forEach(t),Qv=p(We),Yr=a(We,"P",{});var _f=s(Yr);Vv=d(_f,`This model is also a Flax Linen
`),ei=a(_f,"A",{href:!0,rel:!0});var tF=s(ei);Kv=d(tF,"flax.nn.Module"),tF.forEach(t),Jv=d(_f,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),_f.forEach(t),Xv=p(We),Yc=a(We,"P",{});var oF=s(Yc);Zv=d(oF,"Finally, this model supports inherent JAX features such as:"),oF.forEach(t),Yv=p(We),Gt=a(We,"UL",{});var Ga=s(Gt);ep=a(Ga,"LI",{});var nF=s(ep);ti=a(nF,"A",{href:!0,rel:!0});var aF=s(ti);eT=d(aF,"Just-In-Time (JIT) compilation"),aF.forEach(t),nF.forEach(t),tT=p(Ga),tp=a(Ga,"LI",{});var sF=s(tp);oi=a(sF,"A",{href:!0,rel:!0});var rF=s(oi);oT=d(rF,"Automatic Differentiation"),rF.forEach(t),sF.forEach(t),nT=p(Ga),op=a(Ga,"LI",{});var iF=s(op);ni=a(iF,"A",{href:!0,rel:!0});var dF=s(ni);aT=d(dF,"Vectorization"),dF.forEach(t),iF.forEach(t),sT=p(Ga),np=a(Ga,"LI",{});var lF=s(np);ai=a(lF,"A",{href:!0,rel:!0});var cF=s(ai);rT=d(cF,"Parallelization"),cF.forEach(t),lF.forEach(t),Ga.forEach(t),iT=p(We),Pt=a(We,"DIV",{class:!0});var Wa=s(Pt);v(si.$$.fragment,Wa),dT=p(Wa),Vo=a(Wa,"P",{});var Bl=s(Vo);lT=d(Bl,"The "),ap=a(Bl,"CODE",{});var pF=s(ap);cT=d(pF,"FlaxBartPreTrainedModel"),pF.forEach(t),pT=d(Bl," forward method, overrides the "),sp=a(Bl,"CODE",{});var uF=s(sp);uT=d(uF,"__call__"),uF.forEach(t),hT=d(Bl," special method."),Bl.forEach(t),fT=p(Wa),v(oa.$$.fragment,Wa),mT=p(Wa),v(na.$$.fragment,Wa),Wa.forEach(t),_T=p(We),aa=a(We,"DIV",{class:!0});var gf=s(aa);v(ri.$$.fragment,gf),gT=p(gf),v(sa.$$.fragment,gf),gf.forEach(t),bT=p(We),ra=a(We,"DIV",{class:!0});var bf=s(ra);v(ii.$$.fragment,bf),kT=p(bf),v(ia.$$.fragment,bf),bf.forEach(t),We.forEach(t),uh=p(o),Ko=a(o,"H2",{class:!0});var kf=s(Ko);da=a(kf,"A",{id:!0,class:!0,href:!0});var hF=s(da);rp=a(hF,"SPAN",{});var fF=s(rp);v(di.$$.fragment,fF),fF.forEach(t),hF.forEach(t),yT=p(kf),ip=a(kf,"SPAN",{});var mF=s(ip);vT=d(mF,"FlaxBartForConditionalGeneration"),mF.forEach(t),kf.forEach(t),hh=p(o),ge=a(o,"DIV",{class:!0});var Ue=s(ge);v(li.$$.fragment,Ue),TT=p(Ue),ci=a(Ue,"P",{});var yf=s(ci);wT=d(yf,`The BART Model with a language modeling head. Can be used for summarization.
This model inherits from `),dl=a(yf,"A",{href:!0});var _F=s(dl);xT=d(_F,"FlaxPreTrainedModel"),_F.forEach(t),$T=d(yf,`. 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.)`),yf.forEach(t),FT=p(Ue),pi=a(Ue,"P",{});var vf=s(pi);zT=d(vf,`This model is also a Flax Linen
`),ui=a(vf,"A",{href:!0,rel:!0});var gF=s(ui);qT=d(gF,"flax.nn.Module"),gF.forEach(t),BT=d(vf,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),vf.forEach(t),jT=p(Ue),dp=a(Ue,"P",{});var bF=s(dp);ET=d(bF,"Finally, this model supports inherent JAX features such as:"),bF.forEach(t),CT=p(Ue),Wt=a(Ue,"UL",{});var Ua=s(Wt);lp=a(Ua,"LI",{});var kF=s(lp);hi=a(kF,"A",{href:!0,rel:!0});var yF=s(hi);AT=d(yF,"Just-In-Time (JIT) compilation"),yF.forEach(t),kF.forEach(t),MT=p(Ua),cp=a(Ua,"LI",{});var vF=s(cp);fi=a(vF,"A",{href:!0,rel:!0});var TF=s(fi);PT=d(TF,"Automatic Differentiation"),TF.forEach(t),vF.forEach(t),ST=p(Ua),pp=a(Ua,"LI",{});var wF=s(pp);mi=a(wF,"A",{href:!0,rel:!0});var xF=s(mi);IT=d(xF,"Vectorization"),xF.forEach(t),wF.forEach(t),OT=p(Ua),up=a(Ua,"LI",{});var $F=s(up);_i=a($F,"A",{href:!0,rel:!0});var FF=s(_i);NT=d(FF,"Parallelization"),FF.forEach(t),$F.forEach(t),Ua.forEach(t),LT=p(Ue),gt=a(Ue,"DIV",{class:!0});var bo=s(gt);v(gi.$$.fragment,bo),DT=p(bo),Jo=a(bo,"P",{});var jl=s(Jo);GT=d(jl,"The "),hp=a(jl,"CODE",{});var zF=s(hp);WT=d(zF,"FlaxBartPreTrainedModel"),zF.forEach(t),UT=d(jl," forward method, overrides the "),fp=a(jl,"CODE",{});var qF=s(fp);RT=d(qF,"__call__"),qF.forEach(t),HT=d(jl," special method."),jl.forEach(t),QT=p(bo),v(la.$$.fragment,bo),VT=p(bo),v(ca.$$.fragment,bo),KT=p(bo),v(pa.$$.fragment,bo),bo.forEach(t),JT=p(Ue),ua=a(Ue,"DIV",{class:!0});var Tf=s(ua);v(bi.$$.fragment,Tf),XT=p(Tf),v(ha.$$.fragment,Tf),Tf.forEach(t),ZT=p(Ue),fa=a(Ue,"DIV",{class:!0});var wf=s(fa);v(ki.$$.fragment,wf),YT=p(wf),v(ma.$$.fragment,wf),wf.forEach(t),Ue.forEach(t),fh=p(o),Xo=a(o,"H2",{class:!0});var xf=s(Xo);_a=a(xf,"A",{id:!0,class:!0,href:!0});var BF=s(_a);mp=a(BF,"SPAN",{});var jF=s(mp);v(yi.$$.fragment,jF),jF.forEach(t),BF.forEach(t),e1=p(xf),_p=a(xf,"SPAN",{});var EF=s(_p);t1=d(EF,"FlaxBartForSequenceClassification"),EF.forEach(t),xf.forEach(t),mh=p(o),J=a(o,"DIV",{class:!0});var je=s(J);v(vi.$$.fragment,je),o1=p(je),gp=a(je,"P",{});var CF=s(gp);n1=d(CF,`Bart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
tasks.`),CF.forEach(t),a1=p(je),Ti=a(je,"P",{});var $f=s(Ti);s1=d($f,"This model inherits from "),ll=a($f,"A",{href:!0});var AF=s(ll);r1=d(AF,"FlaxPreTrainedModel"),AF.forEach(t),i1=d($f,`. 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.)`),$f.forEach(t),d1=p(je),wi=a(je,"P",{});var Ff=s(wi);l1=d(Ff,`This model is also a Flax Linen
`),xi=a(Ff,"A",{href:!0,rel:!0});var MF=s(xi);c1=d(MF,"flax.nn.Module"),MF.forEach(t),p1=d(Ff,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Ff.forEach(t),u1=p(je),bp=a(je,"P",{});var PF=s(bp);h1=d(PF,"Finally, this model supports inherent JAX features such as:"),PF.forEach(t),f1=p(je),Ut=a(je,"UL",{});var Ra=s(Ut);kp=a(Ra,"LI",{});var SF=s(kp);$i=a(SF,"A",{href:!0,rel:!0});var IF=s($i);m1=d(IF,"Just-In-Time (JIT) compilation"),IF.forEach(t),SF.forEach(t),_1=p(Ra),yp=a(Ra,"LI",{});var OF=s(yp);Fi=a(OF,"A",{href:!0,rel:!0});var NF=s(Fi);g1=d(NF,"Automatic Differentiation"),NF.forEach(t),OF.forEach(t),b1=p(Ra),vp=a(Ra,"LI",{});var LF=s(vp);zi=a(LF,"A",{href:!0,rel:!0});var DF=s(zi);k1=d(DF,"Vectorization"),DF.forEach(t),LF.forEach(t),y1=p(Ra),Tp=a(Ra,"LI",{});var GF=s(Tp);qi=a(GF,"A",{href:!0,rel:!0});var WF=s(qi);v1=d(WF,"Parallelization"),WF.forEach(t),GF.forEach(t),Ra.forEach(t),T1=p(je),St=a(je,"DIV",{class:!0});var Ha=s(St);v(Bi.$$.fragment,Ha),w1=p(Ha),Zo=a(Ha,"P",{});var El=s(Zo);x1=d(El,"The "),wp=a(El,"CODE",{});var UF=s(wp);$1=d(UF,"FlaxBartPreTrainedModel"),UF.forEach(t),F1=d(El," forward method, overrides the "),xp=a(El,"CODE",{});var RF=s(xp);z1=d(RF,"__call__"),RF.forEach(t),q1=d(El," special method."),El.forEach(t),B1=p(Ha),v(ga.$$.fragment,Ha),j1=p(Ha),v(ba.$$.fragment,Ha),Ha.forEach(t),E1=p(je),ka=a(je,"DIV",{class:!0});var zf=s(ka);v(ji.$$.fragment,zf),C1=p(zf),v(ya.$$.fragment,zf),zf.forEach(t),A1=p(je),va=a(je,"DIV",{class:!0});var qf=s(va);v(Ei.$$.fragment,qf),M1=p(qf),v(Ta.$$.fragment,qf),qf.forEach(t),je.forEach(t),_h=p(o),Yo=a(o,"H2",{class:!0});var Bf=s(Yo);wa=a(Bf,"A",{id:!0,class:!0,href:!0});var HF=s(wa);$p=a(HF,"SPAN",{});var QF=s($p);v(Ci.$$.fragment,QF),QF.forEach(t),HF.forEach(t),P1=p(Bf),Fp=a(Bf,"SPAN",{});var VF=s(Fp);S1=d(VF,"FlaxBartForQuestionAnswering"),VF.forEach(t),Bf.forEach(t),gh=p(o),X=a(o,"DIV",{class:!0});var Ee=s(X);v(Ai.$$.fragment,Ee),I1=p(Ee),en=a(Ee,"P",{});var Cl=s(en);O1=d(Cl,`BART Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layer on top of the hidden-states output to compute `),zp=a(Cl,"CODE",{});var KF=s(zp);N1=d(KF,"span start logits"),KF.forEach(t),L1=d(Cl," and "),qp=a(Cl,"CODE",{});var JF=s(qp);D1=d(JF,"span end logits"),JF.forEach(t),G1=d(Cl,")."),Cl.forEach(t),W1=p(Ee),Mi=a(Ee,"P",{});var jf=s(Mi);U1=d(jf,"This model inherits from "),cl=a(jf,"A",{href:!0});var XF=s(cl);R1=d(XF,"FlaxPreTrainedModel"),XF.forEach(t),H1=d(jf,`. 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.)`),jf.forEach(t),Q1=p(Ee),Pi=a(Ee,"P",{});var Ef=s(Pi);V1=d(Ef,`This model is also a Flax Linen
`),Si=a(Ef,"A",{href:!0,rel:!0});var ZF=s(Si);K1=d(ZF,"flax.nn.Module"),ZF.forEach(t),J1=d(Ef,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Ef.forEach(t),X1=p(Ee),Bp=a(Ee,"P",{});var YF=s(Bp);Z1=d(YF,"Finally, this model supports inherent JAX features such as:"),YF.forEach(t),Y1=p(Ee),Rt=a(Ee,"UL",{});var Qa=s(Rt);jp=a(Qa,"LI",{});var e0=s(jp);Ii=a(e0,"A",{href:!0,rel:!0});var t0=s(Ii);ew=d(t0,"Just-In-Time (JIT) compilation"),t0.forEach(t),e0.forEach(t),tw=p(Qa),Ep=a(Qa,"LI",{});var o0=s(Ep);Oi=a(o0,"A",{href:!0,rel:!0});var n0=s(Oi);ow=d(n0,"Automatic Differentiation"),n0.forEach(t),o0.forEach(t),nw=p(Qa),Cp=a(Qa,"LI",{});var a0=s(Cp);Ni=a(a0,"A",{href:!0,rel:!0});var s0=s(Ni);aw=d(s0,"Vectorization"),s0.forEach(t),a0.forEach(t),sw=p(Qa),Ap=a(Qa,"LI",{});var r0=s(Ap);Li=a(r0,"A",{href:!0,rel:!0});var i0=s(Li);rw=d(i0,"Parallelization"),i0.forEach(t),r0.forEach(t),Qa.forEach(t),iw=p(Ee),It=a(Ee,"DIV",{class:!0});var Va=s(It);v(Di.$$.fragment,Va),dw=p(Va),tn=a(Va,"P",{});var Al=s(tn);lw=d(Al,"The "),Mp=a(Al,"CODE",{});var d0=s(Mp);cw=d(d0,"FlaxBartPreTrainedModel"),d0.forEach(t),pw=d(Al," forward method, overrides the "),Pp=a(Al,"CODE",{});var l0=s(Pp);uw=d(l0,"__call__"),l0.forEach(t),hw=d(Al," special method."),Al.forEach(t),fw=p(Va),v(xa.$$.fragment,Va),mw=p(Va),v($a.$$.fragment,Va),Va.forEach(t),_w=p(Ee),Fa=a(Ee,"DIV",{class:!0});var Cf=s(Fa);v(Gi.$$.fragment,Cf),gw=p(Cf),v(za.$$.fragment,Cf),Cf.forEach(t),bw=p(Ee),qa=a(Ee,"DIV",{class:!0});var Af=s(qa);v(Wi.$$.fragment,Af),kw=p(Af),v(Ba.$$.fragment,Af),Af.forEach(t),Ee.forEach(t),bh=p(o),on=a(o,"H2",{class:!0});var Mf=s(on);ja=a(Mf,"A",{id:!0,class:!0,href:!0});var c0=s(ja);Sp=a(c0,"SPAN",{});var p0=s(Sp);v(Ui.$$.fragment,p0),p0.forEach(t),c0.forEach(t),yw=p(Mf),Ip=a(Mf,"SPAN",{});var u0=s(Ip);vw=d(u0,"FlaxBartForCausalLM"),u0.forEach(t),Mf.forEach(t),kh=p(o),xe=a(o,"DIV",{class:!0});var bt=s(xe);v(Ri.$$.fragment,bt),Tw=p(bt),Op=a(bt,"P",{});var h0=s(Op);ww=d(h0,`Bart Decoder Model with a language modeling head on top (linear layer with weights tied to the input embeddings)
e.g for autoregressive tasks.`),h0.forEach(t),xw=p(bt),Hi=a(bt,"P",{});var Pf=s(Hi);$w=d(Pf,"This model inherits from "),pl=a(Pf,"A",{href:!0});var f0=s(pl);Fw=d(f0,"FlaxPreTrainedModel"),f0.forEach(t),zw=d(Pf,`. 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.)`),Pf.forEach(t),qw=p(bt),Qi=a(bt,"P",{});var Sf=s(Qi);Bw=d(Sf,`This model is also a Flax Linen
`),Vi=a(Sf,"A",{href:!0,rel:!0});var m0=s(Vi);jw=d(m0,"flax.nn.Module"),m0.forEach(t),Ew=d(Sf,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Sf.forEach(t),Cw=p(bt),Np=a(bt,"P",{});var _0=s(Np);Aw=d(_0,"Finally, this model supports inherent JAX features such as:"),_0.forEach(t),Mw=p(bt),Ht=a(bt,"UL",{});var Ka=s(Ht);Lp=a(Ka,"LI",{});var g0=s(Lp);Ki=a(g0,"A",{href:!0,rel:!0});var b0=s(Ki);Pw=d(b0,"Just-In-Time (JIT) compilation"),b0.forEach(t),g0.forEach(t),Sw=p(Ka),Dp=a(Ka,"LI",{});var k0=s(Dp);Ji=a(k0,"A",{href:!0,rel:!0});var y0=s(Ji);Iw=d(y0,"Automatic Differentiation"),y0.forEach(t),k0.forEach(t),Ow=p(Ka),Gp=a(Ka,"LI",{});var v0=s(Gp);Xi=a(v0,"A",{href:!0,rel:!0});var T0=s(Xi);Nw=d(T0,"Vectorization"),T0.forEach(t),v0.forEach(t),Lw=p(Ka),Wp=a(Ka,"LI",{});var w0=s(Wp);Zi=a(w0,"A",{href:!0,rel:!0});var x0=s(Zi);Dw=d(x0,"Parallelization"),x0.forEach(t),w0.forEach(t),Ka.forEach(t),Gw=p(bt),Ot=a(bt,"DIV",{class:!0});var Ja=s(Ot);v(Yi.$$.fragment,Ja),Ww=p(Ja),nn=a(Ja,"P",{});var Ml=s(nn);Uw=d(Ml,"The "),Up=a(Ml,"CODE",{});var $0=s(Up);Rw=d($0,"FlaxBartDecoderPreTrainedModel"),$0.forEach(t),Hw=d(Ml," forward method, overrides the "),Rp=a(Ml,"CODE",{});var F0=s(Rp);Qw=d(F0,"__call__"),F0.forEach(t),Vw=d(Ml," special method."),Ml.forEach(t),Kw=p(Ja),v(Ea.$$.fragment,Ja),Jw=p(Ja),v(Ca.$$.fragment,Ja),Ja.forEach(t),bt.forEach(t),this.h()},h(){u(l,"name","hf:doc:metadata"),u(l,"content",JSON.stringify(xz)),u(f,"id","bart"),u(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(f,"href","#bart"),u(m,"class","relative group"),u(ie,"alt","Models"),z0(ie.src,B="https://img.shields.io/badge/All_model_pages-bart-blueviolet")||u(ie,"src",B),u(re,"href","https://huggingface.co/models?filter=bart"),u($e,"alt","Spaces"),z0($e.src,it="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||u($e,"src",it),u(V,"href","https://huggingface.co/spaces/docs-demos/bart-large-mnli"),u(I,"class","flex flex-wrap space-x-1"),u(we,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),u(we,"rel","nofollow"),u(be,"id","overview"),u(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(be,"href","#overview"),u(N,"class","relative group"),u(Q,"href","https://arxiv.org/abs/1910.13461"),u(Q,"rel","nofollow"),u(Xa,"href","https://huggingface.co/sshleifer"),u(Xa,"rel","nofollow"),u(Za,"href","https://github.com/pytorch/fairseq/tree/master/examples/bart"),u(Za,"rel","nofollow"),u(dn,"id","examples"),u(dn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(dn,"href","#examples"),u(ko,"class","relative group"),u(ts,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization/README.md"),u(ts,"rel","nofollow"),u(md,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(os,"href","https://discuss.huggingface.co/t/train-bart-for-conditional-generation-e-g-summarization/1904"),u(os,"rel","nofollow"),u(ns,"href","https://huggingface.co/models?search=distilbart"),u(ns,"rel","nofollow"),u(as,"href","https://arxiv.org/abs/2010.13002"),u(as,"rel","nofollow"),u(cn,"id","implementation-notes"),u(cn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(cn,"href","#implementation-notes"),u(yo,"class","relative group"),u(_d,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartTokenizer"),u(gd,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode"),u(bd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartModel"),u(yd,"href","/docs/transformers/v4.27.1/en/main_classes/text_generation#transformers.GenerationMixin.generate"),u(pn,"id","mask-filling"),u(pn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(pn,"href","#mask-filling"),u(xo,"class","relative group"),u(un,"id","resources"),u(un,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(un,"href","#resources"),u($o,"class","relative group"),u(ps,"href","https://huggingface.co/blog/sagemaker-distributed-training-seq2seq"),u(ps,"rel","nofollow"),u(hs,"href","https://colab.research.google.com/github/ohmeow/ohmeow_website/blob/master/posts/2021-05-25-mbart-sequence-classification-with-blurr.ipynb"),u(hs,"rel","nofollow"),u(ms,"href","https://colab.research.google.com/github/elsanns/xai-nlp-notebooks/blob/master/fine_tune_bart_summarization_two_langs.ipynb"),u(ms,"rel","nofollow"),u(Td,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(_s,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization"),u(_s,"rel","nofollow"),u(gs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization.ipynb"),u(gs,"rel","nofollow"),u(wd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),u(bs,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/summarization"),u(bs,"rel","nofollow"),u(ks,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization-tf.ipynb"),u(ks,"rel","nofollow"),u(xd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.FlaxBartForConditionalGeneration"),u(ys,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/summarization"),u(ys,"rel","nofollow"),u(vs,"href","https://huggingface.co/course/chapter7/5?fw=pt#summarization"),u(vs,"rel","nofollow"),u(Fd,"href","./tasks/summarization"),u(zd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(ws,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#robertabertdistilbert-and-masked-language-modeling"),u(ws,"rel","nofollow"),u(xs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb"),u(xs,"rel","nofollow"),u(qd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),u($s,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_mlmpy"),u($s,"rel","nofollow"),u(Fs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb"),u(Fs,"rel","nofollow"),u(Bd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.FlaxBartForConditionalGeneration"),u(zs,"href","https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#masked-language-modeling"),u(zs,"rel","nofollow"),u(qs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/masked_language_modeling_flax.ipynb"),u(qs,"rel","nofollow"),u(Bs,"href","https://huggingface.co/course/chapter7/3?fw=pt"),u(Bs,"rel","nofollow"),u(Ed,"href","./tasks/masked_language_modeling"),u(Cs,"href","https://colab.research.google.com/github/vasudevgupta7/huggingface-tutorials/blob/main/translation_training.ipynb"),u(Cs,"rel","nofollow"),u(Cd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(As,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/translation"),u(As,"rel","nofollow"),u(Ms,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation.ipynb"),u(Ms,"rel","nofollow"),u(Ad,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),u(Ps,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/translation"),u(Ps,"rel","nofollow"),u(Ss,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation-tf.ipynb"),u(Ss,"rel","nofollow"),u(Md,"href","./tasks/translation"),u(Sd,"href","./tasks/sequence_classification"),u(Id,"href","./tasks/question_answering"),u(Od,"href","./tasks/language_modeling"),u(fn,"id","transformers.BartConfig"),u(fn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(fn,"href","#transformers.BartConfig"),u(Fo,"class","relative group"),u(Nd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartModel"),u(Ns,"href","https://huggingface.co/facebook/bart-large"),u(Ns,"rel","nofollow"),u(Ld,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),u(Dd,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),u(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(_n,"id","transformers.BartTokenizer"),u(_n,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(_n,"href","#transformers.BartTokenizer"),u(Bo,"class","relative group"),u(Gd,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),u(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(kn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(yn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(vn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Tn,"id","transformers.BartTokenizerFast"),u(Tn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Tn,"href","#transformers.BartTokenizerFast"),u(jo,"class","relative group"),u(Rd,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),u($n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Fn,"id","transformers.BartModel"),u(Fn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Fn,"href","#transformers.BartModel"),u(Eo,"class","relative group"),u(Hd,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),u(rr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(rr,"rel","nofollow"),u(Qd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartModel"),u(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Bn,"id","transformers.BartForConditionalGeneration"),u(Bn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Bn,"href","#transformers.BartForConditionalGeneration"),u(Ao,"class","relative group"),u(Vd,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),u(ur,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(ur,"rel","nofollow"),u(Kd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartForConditionalGeneration"),u(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(An,"id","transformers.BartForSequenceClassification"),u(An,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(An,"href","#transformers.BartForSequenceClassification"),u(Po,"class","relative group"),u(Jd,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),u(br,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(br,"rel","nofollow"),u(Xd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartForSequenceClassification"),u(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(In,"id","transformers.BartForQuestionAnswering"),u(In,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(In,"href","#transformers.BartForQuestionAnswering"),u(Io,"class","relative group"),u(Zd,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),u(xr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(xr,"rel","nofollow"),u(Yd,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.BartForQuestionAnswering"),u(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Ln,"id","transformers.BartForCausalLM"),u(Ln,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Ln,"href","#transformers.BartForCausalLM"),u(Lo,"class","relative group"),u(el,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),u(jr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(jr,"rel","nofollow"),u(Dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Wn,"id","transformers.TFBartModel"),u(Wn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Wn,"href","#transformers.TFBartModel"),u(Do,"class","relative group"),u(tl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),u(Sr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Sr,"rel","nofollow"),u(ol,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.TFBartModel"),u(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Qn,"id","transformers.TFBartForConditionalGeneration"),u(Qn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Qn,"href","#transformers.TFBartForConditionalGeneration"),u(Wo,"class","relative group"),u(nl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),u(Gr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Gr,"rel","nofollow"),u(al,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.TFBartForConditionalGeneration"),u(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Zn,"id","transformers.TFBartForSequenceClassification"),u(Zn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Zn,"href","#transformers.TFBartForSequenceClassification"),u(Ro,"class","relative group"),u(sl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),u(Vr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(Vr,"rel","nofollow"),u(rl,"href","/docs/transformers/v4.27.1/en/model_doc/bart#transformers.TFBartForSequenceClassification"),u(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ta,"id","transformers.FlaxBartModel"),u(ta,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(ta,"href","#transformers.FlaxBartModel"),u(Qo,"class","relative group"),u(il,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(ei,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(ei,"rel","nofollow"),u(ti,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(ti,"rel","nofollow"),u(oi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(oi,"rel","nofollow"),u(ni,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(ni,"rel","nofollow"),u(ai,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(ai,"rel","nofollow"),u(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ra,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(da,"id","transformers.FlaxBartForConditionalGeneration"),u(da,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(da,"href","#transformers.FlaxBartForConditionalGeneration"),u(Ko,"class","relative group"),u(dl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(ui,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(ui,"rel","nofollow"),u(hi,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(hi,"rel","nofollow"),u(fi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(fi,"rel","nofollow"),u(mi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(mi,"rel","nofollow"),u(_i,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(_i,"rel","nofollow"),u(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ua,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(fa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(_a,"id","transformers.FlaxBartForSequenceClassification"),u(_a,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(_a,"href","#transformers.FlaxBartForSequenceClassification"),u(Xo,"class","relative group"),u(ll,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(xi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(xi,"rel","nofollow"),u($i,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u($i,"rel","nofollow"),u(Fi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Fi,"rel","nofollow"),u(zi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(zi,"rel","nofollow"),u(qi,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(qi,"rel","nofollow"),u(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ka,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(va,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(wa,"id","transformers.FlaxBartForQuestionAnswering"),u(wa,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(wa,"href","#transformers.FlaxBartForQuestionAnswering"),u(Yo,"class","relative group"),u(cl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(Si,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(Si,"rel","nofollow"),u(Ii,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(Ii,"rel","nofollow"),u(Oi,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Oi,"rel","nofollow"),u(Ni,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(Ni,"rel","nofollow"),u(Li,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(Li,"rel","nofollow"),u(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(Fa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(qa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ja,"id","transformers.FlaxBartForCausalLM"),u(ja,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(ja,"href","#transformers.FlaxBartForCausalLM"),u(on,"class","relative group"),u(pl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),u(Vi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),u(Vi,"rel","nofollow"),u(Ki,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),u(Ki,"rel","nofollow"),u(Ji,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),u(Ji,"rel","nofollow"),u(Xi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),u(Xi,"rel","nofollow"),u(Zi,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),u(Zi,"rel","nofollow"),u(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,_){e(document.head,l),g(o,k,_),g(o,m,_),e(m,f),e(f,b),T(r,b,null),e(m,h),e(m,q),e(q,se),g(o,H,_),g(o,I,_),e(I,re),e(re,ie),e(I,Re),e(I,V),e(V,$e),g(o,Z,_),g(o,de,_),e(de,Ce),e(Ce,le),e(de,He),e(de,we),e(we,ce),e(de,Qe),g(o,Ie,_),g(o,N,_),e(N,be),e(be,Ae),T(Y,Ae,null),e(N,A),e(N,M),e(M,Ve),g(o,ee,_),g(o,ke,_),e(ke,Ke),e(ke,Q),e(Q,Je),e(ke,Xe),g(o,P,_),g(o,Fe,_),e(Fe,pe),g(o,Oe,_),g(o,te,_),e(te,K),e(K,Ze),e(te,Ye),e(te,U),e(U,et),e(te,ue),e(te,Me),e(Me,ze),g(o,S,_),g(o,qe,_),e(qe,L),g(o,Ne,_),g(o,ye,_),e(ye,F),e(F,j),e(j,wt),e(ye,Be),e(ye,Le),e(Le,dt),e(dt,E),e(Le,xt),e(Le,oe),e(oe,lt),e(lt,$t),e(oe,Ft),e(oe,R),e(R,he),e(oe,zt),e(oe,ct),e(ct,fe),e(oe,qt),e(oe,pt),e(pt,tt),e(oe,Bt),e(oe,ve),e(ve,jt),g(o,xu,_),g(o,Vt,_),e(Vt,If),e(Vt,Xa),e(Xa,Of),e(Vt,Nf),e(Vt,Za),e(Za,Lf),e(Vt,Df),g(o,$u,_),g(o,ko,_),e(ko,dn),e(dn,Pl),T(Ya,Pl,null),e(ko,Gf),e(ko,Sl),e(Sl,Wf),g(o,Fu,_),g(o,Kt,_),e(Kt,es),e(es,Uf),e(es,ts),e(ts,Rf),e(es,Hf),e(Kt,Qf),e(Kt,Lt),e(Lt,Vf),e(Lt,md),e(md,Kf),e(Lt,Jf),e(Lt,Il),e(Il,Xf),e(Lt,Zf),e(Lt,os),e(os,Yf),e(Lt,em),e(Kt,tm),e(Kt,ln),e(ln,ns),e(ns,om),e(ln,nm),e(ln,as),e(as,am),e(ln,sm),g(o,zu,_),g(o,yo,_),e(yo,cn),e(cn,Ol),T(ss,Ol,null),e(yo,rm),e(yo,Nl),e(Nl,im),g(o,qu,_),g(o,ut,_),e(ut,Dt),e(Dt,dm),e(Dt,Ll),e(Ll,lm),e(Dt,cm),e(Dt,_d),e(_d,pm),e(Dt,um),e(Dt,gd),e(gd,hm),e(Dt,fm),e(ut,mm),e(ut,vo),e(vo,_m),e(vo,bd),e(bd,gm),e(vo,bm),e(vo,Dl),e(Dl,km),e(vo,ym),e(ut,vm),e(ut,To),e(To,Tm),e(To,Gl),e(Gl,wm),e(To,xm),e(To,Wl),e(Wl,$m),e(To,Fm),e(ut,zm),e(ut,kd),e(kd,yd),e(yd,qm),e(kd,Bm),e(ut,jm),e(ut,wo),e(wo,Em),e(wo,Ul),e(Ul,Cm),e(wo,Am),e(wo,Rl),e(Rl,Mm),e(wo,Pm),g(o,Bu,_),g(o,xo,_),e(xo,pn),e(pn,Hl),T(rs,Hl,null),e(xo,Sm),e(xo,Ql),e(Ql,Im),g(o,ju,_),g(o,Jt,_),e(Jt,Om),e(Jt,Vl),e(Vl,Nm),e(Jt,Lm),e(Jt,Kl),e(Kl,Dm),e(Jt,Gm),g(o,Eu,_),T(is,o,_),g(o,Cu,_),g(o,$o,_),e($o,un),e(un,Jl),T(ds,Jl,null),e($o,Wm),e($o,Xl),e(Xl,Um),g(o,Au,_),g(o,vd,_),e(vd,Rm),g(o,Mu,_),T(ls,o,_),g(o,Pu,_),g(o,Te,_),e(Te,cs),e(cs,Hm),e(cs,ps),e(ps,Qm),e(cs,Vm),e(Te,Km),e(Te,us),e(us,Jm),e(us,hs),e(hs,Xm),e(us,Zm),e(Te,Ym),e(Te,fs),e(fs,e_),e(fs,ms),e(ms,t_),e(fs,o_),e(Te,n_),e(Te,Xt),e(Xt,Td),e(Td,a_),e(Xt,s_),e(Xt,_s),e(_s,r_),e(Xt,i_),e(Xt,gs),e(gs,d_),e(Xt,l_),e(Te,c_),e(Te,Zt),e(Zt,wd),e(wd,p_),e(Zt,u_),e(Zt,bs),e(bs,h_),e(Zt,f_),e(Zt,ks),e(ks,m_),e(Zt,__),e(Te,g_),e(Te,hn),e(hn,xd),e(xd,b_),e(hn,k_),e(hn,ys),e(ys,y_),e(hn,v_),e(Te,T_),e(Te,$d),e($d,vs),e(vs,w_),e($d,x_),e(Te,$_),e(Te,Zl),e(Zl,Fd),e(Fd,F_),g(o,Su,_),T(Ts,o,_),g(o,Iu,_),g(o,ht,_),e(ht,Yt),e(Yt,zd),e(zd,z_),e(Yt,q_),e(Yt,ws),e(ws,B_),e(Yt,j_),e(Yt,xs),e(xs,E_),e(Yt,C_),e(ht,A_),e(ht,eo),e(eo,qd),e(qd,M_),e(eo,P_),e(eo,$s),e($s,S_),e(eo,I_),e(eo,Fs),e(Fs,O_),e(eo,N_),e(ht,L_),e(ht,to),e(to,Bd),e(Bd,D_),e(to,G_),e(to,zs),e(zs,W_),e(to,U_),e(to,qs),e(qs,R_),e(to,H_),e(ht,Q_),e(ht,jd),e(jd,Bs),e(Bs,V_),e(jd,K_),e(ht,J_),e(ht,Yl),e(Yl,Ed),e(Ed,X_),g(o,Ou,_),T(js,o,_),g(o,Nu,_),g(o,Et,_),e(Et,Es),e(Es,Z_),e(Es,Cs),e(Cs,Y_),e(Es,eg),e(Et,tg),e(Et,oo),e(oo,Cd),e(Cd,og),e(oo,ng),e(oo,As),e(As,ag),e(oo,sg),e(oo,Ms),e(Ms,rg),e(oo,ig),e(Et,dg),e(Et,no),e(no,Ad),e(Ad,lg),e(no,cg),e(no,Ps),e(Ps,pg),e(no,ug),e(no,Ss),e(Ss,hg),e(no,fg),e(Et,mg),e(Et,ec),e(ec,Md),e(Md,_g),g(o,Lu,_),g(o,Pd,_),e(Pd,gg),g(o,Du,_),g(o,ao,_),e(ao,tc),e(tc,Sd),e(Sd,bg),e(ao,kg),e(ao,oc),e(oc,Id),e(Id,yg),e(ao,vg),e(ao,nc),e(nc,Od),e(Od,Tg),g(o,Gu,_),g(o,Fo,_),e(Fo,fn),e(fn,ac),T(Is,ac,null),e(Fo,wg),e(Fo,sc),e(sc,xg),g(o,Wu,_),g(o,kt,_),T(Os,kt,null),e(kt,$g),e(kt,zo),e(zo,Fg),e(zo,Nd),e(Nd,zg),e(zo,qg),e(zo,Ns),e(Ns,Bg),e(zo,jg),e(kt,Eg),e(kt,qo),e(qo,Cg),e(qo,Ld),e(Ld,Ag),e(qo,Mg),e(qo,Dd),e(Dd,Pg),e(qo,Sg),e(kt,Ig),T(mn,kt,null),g(o,Uu,_),g(o,Bo,_),e(Bo,_n),e(_n,rc),T(Ls,rc,null),e(Bo,Og),e(Bo,ic),e(ic,Ng),g(o,Ru,_),g(o,D,_),T(Ds,D,null),e(D,Lg),e(D,dc),e(dc,Dg),e(D,Gg),e(D,lc),e(lc,Wg),e(D,Ug),T(gn,D,null),e(D,Rg),e(D,Gs),e(Gs,Hg),e(Gs,cc),e(cc,Qg),e(Gs,Vg),e(D,Kg),T(bn,D,null),e(D,Jg),e(D,Ws),e(Ws,Xg),e(Ws,Gd),e(Gd,Zg),e(Ws,Yg),e(D,eb),e(D,so),T(Us,so,null),e(so,tb),e(so,pc),e(pc,ob),e(so,nb),e(so,Rs),e(Rs,Wd),e(Wd,ab),e(Wd,uc),e(uc,sb),e(Rs,rb),e(Rs,Ud),e(Ud,ib),e(Ud,hc),e(hc,db),e(D,lb),e(D,kn),T(Hs,kn,null),e(kn,cb),e(kn,fc),e(fc,pb),e(D,ub),e(D,yn),T(Qs,yn,null),e(yn,hb),e(yn,mc),e(mc,fb),e(D,mb),e(D,vn),T(Vs,vn,null),e(vn,_b),e(vn,Ks),e(Ks,gb),e(Ks,_c),e(_c,bb),e(Ks,kb),g(o,Hu,_),g(o,jo,_),e(jo,Tn),e(Tn,gc),T(Js,gc,null),e(jo,yb),e(jo,bc),e(bc,vb),g(o,Qu,_),g(o,me,_),T(Xs,me,null),e(me,Tb),e(me,Zs),e(Zs,wb),e(Zs,kc),e(kc,xb),e(Zs,$b),e(me,Fb),e(me,yc),e(yc,zb),e(me,qb),T(wn,me,null),e(me,Bb),e(me,Ys),e(Ys,jb),e(Ys,vc),e(vc,Eb),e(Ys,Cb),e(me,Ab),T(xn,me,null),e(me,Mb),e(me,er),e(er,Pb),e(er,Rd),e(Rd,Sb),e(er,Ib),e(me,Ob),e(me,$n),T(tr,$n,null),e($n,Nb),e($n,Tc),e(Tc,Lb),g(o,Vu,_),g(o,Eo,_),e(Eo,Fn),e(Fn,wc),T(or,wc,null),e(Eo,Db),e(Eo,xc),e(xc,Gb),g(o,Ku,_),g(o,yt,_),T(nr,yt,null),e(yt,Wb),e(yt,ar),e(ar,Ub),e(ar,Hd),e(Hd,Rb),e(ar,Hb),e(yt,Qb),e(yt,sr),e(sr,Vb),e(sr,rr),e(rr,Kb),e(sr,Jb),e(yt,Xb),e(yt,Ct),T(ir,Ct,null),e(Ct,Zb),e(Ct,Co),e(Co,Yb),e(Co,Qd),e(Qd,ek),e(Co,tk),e(Co,$c),e($c,ok),e(Co,nk),e(Ct,ak),T(zn,Ct,null),e(Ct,sk),T(qn,Ct,null),g(o,Ju,_),g(o,Ao,_),e(Ao,Bn),e(Bn,Fc),T(dr,Fc,null),e(Ao,rk),e(Ao,zc),e(zc,ik),g(o,Xu,_),g(o,vt,_),T(lr,vt,null),e(vt,dk),e(vt,cr),e(cr,lk),e(cr,Vd),e(Vd,ck),e(cr,pk),e(vt,uk),e(vt,pr),e(pr,hk),e(pr,ur),e(ur,fk),e(pr,mk),e(vt,_k),e(vt,ft),T(hr,ft,null),e(ft,gk),e(ft,Mo),e(Mo,bk),e(Mo,Kd),e(Kd,kk),e(Mo,yk),e(Mo,qc),e(qc,vk),e(Mo,Tk),e(ft,wk),T(jn,ft,null),e(ft,xk),T(En,ft,null),e(ft,$k),T(Cn,ft,null),g(o,Zu,_),g(o,Po,_),e(Po,An),e(An,Bc),T(fr,Bc,null),e(Po,Fk),e(Po,jc),e(jc,zk),g(o,Yu,_),g(o,ot,_),T(mr,ot,null),e(ot,qk),e(ot,Ec),e(Ec,Bk),e(ot,jk),e(ot,_r),e(_r,Ek),e(_r,Jd),e(Jd,Ck),e(_r,Ak),e(ot,Mk),e(ot,gr),e(gr,Pk),e(gr,br),e(br,Sk),e(gr,Ik),e(ot,Ok),e(ot,mt),T(kr,mt,null),e(mt,Nk),e(mt,So),e(So,Lk),e(So,Xd),e(Xd,Dk),e(So,Gk),e(So,Cc),e(Cc,Wk),e(So,Uk),e(mt,Rk),T(Mn,mt,null),e(mt,Hk),T(Pn,mt,null),e(mt,Qk),T(Sn,mt,null),g(o,eh,_),g(o,Io,_),e(Io,In),e(In,Ac),T(yr,Ac,null),e(Io,Vk),e(Io,Mc),e(Mc,Kk),g(o,th,_),g(o,nt,_),T(vr,nt,null),e(nt,Jk),e(nt,Oo),e(Oo,Xk),e(Oo,Pc),e(Pc,Zk),e(Oo,Yk),e(Oo,Sc),e(Sc,ey),e(Oo,ty),e(nt,oy),e(nt,Tr),e(Tr,ny),e(Tr,Zd),e(Zd,ay),e(Tr,sy),e(nt,ry),e(nt,wr),e(wr,iy),e(wr,xr),e(xr,dy),e(wr,ly),e(nt,cy),e(nt,At),T($r,At,null),e(At,py),e(At,No),e(No,uy),e(No,Yd),e(Yd,hy),e(No,fy),e(No,Ic),e(Ic,my),e(No,_y),e(At,gy),T(On,At,null),e(At,by),T(Nn,At,null),g(o,oh,_),g(o,Lo,_),e(Lo,Ln),e(Ln,Oc),T(Fr,Oc,null),e(Lo,ky),e(Lo,Nc),e(Nc,yy),g(o,nh,_),g(o,at,_),T(zr,at,null),e(at,vy),e(at,Lc),e(Lc,Ty),e(at,wy),e(at,qr),e(qr,xy),e(qr,el),e(el,$y),e(qr,Fy),e(at,zy),e(at,Br),e(Br,qy),e(Br,jr),e(jr,By),e(Br,jy),e(at,Ey),e(at,Dn),T(Er,Dn,null),e(Dn,Cy),T(Gn,Dn,null),g(o,ah,_),g(o,Do,_),e(Do,Wn),e(Wn,Dc),T(Cr,Dc,null),e(Do,Ay),e(Do,Gc),e(Gc,My),g(o,sh,_),g(o,st,_),T(Ar,st,null),e(st,Py),e(st,Mr),e(Mr,Sy),e(Mr,tl),e(tl,Iy),e(Mr,Oy),e(st,Ny),e(st,Pr),e(Pr,Ly),e(Pr,Sr),e(Sr,Dy),e(Pr,Gy),e(st,Wy),T(Un,st,null),e(st,Uy),e(st,Mt),T(Ir,Mt,null),e(Mt,Ry),e(Mt,Go),e(Go,Hy),e(Go,ol),e(ol,Qy),e(Go,Vy),e(Go,Wc),e(Wc,Ky),e(Go,Jy),e(Mt,Xy),T(Rn,Mt,null),e(Mt,Zy),T(Hn,Mt,null),g(o,rh,_),g(o,Wo,_),e(Wo,Qn),e(Qn,Uc),T(Or,Uc,null),e(Wo,Yy),e(Wo,Rc),e(Rc,ev),g(o,ih,_),g(o,rt,_),T(Nr,rt,null),e(rt,tv),e(rt,Lr),e(Lr,ov),e(Lr,nl),e(nl,nv),e(Lr,av),e(rt,sv),e(rt,Dr),e(Dr,rv),e(Dr,Gr),e(Gr,iv),e(Dr,dv),e(rt,lv),T(Vn,rt,null),e(rt,cv),e(rt,_t),T(Wr,_t,null),e(_t,pv),e(_t,Uo),e(Uo,uv),e(Uo,al),e(al,hv),e(Uo,fv),e(Uo,Hc),e(Hc,mv),e(Uo,_v),e(_t,gv),T(Kn,_t,null),e(_t,bv),T(Jn,_t,null),e(_t,kv),T(Xn,_t,null),g(o,dh,_),g(o,Ro,_),e(Ro,Zn),e(Zn,Qc),T(Ur,Qc,null),e(Ro,yv),e(Ro,Vc),e(Vc,vv),g(o,lh,_),g(o,Pe,_),T(Rr,Pe,null),e(Pe,Tv),e(Pe,Kc),e(Kc,wv),e(Pe,xv),e(Pe,Hr),e(Hr,$v),e(Hr,sl),e(sl,Fv),e(Hr,zv),e(Pe,qv),e(Pe,Qr),e(Qr,Bv),e(Qr,Vr),e(Vr,jv),e(Qr,Ev),e(Pe,Cv),T(Yn,Pe,null),e(Pe,Av),e(Pe,ro),T(Kr,ro,null),e(ro,Mv),e(ro,Ho),e(Ho,Pv),e(Ho,rl),e(rl,Sv),e(Ho,Iv),e(Ho,Jc),e(Jc,Ov),e(Ho,Nv),e(ro,Lv),T(ea,ro,null),g(o,ch,_),g(o,Qo,_),e(Qo,ta),e(ta,Xc),T(Jr,Xc,null),e(Qo,Dv),e(Qo,Zc),e(Zc,Gv),g(o,ph,_),g(o,_e,_),T(Xr,_e,null),e(_e,Wv),e(_e,Zr),e(Zr,Uv),e(Zr,il),e(il,Rv),e(Zr,Hv),e(_e,Qv),e(_e,Yr),e(Yr,Vv),e(Yr,ei),e(ei,Kv),e(Yr,Jv),e(_e,Xv),e(_e,Yc),e(Yc,Zv),e(_e,Yv),e(_e,Gt),e(Gt,ep),e(ep,ti),e(ti,eT),e(Gt,tT),e(Gt,tp),e(tp,oi),e(oi,oT),e(Gt,nT),e(Gt,op),e(op,ni),e(ni,aT),e(Gt,sT),e(Gt,np),e(np,ai),e(ai,rT),e(_e,iT),e(_e,Pt),T(si,Pt,null),e(Pt,dT),e(Pt,Vo),e(Vo,lT),e(Vo,ap),e(ap,cT),e(Vo,pT),e(Vo,sp),e(sp,uT),e(Vo,hT),e(Pt,fT),T(oa,Pt,null),e(Pt,mT),T(na,Pt,null),e(_e,_T),e(_e,aa),T(ri,aa,null),e(aa,gT),T(sa,aa,null),e(_e,bT),e(_e,ra),T(ii,ra,null),e(ra,kT),T(ia,ra,null),g(o,uh,_),g(o,Ko,_),e(Ko,da),e(da,rp),T(di,rp,null),e(Ko,yT),e(Ko,ip),e(ip,vT),g(o,hh,_),g(o,ge,_),T(li,ge,null),e(ge,TT),e(ge,ci),e(ci,wT),e(ci,dl),e(dl,xT),e(ci,$T),e(ge,FT),e(ge,pi),e(pi,zT),e(pi,ui),e(ui,qT),e(pi,BT),e(ge,jT),e(ge,dp),e(dp,ET),e(ge,CT),e(ge,Wt),e(Wt,lp),e(lp,hi),e(hi,AT),e(Wt,MT),e(Wt,cp),e(cp,fi),e(fi,PT),e(Wt,ST),e(Wt,pp),e(pp,mi),e(mi,IT),e(Wt,OT),e(Wt,up),e(up,_i),e(_i,NT),e(ge,LT),e(ge,gt),T(gi,gt,null),e(gt,DT),e(gt,Jo),e(Jo,GT),e(Jo,hp),e(hp,WT),e(Jo,UT),e(Jo,fp),e(fp,RT),e(Jo,HT),e(gt,QT),T(la,gt,null),e(gt,VT),T(ca,gt,null),e(gt,KT),T(pa,gt,null),e(ge,JT),e(ge,ua),T(bi,ua,null),e(ua,XT),T(ha,ua,null),e(ge,ZT),e(ge,fa),T(ki,fa,null),e(fa,YT),T(ma,fa,null),g(o,fh,_),g(o,Xo,_),e(Xo,_a),e(_a,mp),T(yi,mp,null),e(Xo,e1),e(Xo,_p),e(_p,t1),g(o,mh,_),g(o,J,_),T(vi,J,null),e(J,o1),e(J,gp),e(gp,n1),e(J,a1),e(J,Ti),e(Ti,s1),e(Ti,ll),e(ll,r1),e(Ti,i1),e(J,d1),e(J,wi),e(wi,l1),e(wi,xi),e(xi,c1),e(wi,p1),e(J,u1),e(J,bp),e(bp,h1),e(J,f1),e(J,Ut),e(Ut,kp),e(kp,$i),e($i,m1),e(Ut,_1),e(Ut,yp),e(yp,Fi),e(Fi,g1),e(Ut,b1),e(Ut,vp),e(vp,zi),e(zi,k1),e(Ut,y1),e(Ut,Tp),e(Tp,qi),e(qi,v1),e(J,T1),e(J,St),T(Bi,St,null),e(St,w1),e(St,Zo),e(Zo,x1),e(Zo,wp),e(wp,$1),e(Zo,F1),e(Zo,xp),e(xp,z1),e(Zo,q1),e(St,B1),T(ga,St,null),e(St,j1),T(ba,St,null),e(J,E1),e(J,ka),T(ji,ka,null),e(ka,C1),T(ya,ka,null),e(J,A1),e(J,va),T(Ei,va,null),e(va,M1),T(Ta,va,null),g(o,_h,_),g(o,Yo,_),e(Yo,wa),e(wa,$p),T(Ci,$p,null),e(Yo,P1),e(Yo,Fp),e(Fp,S1),g(o,gh,_),g(o,X,_),T(Ai,X,null),e(X,I1),e(X,en),e(en,O1),e(en,zp),e(zp,N1),e(en,L1),e(en,qp),e(qp,D1),e(en,G1),e(X,W1),e(X,Mi),e(Mi,U1),e(Mi,cl),e(cl,R1),e(Mi,H1),e(X,Q1),e(X,Pi),e(Pi,V1),e(Pi,Si),e(Si,K1),e(Pi,J1),e(X,X1),e(X,Bp),e(Bp,Z1),e(X,Y1),e(X,Rt),e(Rt,jp),e(jp,Ii),e(Ii,ew),e(Rt,tw),e(Rt,Ep),e(Ep,Oi),e(Oi,ow),e(Rt,nw),e(Rt,Cp),e(Cp,Ni),e(Ni,aw),e(Rt,sw),e(Rt,Ap),e(Ap,Li),e(Li,rw),e(X,iw),e(X,It),T(Di,It,null),e(It,dw),e(It,tn),e(tn,lw),e(tn,Mp),e(Mp,cw),e(tn,pw),e(tn,Pp),e(Pp,uw),e(tn,hw),e(It,fw),T(xa,It,null),e(It,mw),T($a,It,null),e(X,_w),e(X,Fa),T(Gi,Fa,null),e(Fa,gw),T(za,Fa,null),e(X,bw),e(X,qa),T(Wi,qa,null),e(qa,kw),T(Ba,qa,null),g(o,bh,_),g(o,on,_),e(on,ja),e(ja,Sp),T(Ui,Sp,null),e(on,yw),e(on,Ip),e(Ip,vw),g(o,kh,_),g(o,xe,_),T(Ri,xe,null),e(xe,Tw),e(xe,Op),e(Op,ww),e(xe,xw),e(xe,Hi),e(Hi,$w),e(Hi,pl),e(pl,Fw),e(Hi,zw),e(xe,qw),e(xe,Qi),e(Qi,Bw),e(Qi,Vi),e(Vi,jw),e(Qi,Ew),e(xe,Cw),e(xe,Np),e(Np,Aw),e(xe,Mw),e(xe,Ht),e(Ht,Lp),e(Lp,Ki),e(Ki,Pw),e(Ht,Sw),e(Ht,Dp),e(Dp,Ji),e(Ji,Iw),e(Ht,Ow),e(Ht,Gp),e(Gp,Xi),e(Xi,Nw),e(Ht,Lw),e(Ht,Wp),e(Wp,Zi),e(Zi,Dw),e(xe,Gw),e(xe,Ot),T(Yi,Ot,null),e(Ot,Ww),e(Ot,nn),e(nn,Uw),e(nn,Up),e(Up,Rw),e(nn,Hw),e(nn,Rp),e(Rp,Qw),e(nn,Vw),e(Ot,Kw),T(Ea,Ot,null),e(Ot,Jw),T(Ca,Ot,null),yh=!0},p(o,[_]){const ed={};_&2&&(ed.$$scope={dirty:_,ctx:o}),mn.$set(ed);const Hp={};_&2&&(Hp.$$scope={dirty:_,ctx:o}),gn.$set(Hp);const Qp={};_&2&&(Qp.$$scope={dirty:_,ctx:o}),bn.$set(Qp);const Vp={};_&2&&(Vp.$$scope={dirty:_,ctx:o}),wn.$set(Vp);const td={};_&2&&(td.$$scope={dirty:_,ctx:o}),xn.$set(td);const Kp={};_&2&&(Kp.$$scope={dirty:_,ctx:o}),zn.$set(Kp);const Jp={};_&2&&(Jp.$$scope={dirty:_,ctx:o}),qn.$set(Jp);const Aa={};_&2&&(Aa.$$scope={dirty:_,ctx:o}),jn.$set(Aa);const Xp={};_&2&&(Xp.$$scope={dirty:_,ctx:o}),En.$set(Xp);const Zp={};_&2&&(Zp.$$scope={dirty:_,ctx:o}),Cn.$set(Zp);const od={};_&2&&(od.$$scope={dirty:_,ctx:o}),Mn.$set(od);const Yp={};_&2&&(Yp.$$scope={dirty:_,ctx:o}),Pn.$set(Yp);const eu={};_&2&&(eu.$$scope={dirty:_,ctx:o}),Sn.$set(eu);const tu={};_&2&&(tu.$$scope={dirty:_,ctx:o}),On.$set(tu);const nd={};_&2&&(nd.$$scope={dirty:_,ctx:o}),Nn.$set(nd);const ou={};_&2&&(ou.$$scope={dirty:_,ctx:o}),Gn.$set(ou);const nu={};_&2&&(nu.$$scope={dirty:_,ctx:o}),Un.$set(nu);const an={};_&2&&(an.$$scope={dirty:_,ctx:o}),Rn.$set(an);const au={};_&2&&(au.$$scope={dirty:_,ctx:o}),Hn.$set(au);const su={};_&2&&(su.$$scope={dirty:_,ctx:o}),Vn.$set(su);const ru={};_&2&&(ru.$$scope={dirty:_,ctx:o}),Kn.$set(ru);const iu={};_&2&&(iu.$$scope={dirty:_,ctx:o}),Jn.$set(iu);const ad={};_&2&&(ad.$$scope={dirty:_,ctx:o}),Xn.$set(ad);const du={};_&2&&(du.$$scope={dirty:_,ctx:o}),Yn.$set(du);const lu={};_&2&&(lu.$$scope={dirty:_,ctx:o}),ea.$set(lu);const sd={};_&2&&(sd.$$scope={dirty:_,ctx:o}),oa.$set(sd);const cu={};_&2&&(cu.$$scope={dirty:_,ctx:o}),na.$set(cu);const Tt={};_&2&&(Tt.$$scope={dirty:_,ctx:o}),sa.$set(Tt);const pu={};_&2&&(pu.$$scope={dirty:_,ctx:o}),ia.$set(pu);const uu={};_&2&&(uu.$$scope={dirty:_,ctx:o}),la.$set(uu);const hu={};_&2&&(hu.$$scope={dirty:_,ctx:o}),ca.$set(hu);const fu={};_&2&&(fu.$$scope={dirty:_,ctx:o}),pa.$set(fu);const mu={};_&2&&(mu.$$scope={dirty:_,ctx:o}),ha.$set(mu);const sn={};_&2&&(sn.$$scope={dirty:_,ctx:o}),ma.$set(sn);const _u={};_&2&&(_u.$$scope={dirty:_,ctx:o}),ga.$set(_u);const gu={};_&2&&(gu.$$scope={dirty:_,ctx:o}),ba.$set(gu);const rd={};_&2&&(rd.$$scope={dirty:_,ctx:o}),ya.$set(rd);const bu={};_&2&&(bu.$$scope={dirty:_,ctx:o}),Ta.$set(bu);const ku={};_&2&&(ku.$$scope={dirty:_,ctx:o}),xa.$set(ku);const yu={};_&2&&(yu.$$scope={dirty:_,ctx:o}),$a.$set(yu);const rn={};_&2&&(rn.$$scope={dirty:_,ctx:o}),za.$set(rn);const id={};_&2&&(id.$$scope={dirty:_,ctx:o}),Ba.$set(id);const vu={};_&2&&(vu.$$scope={dirty:_,ctx:o}),Ea.$set(vu);const Qt={};_&2&&(Qt.$$scope={dirty:_,ctx:o}),Ca.$set(Qt)},i(o){yh||(w(r.$$.fragment,o),w(Y.$$.fragment,o),w(Ya.$$.fragment,o),w(ss.$$.fragment,o),w(rs.$$.fragment,o),w(is.$$.fragment,o),w(ds.$$.fragment,o),w(ls.$$.fragment,o),w(Ts.$$.fragment,o),w(js.$$.fragment,o),w(Is.$$.fragment,o),w(Os.$$.fragment,o),w(mn.$$.fragment,o),w(Ls.$$.fragment,o),w(Ds.$$.fragment,o),w(gn.$$.fragment,o),w(bn.$$.fragment,o),w(Us.$$.fragment,o),w(Hs.$$.fragment,o),w(Qs.$$.fragment,o),w(Vs.$$.fragment,o),w(Js.$$.fragment,o),w(Xs.$$.fragment,o),w(wn.$$.fragment,o),w(xn.$$.fragment,o),w(tr.$$.fragment,o),w(or.$$.fragment,o),w(nr.$$.fragment,o),w(ir.$$.fragment,o),w(zn.$$.fragment,o),w(qn.$$.fragment,o),w(dr.$$.fragment,o),w(lr.$$.fragment,o),w(hr.$$.fragment,o),w(jn.$$.fragment,o),w(En.$$.fragment,o),w(Cn.$$.fragment,o),w(fr.$$.fragment,o),w(mr.$$.fragment,o),w(kr.$$.fragment,o),w(Mn.$$.fragment,o),w(Pn.$$.fragment,o),w(Sn.$$.fragment,o),w(yr.$$.fragment,o),w(vr.$$.fragment,o),w($r.$$.fragment,o),w(On.$$.fragment,o),w(Nn.$$.fragment,o),w(Fr.$$.fragment,o),w(zr.$$.fragment,o),w(Er.$$.fragment,o),w(Gn.$$.fragment,o),w(Cr.$$.fragment,o),w(Ar.$$.fragment,o),w(Un.$$.fragment,o),w(Ir.$$.fragment,o),w(Rn.$$.fragment,o),w(Hn.$$.fragment,o),w(Or.$$.fragment,o),w(Nr.$$.fragment,o),w(Vn.$$.fragment,o),w(Wr.$$.fragment,o),w(Kn.$$.fragment,o),w(Jn.$$.fragment,o),w(Xn.$$.fragment,o),w(Ur.$$.fragment,o),w(Rr.$$.fragment,o),w(Yn.$$.fragment,o),w(Kr.$$.fragment,o),w(ea.$$.fragment,o),w(Jr.$$.fragment,o),w(Xr.$$.fragment,o),w(si.$$.fragment,o),w(oa.$$.fragment,o),w(na.$$.fragment,o),w(ri.$$.fragment,o),w(sa.$$.fragment,o),w(ii.$$.fragment,o),w(ia.$$.fragment,o),w(di.$$.fragment,o),w(li.$$.fragment,o),w(gi.$$.fragment,o),w(la.$$.fragment,o),w(ca.$$.fragment,o),w(pa.$$.fragment,o),w(bi.$$.fragment,o),w(ha.$$.fragment,o),w(ki.$$.fragment,o),w(ma.$$.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(Ei.$$.fragment,o),w(Ta.$$.fragment,o),w(Ci.$$.fragment,o),w(Ai.$$.fragment,o),w(Di.$$.fragment,o),w(xa.$$.fragment,o),w($a.$$.fragment,o),w(Gi.$$.fragment,o),w(za.$$.fragment,o),w(Wi.$$.fragment,o),w(Ba.$$.fragment,o),w(Ui.$$.fragment,o),w(Ri.$$.fragment,o),w(Yi.$$.fragment,o),w(Ea.$$.fragment,o),w(Ca.$$.fragment,o),yh=!0)},o(o){x(r.$$.fragment,o),x(Y.$$.fragment,o),x(Ya.$$.fragment,o),x(ss.$$.fragment,o),x(rs.$$.fragment,o),x(is.$$.fragment,o),x(ds.$$.fragment,o),x(ls.$$.fragment,o),x(Ts.$$.fragment,o),x(js.$$.fragment,o),x(Is.$$.fragment,o),x(Os.$$.fragment,o),x(mn.$$.fragment,o),x(Ls.$$.fragment,o),x(Ds.$$.fragment,o),x(gn.$$.fragment,o),x(bn.$$.fragment,o),x(Us.$$.fragment,o),x(Hs.$$.fragment,o),x(Qs.$$.fragment,o),x(Vs.$$.fragment,o),x(Js.$$.fragment,o),x(Xs.$$.fragment,o),x(wn.$$.fragment,o),x(xn.$$.fragment,o),x(tr.$$.fragment,o),x(or.$$.fragment,o),x(nr.$$.fragment,o),x(ir.$$.fragment,o),x(zn.$$.fragment,o),x(qn.$$.fragment,o),x(dr.$$.fragment,o),x(lr.$$.fragment,o),x(hr.$$.fragment,o),x(jn.$$.fragment,o),x(En.$$.fragment,o),x(Cn.$$.fragment,o),x(fr.$$.fragment,o),x(mr.$$.fragment,o),x(kr.$$.fragment,o),x(Mn.$$.fragment,o),x(Pn.$$.fragment,o),x(Sn.$$.fragment,o),x(yr.$$.fragment,o),x(vr.$$.fragment,o),x($r.$$.fragment,o),x(On.$$.fragment,o),x(Nn.$$.fragment,o),x(Fr.$$.fragment,o),x(zr.$$.fragment,o),x(Er.$$.fragment,o),x(Gn.$$.fragment,o),x(Cr.$$.fragment,o),x(Ar.$$.fragment,o),x(Un.$$.fragment,o),x(Ir.$$.fragment,o),x(Rn.$$.fragment,o),x(Hn.$$.fragment,o),x(Or.$$.fragment,o),x(Nr.$$.fragment,o),x(Vn.$$.fragment,o),x(Wr.$$.fragment,o),x(Kn.$$.fragment,o),x(Jn.$$.fragment,o),x(Xn.$$.fragment,o),x(Ur.$$.fragment,o),x(Rr.$$.fragment,o),x(Yn.$$.fragment,o),x(Kr.$$.fragment,o),x(ea.$$.fragment,o),x(Jr.$$.fragment,o),x(Xr.$$.fragment,o),x(si.$$.fragment,o),x(oa.$$.fragment,o),x(na.$$.fragment,o),x(ri.$$.fragment,o),x(sa.$$.fragment,o),x(ii.$$.fragment,o),x(ia.$$.fragment,o),x(di.$$.fragment,o),x(li.$$.fragment,o),x(gi.$$.fragment,o),x(la.$$.fragment,o),x(ca.$$.fragment,o),x(pa.$$.fragment,o),x(bi.$$.fragment,o),x(ha.$$.fragment,o),x(ki.$$.fragment,o),x(ma.$$.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(Ei.$$.fragment,o),x(Ta.$$.fragment,o),x(Ci.$$.fragment,o),x(Ai.$$.fragment,o),x(Di.$$.fragment,o),x(xa.$$.fragment,o),x($a.$$.fragment,o),x(Gi.$$.fragment,o),x(za.$$.fragment,o),x(Wi.$$.fragment,o),x(Ba.$$.fragment,o),x(Ui.$$.fragment,o),x(Ri.$$.fragment,o),x(Yi.$$.fragment,o),x(Ea.$$.fragment,o),x(Ca.$$.fragment,o),yh=!1},d(o){t(l),o&&t(k),o&&t(m),$(r),o&&t(H),o&&t(I),o&&t(Z),o&&t(de),o&&t(Ie),o&&t(N),$(Y),o&&t(ee),o&&t(ke),o&&t(P),o&&t(Fe),o&&t(Oe),o&&t(te),o&&t(S),o&&t(qe),o&&t(Ne),o&&t(ye),o&&t(xu),o&&t(Vt),o&&t($u),o&&t(ko),$(Ya),o&&t(Fu),o&&t(Kt),o&&t(zu),o&&t(yo),$(ss),o&&t(qu),o&&t(ut),o&&t(Bu),o&&t(xo),$(rs),o&&t(ju),o&&t(Jt),o&&t(Eu),$(is,o),o&&t(Cu),o&&t($o),$(ds),o&&t(Au),o&&t(vd),o&&t(Mu),$(ls,o),o&&t(Pu),o&&t(Te),o&&t(Su),$(Ts,o),o&&t(Iu),o&&t(ht),o&&t(Ou),$(js,o),o&&t(Nu),o&&t(Et),o&&t(Lu),o&&t(Pd),o&&t(Du),o&&t(ao),o&&t(Gu),o&&t(Fo),$(Is),o&&t(Wu),o&&t(kt),$(Os),$(mn),o&&t(Uu),o&&t(Bo),$(Ls),o&&t(Ru),o&&t(D),$(Ds),$(gn),$(bn),$(Us),$(Hs),$(Qs),$(Vs),o&&t(Hu),o&&t(jo),$(Js),o&&t(Qu),o&&t(me),$(Xs),$(wn),$(xn),$(tr),o&&t(Vu),o&&t(Eo),$(or),o&&t(Ku),o&&t(yt),$(nr),$(ir),$(zn),$(qn),o&&t(Ju),o&&t(Ao),$(dr),o&&t(Xu),o&&t(vt),$(lr),$(hr),$(jn),$(En),$(Cn),o&&t(Zu),o&&t(Po),$(fr),o&&t(Yu),o&&t(ot),$(mr),$(kr),$(Mn),$(Pn),$(Sn),o&&t(eh),o&&t(Io),$(yr),o&&t(th),o&&t(nt),$(vr),$($r),$(On),$(Nn),o&&t(oh),o&&t(Lo),$(Fr),o&&t(nh),o&&t(at),$(zr),$(Er),$(Gn),o&&t(ah),o&&t(Do),$(Cr),o&&t(sh),o&&t(st),$(Ar),$(Un),$(Ir),$(Rn),$(Hn),o&&t(rh),o&&t(Wo),$(Or),o&&t(ih),o&&t(rt),$(Nr),$(Vn),$(Wr),$(Kn),$(Jn),$(Xn),o&&t(dh),o&&t(Ro),$(Ur),o&&t(lh),o&&t(Pe),$(Rr),$(Yn),$(Kr),$(ea),o&&t(ch),o&&t(Qo),$(Jr),o&&t(ph),o&&t(_e),$(Xr),$(si),$(oa),$(na),$(ri),$(sa),$(ii),$(ia),o&&t(uh),o&&t(Ko),$(di),o&&t(hh),o&&t(ge),$(li),$(gi),$(la),$(ca),$(pa),$(bi),$(ha),$(ki),$(ma),o&&t(fh),o&&t(Xo),$(yi),o&&t(mh),o&&t(J),$(vi),$(Bi),$(ga),$(ba),$(ji),$(ya),$(Ei),$(Ta),o&&t(_h),o&&t(Yo),$(Ci),o&&t(gh),o&&t(X),$(Ai),$(Di),$(xa),$($a),$(Gi),$(za),$(Wi),$(Ba),o&&t(bh),o&&t(on),$(Ui),o&&t(kh),o&&t(xe),$(Ri),$(Yi),$(Ea),$(Ca)}}}const xz={local:"bart",sections:[{local:"overview",sections:[{local:"examples",title:"Examples"}],title:"Overview"},{local:"implementation-notes",title:"Implementation Notes"},{local:"mask-filling",title:"Mask Filling"},{local:"resources",title:"Resources"},{local:"transformers.BartConfig",title:"BartConfig"},{local:"transformers.BartTokenizer",title:"BartTokenizer"},{local:"transformers.BartTokenizerFast",title:"BartTokenizerFast"},{local:"transformers.BartModel",title:"BartModel"},{local:"transformers.BartForConditionalGeneration",title:"BartForConditionalGeneration"},{local:"transformers.BartForSequenceClassification",title:"BartForSequenceClassification"},{local:"transformers.BartForQuestionAnswering",title:"BartForQuestionAnswering"},{local:"transformers.BartForCausalLM",title:"BartForCausalLM"},{local:"transformers.TFBartModel",title:"TFBartModel"},{local:"transformers.TFBartForConditionalGeneration",title:"TFBartForConditionalGeneration"},{local:"transformers.TFBartForSequenceClassification",title:"TFBartForSequenceClassification"},{local:"transformers.FlaxBartModel",title:"FlaxBartModel"},{local:"transformers.FlaxBartForConditionalGeneration",title:"FlaxBartForConditionalGeneration"},{local:"transformers.FlaxBartForSequenceClassification",title:"FlaxBartForSequenceClassification"},{local:"transformers.FlaxBartForQuestionAnswering",title:"FlaxBartForQuestionAnswering"},{local:"transformers.FlaxBartForCausalLM",title:"FlaxBartForCausalLM"}],title:"BART"};function $z(z){return C0(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Az extends q0{constructor(l){super();B0(this,l,$z,wz,j0,{})}}export{Az as default,xz as metadata};
